query_id
stringlengths
32
32
query
stringlengths
7
29.6k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
fb4c11d8db9dddca12d601590c120da6
================================================= VACIAR FORMULARIOS =================================================
[ { "docid": "623c55b3e7e2f5979402e583311ee70a", "score": "0.0", "text": "function clear_form1() {document.getElementById(\"frm_om\").reset();}", "title": "" } ]
[ { "docid": "45027279969e3e0e942014706a3bc6d8", "score": "0.62783664", "text": "function formVer(dispatch, model) {\r\n const { description, calorias, showForm } = model;\r\n if (showForm) {\r\n return form(\r\n {\r\n className: 'w-100 mv2',\r\n onsubmit: e => {\r\n //previene que envíe por met tradic (HTTP POST)\r\n //y tampoco se utilizaría este met si se tuviera un backend\r\n e.preventDefault();\r\n //se llama al dispatch\r\n dispatch(guardarComidaMsg);\r\n }\r\n },\r\n [\r\n setCampo('Comida', description,\r\n e => dispatch(comidaInputMsg(e.target.value))\r\n ),\r\n //aplicando un valor default se calorias en 0, utilizan la prop thrusty de js con pipe\r\n setCampo('Calorias', calorias || '',\r\n e => dispatch(caloriasInputMsg(e.target.value))\r\n ),\r\n //agregado los botones\r\n genboton(dispatch),\r\n ],\r\n );\r\n }\r\n return button({\r\n className: 'f3 pv2 ph3 bg-blue white bn',\r\n onclick: () => dispatch(mostrarForm(true)),\r\n },\r\n 'Agregar comida');\r\n}", "title": "" }, { "docid": "eba4bb3ac31410b76e20b76a89f2498f", "score": "0.61689353", "text": "function limpiarFormVer(){\n // resetear campos …\n $(\"#ver_foto\").html('<img class=\"img-responsive\" src=\"http://temporales.com.co/contratacion/images/foto.png\">');\n $(\"#ver_nombreEmpleado\").html(\"$nombre\");\n $(\"#ver_apellidoEmpleado\").html(\"$apellido\");\n $(\"#ver_documentoEmpleado\").html(\"$documento\");\n $(\"#ver_id_empleado\").val(\"\");\n $(\"#ver_nombre\").val(\"\");\n $(\"#ver_nombre2\").val(\"\");\n $(\"#ver_apellido\").val(\"\");\n $(\"#ver_apellido2\").val(\"\");\n $(\"#ver_tipo\").val(\"\");\n $(\"#ver_documento\").val(\"\");\n $(\"#ver_fechaExp\").val(\"\");\n $(\"#ver_ciudadExp\").val(\"\");\n $(\"#ver_fechaNac\").val(\"\");\n $(\"#ver_ciudadNac\").val(\"\");\n $(\"#ver_paisNac\").val(\"\");\n $(\"#ver_genero\").val(\"\");\n $(\"#ver_estado\").val(\"\");\n $(\"#ver_nivel\").val(\"\");\n $(\"#ver_titulo\").val(\"\");\n $(\"#ver_direccion\").val(\"\");\n $(\"#ver_barrio\").val(\"\");\n $(\"#ver_estrato\").val(\"\");\n $(\"#ver_ciudad\").val(\"\");\n $(\"#ver_telefono\").val(\"\");\n $(\"#ver_celular\").val(\"\");\n $(\"#ver_email\").val(\"\");\n $(\"#ver_etnia\").val(\"\");\n $(\"#ver_comentario\").val(\"\");\n $(\"#ver_NombreEps\").html(\"$nombre\");\n $(\"#ver_ApellidoEps\").html(\"$apellido\");\n $(\"#ver_DocumentoEps\").html(\"$documento\");\n $(\"#ver_eps\").val(\"\");\n $(\"#ver_fecha_radicacion_eps\").val(\"\");\n $(\"#ver_tipo_tramite_eps\").val(\"\");\n $(\"#ver_tipo_afiliacion_eps\").val(\"\");\n $(\"#ver_tipo_afiliado_eps\").val(\"\");\n $(\"#ver_tipo_cotizante_eps\").val(\"\");\n $(\"#ver_regimen_eps\").val(\"\");\n $(\"#ver_NombreArl\").html(\"$nombre\");\n $(\"#ver_ApellidoArl\").html(\"$apellido\");\n $(\"#ver_DocumentoArl\").html(\"$documento\");\n $(\"#ver_arl\").val( \"\" );\n $(\"#ver_fecha_afiliacion_arl\").val( \"\" );\n $(\"#ver_codigo_transaccion_arl\").val( \"\" );\n $(\"#ver_NombrePension\").html(\"$nombre\");\n $(\"#ver_ApellidoPension\").html(\"$apellido\");\n $(\"#ver_DocumentoPension\").html(\"$documento\");\n $(\"#ver_pension\").val(\"\");\n $(\"#ver_fecha_afiliacion_pension\").val(\"\");\n $(\"#ver_NombreCaja\").html(\"$nombre\");\n $(\"#ver_ApellidoCaja\").html(\"$apellido\");\n $(\"#ver_DocumentoCaja\").html(\"$documento\");\n $(\"#ver_caja\").val(\"\");\n $(\"#verDatosReferencias\").html(\"\");\n $(\".ver_id_empleado_contrato\").val(\"\");\n $(\"#ver_nombreEmpresa\").html( \"$nombre\" );\n $(\"#ver_apellidoEmpresa\").html( \"$apellido\" );\n $(\"#ver_documentoEmpresa\").html( \"$documento\" );\n $(\"#ver_empresa\").val(\"\");\n $(\"#ver_cargo\").val(\"\");\n $(\"#ver_salario\").val(\"\");\n $(\"#ver_jornada\").val(\"\");\n $(\"#ver_servicio_funerario\").val(\"\");\n $(\"#ver_banco\").val(\"\");\n $(\"#ver_cuenta\").val(\"\");\n $(\"#ver_tipo_cuenta\").val(\"\"); \n $('#mytabsVer a[href=\"#datosBasicosVer\"]').tab('show');\n}", "title": "" }, { "docid": "2d76a8f797196058f55ba4f411642506", "score": "0.6137335", "text": "function VistaAcuerdos(){\n\t //CAMPOS CABECERA MOSTRAR\n\t $(\"#No_comp\").show();\n\t $(\"#No_acuerdo\").show();\n\t $(\"#program\").show();\n\t $(\"#datediv\").show();\n\t $('#descripcion_orden').attr('rows', 5);\n\t $(\"#descdiv\").show(); //Contenedor de input descripcion\n\t $(\"#divprov\").show();\n\t $(\"#btnmodal\").show();\n\n\t //CAMPOS CABECERA OCULTAR\n\t $(\"#No_otros\").hide();\n \t $(\"#No_planilla\").hide();\n\t $(\"#sol\").hide();\n\t $(\"#No_ord\").hide();\n\t $(\"#No_fr\").hide();\n\t $(\"#No_refbancaria\").hide();\n\t $(\"#uni_sup\").hide();\n\n\t // $(\"#alertselectdoc\").hide();\n\n\t //MOSTRAR CAMPOS DETALLES\n\t $(\"#table_invoce\").show();\n\t $(\"#content_table_details\").attr(\"class\", \"col-lg-8 col-sm-8 col-md-8 col-xs-8\");\n\t $(\"#content_table_details\").show();\n\t //MOSTRAR CAMPOS DETALLES OCULTOS\n\t $(\"#content_tfoot\").hide();\n\t $(\"#th_uni\").hide();\n\t $(\"#th_descr\").hide();\n }", "title": "" }, { "docid": "795a27644957c692a6fde8893fdeb1cf", "score": "0.60118294", "text": "function limpiarDatosForms() {\n //resetear formularios\n\n $.each(inputs, function (idx, val) {\n\n $(this).val('');\n });\n $.each(inputs_, function (idx, val) {\n\n $(this).val('');\n });\n\n //mostrar todas las etiquetas\n $('label.etiqueta').show();\n\n }", "title": "" }, { "docid": "43c8fb3728a7e814a4c6ce1e9017dbf1", "score": "0.5921949", "text": "preencherForm(fruta) {\n document.getElementById(\"nomeFruta\").value = fruta.nome;\n //demais campos\n }", "title": "" }, { "docid": "224b7a8e3659168f231b19f714d5ae86", "score": "0.5903788", "text": "setFormHospedagem(context, form){\n context.commit('setFormHospedagem', form)\n }", "title": "" }, { "docid": "3777b2fc71d3f21098e087698c652f67", "score": "0.5890207", "text": "function abrirFormNuevaVacuna(){\n\t\n\t$(\"#hidden_nuevaVacuna\").show('slower');\n\t$(\"#form_nuevaVacuna\").addClass('unsavedForm');\n\t$(\"#tituloLi\").hide('slower');\n\t\n\t\n}", "title": "" }, { "docid": "47f2f8783b5c1801a308714d6ea61b48", "score": "0.5883034", "text": "function validarVistaRol(pCorreo, pFormulario){\n var indice;\n \n for(var i=0; i<aCorreos.length; i++){\n if(pCorreo==aCorreos[i]){\n indice = i;\n }\n \n }\n \n pFormulario.action = aVistasRol[indice];\n\n}", "title": "" }, { "docid": "e60ef09ce4ae80a8a1a03c382e5bb5a5", "score": "0.5878202", "text": "formView() {\n this.showForm = !this.showForm;\n this.name = \"\";\n this.email = \"\";\n this.location = \"\";\n this.primary = \"\";\n this.errors = [];\n }", "title": "" }, { "docid": "01c1b4277f60c33332070ea28ccc975e", "score": "0.5862164", "text": "function TargetaFormulario() {\n\n\tthis.$clave = $('#clave')\n\n\tthis.$equipo= $(\"#id_equipo\")\n\tthis.$observaciones = $('#id_observaciones')\n\tthis.$fecha_estimada_inicio = $('#id_fecha_estimada_inicio')\n\tthis.$fecha_estimada_fin = $('#id_fecha_estimada_fin')\n\tthis.$fecha_real_inicio = $('#id_fecha_real_inicio')\n\tthis.$fecha_real_fin = $('#id_fecha_real_fin')\n\n\tthis.$tab_actividades = $(\"#tab_actividades\")\n\tthis.$tab_materiales = $(\"#tab_materiales\")\n\tthis.$tab_servicios = $(\"#tab_servicios\")\n\tthis.$tab_mano_obra = $(\"#tab_mano_obra\")\n\n\tthis.init()\n\n}", "title": "" }, { "docid": "fb5cb7c6d60de19a658e5af7ac0f41ab", "score": "0.58361244", "text": "function cargarCgg_gem_tipo_salarioCtrls(){\nif(inRecordCgg_gem_tipo_salario){\ntxtCgtsa_codigo.setValue(inRecordCgg_gem_tipo_salario.get('CGTSA_CODIGO'));\ntxtCgtsa_nombre.setValue(inRecordCgg_gem_tipo_salario.get('CGTSA_NOMBRE'));\ntxtCgtsa_descripcion.setValue(inRecordCgg_gem_tipo_salario.get('CGTSA_DESCRIPCION'));\nisEdit = true;\n}}", "title": "" }, { "docid": "252d2473d1b856cebb26442ee9c16110", "score": "0.58119315", "text": "function formulario() {\n titulo.classList.add('show');\n titulo.classList.add('input-estilo');\n form.classList.add('grow');\n guardar.classList.add('show');\n cerrar.classList.add('show');\n cerrar.classList.add('grow');\n guardar.classList.add('boton');\n guardar.classList.add('boton:hover');\n agregar.classList.add('hide');\n }", "title": "" }, { "docid": "75ba6a83cfd146dfc9eaa80b7eb2d184", "score": "0.5810621", "text": "function setCamposVenta(entidad = VentaCtrl.getModelo()) {\n\n\t$(selCampoConsec).val(entidad.codigo);\n\t$(selCampoValorVenta).val(entidad.valorVenta);\n\t$(selCampoIvaVenta).val(entidad.ivaVenta);\n\t$(selCampoTotalVenta).val(entidad.totalVenta);\n\n\treturn;\n}", "title": "" }, { "docid": "9cb5a506b3f1c1a722afe068117ee911", "score": "0.5800487", "text": "function Formulario() {\n\n this.$id_auditores_designados = $(\"#id_auditores_designados\")\n this.$id_auditores_colaboradores = $(\"#id_auditores_colaboradores\")\n this.init_Components()\n}", "title": "" }, { "docid": "0d623b2f7345dd8df065fe029b157bab", "score": "0.57993907", "text": "function MostrarFormVivo(){\n\tformVentasVivo.style.display = \"block\";\n}", "title": "" }, { "docid": "f5121d48d4d6ea1b3d997a86469740fa", "score": "0.5795321", "text": "function init_inpt_formulario_cargar_ruta_vista_previa() {\n // listener click al boton de previsualizar\n $(\".btn-previsualizar\").on(\"click\", function () {\n formulario_cargar_ruta_limpiar_vista_previa();\n if (formulario_validar_logistica_ruta()) {\n formulario_cargar_ruta_previsualizar();\n }\n });\n}", "title": "" }, { "docid": "bac82a88a98addf8df20ae9bf2612b65", "score": "0.578254", "text": "function consultarInputs() {\n let placaVeiculo = document.getElementById(\"placaREP1\").value;\n let modeloVeiculo = document.getElementById(\"inputModelo\").value;\n let corVeiculo = document.getElementById(\"inputCor\").value;\n let valorVeiculo = document.getElementById(\"inputValor\").value;\n\n if (!placaVeiculo) {\n document.getElementById(\"notPlaca\").style.display = \"inline\";\n }\n if (!modeloVeiculo) {\n document.getElementById(\"notModelo\").style.display = \"inline\";\n }\n if (!corVeiculo) {\n document.getElementById(\"notCor\").style.display = \"inline\";\n }\n if (!valorVeiculo) {\n document.getElementById(\"notValor\").style.display = \"inline\";\n }\n\n if (!placaVeiculo || !modeloVeiculo || !corVeiculo || !valorVeiculo) {\n // nada faz / possivel alteração\n } else {\n document\n .getElementById(\"area-formulario-add\")\n .setAttribute(\"action\", \"veiculo-controller.php?acao=adicionar\");\n document.getElementById(\"btn-submit\").setAttribute(\"type\", \"submit\");\n\n let existeAtt = document.getElementById(\"btn-submit\").getAttribute(\"type\");\n\n if (existeAtt == \"submit\") {\n document.getElementById(\"btn-submit\").style.display = \"none\";\n document.getElementById(\"btn-submit-loading\").style.display = \"block\";\n }\n }\n}", "title": "" }, { "docid": "4b0b1b846edce121223a0393f0293ecf", "score": "0.57731867", "text": "function campos_vazios()\n{\n nivel_acesso = document.getElementById(\"nivel_acesso\").value;\n \n enviar = 0;\n \n \n //nivel_acesso pj\n if(nivel_acesso != 4)\n {\n //ocultando mensagens de erro pertencentes a pessoa juridica\n document.getElementById('erro_cpf_cnpj1').style.display = 'none';\n document.getElementById('erro_rg_ie1').style.display = 'none';\n document.getElementById('erro_empresa').style.display = 'none';\n document.getElementById('erro_nome_fantasia').style.display = 'none';\n document.getElementById('erro_responsavel').style.display = 'none';\n \n \n //cpf\n if(document.getElementById('cpf_cnpj').value == \"\" || document.getElementById('cpf_cnpj').value.length < 11)\n {\n document.getElementById('erro_cpf_cnpj').style.display = 'inline-block';\n document.getElementById('cpf_cnpj').style.border = \"1px solid #f00\";\n enviar = 1;\n }\n else\n {\n document.getElementById('erro_cpf_cnpj').style.display = 'none';\n document.getElementById('cpf_cnpj').style.border = \"1px solid #ccc\"; \n }\n \n \n //rg\n if(document.getElementById('rg_ie').value == \"\" || document.getElementById('rg_ie').value.length < 9)\n {\n document.getElementById('erro_rg_ie').style.display = 'inline-block';\n document.getElementById('rg_ie').style.border = \"1px solid #f00\";\n enviar = 1;\n }\n else\n {\n document.getElementById('erro_rg_ie').style.display = 'none';\n document.getElementById('rg_ie').style.border = \"1px solid #ccc\"; \n }\n \n //nome\n if(document.getElementById(\"nome_usuario\").value == \"\" || document.getElementById('nome_usuario').value.length < 5 || !isNaN(document.getElementById('nome_usuario').value))\n {\n document.getElementById('erro_nome').style.display = 'inline-block';\n document.getElementById('nome_usuario').style.border = \"1px solid #f00\";\n document.getElementById('nome_usuario').focus();\n enviar = 1;\n } \n else\n {\n document.getElementById('erro_nome').style.display = 'none';\n document.getElementById('nome_usuario').style.border = \"1px solid #ccc\"; \n }\n \n //profissao\n if(document.getElementById(\"profissao\").value == \"\" || document.getElementById('profissao').value.length < 3 || !isNaN(document.getElementById('profissao').value))\n {\n document.getElementById('erro_profissao').style.display = 'inline-block';\n document.getElementById('profissao').style.border = \"1px solid #f00\";\n document.getElementById('profissao').focus();\n enviar = 1;\n } \n else\n {\n document.getElementById('erro_profissao').style.display = 'none';\n document.getElementById('profissao').style.border = \"1px solid #ccc\"; \n }\n \n //data de nascimento\n if(document.getElementById(\"data_nascimento\").value == \"\" || document.getElementById('data_nascimento').value.length < 10)\n {\n document.getElementById('erro_data_nascimento').style.display = 'inline-block';\n document.getElementById('data_nascimento').style.border = \"1px solid #f00\";\n document.getElementById('data_nascimento').focus();\n enviar = 1;\n } \n else\n {\n document.getElementById('erro_data_nascimento').style.display = 'none';\n document.getElementById('data_nascimento').style.border = \"1px solid #ccc\"; \n }\n }\n else\n {\n //ocultando mensagens de erro pertencentes a pessoa fisica\n document.getElementById('erro_cpf_cnpj').style.display = 'none';\n document.getElementById('erro_rg_ie').style.display = 'none';\n document.getElementById('erro_nome').style.display = 'none';\n document.getElementById('erro_profissao').style.display = 'none';\n document.getElementById('erro_data_nascimento').style.display = 'none';\n \n //cnpj\n if(document.getElementById('cpf_cnpj1').value == \"\" || document.getElementById('cpf_cnpj1').value.length < 15 || isNaN(document.getElementById('cpf_cnpj1').value))\n {\n document.getElementById('erro_cpf_cnpj1').style.display = 'inline-block';\n document.getElementById('cpf_cnpj1').style.border = \"1px solid #f00\";\n enviar = 1;\n }\n else\n {\n document.getElementById('erro_cpf_cnpj1').style.display = 'none';\n document.getElementById('cpf_cnpj1').style.border = \"1px solid #ccc\"; \n }\n \n \n //ie\n if(document.getElementById('rg_ie1').value == \"\")\n {\n document.getElementById('erro_rg_ie1').style.display = 'inline-block';\n document.getElementById('rg_ie1').style.border = \"1px solid #f00\";\n enviar = 1;\n }\n else\n {\n document.getElementById('erro_rg_ie1').style.display = 'none';\n document.getElementById('rg_ie1').style.border = \"1px solid #ccc\"; \n }\n \n //empresa\n if(document.getElementById('empresa').value == \"\")\n {\n document.getElementById('erro_empresa').style.display = 'inline-block';\n document.getElementById('empresa').style.border = \"1px solid #f00\";\n enviar = 1;\n }\n else\n {\n document.getElementById('erro_empresa').style.display = 'none';\n document.getElementById('empresa').style.border = \"1px solid #ccc\"; \n }\n \n //nome fantasia\n if(document.getElementById('nome_fantasia').value == \"\")\n {\n document.getElementById('erro_nome_fantasia').style.display = 'inline-block';\n document.getElementById('nome_fantasia').style.border = \"1px solid #f00\";\n enviar = 1;\n }\n else\n {\n document.getElementById('erro_nome_fantasia').style.display = 'none';\n document.getElementById('nome_fantasia').style.border = \"1px solid #ccc\"; \n }\n \n //responsavel\n if(document.getElementById('responsavel').value == \"\")\n {\n document.getElementById('erro_responsavel').style.display = 'inline-block';\n document.getElementById('responsavel').style.border = \"1px solid #f00\";\n enviar = 1;\n }\n else\n {\n document.getElementById('erro_responsavel').style.display = 'none';\n document.getElementById('responsavel').style.border = \"1px solid #ccc\"; \n }\n }\n \n \n \n //endereco\n if(document.getElementById('endereco').value == \"\" || document.getElementById('endereco').value.length < 3)\n {\n document.getElementById('erro_endereco').style.display = 'inline-block';\n document.getElementById('endereco').style.border = \"1px solid #f00\";\n enviar = 1;\n }\n else\n {\n document.getElementById('erro_endereco').style.display = 'none';\n document.getElementById('endereco').style.border = \"1px solid #ccc\"; \n }\n \n \n //numero\n if(document.getElementById('numero').value == \"\" || isNaN(document.getElementById('numero').value))\n {\n document.getElementById('erro_numero').style.display = 'inline-block';\n document.getElementById('numero').style.border = \"1px solid #f00\";\n enviar = 1;\n }\n else\n {\n document.getElementById('erro_numero').style.display = 'none';\n document.getElementById('numero').style.border = \"1px solid #ccc\"; \n }\n\n \n //bairro\n if(document.getElementById('bairro').value == \"\")\n {\n document.getElementById('erro_bairro').style.display = 'inline-block';\n document.getElementById('bairro').style.border = \"1px solid #f00\";\n enviar = 1;\n }\n else\n {\n document.getElementById('erro_bairro').style.display = 'none';\n document.getElementById('bairro').style.border = \"1px solid #ccc\"; \n }\n \n \n //cep\n if(document.getElementById('cep').value == \"\" || document.getElementById('cep').value.length < 8 || isNaN(document.getElementById('cep').value))\n {\n document.getElementById('erro_cep').style.display = 'inline-block';\n document.getElementById('cep').style.border = \"1px solid #f00\";\n enviar = 1;\n }\n else\n {\n document.getElementById('erro_cep').style.display = 'none';\n document.getElementById('cep').style.border = \"1px solid #ccc\"; \n }\n \n \n //cidade\n if(document.getElementById('cidade').value == \"\")\n {\n document.getElementById('erro_cidade').style.display = 'inline-block';\n document.getElementById('cidade').style.border = \"1px solid #f00\";\n enviar = 1;\n }\n else\n {\n document.getElementById('erro_cidade').style.display = 'none';\n document.getElementById('cidade').style.border = \"1px solid #ccc\"; \n }\n \n //clular\n if(document.getElementById('celular').value == \"\" || document.getElementById('celular').value.length < 11 || isNaN(document.getElementById('celular').value))\n {\n document.getElementById('erro_celular').style.display = 'inline-block';\n document.getElementById('celular').style.border = \"1px solid #f00\";\n enviar = 1;\n }\n else\n {\n document.getElementById('erro_celular').style.display = 'none';\n document.getElementById('celular').style.border = \"1px solid #ccc\"; \n }\n \n //email\n email = document.getElementById('email').value;\n arroba = email.indexOf(\"@\");\n antes_arroba = email.substring(0,arroba);\n depois_arroba = email.substring(arroba+1);\n if(email == \"\") \n {\n document.getElementById('erro_email').style.display = 'inline-block'; \n document.getElementById('email').style.border = \"1px solid #f00\";\n document.getElementById('email').focus();\n enviar = 1;\n }\n else if(email != \"\" && (arroba == -1 || antes_arroba.length < 1 || depois_arroba.length < 4))\n {\n document.getElementById('erro_email').style.display = 'inline-block'; \n document.getElementById('email').style.border = \"1px solid #f00\";\n document.getElementById('email').focus();\n enviar = 1;\n }\n else\n {\n document.getElementById('erro_email').style.display = 'none';\n document.getElementById('email').style.border = \"1px solid #ccc\"; \n }\n \n \n if(enviar != 1)\n {\n document.getElementById('formul').submit();\n }\n}", "title": "" }, { "docid": "4986dc394f0a6633fd18895bb2b593be", "score": "0.5767094", "text": "function cargarCgg_veh_colorCtrls() {\r if (inRecordCgg_veh_color) {\r txtCvclr_codigo.setValue(inRecordCgg_veh_color.get('CVCLR_CODIGO'));\r txtCvclr_nombre.setValue(inRecordCgg_veh_color.get('CVCLR_NOMBRE'));\r txtCvclr_observacion.setValue(inRecordCgg_veh_color.get('CVCLR_OBSERVACION'));\r isEdit = true;\r habilitarCgg_veh_colorCtrls(true);\r }\r }", "title": "" }, { "docid": "ed0a7c9fc4f437331ab1efd88bca6589", "score": "0.57591623", "text": "function formulario_enviar_logistica_ruta() {\n var parametros = {};\n parametros.ruta = $(\"#ruta\").val();\n parametros.descripcion = $(\"#descripcion\").val();\n // color en hexa\n parametros.color = $(\"#slc-color li[aria-selected='true'] div\").attr(\"data-color\");\n\n parametros.puntos = [];\n $.each($(\"#slc-puntos-seleccionados li\"), function () {\n parametros.puntos.push($(this).attr(\"data-id\"));\n });\n\n // routing si/no\n parametros.routing = $('#checkbox-routing').prop('checked');\n\n // cargar opciones de routing\n if (parametros.routing) {\n parametros.routing_caracteristicas = {};\n\n parametros.routing_caracteristicas.vehiculo = $(\"#panel-routing > div.panel-secundario-body .btn-vehiculo.mdc-button--raised\").attr(\"data-valor\");\n\n parametros.routing_caracteristicas.evitar = [];\n $.each($(\"#panel-routing > div.panel-secundario-body .btn-excluir.mdc-button--excluir\"), function (i, item) {\n parametros.routing_caracteristicas.evitar.push($(item).attr(\"data-valor\"));\n });\n\n parametros.routing_caracteristicas.modo = \"fastest\";\n // si no es un camion leemos que elijio el usuario\n if (parametros.routing_caracteristicas.vehiculo !== \"truck\") {\n parametros.routing_caracteristicas.modo = $(\"#panel-routing > div.panel-secundario-body .btn-modo.mdc-button--raised\").attr(\"data-valor\");\n }\n\n parametros.routing_caracteristicas.trafico = $(\"#panel-routing > div.panel-secundario-body .btn-trafico.mdc-button--raised\").attr(\"data-valor\");\n\n parametros.routing_caracteristicas.grosor = (parseFloat($(\"#panel-routing #sld-grosor\").attr(\"aria-valuenow\")) / 10).toFixed(2);\n parametros.routing_caracteristicas.opacidad = (parseFloat($(\"#panel-routing #sld-opacidad\").attr(\"aria-valuenow\")) / 100).toFixed(2);\n }\n\n formulario_de_carga_guardar(parametros);\n}", "title": "" }, { "docid": "b506c72bc50528a37f26da22f9452a61", "score": "0.5744357", "text": "function DemandeForm() {\n return {region: new Object(),\n service: new Object(),\n centre_cout: new Object(),\n budget: new Object(),\n quantite: 0,\n montant: 0};\n }", "title": "" }, { "docid": "d3eae3f13b39a6d6b88156e97e28946e", "score": "0.5733209", "text": "function mostrarFormAlta() {\n if (this.value == \"simple\") {\n $(\"#form_completo\").css({\"display\" : \"none\"});\n $(\"#form_simple\").css({\"display\" : \"block\"});\n $(\"#btnAgregarPaciente\")[0].onclick = agregarPacienteSimple;\n }else {\n $(\"#form_simple\").css({\"display\" : \"none\"});\n $(\"#form_completo\").css({\"display\" : \"block\"});\n $(\"#btnAgregarPaciente\")[0].onclick = agregarPacienteCompleto;\n }\n}", "title": "" }, { "docid": "0abc669946d7ba9989600dd0d15cb8e4", "score": "0.57330424", "text": "function populateJs2Form(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('maeNegocViewFrm.accion'), \n\t\tget('maeNegocViewFrm.origen'));\n\n\n\tset('maeNegocViewFrm.id', jsMaeNegocViewId);\n\tset('maeNegocViewFrm.paisOidPais', [jsMaeNegocViewPaisOidPais]);\n\tset('maeNegocViewFrm.codNego', jsMaeNegocViewCodNego);\n\tif(mode == MMG_MODE_CREATE || mode == MMG_MODE_UPDATE_FORM){\n\t\tunbuildLocalizedString('maeNegocViewFrm', 1, jsMaeNegocViewDescripcion)\n\t\tloadLocalizationWidget('maeNegocViewFrm', 'Descripcion', 1);\n\t}else{\n\t\tset('maeNegocViewFrm.Descripcion', jsMaeNegocViewDescripcion);\t\t\n\t}\n\t\n}", "title": "" }, { "docid": "f1437ea2edc0660a72cc229a246118ee", "score": "0.57160133", "text": "function formVehiculoInicio() {\n document.getElementById(\"formVehiculo\").action = \"\";\n document.getElementById(\"matricula\").value = \"\";\n document.getElementById(\"matricula\").focus();\n document.getElementById(\"botonAlta\").disabled = true;\n document.getElementById(\"botonBaja\").disabled = true;\n document.getElementById(\"botonModificar\").disabled = true;\n document.getElementById(\"ventanaEmergenteOpciones\").options.length = 0;\n document.getElementById(\"ventanaEmergente\").style.display = 'none';\n}", "title": "" }, { "docid": "dc146a5683b1bb05f1a4a7bdd1778e2e", "score": "0.5694359", "text": "function mostrarFormBusqueda() {\n if (tipoBusqueda != \"no_aplica\") {\n $(\"#\" + tipoBusqueda).css({\"display\": \"none\"});\n }\n\n if (this.value != \"no_aplica\") {\n $(\"#\" + this.value).css({\"display\": \"contents\"});\n tipoBusqueda = this.value;\n }else {\n $(\"#btnBuscar\")[0].onclick();\n }\n}", "title": "" }, { "docid": "84258874fbf7353a040414b8bc2b3e25", "score": "0.5666456", "text": "function enviar_formulario(tipo){\nif(tipo==0)\n check(document.formulario1,0);\nif(tipo==1)\n check(document.formulario2,1);\n\n\n}", "title": "" }, { "docid": "1223eb001590755b1d7ee47961f26910", "score": "0.56634206", "text": "createForm() {\n this.langaugeEditForm = this.fb.group({\n lob_id: ['', this.validation.onlyRequired_validator],\n source_language: ['', this.validation.onlyRequired_validator],\n // source_language: [''],\n destination_language: ['', this.validation.onlyRequired_validator],\n rate: ['', this.validation.onlyRequired_validator],\n id: ['']\n });\n }", "title": "" }, { "docid": "29658f4a2fdddc8ab6bb205530cfe9f2", "score": "0.5662041", "text": "function VerVendedor(jsonobj)\n{\n var codigoHTML = '<div class=\"encabezado2\">Visualizar Producto</div>'+\n '<div class=\"tabla\">'+\n '<ul class=\"tabs\">'+\n '<li><a href=\"#Personal\">Producto</a></li>'+\n '</ul>'+\n \n '<div class=\"tab_container\">'+\n '<div id=\"Personal\" class=\"tab_content\">'+\n '<form action=\"\" method=\"POST\" name=\"form_crear_usuario\">'+\n '<table align=\"center\" border=\"0\" align=\"left\">'+\n '<tr>'+\n '<td colspan=\"2\" rowspan=\"9\" align=\"center\">'+\n '<div class=\"foto\">'+\n '<div class=\"imagen\">'+\n '<img src=\"images/usuario.png\" align=\"center\">'+\n '</div>'+\n '<div>'+\n '<input type=\"button\" value=\"Cargar Imagen\" class=\"button\" '+\n \n '</div>'+ \n '</div>'+\n '</td>'+\n '</tr>'+\n '<tr>'+\n '<th align=\"right\" style=\"padding-right:5px;\">Nombre Producto</th>'+\n '<td><input type=\"text\" name=\"id_usuario\" value=\"'+jsonobj.nombre+'\" size=\"20\" maxlength=\"15\" readonly=\"readonly\"/></td>'+\n '</tr>'+\n '<tr>'+\n '<th align=\"right\" style=\"padding-right:5px;\">Id Producto</th>'+\n '<td><input type=\"text\" name=\"apellidos\" value=\"'+jsonobj.foto+'\" size=\"20\" maxlength=\"25\" readonly=\"readonly\"/></td>'+\n '</tr>'+\n '<tr>'+\n '<th align=\"right\" style=\"padding-right:5px;\">Color Producto</th>'+\n '<td><input type=\"text\" name=\"nombres\" value=\"'+jsonobj.precio_costo+'\" size=\"20\" maxlength=\"25\" readonly=\"readonly\"/></td>'+\n '</tr>'+\n '<tr>'+\n '<th align=\"right\" style=\"padding-right:5px;\">Tallas Disponibles</th>'+\n '<td><input type=\"text\" name=\"nickname\" value=\"'+jsonobj.precio_venta+'\" size=\"20\" maxlength=\"10\" readonly=\"readonly\"/></td>'+\n '</tr>'+\n '<tr>'+\n '<th align=\"right\" style=\"padding-right:5px;\">Cantidad a crear</th>'+\n '<td><input type=\"text\" name=\"direccion\" value=\"'+jsonobj.precio_descuento+'\" size=\"20\" maxlength=\"35\" readonly=\"readonly\"/></td>'+\n '</tr>'+\n '<tr>'+\n '<th align=\"right\" style=\"padding-right:5px;\">Fecha de Creacion</th>'+\n '<td><input type=\"text\" name=\"telefono\" value=\"'+jsonobj.codigo_barras+'\" size=\"20\" maxlength=\"12\" readonly=\"readonly\"/></td>'+\n '</tr>'+\n '<tr>'+\n '<th align=\"right\" style=\"padding-right:5px;\">Fecha de Creacion</th>'+\n '<td><input type=\"text\" name=\"telefono\" value=\"'+jsonobj.cod_tipo_producto+'\" size=\"20\" maxlength=\"12\" readonly=\"readonly\"/></td>'+\n '</tr>'+\n '</table>'+\n '</div>'+\n '<br>'+\n '<table align=\"center\">'+\n '<tr>'+\n '<td colspan=\"4\" align=\"center\">'+\n '<input type=\"button\" value=\"Volver\" class=\"button\" id=\"volverAddVendedor\" />'+\n '</td>'+\n '</tr>'+\n '</table> '+ \n '</form>'+\n '</div>';\n \n $(\"#datos\").html(codigoHTML);\n IniciarTabers();\n activadorEventosVendedores();\n}//Con esta funcion tomaremos la consulta.", "title": "" }, { "docid": "de52e50ae3ed1c31d4691afdf28f382f", "score": "0.56558913", "text": "function establecerValoresDefecto(){\n var vdAcce = get('frmUnico.hOidAcce');\n var vdSubAcce = get('frmUnico.hOidSubAcce');\n var vdTipOfer = get('frmUnico.hOidTipOfer');\n var vdSubTipoClie = get('frmUnico.hOidSubTipClie');\n var vdCicVida = get('frmUnico.hOidCicVida');\n var vdCriAsig = get('frmUnico.hOidCriAsig');\n var vdTipDesp = get('frmUnico.hOidTipDesp');\n var vdPerFin = get('frmUnico.varPeriodo');\n \n if(vdAcce != null && vdAcce!=''){\n set('frmUnico.cbAcceso',[vdAcce]);\n cambiaAcceso();\n if(vdSubAcce != null && vdSubAcce!=''){\n set('frmUnico.cbSubacceso',[vdSubAcce]);\n }\n }\n if(vdTipOfer != null && vdTipOfer!=''){\n set('frmUnico.cbTipoOferta',[vdTipOfer]);\n }\n if(vdSubTipoClie != null && vdSubTipoClie!=''){\n set('frmUnico.cbSubtipoCliente',[vdSubTipoClie]);\n cambiaTiposClasificacion();\n }\n if(vdCicVida != null && vdCicVida!=''){\n set('frmUnico.cbCicloVida',[vdCicVida]);\n }\n if(vdCriAsig != null && vdCriAsig!=''){\n set('frmUnico.cbCriterioAsignacion',[vdCriAsig]);\n onchangeCriterioAsignacion();\n }\n if(vdTipDesp != null && vdTipDesp!=''){\n set('frmUnico.cbTipoDespacho',[vdTipDesp]);\n cambiaDespacho('noDetalle');\n }\n if(vdPerFin != null && vdPerFin!=''){\n set('frmUnico.cbPeriodoFin',[vdPerFin]);\n }\n \n set('frmUnico.rbEnviarMensaje2','N');\n set('frmUnico.rbEnviarMensaje3','N');\n \n revisarCombo('frmUnico.cbFormaCobro');\n revisarCombo('frmUnico.cbFormaPago');\n \n revisarCombo('frmUnico.cbTipoOferta');\n revisarCombo('frmUnico.cbCicloVida');\n revisarCombo('frmUnico.cbTipoDespacho');\n\n\t// sapaza -- PER-SiCC-2010-0628 -- 20/10/2010\n\tset('frmUnico.rbExclusionTipoClasificacion','N');\n}", "title": "" }, { "docid": "73ff4861bb6d0bffc88d5513fdeeb246", "score": "0.5641664", "text": "function abrirFormNuevaConsulta(){\n\t\n\t\n\t$(\"#hidden_nuevaConsulta\").show();\n\t$(\"#form_nuevaConsulta\").addClass('unsavedForm');\n\t$(\"#tituloLi\").hide();\n\t$(\"#tab_principalConsulta\").click();\n\n\t\n}", "title": "" }, { "docid": "dad3c7a82c564e4b70040a7f4762b888", "score": "0.5637201", "text": "function limpiar_vent_gen(){\r\n contenGen.getForm().reset();\r\n ventGen.hide();\r\n}", "title": "" }, { "docid": "b222238fb8cdd2ab237d1c9f5c0b09e6", "score": "0.5635619", "text": "function cargarCgg_res_observadoCtrls(){\n if(inRecordCgg_res_observado){\n txtCrper_codigo.setValue(inRecordCgg_res_observado.get('CRPER_CODIGO'));\n txtCrper_num_doc_identific.setValue(inRecordCgg_res_observado.get('CRPER_NUM_DOC_IDENTIFIC'));//Pendiente de cambio.\n isEdit = true;\n habilitarCgg_res_observadoCtrls(false);\n\n\n }}", "title": "" }, { "docid": "a43dfaec30c3c849c6a0671df94c7019", "score": "0.562483", "text": "function verifica_tipo(){\n var tipo = $('[name=tipo]').val()\n $('#oculto').css('display', 'none')\n $('#aggbarrio').css('display', 'none')\n $('[name=pais]').attr('disabled', 'disabled')\n $('[name=estado]').attr('disabled', 'disabled')\n $('[name=ciudad]').attr('disabled', 'disabled')\n $('[name=barrio]').attr('disabled', 'disabled')\n var valor = $('[name=\"tipo_ubicacion\"]').val()\n if (valor == 2 || valor == 3 || valor == 4) {\n obtener_paises($('[name=formularioUbicacionesAgregar]'))\n $('[name=pais]').removeAttr('disabled')\n $('[name=estado]').removeAttr('disabled')\n $('[name=ciudad]').removeAttr('disabled')\n $('[name=barrio]').removeAttr('disabled')\n $('[name=pais]').css('display', 'block')\n $('[name=estado]').css('display', 'block')\n $('[name=ciudad]').css('display', 'block')\n $('[name=barrio]').css('display', 'block')\n } else {\n $('[name=formularioUbicacionesAgregar]').find('[name=pais]').attr('disabled', 'disabled')\n $('[name=formularioUbicacionesAgregar]').find('[name=estado]').attr('disabled', 'disabled')\n $('[name=formularioUbicacionesAgregar]').find('[name=ciudad]').attr('disabled', 'disabled')\n $('[name=formularioUbicacionesAgregar]').find('[name=barrio]').attr('disabled', 'disabled')\n $('[name=formularioUbicacionesAgregar]').find('[name=pais]').val(\"\")\n $('[name=formularioUbicacionesAgregar]').find('[name=estado]').val(\"\")\n $('[name=formularioUbicacionesAgregar]').find('[name=ciudad]').val(\"\")\n $('[name=formularioUbicacionesAgregar]').find('[name=barrio]').val(\"\")\n }\n}", "title": "" }, { "docid": "9f6b8b3fbc005966cc0959b8fc89d55d", "score": "0.5619356", "text": "@api\n handleFormValues() {\n const allInputValid = [...this.template.querySelectorAll('lightning-input')]\n .reduce((validSoFar, inputCmp) => {\n inputCmp.reportValidity();\n return validSoFar && inputCmp.checkValidity();\n }, true);\n\n const allComboxValid = [...this.template.querySelectorAll('lightning-combobox')]\n .reduce((validSoFar, inputCmp) => {\n inputCmp.reportValidity();\n return validSoFar && inputCmp.checkValidity();\n }, true);\n\n const allRadioValid = [...this.template.querySelectorAll('lightning-radio-group')]\n .reduce((validSoFar, inputCmp) => {\n inputCmp.reportValidity();\n return validSoFar && inputCmp.checkValidity();\n }, true);\n this.checkForErrorsManytoMany();\n this.checkForErrorsLookup();\n this.checkForErrorsRadio();\n if (allInputValid && allComboxValid && allRadioValid && this.errorsLoockup && this.errorsMany && this.radioReq) {\n this.createVisita();\n } else {\n console.log('error ');\n }\n }", "title": "" }, { "docid": "2446ed64eb8c265f41ad7cf49d5a04eb", "score": "0.5608689", "text": "function IniForm() {\n\n\n\tif($tc('#data').is('input') && $tc('#data').val() == ''){\n\t\t// inicia campo Data com data de hoje\n\t\tIniciarData();\n\t}\n\n\n\n\tif($tc('#pagamentoSinal').is('select')){\n\t\tSelecionarPagamentoSinal($tc('#pagamentoSinal').val().toLowerCase());\n\t}\n\tif($tc('#pagamentoSinal').is('span')){\n\t\tSelecionarPagamentoSinal($tc('#pagamentoSinal').text().toLowerCase());\n\t}\n\n\tif($tc('#indiceReajuste').is('select')){\n\t\tSelecionarIndiceReajuste($tc('#indiceReajuste').val().toLowerCase());\n\t}\n\tif($tc('#indiceReajuste').is('span')){\n\t\tSelecionarIndiceReajuste($tc('#indiceReajuste').text().toLowerCase());\n\t}\n\n\n if ( document.getElementById(\"exe1Exp\").value == \"true\" )\n\t horas1Exp.style.visibility = \"visible\";\n\t\telse {\n\t horas1Exp.style.visibility = \"hidden\";\n\t\t\thoras1Exp.style.position = \"absolute\";\n\t\t}\n\n if ( document.getElementById(\"exe2Exp\").value == \"true\" )\n\t horas2Exp.style.visibility = \"visible\";\n\telse {\n\t horas2Exp.style.visibility = \"hidden\";\n\t\thoras2Exp.style.position = \"absolute\";\n\t}\n\n if ( document.getElementById(\"exeSinal\").value == \"true\" )\n\t horasSinal.style.visibility = \"visible\";\n\telse {\n\t horasSinal.style.visibility = \"hidden\";\n\t\thorasSinal.style.position = \"absolute\";\n\t}\n\n // apenas primeira execu?o\n if (document.getElementById(\"executou1vez\").value == \"\") {\n // cria uma linha de cheque para tabela de pagamento do sinal\n wdkAddChild(\"tabelaBoleto\");\n wdkAddChild(\"tabelaCheque\");\n wdkAddChild(\"tabelaFormaPagamento\");\n wdkAddChild(\"tabelaOutros\");\n\n\n\t\tdivBoleto.style.position = \"absolute\";\n\t\tdivOutros.style.position = \"absolute\";\n\t\tdivCheque.style.position = \"absolute\";\n\n\t // inicia com foco no campo numero da proposta\n\t var campoInicial = document.getElementById(\"proposta\");\n\t if (campoInicial != null) {\n\t\t\tdocument.getElementById(\"proposta\").value = 0;\n\t campoInicial.focus();\n\t }\n\t}\n document.getElementById(\"executou1vez\").value = \"true\";\n}", "title": "" }, { "docid": "c52720b7bfb4688a423742908a4fe41f", "score": "0.55960464", "text": "function inizializzaProvvisorioDiCassa(tipoMovimento) {\n \tvar tipoForModale = tipoMovimento === \"Impegno\" ? \"S\" : \"E\";\n $(\"#modale_hidden_tipoProvvisorioDiCassa\").val(tipoForModale);\n ProvvisorioDiCassa.inizializzazione(\"#pulsanteCompilazioneGuidataProvvisorioCassaSubdocumento\", \"\", \"#annoProvvisorioCassaSubdocumento\", \"#numeroProvvisorioCassaSubdocumento\",\"#causaleProvvisorioCassaSubdocumento\");\n }", "title": "" }, { "docid": "e8c01208724488df4443d475bf80acd6", "score": "0.55815095", "text": "function cargarCgg_dhu_aplicacion_encuestaCtrls(){\n if(inRecordCgg_dhu_aplicacion_encuesta){\n txtCdape_codigo.setValue(inRecordCgg_dhu_aplicacion_encuesta.get('CDAPE_CODIGO'));\n txtCdcre_codigo.setValue(inRecordCgg_dhu_aplicacion_encuesta.get('CDCRE_CODIGO'));\n dtCdape_fecha.setValue(inRecordCgg_dhu_aplicacion_encuesta.get('CDAPE_FECHA'));\n txtCdape_observacion.setValue(inRecordCgg_dhu_aplicacion_encuesta.get('CDAPE_OBSERVACION'));\n isEdit = true;\n habilitarCgg_dhu_aplicacion_encuestaCtrls(true);\n }}", "title": "" }, { "docid": "2cb3f76bafadc0a2cb2455b600bc5af5", "score": "0.55763435", "text": "function InitPermiso()\n{\n MostrarFormulario(false);\n ListarPermiso();\n}", "title": "" }, { "docid": "109d1bd428c73508c21b50ed9e5c1194", "score": "0.557127", "text": "newVersionForm() {\n let versionName = this._content.get('content_id');\n let template = this._renderTemplate('Content/newVersionForm', { versionName: versionName });\n $('.new-version-form-region', this.$el).html(template);\n }", "title": "" }, { "docid": "07c6922bd1a97736260a1f4ee39d7b87", "score": "0.5565734", "text": "createOrEdit(){\n let self = model.estadoController;\n //validar formulario\n if (!model.validateForm('#formulario')) { \n return;\n }\n\n if(self.estado.estado() == 2 && self.cliente.meses_atrasados() > 0){\n toastr.error(\"cliente tiene meses atrasados, no se puede dar de baja\",\"error\");\n return;\n }\n\n self.estado.id() === null ? self.create() : self.update()\n }", "title": "" }, { "docid": "d9e7da8f9067f91955c30fe45be3b40b", "score": "0.5562751", "text": "function HienThiThongTinLenForm(event){\n //Hiển thị thông tin lên Form\n var btnSua = event.target;\n var idSua = btnSua.getAttribute(\"data-id\");\n console.log(idSua);\n\n //Tim vi tri can xoa;\n var index = TimViTri(idSua);\n console.log(index);\n\n // var nhanVien = mangNhanVien[index];\n \n //Hien thi\n getEle(\"msnv\").value = mangNhanVien[index].maNhanVien;\n getEle(\"name\").value = mangNhanVien[index].tenNhanVien;\n getEle(\"email\").value = mangNhanVien[index].email;\n getEle(\"password\").value = mangNhanVien[index].matKhau;\n getEle(\"datepicker\").value = mangNhanVien[index].ngaySinh;\n getEle(\"chucvu\").value = mangNhanVien[index].chucVu;\n\n //KHong cho ng dung sua ma nhan vien\n getEle(\"msnv\").setAttribute(\"readonly\",true);\n}", "title": "" }, { "docid": "68e72b148451afcf0bde4928df8a4afd", "score": "0.55517197", "text": "function pulisci() {\n ctrl.evento = {};\n ctrl.evento.opzioni = [];\n ctrl.visualizzaOpzioni = false;\n ctrl.visualizzaVincoli = false;\n $scope.creaEventoForm.$setPristine();\n\n }", "title": "" }, { "docid": "5c14a40868fb88271ccd598791ff06e0", "score": "0.5550701", "text": "function agregarVehiculo(){\r\n\r\n\tvar mostrarCoberturas = \"\";\r\n\tvar mostrarCerrados = \"\";\r\n\t\r\n\t\r\n\tif($(\"#tipo_objeto\").val() !=\"VHDinamico\")\r\n\t{\r\n\t\tmostrarCoberturas = \"display:none;\";\r\n\t}\r\n\t\r\n\tif($(\"#tipo_objeto\").val() ==\"Pesados\")\r\n\t{\r\n\t\tmostrarCerrados = '<tr>'+\r\n\t\t\t\t'<td><label><b>Tonelaje: </b></label></td>'+\r\n\t\t\t\t'<td><input type=\"text\" name=\"tonelajenumero\" id=\"tonelajenumero\" class=\"tonelaje datosVehiculo cambioVehiculo\" maxlength=\"4\" onkeypress=\"return justNumbers(event);\"></td>'+\r\n\t\t\t\t'<td><label><b>Tipo adquisicion: </b></label></td>'+\r\n\t\t\t\t'<td><select name=\"tipo_adquisicionnumero\" id=\"tipo_adquisicionnumero\" class=\"tipo_adquisicion datosVehiculo cambioVehiculo\" ></select></td>'+ \t\r\n\t\t\t\t'</tr>';\r\n\t}\r\n\t\r\n\tif($(\"#tipo_objeto\").val() ==\"Livianos\" || $(\"#tipo_objeto\").val() ==\"Publicos\" || $(\"#tipo_objeto\").val() ==\"Motos\")\r\n\t{\r\n\t\tmostrarCerrados = '<tr>'+\r\n\t\t\t\t'<td><label><b>Tipo adquisicion: </b></label></td>'+\r\n\t\t\t\t'<td><select name=\"tipo_adquisicionnumero\" id=\"tipo_adquisicionnumero\" class=\"tipo_adquisicion datosVehiculo cambioVehiculo\" ></select></td>'+\r\n\t\t\t\t'<td></td>'+\r\n\t\t\t\t'<td></td>'+ \t\r\n\t\t\t\t'</tr>';\r\n\t} \t\t \r\n\t\r\n\tvar unicoCoberturas=\t\t\r\n\t'<div class=\"panel-body col-sm-12\" style=\"padding: 15px; border: 0px solid rgb(66, 139, 202);\">'+\r\n\t'<table style=\"border: 1px solid rgb(66, 139, 202); border-radius:5px; border-bottom-color: transparent; text-align:center; \" id=\"\" >'+\r\n\t'<tbody>'+\r\n\t'<tr >'+\r\n\t'<td rowspan=\"2\" width=\"10%\" style=\"color: rgb(255, 255, 255); background: rgb(0, 61, 165);\"><center><label>Coberturas</label></center></td>'+\r\n\t'<td style=\"background: rgb(255, 255, 255);\"><center><label><input type=\"checkbox\" name=\"coberturaTR_check\" id=\"coberturaTR_check\" onclick=\"habilitarDeshabilitarCobertura(\\'\\',event);\" class=\"cobertura datosVehiculo cambioVehiculoClick\" value=\"Todo Riesgo\">&nbsp;&nbsp;Todo Riesgo</label></td></center>'+\r\n\t'</td>'+ \r\n\t\r\n\t'<td style=\"background: rgb(255, 255, 255);\" width=\"20%\"><center><label style=\"'+mostrarCoberturas+'\"><input type=\"checkbox\" name=\"coberturaDT_check\" id=\"coberturaDT_check\" onclick=\"habilitarDeshabilitarCobertura(\\'\\',event); cambiaDispositivoRastreo();\" class=\"cobertura datosVehiculo cambioVehiculoClick\" value=\"Perdida Total\" style=\"'+mostrarCoberturas+'\">&nbsp;&nbsp; Perdida Total</label></center></td>'+\r\n\t'<td style=\"background: rgb(255, 255, 255);\"><center><label style=\"'+mostrarCoberturas+'\"><input type=\"checkbox\" name=\"coberturaRC_check\" id=\"coberturaRC_check\" onclick=\"habilitarDeshabilitarCobertura(\\'\\',event);\" class=\"cobertura datosVehiculo cambioVehiculoClick\" value=\"Resp. Civil\" style=\"'+mostrarCoberturas+'\">&nbsp;&nbsp; Responsabilidad Civil</label></center></td>'+\r\n\t\r\n\t'</tr>'+\r\n\t'<tr>'+\r\n\t'<td id=\"tabla_deducibles\" colspan=3 style=\"background: rgb(255, 255, 255);\"><table style=\"background: rgb(255, 255, 255); \">'+\r\n\t'<td><center><label style=\" font-weight: lighter;\">% Suma Asegurada:</label></center></td>'+\r\n\t'<td><center><input type=\"number\" onkeypress=\"return justNumbers(event);\" name=\"porcentaje_suma_asegurada\" id=\"porcentaje_suma_asegurada\" style=\"width:70px;\" class=\"datosVehiculo cambioVehiculo\" onBlur=\"validarSumaAsegurada();\"></center></td>'+\r\n\t'<td><center><label style=\" font-weight: lighter;\">Monto Fijo:</label></center></td>'+\r\n\t'<td><center><input type=\"number\" onkeypress=\"return justNumbers(event);\" name=\"monto_fijo\" id=\"monto_fijo\" style=\"width:70px;\" class=\"datosVehiculo cambioVehiculo\"></center></td>'+\r\n\t'<td><center><label style=\" font-weight: lighter;\">% Valor Siniestro:</label></center></td>'+\r\n\t'<td><center><input type=\"number\" onkeypress=\"return justNumbers(event);\" name=\"valor_siniestro\" id=\"valor_siniestro\" style=\"width:70px;\" onBlur=\"validarPorcentajeSiniestro();\" class=\"datosVehiculo cambioVehiculo\"></center></td>'+\r\n\t'</table></td>'+\r\n\t'<td id=\"tabla_deduciblesDT\" style=\"display:none;\" colspan=3><table style=\"background: rgb(255, 255, 255);\">'+\r\n\t'<tbody>'+\r\n\t'<td><label style=\" font-weight: lighter;\">% Suma Asegurada:</label></td>'+\r\n\t'<td><input type=\"number\" onkeypress=\"return justNumbers(event);\" name=\"porcentaje_suma_aseguradaDT\" id=\"porcentaje_suma_aseguradaDT\" style=\"width:70px;\" class=\"datosVehiculo cambioVehiculo\"></td>'+\r\n\t'</tbody>'+\r\n\t'</table></td>'+\r\n\t'</tr>'+\r\n\t\r\n\t\r\n\t'<table id=\"\" style=\"border: 1px solid rgb(66, 139, 202); border-radius:5px; text-align:center;\" ><tbody><tr>'+\r\n\t'<td width=\"10%\" style=\"color: rgb(255, 255, 255); background: rgb(0, 61, 165);\"><center><label>Paquetes</label></center></td>'+\r\n\t'<td width=\"18%\" style=\"background: rgb(255, 255, 255);\">'+\r\n\t'<div id=\"div_paquete_black_\">'+\r\n\t'<label><input type=\"checkbox\" name=\"paquete1_check\" id=\"paquete1_check\" class=\"paquete cambioVehiculoClick\" onclick=\"habilitarDeshabilitarCheck(\\'\\',event);\">&nbsp;&nbsp; Black</label>'+\r\n\t'<input type=\"button\" style=\"display:none\" name=\"paquete1_button\" id=\"paquete1_button_unico\" value=\"Detalle\" class=\"btn btn-primary\" data-toggle=\"modal\" onclick=\"mostrarPaqueteCobertura(\\'\\',\\'black\\'); calcularValoresCoberturas(event,\\'\\');\" data-target=\"#modalPaquete1_\">'+\r\n\t'<div class=\"modal\" id=\"modalPaquete1_\" tabindex=\"-1\" role=\"dialog\" aria-hidden=\"true\" style=\"text-align:left;\">'+\r\n\t'<div class=\"modal-dialog\">'+\r\n\t'<div class=\"modal-content\">'+\r\n\t'<div class=\"modal-header\">'+ \t \r\n\t'<h4 class=\"modal-title\">Paquete Black</h4>'+\r\n\t'</div>'+\r\n\t'<div class=\"modal-body\">'+\r\n\t'<div id=\"paquete1_tabla_\"></div>'+ \r\n\t'<div class=\"modal-footer\">'+\r\n\t'<div id=\"valor_total_paquete_Black_\"></div>'+\r\n\t'<a class=\"btn btn-default\" data-dismiss=\"modal\">Cerrar</a> &nbsp;&nbsp;'+\r\n\t'</div>'+\t\r\n\t'</div>'+ \t \r\n\t'</div>'+\r\n\t'</div>'+\r\n\t'</div>'+ \r\n\t'</td>'+\r\n\t'<td width=\"18%\" style=\"background: rgb(255, 255, 255);\">'+\r\n\t'<div id=\"div_paquete_blue_\">'+\t\t\r\n\t'<label><input type=\"checkbox\" name=\"paquete2_check\" id=\"paquete2_check\" class=\"paquete cambioVehiculoClick\" onclick=\"habilitarDeshabilitarCheck(\\'\\',event);\">&nbsp;&nbsp; Blue</label>'+\r\n\t'<input type=\"button\" style=\"display:none\" name=\"paquete2_button\" id=\"paquete2_button_unico\" value=\"Detalle\" class=\"btn btn-primary\" data-toggle=\"modal\" onclick=\"mostrarPaqueteCobertura(\\'\\',\\'blue\\'); calcularValoresCoberturas(event,\\'\\');\" data-target=\"#modalPaquete2_\">'+\r\n\t'<div class=\"modal\" id=\"modalPaquete2_\" tabindex=\"-1\" role=\"dialog\" aria-hidden=\"true\" style=\"text-align:left;\">'+\r\n\t'<div class=\"modal-dialog\">'+\r\n\t'<div class=\"modal-content\">'+\r\n\t'<div class=\"modal-header\">'+ \t \r\n\t'<h4 class=\"modal-title\">Paquete Blue</h4>'+\r\n\t'</div>'+\r\n\t'<div class=\"modal-body\">'+\r\n\t'<div id=\"paquete2_tabla_\"></div>'+ \r\n\t'<div class=\"modal-footer\">'+\t\t\r\n\t'<div id=\"valor_total_paquete_Blue_\"></div>'+ \t \r\n\t'<a class=\"btn btn-default\" data-dismiss=\"modal\">Cerrar</a> &nbsp;&nbsp;'+\r\n\t'</div>'+\t\t\t \t \t\t \t \t\r\n\t'</div>'+ \t \r\n\t'</div>'+\r\n\t'</div>'+\r\n\t'</div>'+ \r\n\t'</div>'+\r\n\t'</td>'+\r\n\t'<td width=\"18%\" style=\"background: rgb(255, 255, 255);\">'+\r\n\t'<div id=\"div_paquete_gold_\">'+\r\n\t'<label><input type=\"checkbox\" name=\"paquete3_check\" id=\"paquete3_check\" class=\"paquete cambioVehiculoClick\" onclick=\"habilitarDeshabilitarCheck(\\'\\',event);\">&nbsp;&nbsp; Gold</label>'+\r\n\t'<input type=\"button\" style=\"display:none\" name=\"paquete3_button\" id=\"paquete3_button_unico\" value=\"Detalle\" class=\"btn btn-primary\" data-toggle=\"modal\" onclick=\"mostrarPaqueteCobertura(\\'\\',\\'gold\\'); calcularValoresCoberturas(event,\\'\\');\" data-target=\"#modalPaquete3_\">'+\r\n\t'<div class=\"modal\" id=\"modalPaquete3_\" tabindex=\"-1\" role=\"dialog\" aria-hidden=\"true\" style=\"text-align:left;\">'+\r\n\t'<div class=\"modal-dialog\">'+\r\n\t'<div class=\"modal-content\">'+\r\n\t'<div class=\"modal-header\">'+ \t \r\n\t'<h4 class=\"modal-title\">Paquete Gold</h4>'+\r\n\t'</div>'+\r\n\t'<div class=\"modal-body\">'+\r\n\t'<div id=\"paquete3_tabla_\"></div>'+ \r\n\t'<div class=\"modal-footer\">'+\t\t \r\n\t'<div id=\"valor_total_paquete_Gold_\"></div>'+ \t \r\n\t'<a class=\"btn btn-default\" data-dismiss=\"modal\">Cerrar</a> &nbsp;&nbsp;'+\r\n\t'</div>'+\t\t \t \t\t \t \t\r\n\t'</div>'+ \t \r\n\t'</div>'+\r\n\t'</div>'+\r\n\t'</div>'+\r\n\t'</div>'+\r\n\t'</td>'+\r\n\t'<td width=\"18%\" style=\"background: rgb(255, 255, 255);\">'+\r\n\t'<div id=\"div_paquete_platinum_\">'+\t\t\r\n\t'<label><input type=\"checkbox\" name=\"paquete4_check\" id=\"paquete4_check\" class=\"paquete cambioVehiculoClick\" onclick=\"habilitarDeshabilitarCheck(\\'\\',event);\">&nbsp;&nbsp; Platinum</label>'+\r\n\t'<input type=\"button\" style=\"display:none\" name=\"paquete4_button\" id=\"paquete4_button_unico\" value=\"Detalle\" class=\"btn btn-primary\" data-toggle=\"modal\" onclick=\"mostrarPaqueteCobertura(\\'\\',\\'platinum\\'); calcularValoresCoberturas(event,\\'\\');\" data-target=\"#modalPaquete4_\">'+\r\n\t'<div class=\"modal\" id=\"modalPaquete4_\" tabindex=\"-1\" role=\"dialog\" aria-hidden=\"true\" style=\"text-align:left;\">'+\r\n\t'<div class=\"modal-dialog\">'+\r\n\t'<div class=\"modal-content\">'+\r\n\t'<div class=\"modal-header\">'+ \t \r\n\t'<h4 class=\"modal-title\">Paquete Platinum</h4>'+\r\n\t'</div>'+\r\n\t'<div class=\"modal-body\">'+\r\n\t'<div id=\"paquete4_tabla_\"></div>'+ \r\n\t'<div class=\"modal-footer\">'+\t\r\n\t'<div id=\"valor_total_paquete_Platinum_\"></div>'+\t \t \r\n\t'<a class=\"btn btn-default\" data-dismiss=\"modal\">Cerrar</a> &nbsp;&nbsp;'+\r\n\t'</div>'+\t\t \t \t\t \t \t\r\n\t'</div>'+ \t \r\n\t'</div>'+\r\n\t'</div>'+\r\n\t'</div>'+ \r\n\t'</div>'+\r\n\t'</td>'+\r\n\t'<td width=\"18%\" style=\"background: rgb(255, 255, 255);\">'+\r\n\t'<div>'+\r\n\t'<label><input type=\"checkbox\" name=\"paquete5_check\" id=\"paquete5_check\" class=\"paquete cambioVehiculoClick\" onclick=\"habilitarDeshabilitarCheck(\\'\\',event);\">&nbsp;&nbsp; Sin Paquete</label>'+\r\n\t'<input type=\"button\"style=\"display:none\" name=\"paquete5_button\" id=\"paquete5_button_unico\" value=\"Detalle\" class=\"btn btn-primary\" data-toggle=\"modal\" onclick=\"mostrarPaqueteCobertura(\\'\\',\\'sin\\'); calcularValoresCoberturas(event,\\'\\');\" data-target=\"#modalPaquete5_\">'+\r\n\t'<div class=\"modal\" id=\"modalPaquete5_\" tabindex=\"-1\" role=\"dialog\" aria-hidden=\"true\" style=\"text-align:left;\">'+\r\n\t'<div class=\"modal-dialog\">'+\r\n\t'<div class=\"modal-content\">'+\r\n\t'<div class=\"modal-header\">'+ \t \r\n\t'<h4 class=\"modal-title\">Sin Paquete</h4>'+\r\n\t'</div>'+\r\n\t'<div class=\"modal-body\">'+\r\n\t'<div id=\"paquete5_tabla_\"></div>'+ \r\n\t'<div class=\"modal-footer\">'+\t\r\n\t'<div id=\"valor_total_paquete_Sin_\"></div>'+ \t \r\n\t'<a class=\"btn btn-default\" data-dismiss=\"modal\">Cerrar</a> &nbsp;&nbsp;'+\r\n\t'</div>'+\t\t \t \t\t \t \t\r\n\t'</div>'+ \t \r\n\t'</div>'+\r\n\t'</div>'+\r\n\t'</div>'+ \r\n\t'</div>'+\r\n\t'</td>'+\t\r\n\t'</tr></tbody></table>';\r\n\t\r\n\tunicoCoberturas=unicoCoberturas.replace(/numero/g, 'unico');\r\n\t\r\n\t//se desabilita el campo de km recorridos\r\n\t//var num_vehiculos = $('#numero_vehiculos').val();\r\n\tvar numero;\r\n\tvar grupoPorProductoId = 0;\r\n\t\r\n\t//if(num_vehiculos == 0){\r\n\t\tif($(\"#tipo_objeto\").val() !=\"VHDinamico\")\r\n\t\t\tgrupoPorProductoId=Number($('#codigoProductos').val());\r\n\t\telse\r\n\t\t\tgrupoPorProductoId=148;\r\n\t\t\r\n\t\t//vehiculo_clone = vehiculo_clone.replace(/numero/g, '1'); \r\n\t\t//$('#lista_vehiculos').html(vehiculo_clone);\r\n\t\t//$(\"#numero_vehiculos\").val(\"1\");\r\n\t\t//numero = 1;\r\n\t\t//cargaTipoExtra(1);\r\n\t\t\r\n\t\tif(!casoEspecial){\r\n\t\t\tvar clase=$(\".div_vehiculos\").attr(\"class\");\r\n\t\t\t$(\".div_coberturas\").attr(\"style\",$(\".div_coberturas\").attr(\"style\")+\";display:none\");\r\n\t\t\t//$(\".div_vehiculos\").attr(\"class\",(clase.replace(\"9\",\"12\")));\r\n\t\t\t//if(numero==1)\r\n\t\t\t$(\"#coberturas_unico\").html(unicoCoberturas);\r\n\t\t}\r\n\t\t//patoargu \t\t \tcargarTipoVehiculo(\"\", numero);\r\n\t\t//patoargu \t\t \tcargarTipoUso(\"\", numero);\r\n\t\t//patoargu \t\t \tcargarTablaCoberturas(\"\",numero,\"\",\"\");\r\n\t\tif(casoEspecial)\r\n\t\tcargarTablaCoberturas(\"\",numero,\"\",\"\",grupoPorProductoId);\r\n\t\tif($(\"#tipo_objeto\").val()!=\"VHDinamico\")\r\n\t\t\t$(\"#coberturaTR_check\"+ numero).prop(\"checked\",true);\r\n\t\t//$(\"#extrasVehiculo\"+numero).attr(\"disabled\",\"true\");\r\n\t\t//$(\"#km_recorridos\"+numero).attr(\"disabled\",\"true\");\t\t\r\n\r\n\t//}else{\r\n\t\t//var nuevo_num_vehiculos = parseInt(num_vehiculos) +1;\r\n\t\t//var num_anterior = nuevo_num_vehiculos -1;\r\n\t\t//var marcaModelo = $('#marca_modelo'+num_anterior).val();\r\n\t\t//var sucursal = $('#sucursales'+num_anterior).val();\r\n\t\t//var anoFabricacion = $('#anio_fabricacion'+num_anterior).val();\r\n\t\t//var sumaAsegurada = $('#suma_asegurada_'+num_anterior).val();\r\n\t\t//var dispositivoRastreo = $('#disposito_rastreo'+num_anterior).val();\r\n\t\t//var ceroKilometros =\t$('#cero_kilometros'+num_anterior).val();\r\n\t\t/*if (marcaModelo ==\"\" || sucursal ==\"\" || anoFabricacion ==\"\" || sumaAsegurada ==\"\" || dispositivoRastreo ==\"\" )\r\n\t\t{\r\n\t\t\treturn $(\"#wizard\").valid();\r\n\t\t}\r\n\t\telse{ \r\n\r\n\t\t\t//vehiculo_clone = vehiculo_clone.replace(/numero/g, nuevo_num_vehiculos); \r\n\t\t\t//$('#clonar_vehiculo'+num_anterior).before(vehiculo_clone); \r\n\t\t\t//$(\"#extrasVehiculo\"+numero).attr(\"disabled\",\"true\");\r\n\t\t\t//$(\"#km_recorridos\"+numero).attr(\"disabled\",\"true\");\r\n\r\n\t\t\t// agregamos los valores de los combos dinamicamente \r\n\t\t\tif(nuevo_num_vehiculos>1){\r\n\t\t\t\tcargaInicial(nuevo_num_vehiculos);\r\n\t\t\t\tcargarDatosVehiculo(nuevo_num_vehiculos);\r\n\t\t\t} \t\t\t \t \t\t\t \r\n\t\t\t//$(\"#numero_vehiculos\").val(nuevo_num_vehiculos);\r\n\t\t\tnumero = nuevo_num_vehiculos;\r\n\t\t\tcargaTipoExtra(nuevo_num_vehiculos);\r\n\t\t\tcargarTipoVehiculo(\"\",nuevo_num_vehiculos);\r\n\t\t\tcargarTipoUso(\"\",nuevo_num_vehiculos);\r\n\t\t\tif(casoEspecial)\r\n\t\t\tcargarTablaCoberturas(\"\",nuevo_num_vehiculos,\"\",\"\",grupoPorProductoId); \t \t\t \t \t\t\r\n\t\t}*/\r\n\t\t\r\n\t\tif(!casoEspecial){\r\n\t\t\t//var clase=$(\".div_vehiculos\").attr(\"class\");\r\n\t\t\t$(\".div_coberturas\").hide();\r\n\t\t\t//$(\".div_vehiculos\").attr(\"class\",(clase.replace(\"9\",\"12\")));\r\n\t\t}\r\n\t\t\r\n\t//} \r\n\t/*$(\".cambioVehiculo\").change(function(){\r\n\t\teditoVehiculo=true;\r\n\r\n\t});*/\r\n\r\n\t/*$(\".cambioVehiculoClick\").click(function(){\r\n\t\teditoVehiculo=true;\r\n\t});*/\r\n\r\n\t/*$(\".cambioVehiculo\").on('select2-blur', function(e) {\r\n\t\teditoVehiculo=true;\r\n\r\n\t});*/\r\n\t\r\n\tif($(\"#estado_cotizacion\").val()==\"Emitido\")\r\n\t\tbloquearEmitido();\r\n}", "title": "" }, { "docid": "3094ac7752d053faf5a5ac2291d6725a", "score": "0.55445915", "text": "function validarGuardadoNuevaAplicacionVacuna(){\n\t\n\tvar sw = 0; // variable para determinar si existen campos sin diligenciar\n \n if( ($(\"#idVacunaBuscada\").val() == \"0\") || ($(\"#idVacunaBuscada\").val() == null) ){\n\t\t\n\t\t$(\"#label_buscarVacuna\").addClass( \"active\" );\n\t\t$(\"#buscarVacuna\").addClass( \"invalid\" );\n\t\tsw = 1;\n\t}\t\n\t\n\n\n\tif(sw == 1){\n\t\treturn false;\n\t}else{\t\n\t\t$(\"#form_nuevaVacuna\").removeClass('unsavedForm');\n\t\t$(\"#form_nuevaVacuna\").submit();\n\t}\n}", "title": "" }, { "docid": "784cd1cbb385856f797115dc3d36b4da", "score": "0.55399656", "text": "function comprobar(){\n var f=formElement;\n\n // Comprobación del select normal\n for(numPreg=0;numPreg<2;numPreg++){\n if (f.elements[numPreg].selectedIndex==0) {\n f.elements[numPreg].focus();\n alert(\"Por favor, selecciona una opcion en la pregunta \"+(numPreg+1));\n return false;\n }\n }\n // Comprobación del select multiple\n for(numPreg=2;numPreg<4;numPreg++){\n var multRespondido=false;\n for(i=1;i<(f.elements[numPreg].length);i++){\n var opt=f.elements[numPreg].options[i];\n if(opt.selected){\n multRespondido=true;\n }\n }\n if (!multRespondido) {\n f.elements[numPreg].focus();\n alert(\"Por favor, selecciona al menos una opcion en la pregunta \"+(numPreg+1));\n return false;\n }\n }\n // Comprobación del text\n for(numPreg=4;numPreg<6;numPreg++){\n if (f.elements[numPreg].value==\"\") {\n f.elements[numPreg].focus();\n alert(\"Por favor, responde la pregunta \"+(numPreg+1));\n return false;\n }\n }\n // Comprobación del radio\n for(numPreg=6;numPreg<8;numPreg++){\n var nombreRadio;\n if (numPreg==6){\n nombreRadio=f.seis;\n } else {\n nombreRadio=f.siete;\n }\n if (nombreRadio.value==\"\") {\n nombreRadio[0].focus();\n alert(\"Por favor, responde la pregunta \"+(numPreg+1));\n return false;\n }\n }\n // Comprobación del checkbox\n for(numPreg=8;numPreg<10;numPreg++){\n var checked=false;\n var nombre;\n if (numPreg==8){\n nombre=f.ocho;\n } else {\n nombre=f.nueve;\n }\n for (i = 0; i < nombre.length; i++) {\n if (nombre[i].checked) {\n checked=true;\n }\n }\n if (!checked) {\n nombre[0].focus();\n alert(\"Por favor, selecciona al menos una opcion en la pregunta \"+(numPreg+1));\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "7c3b3d3dc538aa720d3dc72ccda5597f", "score": "0.55392015", "text": "function atributos_infra(consulta_categorias){\n// AL INICIARSE\n/********************************************************/\n// Vaciado del contenido de atributos\ndocument.getElementById(\"atributos_campos\").innerHTML=\"\";\n// Obtenemos la categoria\nclave = $(\"#id_categoria\").val();\n// Completamos el formulario con los atributos de base\nObject.keys(consulta_categorias[clave]).forEach(key => {\n document.getElementById(\"atributos_campos\").innerHTML += campo_form(key,consulta_categorias[clave][key][\"label\"],consulta_categorias[clave][key][\"valores\"]);\n});\n\n// CUANDO SE CAMBIE LA CATEGORIA\n/********************************************************/\n$(\"#id_categoria\").change(function() {\n // Vaciado del contenido de atributos\n document.getElementById(\"atributos_campos\").innerHTML=\"\";\n // Obtenemos la categoria\n clave = $(\"#id_categoria\").val();\n // Completamos el formulario con los atributos de base\n Object.keys(consulta_categorias[clave]).forEach(key => {\n document.getElementById(\"atributos_campos\").innerHTML += campo_form(key,consulta_categorias[clave][key][\"label\"],consulta_categorias[clave][key][\"valores\"]);\n });\n})}", "title": "" }, { "docid": "7dbac5ddfb4cc896ff8381ea14ad513c", "score": "0.553817", "text": "function clickControllers(e){\n\t //desactivar el evento\n\t e.preventDefault();\n\n\t let paramSolicitud = e.target.value;\n\t \n\t let elSeccVentaCliente = $(e.target).parents(selSeccVentaCliente);\n\t let elSeccVentaProducto = $(e.target).parents(selSeccVentaProducto);\n\n\t//determina se es un boton del panel principal\n\tlet btnId = \"#\" + $(e.target).prop(\"id\");\n\n\t //determinar el contexto de la consulta\n\t if (elSeccVentaCliente.size() > 0) {\n\t\t ejecClienteController(paramSolicitud, elSeccVentaCliente);\n\t } else if (elSeccVentaProducto.size() > 0) {\n\t\t ejecProductoController(paramSolicitud, elSeccVentaProducto);\n\t } else if(btnId == selBtnConfirmarVenta){\n\n\t\t //se inicializa solo para tipar\n\t\t let entidad = ventaActual;\n\n\t\t//spinner animacion show\n\t\t$(selInfoForm).text(\"\");\n\t\t$(selInfoForm).addClass(\"spinner\");\n\t\t$(selInfoForm).show();\n\n\t\t VentaCtrl.ejecutarController(paramSolicitud, entidad)\n\t\t\t .then((metadatos) => {\n\n\t\t\t\t//spinner animacion hide\n\t\t\t\t$(selInfoForm).removeClass(\"spinner\");\n\n\t\t\t\t switch (metadatos.tipoConsulta) {\n\t\t\t\t\t case \"creacion\":\n\n\t\t\t\t\t\t let consecutivo = metadatos.ventas[0].codigo;\n\t\t\t\t\t\t $(selCampoConsec).val(consecutivo)\n\n\t\t\t\t\t\t //limpiarCampos();\t\t\t\t\t\t\n\t\t\t\t\t\t limpiarErrores();\n\t\t\t\t\t\t $(selInfoForm).text(metadatos.msn);\n\t\t\t\t\t\t infoColorClass(selInfoForm, true);\n\t\t\t\t\t\t break;\n\n\t\t\t\t\t case \"actualizacion\":\n\t\t\t\t\t case \"eliminacion\":\n\t\t\t\t\t\t //limpiarCampos();\n\t\t\t\t\t\t limpiarErrores();\n\t\t\t\t\t\t $(selInfoForm).text(metadatos.msn);\n\t\t\t\t\t\t infoColorClass(selInfoForm, true);\n\n\t\t\t\t\t\t break;\n\n\t\t\t\t\t case \"lectura\":\n\t\t\t\t\t\t //---se necesita???---\t\t\t\t\t\t\t\n\t\t\t\t\t\t break;\n\n\t\t\t\t\t default:\n\t\t\t\t\t\t break;\n\t\t\t\t }\n\n\t\t\t\t//deshabilitar los campos cantidad\n\t\t\t\t$(selCampoCantidadProducto).prop(\"disabled\", true);\n\n\t\t\t\t//bloquear btn confirmar\n\t\t\t\t$(selBtnConfirmarVenta).prop(\"disabled\", true);\n\t\t\t\t//muestra el boton de limpieza\n\t\t\t\t$(selBtnVentaLimpiar).show();\n\n\t\t\t })\n\t\t\t .catch((eMt) => {\n\t\t\t\t let metadatos = UsuarioCtrl.getMetadatos();\n\t\t\t\t metadatos = eMt;\n\n\t\t\t\t //spinner animacion hide\n\t\t\t\t $(selInfoForm).removeClass(\"spinner\");\n\n\t\t\t\t limpiarErrores();\n\n\t\t\t\t if (metadatos.errorValidacion\n\t\t\t\t\t && metadatos.errorValidacion != null\n\t\t\t\t\t && typeof (metadatos.errorValidacion) == \"object\") {\n\n\t\t\t\t\t for (const key in metadatos.errorValidacion) {\t\t\t\t\t\t \n\t\t\t\t\t\t metadatos.msn += `<span> ${metadatos.errorValidacion[key]} </span> </br>`;\n\t\t\t\t\t }\n\t\t\t\t }\n\n\t\t\t\t//--porque h5---\n\t\t\t\t metadatos.msn = `<h5> ${metadatos.msn} <h5>`;\n\t\t\t\t $(selInfoForm).html(metadatos.msn);\n\t\t\t\t infoColorClass(selInfoForm, false);\n\n\t\t\t\t//bloquear btn confirmar\n\t\t\t\t$(selBtnConfirmarVenta).prop(\"disabled\", true);\t\n\t\t\t\t//muestra el boton de limpieza\n\t\t\t\t$(selBtnVentaLimpiar).show();\t\t \n\n\t\t\t });\n\t }else if(btnId == selBtnVentaLimpiar){\n\t\t//limpiar todos los campos\n\t\tlimpiarCampos();\n\t\t//limpiar variables de modulo \n\t\tinicializarVarModulo();\n\t\t//oculta el boton de limpieza\n\t\t$(selBtnVentaLimpiar).hide();\t\n\t }\n }", "title": "" }, { "docid": "60f96ee5ed420fecc7b6d488fe3c945d", "score": "0.55374616", "text": "function leerEstudiante(){\r\n\r\n var nombre = document.getElementById(\"nombre\").value;\r\n var matricula = document.getElementById(\"matricula\").value;\r\n var identificacion = document.getElementById(\"identificacion\").value;\r\n\r\n var est = new Estudiante();\r\n est.nombre =nombre;\r\n est.matricula = matricula;\r\n est.identificacion = identificacion;\r\n \r\n if(nombre !== \"\" && matricula !== \"\" && identificacion !== \"\"){\r\n\r\n agregarEstudiante(est);\r\n limpiarFormulario([\"nombre\",\"matricula\",\"identificacion\"]);\r\n \r\n }else {\r\n\r\n alert(\"Campos en blanco\");\r\n }\r\n\r\n}", "title": "" }, { "docid": "36876f154892169530128d6b969fbc6a", "score": "0.5535132", "text": "function asignarCampos(tabla,cade)\n{\n\t//divide los datos en un arreglo\n\tcadena= cade.split(\"=@\");\n\tvar i=0;\n\tfor(i=0;i<cadena.length;i++){\n\t\tcadena[i]=trim(cadena[i]);\n\t}\n\tswitch(tabla){\n\t\tcase \"vista_contrato\":\n\t\t\tif(claseGlobal==\"pagos\"){\n\t\t\t\tdocument.f1.id_contrato.value=cadena[1];\n\t\t\t\t\n\t\t\t\tdocument.f1.nro_contrato.value=cadena[5];\n\t\t\t\t\n\t\t\t\tdocument.getElementById(\"abonado\").innerHTML=\"<label class='border-head'><h4>Abonado: </h4></label > </label> \"+cadena[5]+\"</label > \";\n\t\t\t\tdocument.getElementById(\"status\").innerHTML=\"<label class='border-head'><h4>Status: </h4></label > <span style='color:blue; font-weight:blod; font-size:12pt' >\"+cadena[12]+\" </span > \";\n\t\t\t\tdocument.getElementById(\"ced\").innerHTML=\"<label class='border-head'><h4>C.I/RIF: </h4></label > </label> \"+cadena[40]+cadena[14]+\"</label > \";\n\t\t\t\tdocument.getElementById(\"cliente\").innerHTML=\"<label class='border-head'><h4>CLIENTE: </h4></label > </label>\"+cadena[15]+\" \"+cadena[16]+\"</label >\";\n\t\t\t\tdocument.getElementById(\"direccion\").innerHTML=\"<label class='border-head'><h4>DIRECCION: </h4></label > </label> \"+cadena[30]+\"; \"+cadena[27]+\"; \"+cadena[24]+\"; \"+cadena[23]+\"</label > </div >\t<label class='border-head'><h4> REFERENCIA: </h4></label > </label> \"+cadena[20]+\"</label > </div >\t\";\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t//document.f1.fecha_contrato.value=formatdatei(cadena[6]);\n\t\t\t\tdocument.f1.fecha_contrato.value=cadena[21];\n\t\t\t\tdocument.f1.etiqueta.value=cadena[9];\n\t\t\t\t\n\t\t\t\tdocument.f1.cedula.value=cadena[14];\n\t\t\t\tdocument.f1.apellido.value=cadena[16];\n\t\t\t\tdocument.f1.telefono.value=cadena[17];\n\t\t\t\t\n\t\t\t\tdocument.f1.id_sector.value=cadena[27];\n\t\t\t\tdocument.f1.id_zona.value=cadena[30];\n\t\t\t\tdocument.f1.id_calle.value=cadena[24];\n\t\t\t\tdocument.f1.status_contrato.value=cadena[12];\n\t\t\t\t*/\n\t\t\t\t/*\n\t\t\t\tif(claseGlobal==\"pagos\"){\n\t\t\t\t\t//alerta(cadena[39]);\n\t\t\t\t\tif(cadena[39]==\"\"){\n\t\t\t\t\t\tcadena[39]=\"NATURAL\";\n\t\t\t\t\t}\n\t\t\t\t\tdocument.f1.tipo_cliente.value=cadena[39];\n\t\t\t\t\tdocument.f1.inicial_doc.value=cadena[40];\n\t\t\t\t\tactiva_tipo_c();\n\t\t\t\t\tasigna_tipo_c_pago(cadena[15],cadena[16]);\n\t\t\t\t\t\n\t\t\t\t\tdocument.f1.monto_pago.select();\n\t\t\t\t\t\n\t\t\t\t\tshowTab('dhtmlgoodies_tabView1','3');\n\t\t\t\t\tshowTab('dhtmlgoodies_tabView1','0');\n\t\t\t\t\t\n\t\t\t\t\t*/\n\t\t\t\t\t//conexionPHP(\"informacion.php\",\"traer_datos_abonado\",document.f1.id_contrato.value);\n\t\t\t\t\tdivDataGrid=\"datagrid\"; params = ''; tblpage = ''; tblorder = ''; tblfilter = '';\n\t\t\t\t\tarchivoDataGrid=\"procesos/datagrid_pagos.php?&id_contrato=\"+id_contrato()+\"&\";\n\t\t\t\t\tupdateTable();\n\t\t\t\t\t/*\n\t\t\t\t\tdocument.f1.contrato_fisico.value=cadena[51];\n\t\t\t\t\tdocument.f1.direc_adicional.value=cadena[20];\n\t\t\t\t\tdocument.f1.observacion.value=cadena[8];\n\t\t\t\t}\n\t\t\t\t\t*/\n\t\t\t\t\n\t\t\t}\n\t\t\telse if(claseGlobal==\"actualizar_pagos\" || claseGlobal==\"anular_pagos\" || claseGlobal==\"nota_de_credito\"){\n\t\t\t\tdocument.f1.id_contrato.value=cadena[1];\n\t\t\t\tdocument.f1.nro_contrato.value=cadena[5];\n\t\t\t\t//document.f1.fecha_contrato.value=formatdatei(cadena[6]);\n\t\t\t\tdocument.f1.fecha_contrato.value=cadena[21];\n\t\t\t\tdocument.f1.etiqueta.value=cadena[9];\n\t\t\t\tdocument.f1.cedula.value=cadena[14];\n\t\t\t\tdocument.f1.nombre.value=cadena[15];\n\t\t\t\tdocument.f1.apellido.value=cadena[16];\n\t\t\t\tdocument.f1.telefono.value=cadena[17];\n\t\t\t\tdocument.f1.id_sector.value=cadena[27];\n\t\t\t\tdocument.f1.id_zona.value=cadena[30];\n\t\t\t\tdocument.f1.id_calle.value=cadena[24];\n\t\t\t\tdocument.f1.status_contrato.value=cadena[12];\n\t\t\t\t\n\t\t\t\tif(claseGlobal==\"pagos\"){\n\t\t\t\t\t//alertaa(cadena[39]);\n\t\t\t\t\tif(cadena[39]==\"\"){\n\t\t\t\t\t\tcadena[39]=\"NATURAL\";\n\t\t\t\t\t}\n\t\t\t\t\tdocument.f1.tipo_cliente.value=cadena[39];\n\t\t\t\t\tdocument.f1.inicial_doc.value=cadena[40];\n\t\t\t\t\tactiva_tipo_c();\n\t\t\t\t\tasigna_tipo_c_pago(cadena[15],cadena[16]);\n\t\t\t\t\t\n\t\t\t\t\tdocument.f1.monto_pago.select();\n\t\t\t\t\t\n\t\t\t\t\tshowTab('dhtmlgoodies_tabView1','7');\n\t\t\t\t\tshowTab('dhtmlgoodies_tabView1','0');\n\t\t\t\t\tdivDataGrid=\"datagrid\"; params = ''; tblpage = ''; tblorder = ''; tblfilter = '';\n\t\t\t\t\tarchivoDataGrid=\"procesos/datagrid_pagos.php?&id_contrato=\"+id_contrato()+\"&\";\n\t\t\t\t\tupdateTable();\n\t\t\t\t\tdocument.f1.contrato_fisico.value=cadena[51];\n\t\t\t\t\tdocument.f1.direc_adicional.value=cadena[20];\n\t\t\t\t\tdocument.f1.observacion.value=cadena[8];\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(claseGlobal==\"interfazacc\" || claseGlobal==\"interfaz_cablemodem\"){\n\t\t\t\tdocument.f1.id_contrato.value=cadena[1];\n\t\t\t\tdocument.f1.nro_contrato.value=cadena[5];\n\t\t\t\t\n\t\t\t\tdocument.f1.cedula.value=cadena[14];\n\t\t\t\tdocument.f1.nombre.value=cadena[15] +\" \"+cadena[16];\n\t\t\t\t//document.f1.apellido.value=cadena[16];\n\t\t\t\t\n\t\t\t\tdocument.f1.status_contrato.value=cadena[12];\n\t\t\t\t\n\t\t\t}\n\t\t\telse if(claseGlobal==\"consultar_pagos\"){\n\t\t\t\tdocument.f1.id_contrato.value=cadena[1];\n\t\t\t\tdocument.f1.nro_contrato.value=cadena[5];\n\t\t\t\tdocument.f1.fecha_contrato.value=formatdatei(cadena[6]);\n\t\t\t\tdocument.f1.etiqueta.value=cadena[9];\n\t\t\t\t\n\t\t\t\tdocument.f1.cedula.value=cadena[14];\n\t\t\t\tdocument.f1.nombre.value=cadena[15];\n\t\t\t\tdocument.f1.apellido.value=cadena[16];\n\t\t\t\tdocument.f1.telefono.value=cadena[17];\n\t\t\t\t\n\t\t\t\tdocument.f1.status_contrato.value=cadena[12];\n\t\t\t\t\n\t\t\t}\n\t\t\telse if(claseGlobal==\"actualizar_pagos\"){\n\t\t\t\tdocument.f1.id_contrato.value=cadena[1];\n\t\t\t\tdocument.f1.id_calle.value=cadena[2];\n\t\t\t\tdocument.f1.nro_contrato.value=cadena[5];\n\t\t\t\tdocument.f1.fecha_contrato.value=formatdatei(cadena[6]);\n\t\t\t\tdocument.f1.etiqueta.value=cadena[9];\n\t\t\t\t\n\t\t\t\tdocument.f1.cedula.value=cadena[14];\n\t\t\t\tdocument.f1.nombre.value=cadena[15];\n\t\t\t\tdocument.f1.apellido.value=cadena[16];\n\t\t\t\tdocument.f1.telefono.value=cadena[17];\n\t\t\t\t\n\t\t\t\tdocument.f1.id_sector.value=cadena[22];\n\t\t\t\tdocument.f1.id_zona.value=cadena[25];\n\t\t\t\tdocument.f1.status_contrato.value=cadena[12];\n\t\t\t\t\n\t\t\t\tif(claseGlobal==\"actualizar_pagos\"){\n\t\t\t\t\tdivDataGrid=\"datagrid\"; params = ''; tblpage = ''; tblorder = ''; tblfilter = '';\n\t\t\t\t\tarchivoDataGrid=\"procesos/datagrid_actualizar_pagos.php?&id_contrato=\"+id_contrato()+\"&\";\n\t\t\t\t\tupdateTable();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(claseGlobal==\"ordenes_tecnicos\"){\n\t\t\t\tdocument.f1.id_contrato.value=cadena[1];\n\t\t\t\tdocument.f1.nro_contrato.value=cadena[5];\n\t\t\t\tdocument.f1.cedula.value=cadena[14];\n\t\t\t\tdocument.f1.nombre.value=cadena[15];\n\t\t\t\tdocument.f1.apellido.value=cadena[16];\n\t\t\t\tdocument.f1.status_pago.value=cadena[12];\n\t\t\t\t\n\t\t\t\tdocument.f1.id_sector.value=cadena[27];\n\t\t\t\tdocument.f1.id_zona.value=cadena[30];\n\t\t\t\tdocument.f1.id_calle.value=cadena[24];\n\t\t\t\t\n\t\t\t\tdocument.f1.status_con.value=cadena[12];\n\t\t\t\tdocument.f1.contrato_fisico.value=cadena[51];\n\t\t\t\t\n\t\t\t\t//conexionPHP('informacion.php',\"traerTOStatus\",status_con());\n\t\t\t\tconexionPHP('informacion.php',\"verificaOrden\",id_contrato());\n\t\t\t}\n\t\t\telse if(claseGlobal==\"ordenes_tecnicos_modificar\"){\n\t\t\t\tdocument.f1.id_contrato.value=cadena[1];\n\t\t\t\tdocument.f1.nro_contrato.value=cadena[5];\n\t\t\t\tdocument.f1.cedula.value=cadena[14];\n\t\t\t\tdocument.f1.nombre.value=cadena[15];\n\t\t\t\tdocument.f1.apellido.value=cadena[16];\n\t\t\t\tdocument.f1.status_pago.value=cadena[12];\n\t\t\t\t\n\t\t\t\tdocument.f1.id_sector.value=cadena[27];\n\t\t\t\tdocument.f1.id_zona.value=cadena[30];\n\t\t\t\tdocument.f1.id_calle.value=cadena[24];\n\t\t\t\t\n\t\t\t\tdocument.f1.status_con.value=cadena[12];\n\t\t\t\t\n\t\t\t\tconexionPHP(\"informacion.php\",\"trae_info_grupo\",id_orden());\n\t\t\t}\n\t\t\telse if(claseGlobal==\"reimp_factura\"){\n\t\t\t\tdocument.f1.id_contrato.value=cadena[1];\n\t\t\t\tdocument.f1.nro_contrato.value=cadena[5];\n\t\t\t\tdocument.f1.cedula.value=cadena[14];\n\t\t\t\tdocument.f1.nombre.value=cadena[15];\n\t\t\t\tdocument.f1.apellido.value=cadena[16];\n\t\t\t\tdocument.f1.status_contrato.value=cadena[12];\n\t\t\t\t\n\t\t\t\tdivDataGrid=\"datagrid\"; params = ''; tblpage = ''; tblorder = ''; tblfilter = '';\n\t\t\t\tarchivoDataGrid=\"reportes/reimp_factura.php?&id_contrato=\"+id_contrato()+\"&\";\n\t\t\t\tupdateTable();\n\t\t\t}\n\t\t\telse if(claseGlobal==\"reimp_ordenes\"){\n\t\t\t\tdocument.f1.id_contrato.value=cadena[1];\n\t\t\t\tdocument.f1.nro_contrato.value=cadena[5];\n\t\t\t\tdocument.f1.cedula.value=cadena[14];\n\t\t\t\tdocument.f1.nombre.value=cadena[15];\n\t\t\t\tdocument.f1.apellido.value=cadena[16];\n\t\t\t\tdocument.f1.status_contrato.value=cadena[12];\n\t\t\t\t\n\t\t\t\tdivDataGrid=\"datagrid\"; params = ''; tblpage = ''; tblorder = ''; tblfilter = '';\n\t\t\t\tarchivoDataGrid=\"reportes/reimp_ordenes.php?&id_contrato=\"+id_contrato()+\"&\";\n\t\t\t\tupdateTable();\n\t\t\t}\n\t\t\t\n\t\t\telse if(claseGlobal==\"agregar_promo_contrato\"){\n\t\t\t\tdocument.f1.id_contrato.value=cadena[1];\n\t\t\t\tdocument.f1.nro_contrato.value=cadena[5];\n\t\t\t\t\n\t\t\t\tdocument.f1.cedula.value=cadena[14];\n\t\t\t\tdocument.f1.nombre.value=cadena[15];\n\t\t\t\tdocument.f1.apellido.value=cadena[16];\n\t\t\t\tdocument.f1.status_pago.value=cadena[12];\n\t\t\t\tdivDataGrid=\"datagrid\"; params = ''; tblpage = ''; tblorder = ''; tblfilter = '';\n\t\t\t\t\tarchivoDataGrid=\"procesos/datagrid_promo_contrato.php?&id_contrato=\"+id_contrato()+\"&\";\n\t\t\t\t\tupdateTable();\n\t\t\t//\tconexionPHP(\"informacion.php\",\"traerMensualidad\",id_contrato());\n\t\t\t}\n\t\t\telse if(claseGlobal==\"convenio_pago\"){\n\t\t\t\tdocument.f1.id_contrato.value=cadena[1];\n\t\t\t\tdocument.f1.nro_contrato.value=cadena[5];\n\t\t\t\t\n\t\t\t\tdocument.f1.cedula.value=cadena[14];\n\t\t\t\tdocument.f1.nombre.value=cadena[15];\n\t\t\t\tdocument.f1.apellido.value=cadena[16];\n\t\t\t\tdocument.f1.status_pago.value=cadena[12];\n\t\t\t\t\n\t\t\t\tdivDataGrid=\"datagrid\"; params = ''; tblpage = ''; tblorder = ''; tblfilter = '';\n\t\t\t\t\tarchivoDataGrid=\"procesos/datagrid_convenio_pago.php?&id_contrato=\"+id_contrato()+\"&\";\n\t\t\t\t\tupdateTable();\n\t\t\t\n\t\t\t}\n\t\t\telse if(claseGlobal==\"cargar_deuda\"){\n\t\t\t\tdocument.f1.id_contrato.value=cadena[1];\n\t\t\t\tdocument.f1.nro_contrato.value=cadena[5];\n\t\t\t\t\n\t\t\t\tdocument.f1.cedula.value=cadena[14];\n\t\t\t\tdocument.f1.nombre.value=cadena[15];\n\t\t\t\tdocument.f1.apellido.value=cadena[16];\n\t\t\t\tdocument.f1.status_pago.value=cadena[12];\n\t\t\t//\tconexionPHP(\"informacion.php\",\"traerMensualidad\",id_contrato());\n\t\t\t}\n\t\t\telse if(claseGlobal==\"llamadas\"){\n\t\t\t\tdocument.f1.id_contrato.value=cadena[1];\n\t\t\t\tdocument.f1.nro_contrato.value=cadena[5];\n\t\t\t\t\n\t\t\t\tdocument.f1.cedula.value=cadena[14];\n\t\t\t\tdocument.f1.nombre.value=cadena[15];\n\t\t\t\tdocument.f1.apellido.value=cadena[16];\n\t\t\t\tdocument.f1.status_pago.value=cadena[12];\n\t\t\t\t\n\t\t\t//\tconexionPHP(\"informacion.php\",\"traerMensualidad\",id_contrato());\n\t\t\t}\n\t\t\telse if(claseGlobal==\"Rep_estadocuenta\"){\n\t\t\t\tdocument.f1.id_contrato.value=cadena[1];\n\t\t\t\tdocument.f1.nro_contrato.value=cadena[5];\n\t\t\t\tdocument.f1.cedula.value=cadena[14];\n\t\t\t\t\n\t\t\t\tarchivoDataGrid=\"reportes/Rep_estadocuenta.php?&id_contrato=\"+id_contrato()+\"&\";\n\t\t\t\tupdateTable();\n\t\t\t}\n\t\t\telse if(claseGlobal==\"Rep_historialpago\"){\n\t\t\t\tdocument.f1.id_contrato.value=cadena[1];\n\t\t\t\tdocument.f1.nro_contrato.value=cadena[5];\n\t\t\t\tdocument.f1.cedula.value=cadena[14];\n\t\t\t\t\n\t\t\t\tarchivoDataGrid=\"reportes/Rep_historialpago.php?&id_contrato=\"+id_contrato()+\"&\";\n\t\t\t\tupdateTable();\n\t\t\t}\n\t\t\telse if(claseGlobal==\"contrato\"){\n\t\t\t\talerta(\"Error, el numero de contrato ya corresponde a un Cliente\");\n\t\t\t\t//alerta(document.f1.nro_contrato_nuevo.value);\n\t\t\t\tdocument.f1.nro_contrato.value=document.f1.nro_contrato_nuevo.value;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t//alerta(cadena);\n\t\t\t\tdocument.f1.id_contrato.value=cadena[1];\n\t\t\t\tdocument.f1.id_calle.value=cadena[2];\n\t\t\t\tdocument.f1.id_persona.value=cadena[3];\n\t\t\t\tdocument.f1.cli_id_persona.value=cadena[4];\n\t\t\t\tdocument.f1.nro_contrato.value=cadena[5];\n\t\t\t\tdocument.f1.fecha_contrato.value=formatdatei(cadena[6]);\n\t\t\t\tdocument.f1.hora_contrato.value=cadena[7];\n\t\t\t\tdocument.f1.observacion.value=cadena[8];\n\t\t\t\tdocument.f1.etiqueta.value=cadena[9];\n\t\t\t\tdocument.f1.costo_contrato.value=cadena[10];\n\t\t\t\tdocument.f1.costo_dif_men.value=cadena[11];\n\t\t\t\t\n\t\t\t\tdocument.f1.status_pago.value=cadena[12];\n\n\t\t\t\tdocument.f1.nro_factura.value=cadena[13];\n\t\t\t\t\n\t\t\t\tdocument.f1.direc_adicional.value=cadena[20];\n\t\t\t\tdocument.f1.numero_casa.value=cadena[21];\n\n\t\t\t\tif(cadena[36]!='' && cadena[36]!='0'){\n\t\t\t\t\tdocument.f1.edificio.value=cadena[36];\n\t\t\t\t\t\n\t\t\t\t\tdocument.f1.edificio.disabled=false;\n\t\t\t\t\tdocument.f1.numero_piso.disabled=false;\n\t\t\t\t\tdocument.f1.tipo_costo[1].checked=true;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tdocument.f1.edificio.disabled=true;\n\t\t\t\t\tdocument.f1.numero_piso.disabled=true;\n\t\t\t\t\tdocument.f1.edificio.selectedIndex=0;\n\t\t\t\t\tdocument.f1.numero_piso.value='';\n\t\t\t\t}\n\t\t\t\tdocument.f1.numero_piso.value=cadena[37];\n\t\t\t\t\n\t\t\t\tdocument.f1.postel.value=cadena[43];\n\t\t\t\tdocument.f1.taps.value=cadena[44];\n\t\t\t\tdocument.f1.pto.value=cadena[45];\n\t\t\t\tdocument.f1.id_g_a.value=cadena[46];\n\t\t\t\tdocument.f1.urbanizacion.value=cadena[48];\n\t\t\t\tdocument.f1.cod_id_persona.value=cadena[50];\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tdocument.f1.cedula.value=cadena[14];\n\t\t\t\tdocument.f1.nombre.value=cadena[15];\n\t\t\t\tdocument.f1.apellido.value=cadena[16];\n\t\t\t\tdocument.f1.telefono.value=cadena[17];\n\t\t\t\t\n\t\t\t\tdocument.f1.telf_casa.value=cadena[18];\n\t\t\t\tdocument.f1.email.value=cadena[19];\n\t\t\t\tdocument.f1.telf_adic.value=cadena[38];\n\t\t\t\t\n\t\t\t\tdocument.f1.tipo_cliente.value=cadena[39];\n\t\t\t\tactiva_tipo_c()\n\t\t\t\tdocument.f1.inicial_doc.value=cadena[40];\n\t\t\t\tasigna_tipo_c(cadena[15],cadena[16]);\n\t\t\t\tdocument.f1.fecha_nac.value=formatdatei(cadena[41]);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//conexionPHP(\"validarExistencia.php\",\"1=@vista_cliente\",\"id_persona=@\"+cli_id_persona());\n\t\t\t\t\n\t\t\t\tif(claseGlobal==\"act_contrato\"){\n\t\t\t\t\t\tconexionPHP(\"validarExistencia.php\",\"1=@vista_ubica\",\"id_calle=@\"+id_calle());\n\t\t\t\t\t\t\n\t\t\t\t\t\tdocument.f1.n_contrato.value=cadena[5];\n\t\t\t\t\t\tdocument.f1.contrato_fisico.value=cadena[51];\n\t\t\t\t\t\tdocument.f1.etiqueta_n.value=cadena[52];\n\t\t\t\t\t\ttraeRadiotipo_fact(cadena[53]);\n\t\t\t\t\t\ttraeRadiocontrato_imp(cadena[54]);\n\t\t\t\t\t\tdocument.f1.ultima_act.value=formatdatei(cadena[55]);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//mostrar_estado_cuenta();\n\t\t\t\t\t\t\n\t\t\t\t\t\tdivDataGrid=\"datagrid\";params = ''; tblpage = ''; tblorder = ''; tblfilter = '';\n\t\t\t\t\t\tarchivoDataGrid=\"procesos/datagrid_contrato_servicio.php?&id_contrato=\"+id_contrato()+\"&\";\n\t\t\t\t\t\tlistar_datos(archivoDataGrid,divDataGrid);\n\n\n\t\t\t\t\t\tif( modulo_cable_modem_G=='1'){\n\t\t\t\t\t\t\tdivDataGrid=\"cablemo\";params = ''; tblpage = ''; tblorder = ''; tblfilter = '';\n\t\t\t\t\t\t\tarchivoDataGrid=\"procesos/datagrid_cablemo.php?&id_contrato=\"+id_contrato()+\"&\";\n\t\t\t\t\t\t\tlistar_datos(archivoDataGrid,divDataGrid);\n\n\t\t\t\t\t\t\tdivDataGrid=\"decoana\";params = ''; tblpage = ''; tblorder = ''; tblfilter = '';\n\t\t\t\t\t\t\tarchivoDataGrid=\"procesos/datagrid_decoana.php?&id_contrato=\"+id_contrato()+\"&\";\n\t\t\t\t\t\t\tlistar_datos(archivoDataGrid,divDataGrid);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tconexionPHP(\"informacion.php\",\"traer_serv_acc_susc\",id_contrato());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdivDataGrid=\"estado_cuenta\"; params = ''; tblpage = ''; tblorder = ''; tblfilter = '';\n\t\t\t\t\t\tarchivoDataGrid=\"procesos/datagrid_estado_cuenta.php?&id_contrato=\"+id_contrato()+\"&\";\n\t\t\t\t\t\tlistar_datos(archivoDataGrid,divDataGrid);\n\t\t\t\t\t\t\n\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*\n\t\t\t\t\t\tdivDataGrid=\"cargos\"; \n\t\t\t\t\t\tarchivoDataGrid=\"procesos/datagrid_actualizar_pagos.php?&id_contrato=\"+id_contrato()+\"&\";\n\t\t\t\t\t\tupdateTable();\n\t\t\t\t\t\t*/\n\t\t\t\t\t\tvar id_cont_cli = id_contrato();\n\t\t\t\t\t\t$(document).ready( tabConsultarCliente(id_cont_cli) ); //función personalizada en bootstrap/js/tab.js\n\t\t\t\t\t\t\n\t\t\t\t\t\t//showTab('dhtmlgoodies_tabView1','7');\n\t\t\t\t\t\t//showTab('dhtmlgoodies_tabView1','0');\n\t\t\t\t}\n\t\t\t\ttraerSector();\n\t\t\t\t\n\t\t\t}\n\t\t//\talert(\":\"+alert_act_G+\":\"+alert_imp_G+\":\")\n\t\t\tif(alert_act_G==\"1\"){\n\t\t\t\tif(compara_fecha(formatdate(dias_alert_act_G),formatdate(document.f1.ultima_act.value))>0){\n\t\t\t\t\talerta(\"El contrato NO esta Actualizado\\nUltima fecha de Actualizacion: \"+document.f1.ultima_act.value);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(alert_imp_G==\"1\"){\n\t\t\t\tif(verRadiocontrato_imp()==\"NO\"){\n\t\t\t\t\talerta(\"El cliente no posee Contrato impreso\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"vista_contrato_todo\":\n\t\t\tif(claseGlobal==\"pagos\"){\n\t\t\t\tdocument.f1.id_contrato.value=cadena[1];\n\t\t\t\t\n\t\t\t\tdocument.f1.nro_contrato.value=cadena[5];\n\t\t\t\t\n\t\t\t\tdocument.getElementById(\"abonado\").innerHTML=\"<label class='border-head'><h4>Abonado: </h4></label > </label> \"+cadena[5]+\"</label > \";\n\t\t\t\tdocument.getElementById(\"status\").innerHTML=\"<label class='border-head'><h4>Status: </h4></label > <span style='color:blue; font-weight:blod; font-size:12pt' >\"+cadena[12]+\" </span > \";\n\t\t\t\tdocument.getElementById(\"ced\").innerHTML=\"<label class='border-head'><h4>C.I/RIF: </h4></label > </label> \"+cadena[40]+cadena[14]+\"</label > \";\n\t\t\t\tdocument.getElementById(\"cliente\").innerHTML=\"<label class='border-head'><h4>CLIENTE: </h4></label > </label>\"+cadena[15]+\" \"+cadena[16]+\"</label >\";\n\t\t\t\tdocument.getElementById(\"direccion\").innerHTML=\"<label class='border-head'><h4>DIRECCION: </h4></label > </label> \"+cadena[30]+\"; \"+cadena[27]+\"; \"+cadena[24]+\"; \"+cadena[23]+\"</label > </div >\t<label class='border-head'><h4> REFERENCIA: </h4></label > </label> \"+cadena[20]+\"</label > </div >\t\";\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t//document.f1.fecha_contrato.value=formatdatei(cadena[6]);\n\t\t\t\tdocument.f1.fecha_contrato.value=cadena[21];\n\t\t\t\tdocument.f1.etiqueta.value=cadena[9];\n\t\t\t\t\n\t\t\t\tdocument.f1.cedula.value=cadena[14];\n\t\t\t\tdocument.f1.apellido.value=cadena[16];\n\t\t\t\tdocument.f1.telefono.value=cadena[17];\n\t\t\t\t\n\t\t\t\tdocument.f1.id_sector.value=cadena[27];\n\t\t\t\tdocument.f1.id_zona.value=cadena[30];\n\t\t\t\tdocument.f1.id_calle.value=cadena[24];\n\t\t\t\tdocument.f1.status_contrato.value=cadena[12];\n\t\t\t\t*/\n\t\t\t\t/*\n\t\t\t\tif(claseGlobal==\"pagos\"){\n\t\t\t\t\t//alerta(cadena[39]);\n\t\t\t\t\tif(cadena[39]==\"\"){\n\t\t\t\t\t\tcadena[39]=\"NATURAL\";\n\t\t\t\t\t}\n\t\t\t\t\tdocument.f1.tipo_cliente.value=cadena[39];\n\t\t\t\t\tdocument.f1.inicial_doc.value=cadena[40];\n\t\t\t\t\tactiva_tipo_c();\n\t\t\t\t\tasigna_tipo_c_pago(cadena[15],cadena[16]);\n\t\t\t\t\t\n\t\t\t\t\tdocument.f1.monto_pago.select();\n\t\t\t\t\t\n\t\t\t\t\tshowTab('dhtmlgoodies_tabView1','3');\n\t\t\t\t\tshowTab('dhtmlgoodies_tabView1','0');\n\t\t\t\t\t\n\t\t\t\t\t*/\n\t\t\t\t\t//conexionPHP(\"informacion.php\",\"traer_datos_abonado\",document.f1.id_contrato.value);\n\t\t\t\t\tdivDataGrid=\"datagrid\"; params = ''; tblpage = ''; tblorder = ''; tblfilter = '';\n\t\t\t\t\tarchivoDataGrid=\"procesos/datagrid_pagos.php?&id_contrato=\"+id_contrato()+\"&\";\n\t\t\t\t\tupdateTable();\n\t\t\t\t\t/*\n\t\t\t\t\tdocument.f1.contrato_fisico.value=cadena[51];\n\t\t\t\t\tdocument.f1.direc_adicional.value=cadena[20];\n\t\t\t\t\tdocument.f1.observacion.value=cadena[8];\n\t\t\t\t}\n\t\t\t\t\t*/\n\t\t\t\t\n\t\t\t}\n\t\t\telse if(claseGlobal==\"pagodeposito\"){\n\t\t\t\tdocument.f1.id_contrato.value=cadena[1];\n\t\t\t\tdocument.f1.nro_contrato.value=cadena[5];\n\t\t\t\tdocument.f1.fecha_contrato.value=cadena[21];\n\t\t\t\tdocument.f1.etiqueta.value=cadena[9];\n\t\t\t\t\n\t\t\t\tdocument.f1.cedula.value=cadena[14];\n\t\t\t\tdocument.f1.nombre.value=cadena[15];\n\t\t\t\tdocument.f1.apellido.value=cadena[16];\n\t\t\t\tdocument.f1.telefono.value=cadena[17];\n\t\t\t\t\n\t\t\t\tdocument.f1.id_sector.value=cadena[27];\n\t\t\t\tdocument.f1.id_zona.value=cadena[30];\n\t\t\t\tdocument.f1.id_calle.value=cadena[24];\n\t\t\t\tdocument.f1.status_contrato.value=cadena[12];\n\t\t\t\t\tif(cadena[39]==\"\"){\n\t\t\t\t\t\tcadena[39]=\"NATURAL\";\n\t\t\t\t\t}\n\t\t\t\t\tdocument.f1.tipo_cliente.value=cadena[39];\n\t\t\t\t\tdocument.f1.inicial_doc.value=cadena[40];\n\t\t\t\t\tactiva_tipo_c();\n\t\t\t\t\tasigna_tipo_c_pago(cadena[15],cadena[16]);\n\t\t\t\t\t\n\t\t\t\t\tdocument.f1.monto_pago.select();\n\t\t\t\t\t\n\t\t\t\t\tdocument.f1.contrato_fisico.value=cadena[51];\n\t\t\t\t\tdocument.f1.direc_adicional.value=cadena[20];\n\t\t\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"usuario\":\n\t\t\tbreak;\n\t\tcase \"perfil\":\n\t\t\tdocument.f1.codigo.value=cadena[1];\n\t\t\tdocument.f1.nombre.value=cadena[2];\n\t\t\tdocument.f1.descripcion.value=cadena[3];\n\t\t\testatus(cadena[4]);\n\t\t\tbreak;\n\t\tcase \"vista_ubica\":\n\t\t\tdocument.f1.id_sector.value=cadena[2];\n\t\t\tdocument.f1.id_zona.value=cadena[4];\n\t\t\tdocument.f1.id_ciudad.value=cadena[6];\n\t\t\tdocument.f1.id_mun.value=cadena[7];\n\t\t\tdocument.f1.id_esta.value=cadena[9];\n\t\t\tdocument.f1.id_franq.value=cadena[11];\n\t\t\tbreak;\n\t\tcase \"modulo\":\n\t\t\tdocument.f1.codigo.value=cadena[1];\n\t\t\tdocument.f1.nombre.value=cadena[2];\n\t\t\tdocument.f1.name.value=cadena[3];\n\t\t\tdocument.f1.descripcion.value=cadena[4];\n\t\t\testatus(cadena[5]);\n\t\t\tnombreModulo=document.f1.nombre.value;\n\t\t\tif(cadena[2]=='Modulo' || cadena[2]=='Perfil' || cadena[2]=='Usuario' || cadena[2]=='Persona' || cadena[2]=='CreaFormulario' || cadena[2]=='VerDatos')\n\t\t\t\tdocument.f1.nombre.disabled=true;\n\t\t\telse\n\t\t\t\tdocument.f1.nombre.disabled=false;\n\t\t\tbreak;\n\t\tcase \"personausuario\":\n\t\t\texisteMat=true;\n\t\t\tdocument.f1.id_persona.value=cadena[1];\n\t\t\tdocument.f1.cedula.value=cadena[2];\n\t\t\tdocument.f1.nombre.value=cadena[3];\n\t\t\tdocument.f1.apellido.value=cadena[4];\n\t\t\tdocument.f1.telefono.value=cadena[5];\n\t\t\t\n\t\t\tdocument.f1.login.value=cadena[6];\n\t\t\tdocument.f1.codigoperfil.value=cadena[7];\n\t\t\tdocument.f1.password.value=cadena[8];\n\t\t\tdocument.f1.otropassword.value=cadena[8];\t\t\t\n\t\t\testatus(cadena[9]);\n\t\t\t\n\t\t\tdocument.f1.id_franq.value=cadena[13];\t\t\t\n\t\t\tdocument.f1.id_servidor.value=cadena[15];\t\t\t\n\t\t\t\n\t\t\tbreak;\n\t\tcase \"Manejador\":\n\t\t\tradio(cadena[0]);\n\t\t\tdocument.f1.servidor.value=cadena[1];\n\t\t\tdocument.f1.login.value=cadena[2];\n\t\t\tdocument.f1.password.value=cadena[3];\n\t\t\tdocument.f1.database.value=cadena[4];\n\t\t\tmanejador=cadena[0];\n\t\t\tbreak;\n\t\tcase \"persona\":\n\t\t\tif(claseGlobal==\"contrato\"){\n\t\t\t\tdocument.f1.cli_id_persona.value=cadena[1];\n\t\t\t}else{\n\t\t\t\tdocument.f1.id_persona.value=cadena[1];\n\t\t\t}\n\t\t\t\n\t\t\tdocument.f1.cedula.value=cadena[2];\n\t\t\tdocument.f1.nombre.value=cadena[3];\n\t\t\tdocument.f1.apellido.value=cadena[4];\n\t\t\tdocument.f1.telefono.value=cadena[5];\n\t\t\texisteMat=true;\n\t\t\t\n\t\t\tif(claseGlobal==\"tecnico\"){\n\t\t\t\tvalidartecnico();\n\t\t\t}\n\t\t\telse if(claseGlobal==\"cobrador\"){\n\t\t\t\tvalidarcobrador();\n\t\t\t}\n\t\t\telse if(claseGlobal==\"vendedor\"){\n\t\t\t\tvalidarvendedor();\n\t\t\t}\n\t\t\telse if(claseGlobal==\"gerentes_permitidos\"){\n\t\t\t\tvalidargerentes_permitidos();\n\t\t\t}\n\t\t\t\n\t\t\tbreak;\n\t\t\n\t\t\n\t\tcase \"vista_cobrador\":\n\t\t\tdocument.f1.id_persona.value=cadena[1];\n\t\t\tdocument.f1.cedula.value=cadena[2];\n\t\t\tdocument.f1.nombre.value=cadena[3];\n\t\t\tdocument.f1.apellido.value=cadena[4];\n\t\t\tdocument.f1.telefono.value=cadena[5];\n\t\t\t\n\t\t\tdocument.f1.nro_cobrador.value=cadena[6];\n\t\t\tdocument.f1.direccion_cob.value=cadena[7];\n\t\t\tdocument.f1.dato.value=cadena[9];\n\t\t\tdocument.f1.id_franq.value=cadena[9];\n\t\t\tbreak;\n\t\tcase \"vista_vendedor\":\n\t\t\tdocument.f1.id_persona.value=cadena[1];\n\t\t\tdocument.f1.cedula.value=cadena[2];\n\t\t\tdocument.f1.nombre.value=cadena[3];\n\t\t\tdocument.f1.apellido.value=cadena[4];\n\t\t\tdocument.f1.telefono.value=cadena[5];\n\t\t\t\n\t\t\tdocument.f1.nro_vendedor.value=cadena[6];\n\t\t\tdocument.f1.direccion_ven.value=cadena[7];\n\t\t\tdocument.f1.id_franq.value=cadena[8];\n\t\t\tbreak;\n\t\tcase \"vista_cliente\":\n\t\t\n\t\t\tif(claseGlobal==\"comentario_cliente\" || claseGlobal==\"reclamo_denuncia\"){\n\t\t\t\tdocument.f1.id_persona.value=cadena[1];\n\t\t\t\tdocument.f1.cedula.value=cadena[2];\n\t\t\t\tdocument.f1.nombre.value=cadena[3]+\" \"+cadena[4];\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif(claseGlobal==\"contrato\"){\n\t\t\t\t\texisteMat=true;\n\t\t\t\t\tdocument.f1.cli_id_persona.value=cadena[1];\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\n\t\t\t\t\t\tdocument.f1.id_persona.value=cadena[1];\n\t\t\t\t}\n\t\t\t\tif(cadena[9]==\"\"){\n\t\t\t\t\tcadena[9]=\"NATURAL\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tdocument.f1.cedula.value=cadena[2];\n\t\t\t\tdocument.f1.nombre.value=cadena[3];\n\t\t\t\tdocument.f1.apellido.value=cadena[4];\n\t\t\t\tdocument.f1.telefono.value=cadena[5];\n\t\t\t\t\n\t\t\t\tdocument.f1.telf_casa.value=cadena[6];\n\t\t\t\tdocument.f1.email.value=cadena[7];\n\t\t\t\tdocument.f1.telf_adic.value=cadena[8];\n\t\t\t\t\n\t\t\t\tdocument.f1.tipo_cliente.value=cadena[9];\n\t\t\t\tactiva_tipo_c()\n\t\t\t\tdocument.f1.inicial_doc.value=cadena[10];\n\t\t\t\tasigna_tipo_c(cadena[3],cadena[4]);\n\t\t\t\tdocument.f1.fecha_nac.value=formatdatei(cadena[11]);\n\t\t\t\t\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"vista_cliente\":\n\t\t\t//alerta(claseGlobal);\n\t\t\tif(claseGlobal==\"act_contrato\"){\n\t\t\t\n\t\t\tnew BootstrapDialog({\n\t\ttitle: 'CONFIRMACIÓN DE SAECO',\n\t\tmessage: '¿la cedula corresponde a otro cliente. desea asignarle este contrato?',\n\t\ttype: BootstrapDialog.TYPE_INFO,\n\t\tclosable: false,\n\t\tbuttons: [{\n\t\t\tlabel: 'NO',\n\t\t\ticon: 'glyphicon glyphicon-thumbs-down',\n\t\t\tcssClass: 'btn-danger',\n\t\t\taction: function(dialog) {\n\t\t\t\ttypeof dialog.getData('callback') === 'function' && dialog.getData('callback')(false);\n\t\t\t\tdocument.f1.cedula.value='';\n\t\t\t\tdialog.close();\n\t\t\t}\n\t\t}, {\n\t\t\tlabel: 'SI',\n\t\t\ticon : 'glyphicon glyphicon-thumbs-up',\n\t\t\tcssClass: 'btn-info',\n\t\t\taction: function(dialog) {\n\t\t\t\ttypeof dialog.getData('callback') === 'function' && dialog.getData('callback')(true);\n\t\t\t\tdocument.f1.cli_id_persona.value=cadena[1];\n\t\t\t\tdocument.f1.cedula.value=cadena[2];\n\t\t\t\tdocument.f1.nombre.value=cadena[3];\n\t\t\t\tdocument.f1.apellido.value=cadena[4];\n\t\t\t\tdocument.f1.telefono.value=cadena[5];\n\t\t\t\t\n\t\t\t\tdocument.f1.telf_casa.value=cadena[6];\n\t\t\t\tdocument.f1.email.value=cadena[7];\n\t\t\t\tdocument.f1.telf_adic.value=cadena[8];\n\t\t\t\t\n\t\t\t\tdocument.f1.tipo_cliente.value=cadena[9];\n\t\t\t\tactiva_tipo_c()\n\t\t\t\tdocument.f1.inicial_doc.value=cadena[10];\n\t\t\t\tasigna_tipo_c(cadena[3],cadena[4]);\n\t\t\t\tdocument.f1.fecha_nac.value=formatdatei(cadena[11]);\n\t\t\t\tdialog.close();\n\t\t\t}\n\t\t}]\n\t}).open();\n\t\t\t\n\t\t\t \n\t\t\t}\n\t\t\t\n\t\t\tbreak;\n\t\tcase \"vista_tecnico\":\n\t\t\tdocument.f1.id_persona.value=cadena[1];\n\t\t\tdocument.f1.cedula.value=cadena[2];\n\t\t\tdocument.f1.nombre.value=cadena[3];\n\t\t\tdocument.f1.apellido.value=cadena[4];\n\t\t\tdocument.f1.telefono.value=cadena[5];\n\t\t\t\n\t\t\tdocument.f1.num_tecnico.value=cadena[6];\n\t\t\tdocument.f1.direccion_tec.value=cadena[7]; \n\t\t\tdocument.f1.email.value=cadena[8];\n\t\t\ttraeRadiosattus_gerente(cadena[9]);\n\t\t\t\n\t\t\tdocument.f1.id_franq.value=cadena[10];\n\t\t\t\n\t\t\tbreak;\n\t\tcase \"tipo_orden\":\n\t\t\tdocument.f1.id_tipo_orden.value=cadena[1];\n\t\t\tdocument.f1.nombre_tipo_orden.value=cadena[2];\n\t\t\tbreak;\n\t\tcase \"detalle_orden\":\n\t\t\tdocument.f1.id_det_orden.value=cadena[1];\n\t\t\tdocument.f1.id_tipo_orden.value=cadena[2]\n\t\t\tdocument.f1.nombre_det_orden.value=cadena[3];\n\t\t\t//document.f1.tipo_detalle.value=cadena[4];\n\t\t\tasignarCheck(cadena[4]);\n\t\t\tif(cadena[5]!=''){\n\t\t\t\tdocument.f1.status[0].click();\n\t\t\t\tdocument.f1.id_serv.value=cadena[5];\n\t\t\t}\n\t\t\telse{\n\t\t\t\tdocument.f1.status[1].click();\n\t\t\t\tdocument.f1.id_serv.value='0';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"ordenes_tecnicos\":\n\t\t//alerta(formatdatei(cadena[17])+\":\"+fecha_orden());\n\t\t\tif(formatdatei(cadena[17])==fecha_orden()){\n\t\t\tdocument.f1.id_orden.value=cadena[1];\n\t\t\tdocument.f1.id_persona.value=cadena[2];\n\t\t\tdocument.f1.id_det_orden.value=cadena[3];\n\t\t\tdocument.f1.fecha_orden.value=formatdatei(cadena[4]);\n\t\t\tdocument.f1.fecha_final.value=cadena[5];\n\t\t\tdocument.f1.detalle_orden.value=cadena[6];\n\t\t\tdocument.f1.comentario_orden.value=cadena[7];\n\t\t\tdocument.f1.status_orden.value=cadena[8];\n\t\t\tdocument.f1.id_contrato.value=cadena[9];\n\t\t\tdocument.f1.prioridad.value=cadena[10];\n\t\t\ttraerTO();\n\t\t\tconexionPHP(\"validarExistencia.php\",\"1=@vista_contrato\",\"id_contrato=@\"+id_contrato());\n\t\t\t}else{\n\t\t\t\talerta(\"Aviso, error solo puede modificar una finalizada el dia de hoy\");\n\t\t\t\t\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"vista_orden\":\n\n\t\t\t\n\t\t\tdocument.f1.id_orden.value=cadena[1];\n\t\t\tdocument.f1.fecha_imp.value=cadena[2];\n\t\t\tdocument.f1.id_det_orden.value=cadena[3];\n\t\t\tdocument.f1.fecha_orden.value=formatdatei(cadena[4]);\n\t\t\tdocument.f1.fecha_final.value=cadena[5];\n\t\t\tdocument.f1.detalle_orden.value=cadena[6];\n\t\t\tdocument.f1.comentario_orden.value=cadena[7];\n\t\t\tdocument.f1.status_orden.value=cadena[8];\n\t\t\tdocument.f1.id_contrato.value=cadena[9];\n\t\t\tdocument.f1.prioridad.value=cadena[10];\n\t\t\t\n\t\t\tdocument.f1.id_tipo_orden.value=cadena[11];\n\t\t\t\n\t\t\t\n\n\t\t\t//conexionPHP(\"validarExistencia.php\",\"1=@vista_contrato\",\"id_contrato=@\"+id_contrato());\n\t\t\t\tdocument.f1.id_contrato.value=cadena[1];\n\t\t\t\tdocument.f1.nro_contrato.value=cadena[5];\n\t\t\t\t\n\t\t\t\tdocument.f1.cedula.value=cadena[13];\n\t\t\t\tdocument.f1.nombre.value=cadena[14];\n\t\t\t\tdocument.f1.apellido.value=cadena[15];\n\t\t\t\t\n\t\t\t\tdocument.f1.status_pago.value=cadena[21];\n\t\t\t\t\n\t\t\t\tdocument.f1.id_sector.value=cadena[25];\n\t\t\t\tdocument.f1.id_zona.value=cadena[23];\n\t\t\t\tdocument.f1.id_calle.value=cadena[27];\n\t\t\t\t\n\t\t\t\tdocument.f1.status_con.value=cadena[21];\n\t\t\t\t//conexionPHP('informacion.php',\"traerTOStatus\",status_con());\n\t\t\t\t//conexionPHP('informacion.php',\"verificaOrden\",id_contrato());\n\t\t\t\t\n\t\t\tbreak;\n\t\tcase \"franquicia\":\n\t\t\tdocument.f1.id_franq.value=cadena[1];\n\t\t\tdocument.f1.nombre_franq.value=cadena[2];\n\t\t\tdocument.f1.estado_franq.value=cadena[3];\n\t\t\tdocument.f1.ciudad_franq.value=cadena[4];\n\t\t\tdocument.f1.municipio_franq.value=cadena[5];\n\t\t\tdocument.f1.direccion_franq.value=cadena[6];\n\t\t\tbreak;\n\t\tcase \"parametros\":\n\t\t\tdocument.f1.id_param.value=cadena[1];\n\t\t\tdocument.f1.id_franq.value=cadena[2];\n\t\t\tdocument.f1.fecha_param.value=formatdatei(cadena[3]);\n\t\t\tdocument.f1.parametro.value=cadena[4];\n\t\t\tdocument.f1.valor_param.value=cadena[5];\n\t\t\tdocument.f1.obser_param.value=cadena[6];\n\t\t\tbreak;\n\t\tcase \"calle\":\n\t\t\tdocument.f1.id_calle.value=cadena[1];\n\t\t\tdocument.f1.id_sector.value=cadena[2];\n\t\t\tdocument.f1.nro_calle.value=cadena[3];\n\t\t\tdocument.f1.nombre_calle.value=cadena[4];\n\t\t\ttraerZona();\n\t\t\tbreak;\n\t\tcase \"urbanizacion\":\n\t\t\tdocument.f1.id_calle.value=cadena[1];\n\t\t\tdocument.f1.id_sector.value=cadena[2];\n\t\t\t\n\t\t\tdocument.f1.nombre_calle.value=cadena[3];\n\t\t\ttraerZona();\n\t\t\tbreak;\n\t\tcase \"vista_calle\":\n\t\t\tdocument.f1.id_calle.value=cadena[1];\n\t\t\tdocument.f1.id_sector.value=cadena[2];\n\t\t\tdocument.f1.nro_calle.value=cadena[3];\n\t\t\tdocument.f1.nombre_calle.value=cadena[4];\n\t\t\t\n\t\t\tdocument.f1.id_zona.value=cadena[5];\n\t\t\tdocument.f1.id_franq.value=cadena[8];\n\t\t\tbreak;\n\t\tcase \"vista_sector\":\n\t\t\tdocument.f1.id_sector.value=cadena[1];\n\t\t\tdocument.f1.id_zona.value=cadena[2];\n\t\t\tdocument.f1.nro_sector.value=cadena[3];\n\t\t\tdocument.f1.nombre_sector.value=cadena[4];\n\t\t\tdocument.f1.id_franq.value=cadena[5];\n\t\t\tdocument.f1.dato.value=cadena[13];\n\t\t\tdocument.f1.afiliacion.value=cadena[14];\n\t\t\tbreak;\n\t\tcase \"sector\":\n\t\t\tdocument.f1.id_sector.value=cadena[1];\n\t\t\tdocument.f1.id_zona.value=cadena[2];\n\t\t\tdocument.f1.nro_sector.value=cadena[3];\n\t\t\tdocument.f1.nombre_sector.value=cadena[4];\n\t\t\ttraer_ciudad();\n\t\t\tbreak;\n\t\tcase \"zona\":\n\t\t\tdocument.f1.id_zona.value=cadena[1];\n\t\t\t\n\t\t\tdocument.f1.nro_zona.value=cadena[3];\n\t\t\tdocument.f1.nombre_zona.value=cadena[4];\n\t\t\tdocument.f1.id_ciudad.value=cadena[6];\n\t\t\ttraer_municipio();\n\t\t\tbreak;\n\t\tcase \"materiales\":\n\t\t\t\n\t\t\tdocument.f1.id_mat.value=cadena[1];\n\t\t\tdocument.f1.numero_mat.value=cadena[2];\n\t\t\tdocument.f1.nombre_mat.value=cadena[3];\n\t\t\tdocument.f1.unidad_mat.value=cadena[4];\n\t\t\tdocument.f1.abrevia_unidad.value=cadena[5];\n\t\t\tdocument.f1.cant_existencia.value=cadena[6];\n\t\t\tdocument.f1.precio.value=cadena[7];\n\t\t\tif(claseGlobal==\"ent_sal_mat\"){\n\t\t\t\texisteMat=true;\n\t\t\t\tdivDataGrid=\"datagrid\"; params = ''; tblpage = ''; tblorder = ''; tblfilter = '';\n\t\t\t\tarchivoDataGrid=\"procesos/datagrid_ent_sal_mat.php?id_mat=\"+id_mat()+\"&\";\n\t\t\t\tupdateTable();\n\t\t\t}\n\t\t\tif(claseGlobal==\"sal_mat\"){\n\t\t\t\texisteMat=true;\n\t\t\t\tdivDataGrid=\"datagrid\"; params = ''; tblpage = ''; tblorder = ''; tblfilter = '';\n\t\t\t\tarchivoDataGrid=\"procesos/datagrid_sal_mat.php?id_mat=\"+id_mat()+\"&\";\n\t\t\t\tupdateTable();\n\t\t\t}\n\t\t\telse{\n\t\t\t\tdocument.f1.observacion.value=cadena[8];\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"vista_materiales\":\n\t\t\tdocument.f1.id_ent_sal.value=cadena[1];\n\t\t\tdocument.f1.id_mat.value=cadena[2];\n\t\t\tdocument.f1.tipo_ent_sal.value=cadena[3];\n\t\t\tdocument.f1.fecha_ent_sal.value=formatdatei(cadena[4]);\n\t\t\tdocument.f1.hora_ent_sal.value=cadena[5];\n\t\t\tdocument.f1.cant_ent_sal.value=cadena[6];\n\t\t\tdocument.f1.precio_compra.value=cadena[7];\n\t\t\tdocument.f1.observacion.value=cadena[8];\n\t\t\t\n\t\t\tdocument.f1.numero_mat.value=cadena[9];\n\t\t\tdocument.f1.nombre_mat.value=cadena[10];\n\t\t\tdocument.f1.unidad_mat.value=cadena[11];\n\t\t\tdocument.f1.abrevia_unidad.value=cadena[12];\n\t\t\tdocument.f1.cant_existencia.value=cadena[13];\n\t\t\tdocument.f1.precio.value=cadena[14];\n\t\t\texisteMat=true;\n\t\t\tbreak;\n\t\tcase \"inventario\":\n\t\t\tdocument.f1.id_inv.value=cadena[1];\n\t\t\tdocument.f1.fecha_inv.value=formatdatei(cadena[2]);\n\t\t\tdocument.f1.hora_inv.value=cadena[3];\n\t\t\tdocument.f1.obser_inv.value=cadena[4];\n\t\t\tbreak;\n\t\tcase \"inventario_materiales\":\n\t\t\tdocument.f1.id_mat.value=cadena[1];\n\t\t\tdocument.f1.id_inv.value=cadena[2];\n\t\t\tdocument.f1.cantidad.value=cadena[3];\n\t\t\tbreak;\n\t\tcase \"tipo_servicio\":\n\t\t\tdocument.f1.id_tipo_servicio.value=cadena[1];\n\t\t\tdocument.f1.tipo_servicio.value=cadena[2];\n\t\t\ttraeRadiostatus_servicio(cadena[3]);\n\t\t\tdocument.f1.id_franq.value=cadena[4];\n\t\t\tbreak;\n\t\tcase \"servicios\":\n\t\t\tdocument.f1.id_serv.value=cadena[1];\n\t\t\tdocument.f1.id_tipo_servicio.value=cadena[2];\n\t\t\tdocument.f1.nombre_servicio.value=cadena[3];\n\t\t\ttraeRadiostatus_serv(cadena[4]);\n\t\t\ttraeRadiotipo_costo(cadena[5]);\n\t\t\thab_tipo_paq();\n\t\t\tdocument.f1.tipo_paq.value=cadena[6];\n\t\t\tdocument.f1.obser_serv.value=cadena[7];\n\t\t\tdocument.f1.tarifa_esp.value=cadena[8]; \n\t\t\tdocument.f1.tipo_serv.value=cadena[10];\n\t\t\tdocument.f1.id_paq.value=cadena[11];\n\t\t\tdocument.f1.id_cant.value=cadena[12];\n\t\t\t\n\t\t\tconexionPHP(\"informacion.php\",\"traer_serv_acc\",document.f1.id_serv.value);\n\t\t\tconexionPHP(\"informacion.php\",\"traer_serv_franq\",document.f1.id_serv.value);\n\n\t\t\tbreak;\n\t\tcase \"vista_tarifa\":\n\t\t\tdocument.f1.id_tar_ser.value=cadena[1];\n\t\t\tdocument.f1.id_serv.value=cadena[2];\n\t\t\tdocument.f1.fecha_tar_ser.value=formatdatei(cadena[3]);\n\t\t\tdocument.f1.hora_tar_ser.value=cadena[4];\n\t\t\tdocument.f1.obser_tarifa_ser.value=cadena[5];\n\t\t\ttraeRadiostatus_tarifa_ser(cadena[6]);\n\t\t\tdocument.f1.tarifa_ser.value=cadena[7];\n\t\t\t\n\t\t\tdocument.f1.id_tipo_servicio.value=cadena[8];\n\t\t\t\n\t\t\tbreak;\n\t\tcase \"contrato_servicio\":\n\t\t\tdocument.f1.id_cont_serv.value=cadena[1];\n\t\t\tdocument.f1.id_serv.value=cadena[2];\n\t\t\t//document.f1.id_contrato.value=cadena[3];\n\t\t\tdocument.f1.cant_serv.value=cadena[5];\n\t\t\tdocument.f1.costo_cobro.value=cadena[7];\n\t\t\tdocument.f1.agregar.value=\"Modificar\";\n\t\t\tbreak;\n\t\t\n\t\tcase \"pago_servicio\":\n\t\t\tdocument.f1.id_pago.value=cadena[1];\n\t\t\tdocument.f1.id_cont_serv.value=cadena[2];\n\t\t\tbreak;\n\t\tcase \"pagos\":\n\t\t\tdocument.f1.id_pago.value=cadena[1];\n\t\t\tdocument.f1.id_caja_cob.value=cadena[2];\n\t\t\tdocument.f1.fecha_pago.value=formatdatei(cadena[3]);\n\t\t\tdocument.f1.hora_pago.value=cadena[4];\n\t\t\tdocument.f1.monto_pago.value=cadena[5];\n\t\t\tdocument.f1.obser_pago.value=cadena[6];\n\t\t\tdocument.f1.status_pago.value=cadena[7];\n\t\t\tdocument.f1.nro_factura.value=cadena[8];\n\t\t\tdocument.f1.id_contrato.value=cadena[9];\n\t\t\t\n\t\t\t/*\n\t\t\t\tdocument.f1.total.value=cadena[19];\n\t\t\t\tdocument.f1.desc.value=cadena[14];\n\t\t\t\tdocument.f1.monto_iva.value=cadena[16];\n\t\t\t\tdocument.f1.porc_reten.value=cadena[17];\n\t\t\t\tdocument.f1.monto_reten.value=cadena[18];\n\t\t\t\tdocument.f1.islr.value=cadena[20];\n\t\t\t\tdocument.f1.status_contrato.value=cadena[12];\n\t\t\t\tdocument.f1.fecha_factura.value=formatdatei(cadena[22]);\n*/\t\t\t\t\n\n\t\t\tif(claseGlobal==\"anular_pagos\" || claseGlobal==\"nota_de_credito\"){\n\t\t\t\t\n\t\t\t\tconexionPHP('validarExistencia.php','1=@vista_contrato',\"id_contrato=@\"+document.f1.id_contrato.value);\n\t\t\t\tconexionPHP('validarExistencia.php','1=@detalle_tipopago',\"id_pago=@\"+document.f1.id_pago.value);\n\t\t\t\tconexionPHP(\"informacion.php\",\"traeinfoFact\",id_pago());\n\t\t\t\tdivDataGrid=\"datagrid\"; params = ''; tblpage = ''; tblorder = ''; tblfilter = '';\n\t\t\t\tarchivoDataGrid=\"procesos/datagrid_anular_pagos.php?&id_pago=\"+id_pago()+\"&\";\n\t\t\t\tupdateTable();\n\t\t\t\t\n\t\t\t}else if(claseGlobal==\"consultar_pagos\"){\n\t\t\t\t\n\t\t\t\tconexionPHP('validarExistencia.php','1=@vista_contrato',\"id_contrato=@\"+document.f1.id_contrato.value);\n\t\t\t\tconexionPHP('validarExistencia.php','1=@detalle_tipopago',\"id_pago=@\"+document.f1.id_pago.value);\n\t\t\t\tdivDataGrid=\"datagrid\"; params = ''; tblpage = ''; tblorder = ''; tblfilter = '';\n\t\t\t\tarchivoDataGrid=\"procesos/datagrid_anular_pagos.php?&id_pago=\"+id_pago()+\"&\";\n\t\t\t\tupdateTable();\n\t\t\t\t\n\t\t\t}else if(claseGlobal==\"modificar_pagos\"){\n\t\t\t\tconexionPHP(\"informacion.php\",\"traeinfo_forma_pago\",id_pago());\n\t\t\t}else if(claseGlobal==\"modificar_pagos1\"){\n\t\t\t\tdocument.f1.nro_factura1.value=cadena[8];\n\t\t\t\tdocument.f1.nro_control1.value=cadena[12];\n\t\t\t}\n\t\t\t\n\t\t\tbreak;\n\t\tcase \"detalle_tipopago\":\n\t\t\tdocument.f1.id_tipo_pago.value=cadena[1];\n\t\t\t//cargarDetTipoPago();\n\t\t\tdocument.f1.banco.value=cadena[3];\n\t\t\tdocument.f1.numero.value=cadena[4];\n\t\t\t\n\t\t\tdocument.f1.banco.disabled=true;\n\t\t\tdocument.f1.numero.disabled=true;\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tbreak;\n\t\tcase \"vista_tipopago\":\n\t\t\tdocument.f1.id_pago.value=cadena[2];\n\t\t\tdocument.f1.id_caja_cob.value=cadena[6];\n\t\t\tdocument.f1.fecha_pago.value=formatdatei(cadena[7]);\n\t\t\tdocument.f1.hora_pago.value=cadena[8];\n\t\t\tdocument.f1.monto_pago.value=cadena[9];\n\t\t\tdocument.f1.obser_pago.value=cadena[10];\n\t\t\tdocument.f1.status_pago.value=cadena[11];\n\t\t\tdocument.f1.nro_factura.value=cadena[12];\n\t\t\t\n\t\t\tdocument.f1.id_tipo_pago.value=cadena[1];\n\t\t\tcargarDetTipoPago();\t\n\t\t\tdocument.f1.banco.value=cadena[3];\n\t\t\tdocument.f1.numero.value=cadena[4];\n\t\t\t\n\t\t\tdocument.f1.banco.disabled=true;\n\t\t\tdocument.f1.numero.disabled=true;\n\t\t\t\n\t\t\tif(claseGlobal==\"anular_pagos\"){\n\t\t\t\t\n\t\t\t\tconexionPHP('validarExistencia.php','1=@vista_contrato',\"id_contrato=@\"+cadena[15])\n\t\t\t\tconexionPHP('validarExistencia.php','1=@vista_contrato',\"id_contrato=@\"+cadena[15])\n\t\t\t\tconexionPHP(\"informacion.php\",\"traeinfoFact\",id_pago());\n\t\t\t\tdivDataGrid=\"datagrid\"; params = ''; tblpage = ''; tblorder = ''; tblfilter = '';\n\t\t\t\tarchivoDataGrid=\"procesos/datagrid_anular_pagos.php?&id_pago=\"+id_pago()+\"&\";\n\t\t\t\tupdateTable();\n\t\t\t\t\n\t\t\t}\n\t\t\telse if(claseGlobal==\"modificar_pagos\"){\n\t\t\t\tdocument.f1.monto_tp.value=cadena[5];\n\t\t\t\tdocument.f1.nro_factura1.value=cadena[12];\t\n\t\t\t\tmonto_tp=cadena[9];\n\t\t\t\tcargarDetTipoPago();\n\t\t\t}\n\t\t\telse if(claseGlobal==\"modificar_pagos1\"){\n\t\t\t\tdocument.f1.nro_factura1.value=cadena[12];\n\t\t\t\tcargarDetTipoPago();\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"vista_pagoser\":\n\t\t\tdocument.f1.id_contrato.value=cadena[11];\n\t\t\tconexionPHP('validarExistencia.php','1=@vista_contrato',\"id_contrato=@\"+id_contrato())\n\t\t\tbreak;\n\t\tcase \"tipo_pago\":\n\t\t\tdocument.f1.id_tipo_pago.value=cadena[1];\n\t\t\tdocument.f1.tipo_pago.value=cadena[2];\n\t\t\ttraeRadiostatus_pago(cadena[3]);\n\t\t\tbreak;\n\t\tcase \"cirre_diario\":\n\t\t\tdocument.f1.id_cierre.value=cadena[1];\n\t\t\tdocument.f1.fecha_cierre.value=formatdatei(cadena[2]);\n\t\t\tdocument.f1.hora_cierre.value=cadena[3];\n\t\t\tdocument.f1.monto_total.value=cadena[4];\n\t\t\tdocument.f1.obser_cierre.value=cadena[5];\n\t\t\tdocument.f1.id_franq.value=cadena[7];\n\t\t\tbreak;\n\t\tcase \"cierre_pago\":\n\t\t\tdocument.f1.id_cont_serv.value=cadena[1];\n\t\t\tdocument.f1.id_cierre.value=cadena[2];\n\t\t\tbreak;\n\t\tcase \"caja\":\n\t\t\tdocument.f1.id_caja.value=cadena[1];\n\t\t\tdocument.f1.nombre_caja.value=cadena[2];\n\t\t\tdocument.f1.descripcion_caja.value=cadena[3];\n\t\t\tdocument.f1.id_franq.value=cadena[7];\n\t\t\ttraeRadiostatus_caja(cadena[4]);\n\t\t\t//alerta(cadena[5]);\n\t\t\ttraeRadiotipo_caja(cadena[8]);\n\t\t\tbreak;\n\t\tcase \"caja_cobrador\":\n\t\t\tdocument.f1.id_caja_cob.value=cadena[1];\n\t\t\tdocument.f1.id_caja.value=cadena[2];\n\t\t\tdocument.f1.id_persona.value=cadena[3];\n\t\t\tdocument.f1.fecha_caja.value=formatdatei(cadena[4]);\n\t\t\tdocument.f1.apertura_caja.value=cadena[5];\n\t\t\t//document.f1.cierre_caja.value=cadena[6];\n\t\t\t//document.f1.monto_acum.value=cadena[7];\n\t\t\t//document.f1.status_caja.value=cadena[8];\n\t\t\tdocument.f1.registrar.disabled=false;\n\t\t\t\n\t\t\tbreak;\n\t\tcase \"vista_reclamo\":\n\t\t\tdocument.f1.id_rec.value=cadena[1];\n\t\t\tdocument.f1.id_persona.value=cadena[2];\n\t\t\tdocument.f1.nro_rec.value=cadena[3];\n\t\t\ttraeRadiotipo_rec(cadena[4]);\n\t\t\tdocument.f1.fecha_rec.value=formatdatei(cadena[5]);\n\t\t\tdocument.f1.hora_rec.value=cadena[6];\n\t\t\tdocument.f1.motivo_rec.value=cadena[7];\n\t\t\tdocument.f1.descrip_rec.value=cadena[8];\n\t\t\tdocument.f1.denunciado.value=cadena[9];\n\t\t\tdocument.f1.status_rec.value=cadena[10];\n\t\t\t\n\t\t\tdocument.f1.cedula.value=cadena[11];\n\t\t\tdocument.f1.nombre.value=cadena[12]+\" \"+cadena[13];\n\t\t\t\n\t\t\t\n\t\t\tbreak;\n\t\tcase \"vista_comentario\":\n\t\t\tdocument.f1.id_comen.value=cadena[1];\n\t\t\tdocument.f1.id_persona.value=cadena[2];\n\t\t\tdocument.f1.nro_comen.value=cadena[3];\n\t\t\tdocument.f1.fecha_comen.value=formatdatei(cadena[4]);\n\t\t\tdocument.f1.hora_comen.value=cadena[5];\n\t\t\tdocument.f1.comentario.value=cadena[6];\n\t\t\ttraeRadiostatus_comen(cadena[7]);\n\t\t\t\n\t\t\t\n\t\t\t\tdocument.f1.cedula.value=cadena[8];\n\t\t\t\tdocument.f1.nombre.value=cadena[9]+\" \"+cadena[10];\n\t\t\tbreak;\n\t\tcase \"pago_comisiones\":\n\t\t\tdocument.f1.id_comi.value=cadena[1];\n\t\t\tdocument.f1.id_persona.value=cadena[2];\n\t\t\ttraeRadiocomi_para(cadena[3]);\n\t\t\tdocument.f1.fecha_comi.value=formatdatei(cadena[4]);\n\t\t\tdocument.f1.fecha_desde.value=formatdatei(cadena[5]);\n\t\t\tdocument.f1.fecha_hasta.value=formatdatei(cadena[6]);\n\t\t\tdocument.f1.porcent_aplic.value=cadena[7];\n\t\t\tdocument.f1.monto_comi.value=cadena[8];\n\t\t\tdocument.f1.status_comi.value=cadena[9];\n\t\t\tbreak;\n\t\tcase \"status_contrato\":\n\t\t\tdocument.f1.dato.value=cadena[1];\n\t\t\tdocument.f1.status_contrato.value=cadena[2];\n\t\t\tdocument.f1.id_contrato.value=cadena[3];\n\t\t\tdocument.f1.nombre_status.value=cadena[4];\n\t\t\tdocument.f1.fecha_status.value=formatdatei(cadena[5]);\n\t\t\tdocument.f1.hora_status.value=cadena[6];\n\t\t\tdocument.f1.status_con.value=cadena[7];\n\t\t\tbreak;\n\t\tcase \"edificio\":\n\t\t\tdocument.f1.id_edif.value=cadena[1];\n\t\t\tdocument.f1.id_sector.value=cadena[2];\n\t\t\tdocument.f1.edificio.value=cadena[3];\n\t\t\ttraerZona();\n\t\t\tbreak;\n\t\tcase \"banco\":\n\t\t\tdocument.f1.id_banco.value=cadena[1];\n\t\t\tdocument.f1.banco.value=cadena[2];\n\t\t\tdocument.f1.tipo_banco.value=cadena[3];\n\t\t\tbreak;\n\t\tcase \"grupo_trabajo\":\n\t\t\t//alerta(cadena);\n\t\t\tdocument.f1.id_gt.value=cadena[1];\n\t\t\tdocument.f1.nombre_grupo.value=cadena[5];\n\t\t\tdocument.f1.organizar_por.value=cadena[4];\n\t\t\tdocument.f1.fecha_creacion.value=formatdatei(cadena[2]);\n\t\t\tdocument.f1.hora_creacion.value=cadena[3];\n\t\t\tdocument.f1.id_franq.value=cadena[7];\n\t\t\ttraeRadiostatus_grupo(cadena[6]);\n\t\t\t\n\t\t\ttrae_ubi_gru_f_G=true;\n\t\t\tdivDataGrid=\"grupo_ubicacion\";params = ''; tblpage = ''; tblorder = ''; tblfilter = '';\n\t\t\tarchivoDataGrid=\"procesos/datagrid_grupo_ubicacion.php?organizar_por=\"+document.f1.organizar_por.value+\"&\";\n\t\t\tupdateTable();\n\t\t\n\t\t\tconexionPHP(\"informacion.php\",\"trae_tec_gru\",id_gt());\n\t\t\n\t\t\tbreak;\n\t\tcase \"grupo_tecnico\":\n\t\t\tdocument.f1.id_gt.value=cadena[1];\n\t\t\tdocument.f1.id_persona.value=cadena[2];\n\t\t\tbreak;\n\t\tcase \"orden_grupo\":\n\t\t\tdocument.f1.id_orden.value=cadena[1];\n\t\t\tdocument.f1.id_gt.value=cadena[2];\n\t\t\tbreak;\n\t\tcase \"sms\":\n\t\t\tdocument.f1.dato.value=cadena[1];\n\t\t\tdocument.f1.id_sms.value=cadena[2];\n\t\t\tdocument.f1.id_contrato.value=cadena[3];\n\t\t\tdocument.f1.nro_sms.value=cadena[4];\n\t\t\tdocument.f1.tipo_sms.value=cadena[5];\n\t\t\tdocument.f1.telefono_sms.value=cadena[6];\n\t\t\tdocument.f1.fecha_sms.value=cadena[7];\n\t\t\tdocument.f1.hora_sms.value=cadena[8];\n\t\t\tdocument.f1.mensaje_sms.value=cadena[9];\n\t\t\tdocument.f1.status_sms.value=cadena[10];\n\t\t\tdocument.f1.login.value=cadena[11];\n\t\t\tbreak;\n\t\tcase \"envio_aut\":\n\t\t\tdocument.f1.id_envio.value=cadena[1];\n\t\t\tdocument.f1.id_franq.value=cadena[2];\n\t\t\tdocument.f1.tipo_envio.value=cadena[3];\n\t\t\tdocument.f1.nombre_envio.value=cadena[4];\n\t\t\tdocument.f1.envio_sms.value=cadena[5];\n\t\t\tdocument.f1.envio_email.value=cadena[6];\n\t\t\tdocument.f1.descripcion_envio.value=cadena[7];\n\t\t\tdocument.f1.tipo_variable.value=cadena[9];\n\t\t\tdocument.f1.resp_correo.value=cadena[10];\n\t\t\tif(claseGlobal==\"edit_envio_aut\"){\n\t\t\t\tcuenta_carac();\n\t\t\t\t\n\t\t\t\tdivDataGrid=\"datagrid\"; params = ''; tblpage = ''; tblorder = ''; tblfilter = '';\n\t\t\t\tarchivoDataGrid=\"procesos/listadovariables.php?tipo_variable=\"+tipo_variable()+\"&\";\n\t\t\t\tupdateTable();\n\t\t\t}\n\t\t\t\n\t\t\tbreak;\n\t\tcase \"comandos_sms\":\n\t\t\tdocument.f1.id_com.value=cadena[1];\n\t\t\tdocument.f1.id_franq.value=cadena[2];\n\t\t\tdocument.f1.tipo_com.value=cadena[3];\n\t\t\tdocument.f1.nombre_com.value=cadena[4];\n\t\t\tdocument.f1.descrip_com.value=cadena[5];\n\t\t\tdocument.f1.status_com.value=cadena[6];\n\t\t\tdocument.f1.sms_resp.value=cadena[7];\n\t\t\tdocument.f1.tipo_variable.value=cadena[8];\n\t\t\tdocument.f1.sms_error.value=cadena[9];\n\t\t\tdocument.f1.status_error.value=cadena[10];\n\t\t\tdocument.f1.resp_correo.value=cadena[11];\n\t\t\t\n\t\t\tif(claseGlobal==\"edit_comandos_sms\"){\n\t\t\t\tcuenta_carac_com();\n\t\t\t\tcuenta_carac_com_e();\n\t\t\t\t\n\t\t\t\tdivDataGrid=\"datagrid\"; params = ''; tblpage = ''; tblorder = ''; tblfilter = '';\n\t\t\t\tarchivoDataGrid=\"procesos/listadovariables.php?tipo_variable=\"+tipo_variable()+\"&\";\n\t\t\t\tupdateTable();\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"formato_sms\":\n\t\t\tif(claseGlobal==\"datos_mensajes\"){\n\t\t\t\tdocument.f1.sms.value=cadena[4];\n\t\t\t}\n\t\t\telse{\n\t\t\tdocument.f1.id_form.value=cadena[1];\n\t\t\tdocument.f1.id_franq.value=cadena[2];\n\t\t\tdocument.f1.nombre_form.value=cadena[3];\n\t\t\tdocument.f1.formato.value=cadena[4];\n\t\t\ttraeRadiostatus_form(cadena[5]);\n\t\t\t}\n\t\t\t\n\t\t\tbreak;\n\t\tcase \"config_sms\":\n\t\t\tdocument.f1.id_conf_sms.value=cadena[1];\n\t\t\tdocument.f1.id_franq.value=cadena[2];\n\t\t\tdocument.f1.cod_telf_pais.value=cadena[3];\n\t\t\tdocument.f1.telefono_serv.value=cadena[4];\n\t\t\tdocument.f1.id_canal_sms.value=cadena[5];\n\t\t\tdocument.f1.correo_emp.value=cadena[6];\n\t\t\tdocument.f1.clave_correo.value=cadena[7];\n\t\t\tdocument.f1.asunto_correo.value=cadena[8];\n\t\t\ttraeRadioper_telf_fijo(cadena[9]);\n\t\t\ttraeRadioenv_todos_telf(cadena[10]); \n\t\t\ttraeRadioact_resp_aut(cadena[11]);\n\t\t\tdocument.f1.sms_resp_aut.value=cadena[12];\n\t\t\tdocument.f1.conf_campo1.value=cadena[13];\n\t\t\tdocument.f1.conf_campo2.value=cadena[14];\n\t\t\tdocument.f1.conf_campo3.value=cadena[15];\n\t\t\tdocument.f1.marca.value=cadena[16];\n\t\t\tdocument.f1.modelo.value=cadena[17];\n\t\t\thab_text_sms();\n\t\t\t\n\t\t\tcuenta_carac_d();\n\t\t\tbreak;\n\t\tcase \"vista_gerentes\":\n\t\t\tdocument.f1.id_persona.value=cadena[1];\n\t\t\tdocument.f1.cedula.value=cadena[2];\n\t\t\tdocument.f1.nombre.value=cadena[3];\n\t\t\tdocument.f1.apellido.value=cadena[4];\n\t\t\tdocument.f1.telefono.value=cadena[5];\n\t\t\tdocument.f1.nro_gerente.value=cadena[6];\n\t\t\tdocument.f1.tipo_gerente.value=cadena[7];\n\t\t\tdocument.f1.cargo_gerente.value=cadena[8];\n\t\t\tdocument.f1.descrip_gerente.value=cadena[9];\n\t\t\ttraeRadiosattus_gerente(cadena[10]);\n\t\t\tdocument.f1.email.value=cadena[11];\n\t\t\tdocument.f1.id_franq.value=cadena[12];\n\t\t\tbreak;\n\t\tcase \"variables_sms\":\n\t\t\tdocument.f1.id_var.value=cadena[1];\n\t\t\tdocument.f1.variable.value=cadena[2];\n\t\t\tasignarCheck(cadena[3]);\n\t\t\tdocument.f1.descrip_var.value=cadena[4];\n\t\t\ttraeRadiostatus_var(cadena[5]);\n\t\t\tdocument.f1.id_franq.value=cadena[6];\n\t\t\tbreak;\n\t\tcase \"statuscont\":\n\t\t\tdocument.f1.idstatus.value=cadena[1];\n\t\t\tdocument.f1.nombrestatus.value=cadena[2];\n\t\t\tdocument.f1.dato.value=cadena[4];\n\t\t\ttraeRadiostatus(cadena[3]);\n\t\t\tbreak;\n\t\tcase \"motivonotas\":\n\t\t\tdocument.f1.idmotivonota.value=cadena[1];\n\t\t\tdocument.f1.nombremotivonota.value=cadena[2];\n\t\t\ttraeRadiostatus(cadena[3]);\n\t\t\tbreak;\n\t\tcase \"motivollamada\":\n\t\t\tdocument.f1.idmotivonota.value=cadena[1];\n\t\t\tdocument.f1.nombremotivonota.value=cadena[2];\n\t\t\ttraeRadiostatus(cadena[3]);\n\t\t\tbreak;\n\t\tcase \"otros_datos\":\n\t\t\tdocument.f1.dato.value=cadena[1];\n\t\t\tbreak;\n\t\tcase \"contrato_ser\":\n\t\t\t/*document.f1.dato.value=cadena[];\n\t\t\tdocument.f1.id_seg.value=cadena[];\n\t\t\tdocument.f1.firma_seg.value=cadena[];\n\t\t\tdocument.f1.llave_enc.value=cadena[];\n\t\t\t*/\n\t\t\tdocument.f1.llave_dec.value=cadena[1];\n\t\t\tdocument.f1.licencia_seg.value=cadena[3];\n\t\t\tdocument.f1.limite_reg.value=cadena[2];\n\t\t\tdocument.f1.fecha_lic.value=formatdatei(cadena[4]);\n\t\t\tdocument.f1.hora_lic.value=cadena[5];\n\t\t\tdocument.f1.empresa_aut.value=cadena[6];\n\t\t\tdocument.f1.version_sis.value=cadena[7];\n\t\t\tdocument.f1.acerca_de.value=cadena[8];\n\t\t\tdocument.f1.status_seg.value=cadena[9];\n\t\t\t/*document.f1.campo_seg1.value=cadena[];\n\t\t\tdocument.f1.campo_seg2.value=cadena[];\n\t\t\tdocument.f1.campo_seg3.value=cadena[];\n\t\t\tdocument.f1.campo_seg4.value=cadena[];\n\t\t\tdocument.f1.campo_seg5.value=cadena[];\n\t\t\tdocument.f1.campo_seg6.value=cadena[];\n\t\t\tdocument.f1.campo_seg7.value=cadena[];\n\t\t\t*/\n\t\t\tbreak;\n\t\tcase \"familia\":\n\t\t\tdocument.f1.dato.value=cadena[1];\n\t\t\tdocument.f1.id_fam.value=cadena[2];\n\t\t\tdocument.f1.nombre_fam.value=cadena[3];\n\t\t\ttraeRadiostatus_fam(cadena[4]);\n\t\t\tbreak;\n\t\tcase \"grupo_afinidad\":\n\t\t\tdocument.f1.id_g_a.value=cadena[1];\n\t\t\tdocument.f1.nombre_g_a.value=cadena[2];\n\t\t\ttraeRadiostatus_g_a(cadena[3]);\n\t\t\tbreak;\n\t\tcase \"tipo_alarma\":\n\t\t\tdocument.f1.id_tipo_alarma.value=cadena[1];\n\t\t\tdocument.f1.nombre_alarma.value=cadena[2];\n\t\t\ttraeRadiostatus_alarma(cadena[3]);\n\t\t\tbreak;\n\t\tcase \"alarma_perfil\":\n\t\t\tdocument.f1.codigoperfil.value=cadena[1];\n\t\t\tdocument.f1.id_tipo_alarma.value=cadena[2];\n\t\t\tbreak;\n\t\tcase \"interfazacc\":\n\t\t\tdocument.f1.id_alarma.value=cadena[1];\n\t\t\tdocument.f1.id_tipo_alarma.value=cadena[2];\n\t\t\tdocument.f1.nombre_alarma.value=cadena[3];\n\t\t\tdocument.f1.detalle_alarma.value=cadena[4];\n\t\t\tdocument.f1.fecha_alarma.value=formatdatei(cadena[5]);\n\t\t\tdocument.f1.ref_alarma.value=cadena[6];\n\t\t\tdocument.f1.status_alarma.value=cadena[7];\n\t\t\tbreak;\n\t\tcase \"grupo_ubicacion\":\n\t\t\tdocument.f1.id_gt.value=cadena[1];\n\t\t\tdocument.f1.id_sector.value=cadena[2];\n\t\t\tbreak;\n\t\tcase \"estacion_trabajo\":\n\t\t\tdocument.f1.id_est.value=cadena[1];\n\t\t\tdocument.f1.login.value=cadena[2];\n\t\t\tdocument.f1.nombre_est.value=cadena[3];\n\t\t\tdocument.f1.ip_est.value=cadena[4];\n\t\t\tdocument.f1.mac_est.value=cadena[5];\n\t\t\tdocument.f1.nom_comp.value=cadena[6];\n\t\t\ttraeRadiostatus_est(cadena[7]);\n\t\t\tbreak;\n\t\tcase \"precintos\":\n\t\t\tdocument.f1.id_prec.value=cadena[1];\n\t\t\tdocument.f1.login.value=cadena[2];\n\t\t\tdocument.f1.nombre_prec.value=cadena[3];\n\t\t\tdocument.f1.fecha_ing_prec.value=formatdatei(cadena[4]);\n\t\t\tdocument.f1.fecha_mod_prec.value=formatdatei(cadena[5]);\n\t\t\ttraeRadiostatus_prec(cadena[6]);\n\t\t\tbreak;\n\t\tcase \"estado\":\n\t\t\tdocument.f1.id_esta.value=cadena[1];\n\t\t\tdocument.f1.id_franq.value=cadena[2];\n\t\t\tdocument.f1.nombre_esta.value=cadena[3];\n\t\t\ttraeRadiostatus_esta(cadena[4]);\n\t\t\tbreak;\n\t\tcase \"vista_municipio\":\n\t\t\t\n\t\t\tdocument.f1.id_mun.value=cadena[1];\n\t\t\tdocument.f1.id_esta.value=cadena[2];\n\t\t\tdocument.f1.nombre_mun.value=cadena[3];\n\t\t\ttraeRadiostatus_mun(cadena[4]);\n\t\t\tdocument.f1.id_franq.value=cadena[5];\n\t\t\tbreak;\n\t\tcase \"vista_ciudad\":\n\t\t\t\n\t\t\tdocument.f1.id_ciudad.value=cadena[1];\n\t\t\tdocument.f1.id_mun.value=cadena[2];\n\t\t\tdocument.f1.nombre_ciudad.value=cadena[3];\n\t\t\ttraeRadiostatus_ciudad(cadena[4]);\n\t\t\tdocument.f1.id_esta.value=cadena[5];\n\t\t\tdocument.f1.id_franq.value=cadena[8];\n\t\t\tbreak;\n\t\t/*\n\t\tcase \"cablemodem\":\n\t\tif(claseGlobal==\"act_contrato\"){\n\t\t\tdocument.f1.id_cm.value=cadena[1];\n\t\t\tdocument.f1.codigo_cm.value=cadena[3];\n\t\t\tdocument.f1.status_cm.value=cadena[7];\n\t\t\tdocument.f1.marca_cm.value=cadena[4];\n\t\t\tdocument.f1.modelo_cm.value=cadena[5];\n\t\t\tdocument.f1.agregarcm.value=\"Modificar\";\n\t\t}\n\t\telse{\n\t\t\tdocument.f1.id_cm.value=cadena[1];\n\t\t\tdocument.f1.id_contrato.value=cadena[2];\n\t\t\tdocument.f1.codigo_cm.value=cadena[3];\n\t\t\tdocument.f1.marca_cm.value=cadena[4];\n\t\t\tdocument.f1.modelo_cm.value=cadena[5];\n\t\t\t//document.f1.prov_cm.value=cadena[6];\n\t\t\tdocument.f1.status_cm.value=cadena[7];\n\t\t\t//document.f1.fecha_act_cm.value=formatdatei(cadena[8]);\n\t\t\t//document.f1.obser_cm.value=cadena[9];\n\t\t\t//document.f1.nota1.value=cadena[10];\n\t\t\t//document.f1.nota2.value=cadena[11];\n\t\t\t//document.f1.nota3.value=cadena[12];\n\t\t//\tdocument.f1.agregarcm.value=\"Modificar\";\n\t\t}\n\t\t\tbreak;\n\t\t\t*/\n\t\tcase \"cablemodem\":\n\t\t\t\t\n\t\t\tif(claseGlobal=='act_contrato'){\n\t\t\t\tdocument.f1.id_cm.value=cadena[1];\n\t\t\t\tdocument.f1.codigo_cm.value=cadena[3];\n\t\t\t\tdocument.f1.status_cm.value=cadena[7];\n\t\t\t\tdocument.f1.nota1.value=cadena[10];\n\t\t\t\tdocument.f1.nota2.value=cadena[11];\n\t\t\t\tdocument.f1.agregarcm.value=\"Modificar\";\n\t\t\t}\n\t\t\telse if(claseGlobal==\"interfaz_cablemodem\"){\n\t\t\t\tdocument.f1.id_da.value=cadena[1];\n\t\t\t\tdocument.f1.id_contrato.value=cadena[2];\n\t\t\t\tdocument.f1.codigo_da.value=cadena[3];\n\t\t\t\tdocument.f1.marca_da.value=cadena[4];\n\t\t\t\tdocument.f1.modelo_da.value=cadena[5];\n\t\t\t\tdocument.f1.status_da.value=cadena[7];\n\t\t\t\tdocument.f1.nota1.value=cadena[10];\n\t\t\t\tdocument.f1.nota2.value=cadena[11];\t\t\n\t\t\t\t\n\t\t\t\tdocument.f1.serial_deco.value=document.f1.codigo_da.value;\n\t\t\t\tconexionPHP(\"validarExistencia.php\",\"1=@vista_contrato\",\"id_contrato=@\"+document.f1.id_contrato.value);\n\t\t\t\t\n\t\t\t\tdivDataGrid=\"datagrid\"; params = ''; tblpage = ''; tblorder = ''; tblfilter = '';\n\t\t\t\tarchivoDataGrid=\"procesos/datagrid_interfaz_cablemodem.php?serial_deco=\"+document.f1.serial_deco.value+\"&\";\n\t\t\t\tupdateTable();\n\t\t\t\n\t\t\t//document.f1.servicio.value=cadena[13];\n\t\t\t\n\t\t\t}\n\t\t\telse if(claseGlobal=='cablemodem'){\n\t\t\t\tdocument.f1.id_cm.value=cadena[1];\n\t\t\t\tdocument.f1.codigo_cm.value=cadena[3];\n\t\t\t\tdocument.f1.status_cm.value=cadena[7];\n\t\t\t\t\n\t\t\t\tdocument.f1.marca_cm.value=cadena[4];\n\t\t\t\tdocument.f1.modelo_cm.value=cadena[5];\n\t\t\t\tdocument.f1.fecha_act_cm.value=formatdatei(cadena[8]);\n\t\t\t\tdocument.f1.obser_cm.value=cadena[9];\n\t\t\t\tdocument.f1.nota1.value=cadena[10];\n\t\t\t\tdocument.f1.nota2.value=cadena[11];\t\n\t\t\t\tdocument.f1.nota3.value=cadena[12];\t\n\t\t\t\tdocument.f1.id_contrato.value=cadena[2];\t\n\t\t\t\tc_id_contrato();\t\n\t\t\t}\n\t\t\tbreak;/*\n\t\tcase \"deco_ana\":\n\t\t\tdocument.f1.id_da.value=cadena[1];\n\t\t\tdocument.f1.id_contrato.value=cadena[2];\n\t\t\tdocument.f1.codigo_da.value=cadena[3];\n\t\t\tdocument.f1.marca_da.value=cadena[4];\n\t\t\tdocument.f1.modelo_da.value=cadena[5];\n\t\t\t//document.f1.prov_da.value=cadena[6];\n\t\t\tdocument.f1.tipo_da.value=cadena[7];\n\t\t\t//document.f1.chanmap_da.value=cadena[8];\n\t\t\t//document.f1.punto_da.value=cadena[9];\n\t\t\tdocument.f1.status_da.value=cadena[10];\n\t\t\t//document.f1.fecha_act_da.value=formatdatei(cadena[11]);\n\t\t\t//document.f1.obser_da.value=cadena[12];\n\t\t\tdocument.f1.servicio.value=cadena[13];\n\t\t\t//document.f1.nota2.value=cadena[14];\n\t\t\t//document.f1.nota3.value=cadena[15];\n\t\t\tdocument.f1.agregarda.value=\"Modificar\";\n\t\t\tbreak;\n\t\t\t*/\n\t\tcase \"info_adic\":\n\t\t\tdocument.f1.id_inf_a.value=cadena[1];\n\t\t\tdocument.f1.info_a.value=cadena[3];\n\t\t\tdocument.f1.desc_a.value=cadena[4];\n\t\t\tdocument.f1.agregar_info_adic.value=\"MODIFICAR\";\n\t\t\tbreak;\n\t\t\n\t\tcase \"promocion\":\n\t\t\t//document.f1.dato.value=cadena[1];\n\t\t\tif(claseGlobal==\"agregar_promo_contrato\"){\n\t\t\t\tdocument.f1.fecha_promo.value=formatdatei(cadena[4]);\n\t\t\t\tdocument.f1.inicio_promo.value=formatdatei(cadena[5]);\n\t\t\t\tdocument.f1.fin_promo.value=formatdatei(cadena[6]);\n\t\t\t\tdocument.f1.mes_promo.value=cadena[7];\n\t\t\t\tdocument.f1.tipo_promo.value=cadena[8];\n\t\t\t\tdocument.f1.descuento_promo.value=cadena[9];\n\t\t\t}\n\t\t\telse{\n\t\t\t\tdocument.f1.id_promo.value=cadena[2];\n\t\t\t\tdocument.f1.nombre_promo.value=cadena[3];\n\t\t\t\tdocument.f1.fecha_promo.value=formatdatei(cadena[4]);\n\t\t\t\tdocument.f1.inicio_promo.value=formatdatei(cadena[5]);\n\t\t\t\tdocument.f1.fin_promo.value=formatdatei(cadena[6]);\n\t\t\t\tdocument.f1.mes_promo.value=cadena[7];\n\t\t\t\tdocument.f1.tipo_promo.value=cadena[8];\n\t\t\t\tdocument.f1.descuento_promo.value=cadena[9];\n\t\t\t\tdocument.f1.login.value=cadena[10];\n\t\t\t\ttraeRadiostatus_promo(cadena[11]);\n\t\t\t\tconexionPHP('informacion.php',\"asignar_promo_serv\",id_promo());\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"promo_serv\":\n\t\t\tdocument.f1.dato.value=cadena[1];\n\t\t\tdocument.f1.id_serv.value=cadena[2];\n\t\t\tdocument.f1.id_promo.value=cadena[3];\n\t\t\tbreak;\n\t\tcase \"promo_contrato\":\n\t\t\t//document.f1.dato.value=cadena[1];\n\t\t\tdocument.f1.id_promo_con.value=cadena[2];\n\t\t\tdocument.f1.id_contrato.value=cadena[3];\n\t\t\tdocument.f1.id_promo.value=cadena[4];\n\t\t//\tdocument.f1.inicio_promo.value=formatdatei(cadena[5]);\n\t\t//\tdocument.f1.fin_promo.value=formatdatei(cadena[6]);\n\t\t//\tdocument.f1.login.value=cadena[7];\n\t\t\ttraeRadiostatus_promo_con(cadena[8]);\n\t\t\tconexionPHP(\"validarExistencia.php\",\"1=@vista_contrato\",\"id_contrato=@\"+id_contrato());\n\t\t\tcargar_promocion();\n\t\t\tbreak;\n\t\tcase \"convenio_pago\":\n\t\t\tdocument.f1.dato.value=cadena[1];\n\t\t\tdocument.f1.id_conv.value=cadena[2];\n\t\t\tdocument.f1.fecha_conv.value=formatdatei(cadena[3]);\n\t\t\tdocument.f1.obser_conv.value=cadena[4];\n\t\t\tdocument.f1.login.value=cadena[5];\n\t\t//\tdocument.f1.status_conv.value=cadena[6];\n\t\t\ttraeRadiostatus_conv(cadena[6]);\n\t\t\tbreak;\n\t\tcase \"conv_con\":\n\t\t\tdocument.f1.dato.value=cadena[1];\n\t\t\tdocument.f1.id_conv_cont.value=cadena[2];\n\t\t\tdocument.f1.id_conv.value=cadena[3];\n\t\t\tdocument.f1.id_cont_serv.value=cadena[4];\n\t\t\tdocument.f1.fecha_ven.value=formatdatei(cadena[5]);\n\t\t\tbreak;\n\t\tcase \"asigna_recibo\":\n\t\t\tdocument.f1.dato.value=cadena[1];\n\t\t\tdocument.f1.id_asig.value=cadena[2];\n\t\t\tfor(i=0;i<document.f1.id_cobrador.options.length;i++)\n\t\t\t{\n\t\t\t\tif(document.f1.id_cobrador.options[i].value==cadena[3])\n\t\t\t\t\tdocument.f1.id_cobrador.selectedIndex=i;\t\n\t\t\t}\n\t\t\tdocument.f1.fecha_asig.value=formatdatei(cadena[4]);\n\t\t\tdocument.f1.obser_asig.value=cadena[5];\n\t\t\tdocument.f1.login_asig.value=cadena[6];\n\t\t\tdocument.f1.desde.value=cadena[7];\n\t\t\tdocument.f1.hasta.value=cadena[8];\n\t\t\tdocument.f1.cantidad.value=cadena[9];\n\t\t\tbreak;\n\t\tcase \"recibos\":\n\t\t\tdocument.f1.dato.value=cadena[1];\n\t\t\tdocument.f1.nro_recibo.value=cadena[2];\n\t\t\tdocument.f1.id_asig.value=cadena[3];\n\t\t\tdocument.f1.id_rec.value=cadena[4];\n\t\t\tdocument.f1.status_pago.value=cadena[5];\n\t\t\tbreak;\n\t\tcase \"recibe_recibo\":\n\t\t\tdocument.f1.dato.value=cadena[1];\n\t\t\tdocument.f1.id_rec.value=cadena[2];\n\t\t\tfor(i=0;i<document.f1.id_cobrador.options.length;i++)\n\t\t\t{\n\t\t\t\tif(document.f1.id_cobrador.options[i].value==cadena[3])\n\t\t\t\t\tdocument.f1.id_cobrador.selectedIndex=i;\t\n\t\t\t}\n\t\t\tdocument.f1.fecha_rec.value=formatdatei(cadena[4]);\n\t\t\tdocument.f1.obser_rec.value=cadena[5];\n\t\t\tdocument.f1.login_rec.value=cadena[6];\n\t\t\tbreak;\n\t\tcase \"pagodeposito\":\n\t\t\tdocument.f1.monto_dep.value=cadena[1];\n\t\t\tdocument.f1.id_pd.value=cadena[2];\n\t\t\tdocument.f1.id_contrato.value=cadena[3];\n\t\t\tdocument.f1.fecha_reg.value=formatdatei(cadena[4]);\n\t\t\tdocument.f1.hora_reg.value=cadena[5];\n\t\t\tdocument.f1.login_reg.value=cadena[6];\n\t\t\tdocument.f1.fecha_dep.value=formatdatei(cadena[7]);\n\t\t\tdocument.f1.banco.value=cadena[8];\n\t\t\tdocument.f1.numero_ref.value=cadena[9];\n\t\t\tdocument.f1.fecha_conf.value=formatdatei(cadena[10]);\n\t\t\tdocument.f1.hora_conf.value=cadena[11];\n\t\t\tdocument.f1.login_conf.value=cadena[12];\n\t\t\tdocument.f1.status_pd.value=cadena[13];\n\t\t\tdocument.f1.fecha_proc.value=formatdatei(cadena[14]);\n\t\t\ttraeRadiotipo_dt(cadena[15]);\n\t\t\tdocument.f1.login_proc.value=cadena[16];\n\t\t\tdocument.f1.cedula_titular.value=cadena[17];\n\t\t\tdocument.f1.obser_p.value=cadena[18];\n\t\t\t\n\t\t\tconexionPHP(\"validarExistencia.php\",\"1=@vista_contrato_todo\",\"id_contrato=@\"+id_contrato());\n\t\t\tbreak;\n\t\tcase \"conf_comision\":\n\t\t\tdocument.f1.dato.value=cadena[1];\n\t\t\tdocument.f1.pago_comisones.value=cadena[2];\n\t\t\tfor(i=0;i<document.f1.id_franq.options.length;i++)\n\t\t\t{\n\t\t\t\tif(document.f1.id_franq.options[i].value==cadena[3])\n\t\t\t\t\tdocument.f1.id_franq.selectedIndex=i;\t\n\t\t\t}\n\t\t\tdocument.f1.fecha_confc.value=formatdatei(cadena[4]);\n\t\t\tdocument.f1.status_confc.value=cadena[5];\n\t\t\tdocument.f1.porc_acord.value=cadena[6];\n\t\t\tdocument.f1.porc_com_reca.value=cadena[7];\n\t\t\tdocument.f1.porc_com_venta.value=cadena[8];\n\t\t\tdocument.f1.porc_ret_iva.value=cadena[9];\n\t\t\tdocument.f1.porc_ret_islr.value=cadena[10];\n\t\t\tdocument.f1.descuento_conf.value=cadena[11];\n\t\t\ttraeRadiotipo_e_p(cadena[12]);\n\t\t\tdocument.f1.empresa_confc.value=cadena[13];\n\t\t\tdocument.f1.rif_empresa.value=cadena[14];\n\t\t\tdocument.f1.represen_confc.value=cadena[15];\n\t\t\tdocument.f1.cedula_rep.value=cadena[16];\n\t\t\tdocument.f1.desc_confc.value=cadena[17];\n\t\t\tbreak;\n\t\tcase \"pago_comisones\":\n\t\t\tdocument.f1.dato.value=cadena[1];\n\t\t\tdocument.f1.id_pago_com.value=cadena[2];\n\t\t\tfor(i=0;i<document.f1.id_confc.options.length;i++)\n\t\t\t{\n\t\t\t\tif(document.f1.id_confc.options[i].value==cadena[3])\n\t\t\t\t\tdocument.f1.id_confc.selectedIndex=i;\t\n\t\t\t}\n\t\t\tdocument.f1.nro_comprob.value=cadena[4];\n\t\t\tdocument.f1.fecha_pc.value=formatdatei(cadena[5]);\n\t\t\tdocument.f1.p_desde.value=formatdatei(cadena[6]);\n\t\t\tdocument.f1.p_hasta.value=formatdatei(cadena[7]);\n\t\t\tdocument.f1.total_cob_sis.value=cadena[8];\n\t\t\tdocument.f1.por_comision.value=cadena[9];\n\t\t\tdocument.f1.monto_comision.value=cadena[10];\n\t\t\tdocument.f1.monto_ret_iva.value=cadena[11];\n\t\t\tdocument.f1.monto_ret_islr.value=cadena[12];\n\t\t\tdocument.f1.total_reintegro.value=cadena[13];\n\t\t\tdocument.f1.monto_desc.value=cadena[14];\n\t\t\tdocument.f1.total_deposito.value=cadena[15];\n\t\t\tdocument.f1.realizado_por.value=cadena[16];\n\t\t\tdocument.f1.registrado_por.value=cadena[17];\n\t\t\tdocument.f1.pagado_por.value=cadena[18];\n\t\t\tdocument.f1.status_pago_com.value=cadena[19];\n\t\t\tbreak;\n\t\tcase \"servidor\":\n\t\t\tdocument.f1.database.value=cadena[1];\n\t\t\tdocument.f1.id_servidor.value=cadena[2];\n\t\t\tdocument.f1.nombre_servidor.value=cadena[3];\n\t\t\tdocument.f1.direc_servidor.value=cadena[4];\n\t\t\ttraeRadiostatus_servidor(cadena[5]);\n\t\t\ttraeRadiosincronizar(cadena[6]);\n\t\t\ttraeRadiostatus_ser(cadena[7]);\n\t\t\tdocument.f1.direccio_ip.value=cadena[8];\n\t\t\tdocument.f1.usuario_p.value=cadena[9];\n\t\t\tdocument.f1.clave_p.value=cadena[10];\n\t\t\tbreak;\n\t\tcase \"inicial_id\":\n\t\t\tdocument.f1.dato.value=cadena[1];\n\t\t\tdocument.f1.id_inicial_id.value=cadena[2];\n\t\t\tfor(i=0;i<document.f1.id_servidor.options.length;i++)\n\t\t\t{\n\t\t\t\tif(document.f1.id_servidor.options[i].value==cadena[3])\n\t\t\t\t\tdocument.f1.id_servidor.selectedIndex=i;\t\n\t\t\t}\n\t\t\tdocument.f1.inicial.value=cadena[4];\n\t\t\tdocument.f1.status.value=cadena[5];\n\t\t\tbreak;\n\t\tcase \"sincronizacion_servi\":\n\t\t\tdocument.f1.dato.value=cadena[1];\n\t\t\tdocument.f1.id_sinc.value=cadena[2];\n\t\t\tfor(i=0;i<document.f1.id_servidor.options.length;i++)\n\t\t\t{\n\t\t\t\tif(document.f1.id_servidor.options[i].value==cadena[3])\n\t\t\t\t\tdocument.f1.id_servidor.selectedIndex=i;\t\n\t\t\t}\n\t\t\tdocument.f1.fecha_sinc.value=formatdatei(cadena[4]);\n\t\t\tdocument.f1.hora_sin.value=cadena[5];\n\t\t\tdocument.f1.oid_inicial.value=cadena[6];\n\t\t\tdocument.f1.oid_final.value=cadena[7];\n\t\t\tdocument.f1.status_sinc.value=cadena[8];\n\t\t\tbreak;\n\t\tcase \"descuento_pronto_pag\":\n\t\t\tdocument.f1.dato.value=cadena[1];\n\t\t\tdocument.f1.id_dpp.value=cadena[2];\n\t\t\tfor(i=0;i<document.f1.id_franq.options.length;i++)\n\t\t\t{\n\t\t\t\tif(document.f1.id_franq.options[i].value==cadena[3])\n\t\t\t\t\tdocument.f1.id_franq.selectedIndex=i;\t\n\t\t\t}\n\t\t\tfor(i=0;i<document.f1.dia_dpp.options.length;i++)\n\t\t\t{\n\t\t\t\tif(document.f1.dia_dpp.options[i].value==cadena[4])\n\t\t\t\t\tdocument.f1.dia_dpp.selectedIndex=i;\t\n\t\t\t}\n\t\t\tdocument.f1.monto_dpp.value=cadena[5];\n\t\t\tasignarCheck(cadena[6]);\n\t\t\ttraeRadiostatus_dpp(cadena[7]);\n\t\t\tdocument.f1.obser_dpp.value=cadena[8];\n\t\t\tbreak;\n\t\tcase \"orden_tabla_cortes\":\n\t\t\tdocument.f1.dato.value=cadena[1];\n\t\t\tdocument.f1.id_tc.value=cadena[2];\n\t\t\tdocument.f1.id_orden.value=cadena[3];\n\t\t\tbreak;\n\t\tcase \"tabla_cortes\":\n\t\t\tdocument.f1.dato.value=cadena[1];\n\t\t\tdocument.f1.id_tc.value=cadena[2];\n\t\t\tfor(i=0;i<document.f1.id_franq.options.length;i++)\n\t\t\t{\n\t\t\t\tif(document.f1.id_franq.options[i].value==cadena[3])\n\t\t\t\t\tdocument.f1.id_franq.selectedIndex=i;\t\n\t\t\t}\n\t\t\tdocument.f1.fecha_tc.value=formatdatei(cadena[4]);\n\t\t\tdocument.f1.id_gt.value=formatdatei(cadena[5]);\n\t\t\tdocument.f1.obser_tc.value=cadena[6];\n\t\t\ttraeRadiostatus_tc(cadena[7]);\n\t\t\tbreak;\n\t\tcase \"cuenta_bancos\":\n\t\t\tdocument.f1.dato.value=cadena[1];\n\t\t\tdocument.f1.id_cb.value=cadena[2];\n\t\t\tfor(i=0;i<document.f1.banco.options.length;i++)\n\t\t\t{\n\t\t\t\tif(document.f1.banco.options[i].value==cadena[3])\n\t\t\t\t\tdocument.f1.banco.selectedIndex=i;\t\n\t\t\t}\n\t\t\tdocument.f1.fecha_cb.value=formatdatei(cadena[4]);\n\t\t\tfor(i=0;i<document.f1.tipo_db.options.length;i++)\n\t\t\t{\n\t\t\t\tif(document.f1.tipo_db.options[i].value==cadena[5])\n\t\t\t\t\tdocument.f1.tipo_db.selectedIndex=i;\t\n\t\t\t}\n\t\t\tdocument.f1.referencia_db.value=cadena[6];\n\t\t\tdocument.f1.monto_db.value=cadena[7];\n\t\t\tdocument.f1.descrip_db.value=cadena[8];\n\t\t\tdocument.f1.status_db.value=cadena[9];\n\t\t\tfor(i=0;i<document.f1.tipo_cb.options.length;i++)\n\t\t\t{\n\t\t\t\tif(document.f1.tipo_cb.options[i].value==cadena[10])\n\t\t\t\t\tdocument.f1.tipo_cb.selectedIndex=i;\t\n\t\t\t}\n\t\t\tdocument.f1.relacion_cb.value=cadena[11];\n\t\t\tdocument.f1.login_conf.value=cadena[12];\n\t\t\tdocument.f1.fecha_reg.value=formatdatei(cadena[13]);\n\t\t\tbreak;\n\t\tcase \"conciliacion_pago\":\n\t\t\tdocument.f1.dato.value=cadena[1];\n\t\t\tdocument.f1.id_conc.value=cadena[2];\n\t\t\tfor(i=0;i<document.f1.id_franq.options.length;i++)\n\t\t\t{\n\t\t\t\tif(document.f1.id_franq.options[i].value==cadena[3])\n\t\t\t\t\tdocument.f1.id_franq.selectedIndex=i;\t\n\t\t\t}\n\t\t\tdocument.f1.fecha_conc.value=formatdatei(cadena[4]);\n\t\t\tfor(i=0;i<document.f1.banco.options.length;i++)\n\t\t\t{\n\t\t\t\tif(document.f1.banco.options[i].value==cadena[5])\n\t\t\t\t\tdocument.f1.banco.selectedIndex=i;\t\n\t\t\t}\n\t\t\tdocument.f1.refer_conc.value=cadena[6];\n\t\t\tdocument.f1.monto_conc.value=cadena[7];\n\t\t\tdocument.f1.status_conc.value=cadena[8];\n\t\t\tdocument.f1.login_conc.value=cadena[9];\n\t\t\tdocument.f1.obser_conc.value=cadena[10];\n\t\t\tbreak;\n\t\tcase \"asigna_llamada\":\n\t\t\tdocument.f1.dato.value=cadena[1];\n\t\t\tdocument.f1.id_all.value=cadena[2];\n\t\t\tdocument.f1.ubica_all.value=cadena[3];\n\t\t\tdocument.f1.fecha_all.value=formatdatei(cadena[4]);\n\t\t\tdocument.f1.login_enc.value=cadena[5];\n\t\t\tdocument.f1.login_resp.value=cadena[6];\n\t\t\tdocument.f1.obser_all.value=cadena[7];\n\t\t\tdocument.f1.status_all.value=cadena[8];\n\t\t\tbreak;\n\t\tcase \"asig_lla_cli\":\n\t\t\tdocument.f1.dato.value=cadena[1];\n\t\t\tdocument.f1.id_lc.value=cadena[2];\n\t\t\tdocument.f1.id_all.value=cadena[3];\n\t\t\tdocument.f1.id_contrato.value=cadena[4];\n\t\t\tdocument.f1.id_lla.value=cadena[5];\n\t\t\tdocument.f1.status_lc.value=cadena[6];\n\t\t\tbreak;\n\t\tcase \"tipo_llamada\":\n\t\t\tdocument.f1.dato.value=cadena[1];\n\t\t\tdocument.f1.id_tll.value=cadena[2];\n\t\t\tdocument.f1.nombre_tll.value=cadena[3];\n\t\t\ttraeRadiostatus_tll(cadena[4]);\n\t\t\tbreak;\n\t\tcase \"llamadas\":\n\t\t\tdocument.f1.dato.value=cadena[1];\n\t\t\tdocument.f1.id_lla.value=cadena[2];\n\t\t\tfor(i=0;i<document.f1.id_drl.options.length;i++)\n\t\t\t{\n\t\t\t\tif(document.f1.id_drl.options[i].value==cadena[3])\n\t\t\t\t\tdocument.f1.id_drl.selectedIndex=i;\t\n\t\t\t}\n\t\t\tfor(i=0;i<document.f1.id_tll.options.length;i++)\n\t\t\t{\n\t\t\t\tif(document.f1.id_tll.options[i].value==cadena[4])\n\t\t\t\t\tdocument.f1.id_tll.selectedIndex=i;\t\n\t\t\t}\n\t\t\tdocument.f1.id_contrato.value=cadena[5];\n\t\t\tdocument.f1.fecha_lla.value=formatdatei(cadena[6]);\n\t\t\tdocument.f1.hora_lla.value=cadena[7];\n\t\t\tdocument.f1.login.value=cadena[8];\n\t\t\tdocument.f1.obser_lla.value=cadena[9];\n\t\t\ttraeRadiocrea_alarma(cadena[10]);\n\t\t\tconexionPHP(\"validarExistencia.php\",\"1=@vista_contrato\",\"id_contrato=@\"+id_contrato());\n\t\t\tbreak;\n\t\tcase \"detalle_resp\":\n\t\t\tdocument.f1.dato.value=cadena[1];\n\t\t\tdocument.f1.id_drl.value=cadena[2];\n\t\t\tfor(i=0;i<document.f1.id_trl.options.length;i++)\n\t\t\t{\n\t\t\t\tif(document.f1.id_trl.options[i].value==cadena[3])\n\t\t\t\t\tdocument.f1.id_trl.selectedIndex=i;\t\n\t\t\t}\n\t\t\tdocument.f1.nombre_drl.value=cadena[4];\n\t\t\ttraeRadiostatus_drl(cadena[5]);\n\t\t\tbreak;\n\t\tcase \"tipo_resp\":\n\t\t\tdocument.f1.dato.value=cadena[1];\n\t\t\tdocument.f1.id_trl.value=cadena[2];\n\t\t\tdocument.f1.nombre_trl.value=cadena[3];\n\t\t\ttraeRadiostatus_trl(cadena[4]);\n\t\t\tbreak;\n\t\t\n\t\tcase \"deco_ana\":\n\t\t\tif(claseGlobal==\"deco_ana\"){\n\t\t\t\tdocument.f1.id_da.value=cadena[1];\n\t\t\tdocument.f1.id_contrato.value=cadena[2];\n\t\t\tdocument.f1.codigo_da.value=cadena[3];\n\t\t\tdocument.f1.marca_da.value=cadena[4];\n\t\t\tdocument.f1.modelo_da.value=cadena[5];\n\t\t\t//document.f1.prov_da.value=cadena[6];\n\t\t\tdocument.f1.tipo_da.value=cadena[7];\n\t\t\t//document.f1.chanmap_da.value=cadena[8];\n\t\t\t//document.f1.punto_da.value=cadena[9];\n\t\t\tdocument.f1.status_da.value=cadena[10];\n\t\t\t//document.f1.fecha_act_da.value=formatdatei(cadena[11]);\n\t\t\tdocument.f1.obser_da.value=cadena[12];\n\t\t\t\n\t\t\tdocument.f1.servicio.value=cadena[13];\n\t\t\t//document.f1.nota2.value=cadena[14];\n\t\t\t//document.f1.nota3.value=cadena[15];\n\t\t\t//document.f1.agregarda.value=\"Modificar\";\n\t\t\t}\n\t\t\telse if(claseGlobal==\"interfazacc\"){\n\t\t\t\tdocument.f1.id_da.value=cadena[1];\n\t\t\t\tdocument.f1.id_contrato.value=cadena[2];\n\t\t\t\tdocument.f1.codigo_da.value=cadena[3];\n\t\t\t\tdocument.f1.marca_da.value=cadena[4];\n\t\t\t\tdocument.f1.modelo_da.value=cadena[5];\n\t\t\t\tdocument.f1.tipo_da.value=cadena[7];\n\t\t\t\tdocument.f1.status_da.value=cadena[10];\n\t\t\t\t\n\t\t\t\tdocument.f1.serial_deco.value=document.f1.codigo_da.value;\n\t\t\t\tconexionPHP(\"validarExistencia.php\",\"1=@vista_contrato\",\"id_contrato=@\"+document.f1.id_contrato.value);\n\t\t\t\t\n\t\t\t\tdivDataGrid=\"datagrid\"; params = ''; tblpage = ''; tblorder = ''; tblfilter = '';\n\t\t\t\tarchivoDataGrid=\"procesos/datagrid_interfazacc.php?serial_deco=\"+document.f1.serial_deco.value+\"&\";\n\t\t\t\tupdateTable();\n\t\t\t\n\t\t\t//document.f1.servicio.value=cadena[13];\n\t\t\t}\n\t\t\telse{\n\t\t\tdocument.f1.id_da.value=cadena[1];\n\t\t//\tdocument.f1.id_contrato.value=cadena[2];\n\t\t\tdocument.f1.codigo_da.value=cadena[3];\n\t\t\tdocument.f1.marca_da.value=cadena[4];\n\t\t\tdocument.f1.modelo_da.value=cadena[5];\n\t\t\t//document.f1.prov_da.value=cadena[6];\n\t\t\tdocument.f1.tipo_da.value=cadena[7];\n\t\t\t//document.f1.chanmap_da.value=cadena[8];\n\t\t\tdocument.f1.punto_da.value=cadena[9];\n\t\t\tdocument.f1.status_da.value=cadena[10];\n\t\t\t//document.f1.fecha_act_da.value=formatdatei(cadena[11]);\n\t\t\t//document.f1.obser_da.value=cadena[12];\n\t\t\tdocument.f1.servicio.value=cadena[13];\n\t\t\t//document.f1.nota2.value=cadena[14];\n\t\t\t//document.f1.nota3.value=cadena[15];\n\t\t\tdocument.f1.agregarda.value=\"Modificar\";\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"marca\":\n\t\t\tdocument.f1.dato.value=cadena[1];\n\t\t\tdocument.f1.id_marca.value=cadena[2];\n\t\t\tdocument.f1.nombre_marca.value=cadena[3];\n\t\t\ttraeRadiostatus_marca(cadena[4]);\n\t\t\tbreak;\n\t\tcase \"deco_servicio\":\n\t\t\tdocument.f1.dato.value=cadena[1];\n\t\t\tdocument.f1.id_cont_serv.value=cadena[2];\n\t\t\tdocument.f1.id_da.value=cadena[3];\n\t\t\tbreak;\n\t\tcase \"interfazacc\":\n\t\t\tdocument.f1.id_accquery.value=cadena[1];\n\t\t\tdocument.f1.serial_deco.value=cadena[2];\n\t\t\tdocument.f1.comando_acc.value=cadena[3];\n\t\t\ttraeRadiostatus_accquery(cadena[4]);\n\t\t\tdocument.f1.fecha_accquery.value=formatdatei(cadena[5]);\n\t\t\tbreak;\n\t\tcase \"interfaz_cablemodem\":\n\t\t\tdocument.f1.id_accquery.value=cadena[1];\n\t\t\tdocument.f1.serial_deco.value=cadena[2];\n\t\t\tdocument.f1.comando_acc.value=cadena[3];\n\t\t\ttraeRadiostatus_accquery(cadena[4]);\n\t\t\tdocument.f1.fecha_accquery.value=formatdatei(cadena[5]);\n\t\t\tbreak;\n\t\tcase \"modelo\":\n\t\t\tdocument.f1.dato.value=cadena[1];\n\t\t\tdocument.f1.id_modelo.value=cadena[2];\n\t\t\tfor(i=0;i<document.f1.id_marca.options.length;i++)\n\t\t\t{\n\t\t\t\tif(document.f1.id_marca.options[i].value==cadena[3])\n\t\t\t\t\tdocument.f1.id_marca.selectedIndex=i;\t\n\t\t\t}\n\t\t\tdocument.f1.nombre_modelo.value=cadena[4];\n\t\t\tfor(i=0;i<document.f1.id_tse.options.length;i++)\n\t\t\t{\n\t\t\t\tif(document.f1.id_tse.options[i].value==cadena[5])\n\t\t\t\t\tdocument.f1.id_tse.selectedIndex=i;\t\n\t\t\t}\n\t\t\ttraeRadiostatus_modelo(cadena[6]);\n\t\t\tbreak;\n\t\t\n\t\tcase \"detalle_tipopago_df\":\n\t\t\t//document.f1.dato.value=cadena[1];\n\t\t\tdocument.f1.id_dbf.value=cadena[1];\n\t\t\tfor(i=0;i<document.f1.id_tipo_pago.options.length;i++)\n\t\t\t{\n\t\t\t\tif(document.f1.id_tipo_pago.options[i].value==cadena[2])\n\t\t\t\t\tdocument.f1.id_tipo_pago.selectedIndex=i;\t\n\t\t\t}\n\t\t\tfor(i=0;i<document.f1.id_cuba.options.length;i++)\n\t\t\t{\n\t\t\t\tif(document.f1.id_cuba.options[i].value==cadena[3])\n\t\t\t\t\tdocument.f1.id_cuba.selectedIndex=i;\t\n\t\t\t}\n\t\t\tfor(i=0;i<document.f1.id_df_tp.options.length;i++)\n\t\t\t{\n\t\t\t\tif(document.f1.id_df_tp.options[i].value==cadena[4])\n\t\t\t\t\tdocument.f1.id_df_tp.selectedIndex=i;\t\n\t\t\t}\n\t\t\tdocument.f1.fecha_dbf.value=formatdatei(cadena[5]);\n\t\t\tdocument.f1.refer_dbf.value=cadena[6];\n\t\t\tdocument.f1.monto_dbf.value=cadena[7];\n\t\t\tdocument.f1.obser_dbf.value=cadena[8];\n\t\t\tdocument.f1.status_dbf.value=cadena[9];\n\t\t\tdocument.f1.hora_dbf.value=cadena[10];\n\t\t\tdocument.f1.login_dbf.value=cadena[11];\n\t\t\tbreak;\n\t\tcase \"carga_tabla_banco\":\n\t\t\t//document.f1.dato.value=cadena[1];\n\t\t\tdocument.f1.id_ctb.value=cadena[1];\n\t\t\tfor(i=0;i<document.f1.id_cuba.options.length;i++)\n\t\t\t{\n\t\t\t\tif(document.f1.id_cuba.options[i].value==cadena[2])\n\t\t\t\t\tdocument.f1.id_cuba.selectedIndex=i;\t\n\t\t\t}\n\t\t\tdocument.f1.fecha_ctb.value=formatdatei(cadena[3]);\n\t\t\tdocument.f1.hora_ctb.value=cadena[4];\n\t\t\tdocument.f1.login_ctb.value=cadena[5];\n\t\t\tdocument.f1.fecha_desde_ctb.value=formatdatei(cadena[6]);\n\t\t\tdocument.f1.fecha_hasta_ctb.value=formatdatei(cadena[7]);\n\t\t\tdocument.f1.status_ctb.value=cadena[8];\n\t\t\tdocument.f1.formato_ctb.value=cadena[9];\n\t\t\tbreak;\n\t\tcase \"tabla_bancos\":\n\t\t\t//document.f1.dato.value=cadena[1];\n\t\t\tdocument.f1.id_tb.value=cadena[1];\n\t\t\tdocument.f1.id_ctb.value=cadena[2];\n\t\t\tdocument.f1.fecha_tb.value=formatdatei(cadena[3]);\n\t\t\tdocument.f1.tipo_tb.value=cadena[4];\n\t\t\tdocument.f1.referencia_tb.value=cadena[5];\n\t\t\tdocument.f1.monto_tb.value=cadena[6];\n\t\t\tdocument.f1.descrip_tb.value=cadena[7];\n\t\t\tdocument.f1.status_tb.value=cadena[8];\n\t\t\tbreak;\n\t\tcase \"tipo_pago_df\":\n\t\t\t//document.f1.dato.value=cadena[1];\n\t\t\tdocument.f1.id_tipo_pago.value=cadena[1];\n\t\t\tdocument.f1.tipo_pago.value=cadena[2];\n\t\t\tfor(i=0;i<document.f1.tipo_tp.options.length;i++)\n\t\t\t{\n\t\t\t\tif(document.f1.tipo_tp.options[i].value==cadena[3])\n\t\t\t\t\tdocument.f1.tipo_tp.selectedIndex=i;\t\n\t\t\t}\n\t\t\ttraeRadiostatus_pago(cadena[4]);\n\t\t\tbreak;\n\t\tcase \"cuenta_bancaria\":\n\t\t\tdocument.f1.id_cuba.value=cadena[1];\n\t\t\tdocument.f1.numero_cuba.value=cadena[2];\n\t\t\tdocument.f1.banco_cuba.value=cadena[3];\n\t\t\tdocument.f1.abrev_cuba.value=cadena[4];\n\t\t\tdocument.f1.desc_cuba.value=cadena[5];\n\t\t\ttraeRadiostatus_cuba(cadena[6]);\n\t\t\ttraeRadioconc_cliente(cadena[7]);\n\t\t\ttraeRadioconc_franq(cadena[8]);\n\t\t\tdocument.f1.formato_archivo.value=cadena[9];\n\t\t\tdocument.f1.comision_pv.value=cadena[10];\n\t\t\tdocument.f1.comision_pv_c.value=cadena[11];\n\t\t\t//alert(cadena[5]);\n\t\t\t//traeRadiotipo_caja(cadena[6]);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t//alerta(\"ERROR, no esiste la Tabla\"+tabla); \n\t}\n}", "title": "" }, { "docid": "39e9cc2ed2ac4ea5c5048267aa132155", "score": "0.55316687", "text": "function ObligaCampos(objform) { \n/*---------------------------------------------------------------------\nPARAMETROS \n\tobjform ->(objeto) recibe el objeto formulario\nLLAMADA\n <form name=\"form1\" ...... onSubmit=\"return ObligaCampos(this)\">\nREFERENCIAS\n\nFECHA DE CREACION\n\t07/10/2004\n*----------------------------------------------------------------------*/\n var nErrTot=0; \n var nPas=-1;\n var sError=\"Mensajes del sistema: \"+\"\\n\\n\"; \n\n // RECORRO LOS ELEMENTOS DEL FORMULARIO\n for (var j=0; j<objform.elements.length; j++){ \n // OBTIENE EL NOMBRE DEL CAMPO\n\t valorcheecked=0;\n var sNom=objform.elements[j].name; \n\t\t\t // VERIFICA SI EL CAMPO ES OBLIGATORIO\n\n\t\t\t //SI ES CAMPO FILE\n\t\t\t if (objform.elements[j].value=='' \n\t\t\t\t\t&& sNom.substring(0,1).toUpperCase()=='A' \n\t\t\t\t\t&& sNom.substring(1,2)=='r'\n\t\t\t\t\t&& objform.elements[j].type!=\"checkbox\"){\n\t\t\t\t\tif (objform.elements[j-1].value=='') { \n\t\t\t\t\t sError+=\"Campo '\"+objform.elements[j].id+\"' es obligatorio\"+\"\\n\" \n\t\t\t\t\t nErrTot+=1;}\n\t\t\t }\n\t\t\t else\n\t\t\t\t if (sNom.substring(1,2)=='r') {\n\t\t\t\t\tif (objform.elements[j].value=='') { \n\t\t\t\t\t sError+=\"Campo '\"+objform.elements[j].id+\"' es obligatorio\"+\"\\n\" \n\t\t\t\t\t nErrTot+=1;}\n\t\t\t\t }\n\n///\t\t\t\n\t\t\t// VERIFICA SI EL CAMPO ES DEL TIPO OPTION BUTTON\n\t\t\t if (sNom.substring(0,1).toUpperCase()=='O' && sNom.substring(1,2)=='r') {\n\t\t\t\t\t//recorro todos los elementos del option\n\t\t\t\t\tnamecheck=objform.elements[j].name;\n\t\t\t\t\tdo {\n\t\t\t\t\t\tif(objform.elements[j].checked)\n\t\t\t\t\t\t\tvalorcheecked=1;\n\t\t\t\t\t\tj+=1;\n\t\t\t\t\t}while (j<objform.elements.length && objform.elements[j].name==namecheck)\n\t\t\t\t j-=1;\n\t\t\t\t\t\n\t\t\t\t if(!valorcheecked){\n\t\t\t\t\t sError+=\"Selección de campo '\"+objform.elements[j].id+\"' es obligatorio\"+\"\\n\" ;\n\t\t\t\t\t\tnErrTot+=1;} \n\t\t\t\t }\n///\n\t\t\t// VERIFICA SI EL CAMPO ES EMAIL\n\t\t\t if (sNom.substring(0,1).toUpperCase()=='C' && objform.elements[j].type!='checkbox' && objform.elements[j].value!='') {\n\t\t\t\t\tif (/^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$/.test(objform.elements[j].value)){}\n\t\t\t\t\telse{\n\t\t\t\t\t sError+=\"Campo '\"+objform.elements[j].id+\"' no es valido\"+\"\\n\" ;\n\t\t\t\t\t nErrTot+=1;}\n\t\t\t\t\t}\n\n\t\t\t// VERIFICA SI EL CAMPO ES IP\n\t\t\t if (sNom.substring(0,1).toUpperCase()=='I' && objform.elements[j].value!='') {\n\t\t\t\t\tpartes=objform.elements[j].value.split('.'); \n\t\t\t\t if (partes.length==4) { \n\t\t\t\t\t\tfor (i=0;i<4;i++) { \n\t\t\t\t\t\t\tnum=partes[i]; \n\t\t\t\t\t\t\tif (num>255 || num<0 || num.length==0 || isNaN(num)){ \n\t\t\t\t\t\t\t sError+=\"Campo '\"+objform.elements[j].id+\"' no es valido\"+\"\\n\" ;\n\t\t\t\t\t\t\t nErrTot+=1;\n\t\t\t\t\t\t\t break;}\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 sError+=\"Campo '\"+objform.elements[j].id+\"' no es valido\"+\"\\n\" ;\n\t\t\t\t\t nErrTot+=1;}\n\t\t\t\t}\n\n\t\t\t// VERIFICA SI EL CAMPO ES FECHA\n\t\t\t if (sNom.substring(0,1).toUpperCase()=='D') \n\t\t\t\t if (!isDate(objform.elements[j].value) && objform.elements[j].value!='')\n\t\t\t\t {sError+=\"Valor de campo '\"+objform.elements[j].id+\"' no es valido (formato de fecha debe ser : dd/mm/yyyy)\"+\"\\r\" ;\n\t\t\t\t nErrTot+=1;} \n\t\t\n\t\t\t// FOCO EN EL PRIMER CAMPO OBLIGATORIO\n\t\t\t if (nPas==-1 && nErrTot>0) { \n\t\t\t\tnPas=j; } \n }//fin for\n\nif (nErrTot>0) \n\t{ alert(sError) ;\n\t\tif (objform.elements[nPas].type!='hidden'){\n\t\t\tobjform.elements[nPas].focus();\n\t\t}\n\t return false; }\nelse \n {return mivalidacion(objform);}\n}", "title": "" }, { "docid": "8e72c065757d4d5aa2fb3f7533ff5cd1", "score": "0.55283284", "text": "function controlli(){\n\t//array delli controlli\n\tvar controll = [[\"form_titolo\", \"Titolo Del Libro\"],\n\t[\"form_autore\", \"Nome Cognome (e sigle es J.K.)\"],\n\t[\"form_data\", \"YYYY\"],\n\t[\"form_collana\", \"Nome Della Collana\"],\t\n\t[\"form_numero\", \"es 23\"],\n\t[\"form_editore\", \"Nome Editore\"],\n\t[\"form_voto\", \"0-5\"]];\n\t//Inserimento aiuti\n\tfor (i = 0; i < 7; i++){\n\t\tvar elem = document.getElementById(controll[i][0]);\n\t\telem.defaultValue = controll[i][1];\n\t\telem.style.color = \"#515151\";\n\t}\n\n\tdocument.getElementById(\"form_descrizione\").innerHTML = \"Inserire una descrizione.\";\n\tdocument.getElementById(\"form_recensione\").innerHTML = \"Inserire una breve recensione.\";\n}", "title": "" }, { "docid": "b7fd5790e340a291beb569360fb01ab2", "score": "0.55268604", "text": "function CambiarEstadoEditables(estado)\n{\n // 2.- CAMBIAR ESTADO DE LAS CAJAS DE TEXTO\n // lista de controles de texto editables\n var arrTxt=new Array(\"txtTarjeta\",\"lstMeses\",\"lstYears\",\"txtCodSeguridad\",\"txtCentro\",\n \"txtTPVOri\",\"txtFechaOri\",\"txtIdOpOri\",\"txtAutOri\");\n\n var frm = document.forms[0];\n\n for (i=0;i<frm.elements.length;i++)\n {\n\t var objCtrl = frm.elements[i];\n\t if(objCtrl!=null && objCtrl.id!=null)\n\t {\n\t //alert('debug: frm.elements['+i+'].id='+objCtrl.id);\n\t for( j=0; j<arrTxt.length; j++ )\n\t {\n\t if(objCtrl.id.indexOf(arrTxt[j])>=0)\n\t {\n\t //alert('debug: frm.elements['+i+'].id='+objCtrl.id+' & frm.elements['+i+'].disabled='+objCtrl.disabled);\n\t if(objCtrl.disabled != estado)objCtrl.disabled = estado;\n\t }\n\t }\n\t }\n }\n}", "title": "" }, { "docid": "1e32667774209555ed4bb0327eba79f3", "score": "0.55267185", "text": "function validar_campos_vacio(campo_vacio){\r\n\t\t if(campo_vacio==\"\"){\r\n \t/////////////////LOS CAMPOS ESTAN VACIOS DEBES COMPLETAR///////////\r\n \t/////////////////LOS CAMPOS ESTAN VACIOS DEBES COMPLETAR///////////\r\n \t/////////////////LOS CAMPOS ESTAN VACIOS DEBES COMPLETAR///////////\r\n \treturn false;\r\n\r\n }else{\r\n \treturn true;\r\n }\r\n\t}", "title": "" }, { "docid": "6d8afed10d6369832535a45c39694854", "score": "0.5524207", "text": "function populateJs2Form(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('cccTipoAbonoSubprFrm.accion'), \n\t\tget('cccTipoAbonoSubprFrm.origen'));\n\n\n\tset('cccTipoAbonoSubprFrm.id', jsCccTipoAbonoSubprId);\n\tset('cccTipoAbonoSubprFrm.subpOidSubp', [jsCccTipoAbonoSubprSubpOidSubp]);\n\tset('cccTipoAbonoSubprFrm.tcabOidTcab', [jsCccTipoAbonoSubprTcabOidTcab]);\n\tset('cccTipoAbonoSubprFrm.cucoOidCuenCont', [jsCccTipoAbonoSubprCucoOidCuenCont]);\n\t\n}", "title": "" }, { "docid": "28691aea47bd74ef49de47084978e165", "score": "0.5513228", "text": "function atrNuevoForm(nombre){\n var clave = nombre.toLowerCase(); // sustituimos las mayusculas por minusculas\n clave=clave.replace(\" \",\"_\"); // cambiamos espacios por linea\n var contenido_html = `\n <div id=id_${clave}_fg class=\"form-group\">\n <div class=\"col-md-12\"><label class=\"control-label\" for=\"id_${clave}\"><dt>${nombre}</dt></label></div>\n <div class=\"form-row\">\n <div class=\"col-md-11\"><input type=\"text\" name=\"${nombre}\" maxlength=\"250\" class=\"form-control\" required id=\"id_${clave}\" ></div>\n <div class=\"col-md-1\"><button class=\"btn btn-outline-danger btn-block\" onclick=\"document.getElementById('id_${clave}_fg').remove()\"><i class=\"fas fa-minus\"></i></button></div>\n </div>\n </div>`;\n var html_contenido_atr_nuevo = `\n <div id=id_${clave}_atr>\n <label class=\"control-label text-info\" ><b>${nombre}</b></label>\n <div class=\"form-row\">\n <div class=\"col-10\"><input type=\"text\" name=\"${nombre}\" maxlength=\"250\" class=\"form-control atrib\" required id=\"id_${clave}\" ></div>\n <div class=\"col\"><button type=\"button\" class=\"btn btn-outline-danger btn-block\" onclick=\"document.getElementById('id_${clave}_atr').remove()\"><i class=\"fas fa-minus\"></i></button></div>\n </div>\n </div>\n `;\n return [html_contenido_atr_nuevo,`id_${clave}`,nombre];\n}", "title": "" }, { "docid": "5aee39e9f600fbe2b9e99df00fd5e83c", "score": "0.5512874", "text": "function comprobarFormsVacios(form){\n\t var i;//iterador\n\t for (i = 0; i < form.length; i++) {//itera por todos los campos del form\n\t \t//llama a comprobar vacio para ver si tiene datos.\n\t if(!comprobarVacio(form[i])){\n\t return false;\n\t }\n\t }\n\t return true;\n\t}", "title": "" }, { "docid": "1f009e373eb8349cc2f88adfee32a163", "score": "0.55104524", "text": "editVentaFuera(index){\n this.venta.edit =true;\n this.registro_id = index;\n this.venta.fecha_v = this.t_ventas[index].fecha_v;\n this.venta.detalle = this.t_ventas[index].detalle;\n this.venta.cliente = this.t_ventas[index].cliente;\n this.venta.base_im = this.t_ventas[index].base_im;\n this.venta.porcentaje = this.t_ventas[index].porcentaje;\n this.venta.v_retenido = this.t_ventas[index].v_retenido;\n this.venta.iva = this.t_ventas[index].iva;\n this.venta.ret_10 = this.t_ventas[index].ret_10;\n this.venta.ret_20 = this.t_ventas[index].ret_20;\n this.venta.ret_30 = this.t_ventas[index].ret_30;\n this.venta.ret_70 = this.t_ventas[index].ret_70;\n this.venta.ret_100 = this.t_ventas[index].ret_100;\n \n $('#modal-retencion').modal('show');\n $('#ht-retencion-venta-tab').tab('show');\n }", "title": "" }, { "docid": "a22f50939eb0c2888a58f1d810ae817b", "score": "0.55098987", "text": "function populateJs2Form(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('recOperaViewFrm.accion'), \n\t\tget('recOperaViewFrm.origen'));\n\n\n\tset('recOperaViewFrm.id', jsRecOperaViewId);\n\tset('recOperaViewFrm.codOper', jsRecOperaViewCodOper);\n\tset('recOperaViewFrm.valDescLarg', jsRecOperaViewValDescLarg);\n\tset('recOperaViewFrm.indAnul', jsRecOperaViewIndAnul);\n\tset('recOperaViewFrm.indIngrEnvi', jsRecOperaViewIndIngrEnvi);\n\tset('recOperaViewFrm.valIngrDevu', jsRecOperaViewValIngrDevu);\n\tset('recOperaViewFrm.valPerd', jsRecOperaViewValPerd);\n\tset('recOperaViewFrm.indEspeMercFisi', jsRecOperaViewIndEspeMercFisi);\n\tset('recOperaViewFrm.indDevuFisiFact', jsRecOperaViewIndDevuFisiFact);\n\tset('recOperaViewFrm.numCampHist', jsRecOperaViewNumCampHist);\n\tset('recOperaViewFrm.indEnviGeneDevu', jsRecOperaViewIndEnviGeneDevu);\n\tset('recOperaViewFrm.indDevuGeneEnvi', jsRecOperaViewIndDevuGeneEnvi);\n\tset('recOperaViewFrm.paisOidPais', [jsRecOperaViewPaisOidPais]);\n\tset('recOperaViewFrm.indFaltMerc', jsRecOperaViewIndFaltMerc);\n\t\n}", "title": "" }, { "docid": "58876cca6bf3a40cbd205396847f5e9f", "score": "0.55000526", "text": "function ZeraForm(valor){\r\n\tfor (i=0; i<document.getElementById(valor).elements.length; i++) { \r\n\t if(document.getElementById(valor).elements[i]!=document.getElementById(valor).Data && document.getElementById(valor).elements[i]!=document.getElementById(valor).Hora && document.getElementById(valor).elements[i]!=document.getElementById(valor).FuncionarioId){\r\n\t \tdocument.getElementById(valor).elements[i].value=''; \r\n\t }\r\n\t}\r\n\tdocument.getElementById(valor).Acao.value='Insere';\r\n\tdocument.getElementById(valor).Tabela.value=valor;\r\n\tdocument.getElementById('BtExcluir'+valor).style.display='none';\r\n\tdocument.getElementById('Titulo'+valor).innerHTML='Cadastrar '+valor;\r\n\tdocument.getElementById(valor).Botao.value='Enviar';\r\n\tCarregaData();\r\n\tif(valor=='Venda'){\r\n\t\tdocument.getElementById(valor).StatusId.value='1';\r\n\t\tdocument.getElementById(valor).Botao.value='Incluir Produtos';\r\n\t\tdocument.Venda.DataEntrega.disabled=0;\r\n\t\tdocument.Venda.ClienteId.disabled=0;\r\n\t\tdocument.Venda.Desconto.disabled=0;\r\n\t\tdocument.Venda.StatusId.disabled=0;\r\n\t\tdocument.Venda.ProdId.disabled=0;\r\n\t}else if(valor=='Produto'){\r\n\t\tdocument.Produto.Estoque.value='0';\r\n\t\tdocument.Produto.AdicionaEstoque.value='0';\r\n\t}\r\n}", "title": "" }, { "docid": "bb34ab117ad6bc694591ef7fe5b42e81", "score": "0.54950166", "text": "function buscarCampanya() {\n\n var tipoOperacion = get(\"frmContenido.cbCodTipoOper\");\n\n set(\"frmContenido.accion\", \"buscarCampanya\");\n set(\"frmContenido.conectorAction\", \"LPOperacionReclamos\");\n set(\"frmContenido.oidTipoOperacion\", tipoOperacion);\n eval(\"frmContenido\").oculto = \"S\";\n enviaSICC(\"frmContenido\", null, null, \"N\");\n}", "title": "" }, { "docid": "af63e51bf83267a573feed2d436d0252", "score": "0.54926836", "text": "function abrirFormNuevaCirugia(){\n\t\n\t\n\t$(\"#hidden_nuevaCirugia\").show('slower');\n\t$(\"#form_nuevaCirugia\").addClass('unsavedForm');\n\t$(\"#tituloLi\").hide('slower');\n\t\n}", "title": "" }, { "docid": "08b69559b9903bd15e166c0b1b7160af", "score": "0.54890174", "text": "createForm() {\n this.langaugeForm = this.fb.group({\n name: ['', this.validation.onlyRequired_validator],\n code: ['', this.validation.onlyRequired_validator],\n country: ['', this.validation.onlyRequired_validator],\n description: [''],\n base_rate: ['', this.validation.onlyRequired_validator]\n });\n }", "title": "" }, { "docid": "d3cfc9566f1b2cbde75381db3a593c74", "score": "0.5481186", "text": "function get_dados_form() {\n return {\n Id: $('#id_cadastro').val(),\n Nome: $('#txt_nome').val(),\n Ativo: $('#cbx_ativo').prop('checked'),\n //vamos criar uma função com os arrays dos usuários marcados\n idUsuarios: get_lista_usuarios_marcados()\n };\n}", "title": "" }, { "docid": "ee22686d4925d6da50f1e4ec50f35bdf", "score": "0.54707354", "text": "function showOpAct(){\n hideAll();\n\n var mainAdmin = document.getElementById(\"main-mod-admin\");\n mainAdmin.setAttribute(\"class\",\"d-block \"); \n\n //borramos todos los elemetos \n while(mainAdmin.firstChild){\n //console.log(mainAdmin.firstChild);\n mainAdmin.removeChild(mainAdmin.firstChild);\n }\n\n var a = document.createElement(\"a\");\n a.setAttribute(\"href\",\"#\")\n a.setAttribute(\"onclick\",\"showAdmin()\")\n var volver = document.createTextNode(\"volver a administración\");\n a.appendChild(volver);\n\n mainAdmin.appendChild(a);\n\n var div = document.createElement(\"div\");\n div.setAttribute(\"id\",\"form_cat\"); \n div.setAttribute(\"class\",\"m-auto text-center\");\n\n mainAdmin.appendChild(div);\n\n var h2 = document.createElement(\"h2\");\n var h2_text = document.createTextNode(\"Buscar actor\");\n h2.appendChild(h2_text);\n \n var input = document.createElement(\"input\");\n input.setAttribute(\"class\",\"form-control\");\n input.setAttribute(\"id\",\"myInput\");\n input.setAttribute(\"type\",\"text\");\n input.setAttribute(\"placeholder\",\"Buscar actor... \");\n \n div.appendChild(h2);\n div.appendChild(input);\n\n var table = document.createElement(\"table\");\n table.setAttribute(\"class\",\"table table-bordered table-dark table-striped\");\n\n //cabecera\n var thead = document.createElement(\"thead\");\n var tr = document.createElement(\"tr\");\n \n var th_name = document.createElement(\"th\");\n var name = document.createTextNode(\"Nombre\");\n th_name.appendChild(name);\n\n var th_lastname = document.createElement(\"th\");\n var lastname = document.createTextNode(\"1º Apellido\");\n th_lastname.appendChild(lastname);\n\n /*\n var th_date = document.createElement(\"th\");\n var date = document.createTextNode(\"2º Apellido\");\n th_date.appendChild(date);\n */\n var th_delete = document.createElement(\"th\");\n var dele = document.createTextNode(\"Eliminar\");\n th_delete.appendChild(dele);\n\n var th_edit = document.createElement(\"th\");\n var dele = document.createTextNode(\"Modificar\");\n th_edit.appendChild(dele);\n \n tr.appendChild(th_name);\n tr.appendChild(th_lastname);\n //tr.appendChild(th_date);\n tr.appendChild(th_delete);\n tr.appendChild(th_edit);\n thead.appendChild(tr);\n\n table.appendChild(thead);\n div.appendChild(table);\n\n //cuerpo tabla\n //Recargamos la tabla de las categorías\n var tbody = rechargeTableActors();\n table.appendChild(tbody);\n\n}", "title": "" }, { "docid": "6014d23a92ccfa65452caba9196d86e7", "score": "0.54698014", "text": "function comprobar(form2)\n{\n\t\n\tif(form2.curso.value==0)\n\t{\n\t\talert(\"Seleccione Curso\");\t\n\t\tform2.curso.focus();\n\t\treturn false;\n\t}\n\t\n\tif(form2.num_mat.value==\"\")\n\t{\n\t\talert(\"Ingrese número matrícula\");\t\n\t\tform2.num_mat.focus();\n\t\treturn false;\n\t}\n\t\n\tif(form2.rut_alu.value==\"\")\n\t{\n\t\talert(\"Ingrese rut\");\t\n\t\tform2.rut_alu.focus();\n\t\treturn false;\n\t}\n\t\n\tif(form2.dig_alu.value==\"\")\n\t{\n\t\talert(\"Ingrese DV\");\t\n\t\tform2.dig_alu.focus();\n\t\treturn false;\n\t}\n\t\n\tif(form2.ape_pat.value==\"\")\n\t{\n\t\talert(\"Ingrese Apellido Paterno Alumno\");\t\n\t\tform2.ape_pat.focus();\n\t\treturn false;\n\t}\n\t\n\tif(form2.ape_mat.value==\"\")\n\t{\n\t\talert(\"Ingrese Apellido Materno Alumno\");\t\n\t\tform2.ape_mat.focus();\n\t\treturn false;\n\t}\n\t\n\tif(form2.nombre_alu.value==\"\")\n\t{\n\t\talert(\"Ingrese Nombre Alumno\");\t\n\t\tform2.nombre_alu.focus();\n\t\treturn false;\n\t}\n\t\n\tif(form2.sexo.value==0)\n\t{\n\t\talert(\"Seleccione sexo\");\t\n\t\tform2.sexo.focus();\n\t\treturn false;\n\t}\n\t\n\tif(form2.fecha_nacimiento.value==\"\")\n\t{\n\t\talert(\"Seleccione Fecha de Nacimiento\");\t\n\t\tform2.fecha_nacimiento.focus();\n\t\treturn false;\n\t}\n\t\n\tif(form2.calle.value==\"\")\n\t{\n\t\talert(\"Digite Nombre de calle\");\t\n\t\tform2.calle.focus();\n\t\treturn false;\n\t}\n\t\n\tif(form2.nro.value==\"\")\n\t{\n\t\talert(\"Digite número casa\");\t\n\t\tform2.nro.focus();\n\t\treturn false;\n\t}\n\t\n\tif(form2.fecha_inc_cur.value==\"\")\n\t{\n\t\talert(\"Seleccione Fecha Incorporación curso\");\t\n\t\tform2.fecha_inc_cur.focus();\n\t\treturn false;\n\t}\n\t\n\tif(form2.comuna.value==0)\n\t{\n\t\talert(\"Seleccione Comuna - Alumno\");\t\n\t\tform2.comuna.focus();\n\t\treturn false;\n\t}\n\t\n\tif(form2.alu_cqv.value==\"\")\n\t{\n\t\talert(\"Especifique con quién vive alumno\");\t\n\t\tform2.alu_cqv.focus();\n\t\treturn false;\n\t}\n\t\n\t\n\tif(form2.nom_apo.value==\"\")\n\t{\n\t\talert(\"Digite nombre apoderado\");\t\n\t\tform2.nom_apo.focus();\n\t\treturn false;\n\t}\n\t\n\t\n\tif(form2.ape_pat_apo.value==\"\")\n\t{\n\t\talert(\"Digite apellido paterno apoderado\");\t\n\t\tform2.ape_pat_apo.focus();\n\t\treturn false;\n\t}\n\t\n\tif(form2.ape_mat_apo.value==\"\")\n\t{\n\t\talert(\"Digite apellido materno apoderado\");\t\n\t\tform2.ape_mat_apo.focus();\n\t\treturn false;\n\t}\n\t\n\tif(form2.ape_pat_apo.value==\"\")\n\t{\n\t\talert(\"Digite apellido paterno apoderado\");\t\n\t\tform2.ape_pat_apo.focus();\n\t\treturn false;\n\t}\n\t\n\tif(form2.parent_apo.value==0)\n\t{\n\t\talert(\"Seleccione Parentezco con alumno\");\t\n\t\tform2.parent_apo.focus();\n\t\treturn false;\n\t}\n\t\n\tif(form2.dom_apo.value==\"\")\n\t{\n\t\talert(\"Digite dirección apoderado\");\t\n\t\tform2.dom_apo.focus();\n\t\treturn false;\n\t}\n\tif(form2.nro_apo.value==\"\")\n\t{\n\t\talert(\"Digite número casa apoderado\");\t\n\t\tform2.nro_apo.focus();\n\t\treturn false;\n\t}\n\t\n\tif(form2.comuna_apo.value==0)\n\t{\n\t\talert(\"Seleccione Comuna apoderado\");\t\n\t\tform2.comuna_apo.focus();\n\t\treturn false;\n\t}\n\t\n\tif(form2.n_educ_apo.value==0)\n\t{\n\t\talert(\"Seleccione nivel educacional apoderado\");\t\n\t\tform2.n_educ_apo.focus();\n\t\treturn false;\n\t}\n\t\n\tif(form2.nom_func_mat.value==0)\n\t{\n\t\talert(\"Digite nombre funcionario que matricula\");\t\n\t\tform2.nom_func_mat.focus();\n\t\treturn false;\n\t}\n\t\n\t\n\trepite=-1;\n\t\t\t\tfor(i=0;i<form2.rep.length;i++)\n\t\t\t\t{\n\t\t\t\t\tif(form2.rep[i].checked)\n\t\t\t\t\t\trepite=1;\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif (repite==-1)\n\t\t\t\t{\n\t\t\t\talert(\"Debe indicar si ha repetido algún curso \");\n\t\t\t\tform2.rep[0].focus();\n\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//repitio =si\n\t\t\t\tif (form2.rep[0].checked == true) {\n\t\t\t\tif (form2.cursosrep.value == \"\") {\n\t\t\t\talert(\"Indique qué cursos ha repetido.\");\n\t\t\t\tform2.cursosrep.focus();\n\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\trelig=-1;\n\t\t\t\tfor(i=0;i<form2.rel.length;i++)\n\t\t\t\t{\n\t\t\t\t\tif(form2.rel[i].checked)\n\t\t\t\t\t\trelig=1;\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif (relig==-1)\n\t\t\t\t{\n\t\t\t\talert(\"Debe indicar si profesa alguna religión \");\n\t\t\t\tform2.rel[0].focus();\n\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//religion =si\n\t\t\t\tif (form2.rel[0].checked == true) {\n\t\t\t\tif (form2.religion.value == \"\") {\n\t\t\t\talert(\"Indicar religión.\");\n\t\t\t\tform2.religion.focus();\n\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\tunif=-1;\n\t\t\t\tfor(i=0;i<form2.tie_unif.length;i++)\n\t\t\t\t{\n\t\t\t\t\tif(form2.tie_unif[i].checked)\n\t\t\t\t\t\tunif=1;\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif (unif==-1)\n\t\t\t\t{\n\t\t\t\talert(\"Debe indicar si alumno posee uniforme \");\n\t\t\t\tform2.tie_unif[0].focus();\n\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\n}", "title": "" }, { "docid": "25432d1b492042f011d4570c6ff1762f", "score": "0.5467112", "text": "function crearVenta() {\n let venta = new Venta();\n\n venta.rut = inputRut.value;\n venta.nombre = inputNombre.value;\n venta.fecha = inputFecha.value;\n venta.region = inputRegion.value;\n venta.total = inputTotal.value;\n detalle.push(venta);\n if (validaciones(detalle)) {\n imprimirVentas();\n sumarVentas();\n }\n}", "title": "" }, { "docid": "bf9af2978e550d97bf0129d71d18affb", "score": "0.54633796", "text": "function llenarFormulario(params) {\n for (let i = 0; i < buttonEditar.length; i++) {\n buttonEditar[i].addEventListener(\"click\",()=>{\n idEditar.value = productos[i].id\n nombreEditar.value = productos[i].nombre\n precioEditar.value = productos[i].precio\n descripcionEditar.value = productos[i].descripcion\n imagenEditar.value = productos[i].imagen\n cantidadEditar.value = productos[i].cantidad\n categoriaEditar.value = productos[i].agrupacion.agrupacion\n unidadEditar.value = productos[i].unidad.unidad\n })\n }\n idEditar.readOnly = true\n}", "title": "" }, { "docid": "5d2b4a64e84c0088cafe4f92be474a9b", "score": "0.54619366", "text": "function ObtenerFormaAgregarTipoGarantia()\n{\n $(\"#dialogAgregarTipoGarantia\").obtenerVista({\n nombreTemplate: \"tmplAgregarTipoGarantia.html\",\n despuesDeCompilar: function(pRespuesta) {\n $(\"#dialogAgregarTipoGarantia\").dialog(\"open\");\n }\n });\n}", "title": "" }, { "docid": "31fb49e80dac9444e9914876c04dcb7c", "score": "0.5450979", "text": "function reiniciarFormasPago(){\n idFormaPago = 0;\n //$('#optionEfectivo').prop('checked', false);\n $('#optionDebito').prop('checked', false);\n $('#optionCredito').prop('checked', false);\t\t\n $(\"#efectivoCant\").val(\"0.00\");\n $(\"#debitoCant\").val(\"0.00\");\n $(\"#creditoCant\").val(\"0.00\"); \n\t\t$(\"#importeRecibido\").val(\"0.00\");\n $(\"#vuelto\").val(\"0.00\"); \n\t\t//reinicio comprobantes\n\t\t$('select[name=\"txtComprobante\"]').val('1');\n\t\t//reinicio select de tarjetas\n\t\t$('#tarjetaDebito option:first-child').prop(\"selected\", true);\n $('#tarjetaCredito option:first-child').prop(\"selected\", true); \n\t\t//reinicio cuotas\n\t\t$(\"#cuotas\").val(1);\t\t\n //descuentos\n $(\"#descGral\").val(\"0.00\");\n }", "title": "" }, { "docid": "3e6cec75060de5b586584c536cf231a2", "score": "0.54501176", "text": "function mostrarOcultar() {\n\t/*if (document.getElementById('compra').value!=\"ml\"){\n\t\tdocument.getElementById('div_seudonimo').className = \"row-fluid hidden\";\n\t\t}else {\n\t\t\tdocument.getElementById('div_seudonimo').className = \"row-fluid visible\";\n\t\t\t}*/\n\tif(document.getElementById('persona')){\n switch (document.getElementById('persona').value){\t\t\t\t\t\t\t\t\t\t\n case 'j':\n document.getElementById('div_razon-social').className = \"row-fluid visible\";\t\n document.getElementById('div_rif').className = \"row-fluid visible\";\t\n document.getElementById('div_direccion-fiscal').className = \"row-fluid visible\";\n\n document.getElementById('div_nombre-apellido').className = \"row-fluid hidden\";\n document.getElementById('div_cedula').className = \"row-fluid hidden\";\n document.getElementById('div_direccion').className = \"row-fluid hidden\";\n break;\n case 'n':\n document.getElementById('div_razon-social').className = \"row-fluid hidden\";\t\n document.getElementById('div_rif').className = \"row-fluid hidden\";\t\n document.getElementById('div_direccion-fiscal').className = \"row-fluid hidden\";\n\n document.getElementById('div_nombre-apellido').className = \"row-fluid visible\";\n document.getElementById('div_cedula').className = \"row-fluid visible\";\n document.getElementById('div_direccion').className = \"row-fluid visible\";\n\n break;\t\t\t\t\t\n default:\n document.getElementById('div_razon-social').className = \"row-fluid hidden\";\t\n document.getElementById('div_rif').className = \"row-fluid hidden\";\t\n document.getElementById('div_direccion-fiscal').className = \"row-fluid hidden\";\t\n document.getElementById('div_nombre-apellido').className = \"row-fluid hidden\";\n document.getElementById('div_cedula').className = \"row-fluid hidden\";\t\n document.getElementById('div_direccion').className = \"row-fluid hidden\";\n }\t\n }\n if(document.getElementById('forma-pago')){\n \n if (document.getElementById('forma-pago').value==\"deposito\" || document.getElementById('forma-pago').value==\"transferencia\"){\n\t\t\tdocument.getElementById('div_monto').className = \"row-fluid visible\";\n\t\t\tdocument.getElementById('div_banco').className = \"row-fluid visible\";\n\t\t\tdocument.getElementById('div_nro-transaccion').className = \"row-fluid visible\";\n\t\t}else if (document.getElementById('forma-pago').value==\"credito-mp\"){\n\t\t\tdocument.getElementById('div_monto').className = \"row-fluid visible\";\t\t\t\n\t\t\tdocument.getElementById('div_nro-transaccion').className = \"row-fluid visible\";\n\t\t\t} \n else if (document.getElementById('forma-pago').value==\"efectivo\" || document.getElementById('forma-pago').value==\"debito\" || document.getElementById('forma-pago').value==\"\"){\n\t\t\tdocument.getElementById('div_monto').className = \"row-fluid hidden\";\n\t\t\tdocument.getElementById('div_banco').className = \"row-fluid hidden\";\n\t\t\tdocument.getElementById('div_nro-transaccion').className = \"row-fluid hidden\";\n\t\t\t} \n }\n\t\n\tif (document.getElementById('empresa-envio')){\n\t\tfield = document.getElementById('div_forma-pago');\n\t\thijo = field.getElementsByTagName('option');\n\t\tif (document.getElementById('empresa-envio').value==\"MRW\" || document.getElementById('empresa-envio').value==\"ZOOM\"){\n\t\t\tdocument.getElementById('div_direccion-envio').className = \"row-fluid visible\";\n\t\t\thijo[3].setAttribute('class', 'hidden');\n\t\t\thijo[5].setAttribute('class', 'hidden');\n\t\t\t}else {\n\t\t\t\tdocument.getElementById('div_direccion-envio').className = \"row-fluid hidden\";\n\t\t\t\thijo[3].setAttribute('class', '');\n\t\t\t\thijo[5].setAttribute('class', '');\n\t\t\t\t}\n\t}\n \n if (document.getElementById(\"envio\")){ \n\t\tif (document.getElementById('envio').value==\"MRW\" || document.getElementById('envio').value==\"ZOOM\"){\n\t\t\tdocument.getElementById('div_direccion').className = \"row-fluid visible\";\n document.getElementById('div_estado').className = \"row-fluid visible\";\n document.getElementById('div_ciudad').className = \"row-fluid visible\";\n\t\t\t}else {\n\t\t\t\tdocument.getElementById('div_direccion').className = \"row-fluid hidden\";\t\t\t\t\n\t\t\t\tdocument.getElementById('div_estado').className = \"row-fluid hidden\";\t\t\t\t\n\t\t\t\tdocument.getElementById('div_ciudad').className = \"row-fluid hidden\";\t\t\t\t\n\t\t\t\t}\n\t} \t\n}", "title": "" }, { "docid": "8193408d0b53d618ce4ba0b6cabdd8dc", "score": "0.5447701", "text": "function exibeOcultaFormacao() {\n\t\t\t\n\t\t\tif ( $('#cadastro-escolaridade option:selected').text() != 'Grau de escolaridade' && $('#cadastro-escolaridade option:selected').text() != 'ensino fundamental' && $('#cadastro-escolaridade option:selected').text() != 'ensino médio' ) \n\t\t\t{\n\t\t\t\t$('#cadastro-formacao').parent(\".linha\").show();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$('#cadastro-formacao').val(\"\").parent(\".linha\").hide();\n\t\t\t}\n\t\t\t\n\t\t}", "title": "" }, { "docid": "ca6761ff6e1e358272172d86cc68c506", "score": "0.54403484", "text": "function habilitarForm(){\n formasDePago = document.getElementsByName(\"metodo-pago\");\n inputGiro = document.getElementsByName(\"form-giro\")\n inputTarjeta = document.getElementsByName(\"form-tarjeta\")\n if(formasDePago[0].checked == true){\n //la posicion 0 es la tarjeta\n for (let i = 0; i < inputGiro.length; i++) {\n inputGiro[i].disabled = true;\n for (let i = 0; i < inputTarjeta.length; i++) {\n inputTarjeta[i].disabled = false;\n }\n }\n }else if (formasDePago[1].checked == true){\n //posicion 1 es el giro\n for (let i = 0; i < inputTarjeta.length; i++) {\n inputTarjeta[i].disabled = true;\n for (let i = 0; i < inputGiro.length; i++) {\n inputGiro[i].disabled = false;\n }\n }\n }\n}", "title": "" }, { "docid": "b7dbd9bd80ddaabacbb63667fb2294b6", "score": "0.54348385", "text": "function populateForm2Js(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('maeNegocViewFrm.accion'), \n\t\tget('maeNegocViewFrm.origen'));\n\t\n\tjsMaeNegocViewId = get('maeNegocViewFrm.id').toString();\n\tjsMaeNegocViewPaisOidPais = get('maeNegocViewFrm.paisOidPais')[0];\n\tjsMaeNegocViewCodNego = get('maeNegocViewFrm.codNego').toString();\n\tif(mode == MMG_MODE_CREATE || mode == MMG_MODE_UPDATE_FORM){\n\t\tjsMaeNegocViewDescripcion = buildLocalizedString('maeNegocViewFrm', 1);\n\t}else{\n\t\tjsMaeNegocViewDescripcion = get('maeNegocViewFrm.Descripcion');\n\t}\n\t\n}", "title": "" }, { "docid": "635b10f7257be5e09d544de997c434fe", "score": "0.54302496", "text": "function abrirFormNuevaHospitalizacion(){\n\t\n\t\n\t$(\"#hidden_nuevaHospitalizacion\").show();\n\t$(\"#form_nuevaHospitalizacion\").addClass('unsavedForm');\n\t$(\"#tituloLi\").hide();\n\n\t\n}", "title": "" }, { "docid": "2b9abae28ea9f4cb6a085d79f0758c2d", "score": "0.5425342", "text": "function abrirFormNuevoExamen(){\n\t\n\t\n\t$(\"#hidden_nuevoExamen\").show('slower');\n\t$(\"#form_nuevoExamen\").addClass('unsavedForm');\n\t$(\"#tituloLi\").hide('slower');\n\n\t\n}", "title": "" }, { "docid": "bfb31273fd56da86a3b5be46cb751b80", "score": "0.5422233", "text": "function cotizaciones_invitaciones_cotizar(form, accion) {\r\n\tcargando(\"block\");\r\n\t//\tformulario\r\n\t//\tdatos generales\r\n\tvar finvitacion = document.getElementById(\"finvitacion\").value.trim();\r\n\tvar flimite = document.getElementById(\"flimite\").value.trim();\r\n\tvar fcotizacion = document.getElementById(\"fcotizacion\").value.trim();\r\n\tvar frecepcion = document.getElementById(\"frecepcion\").value.trim();\r\n\tvar fapertura = document.getElementById(\"fapertura\").value.trim();\r\n\tvar codproveedor = document.getElementById(\"codproveedor\").value.trim();\r\n\tvar descp = new Number(setNumero(document.getElementById(\"descp\").value.trim()));\r\n\tvar descf = new Number(setNumero(document.getElementById(\"descf\").value.trim()));\r\n\tvar nrocotizacionprov = document.getElementById(\"nrocotizacionprov\").value.trim();\r\n\tvar validez = document.getElementById(\"validez\").value.trim();\r\n\tvar dias = document.getElementById(\"dias\").value.trim();\r\n\tvar codformapago = document.getElementById(\"codformapago\").value.trim();\r\n\tvar error = \"\";\r\n\t\r\n\t//\tdetalle\r\n\tvar detalle = \"\";\r\n\tvar frm_detalle = document.getElementById(\"frm_detalle\");\r\n\tfor(var i=0; n=frm_detalle.elements[i]; i++) {\r\n\t\tif (n.name == \"cotizacion_secuencia\") detalle += n.value + \"|\";\r\n\t\telse if (n.name == \"cant\") {\r\n\t\t\tvar cant = new Number(n.value);\r\n\t\t\tdetalle += cant + \"|\";\r\n\t\t}\r\n\t\telse if (n.name == \"pu\") {\r\n\t\t\tvar pu = new Number(n.value);\r\n\t\t\tdetalle += pu + \"|\";\r\n\t\t}\r\n\t\telse if (n.name == \"flagasig\") {\r\n\t\t\tif (n.checked) detalle += \"S|\"; else detalle += \"N|\";\r\n\t\t}\r\n\t\telse if (n.name == \"flagexon\") {\r\n\t\t\tif (n.checked) detalle += \"S|\"; else detalle += \"N|\";\r\n\t\t}\r\n\t\telse if (n.name == \"pu_igv\") {\r\n\t\t\tvar pu_igv = new Number(n.value);\r\n\t\t\tdetalle += pu_igv + \"|\";\r\n\t\t}\r\n\t\telse if (n.name == \"descp\") {\r\n\t\t\tvar descp = new Number(n.value);\r\n\t\t\tdetalle += descp + \"|\";\r\n\t\t}\r\n\t\telse if (n.name == \"descf\") {\r\n\t\t\tvar descf = new Number(n.value);\r\n\t\t\tdetalle += descf + \"|\";\r\n\t\t}\r\n\t\telse if (n.name == \"pu_desc\") {\r\n\t\t\tvar pu_desc = new Number(n.value);\r\n\t\t\tdetalle += pu_desc + \"|\";\r\n\t\t}\r\n\t\telse if (n.name == \"pu_total\") {\r\n\t\t\tvar pu_total = new Number(n.value);\r\n\t\t\tdetalle += pu_total + \"|\";\r\n\t\t}\r\n\t\telse if (n.name == \"total\") {\r\n\t\t\tvar total = new Number(n.value);\r\n\t\t\tdetalle += total + \"|\";\r\n\t\t}\r\n\t\telse if (n.name == \"observaciones\") {\r\n\t\t\tdetalle += n.value + \";\";\t\t\t\r\n\t\t}\r\n\t}\r\n\tvar len = detalle.length; len--;\r\n\tdetalle = detalle.substr(0, len);\r\n\t\r\n\t//\tbuscar errores\r\n\tif (!valFecha(fapertura) || !valFecha(frecepcion) || !valFecha(fcotizacion)) error = \"¡ERROR: El formato de las fechas es (dd-mm-aaaa)!\";\r\n\telse if (!valAlfaNumerico(detalle)) error = \"¡ERROR: No se permiten carácteres especiales en los campos!\";\r\n\t\r\n\t//\tvalido\r\n\tif (error != \"\") { alert(error); cargando(\"none\"); }\r\n\telse {\r\n\t\t//\tCREO UN OBJETO AJAX\r\n\t\tvar ajax=nuevoAjax();\r\n\t\tajax.open(\"POST\", \"../lib/lg_fphp_ajax.php\", true);\r\n\t\tajax.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\r\n\t\tajax.send(\"modulo=cotizaciones&accion=\"+accion+\"&finvitacion=\"+finvitacion+\"&flimite=\"+flimite+\"&fcotizacion=\"+fcotizacion+\"&frecepcion=\"+frecepcion+\"&fapertura=\"+fapertura+\"&codproveedor=\"+codproveedor+\"&descp=\"+descp+\"&descf=\"+descf+\"&nrocotizacionprov=\"+nrocotizacionprov+\"&validez=\"+validez+\"&dias=\"+dias+\"&detalle=\"+detalle+\"&codformapago=\"+codformapago);\r\n\t\tajax.onreadystatechange=function() {\r\n\t\t\tif (ajax.readyState==4)\t{\r\n\t\t\t\tcargando(\"none\");\r\n\t\t\t\tvar resp = ajax.responseText;\r\n\t\t\t\tif (resp.trim() != \"\") alert(resp);\r\n\t\t\t\telse {\r\n\t\t\t\t\topener.document.getElementById(\"frmentrada\").submit();\r\n\t\t\t\t\twindow.close();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "title": "" }, { "docid": "87638a42efd430a785b5233f657a0ae3", "score": "0.54211926", "text": "function abrirFormNuevoDesparasitante(){\n\t\n\t$(\"#hidden_nuevoDesparasitante\").show('slower');\n\t$(\"#form_nuevoDesparasitante\").addClass('unsavedForm');\n\t$(\"#tituloLi\").hide('slower');\n\t\n\t\n}", "title": "" }, { "docid": "25eefd0745afb3db34d46b68e12154b4", "score": "0.5417506", "text": "function limpiarCamposFormulario() {\n nombreProducto.value = \"\";\n descripcion = descripcionProducto.value = \"\";\n tamanioProducto.value = \"\";\n precioProducto.value = \"\";\n }", "title": "" }, { "docid": "3eecf0103f403093d8716f120440e30f", "score": "0.54148877", "text": "function cargarCgg_jur_criterioCtrls(){\n if(inRecordCgg_jur_criterio){\n txtCjcri_codigo.setValue(inRecordCgg_jur_criterio.get('CJCRI_CODIGO'));\n txtCrfas_codigo.setValue(inRecordCgg_jur_criterio.get('CRFAS_CODIGO'));\n grdCgg_jur_criterio.setValue(inRecordCgg_jur_criterio.get('CJCRI_REQUERIMIENTO'));\n isEdit = true;\n habilitarCgg_jur_criterioCtrls(true);\n }}", "title": "" }, { "docid": "80ceda0574d9b177025657d22869c931", "score": "0.54143596", "text": "function comprobar() {\r\n var f = formElement;\r\n var checked = false;\r\n var checked1 = false;\r\n var checkedmul = 0;\r\n var checked2 = false;\r\n var checked3 = false;\r\n var checkedmul1 = 0;\r\n var checked4 = false;\r\n\r\n for(i = 0; i < f.historia.length; i++) { //\"historia,historia1...\" es el nombre asignado a todos los checkbox\r\n if(f.historia[i].checked) checked = true;\r\n }\r\n for(i = 0; i < f.historia1.length; i++) {\r\n if(f.historia1[i].checked) checked1 = true;\r\n }\r\n for(i = 0; i < f.mul.length; i++) {\r\n if(f.mul[i].checked) checkedmul++;\r\n }\r\n for(i = 0; i < f.historia2.length; i++) {\r\n if(f.historia2[i].checked) checked2 = true;\r\n }\r\n for(i = 0; i < f.historia3.length; i++) {\r\n if(f.historia3[i].checked) checked3 = true;\r\n }\r\n for(i = 0; i < f.mul1.length; i++) {\r\n if(f.mul1[i].checked) checkedmul1++;\r\n }\r\n for(i = 0; i < f.historia4.length; i++) {\r\n if(f.historia4[i].checked) checked4 = true;\r\n }\r\n\r\n if(f.elements[0].value == \"\") {\r\n f.elements[0].focus();\r\n alert(\"Escribe una respuesta\");\r\n return false;\r\n\r\n } else if(f.elements[1].selectedIndex == 0) {\r\n f.elements[1].focus();\r\n alert(\"Selecciona una opción\");\r\n return false;\r\n\r\n } else if(!checked) {\r\n document.getElementsByTagName(\"h3\")[2].scrollIntoView();\r\n alert(\"Selecciona una opción del checkbox\");\r\n return false;\r\n\r\n } else if(!checked1) {\r\n document.getElementsByTagName(\"h3\")[3].scrollIntoView();\r\n alert(\"Selecciona una opción del radio\");\r\n return false;\r\n\r\n } else if(checkedmul = 0) {\r\n document.getElementsByTagName(\"h3\")[4].scrollIntoView();\r\n alert(\"Selecciona una opción o más\");\r\n return false;\r\n\r\n } else if(!checked2) {\r\n document.getElementsByTagName(\"h3\")[5].scrollIntoView();\r\n alert(\"Selecciona una opción del radio\");\r\n return false;\r\n\r\n } else if(!checked3) {\r\n document.getElementsByTagName(\"h3\")[6].scrollIntoView();\r\n alert(\"Selecciona una opción del radio\");\r\n return false;\r\n\r\n } else if(f.elements[17].value == \"\") {\r\n f.elements[17].focus();\r\n alert(\"Escribe una respuesta\");\r\n return false;\r\n\r\n } else if(f.elements[18].value == \"\") {\r\n f.elements[18].focus();\r\n alert(\"Escribe una respuesta\");\r\n return false;\r\n\r\n } else if(checkedmul1 = 0) {\r\n document.getElementsByTagName(\"h3\")[09].scrollIntoView();\r\n alert(\"Selecciona una opción o más\");\r\n return false;\r\n\r\n } else if(!checked4) {\r\n document.getElementsByTagName(\"h3\")[10].scrollIntoView();\r\n alert(\"Selecciona una opción del checkbox\");\r\n return false;\r\n\r\n } else if(f.elements[23].value == \"\") {\r\n f.elements[23].focus();\r\n alert(\"Escribe una respuesta\");\r\n return false;\r\n\r\n } else if(f.elements[24].selectedIndex == 0) {\r\n f.elements[24].focus();\r\n alert(\"Selecciona una opción\");\r\n return false;\r\n\r\n } else return true;\r\n}", "title": "" }, { "docid": "1aa7c2e386be5ad4fb29413c0bfcab85", "score": "0.54133266", "text": "function actualizar_reservaciones(){\n\tenviarFormulario(\"#form_reservaciones_actualizar\", 'Membresia/actualizar_membresia', '#cuadro4');\n}", "title": "" }, { "docid": "29f33248a59b2eb42742cc0e24efecd9", "score": "0.5411473", "text": "function rellenarFormCobro (datos) {\n if (datos.imagen !== '') {\n $('#imagen').removeClass('hide');\n $('#fotoCapturada').attr('src', datos.imagen);\n }\n\n $('#nombreCompleto').text(datos.nombreCompleto);\n $('#anios').text(datos.edad);\n\n $('#costoConsulta').text('$' + datos.costoConsulta);\n $('#totalPagarTexto').text('$' + datos.saldo);\n $('#totalPagar').text(datos.saldo);\n $('#consultaId').val(datos.consultaId);\n $('#cobros').removeClass('hide');\n\n $abono.rules('add', {\n number: true,\n max: datos.saldo,\n messages: {\n number: 'Ingrese solo números',\n max: 'El máximo a abonar es de $' + datos.saldo\n }\n })\n }", "title": "" }, { "docid": "cb3c9765ed8806c8a641426f7b1f7ea7", "score": "0.54099905", "text": "updateForm () {\n this.$step.innerText = this.currentStep;\n\n // TODO: Validation\n\n this.slides.forEach(slide => {\n slide.classList.remove(\"active\");\n\n if (slide.dataset.step == this.currentStep) {\n slide.classList.add(\"active\");\n }\n });\n\n this.$stepInstructions[0].parentElement.parentElement.hidden = this.currentStep >= 5;\n this.$step.parentElement.hidden = this.currentStep >= 5;\n\n\n //categories + quantity\n const selectedCategories = document.querySelectorAll(\"input[name='categories']:checked\");\n const quantity = document.querySelector(\"input[name='bags']\");\n const pack = document.querySelector(\"#packages\");\n pack.innerText = `${quantity.value} worki/worków: ${Array.from(selectedCategories).map(el => el.value).join(\", \")}`\n\n //institution\n const selected = document.querySelectorAll(\"input[name='organization']:checked\");\n const institution = document.querySelector(\"#institution\");\n institution.innerText = `Dla fundacji \"${Array.from(selected).map(el => el.value)}\" w miejscowości `\n\n //address\n const street = document.querySelector(\"input[name='street']\");\n const city = document.querySelector(\"input[name='city']\");\n const postcode = document.querySelector(\"input[name='postcode']\");\n const phone = document.querySelector(\"input[name='phone']\");\n const date = document.querySelector(\"input[name='date']\");\n const time = document.querySelector(\"input[name='time']\");\n const more_info = document.querySelector(\"textarea[name='more_info']\");\n\n const address = document.querySelector(\"#address\");\n console.log(address)\n console.log(street)\n address.innerHTML = `<h4>Adres odbioru:</h4>\n <ul>\n <li>${street.value}</li>\n <li>${city.value}</li>\n <li>${postcode.value}</li>\n <li>${phone.value}</li>\n </ul>`\n const pickup = document.querySelector(\"#time\");\n pickup.innerHTML = `<h4>Termin odbioru:</h4>\n <ul>\n <li>${date.value}</li>\n <li>${time.value}</li>\n <li>${more_info.value}</li>\n </ul>`\n\n }", "title": "" }, { "docid": "784375a29f1d629c5e33413cc67833ca", "score": "0.54065144", "text": "function zoto_permissions_form(options) {\n\tthis.groups = [];\n\tthis.contacts = [];\n\tthis.data = [];\n\tthis.dirty = false;\n\tthis.options = options || {};\n\tthis.view_types = this.options.view_types || {};\n\tthis.name = this.options.name || \"anonymous\";\n\n\t//\n\t// make the select box\n\t//\n\tvar select_values = [];\n\tforEach(items(this.view_types), method(this, function(v) {\n\t\tselect_values.push([v[0], v[1].select_text]);\n\t}));\n\tthis.view_select = new zoto_select_box(1, select_values, {});\n\tconnect(this.view_select, 'onchange', this, 'switch_view');\n\n\t//\n\t// create our radio buttons\n\t//\n\tthis.nochange_radio = this.create_radio(-1);\n\tthis.public_radio = this.create_radio(0);\n\tthis.all_contacts_radio = this.create_radio(1);\n\tthis.some_contacts_radio = this.create_radio(2);\n\tthis.private_radio = this.create_radio(3);\n\n\tthis.nochange_div = DIV({'class': \"perms_radio_holder\"},\n\t\tthis.nochange_radio,\n\t\tSPAN({}, _(\"leave permissions 'as is'\"))\n\t);\n\n\tthis.group_checks = DIV({});\n\n\tthis.dual_list = new zoto_dual_list_perms({'chosen': _(\"allowed\")});\n\tconnect(this.dual_list, 'CHOICES_UPDATED', this, function(){\n\t\tthis.set_dirty(true);\n\t});\n\n\tthis.btn_create = A({href:'javascript:void(0);', 'class': 'form_button'}, _('add new contact'));\n\tthis.input_email = INPUT({'type':'text', 'class':'text', 'maxlength':30});\n\tthis.create_form = FORM({}, FIELDSET({'class':'shaded'},\n\t\tLABEL({}, _('enter email address or username')), BR(),\n\t\tthis.input_email, ' ', this.btn_create\n\t));\n\tconnect(this.btn_create, 'onclick', this, 'handle_create');\n\tconnect(this.create_form, 'onsubmit', this, function(e){\n\t\te.stop();\n\t\tthis.handle_create();\n\t});\n\n\tthis.err_msg = new zoto_error_message();\n\tthis.div_err_holder = DIV({'class':'err_holder'},this.err_msg.el);\n\n\n\tthis.form = FORM({'id': this.name + \"perms_form\", 'class': \"perms_form\"},\n\t\tFIELDSET({},\n\t\t\tDIV({'class': \"select_box_container\"},\n\t\t\t\tthis.view_select.el,\n\t\t\t\tBR({'style': \"clear: left\"})\n\t\t\t),\n\t\t\tBR({'style': \"clear: left\"}),\n\t\t\tDIV({'class': \"checkbox_holder\"},\n\t\t\t\tthis.nochange_div,\n\t\t\t\tDIV({'class': \"perms_radio_holder\"},\n\t\t\t\t\tthis.public_radio,\n\t\t\t\t\tSPAN({}, _(\"public (everyone)\"))\n\t\t\t\t),\n\t\t\t\tDIV({'class': \"perms_radio_holder\"},\n\t\t\t\t\tthis.private_radio,\n\t\t\t\t\tSPAN({}, _(\"private (only me)\"))\n\t\t\t\t),\n\t\t\t\tDIV({'class': \"perms_radio_holder\"},\n\t\t\t\t\tthis.all_contacts_radio,\n\t\t\t\t\tSPAN({}, _(\"private (only me and all of my contacts)\"))\n\t\t\t\t),\n\t\t\t\tDIV({'class': \"perms_radio_holder\"},\n\t\t\t\t\tthis.some_contacts_radio,\n\t\t\t\t\tSPAN({}, _(\"private (only me and the contacts I select)\"))\n\t\t\t\t)\n\t\t\t),\n\t\t\tBR({'clear':'all'}),BR(),\n\t\t\tthis.dual_list.el\n\t\t)\n\t);\n\n\t//\n\t// Put it all together\n\t//\n\tthis.el = DIV({'class': \"perms_holder\"}, \n\t\tthis.form,\n\t\tthis.div_err_holder,\n\t\tthis.create_form\n\t);\n}", "title": "" }, { "docid": "6200c50dc346d398365b397f51ad84b7", "score": "0.54064566", "text": "function mostrar_form()\n{\n document.getElementById('datos').style.display = 'block';\n document.getElementById('validar').style.display = 'none';\n \n}", "title": "" }, { "docid": "71c63b24456f282afce48610f723b75c", "score": "0.5399497", "text": "function abrirVentana(){\n\tvar index = 0;\n\tvar encontrada = false;\n\t\n\t//Activa el boton de cerrar ventanas\n\tdocument.getElementById(\"btnVentanas\").style.display = \"block\";\n\t//Si es la primera vez que se ejecuta la funcion crea directamente la ventana\n\tif((arrayVentanas[0] == undefined) || (arrayVentanas[0].name == \"\")){\n\t\tcrearVentana(this.value);\n\t}else{\n\t\twhile ((index < arrayVentanas.length) && !encontrada) {\n\t\t\tif ((arrayVentanas[index] && !arrayVentanas[index].closed && arrayVentanas[index].name == this.value)){\n\t\t\t\t//Si la ventana no esta cerrada, esta creada y ya tiene ese nombre pone la variable a true\n\t\t\t\tencontrada = true;\n\t\t\t}\n\t\t\tindex++;\n\t\t}//Fin del while\n\t\tif (encontrada) {\n\t\t\tarrayVentanas[index-1].focus();\n\t\t}else{\n\t\t\tcrearVentana(this.value);\n\t\t}\n\t}//Fin del if\n\t\n}//FIn de abrir ventana", "title": "" }, { "docid": "72399862998e0303a8e93f791a4c8ba3", "score": "0.53949314", "text": "function activadorEventosVendedores()\n{\n // Se declara las variables del menu vertical */\n \n var VisualizarV, ubicacionV,actividadesV, viaticosV, comisionesV;\n \n /* Se le asigna eventos a las anteriores variables */\n \n VisualizarV=$(\"#listadoVentas\");\n VisualizarV.click(seccionListado);\n ubicacionV=$(\"#ubicacionVendedor\");\n ubicacionV.click(seccionUbicacion);\n ventasV=$(\"#ventasVendedor\");\n ventasV.click(seccionVentas);\n actividadesV=$(\"#ActividadesVendedor\");\n actividadesV.click(seccionActividades);\n viaticosV=$(\"#viaticosVendedor\");\n viaticosV.click(seccionViaticos);\n comisionesV=$(\"#comisionesVendedor\");\n comisionesV.click(seccionComisiones);\n \n\n /* Variables de las opciones del listado de vendedores */\n\n var VisualizarV,VisualizarW;\n var volverVendedor, vBorrarV, vHideDelV;\n var ingresosV, egresosV; \n \n /* Asignacion de evntos a las variables declaradas */\n \n VisualizarV=$(\".VerVendedor\");\n VisualizarV.click(VerClientes);\n VisualizarW=$(\".VerClientes\");\n VisualizarW.click(VerClientes);\n ingresosV=$(\"#IngresosFinanciera\");\n ingresosV.click(VerIngreso);\n egresosV=$(\"#EgresosFinanciera\");\n egresosV.click(VerEgreso);\n \n}", "title": "" }, { "docid": "72399862998e0303a8e93f791a4c8ba3", "score": "0.53949314", "text": "function activadorEventosVendedores()\n{\n // Se declara las variables del menu vertical */\n \n var VisualizarV, ubicacionV,actividadesV, viaticosV, comisionesV;\n \n /* Se le asigna eventos a las anteriores variables */\n \n VisualizarV=$(\"#listadoVentas\");\n VisualizarV.click(seccionListado);\n ubicacionV=$(\"#ubicacionVendedor\");\n ubicacionV.click(seccionUbicacion);\n ventasV=$(\"#ventasVendedor\");\n ventasV.click(seccionVentas);\n actividadesV=$(\"#ActividadesVendedor\");\n actividadesV.click(seccionActividades);\n viaticosV=$(\"#viaticosVendedor\");\n viaticosV.click(seccionViaticos);\n comisionesV=$(\"#comisionesVendedor\");\n comisionesV.click(seccionComisiones);\n \n\n /* Variables de las opciones del listado de vendedores */\n\n var VisualizarV,VisualizarW;\n var volverVendedor, vBorrarV, vHideDelV;\n var ingresosV, egresosV; \n \n /* Asignacion de evntos a las variables declaradas */\n \n VisualizarV=$(\".VerVendedor\");\n VisualizarV.click(VerClientes);\n VisualizarW=$(\".VerClientes\");\n VisualizarW.click(VerClientes);\n ingresosV=$(\"#IngresosFinanciera\");\n ingresosV.click(VerIngreso);\n egresosV=$(\"#EgresosFinanciera\");\n egresosV.click(VerEgreso);\n \n}", "title": "" }, { "docid": "72399862998e0303a8e93f791a4c8ba3", "score": "0.53949314", "text": "function activadorEventosVendedores()\n{\n // Se declara las variables del menu vertical */\n \n var VisualizarV, ubicacionV,actividadesV, viaticosV, comisionesV;\n \n /* Se le asigna eventos a las anteriores variables */\n \n VisualizarV=$(\"#listadoVentas\");\n VisualizarV.click(seccionListado);\n ubicacionV=$(\"#ubicacionVendedor\");\n ubicacionV.click(seccionUbicacion);\n ventasV=$(\"#ventasVendedor\");\n ventasV.click(seccionVentas);\n actividadesV=$(\"#ActividadesVendedor\");\n actividadesV.click(seccionActividades);\n viaticosV=$(\"#viaticosVendedor\");\n viaticosV.click(seccionViaticos);\n comisionesV=$(\"#comisionesVendedor\");\n comisionesV.click(seccionComisiones);\n \n\n /* Variables de las opciones del listado de vendedores */\n\n var VisualizarV,VisualizarW;\n var volverVendedor, vBorrarV, vHideDelV;\n var ingresosV, egresosV; \n \n /* Asignacion de evntos a las variables declaradas */\n \n VisualizarV=$(\".VerVendedor\");\n VisualizarV.click(VerClientes);\n VisualizarW=$(\".VerClientes\");\n VisualizarW.click(VerClientes);\n ingresosV=$(\"#IngresosFinanciera\");\n ingresosV.click(VerIngreso);\n egresosV=$(\"#EgresosFinanciera\");\n egresosV.click(VerEgreso);\n \n}", "title": "" }, { "docid": "72399862998e0303a8e93f791a4c8ba3", "score": "0.53949314", "text": "function activadorEventosVendedores()\n{\n // Se declara las variables del menu vertical */\n \n var VisualizarV, ubicacionV,actividadesV, viaticosV, comisionesV;\n \n /* Se le asigna eventos a las anteriores variables */\n \n VisualizarV=$(\"#listadoVentas\");\n VisualizarV.click(seccionListado);\n ubicacionV=$(\"#ubicacionVendedor\");\n ubicacionV.click(seccionUbicacion);\n ventasV=$(\"#ventasVendedor\");\n ventasV.click(seccionVentas);\n actividadesV=$(\"#ActividadesVendedor\");\n actividadesV.click(seccionActividades);\n viaticosV=$(\"#viaticosVendedor\");\n viaticosV.click(seccionViaticos);\n comisionesV=$(\"#comisionesVendedor\");\n comisionesV.click(seccionComisiones);\n \n\n /* Variables de las opciones del listado de vendedores */\n\n var VisualizarV,VisualizarW;\n var volverVendedor, vBorrarV, vHideDelV;\n var ingresosV, egresosV; \n \n /* Asignacion de evntos a las variables declaradas */\n \n VisualizarV=$(\".VerVendedor\");\n VisualizarV.click(VerClientes);\n VisualizarW=$(\".VerClientes\");\n VisualizarW.click(VerClientes);\n ingresosV=$(\"#IngresosFinanciera\");\n ingresosV.click(VerIngreso);\n egresosV=$(\"#EgresosFinanciera\");\n egresosV.click(VerEgreso);\n \n}", "title": "" }, { "docid": "c890f016b4fde5e94a29899225f9c6e9", "score": "0.5394571", "text": "_limpaFormulario(){\n\n\t\tthis._inputData.value = '';\n\t\tthis._inputQuantidade.value = 1;\n\t\tthis._inputValor.value = 0.0;\n\n\t\tthis._inputData.focus();\n\t}", "title": "" }, { "docid": "a2d60c0058b436615f0c05562a196105", "score": "0.53938293", "text": "function prepareForm() {\n $http.get('js/app/storage/data.json').success(function (response) {\n $scope.props = $.extend(\n response,\n {phoneCodes:response.codes},\n {phoneCode:response.codes[0].sign});\n\n self.professions = response.professions.map(function(profession){\n return {\n value:profession\n }\n });\n $(\"[data-app='phone']\").mask($scope.props.phoneCodes[0].mask);\n });\n }", "title": "" }, { "docid": "fd1d7f94f2f40a3357976652a002d1cb", "score": "0.5382181", "text": "function populateJs2Form(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('segSocieFrm.accion'), \n\t\tget('segSocieFrm.origen'));\n\n\n\tset('segSocieFrm.id', jsSegSocieId);\n\tset('segSocieFrm.paisOidPais', [jsSegSociePaisOidPais]);\n\tset('segSocieFrm.codSoci', jsSegSocieCodSoci);\n\tset('segSocieFrm.valDeno', jsSegSocieValDeno);\n\tset('segSocieFrm.valDire', jsSegSocieValDire);\n\tset('segSocieFrm.valTlfn', jsSegSocieValTlfn);\n\tset('segSocieFrm.valFax', jsSegSocieValFax);\n\tset('segSocieFrm.valIdenFisc', jsSegSocieValIdenFisc);\n\t\n}", "title": "" }, { "docid": "0eb351de17f1afe4cfef908c3db9691c", "score": "0.5374555", "text": "function recuperarDadosQuatroParametros(idRegistro, descricaoRegistro, codigoRegistro, tipoConsulta) {\r\n\tvar form = document.forms[0];\r\n\r\n\tif (tipoConsulta == 'setorComercialOrigem') {\r\n form.codigoSetorComercialInicial.value = codigoRegistro;\r\n\t form.nomeSetorComercialInicial.value = descricaoRegistro;\r\n\t form.nomeSetorComercialInicial.style.color = \"#000000\";\r\n\t \r\n\t form.codigoSetorComercialFinal.value = codigoRegistro;\r\n\t form.nomeSetorComercialFinal.value = descricaoRegistro;\r\n\t form.nomeSetorComercialFinal.style.color = \"#000000\";\r\n\t controleQuadra();\r\n\t}\r\n\r\n\tif (tipoConsulta == 'setorComercialDestino') {\r\n form.codigoSetorComercialFinal.value = codigoRegistro;\r\n\t form.nomeSetorComercialFinal.value = descricaoRegistro;\r\n\t form.nomeSetorComercialFinal.style.color = \"#000000\"; \r\n\t controleQuadra();\r\n\t}\r\n}", "title": "" }, { "docid": "3c6ba1c96965892dd685b3f1fd1757d0", "score": "0.53735983", "text": "function atributosEspeciales(_cajaSelected) {\n\n switch (_cajaSelected) {\n case \"CajaSorpresa\":\n //Mostramos la caja contenido\n document.getElementById(\"cajaContenido\").style.display = \"inline\";\n var division = document.getElementById(\"div3\");\n var colorCajaID = document.getElementById(\"colorCaja\");\n division.removeChild(colorCajaID);\n var colorcaja = document.createElement('input');\n division.appendChild(colorcaja);\n colorcaja.setAttribute(\"type\", \"color\");\n colorcaja.setAttribute(\"name\", \"colorCaja\");\n colorcaja.setAttribute(\"id\", \"colorCaja\");\n\n //Ocultamos placa y clave\n document.getElementById(\"cajaPlaca\").style.display = \"none\";\n document.getElementById(\"cajaClave\").style.display = \"none\";\n\n break;\n case \"CajaNegra\":\n //mostramos la caja placa\n document.getElementById(\"cajaPlaca\").style.display = \"inline\"; \n \n var division = document.getElementById(\"div3\");\n var colorCajaID = document.getElementById(\"colorCaja\");\n division.removeChild(colorCajaID);\n var colorcaja = document.createElement('input');\n division.appendChild(colorcaja);\n colorcaja.setAttribute(\"type\", \"color\");\n colorcaja.setAttribute(\"name\", \"colorCaja\");\n colorcaja.setAttribute(\"id\", \"colorCaja\");\n colorcaja.setAttribute(\"value\", \"#ff8000\");\n colorcaja.setAttribute(\"disabled\", \"\");\n //ocultamos contenido y clave\n document.getElementById(\"cajaContenido\").style.display = \"none\";\n document.getElementById(\"cajaClave\").style.display = \"none\";\n\n break;\n case \"CajaFuerte\":\n //mostramos la caja clave\n document.getElementById(\"cajaClave\").style.display = \"inline\";\n //#ff8000\n var division = document.getElementById(\"div3\");\n var colorCajaID = document.getElementById(\"colorCaja\");\n division.removeChild(colorCajaID);\n var colorcaja = document.createElement('input');\n division.appendChild(colorcaja);\n colorcaja.setAttribute(\"type\", \"color\");\n colorcaja.setAttribute(\"name\", \"colorCaja\");\n colorcaja.setAttribute(\"id\", \"colorCaja\");\n\n \n //ocultamos placa y contenido\n document.getElementById(\"cajaPlaca\").style.display = \"none\";\n document.getElementById(\"cajaContenido\").style.display = \"none\";\n\n break;\n }\n}", "title": "" }, { "docid": "804c252279c6d71f746027b63543dab3", "score": "0.53733397", "text": "function verTablaResultado(){\n \tdocument.frmBuscaSolicitud.idStMovimiento.disabled=false;\n \tdocument.frmBuscaSolicitud.region.disabled=false;\n// \tdocument.getElementById(\"divBuscaSolicitud\").style.visibility=\"visible\";\n }", "title": "" }, { "docid": "f21163807a80b8a3608982974c0c242a", "score": "0.5360393", "text": "function verificarVentanaInicial(idioma)\n{\n if (document.getElementById('pais') &&\n document.getElementById('dia') &&\n document.getElementById('mes') &&\n document.getElementById('anio') &&\n document.getElementById('documento') &&\n document.getElementById('codigo_seguridad'))\n {\n var pais = document.getElementById('pais');\n var dia = document.getElementById('dia');\n var mes = document.getElementById('mes');\n var anio = document.getElementById('anio');\n var documento = document.getElementById('documento');\n var codigo_seguridad = document.getElementById('codigo_seguridad');\n var fecha_nacimiento = document.getElementById('fecha_nacimiento');\n\n switch (idioma)\n {\n case 'ES':\n var mensaje = 'Por favor complete todos los campos';\n var mensaje2 = 'Por favor seleccione una opcion';\n var mensajeFormatoFecha = 'Atencion, El formato de la fecha debe ser dd/mm/aaaa';\n var mensajeFormatoNumero = 'El documento debe ser el nro sin puntos. ej 23434453';\n var mensajeIngresarLetras = 'Apellidos/Nombres, debe ingresar solo letras';\n var mensajeIngresarNumeros = 'Debe ingresar solo numeros';\n break;\n\n case 'PO':\n var mensaje = 'Por Favor complete todos os campos';\n var mensaje2 = 'Por Favor selecione uma opcion';\n var mensajeFormatoFecha = 'Atenca, o formato da data deve ser dd/mm/aaaa';\n var mensajeFormatoNumero = 'A carteira deve ser o numero sem puntos';\n var mensajeIngresarLetras = 'Sobrenomes/Nomes, deve ingressar somente letras';\n var mensajeIngresarNumeros = 'Deve ingressar somente numeros';\n break;\n\n case 'EN':\n var mensaje = 'Please fill in all the gaps';\n var mensaje2 = 'Please select an option';\n var mensajeFormatoFecha = 'Atention, date format must be dd/mm/yyyy';\n var mensajeFormatoNumero = 'Document must be a number without special characters';\n var mensajeIngresarLetras = 'Last names/Names, you must enter only letters';\n var mensajeIngresarNumeros = 'You must enter only numbers';\n break;\n }\n\n if (pais.value.length == 0)\n {\n alert(mensaje);\n pais.focus();\n return false;\n }\n if (pais.value == '0')\n {\n alert(mensaje2);\n pais.focus();\n return false;\n }\n\n if (dia.value.length == 0)\n {\n alert(mensaje);\n dia.focus();\n return false;\n }\n\n if (dia.value != \"\" &&\n !chkNumeric(dia.value))\n {\n alert(mensajeIngresarNumeros);\n dia.value = \"\";\n dia.focus();\n return false;\n }\n\n if (mes.value.length == 0)\n {\n alert(mensaje);\n mes.focus();\n return false;\n }\n\n if (mes.value != \"\" &&\n !chkNumeric(mes.value))\n {\n alert(mensajeIngresarNumeros);\n mes.value = \"\";\n mes.focus();\n return false;\n }\n\n if (anio.value.length == 0)\n {\n alert(mensaje);\n anio.focus();\n return false;\n }\n\n if (anio.value != \"\" &&\n !chkNumeric(anio.value))\n {\n alert(mensajeIngresarNumeros);\n anio.value = \"\";\n anio.focus();\n return false;\n }\n\n fecha_nacimiento.value = dia.value + '-' + mes.value + '-' + anio.value;\n if (chkDate_(fecha_nacimiento) == false)\n {\n alert(mensajeFormatoFecha);\n dia.focus();\n return false;\n }\n\n if (documento.value.length == 0)\n {\n alert(mensaje);\n documento.focus();\n return false;\n }\n\n if (codigo_seguridad.value.length == 0)\n {\n alert(mensaje);\n codigo_seguridad.focus();\n return false;\n }\n\n }\n else\n {\n alert('Verificar validaciones');\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "8df22401964227d51e4050771b6ece5d", "score": "0.5360183", "text": "function fnc_form_objs_verificar_requeridos (ia_obj)\n{\n\tvar pb_value = true;\n\tvar pc_message = '';\n\n\tvar ac_object;\n\tvar pc_form;\n\tvar pc_tab_container;\n\tvar pc_type;\n\tvar pc_col;\n\tvar pc_col_dsc;\n\n\t// Selector\n\tvar pc_selector = '';\n\t$.each(ia_obj, function (i, option) {\n\t\tif (option.indexOf(',') > -1)\n\t\t{\n\t\t\tvar pa_result = fnc_GET_ArrayValues_to_RowString(option, ',');\n\t\t\tpc_selector += Obj_Col(pa_result[0], pa_result[1]) + ':required.invalid, ';\n\t\t}\n\t\telse\n\t\t{\n\t\t\tpc_selector = \n\t\t\t\t\t\t'#' + option + ' select:required.invalid, ' + \n\t\t\t\t\t\t'#' + option + ' input:required.invalid, ' + \n\t\t\t\t\t\t'#' + option + ' table.required, ' + \n\t\t\t\t\t\t'#' + option + ' textarea:required.invalid ';\n\t\t}\n\t});\n\tpc_selector = pc_selector.substring(0, pc_selector.length - 2);\n\n\t// Ejecucion\n\t$(pc_selector).each(function() {\n\t\tif (pb_value === true)\n\t\t{\n\t\t\tac_object = fnc_GET_Obj_Attributes(this);\n\t\t\tpc_form = ac_object.form;\n\t\t\tpc_tab_container = ac_object.tab_container;\n\t\t\tpc_type = ac_object.type;\n\t\t\tpc_col = ac_object.col;\n\t\t\tpc_col_dsc = ac_object.col_dsc;\n\n\t\t\tif (pc_type === 'input' || pc_type === 'select' || pc_type === 'textarea')\n\t\t\t{\n\t\t\t\tpb_value = false;\n\t\t\t\tpc_message = 'Ingrese valor: ' + (pc_col_dsc === undefined ? pc_col : pc_col_dsc);\n\n\t\t\t\tfnc_set_focus(pc_form, pc_col);\n\t\t\t}\n\t\t\telse if (pc_type === 'table')\n\t\t\t{\n\t\t\t\tvar obj_id_ = $(this).attr('id');\n\t\t\t\tvar pn_count_items = $('#' + obj_id_).DataTable().data().count();\n\t\t\t\tif (pn_count_items === 0) {\n\t\t\t\t\tpb_value = false;\n\t\t\t\t\tpc_message = (pc_col_dsc === '' ? '¡Inserte item(s) a la grilla!' : '¡Inserte ' + pc_col_dsc + '!');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (pb_value === false) {\n\t\t\t\tswal(gc_msj_titulo_error, pc_message, gc_msj_tipo_error);\n\t\t\t\t$(\".tabs\").tabs(\"select\", pc_tab_container);\n\t\t\t}\n\t\t}\n\t});\n\treturn pb_value;\n}", "title": "" }, { "docid": "4bc08697afdba6da5e64de59f1a184c1", "score": "0.5358498", "text": "function ocultarFormularios(){\r\n for(let item of formularioMetodoDePago){\r\n item.style.display = \"none\";\r\n }\r\n}", "title": "" }, { "docid": "f3c76b74abd243f1b0aeaa4ff155f564", "score": "0.53584623", "text": "function changeLabelNewCarForm() {\n var visibleForm = document.getElementById('container').hidden;\n var addFormLabel = document.getElementById('openForm');\n inputTipo = document.getElementById('tipo-vehiculo');\n if (visibleForm == true) {\n showForm();\n addFormLabel.value = \"Cerrar formulario\";\n }\n else {\n hideForm();\n clearTextBoxForm();\n clearBorderTextBoxForm();\n addFormLabel.value = \"Alta\";\n }\n }", "title": "" }, { "docid": "88ee949e8da9ebdb2d3aeebf4e26d3b2", "score": "0.535564", "text": "function ver_grado(pk,nombre,nivel){\n\tpk_grado = pk;\n\t$('#formAgregarGrado').hide();\n\t$('#formModGrado').show();\n \t$(\"label\").addClass(\"active\");\n\t$(\"#mod_nombre\").val(nombre);\n\t$('#selectNivelMod').find('option[value=\"'+nivel+'\"]').prop('selected', true);\n\t$(\"#selectNivelMod\").material_select();\n}", "title": "" } ]
79853efc09a1efc5a8d7b4b785d4ea0f
Returns true if the given value is a String.
[ { "docid": "745233714688bbd03a7aade0a5d57f3c", "score": "0.7298515", "text": "function _isString(v) {\n return (typeof v === 'string' ||\n Object.prototype.toString.call(v) === '[object String]');\n}", "title": "" } ]
[ { "docid": "e17e4c350e721cc63fc83a1b33ecba5b", "score": "0.8366715", "text": "function acpIsString (value) {\n return typeof value === 'string' || value instanceof String;\n}", "title": "" }, { "docid": "5f800a9a3dcb9f854ae44b9b5cc95000", "score": "0.8266768", "text": "function isString(value) {\n return value && Object.prototype.toString.call(value) === '[object String]';\n }", "title": "" }, { "docid": "5fd14f19962fa5f6e2046dbbeca23986", "score": "0.8165503", "text": "static isString(value){\n\t\tif (typeof value == 'string') return true;\n\t\telse if (value instanceof String) return true;\n\t\treturn false;\n\t}", "title": "" }, { "docid": "6a3b884aa33c5be2ec7e0158c23f16a2", "score": "0.81117105", "text": "function isString(value) {\n return isType(value, 'string');\n}", "title": "" }, { "docid": "e6a4b0f0d775d8ba27206cdcfbeb113a", "score": "0.80498934", "text": "static isString(value) {\r\n return value === null || value === undefined\r\n ? false : Object.prototype.toString.call(value) === \"[object String]\";\r\n }", "title": "" }, { "docid": "450e58774e1d9b45c5cd4715279e6af0", "score": "0.8025104", "text": "function isString (value) {\n return typeof value === 'string' || value instanceof String;\n}", "title": "" }, { "docid": "b4dbc0765dba2a0677d02436380e7820", "score": "0.80236083", "text": "function isString(value){\n if(typeof(value) === \"string\"){\n return true; \n }\n return false;\n }", "title": "" }, { "docid": "66ef198ae3c83bfc8161e911cee5f381", "score": "0.80152935", "text": "function isString(value) {\n return typeof value === 'string' || value instanceof String;\n}", "title": "" }, { "docid": "66ef198ae3c83bfc8161e911cee5f381", "score": "0.80152935", "text": "function isString(value) {\n return typeof value === 'string' || value instanceof String;\n}", "title": "" }, { "docid": "66ef198ae3c83bfc8161e911cee5f381", "score": "0.80152935", "text": "function isString(value) {\n return typeof value === 'string' || value instanceof String;\n}", "title": "" }, { "docid": "66ef198ae3c83bfc8161e911cee5f381", "score": "0.80152935", "text": "function isString(value) {\n return typeof value === 'string' || value instanceof String;\n}", "title": "" }, { "docid": "66ef198ae3c83bfc8161e911cee5f381", "score": "0.80152935", "text": "function isString(value) {\n return typeof value === 'string' || value instanceof String;\n}", "title": "" }, { "docid": "8e5fc7a6c61cabf7f9c43479688ccacf", "score": "0.8008182", "text": "function isString(value) {\n return typeof value === \"string\";\n }", "title": "" }, { "docid": "77acea1046b89e3206cef760b841bdcc", "score": "0.79990727", "text": "function isString(value) {\n\t return typeof value === \"string\";\n\t }", "title": "" }, { "docid": "4a98a61ef685e6c44933c27e75f1219d", "score": "0.7994812", "text": "function isString(value) {\n return typeof value === \"string\" || value instanceof String;\n}", "title": "" }, { "docid": "74e46bdb07cabc9b0ad990c08c20705b", "score": "0.7990046", "text": "function isString(value) {\n return typeof value === 'string' || value instanceof String\n}", "title": "" }, { "docid": "023203734fb7ffc7ca9f4beefe7b58f0", "score": "0.7988498", "text": "isString (value) {\n return typeof value === 'string' || value instanceof String;\n }", "title": "" }, { "docid": "2fe65d9926bfdd86b1d71e4b8a1f8dd2", "score": "0.7976842", "text": "function isString(value) {\n\t\treturn value instanceof String || typeof value === \"string\";\n\t}", "title": "" }, { "docid": "7aca2e0034b2e4cb843e9ff4ea74f832", "score": "0.795682", "text": "function isString( value ) {\n\n\treturn( {}.toString.call( value ) === \"[object String]\" );\n\n}", "title": "" }, { "docid": "ed5489c34bbeafcbd0681ee6c8aa036b", "score": "0.7950993", "text": "function isString(value) {\r\n return typeof value === \"string\";\r\n}", "title": "" }, { "docid": "2f96449baf11d4b57dbc87032b0840cd", "score": "0.7947773", "text": "function isString(value) {\n return typeof(value) == 'string';\n}", "title": "" }, { "docid": "f352697fccf8a183b4f19b5428736dae", "score": "0.79193044", "text": "function isString(value) {\n return typeof value === \"string\";\n}", "title": "" }, { "docid": "f352697fccf8a183b4f19b5428736dae", "score": "0.79193044", "text": "function isString(value) {\n return typeof value === \"string\";\n}", "title": "" }, { "docid": "f352697fccf8a183b4f19b5428736dae", "score": "0.79193044", "text": "function isString(value) {\n return typeof value === \"string\";\n}", "title": "" }, { "docid": "d17fce1d1cd8001d31068c28f26b1349", "score": "0.7725182", "text": "function isString(val) {\n return objToString(val) == \"[object String]\";\n}", "title": "" }, { "docid": "11dd12d269c18d5200f042e6b10c01d4", "score": "0.77167064", "text": "function isString(value) {\n\n return $.type(value) === 'string' && $.trim(value).length > 0;\n\n }", "title": "" }, { "docid": "845aed9b9a75e860b40a4dfc1e6d10cc", "score": "0.76755804", "text": "function _isString(value) {\n return $.type(value) === 'string' && $.trim(value).length > 0;\n }", "title": "" }, { "docid": "92fb31bc6846411426b9e4346ab613e9", "score": "0.76096606", "text": "function isString(str){\n if (typeof str === 'string' || str instanceof String)\n return true;\n else\n return false;\n }//end isString", "title": "" }, { "docid": "fd5b5698a958899acb04f99d2dbba599", "score": "0.75833565", "text": "function isString(val) {\n return typeof val === 'string';\n }", "title": "" }, { "docid": "d9217ab5ab347a542d92131175f5e014", "score": "0.75720495", "text": "function isString(val) {\n return typeof val === 'string' || ((!!val && typeof val === 'object') && Object.prototype.toString.call(val) === '[object String]');\n}", "title": "" }, { "docid": "53f47685bc0348c01b22721aa47a3ce0", "score": "0.75707877", "text": "function IsString(value, requireLength = false) {\n if (value && typeof value === 'string' && !(IsNumber(value))) {\n if (requireLength) {\n if (String(value).length) {\n return true;\n }\n else {\n return false;\n }\n }\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "8a746901f0d6b7154dbe4c4c43222deb", "score": "0.7540349", "text": "function typeString(x){\n return (typeof(x) === \"string\")\n}", "title": "" }, { "docid": "4f9b004c40d3ff28cb01c13590b2427f", "score": "0.75374806", "text": "isString(value){\r\nreturn typeof value === \"string\" || value instanceof String;\r\n}", "title": "" }, { "docid": "9af7320d1467950c05a1dc5b3700ddca", "score": "0.75235957", "text": "function isStr(s) {\n return typeof s === 'string';\n }", "title": "" }, { "docid": "6469b44a93d99ceed36c53f13bdad91f", "score": "0.7519343", "text": "function isString(val) {\n return typeof val === 'string';\n}", "title": "" }, { "docid": "6469b44a93d99ceed36c53f13bdad91f", "score": "0.7519343", "text": "function isString(val) {\n return typeof val === 'string';\n}", "title": "" }, { "docid": "6469b44a93d99ceed36c53f13bdad91f", "score": "0.7519343", "text": "function isString(val) {\n return typeof val === 'string';\n}", "title": "" }, { "docid": "f0f26201af075156b316289756ae834c", "score": "0.7507365", "text": "function isString(val) {\r\n\treturn typeof val === 'string' || val instanceof String;\r\n}", "title": "" }, { "docid": "cdb9e8c76f79293775c708d1d6f150c0", "score": "0.75031567", "text": "function isString(value) {\n return Object.prototype.toString.call(value) === const_object_string;\n }", "title": "" }, { "docid": "bf39e76b5ad6ba746609e424701cc7b5", "score": "0.74960816", "text": "function stringable(val){\n return /string|number|boolean/.test(typeof val);\n}", "title": "" }, { "docid": "de381160fa3eb144938fe423b160cd17", "score": "0.74085164", "text": "function _isString(input) {\n return (input && input.constructor === String);\n}", "title": "" }, { "docid": "61b0a0edda8568a6b10e448e559548db", "score": "0.73935676", "text": "isString(val) {\n return typeof val === \"string\" && \n !(val instanceof String);\n }", "title": "" }, { "docid": "cfdf246f4b95977a061d16d51337c149", "score": "0.7369516", "text": "function isString(x) {\n return Object.prototype.toString.call(x) === '[object String]';\n }", "title": "" }, { "docid": "6b26006439e90e9ede053b8ef6878636", "score": "0.7360881", "text": "function isString(obj) {\n return !!(obj === '' || (obj && obj.charCodeAt && obj.substr));\n }", "title": "" }, { "docid": "795d7019e09bb2d653a1d9e3ff7e057e", "score": "0.73493975", "text": "function isString(obj) {\n return !!(obj === '' || (obj && obj.charCodeAt && obj.substr));\n }", "title": "" }, { "docid": "125a706f1d7deefdf22ded19bed25e8f", "score": "0.7301884", "text": "function isString(obj) {\n\t\treturn !!(obj === '' || (obj && obj.charCodeAt && obj.substr));\n\t}", "title": "" }, { "docid": "125a706f1d7deefdf22ded19bed25e8f", "score": "0.7301884", "text": "function isString(obj) {\n\t\treturn !!(obj === '' || (obj && obj.charCodeAt && obj.substr));\n\t}", "title": "" }, { "docid": "9820807cf6a8cbf6c16690dbb03436eb", "score": "0.72924906", "text": "function is_string(s) {\n return (typeof s == 'string');\n}", "title": "" }, { "docid": "bade569061cec170a0001770e004329d", "score": "0.7265081", "text": "function isString(val) {\r\n if (typeof (val) == 'string') return true;\r\n if (typeof (val) == 'object') {\r\n var criterion = arguments[0].constructor.toString().match(/string/i);\r\n return (criterion != null);\r\n }\r\n return false;\r\n}", "title": "" }, { "docid": "4c6a460a0322ad07231347c29231517f", "score": "0.7261945", "text": "function string (data) {\n return typeof data === 'string';\n }", "title": "" }, { "docid": "f5dee52ca24a2784c556a0b6c7dbb750", "score": "0.7233582", "text": "function isString(v) {\n return typeof v === 'string';\n}", "title": "" }, { "docid": "50ecd6e87a231baa691b5f2a8916ee67", "score": "0.7222022", "text": "function isString (str) {\n return (typeof str === 'string');\n }", "title": "" }, { "docid": "9e68345958b3cb2e1900d7e8f55de6fe", "score": "0.7216186", "text": "function isString(s) {\n return typeof(s) === 'string' || s instanceof String;\n }", "title": "" }, { "docid": "5d3d99c0ca637f28395ea54e75d06292", "score": "0.7208989", "text": "function isString(str) {\n return typeof str === 'string' || str instanceof String;\n}", "title": "" }, { "docid": "82db0a657dab5878c652126141dd65df", "score": "0.7206216", "text": "function isString(str) {\n return (typeof str === 'string') || (str.constructor === String);\n }", "title": "" }, { "docid": "e28a8ff6f1f81f47cc93e9d7fb846af6", "score": "0.7188787", "text": "function is_string(arg){return typeof arg==='string';}", "title": "" }, { "docid": "884bbcadbfb7aaf04b97ac49dd9c489b", "score": "0.7184339", "text": "function isString(a) {\n\treturn (typeof a === \"string\");\n}", "title": "" }, { "docid": "4df4a7669c51ee4a6f04b229f6839961", "score": "0.71786", "text": "function isString(input) {\n\t return typeof input === 'string';\n\t}", "title": "" }, { "docid": "ec56239f15e470c8d46a8910250748b6", "score": "0.71781486", "text": "function isString(s) {\n return typeof s === 'string' || s instanceof String;\n}", "title": "" }, { "docid": "ec56239f15e470c8d46a8910250748b6", "score": "0.71781486", "text": "function isString(s) {\n return typeof s === 'string' || s instanceof String;\n}", "title": "" }, { "docid": "04223086ca5f840e1efa881b01cddd1d", "score": "0.71755093", "text": "function isString(obj) {\n return Object.prototype.toString.call(obj) === '[object String]';\n }", "title": "" }, { "docid": "8a0e08d0d64427d767666896bd538233", "score": "0.71526635", "text": "function isString(o) {\n return toString.call(o) == '[object String]';\n}", "title": "" }, { "docid": "2f81e11fae02f78eef52863136010200", "score": "0.715013", "text": "function isString(input) {\n return typeof input === 'string';\n}", "title": "" }, { "docid": "3ee1b677a36fe650f4d12ebe2f2f7518", "score": "0.71277124", "text": "function isString(object) { return typeof object === 'string'; }", "title": "" }, { "docid": "3ee1b677a36fe650f4d12ebe2f2f7518", "score": "0.71277124", "text": "function isString(object) { return typeof object === 'string'; }", "title": "" }, { "docid": "82a75fd7924f4e5b6f5ad7016e76136a", "score": "0.7127184", "text": "function isString(a) {\n if (typeof a === \"string\") {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "ccc3541931e2b9f9142252b3ec7eee91", "score": "0.7101168", "text": "function isString(Type) {\n return Type.name === 'String';\n}", "title": "" }, { "docid": "33d392ebbb1e7322a1eeb0e9c4a76c13", "score": "0.7100341", "text": "function isString(str) {\n return str && typeof str === 'string';\n}", "title": "" }, { "docid": "33d392ebbb1e7322a1eeb0e9c4a76c13", "score": "0.7100341", "text": "function isString(str) {\n return str && typeof str === 'string';\n}", "title": "" }, { "docid": "bbdfa68aed4a27d9d64cee13362f28f5", "score": "0.70933586", "text": "function string (data) {\n\t return typeof data === 'string';\n\t }", "title": "" }, { "docid": "b0f8ff1f0816a0e8f5bd25496aacd67c", "score": "0.7085829", "text": "function isString(x) {\n return (typeof x) == \"string\"\n}", "title": "" }, { "docid": "3e58f0d5ff1d142490e110c796c70cc1", "score": "0.70787054", "text": "function isString(input) {\n return typeof input == \"string\";\n}", "title": "" }, { "docid": "bae1347e8b14dffe120e37f614586596", "score": "0.7030307", "text": "function _isString(v){return typeof v==='string'||Object.prototype.toString.call(v)==='[object String]';}", "title": "" }, { "docid": "65533641ede86e11cfb2603f94356d4c", "score": "0.7023518", "text": "function is_string( arg ) {\n return typeof arg === 'string';\n }", "title": "" }, { "docid": "cbcbcfb42af5b88bdf6dfd8c27be8e70", "score": "0.701947", "text": "function is_string( arg ) {\r\n return typeof arg === 'string';\r\n }", "title": "" }, { "docid": "1be5fcca38d3d302c76923df16fa7501", "score": "0.7019105", "text": "function isString (obj) {\n return Object.prototype.toString.apply(obj) === '[object String]';\n }", "title": "" }, { "docid": "680e7a2aadeee301894b1cc8fb96b11d", "score": "0.70182866", "text": "function isString(arg) {\n\treturn typeof arg === 'string';\n}", "title": "" }, { "docid": "e4d76e384af77fbd1c495bba4250970a", "score": "0.7010543", "text": "function isString(input){\n return typeof input == \"string\"\n}", "title": "" }, { "docid": "bcb90ebfa63e7662634de225e24ce98f", "score": "0.6980741", "text": "function isString(s){return typeof s==='string'||s instanceof String;}// ## Exports", "title": "" }, { "docid": "bcb90ebfa63e7662634de225e24ce98f", "score": "0.6980741", "text": "function isString(s){return typeof s==='string'||s instanceof String;}// ## Exports", "title": "" }, { "docid": "4578318ddcffccc0eea6132aef3c0ca6", "score": "0.6977599", "text": "function isString(arg){\n return (typeof arg == \"string\");\n}", "title": "" }, { "docid": "f6c57c31d904671d692f24cded2c583f", "score": "0.6958186", "text": "function isString(o) {\n return (\n typeof o === \"string\" || (typeof o === \"object\" && o.constructor === String)\n );\n}", "title": "" }, { "docid": "be9c5a2b80a36e1b15cacd251a924ebe", "score": "0.6945913", "text": "function isString(x) {\n return x !== null && x !== undefined && x.constructor === String\n}", "title": "" }, { "docid": "e716a301fb97b2c157794053d9c0772a", "score": "0.68960476", "text": "function isString(object)\r\n {\r\n return (object != null\r\n && object != undefined\r\n && object.constructor == String);\r\n }", "title": "" }, { "docid": "dad10466cb944c6e1793619d155b25f5", "score": "0.6881992", "text": "function _isString (obj) {\n\t\treturn toString.call(obj) === '[object String]';\n\t}", "title": "" }, { "docid": "2f3b30a8c784a268c82d32079b8e4899", "score": "0.6876485", "text": "function isString$7(str) {\n return typeof str === 'string' || str instanceof String;\n}", "title": "" }, { "docid": "da0b05939940844d47905902c7e4e367", "score": "0.6875327", "text": "function isString$6(str) {\n return typeof str === 'string' || str instanceof String;\n}", "title": "" }, { "docid": "7797d09c033d3b8daa0f015eaaa1fe33", "score": "0.68709195", "text": "function isString(obj) {\r\n\t\t\treturn typeof obj == \"string\" || Object.prototype.toString.call(obj) === \"[object String]\";\r\n\t\t}", "title": "" }, { "docid": "9d1ce609790091ebdef7d8043ae0e7ac", "score": "0.6870077", "text": "function isString$2(str) {\n return typeof str === 'string' || str instanceof String;\n}", "title": "" }, { "docid": "208f5c651936e4f89a234eaf5947a0f9", "score": "0.6869973", "text": "function isString$8(str) {\n return typeof str === 'string' || str instanceof String;\n}", "title": "" }, { "docid": "f181b3a03f5a93035c47bfaa7b794bea", "score": "0.68631166", "text": "function isString$3(str) {\n return typeof str === 'string' || str instanceof String;\n}", "title": "" }, { "docid": "c8c512d47dd1dbb870a6e745d129c045", "score": "0.6840657", "text": "_isStringOrBoolean(value) {\r\n return typeof value === 'string' || typeof value === 'boolean';\r\n }", "title": "" }, { "docid": "1871e969f12729ac009027a249cac87a", "score": "0.68219626", "text": "function isString(object) {\r\n return typeof object == 'string';\r\n}", "title": "" }, { "docid": "ac0f12b5cc4a29c407ca90d9ae90cd1e", "score": "0.6811837", "text": "function isString(obj) {\n return typeof obj === \"string\";\n }", "title": "" }, { "docid": "750fb2093d2fe3042b1068b1539a8f54", "score": "0.6810035", "text": "function _isString(obj) {\n\treturn (typeof obj === 'string' || obj instanceof String);\n}", "title": "" }, { "docid": "04f93e95ba3a1c7676a1bfdacde20a20", "score": "0.6805445", "text": "function isString(currentValue) {\n return typeof currentValue === 'string';\n}", "title": "" }, { "docid": "5dec70c3a8fde018757d89616cc780b1", "score": "0.6800457", "text": "function isItAString (maybeString) {\n return typeof maybeString === 'string';\n}", "title": "" } ]
2697cb527e255878744d3e9371d0ad3e
use media query to check for retina screen
[ { "docid": "fb976f28f5d48f8fac1c8d7781676c8a", "score": "0.6309636", "text": "function getDevicePixelRatio() {\n\n\t var mediaQuery = '(-webkit-min-device-pixel-ratio: 1.5),' +\n\t '(min--moz-device-pixel-ratio: 1.5), ' +\n\t '(-o-min-device-pixel-ratio: 3/2), ' +\n\t '(min-device-pixel-ratio: 1.5), ' +\n\t '(min-resolution: 1.5dppx), ' +\n\t '(min-resolution: 192dpi)';\n\n\t window.devicePixelRatio = window.devicePixelRatio ||\n\t window.screen.deviceXDPI / window.screen.logicalXDPI;\n\t if (window.devicePixelRatio >= 1.5) {\n\t return Retina.RETINA_RATIO.RETINA_2X;\n\t }\n\n\t if (window.matchMedia && window.matchMedia(mediaQuery).matches) {\n\t return Retina.RETINA_RATIO.RETINA_2X;\n\t }\n\n\t return Retina.RETINA_RATIO.NORMAL;\n\t }", "title": "" } ]
[ { "docid": "99c7c95f7749e3a5ce5b96dbf7d3c400", "score": "0.8254009", "text": "function isRetinaDisplay() {\n if (window.matchMedia) {\n var mq = window.matchMedia(\"only screen and (min--moz-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 2.6/2), only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (min-device-pixel-ratio: 1.3), only screen and (min-resolution: 1.3dppx)\");\n return (mq && mq.matches || (window.devicePixelRatio > 1)); \n }\n}", "title": "" }, { "docid": "1c0650f82bf0d0a09a643dfb4b5623ce", "score": "0.8205975", "text": "function isRetina() {\n var query = '(-webkit-min-device-pixel-ratio: 1.5),\\\n (min--moz-device-pixel-ratio: 1.5),\\\n (-o-min-device-pixel-ratio: 3/2),\\\n (min-device-pixel-ratio: 1.5),\\\n (min-resolution: 144dpi),\\\n (min-resolution: 1.5dppx)';\n\n if (window.devicePixelRatio > 1 || (window.matchMedia && window.matchMedia(query).matches)) {\n return true;\n }\n\n return false;\n}", "title": "" }, { "docid": "9600342ea5d7e741aab5322758453047", "score": "0.81544095", "text": "function isRetina() {\n var mediaQuery = \"(-webkit-min-device-pixel-ratio: 1.5),\\\n (min--moz-device-pixel-ratio: 1.5),\\\n (-o-min-device-pixel-ratio: 3/2),\\\n (min-resolution: 1.5dppx)\";\n\n if (window.devicePixelRatio > 1) {\n return true;\n } else if (window.matchMedia && window.matchMedia(mediaQuery).matches) {\n return true;\n }\n\n return false;\n}", "title": "" }, { "docid": "80c4992400c0522ddeae267b827613ec", "score": "0.793416", "text": "function isRetina() {\n var is_retina = window.devicePixelRatio > 1 ||\n ( window.matchMedia && window.matchMedia(\"(-webkit-min-device-pixel-ratio: 1.5),(-moz-min-device-pixel-ratio: 1.5),(min-device-pixel-ratio: 1.5)\").matches );\n return is_retina;\n}", "title": "" }, { "docid": "4dfd4ee941ee697e5d3a0f820b3db8e0", "score": "0.65044695", "text": "function xsDevice() {\n if (viewportWidth <= 480) {\n return true;\n }\n}", "title": "" }, { "docid": "5c2cb6e1f896171d9142f475a6746651", "score": "0.6480187", "text": "function isHiDPI() {\n var query =\n \"(-webkit-min\" + devicePixelRatio15 +\n \"(min--moz\" + devicePixelRatio15 +\n \"(-ms-min\" + devicePixelRatio15 +\n \"(-o-min\" + devicePixelRatio15 +\n \"(min\" + devicePixelRatio15 +\n \"(min-resolution: 1.5dppx)\";\n\n if (w.devicePixelRatio && w.devicePixelRatio > 1)\n return true;\n\n if (w.matchMedia && w.matchMedia(query).matches)\n return true;\n\n return false;\n }", "title": "" }, { "docid": "6b3edccccc9ac26a727c4dafd562e3a6", "score": "0.64308923", "text": "function screenSize() {\n return xxsmall.matches ? 200 :\n xsmall.matches ? 250 :\n small.matches ? 350 :\n medium.matches ? 500 :\n large.matches ? 600 :\n xlarge.matches ? 350 :\n xxlarge.matches ? 1000 :\n null;\n }", "title": "" }, { "docid": "aecb18e91fc3c3f4058e673d62a70729", "score": "0.63344", "text": "isMobileScreen() {\n if (window.innerWidth < 768) return true;\n if (window.innerHeight < 400) return true;\n return false;\n }", "title": "" }, { "docid": "77a18b706e26caa82ebcdcd3b609c75e", "score": "0.6217536", "text": "isTablet() {\n \treturn Math.max( window.screen.width, window.screen.height ) / Math.min( window.screen.width, window.screen.height ) < 1.35 &&\n \t!( /(Oculus|Gear)/ ).test( navigator.userAgent );\n }", "title": "" }, { "docid": "f76058b728a1f33d33cbd11425b5446f", "score": "0.62175304", "text": "function lyingAboutRes() {\n return screen.width != screen.availWidth || screen.height != screen.availHeight ||\n screen.width != window.innerWidth || screen.height * 0.85 > window.innerHeight;\n}", "title": "" }, { "docid": "0f221cf31c947c8fe4497a0cf24953fc", "score": "0.6208182", "text": "function checkDeviceSize() {\n let winWidth = getWidth();\n\n if (winWidth >= 768 && winWidth < 992) {\n //It is in a tablet screen size\n putImageAsChild();\n } else {\n putImageAsSibling();\n }\n }", "title": "" }, { "docid": "d66f57eb40556951fdd2458f91391426", "score": "0.61977565", "text": "function setDevice(){\n var viewportWidth = $(window).width();\n isLarge = (viewportWidth >= 1200);\n isMedium = (viewportWidth >= 993 && viewportWidth <= 1199);\n isSmall = (viewportWidth >= 768 && viewportWidth <= 992);\n isExtraSmall = (viewportWidth <= 767);\n }", "title": "" }, { "docid": "97a04a40937cae2cc329ae0634b1b98b", "score": "0.61467445", "text": "function xsDevice() {\n if (viewportWidth <= 767) {\n return true;\n }\n}", "title": "" }, { "docid": "4f8d4f627ade879de461b175e508eab4", "score": "0.61458963", "text": "isTablet() {\n let width = window.innerWidth;\n return width <= 1024 && width > 640;\n }", "title": "" }, { "docid": "c8d5967517d93b16154619ccaf9196a6", "score": "0.6067812", "text": "function detectScreenWidth() {\n if ($(window).width() < 768) {\n let zoom = 10;\n console.log('screen size is less than 768px');\n return zoom;\n } else {\n let zoom = 11;\n console.log('screen size is less than 768px');\n return zoom;\n };\n}", "title": "" }, { "docid": "976526ea0d3fe6d50242d22e323b359d", "score": "0.6034407", "text": "function isMinimalScreen() {\n var mediaQuery = Terra.getMediaQueryName();\n\n return mediaQuery === 'xxs' || mediaQuery === 'xs' || mediaQuery === 's';\n }", "title": "" }, { "docid": "0a38e502c49656a694b96be1c74f7911", "score": "0.60293406", "text": "function onBigScreens() {\n if (window.innerWidth >= 950) {\n return true\n } else {\n return false\n }\n}", "title": "" }, { "docid": "c3dfc393a8dd3497cbdfb1c62bc2e2c0", "score": "0.59834087", "text": "isMobilePortrait() {\n if (window.innerWidth < 576) return true;\n return false;\n }", "title": "" }, { "docid": "f7344af76460ec6335826f8e1a28eaae", "score": "0.5981213", "text": "function pixflow_isMobile() {\r\n 'use strict';\r\n\r\n try {\r\n if(/Android|webOS|iPhone|iPad|iPod|pocket|psp|kindle|avantgo|blazer|midori|Tablet|Palm|maemo|plucker|phone|BlackBerry|symbian|IEMobile|mobile|ZuneWP7|Windows Phone|Opera Mini/i.test(navigator.userAgent)) {\r\n return true;\r\n }\r\n return false;\r\n } catch(e){ console.log(\"Error in isMobile\"); return false; }\r\n}", "title": "" }, { "docid": "e00b98503247d68fc6498242a6af85be", "score": "0.5972475", "text": "function checkPixelRatio() {\n // Check for pixel issues.\n // Must be done in full screen, so we can compare real screen size with document.\n // This must therefore be called after the real screen size is established and document loaded.\n // To have this operate at start we use fullscreen: true,\n // with 'deferred' \"deferfullscreen\": false if we don't really want to start fullscreen.\n // This does cause some glitch at start, we may just want to make calling this optional,\n // or preferably find a better way to test.\n if (nwwin) {\n if (electron.restarts > 1) return;\n var ppp = require('./package');\n // test for correct resolution if we start fullscreen\n if (nwwin.isFullscreen) {\n var exp = screens[0].width;\n var got = document.body.clientWidth;\n if (exp !== got) {\n serious(\"unexpected initial widths, ?pixel scaling issue: \" + exp + \" != \" + got + \"\\r\\n\" +\n \"For Windows, make sure the Compatibility/Disable display scaling setting is ticked for the executable property.\");\n }\n }\n // force to required initial if appropriate. also after F5 as well as on fresh start\n var ww = ppp.window || { deferfullscreen: false };\n if (ww.deferfullscreen === false) {\n nwwin.leaveFullscreen();\n let w = FIRST(ww.width, screen.availWidth, screens[0].width, 800);\n let h = FIRST(ww.height, screen.availHeight, screens[0].height, 600);\n let l = FIRST(ww.left, screen.availLeft, 0);\n let t = FIRST(ww.top, screen.availTop, 0);\n nwwin.resizeTo(w, h);\n nwwin.moveTo(l, t);\n }\n }\n}", "title": "" }, { "docid": "07519a0a72cd9784b975d3d7b9c36c16", "score": "0.59507096", "text": "function computeScreenAwareSize(cssPx){var screenPx=window.devicePixelRatio*cssPx;return Math.max(1,Math.floor(screenPx))/window.devicePixelRatio;}", "title": "" }, { "docid": "1217f41c73dceccb0cc06cf01aba0319", "score": "0.5947001", "text": "function checkMediaQuery() {\n\n let mq = window.matchMedia( \"(max-width: 599px)\" );\n\n return mq.matches;\n\n }", "title": "" }, { "docid": "72c6080425031b7065df328aff824c4f", "score": "0.5932424", "text": "_detect_mobile() {\n var winsize = $(window).width();\n\n if (winsize < 520) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "9796edc737584cb4eecd108a85762779", "score": "0.5868607", "text": "_detect_mobile() {\n var winsize = $(window).width();\n\n if (winsize < 520) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "d3a96269c6c217123789f7b15e616f48", "score": "0.58641374", "text": "function matchMediaNatively(query) {\n return window.matchMedia(query)\n }", "title": "" }, { "docid": "d329e0307f2592463cbed8aec760973e", "score": "0.5846817", "text": "function identifyScreenType() {\n\tvar styleSheets = document.styleSheets;\n\tfor (var i = 0; i < styleSheets.length; i++) {\n\t\tvar styleSheet = styleSheets[i];\n\t\tvar href = styleSheet.href;\n\t\tif (null != href && href.indexOf('style-narrower.css') != -1) {\n\t\t\tscreenType = 'small-screen';\n\t\t\treturn;\n\t\t}\n\t}\n\tscreenType = 'big-screen';\n}", "title": "" }, { "docid": "2f639e3e68acca5be77da30ad70c6c64", "score": "0.5842923", "text": "function testEnvironment() {\nvar currentEnvironment = environment;\nwindowWidth = viewport().width;\nif (windowWidth <= 1279 && windowWidth > 639) {\nenvironment = 'tablette';\n} else if (windowWidth <= 639) {\nenvironment = 'mobile';\n} else {\nenvironment = 'desktop';\n}\nif (currentEnvironment != environment) {\nreturn true;\n} else {\nreturn false;\n}\n}", "title": "" }, { "docid": "861b47565b82ea77fec34600a98d61fe", "score": "0.5821163", "text": "function isMobile() {\n return screen.width < 1000;\n}", "title": "" }, { "docid": "f2d6d7829447edaf9f6783b4b37288d0", "score": "0.58048046", "text": "function retina(a){\n\n\tif( 'devicePixelRatio' in window && window.devicePixelRatio == 2 ){\n\n\t\tvar imgToReplace = $(a+' img.replace-2x').get();\t\n\t for (var i=0,l=imgToReplace.length; i<l; i++) {\n \t\tvar src = imgToReplace[i].src;\n\t \tsrc = src.replace(/\\.(png|jpg|gif)+$/i, '@2x.$1');\n\t \timgToReplace[i].src = src;\n\t \t$(imgToReplace[i]).load(function(){\n\t\t\t\t$(this).addClass('loaded');\n\t\t\t});\t \t\n\t };\t \n\n\t var imgToReplaceM = $(a+' a.replace-2x').get();\n\t for (var i=0,l=imgToReplaceM.length; i<l; i++) {\n\t \tvar src = imgToReplaceM[i].href;\n\t \tsrc = src.replace(/\\.(png|jpg|gif)+$/i, '@2x.$1');\n\t \timgToReplaceM[i].href = src;\n\t \t$(imgToReplaceM[i]).addClass('loaded');\n\t };\n\n\t $('img').each(function(){\n\t\t\tvar item = $(this);\n\t \t\tvar retinaSrc = $(this).attr('data-retina-src');\n\n\t \t\tif(retinaSrc !== undefined) {\n\t\t\t\titem.attr('src', retinaSrc );\n\t\t\t}\n\t \t});\n\t \n\t}\n}", "title": "" }, { "docid": "88223d8bf260fab973ec7aa071b47e2a", "score": "0.5792311", "text": "function updateImagesToRetina() {\n if ( isRetina() ) {\n debug.log(\"User is on a retina device. Update certain images to use Retina version\");\n\n var retina_images = $(\"img.retina\");\n var retina_image_length = retina_images.length;\n debug.log(\"We have the following number of images to get the retina version for\", retina_image_length);\n\n if ( retina_image_length ) {\n var retina_file_format = \"@2x\";\n for(var i = 0; i < retina_image_length; i++) {\n var imageType = retina_images[i].src.substr(-4);\n var imageName = retina_images[i].src.substr(0, retina_images[i].src.length - 4);\n imageName += retina_file_format + imageType;\n\n // re-assign image\n retina_images[i].src = imageName;\n }\n }\n }\n}", "title": "" }, { "docid": "ced3bf7149381e288ee4d49d3efe389c", "score": "0.57833046", "text": "isLgMobileScreen() {\n if (window.innerWidth <= 992) return true;\n if (window.innerHeight < 600) return true;\n return false;\n }", "title": "" }, { "docid": "ea37b2b2a4b03b17e1b6e78b83c808a6", "score": "0.5760572", "text": "function aspectCheck(){\n let ratio = windowWidth/windowHeight\n // if(ratio <= 1.4677 && ratio >= 0.7626) {\n // isShort = true;\n // isMobile = false;\n // } else if (ratio < 0.7626) {\n // isMobile = true;\n // isShort = false;\n // } else {\n // isShort = false;\n // isMobile = false;\n // }\n if(ratio <= 0.7626) {\n isMobile = true;\n } else {\n isMobile = false;\n }\n}", "title": "" }, { "docid": "a8b50b5e871356762c0889bff803e604", "score": "0.5705541", "text": "function mqCheck(){\r\n if( !( $('html').hasClass('lt-ie9') ) ){\r\n switch(true){\r\n case ( mediaQuery <= 767 ):\r\n mq = 'xs';\r\n break;\r\n case ( 768 <= mediaQuery && mediaQuery <= 991 ):\r\n mq = 'sm';\r\n break;\r\n case ( 992 <= mediaQuery && mediaQuery <= 1199 ):\r\n mq = 'md';\r\n break;\r\n case ( 1200 <= mediaQuery && mediaQuery <= 1600 ):\r\n mq = 'lg';\r\n break;\r\n case ( mediaQuery >= 1601 ):\r\n mq = 'xl';\r\n break;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "99c9d3d818ca7e7e16b3e8e35da75e0a", "score": "0.5703341", "text": "function MediaQueryDispatch(){if(!window.matchMedia){throw new Error('matchMedia not present, legacy browsers require a polyfill');}this.queries={};this.browserIsIncapable=!window.matchMedia('only all').matches;}", "title": "" }, { "docid": "4a2f2c28727fdd8e787c006368325ae0", "score": "0.5701827", "text": "function isIphoneX() {\n const dimen = Dimensions.get('window');\n return (\n Platform.OS === 'ios' &&\n !Platform.isPad &&\n !Platform.isTVOS &&\n (dimen.height === 812 ||\n dimen.width === 812 ||\n dimen.height === 896 ||\n dimen.width === 896)\n );\n}", "title": "" }, { "docid": "91fbb163f7d03a66aef8b5029298848f", "score": "0.5699299", "text": "function checkWindowSize() { \n var width = $(window).width(), screen_size;\n if(width < 768) {\n screen_size = 'screen-xs'; \n }\n if(width > 769 && width < 992) {\n screen_size = 'screen-sm'; \n }\n if(width > 992 && width < 1200) {\n screen_size = 'screen-md'; \n }\n if (width > 1200 ) {\n screen_size = 'screen-lg'; \n }\n $(document.body).removeClass('screen-xs screen-sm screen-md screen-lg').addClass(screen_size);\n return screen_size;\n}", "title": "" }, { "docid": "ce03e216a7a1ff2b8de6f3809bdb816e", "score": "0.56933683", "text": "function updateMediaQuery () {\n windowWidth = $window.innerWidth;\n windowHeight = $window.innerHeight;\n mediaQuery = windowWidth >= 600 ? 'desktop' : 'phone';\n return mediaQuery;\n }", "title": "" }, { "docid": "d96f5db8c2c37e02565d12093b7afdff", "score": "0.5693267", "text": "function smallDisplay() {\r\n return window.innerWidth < 600;\r\n}", "title": "" }, { "docid": "189a05a263352bd6ecbb4a822f1ddef5", "score": "0.56523836", "text": "function testMobile() {\n\treturn Modernizr.touch;// || window.innerWidth < 600;//true;// Modernizr.touch || window.innerWidth < 600;\n}", "title": "" }, { "docid": "52cde0fdad7225879132a59d4ee98f62", "score": "0.5644171", "text": "function whatDevice() {\n if( $(window).width() > 1280 ) { return 'desktop'; }\n else if( $(window).width() > 760 ) { return 'tablet'; }\n else { return 'mobile'; }\n}", "title": "" }, { "docid": "1fb74c5cde9f92ad397ec92a53a8f3d5", "score": "0.56263053", "text": "function smDisplay(x) {\n if (smallScrn.matches) { // If media query matches\n alert('Please Increase Window To Full Screen For Best Vewing Experience');\n }\n}", "title": "" }, { "docid": "3b42d17e7ef6c9da7f522d3bd4744687", "score": "0.5576962", "text": "isScreenDevice() {\n if (this.getOriginalDetectIntentRequest() == \"google\") {\n return this.request.originalDetectIntentRequest.payload.surface.capabilities.find(a => a.name == 'actions.capability.SCREEN_OUTPUT') || false;\n }\n else {\n return false;\n }\n }", "title": "" }, { "docid": "acaecf78c9fbf9be6d2426d3e667e664", "score": "0.55594873", "text": "function requestDesktopSite(){\n if(document.getElementsByTagName('meta')['viewport'].content=='width= 1200px'){\n document.getElementsByTagName('meta')['viewport'].content='width= 400px';\n }else{\n document.getElementsByTagName('meta')['viewport'].content='width= 1200px';\n }\n}", "title": "" }, { "docid": "f3c4620c268f13cfc17720c4b8dc9a08", "score": "0.5514301", "text": "static isMobile() {\n return window.innerWidth < MOBILE_THRESHOLD;\n }", "title": "" }, { "docid": "24d30e5969c19e1b8fa21b9589ae4808", "score": "0.5498746", "text": "function checkScreen() {\n\n var w = window;\n\n return w.outerWidth == 0 && w.outerHeight == 0\n\n }", "title": "" }, { "docid": "eb0b40e1ffae0aac966ba1b3f9e09198", "score": "0.54955703", "text": "function detectDevice(){\n var width = doc.body.offsetWidth;\n if(width < 800){\n return 0;\n } else {\n return 1;\n }\n }", "title": "" }, { "docid": "d6f6fc949d6be41a53328d066087954b", "score": "0.54900014", "text": "function matchPageMedia() {\n\tif (window.matchMedia('(max-width: 420px)').matches) {\n\t\trenderLecturerAtMobile();\n\t\trenderScheduleAtMobile();\n\t}\n}", "title": "" }, { "docid": "6753bef2f306e0a4e4bf2a1f817074cc", "score": "0.5489042", "text": "function getpicsize( imgsize){\n var viewport = getWindowSize();\n if( viewport == 'xs' ) {\n return \"100px\"\n }\n else{\n return imgsize;\n }\n }", "title": "" }, { "docid": "d21357837e598880dcec30dcd105f840", "score": "0.5475662", "text": "function show_viewport()\n{\n\tvar viewport = document.querySelector(\"meta[name=viewport]\");\n\tvar viewportScale = screen.width / 520;\n\tvar device_name = (typeof device !== 'undefined') ? device.model + \" \" + device.version : \"None\";\n\tif (document.getElementById('footer'))\n\t{\n\n\t\tdocument.getElementById('footer').innerHTML += screen.width + \"x\" + screen.height + \n\t\t\" \" + window.innerWidth + \"x\" + window.innerHeight +\n\t\t\" \" + window.devicePixelRatio + \" \" + window.orientation + \" \" + navigator.userAgent + \" \" +\n\t\tdevice_name;\n\t\t/*\t\t\tscreen.width\twindow.innerWidth\twindow.devicePixelRatio\t\n\t\t\tKindle\t\t1200\t\t\t600\t\t\t\t\t2\n\t\t\tNexus 4\t\t480x800\t\t\t320x240\t\t\t\t1.5\n\t\t\tNexus 7\t\t800x1280\t\t602x889\t\t\t\t1.33\n\t\t\tNexus 10\t2560\t\t\t1280\t\t\t\t2\n\t\t\tHTC Evo\t\t720x1280\t\t360x640\t\t\t\t2\n\t\t\tiPhone 5\t320x568\t\t\t534x768\t\t\t\t2\t\n\t\t\tiPad-Mini\t768x1024\t\t980x1183\t\t\t1\t\n\t\t*/\n\t}\n\tdocument.fm.vp.value = viewport.getAttribute(\"content\");\n}", "title": "" }, { "docid": "a88fb129c99218f98fec1a0566d0585e", "score": "0.54746187", "text": "function detectProductName(t, width, height, gpu) {\r\n\r\n if(!t && !width && !height && !gpu) return false; //performance optimalisation\r\n\r\n var dpi = detectDPI(width, height);\r\n\r\n\r\n if(t === \"iPhone\") {\r\n if(height <= 480) return ['iPhone 2G', 'iPhone 3', 'iPhone 3GS'];\r\n\r\n if(width === 320 && height === 480 && gpu =='A4') return ['iPhone 4'];\r\n \r\n if(width === 320 && height === 480 && gpu == 'A5') return ['iPhone 4S'];\r\n if(width === 320 && height === 568 && gpu == 'A5') return ['iPhone 5'];\r\n \r\n if(width === 320 && height === 568 && gpu == 'A6') return ['iPhone 5C'];\r\n \r\n if(width === 320 && height === 568 && gpu == 'A7') return ['iPhone 5S'];\r\n \r\n if(width === 375 && height === 667 && gpu == 'A8') return ['iPhone 6'];\r\n if(width === 414 && height === 736 && gpu == 'A8') return ['iPhone 6+'];\r\n \r\n if(width === 375 && height === 667 && gpu == 'A9') return ['iPhone 6S'];\r\n if(width === 414 && height === 736 && gpu == 'A9') return ['iPhone 6S+'];\r\n if(width === 320 && height === 568 && gpu == 'A9') return ['iPhone SE'];\r\n \r\n if(width === 375 && height === 667 && gpu == 'A10') return ['iPhone 7'];\r\n if(width === 414 && height === 736 && gpu == 'A10') return ['iPhone 7+'];\r\n \r\n if(width === 375 && height === 667 && gpu == 'A11') return ['iPhone 8'];\r\n if(width === 414 && height === 736 && gpu == 'A11') return ['iPhone 8+'];\r\n if(width === 375 && height === 812 && gpu == 'A11') return ['iPhone X'];\r\n }\r\n\r\n else if(t === \"iPad\") {\r\n /* iPads */\r\n if(width === 768 && height === 1024 && gpu == 'A5') return ['iPad Mini', 'iPad 2'];\r\n \r\n if(width === 768 && height === 1024 && gpu == 'A7') return ['iPad Mini 2', 'iPad Mini 3', 'iPad Air'];\r\n \r\n if(width === 768 && height === 1024 && gpu == 'A8') return ['iPad Mini 4'];\r\n \r\n if(width === 768 && height === 1024 && gpu == 'A5X') return ['iPad 3'];\r\n \r\n if(width === 768 && height === 1024 && gpu == 'A6X') return ['iPad 4'];\r\n \r\n if(width === 768 && height === 1024 && gpu == 'A8X') return ['iPad Air 2'];\r\n \r\n if(width === 768 && height === 1024 && gpu == 'A9X') return ['9.7-inch iPad Pro'];\r\n \r\n if(width === 768 && height === 1024 && gpu == 'A10') return ['iPad 6 (Cellular)'];\r\n\r\n if(width === 834 && height === 1112 && gpu == 'A10X') return ['10.5-inch iPad Pro'];\r\n if(width === 1024 && height === 1366 && gpu == 'A10X') return ['12.9-inch iPad Pro'];\r\n \r\n } else {\r\n \r\n if(width === 272 && height === 340 && gpu == 'S1') return ['Watch 1 38mm'];\r\n if(width === 312 && height === 390 && gpu == 'S1') return ['Watch 1 42mm'];\r\n \r\n if(width === 272 && height === 340 && gpu == 'S1P') return ['Watch 1 sport 38mm'];\r\n if(width === 312 && height === 390 && gpu == 'S1P') return ['Watch 1 sport 42mm'];\r\n \r\n if(width === 272 && height === 340 && gpu == 'S2') return ['Watch 2 38mm'];\r\n if(width === 312 && height === 390 && gpu == 'S2') return ['Watch 2 42mm'];\r\n \r\n if(width === 272 && height === 340 && gpu == 'S3') return ['Watch 3 38mm'];\r\n if(width === 312 && height === 390 && gpu == 'S3') return ['Watch 3 42mm'];\r\n }\r\n \r\n return false;\r\n}", "title": "" }, { "docid": "95461bb6f9c88c19aa8260a53e6b798c", "score": "0.5463867", "text": "function mediaQueries(){\n\t\tif(currentSize != newSize){\n\t\t\tif((documentClientWidth >= 1000)){\n\t\t\t\tnewSize = 1;\n\t\t \tdevice = 980;\n\t\t \tupdateElements(980);\n\t\t } else\n\t\t if((documentClientWidth >= 768) & (documentClientWidth <= 1000)){\n\t\t \tnewSize = 2;\n\t\t \tdevice = 768;\n\t\t \tupdateElements(768);\n\t\t } else\n\t\t if((documentClientWidth >= 480) & (documentClientWidth <= 767)){\n\t\t \tnewSize = 3;\n\t\t \tdevice = 480;\n\t\t \tupdateElements(480);\n\t\t } else\n\t\t if(documentClientWidth < 479){\n\t\t \tnewSize = 4;\n\t\t \tdevice = 320;\n\t\t \tupdateElements(320);\n\t\t }\t\n\t\t currentSize = newSize; \n \t\t\t//console.log(currentSize+' '+newSize);\n\t }\n\t}", "title": "" }, { "docid": "a4fac09ec02b848dc3419e610ff09bc7", "score": "0.54598045", "text": "isNotMobile () {\n // eslint-disable-next-line no-undef\n const bootstrapDetectedSizeXs = $(\"#users-device-size\").find(\"div:visible\").first().attr(\"id\");\n return bootstrapDetectedSizeXs === undefined;\n }", "title": "" }, { "docid": "d7df2ce81016c4edab3348545d638a97", "score": "0.5451477", "text": "function biggestScreenWidthAvailable () {\n var width = document.documentElement.clientWidth;\n if (width >= 1000) {\n return 960;\n } else if (width >= 760) {\n return 720;\n } else if (width >= 540) {\n return 540;\n } else if (width >= 420){\n return 420;\n } else {\n return 300;\n }\n }", "title": "" }, { "docid": "dcad461a06c4e0236113135206a15375", "score": "0.5448382", "text": "function viewportSize() {\n var ventanaAncho = $(window).width();\n var ventanaAlto = $(window).height();\n\n var altoViewpor = ventanaAlto + 'px';\n var anchoViewpor = ventanaAncho + 'px';\n\n if (ventanaAncho <= 480) {\n //console.log('movil :', ventanaAncho);\n\n } else if (ventanaAncho > 480 && ventanaAncho <= 768) {\n //console.log('tabla :', ventanaAncho);\n\n } else if (ventanaAncho > 768) {\n //console.log('desktop :', ventanaAncho);\n }\n}", "title": "" }, { "docid": "05070a4ce9fe287f30800cd659a65c74", "score": "0.5439212", "text": "function optimizeForMobile() {\n if (window.innerWidth < constants.GAME_WIDTH) {\n stage.canvas.width = 320;\n }\n if (createjs.Touch.isSupported()) {\n createjs.Touch.enable(stage);\n }\n screenScale = stage.canvas.width / constants.GAME_WIDTH;\n stage.update();\n}", "title": "" }, { "docid": "4b422820f448689390d3abd05c5a9ea8", "score": "0.542767", "text": "function deviceType() {\r\n\tvar _windowWidth = window.innerWidth;\r\n\r\n\tif (_windowWidth >= 1024) {\r\n\t\t$('html').removeClass('mobile-version');\r\n\t\t$('html').addClass('desktop-version');\r\n\t} else {\r\n\t\t$('html').removeClass('desktop-version');\r\n\t\t$('html').addClass('mobile-version');\r\n\t}\r\n}", "title": "" }, { "docid": "24280761f1ab3aa6dd09bd4c34f17127", "score": "0.5427533", "text": "function wd(){return z(\"iPad\")||z(\"Android\")&&!z(\"Mobile\")||z(\"Silk\")}", "title": "" }, { "docid": "ea8815e9970303cb9adb74adb4b96396", "score": "0.5425484", "text": "function computeScreenAwareSize(cssPx) {\r\n var screenPx = window.devicePixelRatio * cssPx;\r\n return Math.max(1, Math.floor(screenPx)) / window.devicePixelRatio;\r\n}", "title": "" }, { "docid": "ea8815e9970303cb9adb74adb4b96396", "score": "0.5425484", "text": "function computeScreenAwareSize(cssPx) {\r\n var screenPx = window.devicePixelRatio * cssPx;\r\n return Math.max(1, Math.floor(screenPx)) / window.devicePixelRatio;\r\n}", "title": "" }, { "docid": "a8a499fe96cc0de25269bb9a02444175", "score": "0.5417406", "text": "function viewPort () {\r\n if($(window).width() < 768){\r\n // new man hinh nho hon 768 add viewport vao\r\n $(\"head\").append('<meta name=\"viewport\" content=\"width=580px\" />');\r\n }\r\n else{\r\n // new man hinh lon hon 768 add viewport vao\r\n $(\"head\").append('<meta name=\"viewport\" content=\"width=1024px\" />');\r\n };\r\n}", "title": "" }, { "docid": "a3c98edf1205150ec012c1bb2498ad3f", "score": "0.5409249", "text": "function checkHiPPI(canvas) {\n if (window.devicePixelRatio > 1) {\n const PIXEL_RATIO = 2\n canvas.style.width = `${canvas.width}px`\n canvas.style.height = `${canvas.height}px`\n\n canvas.width *= PIXEL_RATIO\n canvas.height *= PIXEL_RATIO\n\n const context = canvas.getContext('2d')\n context.scale(PIXEL_RATIO, PIXEL_RATIO)\n }\n}", "title": "" }, { "docid": "bd036ccc0f6e36bad938416b39cf2b62", "score": "0.539845", "text": "function checkIfMobile(){\n \t\twindow.mobile = window.innerWidth < 450 ? true : false;\n \t}", "title": "" }, { "docid": "f83f18c58dca1306034caaa950ffcb7e", "score": "0.5388529", "text": "function pageCalculations(){\n\t\twinW = $(window).width();\n\t\twinH = $(window).height();\n\t\tif($('.mob-icon').is(':visible')) {\n\t\t\t_isresponsive = true;\n\t\t}\n\t\telse {\n\t\t\t_isresponsive = false;\n\t\t}\n\t}", "title": "" }, { "docid": "b1eb08100baf8a263d7c03612a6cd698", "score": "0.53836924", "text": "function computeScreenAwareSize(cssPx) {\n var screenPx = window.devicePixelRatio * cssPx;\n return Math.max(1, Math.floor(screenPx)) / window.devicePixelRatio;\n}", "title": "" }, { "docid": "8470e23e7d4281ae42759910de5e44f8", "score": "0.5374525", "text": "function getPixelRatio() {\n var ratio = window.devicePixelRatio || 1;\n return ratio;\n}", "title": "" }, { "docid": "29d6f713a5645d5a0a1804fbc921152b", "score": "0.53697884", "text": "devicePixelRatio() {\n return this.native.devicePixelRatio();\n }", "title": "" }, { "docid": "b9e8159c3510335d85c80d5b30b52c2e", "score": "0.5363139", "text": "function detectBrowser() {\n var useragent = navigator.userAgent;\n var mapdiv = document.getElementById(\"map-canvas\");\n\n if (useragent.indexOf('iPhone') != -1 || useragent.indexOf('Android') != -1) {\n mapdiv.style.width = '100%';\n mapdiv.style.height = '100%';\n } else {\n mapdiv.style.width = '600px';\n mapdiv.style.height = '800px';\n }\n}", "title": "" }, { "docid": "4095ec4f10bb5c867f011a3448974811", "score": "0.5356824", "text": "function isResponsiveMode(){\n\n return hasClass($body, RESPONSIVE);\n\n }", "title": "" }, { "docid": "96528f9cd4073de30a0d033e4b605b33", "score": "0.5348418", "text": "function calcWidth(){\n return window.innerWidth >= 1350 ? 1280 : 896\n}", "title": "" }, { "docid": "67d7594e31311a191181847d9014668b", "score": "0.534277", "text": "function checkWindowWidth () {\n return (window.innerWidth <= tabletWidth) ? true : false;\n }", "title": "" }, { "docid": "52ee1f74f24a85c51c7a5729fa8592fa", "score": "0.5342018", "text": "getScreenScale() {\n return window.innerWidth / window.outerWidth;\n }", "title": "" }, { "docid": "ea4963664ebbf37f349ad86f431683f8", "score": "0.53399795", "text": "function DetectaWindowsMobile(){\n\n if (uagent.search(dispositivoWinMob) > -1)\n\n return true;\n\n else\n\n return false;\n\n}", "title": "" }, { "docid": "b1c1f1c36ae5cbca4858f7bf4d0497c0", "score": "0.53357214", "text": "function detectScreenChange(){\n\tlet initScreen = $(window).width() > 1024 ? 'large' : 'small';\n\tlet oldScreen = \"\";\n\n\treturn !function(){\n\t\t$(window).on('resize',function(){\n\t\t\tlet screenChange = false;\n\t\t\tlet newScreen = $(window).width() > 1024 ? 'large' : 'small';\n\t\t\tif(oldScreen === \"\") oldScreen = newScreen;\n\t\t\tif(oldScreen !== newScreen) screenChange = true;\n\t\t\tif(screenChange){\n\t\t\t\tnewScreen === 'large' ? $('nav.nav-desktop').addClass('show').removeClass('hide') : $('nav.nav-desktop').addClass('hide').removeClass('show');\n\t\t\t\toldScreen = newScreen;\n\t\t\t}\n\t\t}); \n\t}();\n}", "title": "" }, { "docid": "133db2dfc3dd05ca3012fb84984f07a2", "score": "0.5324764", "text": "isMobile() {\n if (navigator.userAgent.match(/Android/i) ||\n navigator.userAgent.match(/webOS/i) ||\n navigator.userAgent.match(/iPhone/i) ||\n navigator.userAgent.match(/iPad/i) ||\n navigator.userAgent.match(/iPod/i) ||\n navigator.userAgent.match(/BlackBerry/i) ||\n navigator.userAgent.match(/Windows Phone/i))\n\n return true;\n }", "title": "" }, { "docid": "36d9aa20c9b7b3872868699bd6a39f0d", "score": "0.53240466", "text": "function isMobile(){\n if ($(window).width() <= 991) {\n return true;\n }\n else {\n return false;\n }\n}", "title": "" }, { "docid": "ff15bb8b9218331fe1d1d216f1d349f4", "score": "0.5322083", "text": "function checkIpadDevice(){ \n if (navigator && navigator.userAgent && navigator.userAgent != null) \n { \n var strUserAgent = navigator.userAgent.toLowerCase();\n var arrMatches = strUserAgent.match(/(iphone|ipod|ipad)/);\n if (arrMatches != null){ \n $('.content_item_hover').removeClass('content_item_hover'); \n }\n }\n}", "title": "" }, { "docid": "51c77792111a7cf576b7e9cc52999c98", "score": "0.5318179", "text": "function onWindowResize() {\n var width = window.innerWidth;\n\n if (isLargeScreen(width)) {\n onLargeScreen();\n currentScreenSize = 1200;\n }\n else if (isMediumScreen(width)) {\n onMediumScreen();\n currentScreenSize = 992;\n }\n else if (isSmallScreen(width)) {\n onSmallScreen();\n currentScreenSize = 768;\n }\n else if (isExtraSmallScreen(width)) {\n onExtraSmallScreen();\n currentScreenSize = 576;\n }\n}", "title": "" }, { "docid": "501d7ebae0e09da566f395e41e7d44fe", "score": "0.53167385", "text": "function checkMobile() {\n var is_mobile = ((/Mobile|iPhone|iPod|BlackBerry|Windows Phone/i).test(navigator.userAgent || navigator.vendor || window.opera) ? true : false),\n is_small = ($(window).innerWidth() < 705 ? true : false );\n\n if (!is_mobile && !is_small) {\n $('html').removeClass('is-mobile');\n $('.mp-scroller, .highlight').perfectScrollbar();\n } else {\n $('html').addClass('is-mobile');\n }\n }", "title": "" }, { "docid": "22752a0accf67be4a148fb77136708cc", "score": "0.5296914", "text": "function setMobileImgSize(){\n if ( $(window).width() < 739) {\n $(\".prodMaisVendido\").height(90);\n }\n}", "title": "" }, { "docid": "ecf5ea811d75baa410815f4db05bbd46", "score": "0.5287029", "text": "isMobile() {\n \treturn AFRAME.utils.device.isMobile();\n }", "title": "" }, { "docid": "5ed26181e67e12f96d9435c699d8652b", "score": "0.52865314", "text": "function checkIfScreenIsUnder900px(screenSize) {\n if (screenSize.matches) {\n search.addEventListener('click', function () {\n logo.classList.add('hidden');\n });\n } else {\n logo.classList.remove('hidden');\n search.addEventListener('click', function () {\n logo.classList.remove('hidden');\n });\n }\n}", "title": "" }, { "docid": "8ef1bc3e3275e63478dfdb86869a3946", "score": "0.528576", "text": "function detectBrowser() {\n var useragent = navigator.userAgent;\n var mapdiv = document.getElementById(\"map\");\n\n if (useragent.indexOf('iPhone') != -1 || useragent.indexOf('Android') != -1 ) {\n mapdiv.style.width = '100%';\n mapdiv.style.height = '100%';\n } else {\n mapdiv.style.width = '600px';\n mapdiv.style.height = '800px';\n }\n}", "title": "" }, { "docid": "2e1a958db9334b829f6077af4b92e89f", "score": "0.52836907", "text": "function initScreenSize()\n{\n\treturn false;\n\t\n\tvar winW = $(window).width();\n\tvar winH = $(window).height();\n\n\tvar optimRatio = 4/3;\n\tvar currRatio = winW/winH;\n\tvar difRatio = (optimRatio - currRatio).toFixed(3);\n\tvar msg = winW+'x'+winH+' : '+difRatio;\n\tif(difRatio < 0.1 && difRatio > -0.1){\n\t\tmsg += ' <- Optimum Ratio';\n\t}\n\t$('body').append('<div id=\"resolution-debug\"></div>');\n\t$('#resolution-debug').css({\n\t\t'position':'fixed',\n\t\t'z-index':'9999',\n\t\t'background-color':'#272822',\n\t\t'top':'40px',\n\t\t'left':'10px',\n\t\t'padding':'10px',\n\t\t'opacity':'0.5',\n\t\t'font-size':'12px',\n\t\t'cursor':'pointer',\n\t\t'color':'#fff'\n\t});\n\t$('#resolution-debug').hover(function(){\n\t\t\t$(this).stop().animate({opacity:1},300);\n\t\t},function(){\n\t\t\t$(this).stop().animate({opacity:0.5},300);\n\t\t})\n\t$('#resolution-debug').click(function(){\n\t\t$(this).remove();\n\t})\n\t$('#resolution-debug').html(msg);\n}", "title": "" }, { "docid": "7aea200dcb4db592acc0b03ae41f93ba", "score": "0.52752", "text": "static isMobile() {\n return 'ontouchstart' in document.documentElement;\n }", "title": "" }, { "docid": "fffb4c24ab0011cf6c341d7f26262775", "score": "0.5273669", "text": "function isMobile() {\n\treturn (( /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ) || ($(window).width() <= 480));\n}", "title": "" }, { "docid": "e76c140e5fb614a9ef99b6973525fa48", "score": "0.5265409", "text": "function isMobileDevice(){try{return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);}catch(e){return false;}}// ==============================", "title": "" }, { "docid": "5545411968a4e5d2d8aac10b6b5801b0", "score": "0.52623516", "text": "function isSuitableMedia(x) {\n return SUITABLE_MEDIA_QUERIES.test(x);\n}", "title": "" }, { "docid": "aa334eca1bbf7c8bddbc4060ad8dca36", "score": "0.5255659", "text": "onMediaQueryChange() {}", "title": "" }, { "docid": "26ce9b1b72310b24e80a0ffb9598c564", "score": "0.52544075", "text": "function setupScreenDetection() {\n var sd = new ScreenDetection();\n sd.watchZoom(function(obj) {\n var oldZoomValue = lsScreen.get('browserZoom');\n lsScreen.set('browserZoom', obj.zoom);\n var z = Math.round(obj.zoom*100);\n if (obj.init) {\n _gaq.push(['_trackEvent', 'Zoom', 'Init', z]);\n } else {\n _gaq.push(['_trackEvent', 'Zoom', 'Change', z]);\n }\n if (oldZoomValue != obj.zoom) {\n // zoom value has changed\n LsLog.info('browser zoom changed from ' + oldZoomValue + ' to ' + obj.zoom);\n }\n });\n if (sd.canDetectZoom) {\n lsScreen.set('browserZoom', sd.zoom);\n } else {\n _gaq.push(['_trackEvent', 'Zoom', 'CannotDetect']);\n }\n // watch for screen changes\n var screenRes = lsScreen.get('res');\n sd.watchScreenRes(function(width, height, onInit) {\n if (onInit && screenRes[0] == width && screenRes[1] == height) {\n // screen resolution assumption is correct.\n if (!lsScreen.get('cal')) {\n // screen isn't calibrated, kick off calibration (after 1 sec delay)\n window.setTimeout(function() {\n lifeSizeViewer.trigger('startCalibration');\n }, 1000);\n }\n } else {\n // screen resolution is different from expected (or previous) resolution!\n if (onInit) {\n _gaq.push(['_trackEvent', 'Screen', 'ResolutionChangeOnInit']);\n } else {\n _gaq.push(['_trackEvent', 'Screen', 'ResolutionChange']);\n }\n LsLog.info(\"new resolution = \" + width + \"x\" + height + \", onInit = \" + onInit);\n lsScreen.set('res', [width, height]);\n // fetch new screen data\n $.post('/view/screenres', {w: width, h: height}, function(data) {\n LsLog.debug(\"response from screenres:\", data);\n //console.log('received response:');\n //console.dir(data);\n if (data.status == 'ok') {\n // update the LsScreen object\n lsScreen.set(data.screen);\n lsScreen.set('matches', data.screenMatches);\n lifeSizeViewer.trigger('screenChanged');\n if (!lsScreen.get('cal')) {\n // this screen isn't calibrated, so kick off calibration\n lifeSizeViewer.trigger('startCalibration');\n }\n }\n });\n }\n });\n}", "title": "" }, { "docid": "55337ebf9f9fe2d1dbfa29eb1ee38a49", "score": "0.5243484", "text": "function specific_render() {\n\tif(width >= versions.tablet){\n\t\tsizes[0] = 'Tablet';\n\t}\n\tif(width >= versions.desktop){\n\t\tsizes[0] = 'Desktop';\n\t}\n\tif(width >= versions.bigscreen){\n\t\tsizes[0] = 'Bigscreen';\n\t}\n\tif(width >= versions.hdtv){\n\t\tsizes[0] = 'Hdtv';\n\t}\n\trenderFor(sizes);\n}", "title": "" }, { "docid": "4e3fec7b92ceee2f30617b8090d6fa33", "score": "0.5241558", "text": "function isMobile(){\r\n return ($(window).width() < settings.switchWidth);\r\n }", "title": "" }, { "docid": "90990c5d155a0e41d34f0d2f246d88dd", "score": "0.52413994", "text": "isMobileMode(width) {\n let windowWidth = width;\n if (isNaN(windowWidth)) {\n this.errorMsg = \"Browser window width is not a number\";\n this.errorHandler(this.errorMsg);\n /* As window width is not available, length 2 is set as default */\n return false;\n }\n\n if (windowWidth < 768) {\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "b017b4eab31d9d1536a4c032cfd4d3ad", "score": "0.52405477", "text": "function isMobile() {\n return ( window.matchMedia(`(max-width: 767px)`).matches );\n}", "title": "" }, { "docid": "328187aaeac36f130341edb84c20a30d", "score": "0.52366465", "text": "function mobileCheck() {\r\n\t\t\t\tvar md = new MobileDetect(window.navigator.userAgent);\r\n\t\t\t\tvar dv;\r\n\t\t\t\tif (md.phone() != null) {\r\n\t\t\t\t\tdv = \"phone\";\r\n\t\t\t\t} else if (md.tablet() != null) {\r\n\t\t\t\t\tdv = \"tablet\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tdv = \"pc\";\r\n\t\t\t\t}\r\n\t\t\t\treturn dv;\r\n\t\t\t}", "title": "" }, { "docid": "f380604184031d622aa4aeffd6a60670", "score": "0.52336025", "text": "function checkDevice (){\n if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "46b2368fdf46d65273d3f4476710ac2d", "score": "0.5228336", "text": "static get hardwareSupportsRectRenderTexture() {}", "title": "" }, { "docid": "35ecce22deeb969abe60171aeed2bb42", "score": "0.5227732", "text": "function isMobile(){\n return ($(window).width() < settings.switchWidth);\n }", "title": "" }, { "docid": "b6ed9e00861c870c0f5e5ee7560b9e10", "score": "0.52265894", "text": "function DetectaIpad(){\n\n if (uagent.search(dispositivoIpad) > -1 && DetectaWebkit())\n\n return true;\n\n else\n\n return false;\n\n}", "title": "" }, { "docid": "7e4e491f74878bbfbeff193e9f179710", "score": "0.52229154", "text": "function detectDPI(w, h) {\r\n var dppx = window.devicePixelRatio || (window.matchMedia && window.matchMedia(\"(min-resolution: 2dppx), (-webkit-min-device-pixel-ratio: 1.5),(-moz-min-device-pixel-ratio: 1.5),(min-device-pixel-ratio: 1.5)\").matches? 2 : 1) || 1;\r\n w = w * dppx;\r\n h = h * dppx;\r\n w > 0 || (w = 1);\r\n h > 0 || (h = 1);\r\n var dpi = Math.sqrt(w * w + h * h);\r\n return dpi > 0 ? Math.round(dpi) : 0;\r\n}", "title": "" }, { "docid": "1ab8ac11f152401fd170c4c70ad9b425", "score": "0.5221456", "text": "function detectScreen() {\n\n var screenWidth = $(window).width();\n \n return screenWidth;\n\n}", "title": "" } ]
40a21f84ac91bbf70f7f85b04ed9aba4
const showSidebar = () => setSidebar(!sidebar)
[ { "docid": "bc7e9ed8d121754be34223483ac021d3", "score": "0.0", "text": "function stayColor(index){\n console.log(estado)\n setEstado(index)\n }", "title": "" } ]
[ { "docid": "dde6939c872211c629bad10366c888fb", "score": "0.8530594", "text": "setSideBar() {\n this.setState({ sidebar : !this.state.sidebar });\n }", "title": "" }, { "docid": "3dadca4d7cf2b0d12e0ae24a2dc45a79", "score": "0.7873818", "text": "handleSidebarToggle() {\n let sidebar = document.getElementById(\"sidebar\");\n sidebar.classList.toggle(\"show\");\n }", "title": "" }, { "docid": "182f81a5ece6994876788aa053e19b5e", "score": "0.7655638", "text": "sidebarToggle() {\n this.setState(state => ({isNavClosed: !state.isNavClosed}));\n }", "title": "" }, { "docid": "c600cf09d013213d32dd38c7e106d4fc", "score": "0.75998384", "text": "function toggleSidebar() {\n console.log('toggle sidebar');\n if (document.getElementById('main').style==null || document.getElementById('main').style.display != \"none\") {\n showSidebar();\n } else {\n hideSidebar();\n }\n}", "title": "" }, { "docid": "0dca57c74b7d748cb0979f16b94f72b9", "score": "0.74517524", "text": "function toggleSidebar() {\n \n r = sidebar.style.width == '0px'?sidebar.style.width = '':sidebar.style.width = '0px';\n \n \n} //hides and shows sidebar", "title": "" }, { "docid": "860b04e5707e949e82b0d60196938e93", "score": "0.7447307", "text": "toggleSidebar() {\n document.getElementById(\"wrapper\").classList.toggle(\"toggled\");\n }", "title": "" }, { "docid": "860b04e5707e949e82b0d60196938e93", "score": "0.7447307", "text": "toggleSidebar() {\n document.getElementById(\"wrapper\").classList.toggle(\"toggled\");\n }", "title": "" }, { "docid": "a5131664cbc81272509df3d0d396d66d", "score": "0.74343526", "text": "toggleBigSidebar() {\n const { minimizeSidebar } = this.state;\n ipcRenderer.send('toggle-sidebar', !minimizeSidebar);\n this.setState({\n minimizeSidebar: !minimizeSidebar,\n });\n }", "title": "" }, { "docid": "5aeb24a9c2d7b92c68277fb525d01a5d", "score": "0.7403331", "text": "toggleSidebar() {\n let sidebar = $('.ui.sidebar.main.menu');\n sidebar.sidebar('toggle');\n\n if ($('.inverted.vertical.main.menu').hasClass('visible')) {\n $('.sidebar.icon.text-menu-show').removeClass('hidden');\n $('.sidebar.icon.text-menu-hide').addClass('hidden');\n $('.bgw-opacity').addClass('hidden');\n $('.full.height').css({ transition: 'width 0.45s ease-in-out 0s', width: '100%' });\n } else {\n $('.sidebar.icon.text-menu-show').addClass('hidden');\n $('.sidebar.icon.text-menu-hide').removeClass('hidden');\n $('.bgw-opacity').removeClass('hidden');\n $('.full.height').css({ transition: 'width 0.3s ease-in-out 0s', width: 'calc(100% - ' + sidebar.width() + 'px)' });\n }\n }", "title": "" }, { "docid": "e518b996e09b67cd22f3cf670f762f3f", "score": "0.7348616", "text": "handleClick2() {\n this.setState({ sidebarAdd: false });\n }", "title": "" }, { "docid": "2b673ea08cc3ef60b123ac64b5667d9d", "score": "0.73069763", "text": "function SidebarWrapper() {\n return <Sidebar />;\n}", "title": "" }, { "docid": "f2ce5f540c25f771d81e4ddd650ce652", "score": "0.7292874", "text": "function toggleSidebar() {\n let sidebarCList = document.getElementById(\"sidebar\").classList;\n sidebarOpen ? sidebarCList.add(\"closed\") : sidebarCList.remove(\"closed\");\n\n let mapCList = document.getElementById(\"map\").classList;\n sidebarOpen ? mapCList.add(\"closed\") : mapCList.remove(\"closed\");\n\n sidebarOpen = !sidebarOpen;\n\n // Add interval to repeatedly adjust map view while sidebar is toggled\n const readjustMap = setInterval(() => {\n map.invalidateSize()\n }, 5);\n\n // Remove interval of readjusting map once transition is over\n setTimeout(() => {\n clearInterval(readjustMap)\n }, 500);\n}", "title": "" }, { "docid": "7580d2346d51627784778363b4e849f0", "score": "0.72642154", "text": "sidebar(state, payload) {\n if (helpers.getWindowWidth() > 991) {\n if (payload.mode === 'open') {\n state.settings.sidebarVisibleDesktop = true\n } else if (payload.mode === 'close') {\n state.settings.sidebarVisibleDesktop = false\n } else if (payload.mode === 'toggle') {\n state.settings.sidebarVisibleDesktop = !state.settings.sidebarVisibleDesktop\n }\n } else {\n if (payload.mode === 'open') {\n state.settings.sidebarVisibleMobile = true\n } else if (payload.mode === 'close') {\n state.settings.sidebarVisibleMobile = false\n } else if (payload.mode === 'toggle') {\n state.settings.sidebarVisibleMobile = !state.settings.sidebarVisibleMobile\n }\n }\n }", "title": "" }, { "docid": "6e4226a3f2fdcec9299fc55c41636018", "score": "0.72009957", "text": "IS_SIDEBAR_ACTIVE(state, value) {\n state.isSidebarActive = value;\n }", "title": "" }, { "docid": "242a4522fbcb986e32087892af6769d9", "score": "0.7188984", "text": "toggleClick() {\n this.setState({\"sidebarOpen\": !this.state.sidebarOpen});\n console.log(\"clicked it!\");\n }", "title": "" }, { "docid": "687a6786e66146056ecf9f8d5a6195a6", "score": "0.7176056", "text": "function toggle_sidebar() {\r\n // Target Needed Elements\r\n var sidebar = document.querySelector('aside.sidebar');\r\n\r\n // If The Side Bar is Defined\r\n if (sidebar != undefined) {\r\n sidebar.classList.toggle('show')\r\n }\r\n}", "title": "" }, { "docid": "fd4a03fd88c0117f2e2fee15b9a7892b", "score": "0.7152703", "text": "function showSidebar() {\n console.log('show sidebar');\n //Show the sidebar\n var side=document.getElementById('side');\n console.log(side);\n if (side!=null) {\n console.log('sidebar found. show');\n side.setAttribute('style',\"display:float;\");\n }\n var main = document.getElementById('main');\n console.log(main);\n if (main!=null) {\n console.log('mainbar found. hide');\n main.setAttribute('style',\"display:none;\");\n }\n disableAllText();\n}", "title": "" }, { "docid": "86db3f41102731e3ebc18441279cb528", "score": "0.71520287", "text": "function toggleSidebar() {\r\n document.getElementById(\"sidebar\").classList.toggle('active');\r\n}", "title": "" }, { "docid": "86a4b9e838ee4889da94b031383704c9", "score": "0.7148656", "text": "function toggleSidebar()\n{\nsidebar.classList.toggle('active');\nconsole.log(\"sidebar toggled\");\n}", "title": "" }, { "docid": "20531f9828ea1055369985cb0933bcc1", "score": "0.7146787", "text": "function sidebarOpen() {\n\n if (x === true) {\n document.getElementById(\"sidebar_hide\").style.display = \"block\";\n document.getElementById(\"hamburger-menu__hiden\").style.display = \"none\";\n } else {\n document.getElementById(\"sidebar_hide\").style.display = \"block\";\n document.getElementById(\"hamburger-menu__hiden\").style.display = \"none\";\n }\n}", "title": "" }, { "docid": "3f788b6e89f77c80ff087f61e929f013", "score": "0.71224844", "text": "function sidebarHide() {\n if (x === true) {\n document.getElementById(\"sidebar_hide\").style.display = \"none\";\n document.getElementById(\"hamburger-menu__hiden\").style.display = \"block\";\n } else {\n document.getElementById(\"sidebar_hide\").style.display = \"none\";\n document.getElementById(\"hamburger-menu__hiden\").style.display = \"block\";\n }\n}", "title": "" }, { "docid": "23208bfe6ec2ae68e08a87eeb5ca84de", "score": "0.711918", "text": "function toggleSidebar() {\n\t$('.b-sidebar').toggleClass('b-sidebar--active');\n\t$('.b-blank').toggleClass('b-blank--active');\n}", "title": "" }, { "docid": "20eed741e474850203bc6972a64d4dc7", "score": "0.7101832", "text": "toggleShowSideMenu (state) {\n state.showSideMenu = !state.showSideMenu;\n }", "title": "" }, { "docid": "c6abcb7e532d385acf70ccd29c6382ac", "score": "0.70995307", "text": "function showSidebar() {\n let show = document.getElementById(\"sidebar\"); \n show.classList.add(\"sidebar-show\"); \n}", "title": "" }, { "docid": "c2fbc6cb93ed802936b16d8d43d21e6e", "score": "0.70932585", "text": "function toggleSidebarOnly() {\n const $elemsInSidebarNotNav = $sidebar.children('*:not(.main-nav)');\n\n if (!$sidebar.hasClass('closed')) {\n $('.main-subnav.collapse.show').collapse('hide');\n }\n\n $sidebar.toggleClass('closed');\n $elemsInSidebarNotNav.toggleClass('hidden');\n $('.main-nav .title .name').toggleClass('no-opacity');\n }", "title": "" }, { "docid": "f134878adc3e9abfefb6008207454afa", "score": "0.7082635", "text": "function isSidebarOpen(){\n let key = \"_sidebarOpen\"\n return store.get(key) || false\n }", "title": "" }, { "docid": "eb51e3357a4e520ce1ee21bc284f279b", "score": "0.7035728", "text": "function toggleSidebar() {\n\t\t$('.sidebar').toggleClass('closed');\n\t\t$('.gallery').toggleClass('full');\n\t\t$('.toggleSide').toggleClass('toggleSideOut');\n\t}", "title": "" }, { "docid": "e5750a77c07737b77a203dc85d847435", "score": "0.7030089", "text": "function showSidebar() {\n $('body').removeClass('sidebar-hidden');\n $.cookie('sidebar-pref', null, {\n expires: 30\n });\n }", "title": "" }, { "docid": "8f0752160420df82f8857cef9cd7f74e", "score": "0.70082873", "text": "function toggleSidebar() {\n if (sidebarToggle) {\n sidebarToggle.classList.toggle(\"active\");\n }\n if (navbarThumb) {\n navbarThumb.classList.toggle(\"open\");\n }\n }", "title": "" }, { "docid": "b2f62bf33846df3e377a004a398fac54", "score": "0.69977635", "text": "function openSidebar() {\n // Toggle the class name on the element\n sideBar.classList.toggle(\"open\");\n openBtn.classList.toggle(\"open\");\n}", "title": "" }, { "docid": "2fcf840485843629141dceb2ddff33a4", "score": "0.69914424", "text": "function SidebarToggle() {\n var SidebarMenu = document.getElementById(\"LeftSidebar\");\n if (SidebarMenu.style.display === \"none\" || SidebarMenu.style.display === \"\") {\n SidebarMenu.style.display = \"block\";\n\n } else {\n SidebarMenu.style.display = \"none\";\n }\n }", "title": "" }, { "docid": "6149781d9dc643a003a513cabd59147c", "score": "0.697421", "text": "function toggle() {\n Common.toggleClass(document.getElementById(ids.sidebar), 'is-active');\n }", "title": "" }, { "docid": "4c26d3787a9f686e824c659a2637fb38", "score": "0.69519705", "text": "handleClick() {\n this.setState({ sidebarAdd: true });\n }", "title": "" }, { "docid": "2a14836d47e73d2afbb096053891003e", "score": "0.6926565", "text": "toggleSideMenu () {\n this.setState({\n isOpen: !this.state.isOpen\n })\n }", "title": "" }, { "docid": "bf689e3494f4a2544967b97da3751c8f", "score": "0.69133955", "text": "function toggleSideBar(ref) {\n ref.classList.toggle('active');\n document.getElementById('sidebar').classList.toggle('active');\n \n}", "title": "" }, { "docid": "373d98c44cb80bfe731ee03b6da342bf", "score": "0.6906993", "text": "function toggleSideBar() {\n\n document.body.classList.contains('closed') ? document.body.classList.remove('closed') : document.body.classList.add('closed') \n}", "title": "" }, { "docid": "d8ab8cfae76e11473d5a1a289946c0d7", "score": "0.68889004", "text": "function toggleSidebar() {\n\n $sb.classed(showClass, !$sb.classed(showClass));\n if (isSidebarOpen === false) {\n setSidebarContentHeight();\n $menubutton.classed('active', true);\n isSidebarOpen = true;\n setTimeout(function () {\n\n $sbSearchfield.node().focus();\n }, 300);\n } else {\n $menubutton.classed('active', false);\n isSidebarOpen = false;\n closeSettings();\n $sbSearchfield.node().blur();\n }\n }", "title": "" }, { "docid": "e9bef49dd91bf6835d3311b11bfa5c69", "score": "0.688086", "text": "handleHideSideMenu(){\n this.setState({isSideMenuShown : false})\n }", "title": "" }, { "docid": "2a8404d92296cc2d75c00bc243f0c4ab", "score": "0.68739873", "text": "function toggleSidebar(_state, animation) {\n if (gitbook.state != null && isOpen() == _state) return;\n if (animation == null) animation = true;\n\n gitbook.state.$book.toggleClass(\"without-animation\", !animation);\n gitbook.state.$book.toggleClass(\"with-summary\", _state);\n\n gitbook.storage.set(\"sidebar\", isOpen());\n}", "title": "" }, { "docid": "d0356279b0e089f6c51699bd36d37405", "score": "0.6873814", "text": "function toggleSidebar(){\r\n $(\"#side-menu\").toggleClass('side-menu-hidden side-menu-visible');\r\n if(checkSideNavigationVisibility(\"#side-menu\", \"side-menu-visible\")){\r\n $(\"header\").append(\"<div class='sidebar-overlay' onclick='toggleSidebar()'></div>\");\r\n $(\"body\").addClass(\"sidebar-overlay\");\r\n }\r\n else{\r\n $(\"body\").removeClass(\"sidebar-overlay\");\r\n $(\".sidebar-overlay\").remove();\r\n }\r\n}", "title": "" }, { "docid": "7e56a46f0846df6b13e6a3e034f8cfeb", "score": "0.6873042", "text": "function myFunction() {\n\tvar x = document.getElementById(\"sidebar\");\n\tif (x.style.display === \"none\") {\n\t\tx.style.display = \"block\";\n\t} else {\n\t\tx.style.display = \"none\";\n\t}\n}", "title": "" }, { "docid": "1e0143f36614a45d4ba7ad69e6ac5216", "score": "0.6869089", "text": "function toggleSidebar () {\n const sidebar = document.getElementById('sidebar-section')\n if (sidebar == null) {\n return\n }\n if (sidebar.classList.contains('hide')) {\n sidebar.classList.remove('hide')\n } else {\n // if toc-section is open, then close it first\n const toc = document.getElementById('toc-section')\n if (toc != null && toc.classList.contains('hide')) {\n toc.classList.remove('hide')\n }\n // add \"hide\" class\n sidebar.classList.add('hide')\n // if it is mobile device. then scroll to top.\n const { isMobile } = getDeviceState()\n if (isMobile && sidebar.classList.contains('hide')) {\n document.body.scrollTop = 0\n document.documentElement.scrollTop = 0\n if (document.getElementById('hero-area') != null) {\n document.getElementById('hero-area').classList.toggle('hide')\n }\n }\n }\n if (document.getElementById('content-section') != null) {\n document.getElementById('content-section').classList.toggle('hide')\n }\n}", "title": "" }, { "docid": "b9ccbbddccc35a3f459e0d1a5680cd2b", "score": "0.68469787", "text": "function showSidebar(c) {\n var sidebar = document.getElementById(\"js--sidebar\");\n sidebar.classList.toggle(\"slide-in\");\n}", "title": "" }, { "docid": "573e8db660198e5109c6f873fea70ef6", "score": "0.68297637", "text": "function openOrCloseSideBar() {\n if (isSidebarOpen == false) {\n openNav();\n changeIconToClose();\n } else {\n closeNav();\n changeIconToopen();\n }\n isSidebarOpen = !isSidebarOpen;\n}", "title": "" }, { "docid": "cbc087cb8be04efbbd740ff1db353e00", "score": "0.68018854", "text": "function toggleSideBar()\n{\n $('#sidebar,#sidebar-content').toggleClass('open');\n}", "title": "" }, { "docid": "8f15752e070fd33c07717340b742ad5a", "score": "0.6795193", "text": "setSidebarHoverState() {\n let hoverState = this.state.sidebarHover;\n this.setState({\n sidebarHover: !hoverState\n });\n }", "title": "" }, { "docid": "407cb2dc2d986d9f97c411534fce6703", "score": "0.67021465", "text": "function App() {\n const [navToggle, setNavToggle] = useState(false);\n const [btn, setBtn] = useState(true);\n \n \n return (\n <div className=\"App\">\n {/* <Suspense fallback={<div>Loading....</div>}> */}\n <BrowserRouter>\n <Sidebar \n navToggle={navToggle} \n btn={btn} \n setBtn={setBtn}\n setNavToggle={setNavToggle}\n />\n <div className=\"menu\">\n <IconButton className=\"btn\" onClick={() => {\n setNavToggle(!navToggle)\n setBtn(!btn)\n } }> \n {\n btn ? <MenuIcon /> : <CloseIcon/>\n }\n </IconButton>\n </div>\n <MainContentStyled className={`${navToggle ? 'nav-toggle' : '' }`}>\n <Switch>\n <Redirect exact from=\"/\" to=\"/home\"/>\n\n <Route path=\"/home\" exact>\n <Homepage/>\n </Route> \n <Route path=\"/about\" exact>\n <Aboutpage/>\n </Route>\n <Route path=\"/resume\" exact>\n <Resumepage/>\n </Route>\n <Route path=\"/portfolios\" exact>\n <Portfoliopage/>\n </Route>\n <Route path=\"/contact\" exact>\n <Contactpage/>\n </Route>\n </Switch>\n </MainContentStyled>\n </BrowserRouter>\n {/* </Suspense> */}\n </div>\n );\n}", "title": "" }, { "docid": "b071a7df4ec51daf5c23ff6b3252b949", "score": "0.669464", "text": "function HideFullSidebar() {\n $(\"#guide\").addClass(\"hide\");\n $(\"#contentContainer\").addClass(\"hide\");\n}", "title": "" }, { "docid": "3ed8de1ecb3a424873691d1b59b8435e", "score": "0.66904753", "text": "function openSidebar() {\n document.getElementById('sidebar').style.display = \"flex\";\n document.getElementById('sidebar').style.width = '50%';\n document.getElementById('sidebar').style.minWidth = '310px';\n document.getElementById('sidebar').style.maxWidth = '340px';\n document.getElementById('header').style.display = \"none\";\n document.getElementById('map').style.top = \"0px\";\n}", "title": "" }, { "docid": "9648016bd269bc6ac823ae03bba10cd5", "score": "0.66678375", "text": "function showSidebar() {\n var ui = HtmlService.createTemplateFromFile('Sidebar')\n .evaluate()\n .setTitle(SIDEBAR_TITLE)\n .setSandboxMode(HtmlService.SandboxMode.IFRAME);\n SpreadsheetApp.getUi().showSidebar(ui);\n PropertiesService.getScriptProperties().setProperty('selectedSheet', 'current-sheet'); // Set default value\n}", "title": "" }, { "docid": "fde0e8a65483003b5e44a7e88a3c77e4", "score": "0.66622597", "text": "function toggleSidebar() {\n let scrollPosition = $(document).scrollTop();\n\n // change to first paragraph header, eg here is #challenge\n let firstHeader = $(\"#context\").position().top;\n if (scrollPosition < firstHeader) {\n $(\"#sidebar-fixed-sidenav\").css(\"display\",\"none\");\n }\n else {\n let mql = window.matchMedia('(min-width: 1600px)').matches;\n if (mql) {\n $(\"#sidebar-fixed-sidenav\").css(\"display\",\"block\");\n }\n else {\n $(\"#sidebar-fixed-sidenav\").css(\"display\",\"none\");\n }\n }\n}", "title": "" }, { "docid": "f71fa76a26519d0e80aa949d2bfd71d6", "score": "0.6648464", "text": "function toggleSideBar() {\r\n if (!document.querySelector(\"#expand-button\").classList.contains(\"sidebar-opened\")) {\r\n\r\n document.querySelector(\"#sidebar\").classList.add(\"expand-sidebar\");\r\n document.querySelector(\"#sidebar\").classList.remove(\"hide-sidebar\");\r\n\r\n document.querySelector(\"#expand-button\").classList.add(\"rotate-arrow-back\");\r\n document.querySelector(\"#expand-button\").classList.remove(\"rotate-arrow\");\r\n document.querySelector(\"#expand-button\").classList.add(\"sidebar-opened\");\r\n } else {\r\n document.querySelector(\"#sidebar\").classList.remove(\"expand-sidebar\");\r\n document.querySelector(\"#sidebar\").classList.add(\"hide-sidebar\");\r\n \r\n document.querySelector(\"#expand-button\").classList.remove(\"rotate-arrow-back\");\r\n document.querySelector(\"#expand-button\").classList.add(\"rotate-arrow\");\r\n document.querySelector(\"#expand-button\").classList.remove(\"sidebar-opened\");\r\n }\r\n}", "title": "" }, { "docid": "60da7d1a2c8f33929c3819e63fff14a2", "score": "0.6643283", "text": "function toggleSideBar(){\n var button = $(\".be-toggle-left-sidebar\");\n\n button.on(\"click\", function(){\n if( wrapper.hasClass( config.collapsibleSidebarCollapsedClass ) ) {\n wrapper.removeClass( config.collapsibleSidebarCollapsedClass );\n $(\"li.open\", leftSidebar).removeClass(\"open\");\n $(\"li.active\", leftSidebar).parents(\".parent\").addClass(\"active open\");\n $(\".be-scroller\", leftSidebar).perfectScrollbar(\"destroy\");\n } else {\n wrapper.addClass( config.collapsibleSidebarCollapsedClass );\n $(\"li.active\", leftSidebar).parents(\".parent\").removeClass(\"open\");\n $(\"li.open\", leftSidebar).removeClass(\"open\");\n }\n });\n }", "title": "" }, { "docid": "62af55c41fd66b1b694ea6289186ae39", "score": "0.66287786", "text": "function SidebarService() {\n var sidebar = false;\n var isDarkNavbar = true;\n\n function openSidebar() {\n sidebar = true;\n }\n\n function closeSidebar() {\n sidebar = false;\n }\n\n function darkNavbar() {\n isDarkNavbar = true;\n }\n\n function brightNavbar() {\n isDarkNavbar = false;\n }\n\n return {\n open: openSidebar,\n close: closeSidebar,\n darkNavbar: darkNavbar,\n brightNavbar: brightNavbar,\n isOpened: function () {\n return sidebar;\n },\n isDarkNavbar: function () {\n return isDarkNavbar;\n }\n };\n}", "title": "" }, { "docid": "59e01500ef91815b5c74259c01dffcfe", "score": "0.66029525", "text": "function originalSideBar() {\r\n if (window.innerWidth > 1050) {\r\n document.querySelector(\"#sidebar\").classList.remove(\"expand-sidebar\");\r\n document.querySelector(\"#sidebar\").classList.remove(\"hide-sidebar\");\r\n\r\n document.querySelector(\"#expand-button\").classList.remove(\"rotate-arrow\");\r\n document.querySelector(\"#expand-button\").classList.remove(\"rotate-arrow-back\");\r\n document.querySelector(\"#expand-button\").classList.remove(\"sidebar-opened\");\r\n }\r\n}", "title": "" }, { "docid": "60b3d051d4d48ede34e688d1d6a76eb3", "score": "0.6598025", "text": "function Navbars() {\n const [sidebar, setSidebar] = useState(false);\n const [icons, setIcons] = useState(true);\n const showSidebar = () => setSidebar(!sidebar);\n return (\n <>\n <div className=\"preloader\">\n <div className=\"lds-ripple\">\n <div className=\"lds-pos\"></div>\n <div className=\"lds-pos\"></div>\n </div>\n </div>\n <div id=\"main-wrapper\" data-layout=\"vertical\" data-navbarbg=\"skin5\" data-sidebartype=\"full\"\n data-sidebar-position=\"absolute\" data-header-position=\"absolute\" data-boxed-layout=\"full\">\n <header className=\"topbar\" data-navbarbg=\"skin5\">\n <Nav className=\"navbar top-navbar navbar-expand-md navbar-dark\">\n <div className=\"navbar-header\" data-logobg=\"skin5\">\n <NavbarBrand href=\"/admin\">\n <b className=\"logo-icon\">\n <Image src=\"/images/logo-icon.png\" alt=\"homepage\" className=\"dark-logo\" />\n <Image src=\"/images/logo-light-icon.png\" alt=\"homepage\" className=\"light-logo\" />\n </b>\n <span className=\"logo-text\">\n <Image src=\"/images/logo-text.png\" alt=\"homepage\" className=\"dark-logo\" />\n <Image src=\"/images/logo-light-text.png\" className=\"light-logo\" alt=\"homepage\" />\n </span>\n </NavbarBrand>\n\n <NavbarToggle className=\"show-sidebar waves-effect waves-light d-block d-md-none\" href=\"\">\n\n <Navbar>\n <Link to='#' className='menu-bars menu-icon ml-auto '>\n <Button className=\"bg-dark border-0\" onClick={() => setIcons(icons => !icons)} >{icons ? <FaIcons.FaBars className=\"buttonIcons\" onClick={showSidebar} /> : <AiIcons.AiOutlineClose className=\"buttonIcons\" onClick={showSidebar} />}</Button>\n </Link>\n </Navbar>\n </NavbarToggle>\n </div>\n\n <NavbarCollapse id=\"navbarSupportedContent\" data-navbarbg=\"skin5\">\n <Navbar className=\" float-start me-auto\">\n <NavItem className=\" search-box\"> <a className=\"nav-link waves-effect waves-dark\">\n <SearchIcon /></a>\n <form className=\"app-search position-absolute\" data-Toggle=\"#navbarSupportedContent\">\n <input type=\"text\" className=\"form-control\" placeholder=\"Search &amp; enter\" /> <a\n className=\"srh-btn\"><CloseIcon /></a>\n </form>\n </NavItem>\n </Navbar>\n\n <ul className=\"navbar-nav ml-auto\">\n <NavItem>\n <Dropdown>\n <Dropdown.Toggle className=\"text-muted border-0 pro-pic\" style={{ background: \"#414755\" }}>\n <Image src=\"images/users/1.jpg\" alt=\"users\" className=\"rounded-circle mr-auto\" width=\"40\" />\n </Dropdown.Toggle>\n <Dropdown.Menu>\n <Dropdown.Item href=\"javascript:void(0)\">\n <PersonOutlineIcon className=\"m-r-5 m-2 m-l-5\" width=\"17\" /> My Profile\n </Dropdown.Item>\n <Dropdown.Item href=\"javascript:void(0)\">\n <AccountBalanceWalletIcon className=\"m-r-5 m-2 m-l-5\" width=\"17\" /> My Balance\n </Dropdown.Item>\n <Dropdown.Item href=\"javascript:void(0)\">\n <MailOutlineIcon className=\"m-r-5 m-2 m-l-5\" width=\"17\" /> Inbox\n </Dropdown.Item>\n </Dropdown.Menu>\n </Dropdown>\n </NavItem>\n </ul>\n </NavbarCollapse>\n </Nav>\n </header>\n <Nav className={sidebar ? 'nav-menu active' : 'nav-menu'}>\n <ul>\n <Sidebar />\n </ul>\n </Nav>\n </div>\n\n </>\n );\n}", "title": "" }, { "docid": "60fd2cd24115a9ac068846d26d7179ce", "score": "0.65880996", "text": "sidebarPosition(state, payload) {\n if (payload.mode === 'left') {\n state.settings.sidebarLeft = true\n } else if (payload.mode === 'right') {\n state.settings.sidebarLeft = false\n } else if (payload.mode === 'toggle') {\n state.settings.sidebarLeft = !state.settings.sidebarLeft\n }\n }", "title": "" }, { "docid": "66a79a8e11e8b0790ce8a2bf1ed8d99d", "score": "0.65873116", "text": "function hideShowAside() {\n var el = $(\"#sidebar\");\n if (el.hasClass(\"show\")) {\n $(\"#sidebar\").removeClass(\"show\");\n } else {\n $(\"#sidebar\").addClass(\"show\");\n }\n }", "title": "" }, { "docid": "9ba4f54b522a1376a44e973559a4294a", "score": "0.6586722", "text": "function hideSidebar() {\n console.log('hide sidebar');\n //Hide the sidebar\n var side=document.getElementById('side');\n if (side!=null) {\n side.setAttribute('style',\"display:none;\");// width:0%;\n }\n var main = document.getElementById('main');\n if (main!=null) {\n main.setAttribute('style',\"display:float;\"); //width:100%; height: 100%; overflow: scroll;\n }\n disableAllText();\n}", "title": "" }, { "docid": "1a8c7480932ce4ff5b95491a8e5e7a07", "score": "0.65827155", "text": "UPDATE_SIDEBAR_WIDTH (state, width) {\n state.sidebarWidth = width;\n }", "title": "" }, { "docid": "253cd8a368d829a4b74f06524e596ba4", "score": "0.6580148", "text": "function showSidebar() {\n var ui = HtmlService.createTemplateFromFile('Sidebar')\n .evaluate()\n .setTitle(SIDEBAR_TITLE);\n SpreadsheetApp.getUi().showSidebar(ui);\n}", "title": "" }, { "docid": "21a585643bc8f82a7d40c8cc2625445d", "score": "0.6552985", "text": "function getDefaultSidebar() {\n if (window.matchMedia(sidebarQuery).matches)\n return 'hidden'\n else\n return 'visible'\n}", "title": "" }, { "docid": "2d2771c610f3c5f3f9ee50ac3310764e", "score": "0.65436596", "text": "_toggleSideMenu() {\n // Same thing as before, might want to store this as a variable\n var rootNode = ReactDOM.findDOMNode(this);\n $(rootNode).find('#sidebar-menu').sidebar('toggle');\n }", "title": "" }, { "docid": "fb7162f07c4bbd943dd7a342a2373e71", "score": "0.6541477", "text": "function displaySidebar()\n{\n destroyPopup();\n const sidebar = $(\".sidebar\");\n const ANIMATE_TIME = 300;\n if (sidebar.length > 0)\n {\n return false;\n }\n else\n {\n $(\".icon\").addClass(\"close\");\n const buttons = [$(\"#view-cart-btn\"), $(\"#login-btn\"), $(\"#register-btn\"), $(\"#title-btn\"), $(\"#genre-btn\"), $(\"#search-btn\"), $(\"#order-history-btn\")];\n let contents = \"<ul class='side sidenav-list'>\";\n for (let button of buttons)\n {\n button = $(button);\n if (!button.hasClass(\"hidden\"))\n contents += `<li class='side sidenav-holder'><button id=\"${button.attr(\"id\")}\" class=\"topbtn\">${button.text()}</button></li>`;\n }\n contents += \"</ul>\";\n $(\"body\").append(\"<div class='side sidebar'>\" + contents + \"</div>\");\n $(\".sidebar #search-btn\").text(\"Search\");\n attachMobileNavigationBtnEventListeners();\n\n\n sidebar.find(\"button\").attr(\"class\", \"navbtn side\");\n $(\".sidebar\").animate({left: \"0px\"},\n ANIMATE_TIME,\n function () {\n const sidebar_btn = $(\".sidebar-mobile-icon-holder\");\n sidebar_btn.unbind('click');\n sidebar_btn.click(hideSidebar);\n });\n }\n}", "title": "" }, { "docid": "033bba74d096b44120acc3d7969b1ffd", "score": "0.6510566", "text": "function showSideBar(){ //display side bar\n \toverlap.fadeIn(); //display mask\n \tsidebar.css('right',0); //adjust css of side bar\n }", "title": "" }, { "docid": "16b8201eea6befb1eb0c90d4a73db721", "score": "0.6504112", "text": "function openCloseSidebar ()\r\n{\r\n if (!document.getElementsByClassName (\"sidebar\")[0].classList.contains(\"active\"))\r\n document.getElementsByClassName (\"sidebar\")[0].classList.add(\"active\");\r\n else\r\n document.getElementsByClassName (\"sidebar\")[0].classList.remove(\"active\");\r\n}", "title": "" }, { "docid": "5ba81a6c54b1c07ba696e3823508ccd8", "score": "0.650136", "text": "function openNavToggle () {\n const mySidebar = document.getElementById(\"mySidebar\");\n\n if (mySidebar.style.display === \"none\") {\n document.getElementById(\"mainContent\").style.marginLeft = \"15%\";\n document.getElementById(\"mainContent\").style.width = \"64%\";\n document.getElementById(\"mySidebar\").style.width = \"15%\";\n document.getElementById(\"mySidebar\").style.display = \"block\";\n } else {\n document.getElementById(\"mainContent\").style.marginLeft = \"0%\";\n document.getElementById(\"mainContent\").style.width = \"79%\";\n document.getElementById(\"mySidebar\").style.display = \"none\";\n document.getElementById(\"openNav\").style.display = \"inline-block\";\n }\n}", "title": "" }, { "docid": "0830a22bf03a200e1a061549034240c8", "score": "0.6489697", "text": "function menuItem_open_close() {\n opened = !opened\n if(opened){\n document.getElementById(\"main\").style.marginLeft = \"25%\";\n if(document.getElementById(\"newCanvas\").checked){\n //document.getElementById(\"mySidebar2\").style.width = \"25%\";\n //document.getElementById(\"mySidebar2\").style.display = \"block\";\n document.getElementById(\"mySidebar\").style.display = \"none\";\n }\n else{\n document.getElementById(\"mySidebar\").style.width = \"25%\";\n document.getElementById(\"mySidebar\").style.display = \"block\";\n ///document.getElementById(\"mySidebar2\").style.display = \"none\";\n }\n }\n else{\n document.getElementById(\"main\").style.marginLeft = \"0%\";\n document.getElementById(\"mySidebar\").style.display = \"none\";\n //document.getElementById(\"mySidebar2\").style.display = \"none\";\n }\n}", "title": "" }, { "docid": "df42f0b16a6876e7cd5200119e011e7a", "score": "0.6480255", "text": "sidebarMini(state, payload) {\n if (helpers.getWindowWidth() > 991) {\n if (payload.mode === 'on') {\n state.settings.sidebarMini = true\n } else if (payload.mode === 'off') {\n state.settings.sidebarMini = false\n } else if (payload.mode === 'toggle') {\n state.settings.sidebarMini = !state.settings.sidebarMini\n }\n }\n }", "title": "" }, { "docid": "402f9b672f32c5d0a5231c1df43c2d14", "score": "0.6479538", "text": "function sideBarShown() {\n\treturn (!configPanel.collapsed);\n}", "title": "" }, { "docid": "f9935dc566db372abb49ec492d56bf09", "score": "0.6478513", "text": "collapseSidebar() {\n // overwrite the configuration to prevent unwanted changes to the tree state.\n this.layoutConfig.tree.collapsedByDefault = !this.layoutConfig.tree.collapsedByDefault;\n this.sidebarCollapsed = !this.sidebarCollapsed;\n this.getWidgetDataSource('aw-sidebar-header').toggleSidebar();\n }", "title": "" }, { "docid": "de0f7e7d58ce6a32bdfbc6524513dffb", "score": "0.6473", "text": "function toggleSideBar() {\n var left_offset = +$(\"#widget-cards\").css(\"left\").replace(\"px\",\"\");\n if(left_offset < 0) {\n openSideBar();\n } else {\n closeSideBar();\n }\n}", "title": "" }, { "docid": "f9a8608c5a9ee0d48eccf07aba7b3be2", "score": "0.6461336", "text": "function showSidebar() {\n\t\t\t\n\t\t\tsidebar.show();\n\t\t\tsidebar.animate({ 'max-width' : '400px' }, 400 );\n\t\t\t\t\t\n\t\t\tcontent.fadeTo('400', 0.5); \n\t\t\t\n\t\t}", "title": "" }, { "docid": "227702389c00c9e715b81fe5801d2bd1", "score": "0.6453271", "text": "function SideBar({ show, closed }) {\n return (\n <>\n <aside\n className={`fixed bg-white inset-y-0 z-50 flex flex-col flex-shrink-0 ${\n show ? \"w-64\" : \"w-0\"\n } max-h-screen overflow-hidden transition-all transform border-r shadow-lg lg:z-auto lg:static lg:shadow-none`}\n >\n <div className=\"flex items-center justify-between flex-shrink-0 p-2\">\n <span className=\"p-2 text-xl font-semibold leading-8 tracking-wider uppercase whitespace-nowrap\">\n <span className=\"text-purple-500\">Logo</span>\n </span>\n <XIcon width={20} className=\"lg:hidden block cursor-pointer\" onClick={closed}/>\n </div>\n\n <nav className=\"flex-1 overflow-hidden hover:overflow-y-auto\">\n <ul className=\"p-2 space-y-5 overflow-hidden\">\n <li>\n <NavLink\n to=\"/\"\n exact\n activeClassName=\"selected\"\n className=\"flex items-center p-2 space-x-2 rounded-md hover:bg-gray-100\"\n >\n <span>\n <ViewGridIcon width={25} />\n </span>\n <span className={`${show ? \"block\" : \"hidden\"}`}>Dashboard</span>\n </NavLink>\n </li>\n\n <li>\n <NavLink\n to=\"/reports\"\n activeClassName=\"selected\"\n className=\"flex items-center p-2 space-x-2 rounded-md hover:bg-gray-100\"\n >\n <span className=\"border p-2 rounded-full\">\n <TrendingUpIcon width={20} />\n </span>\n <span className={`${show ? \"block\" : \"hidden\"}`}>Reports</span>\n </NavLink>\n </li>\n\n <li>\n <NavLink\n to=\"/payment\"\n activeClassName=\"selected\"\n className=\"flex items-center p-2 space-x-2 rounded-md hover:bg-gray-100\"\n >\n <span>\n <CreditCardIcon width={25} />\n </span>\n <span className={`${show ? \"block\" : \"hidden\"}`}>Payment</span>\n </NavLink>\n </li>\n </ul>\n </nav>\n </aside>\n </>\n );\n}", "title": "" }, { "docid": "d2875b615bfe2c4b5759ef21ca5f851c", "score": "0.6451973", "text": "function loadSidebarOption() {\n let loadedSidebar = localStorage.getItem(SIDEBARBIG_LS);\n if(loadedSidebar ===\"showing\"){\n sidebarBig.classList.add(SHOWING_CN)\n }\n}", "title": "" }, { "docid": "c69153a2d32e1d057ebdbb70b660e107", "score": "0.6442782", "text": "toggleDrawer() {\n const { isDrawerVisible } = this.state;\n this.setState({ isDrawerVisible: !isDrawerVisible });\n }", "title": "" }, { "docid": "7cce97d244b96796253e0abcc4a9f194", "score": "0.6414755", "text": "function resetSidebar() {\n\t\t\t\n\t\t\tsidebar.show();\n\t\t\tsidebar.css({ 'max-width' : '100%' });\n\t\t\t\t\t\n\t\t\tcontent.fadeTo('0', 1); \n\t\t}", "title": "" }, { "docid": "987421ac1c2c3f2ff5f07b52de11887a", "score": "0.64056784", "text": "function Sidebar() {\n React.useEffect(() => {\n console.log(\"Sidebar\");\n });\n return <div>Sidebar (look at my nextEffect chain)</div>;\n}", "title": "" }, { "docid": "e558d7d3c6ffff27a80ff1f265b1ee6b", "score": "0.6393312", "text": "function SideBar() {\n return (\n <div className='sideBar'>\n <IconButton className='addIcon'>\n <AddRoundedIcon />\n </IconButton>\n <SidebarMenu\n Icon={InboxRoundedIcon}\n Title={'Inbox'}\n Notifications={'100'}\n />\n <SidebarMenu\n Icon={GradeRoundedIcon}\n Title={'Starred'}\n Notifications={'100'}\n />\n <SidebarMenu\n Icon={WatchLaterIcon}\n Title={'Snoozed'}\n Notifications={'100'}\n />\n <SidebarMenu\n Icon={SendIcon}\n Title={'Sent'}\n Notifications={'100'}\n />\n <SidebarMenu\n Icon={DraftsIcon}\n Title={'Drafts'}\n Notifications={'100'}\n />\n <SidebarMenu\n Icon={ExpandMoreIcon}\n Title={'More'}\n Notifications={'100'}\n />\n\n <div className='sideBar_bottom'>\n <SidebarMenu\n Icon={VideocamIcon}\n Title={'New Meeting'}\n />\n <SidebarMenu\n Icon={KeyboardIcon}\n Title={'Join Meeting'}\n />\n \n \n </div>\n </div>\n )\n \n}", "title": "" }, { "docid": "07894425f64e9619a3c45df1093e618f", "score": "0.63837713", "text": "function showSidebar() {\n var sb = HtmlService.createTemplateFromFile('Sidebar')\n .evaluate()\n .setTitle(SIDEBAR_TITLE)\n .setSandboxMode(HtmlService.SandboxMode.IFRAME);\n DocumentApp.getUi().showSidebar(sb);\n}", "title": "" }, { "docid": "6ccc15a2ceebffa0b8fac0e3739a6630", "score": "0.6379709", "text": "function maintainLayout() {\n let sideBarStatus = getCookie(\"sidebar\");\n let fullscreenStatus = getCookie(\"fullscreen\");\n if (sideBarStatus!=null){\n if (sideBarStatus == \"false\"){\n let sideBar = document.querySelector(\"div#sidebar\");\n if (sideBar){\n sideBar.style.display = \"none\";\n }\n let mainBar = document.querySelector(\"div#mainbar\");\n mainBar.style.width = \"calc(100% - 24px)\";\n }\n }\n if (fullscreenStatus!=null){\n if (fullscreenStatus==\"true\"){\n document.documentElement.requestFullscreen();\n }\n }\n}", "title": "" }, { "docid": "8b128894ea0616269d4466bab49b2555", "score": "0.6379302", "text": "function showSidebar() {\n var ui = HtmlService.createTemplateFromFile('Sidebar')\n .evaluate()\n .setTitle(SIDEBAR_TITLE)\n .setSandboxMode(HtmlService.SandboxMode.IFRAME);\n DocumentApp.getUi().showSidebar(ui);\n}", "title": "" }, { "docid": "56f1a72fc27d00e2fb33a30a65b0c411", "score": "0.63766694", "text": "function toggleSideBar() {\n\tif (sideBarShown()) {\n\t\tconfigPanel.collapse(Ext.Component.DIRECTION_RIGHT, false);\n\t} else {\n\t\tconfigPanel.expand(false);\n\t}\n}", "title": "" }, { "docid": "fa6e3cab359e357bd034275c0d8755e7", "score": "0.6376158", "text": "function closeSidebar() {\n if (winWidth < 384) {\n $('#sidebar').css('left', -winWidth);\n }\n else {\n $('#sidebar').css('left','-24rem');\n }\n $('main').css('margin-left','auto');\n $('.sidebtn').css('left','0px');\n $('#fade-sidebar').removeClass('show').css('z-index','-1');\n $('.dropdown-menu').removeClass('active-side');\n $('.arrow-wide').removeClass('active');\n}", "title": "" }, { "docid": "b493801f9579e9df27d6793987be1f14", "score": "0.636844", "text": "render() {\n return (\n <nav className=\"sidebar\">\n <ul className=\"side-nav\">\n <li className={`${\n this.state.toggle == '1' ? 'side-nav__item--active' : ''\n } side-nav__item`}>\n <div className=\"side-nav__link\" onClick={this.toggleNav1}>\n <IconHome className=\"side-nav__icon\" />\n <span>Hotel</span>\n </div>\n </li>\n\n <li className={`${\n this.state.toggle == '2' ? 'side-nav__item--active' : ''\n } side-nav__item`}>\n <div className=\"side-nav__link\" onClick={this.toggleNav2}>\n <IconAircraft className=\"side-nav__icon\" />\n <span>Flight</span>\n </div>\n </li>\n\n <li className={`${\n this.state.toggle == '3' ? 'side-nav__item--active' : ''\n } side-nav__item`}>\n <div className=\"side-nav__link\" onClick={this.toggleNav3}>\n <IconKey className=\"side-nav__icon\" />\n <span>Car rental</span>\n </div>\n </li>\n\n <li className={`${\n this.state.toggle == '4' ? 'side-nav__item--active' : ''\n } side-nav__item`}>\n <div className=\"side-nav__link\" onClick={this.toggleNav4}>\n <IconMap className=\"side-nav__icon\" />\n <span>Tours</span>\n </div>\n </li>\n </ul>\n\n <div className=\"legal\">\n &copy; 2020 by Mahmoud Abdo. All rights reserved.\n </div>\n </nav>\n )\n }", "title": "" }, { "docid": "77b34db7c088eda90e0cce757e4deb59", "score": "0.63641334", "text": "toggleNavbar() {\n let container = document.getElementById('sidebar-container');\n let left = container.offsetLeft;\n\n // checks if sidebar is shown\n if (left === 0) {\n container.style.animationName = \"SlideOut\";\n container.style.animationFillMode = \"forwards\";\n container.style.animationDuration = \"0.5s\";\n } else {\n container.style.animationName = \"SlideIn\";\n container.style.animationFillMode = \"forwards\";\n container.style.animationDuration = \"0.5s\";\n }\n }", "title": "" }, { "docid": "9ec36a6db97e8c0cffc0099a2270f13f", "score": "0.6348249", "text": "function sideBar_open() {\n document.getElementById(\"StuSideBar\").style.display = \"block\";\n}", "title": "" }, { "docid": "30b776567d509d96a89689ac2d58261f", "score": "0.63481516", "text": "function sidebar() {\n if (sidebarIsOpen) {\n sidenav.style.display = \"none\";\n sidebarIsOpen = false;\n } else {\n sidenav.style.display = \"block\";\n sidebarIsOpen = true;\n\n // On limite le tab index au sidebar\n let focusableElements = \"#sidenavCloseBtn, .sidenav__link\";\n let sidenav2 = document.querySelector(\"#sidenavContent\");\n let firstFocusableElement = sidenav2.querySelectorAll(focusableElements)[0];\n let focusableContent = sidenav2.querySelectorAll(focusableElements);\n let lastFocusableElement = focusableContent[focusableContent.length - 1];\n\n document.addEventListener(\"keydown\", function (e) {\n let isTabPressed = e.key === \"Tab\" || e.keyCode === 9;\n if (!isTabPressed) {\n return;\n }\n if (e.shiftKey) {\n if (document.activeElement === firstFocusableElement) {\n lastFocusableElement.focus();\n e.preventDefault();\n }\n } else {\n if (document.activeElement === lastFocusableElement) {\n firstFocusableElement.focus();\n e.preventDefault();\n }\n }\n });\n firstFocusableElement.focus();\n }\n}", "title": "" }, { "docid": "8e42d26dae53c9ed5a02060c426c7d0f", "score": "0.6341317", "text": "function areaClick() {\n if(!area_sidebar) { dismiss_sidebar(); }\n\n area_sidebar = !area_sidebar;\n if(area_sidebar) {\n sidebar_area_slideOut();\n } else {\n sidebar_area_slideIn();\n }\n}", "title": "" }, { "docid": "7c1881a1b73b19d8aa7246625c5e8076", "score": "0.633991", "text": "function showSidebar() {\n var facebookService = getFacebookService();\n \n // if app does not have access yet\n if (!facebookService.hasAccess()) {\n var authorizationUrl = facebookService.getAuthorizationUrl();\n Logger.log(authorizationUrl);\n \n var template = HtmlService.createTemplate(\n '<a href=\"<?= authorizationUrl ?>\" target=\"_blank\">Authorize</a>. ' +\n 'Reopen the sidebar when the authorization is complete.');\n template.authorizationUrl = authorizationUrl;\n var page = template.evaluate();\n SpreadsheetApp.getUi().showSidebar(page);\n } else {\n // app does have access\n Logger.log('App has access');\n \n // make the api request\n makeRequest();\n }\n}", "title": "" }, { "docid": "5a2310e87b597219fdfa6d9aed6ed0f0", "score": "0.6336549", "text": "setSidebarAcara(state , list){\n state.sidebarAcara = list\n }", "title": "" }, { "docid": "ad268d65137d5eb6d5b867a7a8ea8120", "score": "0.6335696", "text": "function w3_open() {\n document.getElementById(\"mySidebar\").style.width = \"100%\";\n document.getElementById(\"mySidebar\").style.display = \"block\";\n}", "title": "" }, { "docid": "38925aaf73a3d5de16b3ecef294f111f", "score": "0.6333709", "text": "render() {\n let nav;\n\n if (this.state.showSearchBar) {\n nav = (\n <React.Fragment>\n <SearchBar history={this.props.history} />\n </React.Fragment>\n );\n } else if (this.props.windowWidth < 750) {\n let sideBar;\n if (this.props.isAuthenticated) {\n sideBar = (\n <SideDrawer open={this.state.showSideBar} closed={this.hideSideBar}>\n <NavigationItem link=\"/\" exact onClick={this.hideSideBar}>\n {\n <FontAwesomeIcon\n icon={faHome}\n style={{ paddingRight: \"5px\" }}\n />\n }\n Home\n </NavigationItem>\n <NavigationItem link=\"/new-post\" onClick={this.hideSideBar}>\n {\n <FontAwesomeIcon\n icon={faEdit}\n style={{ paddingRight: \"5px\" }}\n />\n }\n New Post\n </NavigationItem>\n <NavigationItem\n link=\"/liked-listings\"\n onClick={() => {\n this.props.setFilterTermForListing(\"favorites\");\n this.hideSideBar();\n }}\n >\n {\n <FontAwesomeIcon\n icon={faHeart}\n style={{ paddingRight: \"5px\" }}\n />\n }\n Favorites\n </NavigationItem>\n <NavigationItem link=\"/chats\" onClick={this.hideSideBar}>\n {\n <FontAwesomeIcon\n icon={faComments}\n style={{ paddingRight: \"5px\" }}\n />\n }\n Chats\n </NavigationItem>\n <NavigationItem\n link=\"/profile?from=/profile&&profile=personal\"\n onClick={() => {\n this.props.setFilterTermForListing(\"displayName\");\n this.hideSideBar();\n }}\n >\n {\n <FontAwesomeIcon\n icon={faUser}\n style={{ paddingRight: \"5px\" }}\n />\n }\n Profile\n </NavigationItem>\n <NavigationItem link=\"/logout\" onClick={this.hideSideBar}>\n {\n <FontAwesomeIcon\n icon={faSignOutAlt}\n style={{ paddingRight: \"5px\" }}\n />\n }\n Log out\n </NavigationItem>\n </SideDrawer>\n );\n } else {\n sideBar = (\n <SideDrawer open={this.state.showSideBar} closed={this.hideSideBar}>\n <NavigationItem link=\"/\" exact onClick={this.hideSideBar}>\n {\n <FontAwesomeIcon\n icon={faHome}\n style={{ paddingRight: \"5px\" }}\n />\n }\n Home\n </NavigationItem>\n <NavigationItem link=\"/auth\" onClick={this.hideSideBar}>\n {\n <FontAwesomeIcon\n icon={faSignOutAlt}\n style={{ paddingRight: \"5px\" }}\n />\n }\n Log in\n </NavigationItem>\n </SideDrawer>\n );\n }\n\n nav = (\n <div className={classes.filter}>\n <div\n className={classes.Button}\n onClick={\n this.state.showSideBar ? this.hideSideBar : this.showSideBar\n }\n >\n <FontAwesomeIcon\n icon={faBars}\n style={{\n color: \"white\",\n fontSize: \"1.5rem\",\n paddingLeft: \"20px\",\n paddingRight: \"10px\",\n }}\n />\n Menu\n </div>\n <div className={classes.dropdownContent}>\n {this.state.showSideBar ? sideBar : null}\n </div>\n </div>\n );\n } else {\n if (!this.props.isAuthenticated) {\n nav = (\n <React.Fragment>\n <NavigationItem link=\"/\" exact>\n {\n <FontAwesomeIcon\n icon={faHome}\n style={{ paddingRight: \"5px\" }}\n />\n }\n Home\n </NavigationItem>\n <NavigationItem link=\"/auth\">\n {\n <FontAwesomeIcon\n icon={faSignInAlt}\n style={{ paddingRight: \"5px\" }}\n />\n }\n Log In\n </NavigationItem>\n </React.Fragment>\n );\n } else {\n nav = (\n <React.Fragment>\n <NavigationItem link=\"/\" exact>\n {\n <FontAwesomeIcon\n icon={faHome}\n style={{ paddingRight: \"5px\" }}\n />\n }\n Home\n </NavigationItem>\n <NavigationItem link=\"/new-post\">\n {\n <FontAwesomeIcon\n icon={faEdit}\n style={{ paddingRight: \"5px\" }}\n />\n }\n New Post\n </NavigationItem>\n <NavigationItem\n link=\"/liked-listings\"\n onClick={() => this.props.setFilterTermForListing(\"favorites\")}\n >\n {\n <FontAwesomeIcon\n icon={faHeart}\n style={{ paddingRight: \"5px\" }}\n />\n }\n Favorites\n </NavigationItem>\n <NavigationItem link=\"/chats\">\n {\n <FontAwesomeIcon\n icon={faComments}\n style={{ paddingRight: \"5px\" }}\n />\n }\n Chats\n </NavigationItem>\n <NavigationItem\n link=\"/profile?from=/profile&&profile=personal\"\n onClick={() => this.props.setFilterTermForListing(\"displayName\")}\n >\n {\n <FontAwesomeIcon\n icon={faUser}\n style={{ paddingRight: \"5px\" }}\n />\n }\n Profile\n </NavigationItem>\n <NavigationItem link=\"/logout\">\n {\n <FontAwesomeIcon\n icon={faSignOutAlt}\n style={{ paddingRight: \"5px\" }}\n />\n }\n Log out\n </NavigationItem>\n </React.Fragment>\n );\n }\n }\n\n let searchIcon = this.state.showSearchBar ? (\n <div className={classes.SearchIcon}>\n <FontAwesomeIcon\n icon={faWindowClose}\n style={{\n color: \"white\",\n fontSize: \"1.5rem\",\n paddingLeft: \"20px\",\n paddingRight: \"10px\",\n }}\n onClick={this.cancelSearchHandler}\n />\n </div>\n ) : (\n <div className={classes.SearchIcon}>\n <FontAwesomeIcon\n icon={faSearch}\n style={{\n color: \"white\",\n fontSize: \"1.5rem\",\n paddingLeft: \"20px\",\n paddingRight: \"10px\",\n }}\n onClick={this.toggleSearchBarHandler}\n />\n </div>\n );\n\n let backgroundColor = { backgroundColor: \"#fd8673\" };\n if (this.state.showSearchBar) {\n backgroundColor = { backgroundColor: \"#fdb2a7\" };\n }\n\n return (\n <div className={classes.NavigationItems} style={backgroundColor}>\n {nav}\n {searchIcon}\n </div>\n );\n }", "title": "" }, { "docid": "65fe0a1b352101a5b97854db264bf1d1", "score": "0.63266104", "text": "function setupSidebar() {\n $(\"#more\").click(function() {\n $(\".sidebar\").toggle();\n $(\"#content-container\").toggleClass(\"col-md-12 col-lg-12 col-md-9 col-lg-10\");\n });\n}", "title": "" }, { "docid": "a0d17e7d0db73df3647175c9655c7f21", "score": "0.6321042", "text": "constructor(props) {\n super(props);\n\n this.state = {\n sidebarOpen: false\n }\n\n this.onSetSidebarOpen = this.onSetSidebarOpen.bind(this);\n }", "title": "" }, { "docid": "a0656869ed6c55e2c3f5d71f0b63848c", "score": "0.6316851", "text": "function w3_open() {\n if (mySidebar.style.display === 'block') {\n mySidebar.style.display = 'none';\n overlayBg.style.display = \"none\";\n } else {\n mySidebar.style.display = 'block';\n overlayBg.style.display = \"block\";\n }\n}", "title": "" }, { "docid": "a0656869ed6c55e2c3f5d71f0b63848c", "score": "0.6316851", "text": "function w3_open() {\n if (mySidebar.style.display === 'block') {\n mySidebar.style.display = 'none';\n overlayBg.style.display = \"none\";\n } else {\n mySidebar.style.display = 'block';\n overlayBg.style.display = \"block\";\n }\n}", "title": "" }, { "docid": "a0656869ed6c55e2c3f5d71f0b63848c", "score": "0.6316851", "text": "function w3_open() {\n if (mySidebar.style.display === 'block') {\n mySidebar.style.display = 'none';\n overlayBg.style.display = \"none\";\n } else {\n mySidebar.style.display = 'block';\n overlayBg.style.display = \"block\";\n }\n}", "title": "" }, { "docid": "a0656869ed6c55e2c3f5d71f0b63848c", "score": "0.6316851", "text": "function w3_open() {\n if (mySidebar.style.display === 'block') {\n mySidebar.style.display = 'none';\n overlayBg.style.display = \"none\";\n } else {\n mySidebar.style.display = 'block';\n overlayBg.style.display = \"block\";\n }\n}", "title": "" }, { "docid": "f825dcea617c1dbfa56a19131f131eeb", "score": "0.63154817", "text": "function CartSidebarToggle() {\n var CartSidebarMenu = document.getElementById(\"CartSidebar\");\n \n if (CartSidebarMenu.style.display === \"none\" || CartSidebarMenu.style.display === \"\") {\n CartSidebarMenu.style.display = \"block\";\n } else {\n CartSidebarMenu.style.display = \"none\";\n }\n}", "title": "" }, { "docid": "5ece0142042c46ed0a95e2d7874b846e", "score": "0.63106805", "text": "set sidebarOpen(open) {\n this._sidebarOpen = open;\n this.render();\n }", "title": "" } ]
66b7de54291d8b78a22b76c589166343
Removes a node from the DOM given its native parent.
[ { "docid": "4a9f6d69976789c3c624de94a18dc400", "score": "0.6188626", "text": "function nativeRemoveChild(renderer, parent, child, isHostElement) {\n if (isProceduralRenderer(renderer)) {\n renderer.removeChild(parent, child, isHostElement);\n }\n else {\n parent.removeChild(child);\n }\n}", "title": "" } ]
[ { "docid": "4e8f4a9a3416a275cfc5cded618d9a19", "score": "0.7511742", "text": "remove() {\n const parent = this.node.parentNode;\n\n parent && parent.removeChild(this.node);\n }", "title": "" }, { "docid": "bae4a331199be1d8b722ca7e8ae800ea", "score": "0.7134318", "text": "function _removeNode(node) {\n var parent = node.parentNode;\n while (node.childNodes.length) {\n var child = node.firstChild;\n child = node.removeChild(child);\n parent.insertBefore(child, node);\n };\n parent.removeChild(node);\n}", "title": "" }, { "docid": "d837a22a6bead87d8ab5bd4dd13aa78f", "score": "0.69995046", "text": "function remove_it(doc, node) {\r\n if (doc == null || node == null) return;\r\n if (!node.parentNode) return;\r\n\tnode.parentNode.removeChild(node);\r\n}", "title": "" }, { "docid": "911d351b8014ab908e6b20230bb46889", "score": "0.6986773", "text": "function cleanNode(parentNode, childNode){\r\n\tconst child = parentNode.querySelector(`.${childNode}`)\r\n\t\t\t// console.log(child)\r\n\tif(child !== null) \r\n\t\tchild.remove()\r\n}", "title": "" }, { "docid": "111677aaaade2b35b14dd7e8ca7634bc", "score": "0.697049", "text": "function removeDOMNode(node) {\n node.parentNode.removeChild(node);\n}", "title": "" }, { "docid": "9096e90bdbb3b62f504a0288d79c085d", "score": "0.6910149", "text": "function nativeRemoveNode(renderer, rNode, isHostElement) {\n var nativeParent = nativeParentNode(renderer, rNode);\n if (nativeParent) {\n nativeRemoveChild(renderer, nativeParent, rNode, isHostElement);\n }\n}", "title": "" }, { "docid": "9096e90bdbb3b62f504a0288d79c085d", "score": "0.6910149", "text": "function nativeRemoveNode(renderer, rNode, isHostElement) {\n var nativeParent = nativeParentNode(renderer, rNode);\n if (nativeParent) {\n nativeRemoveChild(renderer, nativeParent, rNode, isHostElement);\n }\n}", "title": "" }, { "docid": "9096e90bdbb3b62f504a0288d79c085d", "score": "0.6910149", "text": "function nativeRemoveNode(renderer, rNode, isHostElement) {\n var nativeParent = nativeParentNode(renderer, rNode);\n if (nativeParent) {\n nativeRemoveChild(renderer, nativeParent, rNode, isHostElement);\n }\n}", "title": "" }, { "docid": "9096e90bdbb3b62f504a0288d79c085d", "score": "0.6910149", "text": "function nativeRemoveNode(renderer, rNode, isHostElement) {\n var nativeParent = nativeParentNode(renderer, rNode);\n if (nativeParent) {\n nativeRemoveChild(renderer, nativeParent, rNode, isHostElement);\n }\n}", "title": "" }, { "docid": "9096e90bdbb3b62f504a0288d79c085d", "score": "0.6910149", "text": "function nativeRemoveNode(renderer, rNode, isHostElement) {\n var nativeParent = nativeParentNode(renderer, rNode);\n if (nativeParent) {\n nativeRemoveChild(renderer, nativeParent, rNode, isHostElement);\n }\n}", "title": "" }, { "docid": "9096e90bdbb3b62f504a0288d79c085d", "score": "0.6910149", "text": "function nativeRemoveNode(renderer, rNode, isHostElement) {\n var nativeParent = nativeParentNode(renderer, rNode);\n if (nativeParent) {\n nativeRemoveChild(renderer, nativeParent, rNode, isHostElement);\n }\n}", "title": "" }, { "docid": "d5c6ae0e5945dc0f7f877b5dfe2f5e77", "score": "0.68778765", "text": "removeFromParent() {\n var _a;\n (_a = this.parent) == null ? void 0 : _a.removeChild(this);\n }", "title": "" }, { "docid": "49ccddca9d9fc0d96edb6de772050cd7", "score": "0.6838942", "text": "function removeNode(node) {\n if (node && node.parentNode) {\n node.parentNode.removeChild(node);\n }\n}", "title": "" }, { "docid": "49ccddca9d9fc0d96edb6de772050cd7", "score": "0.6838942", "text": "function removeNode(node) {\n if (node && node.parentNode) {\n node.parentNode.removeChild(node);\n }\n}", "title": "" }, { "docid": "5c5cb7d5c353ae89e713bcb0cec9a8da", "score": "0.68272185", "text": "function removeElement( node ){\n node.parentNode.removeChild( node );\n}", "title": "" }, { "docid": "9abb4ab31d1e0d4eaad34f53532d14df", "score": "0.6788098", "text": "removeChild(node) {\n if (tree.Logical.getParentNode(node) !== this) {\n throw Error('The node to be removed is not a child of this node: ' +\n node);\n }\n if (!mixinImpl.removeNode(node)) {\n // if removing from a shadyRoot, remove form host instead\n let container = utils.isShadyRoot(this) ?\n this.host :\n this;\n // not guaranteed to physically be in container; e.g.\n // undistributed nodes.\n let parent = tree.Composed.getParentNode(node);\n if (container === parent) {\n tree.Composed.removeChild(container, node);\n }\n }\n mixinImpl._scheduleObserver(this, null, node);\n return node;\n }", "title": "" }, { "docid": "1397313e7b8284de06caab49c114020f", "score": "0.6715081", "text": "function removeElement(node){\n if (node[0] === undefined)\n {var parent = node.parentNode;\n parent.removeChild(node);}\n else\n for (var i = 0; i < node.length; i = i +1){\n var parent = node[i].parentNode;\n parent.removeChild(node[0]);\n }\n}", "title": "" }, { "docid": "745d9d502768bf4f9b5908de11c4e83a", "score": "0.6647909", "text": "function removeNode(e)\n{\n\tjQuery(e).remove();\n}", "title": "" }, { "docid": "1acb86fac197ad1a2c86a1a1b628d301", "score": "0.6636354", "text": "function _removeChild(parentNode,child){\n \tvar previous = child.previousSibling;\n \tvar next = child.nextSibling;\n \tif(previous){\n \t\tprevious.nextSibling = next;\n \t}else {\n \t\tparentNode.firstChild = next;\n \t}\n \tif(next){\n \t\tnext.previousSibling = previous;\n \t}else {\n \t\tparentNode.lastChild = previous;\n \t}\n \t_onUpdateChild(parentNode.ownerDocument,parentNode);\n \treturn child;\n }", "title": "" }, { "docid": "45d23c413704efb451508ab4cac47e56", "score": "0.66264343", "text": "function rm (child) {\n el.removeChild(child)\n }", "title": "" }, { "docid": "45d23c413704efb451508ab4cac47e56", "score": "0.66264343", "text": "function rm (child) {\n el.removeChild(child)\n }", "title": "" }, { "docid": "adbfffa74ad54b2aa2b262699da8d923", "score": "0.66249484", "text": "function deleteNode(node) {\n let target = document.querySelector(node)\n if (target !== null) {\n target.remove()\n }\n}", "title": "" }, { "docid": "21ea9fb70de05aac19c43906911fec4f", "score": "0.6576007", "text": "function _removeChild(parentNode,child){\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif(previous){\n\t\tprevious.nextSibling = next;\n\t}else{\n\t\tparentNode.firstChild = next\n\t}\n\tif(next){\n\t\tnext.previousSibling = previous;\n\t}else{\n\t\tparentNode.lastChild = previous;\n\t}\n\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\treturn child;\n}", "title": "" }, { "docid": "21ea9fb70de05aac19c43906911fec4f", "score": "0.6576007", "text": "function _removeChild(parentNode,child){\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif(previous){\n\t\tprevious.nextSibling = next;\n\t}else{\n\t\tparentNode.firstChild = next\n\t}\n\tif(next){\n\t\tnext.previousSibling = previous;\n\t}else{\n\t\tparentNode.lastChild = previous;\n\t}\n\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\treturn child;\n}", "title": "" }, { "docid": "21ea9fb70de05aac19c43906911fec4f", "score": "0.6576007", "text": "function _removeChild(parentNode,child){\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif(previous){\n\t\tprevious.nextSibling = next;\n\t}else{\n\t\tparentNode.firstChild = next\n\t}\n\tif(next){\n\t\tnext.previousSibling = previous;\n\t}else{\n\t\tparentNode.lastChild = previous;\n\t}\n\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\treturn child;\n}", "title": "" }, { "docid": "21ea9fb70de05aac19c43906911fec4f", "score": "0.6576007", "text": "function _removeChild(parentNode,child){\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif(previous){\n\t\tprevious.nextSibling = next;\n\t}else{\n\t\tparentNode.firstChild = next\n\t}\n\tif(next){\n\t\tnext.previousSibling = previous;\n\t}else{\n\t\tparentNode.lastChild = previous;\n\t}\n\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\treturn child;\n}", "title": "" }, { "docid": "21ea9fb70de05aac19c43906911fec4f", "score": "0.6576007", "text": "function _removeChild(parentNode,child){\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif(previous){\n\t\tprevious.nextSibling = next;\n\t}else{\n\t\tparentNode.firstChild = next\n\t}\n\tif(next){\n\t\tnext.previousSibling = previous;\n\t}else{\n\t\tparentNode.lastChild = previous;\n\t}\n\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\treturn child;\n}", "title": "" }, { "docid": "21ea9fb70de05aac19c43906911fec4f", "score": "0.6576007", "text": "function _removeChild(parentNode,child){\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif(previous){\n\t\tprevious.nextSibling = next;\n\t}else{\n\t\tparentNode.firstChild = next\n\t}\n\tif(next){\n\t\tnext.previousSibling = previous;\n\t}else{\n\t\tparentNode.lastChild = previous;\n\t}\n\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\treturn child;\n}", "title": "" }, { "docid": "21ea9fb70de05aac19c43906911fec4f", "score": "0.6576007", "text": "function _removeChild(parentNode,child){\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif(previous){\n\t\tprevious.nextSibling = next;\n\t}else{\n\t\tparentNode.firstChild = next\n\t}\n\tif(next){\n\t\tnext.previousSibling = previous;\n\t}else{\n\t\tparentNode.lastChild = previous;\n\t}\n\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\treturn child;\n}", "title": "" }, { "docid": "21ea9fb70de05aac19c43906911fec4f", "score": "0.6576007", "text": "function _removeChild(parentNode,child){\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif(previous){\n\t\tprevious.nextSibling = next;\n\t}else{\n\t\tparentNode.firstChild = next\n\t}\n\tif(next){\n\t\tnext.previousSibling = previous;\n\t}else{\n\t\tparentNode.lastChild = previous;\n\t}\n\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\treturn child;\n}", "title": "" }, { "docid": "21ea9fb70de05aac19c43906911fec4f", "score": "0.6576007", "text": "function _removeChild(parentNode,child){\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif(previous){\n\t\tprevious.nextSibling = next;\n\t}else{\n\t\tparentNode.firstChild = next\n\t}\n\tif(next){\n\t\tnext.previousSibling = previous;\n\t}else{\n\t\tparentNode.lastChild = previous;\n\t}\n\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\treturn child;\n}", "title": "" }, { "docid": "21ea9fb70de05aac19c43906911fec4f", "score": "0.6576007", "text": "function _removeChild(parentNode,child){\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif(previous){\n\t\tprevious.nextSibling = next;\n\t}else{\n\t\tparentNode.firstChild = next\n\t}\n\tif(next){\n\t\tnext.previousSibling = previous;\n\t}else{\n\t\tparentNode.lastChild = previous;\n\t}\n\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\treturn child;\n}", "title": "" }, { "docid": "21ea9fb70de05aac19c43906911fec4f", "score": "0.6576007", "text": "function _removeChild(parentNode,child){\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif(previous){\n\t\tprevious.nextSibling = next;\n\t}else{\n\t\tparentNode.firstChild = next\n\t}\n\tif(next){\n\t\tnext.previousSibling = previous;\n\t}else{\n\t\tparentNode.lastChild = previous;\n\t}\n\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\treturn child;\n}", "title": "" }, { "docid": "07a8b9a7d4fc7164ca278775f4ed83a9", "score": "0.65726465", "text": "function _removeChild(parentNode,child){\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif(previous){\n\t\tprevious.nextSibling = next;\n\t}else{\n\t\tparentNode.firstChild = next;\n\t}\n\tif(next){\n\t\tnext.previousSibling = previous;\n\t}else{\n\t\tparentNode.lastChild = previous;\n\t}\n\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\treturn child;\n}", "title": "" }, { "docid": "9fdc8aa847d9227ee403c468c5e67193", "score": "0.6562979", "text": "function nativeRemoveChild(renderer, parent, child, isHostElement) {\n renderer.removeChild(parent, child, isHostElement);\n}", "title": "" }, { "docid": "0ac4d69ebbbe67197dcec5b105b0d0ac", "score": "0.6549949", "text": "function remove(item){\n\tvar parent = item.parentNode.parentNode;\n\tvar child = item.parentNode;\n\tparent.removeChild(child);\n}", "title": "" }, { "docid": "478001c92070712b18fb75463fcb8e4c", "score": "0.65457946", "text": "remove(){\n\t\t//console.log(this.div.parentNode,\"REMOVE\");\n\t\tthis.div.parentNode.removeChildren(this.div);\n\t}", "title": "" }, { "docid": "f2eeaea551c9e04e792d59e6ad653c04", "score": "0.65133315", "text": "function removeChild(childNode) {\n var idx = this.childNodes.indexOf(childNode);\n if (idx > -1) {\n this.childNodes.splice(idx, 1)[0];\n childNode.parentNode = null;\n }\n return childNode;\n }", "title": "" }, { "docid": "c1f7fc349a35effbed64e798acd4f0b1", "score": "0.65013134", "text": "function _removeChild(parentNode,child){\n\t\tvar previous = child.previousSibling;\n\t\tvar next = child.nextSibling;\n\t\tif(previous){\n\t\t\tprevious.nextSibling = next;\n\t\t}else{\n\t\t\tparentNode.firstChild = next\n\t\t}\n\t\tif(next){\n\t\t\tnext.previousSibling = previous;\n\t\t}else{\n\t\t\tparentNode.lastChild = previous;\n\t\t}\n\t\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\t\treturn child;\n\t}", "title": "" }, { "docid": "b179c5bcb0611ae19234cf5869adc75a", "score": "0.64855576", "text": "removeNode(){\n this.#node.remove(); \n }", "title": "" }, { "docid": "e05f4e3c5bc7d1d35236077dc7e5cffa", "score": "0.6481215", "text": "function _removeChild(parentNode, child) {\n var previous = child.previousSibling;\n var next = child.nextSibling;\n if (previous) {\n previous.nextSibling = next;\n } else {\n parentNode.firstChild = next;\n }\n if (next) {\n next.previousSibling = previous;\n } else {\n parentNode.lastChild = previous;\n }\n _onUpdateChild(parentNode.ownerDocument, parentNode);\n return child;\n }", "title": "" }, { "docid": "e05f4e3c5bc7d1d35236077dc7e5cffa", "score": "0.6481215", "text": "function _removeChild(parentNode, child) {\n var previous = child.previousSibling;\n var next = child.nextSibling;\n if (previous) {\n previous.nextSibling = next;\n } else {\n parentNode.firstChild = next;\n }\n if (next) {\n next.previousSibling = previous;\n } else {\n parentNode.lastChild = previous;\n }\n _onUpdateChild(parentNode.ownerDocument, parentNode);\n return child;\n }", "title": "" }, { "docid": "2783ea91237e28c06e6a7efaf259b70b", "score": "0.6475922", "text": "function std_tree_remove(node){\n\tif(confirm(std_i18n['tree_confirm'])){\n\t\tvar n=document.getElementById(node);\n\t\tif(!n){\n\t\t\talert('uknown node: '+node+' ! stdjs002');\n\t\t}else{\n\t\t\tn.parentNode.removeChild(n);\n\t\t}\n\t\t\n\t}else{\n\n\t}\n}", "title": "" }, { "docid": "2c1cef6e811c5f53cedf7b66a309dc0e", "score": "0.6464484", "text": "remove(_parent, position) {\n const parent = this.getElementOrDie(_parent);\n dieIfOutOfRange(this, \"remove\", parent.children, position);\n\n const parentClone = this._cloneElementAndParents(parent);\n\n // pull out the element\n let element = parentClone.children.splice(position, 1)[0];\n\n // clone and clear parent\n if (element instanceof JSXElement) {\n \telement = element.clone();\n \tdelete element._parent;\n }\n\n // recursively remove all `oids` for element and its children\n this._removeOids(element);\n\n // return the element;\n return element;\n }", "title": "" }, { "docid": "78bacf890600e765b5e28541552d3b25", "score": "0.6461575", "text": "function anakin(parent) {\n while (parent.firstChild) {\n parent.removeChild(parent.firstChild);\n }\n}", "title": "" }, { "docid": "5e94f89bfcfdbb2e1dd26e7f012b3dfe", "score": "0.64537233", "text": "function nativeRemoveNode(renderer, rNode, isHostElement) {\n ngDevMode && ngDevMode.rendererRemoveNode++;\n var nativeParent = nativeParentNode(renderer, rNode);\n\n if (nativeParent) {\n nativeRemoveChild(renderer, nativeParent, rNode, isHostElement);\n }\n }", "title": "" }, { "docid": "5e94f89bfcfdbb2e1dd26e7f012b3dfe", "score": "0.64537233", "text": "function nativeRemoveNode(renderer, rNode, isHostElement) {\n ngDevMode && ngDevMode.rendererRemoveNode++;\n var nativeParent = nativeParentNode(renderer, rNode);\n\n if (nativeParent) {\n nativeRemoveChild(renderer, nativeParent, rNode, isHostElement);\n }\n }", "title": "" }, { "docid": "370746517e4b6616df5761e39798e797", "score": "0.64519703", "text": "function removeItem() {\r\n var item = this.parentNode.parentNode;\r\n var parent = item.parentNode;\r\n \r\n parent.removeChild(item);\r\n // console.log(this.parentNode.parentNode);\r\n}", "title": "" }, { "docid": "3cf41c39dea1d5b7d3664751802e7bea", "score": "0.6449147", "text": "function remove(el) {\n if (!el) return;\n var p = el.parentNode;\n if (p) {\n p.removeChild(el);\n if (!p.childNodes || !p.childNodes.length) remove(p);\n }\n}", "title": "" }, { "docid": "36fdf1a3e439346ee73b08dc190f22e3", "score": "0.6442219", "text": "function removeParent(evt){\n\tevt.target.parentNode.remove();\n}", "title": "" }, { "docid": "a05e36d975a60847d3feb52c72d38aec", "score": "0.64418983", "text": "function _removeChild(parentNode, child) {\n var previous = child.previousSibling;\n var next = child.nextSibling;\n if (previous) {\n previous.nextSibling = next;\n } else {\n parentNode.firstChild = next;\n }\n if (next) {\n next.previousSibling = previous;\n } else {\n parentNode.lastChild = previous;\n }\n _onUpdateChild(parentNode.ownerDocument, parentNode);\n return child;\n }", "title": "" }, { "docid": "359e30da11ee90aa0282df3c3827bddb", "score": "0.6391138", "text": "function removeItem() {\n const item = this.parentNode;\n const parent = item.parentNode;\n parent.removeChild(item);\n}", "title": "" }, { "docid": "db9d6bb2d29eff8fde40aa8f924986e0", "score": "0.63833284", "text": "remove() {\n this.parent().removeChild(this.element);\n }", "title": "" }, { "docid": "70b101a5beb4e09aefb8bf1c1966e96f", "score": "0.6383314", "text": "function destoryChild() {\n var children = document.getElementById('removeChild');\n children.removeChild(children.childNodes[0]);\n}", "title": "" }, { "docid": "a77042cbcb3b1dfdb90b1b24084e39e9", "score": "0.63810915", "text": "function removeAllChildNodes(parent){\n while(parent.firstChild){\n parent.removeChild(parent.firstChild);\n }\n}", "title": "" }, { "docid": "6f56f1eac64fd3f52b685cee9412b73a", "score": "0.6378618", "text": "remove() {\n this.node.remove()\n }", "title": "" }, { "docid": "e989282625019a9eddcf72ccc7ab9b99", "score": "0.6378", "text": "function removeAllChildNodes(parent) {\n while (parent.firstChild) {\n parent.removeChild(parent.firstChild);\n }\n}", "title": "" }, { "docid": "6249e541cb1c5c2a792326d5fa8ac4fe", "score": "0.6367633", "text": "removeElement() {\n if (this.element.parentNode)\n this.element.parentNode.removeChild(this.element)\n }", "title": "" }, { "docid": "56efcf6b47a5658900a2534a497cf1ef", "score": "0.6355233", "text": "function removeAllChildNodes(parent) {\n while (parent.firstChild) {\n parent.removeChild(parent.firstChild);\n }\n}", "title": "" }, { "docid": "56efcf6b47a5658900a2534a497cf1ef", "score": "0.6355233", "text": "function removeAllChildNodes(parent) {\n while (parent.firstChild) {\n parent.removeChild(parent.firstChild);\n }\n}", "title": "" }, { "docid": "56efcf6b47a5658900a2534a497cf1ef", "score": "0.6355233", "text": "function removeAllChildNodes(parent) {\n while (parent.firstChild) {\n parent.removeChild(parent.firstChild);\n }\n}", "title": "" }, { "docid": "8cfa6a5d6b0638e59c4cf63e1685bc65", "score": "0.6348118", "text": "function _removeChild(parentNode, child) {\n var previous = child.previousSibling;\n var next = child.nextSibling;\n if (previous) {\n previous.nextSibling = next;\n } else {\n parentNode.firstChild = next;\n }\n if (next) {\n next.previousSibling = previous;\n } else {\n parentNode.lastChild = previous;\n }\n _onUpdateChild(parentNode.ownerDocument, parentNode);\n return child;\n}", "title": "" }, { "docid": "ef425247f47db646811b98049a6baa4c", "score": "0.6324619", "text": "function removeEle(parentdiv) {\n while(parentdiv.lastChild) {\n parentdiv.removeChild(parentdiv.lastChild);\n }\n }", "title": "" }, { "docid": "b02c8bb838bd641b37c28121b63b3769", "score": "0.63217044", "text": "function remove(el) {\n var parent = el.parentNode;\n\n if (parent) {\n parent.removeChild(el);\n }\n } // @function empty(el: HTMLElement)", "title": "" }, { "docid": "fb49828c161fc53a8eef9019e39cba51", "score": "0.6321458", "text": "remove() {\n this.ensureNotDeleted('remove');\n // console.log('AbstractNode().remove() node: ' + this.id);\n // console.log(this.toJSON(true));\n if (this.isInternalNode()) {\n const useNode = this;\n if (useNode.parents.size > 0) {\n throw new Error('cannot remove node with parents ' + this.id);\n }\n }\n if (this.branches) {\n const useNode = this;\n if (useNode.branches.areBranchesStrictEqual()) {\n useNode.branches.getBranch('0').parents.remove(useNode);\n }\n else {\n useNode.branches.getBranch('0').parents.remove(useNode);\n useNode.branches.getBranch('1').parents.remove(useNode);\n }\n }\n this.deleted = true;\n this.rootNode.removeNode(this);\n }", "title": "" }, { "docid": "6877eeeac4ca4f6c358181216c59727f", "score": "0.6307555", "text": "function remove(el) {\n\t if (!el) return;\n\t var p = el.parentNode;\n\t if (p) {\n\t p.removeChild(el);\n\t if (!p.childNodes || !p.childNodes.length) remove(p);\n\t }\n\t}", "title": "" }, { "docid": "758aac1302d017924d45c78a5686d03a", "score": "0.6298347", "text": "removeElement() {\n this.el.parentNode.removeChild(this.el);\n }", "title": "" }, { "docid": "8b9bb747c01f681ac251bbbf13b68b51", "score": "0.6292394", "text": "function removeAllChildNodes(parent) {\n while (parent.firstChild) {\n parent.removeChild(parent.firstChild);\n }\n }", "title": "" }, { "docid": "b77039d75f7eab232eaa902027bd7afa", "score": "0.62868154", "text": "function removeAllChildren(parentNode){\n while (parentNode.firstChild) {\n parentNode.removeChild(parentNode.firstChild);\n }\n}", "title": "" }, { "docid": "4406c9bc46022d9bd95b93fc008b46dd", "score": "0.62856", "text": "remove() {\n this.node.remove()\n }", "title": "" }, { "docid": "2ab88e11f36d7751b007cd93fd532f28", "score": "0.62834346", "text": "function nativeRemoveNode(renderer, rNode, isHostElement) {\n ngDevMode && ngDevMode.rendererRemoveNode++;\n const nativeParent = nativeParentNode(renderer, rNode);\n\n if (nativeParent) {\n nativeRemoveChild(renderer, nativeParent, rNode, isHostElement);\n }\n}", "title": "" }, { "docid": "3806fcfab0fda3d8fca1948bea1945a6", "score": "0.6265531", "text": "remove () {\n this.node.remove();\n }", "title": "" }, { "docid": "8fa2fcc3e5c44fc1315adbea02d2d166", "score": "0.6261185", "text": "function nativeRemoveNode(renderer, rNode, isHostElement) {\n ngDevMode && ngDevMode.rendererRemoveNode++;\n const nativeParent = nativeParentNode(renderer, rNode);\n if (nativeParent) {\n nativeRemoveChild(renderer, nativeParent, rNode, isHostElement);\n }\n}", "title": "" }, { "docid": "4294b823004aa3378e36a7f273099cdf", "score": "0.6257956", "text": "function remove_me(event,parent) {\n console.debug('[remove_me] parent: '+parent);\n jQuery(this).closest(parent).remove();\n}", "title": "" }, { "docid": "643ab1c56e6b960c42c03f1456740b25", "score": "0.62527007", "text": "function removeNode(node) {\n if (!node) {\n return;\n }\n node.remove ?\n node.remove() :\n node.style.display = 'none';\n}", "title": "" }, { "docid": "c3856be111af5db08f36aebc2f7ca7f8", "score": "0.62526155", "text": "removeChildNodes(parent) {\n for (let child = parent.firstChild; child !== null; child = parent.firstChild) {\n parent.removeChild(child);\n }\n }", "title": "" }, { "docid": "17fbfb9ece191f6698ecfe9c2449cfa7", "score": "0.6250042", "text": "function nativeRemoveNode(renderer, rNode, isHostElement) {\n ngDevMode && ngDevMode.rendererRemoveNode++;\n const nativeParent = nativeParentNode(renderer, rNode);\n if (nativeParent) {\n nativeRemoveChild(renderer, nativeParent, rNode, isHostElement);\n }\n}", "title": "" }, { "docid": "17fbfb9ece191f6698ecfe9c2449cfa7", "score": "0.6250042", "text": "function nativeRemoveNode(renderer, rNode, isHostElement) {\n ngDevMode && ngDevMode.rendererRemoveNode++;\n const nativeParent = nativeParentNode(renderer, rNode);\n if (nativeParent) {\n nativeRemoveChild(renderer, nativeParent, rNode, isHostElement);\n }\n}", "title": "" }, { "docid": "0501bd32ca82d01d60229e5ca9495a74", "score": "0.6239202", "text": "function removeAllChildElements(parent){\r\n while (parent.firstChild) {\r\n parent.removeChild(parent.firstChild);\r\n }\r\n}", "title": "" }, { "docid": "5d5ca7de8610d94d3b2a1bb7451e5af4", "score": "0.62391067", "text": "function removeNode(n){\n if(n.hasChildNodes()){\n for(var i=0;i<n.childNodes.length;i++){\n n.parentNode.insertBefore(n.childNodes[i].cloneNode(true),n);\n }\n }\n n.parentNode.removeChild(n);\n}", "title": "" }, { "docid": "47343a7d2b2e352d98d24e92ef1f6382", "score": "0.6231005", "text": "removeDisplayChild(node) {\n\t\tthis._display.removeChild(node);\n\t}", "title": "" }, { "docid": "378e1049797e5245ee10bb18b081a8aa", "score": "0.62293684", "text": "remove() {\n if (this.parent) {\n this.parent.remove(this)\n }\n }", "title": "" }, { "docid": "3ed04e6ea7e2e9b2245ef6f422cb0203", "score": "0.62278944", "text": "function _removeHelper(parent, soughtNode) {\n\n //if the node has no children\n if(!soughtNode.left && !soughtNode.right){\n parent.left === soughtNode ? parent.left = null : parent.right = null;\n } else if (soughtNode.left && soughtNode.right) {\n //handle if node being removed has two children\n console.log(parent)\n if (parent.left === soughtNode) {\n parent.left.val = soughtNode.right.val\n parent.left.right = null;\n } else {\n parent.right.val = soughtNode.right.val\n parent.right.right = null;\n }\n } else {\n //handle if node being removed has one child\n parent.left === soughtNode ? parent.left = soughtNode.left || soughtNode.right : parent.right = soughtNode.left || soughtNode.right\n }\n }", "title": "" }, { "docid": "486968fb7335de7d6b889e26c616f88b", "score": "0.6222437", "text": "function nativeRemoveChild(renderer, parent, child, isHostElement) {\n if (isProceduralRenderer(renderer)) {\n renderer.removeChild(parent, child, isHostElement);\n } else {\n parent.removeChild(child);\n }\n }", "title": "" }, { "docid": "486968fb7335de7d6b889e26c616f88b", "score": "0.6222437", "text": "function nativeRemoveChild(renderer, parent, child, isHostElement) {\n if (isProceduralRenderer(renderer)) {\n renderer.removeChild(parent, child, isHostElement);\n } else {\n parent.removeChild(child);\n }\n }", "title": "" }, { "docid": "8a78b9936a2d184e8e0f870170a0e44d", "score": "0.6208776", "text": "function removeChildren(parentNode) { \n while (parentNode.firstChild) { \n parentNode.removeChild(parentNode.firstChild) \n }\n }", "title": "" }, { "docid": "0daaf7989f540ccba8e82f826dbf568b", "score": "0.62021595", "text": "function delNode(targetNode) {\r\n\tvar iNode = $ref(targetNode);\r\n\tif (iNode) return iNode.parentNode.removeChild(iNode);\r\n\treturn null;\r\n}", "title": "" }, { "docid": "0daaf7989f540ccba8e82f826dbf568b", "score": "0.62021595", "text": "function delNode(targetNode) {\r\n\tvar iNode = $ref(targetNode);\r\n\tif (iNode) return iNode.parentNode.removeChild(iNode);\r\n\treturn null;\r\n}", "title": "" }, { "docid": "242ef7a6fb36df483cf2d782519ccd71", "score": "0.6197765", "text": "function destroy(parent){\n var parentElem = document.getElementsByClassName(parent)[0];\n while(parentElem.firstChild){\n parentElem.removeChild(parentElem.firstChild);\n }\n }", "title": "" }, { "docid": "ca724e76baca17a16fa6f05c3bd83859", "score": "0.6196373", "text": "function nativeRemoveChild(renderer, parent, child, isHostElement) {\n if (isProceduralRenderer(renderer)) {\n renderer.removeChild(parent, child, isHostElement);\n } else {\n parent.removeChild(child);\n }\n}", "title": "" }, { "docid": "a7b9088f4dd557303ed242080a985f0f", "score": "0.6194314", "text": "function DeleteElement(parent, name) {\n var els = parent.getElementsByTagName(name);\n if (els.length > 0) \n parent.removeChild(els[0]);\n}", "title": "" }, { "docid": "44047dac5cf14df44d41f6d5b309304b", "score": "0.6184212", "text": "deleteSelf() {\n this.insideDOM.removeChild(this.DOM);\n }", "title": "" }, { "docid": "916726051f86d6890fbff98b85801b7c", "score": "0.6176255", "text": "function removeChild(parent, child, currentView) {\n if (child !== null && canInsertNativeNode(parent, currentView)) {\n // We only remove the element if not in View or not projected.\n var renderer = currentView[RENDERER];\n isProceduralRenderer(renderer) ? renderer.removeChild(parent.native, child) :\n parent.native.removeChild(child);\n return true;\n }\n return false;\n}", "title": "" } ]
c0d0290e56a55e557dd37b578b7d131e
draw a "token" as a purple square that tracks player one's movement along the game board. Using the same logic found in the drawPathSpaces function, another square is drawn at a new position on the canvas based on the player1Position variable. The old square does not move, which is fixed in the clearFormerPlayer1 code
[ { "docid": "5aadb10ef198a5e727e43aa608db27ff", "score": "0.71397096", "text": "function Player1Square(player1Position) {\n var canvas = document.getElementById(\"gameBoard\");\n var ctx = canvas.getContext(\"2d\");\n ctx.beginPath();\n ctx.strokeStyle = \"purple\";\n ctx.fillStyle = \"MediumPurple\";\n ctx.moveTo(35 + (player1Position*50),305);\n ctx.lineTo(50 + (player1Position*50),305);\n ctx.lineTo(50 + (player1Position*50),290);\n ctx.lineTo(35 + (player1Position*50),290);\n ctx.lineTo(35 + (player1Position*50),305);\n ctx.closePath();\n ctx.stroke();\n ctx.fill();\n}", "title": "" } ]
[ { "docid": "5253eb3961b88993aff63d7c753b43af", "score": "0.7475744", "text": "function drawToken(player, row, column){\n\n \n //center coordinates - middle of the squares\n cx = (column*50) - 25;\n cy = (row*50) - 25;\n\n r = 15;\n\n if (player == 1){\n ctx.fillStyle = 'black';\n }\n\n if (player == 2){\n ctx.fillStyle = 'white';\n }\n \n ctx.beginPath();\n ctx.arc(this.cx, this.cy, this.r, 0, Math.PI * 2);\n ctx.fill(); \n}", "title": "" }, { "docid": "e2202de87ba2e92a8b3048c9a6380842", "score": "0.71903175", "text": "function clearFormerPlayer1(player1Position) {\n var canvas = document.getElementById(\"gameBoard\");\n var ctx = canvas.getContext(\"2d\");\n ctx.beginPath();\n ctx.strokeStyle = \"gold\";\n ctx.fillStyle = \"gold\";\n ctx.moveTo(34 + (player1Position*50),306);\n ctx.lineTo(51 + (player1Position*50),306);\n ctx.lineTo(51 + (player1Position*50),289);\n ctx.lineTo(34 + (player1Position*50),289);\n ctx.lineTo(34 + (player1Position*50),306);\n ctx.closePath();\n ctx.stroke();\n ctx.fill();\n}", "title": "" }, { "docid": "a0332675296628dbe6c0e662ef300d2d", "score": "0.71420103", "text": "function clearFormerPlayer2(player2Position) {\n var canvas = document.getElementById(\"gameBoard\");\n var ctx = canvas.getContext(\"2d\");\n ctx.beginPath();\n ctx.strokeStyle = \"gold\";\n ctx.fillStyle = \"gold\";\n ctx.moveTo(29 + (player2Position*50),326);\n ctx.lineTo(46 + (player2Position*50),326);\n ctx.lineTo(46 + (player2Position*50),309);\n ctx.lineTo(29 + (player2Position*50),309);\n ctx.lineTo(29 + (player2Position*50),326);\n ctx.closePath();\n ctx.stroke();\n ctx.fill();\n}", "title": "" }, { "docid": "04c88f55640cf68b380a1ebf97445d14", "score": "0.6996514", "text": "function Player2Square(player2Position) {\n var canvas = document.getElementById(\"gameBoard\");\n var ctx = canvas.getContext(\"2d\");\n ctx.beginPath();\n ctx.strokeStyle = \"Turquoise\";\n ctx.fillStyle = \"Turquoise\";\n ctx.moveTo(30 + (player2Position*50),325);\n ctx.lineTo(45 + (player2Position*50),325);\n ctx.lineTo(45 + (player2Position*50),310);\n ctx.lineTo(30 + (player2Position*50),310);\n ctx.lineTo(30 + (player2Position*50),325);\n ctx.closePath();\n ctx.stroke();\n ctx.fill();\n}", "title": "" }, { "docid": "3e654cea68ba3850df98ae472e470ab9", "score": "0.6577079", "text": "function drawPlayer(player, ctx) {\n var mode = player.get(\"mode\");\n\n if (mode === 'GET_READY') {\n ctx.font = \"16px sans-serif\";\n ctx.textBaseline = \"bottom\"; \n ctx.textAlign = \"center\";\n ctx.fillStyle = \"white\";\n ctx.fillText(\"Get Ready!\", canvas.width / 2, canvas.height * 0.25);\n }\n\n var x = player.get(\"x\");\n var y = player.get(\"y\");\n\n ctx.save();\n ctx.translate(x, y);\n\n if (mode === 'GONE') {\n return;\n } else if (mode === 'EXPLODING') {\n ctx.beginPath();\n ctx.fillStyle = \"black\";\n ctx.arc(Math.floor(Math.random() * 16) - 8, Math.floor(Math.random() * 16) - 8, 4, 0, Math.PI * 2, false);\n ctx.fill();\n } else {\n var theta = degreesToRadians(player.get(\"h\"));\n ctx.rotate(theta + (Math.PI / 2));\n\n if (mode === 'GET_READY') {\n if (Math.floor(player.get(\"timer\") / 10) % 2 === 0) {\n ctx.fillStyle = 'green';\n } else {\n ctx.fillStyle = 'blue';\n }\n } else {\n ctx.fillStyle = \"red\";\n }\n ctx.beginPath();\n ctx.moveTo(-10, 10);\n ctx.lineTo(0, -10);\n ctx.lineTo(10, 10);\n ctx.lineTo(-10, 10);\n ctx.fill();\n\n if (player.get(\"f\") > 0) {\n ctx.beginPath();\n ctx.fillStyle = \"yellow\";\n ctx.moveTo(-5, 10);\n ctx.lineTo(5, 10);\n ctx.lineTo(0, 15);\n ctx.lineTo(-5, 10);\n ctx.fill();\n }\n }\n\n ctx.restore();\n}", "title": "" }, { "docid": "873537c85b4fdafa4f25cecd502dffab", "score": "0.6572575", "text": "function reDraw() {\n console.log('Player 1: ' + player1 + '\\tSign : O');\n console.log('Player 2: ' + player2 + '\\tSign : X');\n console.log('```\\n 1 \\t 2\\t 3\\n~~~~~~~~~~~~~\\n1| ' + printValue(0, 0) + '| ' + printValue(0, 1) + '| ' + printValue(0, 2) + '|\\n~~~~~~~~~~~~~\\n2| ' + printValue(1, 0) + '| ' + printValue(1, 1)\n + '| ' + printValue(1, 2) + '|\\n~~~~~~~~~~~~~\\n3| ' + printValue(2, 0) + '| ' + printValue(2, 1) + '|' + printValue(2, 2) + '|\\n~~~~~~~~~~~~~\\n```');\n}", "title": "" }, { "docid": "453e95b614118f42b7355e2e6f2800c6", "score": "0.64043534", "text": "draw() { // the \"step,\" causes the game to move forward\n // \"every\" returns true if every element in a list passes the given argument\n let winner = null;\n let oneDead = false;\n if (this.playerList.every(p => !!p.direction && !p.dead)) {\n this.playerList.forEach(p => {\n\n // draws player on canvas\n this.ctx.fillStyle = p.color;\n this.ctx.fillRect(p.x * UNIT, p.y * UNIT, UNIT, UNIT);\n this.ctx.strokeStyle = 'black';\n this.ctx.strokeRect(p.x * UNIT, p.y * UNIT, UNIT, UNIT);\n\n // kills player if they don't move onto a safe cell\n if (!this.safeCells.has(`${p.x}x${p.y}y`) && p.dead == false) {\n \n console.log(`${p.name} is dead`);\n p.dead = true;\n oneDead = true;\n p.direction = '';\n winner = this.playerList.filter(q => q.id != p.id)[0];\n }\n\n // sets the player's cell to unsafe\n this.safeCells.delete(`${p.x}x${p.y}y`);\n\n // updates the player's position based on key pressed if not dead\n //if (!p.dead) {\n p.move(this);\n //}\n });\n }\n if (this.playerList.every(p => p.dead) || this.playerList[0].x === this.playerList[1].x && this.playerList[0].y === this.playerList[1].y) {\n this.ctx.font = '30px Sans Serif';\n this.ctx.fillStyle = '#ffffff';\n this.ctx.textBaseline = 'middle';\n this.ctx.textAlign = 'center';\n this.ctx.fillText(`It's a draw! Press space to play 1-Player, M to play 2-Player`, this.canvas.width / 2, this.canvas.height / 2);\n this.end();\n }\n else if (oneDead) {\n this.ctx.font = '30px Sans Serif';\n this.ctx.fillStyle = '#ffffff';\n this.ctx.textBaseline = 'middle';\n this.ctx.textAlign = 'center';\n this.ctx.fillText(`Congrats ${winner.name}! Press space to play 1-Player, M to play 2-Player`, this.canvas.width / 2, this.canvas.height / 2);\n this.end();\n }\n }", "title": "" }, { "docid": "793b59e3efe890e7b1ba05fcb573282e", "score": "0.63476115", "text": "drawMoveSpots(tileX, tileY, x, y, tileSize, context) {\n if ((playerData.movement > 0 || playerData.movement == \"infinite\") && !playerData.moving) {\n\n context.fillStyle = \"rgba(80,200,100,0.4)\";\n if (playerData.availableDirections.up.status && tileX == playerData.currentTile.x && tileY == playerData.currentTile.y - 1) {\n context.fillRect(x, y, tileSize, tileSize);\n playerData.availableDirections.up.pos.x = x;\n playerData.availableDirections.up.pos.y = y;\n }\n if (playerData.availableDirections.down.status && tileX == playerData.currentTile.x && tileY == playerData.currentTile.y + 1) {\n context.fillRect(x, y, tileSize, tileSize);\n playerData.availableDirections.down.pos.x = x;\n playerData.availableDirections.down.pos.y = y;\n }\n if (playerData.availableDirections.left.status && tileX == playerData.currentTile.x - 1 && tileY == playerData.currentTile.y) {\n context.fillRect(x, y, tileSize, tileSize);\n playerData.availableDirections.left.pos.x = x;\n playerData.availableDirections.left.pos.y = y;\n }\n if (playerData.availableDirections.right.status && tileX == playerData.currentTile.x + 1 && tileY == playerData.currentTile.y) {\n context.fillRect(x, y, tileSize, tileSize);\n playerData.availableDirections.right.pos.x = x;\n playerData.availableDirections.right.pos.y = y;\n }\n\n\n }\n }", "title": "" }, { "docid": "f6e8289613b7ef37c5ba92589123972e", "score": "0.63384724", "text": "function drop_token(){\r\n\r\n // drop a token in the correct position based on which click listener has been triggered\r\n if(Game.game_over){\r\n\t // dont drop a token if we are currently dropping or if the game is over\r\n return;\r\n }// do nothing if the game is over and this function is called\r\n\r\n column = this.id.substring(1);\r\n\r\n // find which row we can put this piece in\r\n for(row = Game.rows - 1; row >= 0; row--){\r\n if(Game.board[row][column] == 0){\r\n break;\r\n }// end if we have found an empty piece, break out of the loop\r\n }// end for loop over all rows\r\n\r\n if(Game.board[row][column] != 0){\r\n return;\r\n }// end if we are on the last row, we cant place a piece\r\n\r\n (function animate (i) {\r\n\r\n setTimeout(function () {\r\n // set a timeout function so that the color is set on each row before the row to be dropped on\r\n // this will create a sort of dropping token effect\r\n Game.board[i][column] = Game.current_player_color;\r\n Game.draw_board();\r\n if (i < row) { // If i > 0, keep going\r\n\r\n setTimeout(function () {\r\n // set this timeout function so that after the color is set,\r\n // the color will be reset back to empty\r\n Game.board[i][column] = 0;\r\n Game.draw_board();\r\n }, 40);\r\n // recurse setting timeout functions until we reach the final row\r\n animate(i);\r\n }else{\r\n // we have reached the final row, set the color\r\n // toggle the players turn, redraw the board, and check if the game is over\r\n Game.board[row][column] = Game.current_player_color;\r\n Game.toggle_player_turn();\r\n Game.draw_board();\r\n top_display();\r\n\r\n if(Game.check_win(1)){\r\n document.getElementById('game_text').innerHTML = \"Yellow has won the game! Click 'Restart' to begin a new game.\";\r\n }else if(Game.check_win(2)){\r\n document.getElementById('game_text').innerHTML = \"Red has won the game! Click 'Restart' to begin a new game.\";\r\n }// end if we are checking for a winner\r\n\r\n if(Game.board_is_full()){\r\n document.getElementById('game_text').innerHTML = \"Game has ended in a tie! Click 'Restart' to begin a new game.\";\r\n }// board is full and nobody won, game is a tie\r\n }// end if we've reached the last row\r\n }, 40);// end timeout function for animating the chip falling\r\n\r\n i++;\r\n })(-1); // end of animate function for token animation\r\n}// end function for dropping tokens, event listener for each table cell", "title": "" }, { "docid": "b35c707eb93da68722aa1c896bd74aa9", "score": "0.63326436", "text": "function movePlayer() {\n //\"dice roll\". Should be between 1 and 4\n var moves = Math.floor(Math.random() * (4 - 1) + 1);\n //need the total number of squares, adding 1 because start isn't included in the squares array\n var totalSquares = game.squares.length + 1;\n //get the current player and the square he's on\n var currentPlayer = game.players[game.currentPlayer];\n var currentSquare = parseInt(currentPlayer.currentSquare.slice(6));\n\n //figure out if the roll will put player past start. If so, reset and give money for passing start\n if (currentSquare + moves <= totalSquares) {\n var nextSquare = currentSquare + moves;\n } else {\n var nextSquare = currentSquare + moves - totalSquares;\n currentPlayer.updateCash(currentPlayer.cash + 100);\n console.log(\"$100 for passing start\");\n }\n\n //update current square in object (the string \"square\" plus the index of the next square)\n currentPlayer.currentSquare = \"square\" + nextSquare;\n\n //find and remove current player token\n var currentToken = document.getElementById(currentPlayer.id);\n currentToken.parentNode.removeChild(currentToken);\n\n //add player to next location\n currentPlayer.createToken(\n document.getElementById(currentPlayer.currentSquare)\n );\n }", "title": "" }, { "docid": "95eaf2acd67ede0433e5db9cf663cee7", "score": "0.6318024", "text": "placeToken (player, x, y) {\n if(!this.__gameOver){\n var captured;\n\n if (this.checkLegal(player, x, y)) {\n \t\tthis.__lastMove = {\"x\":x, \"y\":y, \"c\":player, \"pass\":false};\n this.board = this.board.clone();\n this.board.evaluateMove(player, x, y);\n this.__addCapturedArmies(player);\n \t\t\tthis.history.push(this.board);\n\n // this.board.print();\n return true;\n }\n return false;\n }else{\n return true;\n }\n }", "title": "" }, { "docid": "7fac9c3ddc3c51958693db152ae52a63", "score": "0.6303833", "text": "function draw(){\n var width = canvas.width();\n var blockSize = width/board.length;\n var ctx = canvas[0].getContext('2d');\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, width, width);\n ctx.fillStyle=\"gray\";\n // loop through the board array drawing the walls and the goal\n for(var y = 0; y < board.length; y++){\n for(var x = 0; x < board[y].length; x++){\n // draw the walls\n if(board[y][x] === 1){\n ctx.fillRect(x*blockSize, y*blockSize, blockSize, blockSize);\n }\n // draw the goals\n else if(board[y][x] === -1){\n ctx.beginPath();\n ctx.lineWidth = 5;\n ctx.strokeStyle = \"gold\";\n ctx.moveTo(x*blockSize, y*blockSize);\n ctx.lineTo((x+1)*blockSize, (y+1)*blockSize);\n ctx.moveTo(x*blockSize, (y+1)*blockSize);\n ctx.lineTo((x+1)*blockSize, y*blockSize);\n ctx.stroke();\n }\n }\n }\n\n // draw the players\n var drawP1 = function() {\n ctx.beginPath();\n var half = blockSize/2;\n ctx.fillStyle = \"#33cc99\";\n ctx.arc(player1.x*blockSize+half, player1.y*blockSize+half, half, 0, 2*Math.PI);\n ctx.fill();\n };\n drawP1();\n\n var drawP2 = function() {\n ctx.beginPath();\n var half = blockSize/2;\n ctx.fillStyle = \"#006666\";\n ctx.arc(player2.x*blockSize+half, player2.y*blockSize+half, half, 0, 2*Math.PI);\n ctx.fill();\n };\n drawP2();\n}", "title": "" }, { "docid": "939db89d3183ae5596a4201ea3dd334c", "score": "0.62864274", "text": "drawPlayer(currentPlayer, newPosition) {\n //deconstruction\n const { y, x } = currentPlayer.position\n const newY = newPosition.y\n const newX = newPosition.x\n // the New Cell replaced with the new player Object(put player in new cell)\n this.map[newY][newX].push(currentPlayer)\n // remove player from the old cell\n this.map[y][x] = this.map[y][x].filter(item => {\n return item.id !== currentPlayer.id\n })\n this.drawCell({ y, x })\n this.drawCell({ y: newY, x: newX })\n }", "title": "" }, { "docid": "b804f13e4d7f170bbfa6d996c535e1dd", "score": "0.62737", "text": "function move(){\n\t\t\t\tif(player.x != end_x || player.y != end_y){\n\t\t\t\t\tconsole.log(\"draw!\");\n\t\t\t\t\t//If difference in distance from final spots are unequal we need to move in a diagnol line\n\t\t\t\t\tvar diff_x = Math.abs(player.x - end_x);\n\t\t\t\t\tvar diff_y = Math.abs(player.y - end_y);\n\t\t\t\t\tif (diff_x > diff_y){\n\t\t\t\t\t\t//console.log(diff_x / diff_y);\n\t\t\t\t\t}\n\t\t\t\t\tif (diff_x < diff_y){\n\t\t\t\t\t\t//console.log(diff_y / diff_x);\n\t\t\t\t\t}\t\t \n\t\t\t\t\tif (player.x > end_x){\n\t\t\t\t\t\t--player.x;\n\t\t\t\t\t}\n\t\t\t\t\tif (player.x < end_x){\n\t\t\t\t\t\t++player.x;\n\t\t\t\t\t}\n\t\t\t\t\tif (player.y > end_y){\n\t\t\t\t\t\t--player.y;\n\t\t\t\t\t}\n\t\t\t\t\tif (player.y < end_y){\n\t\t\t\t\t\t++player.y;\n\t\t\t\t\t}\n\t\t\t\t\tdraw();\n\t\t\t\t\tcanvasValid = false;\n\t\t\t\t}else{\n\t\t\t\t\tclearInterval(moveHandle);\n\t\t\t\t}\n\t\t }", "title": "" }, { "docid": "f0a0f34a97f89af1dfed2e635ef93ae9", "score": "0.62476504", "text": "function positionToken(token, position){\n\n let matchingProperty // This is determined further down\n let xTransform = 0\n let yTransform = 0\n\n let tokenOwner = players[token.getAttribute('player') - 1]\n\n let jail = tokenOwner.inJail > 0 ? true : false\n if (position == 10){\n if (jail){\n matchingProperty = document.querySelector('#board > .space[position=\"10\"] .in-jail')\n xTransform += document.querySelector('.just-visiting').offsetWidth \n } else{\n matchingProperty = document.querySelector('#board > .space[position=\"10\"] .just-visiting')\n }\n token.setAttribute('jail', jail)\n } else{\n matchingProperty = document.querySelector('#board > .space[position=\"' + position + '\"]')\n }\n\n token.style.gridArea = 'position-' + position\n xTransform += (matchingProperty.getBoundingClientRect().width / 2 - (token.offsetWidth / 2)) \n yTransform += (matchingProperty.getBoundingClientRect().height / 2 - (token.offsetHeight / 2)) \n\n\n\n\n // Check whether there are other tokens also on this property. If so, shift\n // them about so all are visible.\n let matchingTokens = document.querySelectorAll('#board > .token[position=\"' + position + '\"][jail=\"' + jail + '\"]')\n let factor = (matchingTokens.length - 1) * 10\n yTransform -= factor / 2 + 5\n\n for (i = 0; i < matchingTokens.length; i++){\n yTransform += 10\n matchingTokens[i].style.marginLeft = xTransform + 'px'\n matchingTokens[i].style.marginTop = yTransform + 'px'\n }\n\n\n tokenOwner.position = position\n}", "title": "" }, { "docid": "3d95d17b0777e0a0c9230824facd05ab", "score": "0.6210786", "text": "function movePlayersToStart() {\n // Update Player locations to be in the middle of the board\n player1.y = (canvas.height - player1.height) / 2;\n player2.y = (canvas.height - player2.height) / 2;\n}", "title": "" }, { "docid": "e1cba9dcc72e7517824b972f9f975a94", "score": "0.6150999", "text": "function player(){\n\n\t\tif(gammer === red){\n\n\t\t\tgammer = blue;\n\t\t\ttokenDraw(gammer);\n\n\t\t}else {\n\n\t\t\tgammer = red;\n\t\t\ttokenDraw(gammer);\n\t\t}\n\n\t\t\n}", "title": "" }, { "docid": "dace15e129281e7aa09402c675919bfb", "score": "0.61334723", "text": "function onePlayerGameLoop() {\n // Step 1: Clear Our Canvas & re-draw center line\n ctx.clearRect(0,0,canvas.width, canvas.height);\n drawCenterLine();\n\n // Step 2: Check for pressed keys, and update the player's accordingly\n\n // Player 1 Controls\n // We will Check if the key is pressed, and that we are not about to go out-of-bounds in each case\n if (keysPressed['w'] === true && player1.y > 0) {\n // Moving Upward\n player1.y -= 2.5;\n }\n\n // have to account for the player height in this calculation\n if (keysPressed['s'] === true && player1.y < canvas.height - player1.height) {\n // Moving Downward\n player1.y += 2.5;\n }\n\n // Player Two (Computer) Movements\n\n /**\n * To simulate a player, determine where this paddle is on the board\n * relative to the postion of the puck, and move accordingly\n */\n\n // Case 1: Puck is below paddle and we won't hit the bottom wall\n // if (puck.y - puck.r > player2.y + player2.height && player2.y < canvas.height - player2.height) {\n /*\n * Forgo the puck.r subtraction in this if statement\n * When it was included, it would sometimes not move to hit the puck,\n * and let it slide under the paddle\n */\n if (puck.y > player2.y + player2.height && player2.y < canvas.height - player2.height) {\n player2.y += 2;\n }\n\n // Case 2: Puck is above paddle and we won't hit the top wall\n else if (puck.y + puck.r < player2.y + player2.height && player2.y > 0) {\n player2.y -= 2;\n }\n\n\n // Step 3: Redraw our Player's in the new locations\n\n // drawPlayer1(player1.x, player1.y, player1.width, player1.height)\n // drawPlayer2(player2.x, player2.y, player2.width, player2.height)\n drawPlayer1();\n drawPlayer2();\n\n // Step 4: Draw the Puck & update its location\n\n // Check if we are colliding with the top or botton wall, and adjust accordingly\n\n checkIfPuckHitWall();\n\n // Check for collision with players\n checkAndHandlePlayerCollison()\n\n // Update puck x & y based on its velocity values before drawing\n puck.x += puck.xVelocity;\n puck.y += puck.yVelocity;\n\n // drawPuck(puck.x, puck.y, puck.r, puck.start, puck.end)\n drawPuck();\n\n // Step 6: Now that we have finsihed drawing, check for a winner\n checkForWinner();\n\n // While neither player has won\n // if (!player1Win && !player2Win) {\n if (!won) {\n //Request another animation frame\n window.requestAnimationFrame(onePlayerGameLoop)\n }\n else {\n // Otherwise, we can cancel the animation frame, and display a winner\n // .cancelAnimationFrame(gameLoop)\n\n // If one of the players has a score equal to 10, declare a winner\n if (player1.score === 10) {\n window.alert(\"Player 1 Wins!!\")\n window.cancelAnimationFrame(onePlayerGameLoop)\n\n // Return to our game mode menu\n showGameModeMenu();\n }\n else if (player2.score === 10) {\n window.alert(\"Player 2 Wins!!\")\n window.cancelAnimationFrame(onePlayerGameLoop)\n\n // Return to our game mode menu\n showGameModeMenu();\n }\n // Otherwise, reset the board, and play again\n else {\n initialize();\n }\n }\n\n}", "title": "" }, { "docid": "7becf61488136f76624ae818dbb1704a", "score": "0.6132014", "text": "function drawBoard() {\n $(\"#canvas\").empty();\n //$(\"#canvas\").replaceWith(jQuery(\"<div>\", {id: \"canvas\"}));\n \n $(\"#canvas\").css(\"background-color\", boardC);\n var svg = $(makeSVG(580, 580));\n var sqLen = Math.round(500 / (board.length - 1));\n \n //Draw the lines of the Go board\n for (var i = 0; i < board.length; i++) {\n svg.append(makeLine(40, i*sqLen + 40, (board.length - 1)*sqLen + 40, i*sqLen + 40, \"black\", 2));\n svg.append(makeLine(i*sqLen + 40, 40, i*sqLen + 40, (board.length - 1)*sqLen + 40, \"black\", 2));\n }\n\n //Draw the tokens that have been placed on the board\n for (var j = 0; j < board.length; j++) {\n for (var k = 0; k < board.length; k++) {\n if (board[j][k] !== 0) {\n svg.append(makeCircle(j * sqLen + 40, k * sqLen + 40, Math.min(Math.ceil(580 / (3 * board.length)), 39), board[j][k] > 0 ? tokenA : tokenB));\n }\n }\n }\n \n $(\"#canvas\").append(svg);\n}", "title": "" }, { "docid": "21443c37ca49f423e505cd3e24b69461", "score": "0.6109658", "text": "moving() {\n\n let divId = this.piece.id\n this.totalMoves++\n\n if (this.totalMoves > 1) {\n this.currentTile++\n }\n\n //If the token hasn't made a full round, do not allow it into a color zone\n if (this.currentTile > TILE_BEFORE_ROLLEROVER && this.totalMoves <= COMPLETE_ROUND_TILE_COUNT) {\n this.currentTile = 1\n }\n\n //If token moved 51 places, it can now enter it's colored zone\n if (this.totalMoves == TILE_BEFORE_ROLLEROVER) {\n this.currentTile = this.zoneTile\n }\n\n //If token reaches winning tile, put it in the center box and set win, if not, play normal\n if (this.currentTile == (this.endTile + 1)) {\n let classOfWin = this.piece.classList[0]\n this.piece.classList.add('win')\n $('#'+divId).detach().appendTo($('#'+classOfWin))\n this.inPlay = false\n message.textContent = 'You got a token to the end!'\n checkWin()\n } else {\n $('#'+divId).detach().appendTo($('.box[data-tile-number=\"'+ this.currentTile +'\"]'))\n }\n }", "title": "" }, { "docid": "194d89f68ecb01348e8b53121bc35d91", "score": "0.606603", "text": "function drawPlayerPosition() {\n\tvar newPlayerPosition = $(\"td#td__\" + player.positions.currentY + \"-\" + player.positions.currentX);\n\t//$(newPlayerPosition).attr('class', 'player-position');\n\tif (!$(newPlayerPosition).hasClass('is-wall')) {\n\t\t$(newPlayerPosition).removeClass('is-visited').addClass('player-position');\t\n\t}\n\t\n}", "title": "" }, { "docid": "1f672295b7ceb69beab40a2416e0cbf4", "score": "0.6059545", "text": "function Player(xstart, yStart, width, height) {\n this.xLoc = xstart;\n this.yLoc = yStart;\n this.width = width;\n this.height = height;\n this.drawPlayer = function() {\n ctx.beginPath();\n ctx.arc(this.xLoc, this.yLoc, this.width, 0, Math.PI*2);\n ctx.fillStyle = \"FF0000\";\n ctx.fill();\n ctx.closePath();\n };\n // drawPlayer, creates a circle, specifies its location and colors and fills it \n this.movePlayer = function() {\n if (moveLeft == true) {\n console.log(\"left\");\n if (this.xLoc < 0) {\n this.xLoc = (canvas.width+15)\n } else {\n this.xLoc -= 8;\n }; \n } else if (moveRight == true) {\n console.log(\"right\");\n if (this.xLoc > 480) {\n this.xLoc = 0;\n } else {\n this.xLoc += 8;\n }; \n } else if (moveUp == true) {\n console.log(\"up\");\n if (this.yLoc < 0) {\n this.yLoc = 320;\n } else {\n this.yLoc -= 8;\n }; \n } else if (moveDown == true) {\n console.log(\"down\");\n if (this.yLoc > 320) {\n this.yLoc = 0;\n } else {\n this.yLoc += 8;\n }; \n };\n };\n // movePlayer lookes at the states of the movement global vars and if/elses throught possible options and determines which direction\n // to go, and subtracts or adds to the player objects xLoc or yLoc properties\n this.playerDrift = function(xdrift, ydrift) {\n this.xLoc -= xdrift;\n this.yLoc += ydrift;\n }\n}", "title": "" }, { "docid": "142d7de7cc8b5086ee7a72a0f0a5c364", "score": "0.6052971", "text": "function renderPlayer (me, player) {\n const { x, y, direction, username, score } = player\n const canvasX = canvas.width / 2 + x - me.x\n const canvasY = canvas.height / 2 + y - me.y\n // Draw ship\n context.save()\n context.translate(canvasX, canvasY)\n context.rotate(direction)\n context.drawImage(\n player.charging ? assets.getAsset('ship_charge.png') : assets.getAsset('ship.png'),\n -player.radius,\n -player.radius,\n player.radius * 2,\n player.radius * 2\n )\n context.restore()\n // Draw health bar\n context.fillStyle = 'red'\n context.fillRect(\n canvasX - player.radius,\n canvasY + player.radius + 8,\n player.radius * 2,\n 4\n )\n context.fillStyle = 'lime'\n context.fillRect(\n canvasX - player.radius,\n canvasY + player.radius + 8,\n player.radius * 2 * (player.hp / PLAYER_MAX_HP),\n 4\n )\n // Draw stamina bar\n context.fillStyle = 'yellow'\n context.fillRect(\n canvasX - player.radius,\n canvasY + player.radius + 12,\n player.radius * 2,\n 4\n )\n context.fillStyle = 'black'\n context.fillRect(\n canvasX - player.radius + player.radius * 2 * player.chargeCooldown / PLAYER_CHANGE_MAX,\n canvasY + player.radius + 12,\n player.radius * 2 * (1 - player.chargeCooldown / PLAYER_CHANGE_MAX),\n 4\n )\n // Draw name\n const name = (player.spectator ? 'Spectator ' : '') + (username || 'Looper')\n const fontSize = Math.max(player.radius / 2, 12)\n context.lineWidth = 3\n context.fillStyle = '#eeeeee'\n context.strokeStyle = '#000000'\n context.miterLimit = 1\n context.lineJoin = 'round'\n context.textAlign = 'center'\n context.textBaseline = 'middle'\n context.font = 'bold ' + fontSize + 'px sans-serif'\n\n context.strokeText(name, canvasX, canvasY - player.radius * 1.5)\n context.fillText(name, canvasX, canvasY - player.radius * 1.5)\n context.strokeText(score, canvasX, canvasY - player.radius * 2)\n context.fillText(score, canvasX, canvasY - player.radius * 2)\n\n // if (global.toggleMassState === 0) {\n // context.strokeText(name, circle.x, circle.y)\n // context.fillText(name, circle.x, circle.y)\n // } else {\n // context.strokeText(name, circle.x, circle.y)\n // context.fillText(name, circle.x, circle.y)\n // context.font = 'bold ' + Math.max(fontSize / 3 * 2, 10) + 'px sans-serif'\n // if (name.length === 0) fontSize = 0\n // context.strokeText(Math.round(cellCurrent.mass), circle.x, circle.y + fontSize)\n // context.fillText(Math.round(cellCurrent.mass), circle.x, circle.y + fontSize)\n // }\n}", "title": "" }, { "docid": "4224519a091711c8ea29f92fe1890069", "score": "0.6050695", "text": "draw() {\n let ctx = this.miniMap.getContext(\"2d\");\n ctx.clearRect(0, 0, this.miniMap.width, this.miniMap.height);\n\n // Draw Tiles\n for (let y = 0; y < this.mapHeight; y++) {\n for (let x = 0; x < this.mapWidth; x++) {\n let wall = map[y][x];\n\n if (wall > 0) {\n ctx.fillStyle = \"rgb(124, 67, 43)\";\n ctx.fillRect(\n x * this.miniMapScale,\n y * this.miniMapScale,\n this.miniMapScale, this.miniMapScale\n );\n }\n }\n }\n\n // Draw Player\n ctx.fillStyle = \"rgb(255, 255, 255)\"\n ctx.fillRect(\n this.player.x * this.miniMapScale - 2,\n this.player.y * this.miniMapScale - 2,\n this.miniMapScale, this.miniMapScale\n );\n\n ctx.beginPath();\n ctx.moveTo(this.player.x * this.miniMapScale, this.player.y * this.miniMapScale);\n ctx.lineTo(\n (this.player.x + Math.cos(this.player.rot) * 4) * this.miniMapScale,\n (this.player.y + Math.sin(this.player.rot) * 4) * this.miniMapScale\n );\n ctx.closePath();\n ctx.strokeStyle = 'white';\n ctx.stroke();\n }", "title": "" }, { "docid": "b48b5548360b5a29d2bf6107d177980d", "score": "0.603417", "text": "highlightPlayerMoves() {\n const { currentPlayer } = this.props;\n const { CELL_SIZE, canvasContext, data: gameBoard } = this.state;\n canvasContext.fillStyle = 'rgba(0,125,255,0.25)';\n currentPlayer.availableMoves.forEach((move) => {\n canvasContext.beginPath();\n canvasContext.rect(\n (move.x * CELL_SIZE) + 1,\n (move.y * CELL_SIZE) + 1,\n CELL_SIZE - 2,\n CELL_SIZE - 2,\n );\n canvasContext.fill();\n canvasContext.closePath();\n });\n }", "title": "" }, { "docid": "7c6b7983e3213fd27c35ff14d7642fb8", "score": "0.59961694", "text": "function twoPlayerGameLoop() {\n // Step 1: Clear Our Canvas & re-draw center line\n ctx.clearRect(0,0,canvas.width, canvas.height);\n drawCenterLine();\n\n // Step 2: Check for pressed keys, and update the player's accordingly\n\n // Player 1 Controls\n // We will Check if the key is pressed, and that we are not about to go out-of-bounds in each case\n if (keysPressed['w'] === true && player1.y > 0) {\n // Moving Upward\n player1.y -= 2.5;\n }\n\n // have to account for the player height in this calculation\n if (keysPressed['s'] === true && player1.y < canvas.height - player1.height) {\n // Moving Downward\n player1.y += 2.5;\n }\n\n // Player 2 Controls\n if (keysPressed['k'] === true && player2.y > 0) {\n // Moving Upward\n player2.y -= 2.5;\n }\n\n if (keysPressed['m'] === true && player2.y < canvas.height - player2.height) {\n // Moving Downward\n player2.y += 2.5;\n }\n\n // Step 3: Redraw our Player's in the new locations\n\n // drawPlayer1(player1.x, player1.y, player1.width, player1.height)\n // drawPlayer2(player2.x, player2.y, player2.width, player2.height)\n drawPlayer1();\n drawPlayer2();\n\n // Step 4: Draw the Puck & update its location\n\n // Check if we are colliding with the top or botton wall, and adjust accordingly\n\n checkIfPuckHitWall();\n\n // Check for collision with players\n checkAndHandlePlayerCollison()\n\n // Update puck x & y based on its velocity values before drawing\n puck.x += puck.xVelocity;\n puck.y += puck.yVelocity;\n\n // drawPuck(puck.x, puck.y, puck.r, puck.start, puck.end)\n drawPuck();\n\n // Step 6: Now that we have finsihed drawing, check for a winner\n checkForWinner();\n\n // While neither player has won\n // if (!player1Win && !player2Win) {\n if (!won) {\n //Request another animation frame\n window.requestAnimationFrame(twoPlayerGameLoop)\n }\n else {\n // Otherwise, we can cancel the animation frame, and display a winner\n // .cancelAnimationFrame(gameLoop)\n\n // If one of the players has a score equal to 10, declare a winner\n if (player1.score === 10) {\n window.alert(\"Player 1 Wins!!\")\n window.cancelAnimationFrame(twoPlayerGameLoop)\n\n // Return to our game mode menu\n showGameModeMenu();\n }\n else if (player2.score === 10) {\n window.alert(\"Player 2 Wins!!\")\n window.cancelAnimationFrame(twoPlayerGameLoop)\n\n // Return to our game mode menu\n showGameModeMenu();\n }\n // Otherwise, reset the board, and play again\n else {\n initialize();\n }\n }\n\n}", "title": "" }, { "docid": "74d97046a9a1bad2c0de0371db9196a1", "score": "0.59741974", "text": "function moveSomething(e) {\n\t\t\tfunction moveLeftRight(xVal){\n\t\t\t\tvar newX = xVal;\n\t\t\t\tboard.player.xPrev = board.player.x;\n\t\t\t\tboard.player.yPrev = board.player.y;\n\t\t\t\tboard.player.x = newX;\n\t\t\t\tboard.player.y = board.player.y;\n\t\t\t\tboard.position[newX][board.player.y] = 4;\n\t\t\t\tboard.position[board.player.xPrev][board.player.yPrev] = 0;\n\t\t\t\tboard.player.erasePrevious();\n\t\t\t\tboard.player.render();\n\t\t\t}\n\t\t\tfunction moveUpDown(yVal){\n\t\t\t\tvar newY = yVal;\n\t\t\t\tboard.player.xPrev = board.player.x;\n\t\t\t\tboard.player.yPrev = board.player.y;\n\t\t\t\tboard.player.x = board.player.x;\n\t\t\t\tboard.player.y = newY;\n\t\t\t\tboard.position[board.player.x][newY] = 4;\n\t\t\t\tboard.position[board.player.xPrev][board.player.yPrev] = 0;\n\t\t\t\tboard.player.erasePrevious();\n\t\t\t\tboard.player.render();\n\t\t\t}\n\t\t\tfunction enemiesMove(){\n\t\t\t\tif (!board.enemy1.enemyDead)\n\t\t\t\t\tenemy1Move.makeMove();\n\t\t\t\tif (!board.enemy2.enemyDead)\n\t\t\t\t\tenemy2Move.makeMove();\n\t\t\t\tif (!board.enemy3.enemyDead)\n\t\t\t\t\tenemy3Move.makeMove();\n\t\t\t}\n\t\t\tfunction checkForWin(){\n\t\t\t\tif (board.enemy1.enemyDead && board.enemy2.enemyDead && board.enemy3.enemyDead){\n\t\t\t\t\tconsole.log(\"You Win!!!!! *airhorn*\" )\n\t\t\t\t\tboard.player.eraseThis();\n\t\t\t\t\t//board.potion1.eraseThis();\n\t\t\t\t\t//board.potion2.eraseThis();\n\t\t\t\t\tctx.beginPath();\n\t\t\t\t\tctx.font = \"128px Georgia\";\n\t\t\t\t\tctx.fillStyle = \"#00F\";\n\t\t\t\t\tctx.fillText(\"You Win!!\", 40, 320);\n\t\t\t}\n\t\t\t}\n\t\t\tfunction restoreHealth(xVal,yVal){\n\t\t\t\tvar x = xVal;\n\t\t\t\tvar y = yVal;\n\t\t\t\tif (board.position[x][y] == 5){\n\t\t\t\t\tboard.player.restoreHealth();\n\t\t\t\t\tif(board.potion1.x == x && board.potion1.y == y)\n\t\t\t\t\t\tboard.potion1.eraseThis()\n\t\t\t\t\telse \n\t\t\t\t\t\tboard.potion2.eraseThis();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(!board.player.playerDead || board.enemy1.enemyDead && board.enemy2.enemyDead && board.enemy3.enemyDead){\n\t\t\tswitch(e.keyCode) {\n\t\t\t\tcase 37:\n\t\t\t\t\t// left key pressed\n\t\t\t\t\tvar newX = board.player.x - 1;\n\t\t\t\t\tif(board.player.x == 0)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tif(board.position[newX][board.player.y] == 0 || board.position[newX][board.player.y] == 5)\n\t\t\t\t\t{\n\t\t\t\t\t\tconsole.log(\"Left was pressed...\\n\");\n\t\t\t\t\t\trestoreHealth(newX,board.player.y);\n\t\t\t\t\t\tmoveLeftRight(newX);\n\t\t\t\t\t\tenemiesMove();\n\t\t\t\t\t}\n\t\t\t\t\telse if(board.position[newX][board.player.y] == 3){\n\t\t\t\t\t\tconsole.log(\"Enemy is taking damage...\");\n\t\t\t\t\t\tif(board.enemy1.x == newX && board.enemy1.y == board.player.y){\n\t\t\t\t\t\t\tboard.enemy1.takeDamage();\n\t\t\t\t\t\t\tif(board.enemy1.enemyDead)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmoveLeftRight(newX);\n\t\t\t\t\t\t\t\tcheckForWin();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(board.enemy2.x == newX && board.enemy2.y == board.player.y){\n\t\t\t\t\t\t\tboard.enemy2.takeDamage();\n\t\t\t\t\t\t\t\tif(board.enemy2.enemyDead)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmoveLeftRight(newX);\n\t\t\t\t\t\t\t\tcheckForWin();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(board.enemy3.x == newX && board.enemy3.y == board.player.y){\n\t\t\t\t\t\t\tboard.enemy3.takeDamage();\n\t\t\t\t\t\t\t\tif(board.enemy3.enemyDead)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmoveLeftRight(newX);\n\t\t\t\t\t\t\t\tcheckForWin();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tenemiesMove();\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase 38:\n\t\t\t\t\t// up key \n\t\t\t\t\tvar newY = board.player.y - 1;\n\t\t\t\t\tif(board.player.y == 0)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tif(board.position[board.player.x][newY] == 0 || board.position[board.player.x][newY] == 5)\n\t\t\t\t\t{\n\t\t\t\t\t console.log(\"Up was pressed...\\n\");\n\t\t\t\t\t\trestoreHealth(board.player.x,newY);\n\t\t\t\t\t\tmoveUpDown(newY);\n\t\t\t\t\t\tenemiesMove();\n\t\t\t\t\t}\n\t\t\t\t\telse if(board.position[board.player.x][newY] == 3){\n\t\t\t\t\t\tconsole.log(\"Enemy is taking damage...\");\n\t\t\t\t\t\tif(board.enemy1.x == board.player.x && board.enemy1.y == newY){\n\t\t\t\t\t\t\tboard.enemy1.takeDamage();\n\t\t\t\t\t\t\tif(board.enemy1.enemyDead){\n\t\t\t\t\t\t\t\tmoveUpDown(newY);\n\t\t\t\t\t\t\t\tcheckForWin();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(board.enemy2.x == board.player.x && board.enemy2.y == newY){\n\t\t\t\t\t\t\tboard.enemy2.takeDamage();\n\t\t\t\t\t\t\tif(board.enemy2.enemyDead){\n\t\t\t\t\t\t\t\tmoveUpDown(newY);\n\t\t\t\t\t\t\t\tcheckForWin();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(board.enemy3.x == board.player.x && board.enemy3.y == newY){\n\t\t\t\t\t\t\tboard.enemy3.takeDamage();\n\t\t\t\t\t\t\tif(board.enemy3.enemyDead){\n\t\t\t\t\t\t\t\tmoveUpDown(newY);\n\t\t\t\t\t\t\t\tcheckForWin();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tenemiesMove();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 39:\n\t\t\t\t\t// right key pressed\n\t\t\t\t\tvar newX = board.player.x + 1;\n\t\t\t\t\tif(board.player.x == 9)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tif(board.position[newX][board.player.y] == 0 || board.position[newX][board.player.y] == 5)\n\t\t\t\t\t{\n\t\t\t\t\t\tconsole.log(\"Right was pressed...\\n\");\n\t\t\t\t\t\trestoreHealth(newX,board.player.y);\n\t\t\t\t\t\tmoveLeftRight(newX);\n\t\t\t\t\t\tenemiesMove();\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse if(board.position[newX][board.player.y] == 3){\n\t\t\t\t\t\tconsole.log(\"Enemy is taking damage...\");\n\t\t\t\t\t\t\tif(board.enemy1.x == newX && board.enemy1.y == board.player.y){\n\t\t\t\t\t\t\tboard.enemy1.takeDamage();\n\t\t\t\t\t\t\tif(board.enemy1.enemyDead){\n\t\t\t\t\t\t\t\tmoveLeftRight(newX);\n\t\t\t\t\t\t\t\tcheckForWin();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(board.enemy2.x == newX && board.enemy2.y == board.player.y){\n\t\t\t\t\t\t\tboard.enemy2.takeDamage();\n\t\t\t\t\t\t\t\tif(board.enemy2.enemyDead){\n\t\t\t\t\t\t\t\tmoveLeftRight(newX);\n\t\t\t\t\t\t\t\tcheckForWin();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(board.enemy3.x == newX && board.enemy3.y == board.player.y){\n\t\t\t\t\t\t\tboard.enemy3.takeDamage();\n\t\t\t\t\t\t\t\tif(board.enemy3.enemyDead){\n\t\t\t\t\t\t\t\tmoveLeftRight(newX);\n\t\t\t\t\t\t\t\tcheckForWin();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tenemiesMove();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 40:\n\t\t\t\t\t// down key pressed\n\t\t\t\t\tvar newY = board.player.y + 1;\n\t\t\t\t\tif(board.player.y == 9)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tif(board.position[board.player.x][newY] == 0 || board.position[board.player.x][newY] == 5)\n\t\t\t\t\t{\n\t\t\t\t\t\tconsole.log(\"Down was pressed...\\n\");\n\t\t\t\t\t\trestoreHealth(board.player.x,newY);\n\t\t\t\t\t\tmoveUpDown(newY);\n\t\t\t\t\t\tenemiesMove();\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse if(board.position[board.player.x][newY] == 3){\n\t\t\t\t\t\tconsole.log(\"Enemy is taking damage...\");\n\t\t\t\t\t\t\tif(board.enemy1.x == board.player.x && board.enemy1.y == newY){\n\t\t\t\t\t\t\tboard.enemy1.takeDamage();\n\t\t\t\t\t\t\tif(board.enemy1.enemyDead){\n\t\t\t\t\t\t\t\tmoveUpDown(newY);\n\t\t\t\t\t\t\t\tcheckForWin();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(board.enemy2.x == board.player.x && board.enemy2.y == newY){\n\t\t\t\t\t\t\tboard.enemy2.takeDamage();\n\t\t\t\t\t\t\tif(board.enemy2.enemyDead){\n\t\t\t\t\t\t\t\tmoveUpDown(newY);\n\t\t\t\t\t\t\t\tcheckForWin();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(board.enemy3.x == board.player.x && board.enemy3.y == newY){\n\t\t\t\t\t\t\tboard.enemy3.takeDamage();\n\t\t\t\t\t\t\tif(board.enemy3.enemyDead){\n\t\t\t\t\t\t\t\tmoveUpDown(newY);\n\t\t\t\t\t\t\t\tcheckForWin();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tenemiesMove();\n\t\t\t\t\t}\n\t\t\t\t\tbreak; \n\t\t\t}\n\t\t\t//console.log(\"heres our current player position in moveSomething \"+board.player.x + board.player.y);\n\t\t\t}\t//console.log(\"heres our previous player position in moveSomething \"+board.player.xPrev + board.player.yPrev);\t\t\n\t\t}", "title": "" }, { "docid": "467b2b7b47ada181ddb3427536adb424", "score": "0.5971398", "text": "function drawX(event)\n{\n // x and y are defined based on the mouse position at the time of the click event\n var x = event.x;\n var y = event.y;\n\n // redefine x and y relative to the canvas\n x -= canvas.offsetLeft;\n y -= canvas.offsetTop;\n // determine which row and column the user clicked\n var col = Math.floor(x/200);\n var row = Math.floor(y/200);\n // define the color of our X or O\n context.fillStyle = \"#c0392b\";\n // draw a X or O\n context.beginPath();\n context.font=\"200px Helvetica\";\n if(spaces[col][row]==0){\n\t if(player1){\n\t \tcontext.fillText(\"X\",col*200+25,row*200+175);\n\t }else {\n\t\tcontext.fillText(\"O\",col*200+25,row*200+175);\t\n\t }\n } else {\n \talert(\"Someone already played there!\")\n }\n\n // updates our spaces array to keep track of who played where\n if(player1){\n \tspaces[col][row] = 1;\n } else {\n \tspaces[col][row] = 2;\n }\n // call the checkForWinner function\n checkForWinner(player1);\n // switch who is the active player\n player1 = !player1;\n}", "title": "" }, { "docid": "de84dfcdbd45649514eb88f686568355", "score": "0.59629565", "text": "function movePlayer() {\n var drawPlayerEmoji = function(px, py) {\n ctx.drawImage(ballArray[player.emoji.tiletype], px , py,\n gameBoard.tileWidth, gameBoard.tileHeight);\n }\n player.emoji.x = player.x;\n player.emoji.y = player.y;\n player.emoji.angle = player.angle;\n player.emoji.tiletype = player.tiletype;\n player.emoji.speed = 1.2;\n var dx = player.emoji.speed * Math.cos(degToRad(player.emoji.angle));\n var dy = player.emoji.speed * -1 * Math.sin(degToRad(player.emoji.angle));\n moveInterval = setInterval(function() {\n if (!moving){\n clearInterval(moveInterval);\n }\n if ((player.emoji.x + dx > gameBoard.x - 50) || (player.emoji.x + dx < 0)) {\n dx = -dx;\n }\n if (player.emoji.y + dy < 10) {\n closestTileCoordinate(player.emoji.x, player.emoji.y + 20);\n }\n drawPlayerEmoji(player.emoji.x += dx, player.emoji.y += dy);\n detectCollision();\n }, 5);\n}", "title": "" }, { "docid": "8cde40c44fd8caafe76dd684b583a268", "score": "0.5959901", "text": "function draw(){\n\tcontext.fillStyle='#000';\n\tcontext.fillRect(0,0,canvas.width,canvas.height);\n\tdrawMatrix(arena,{x:0,y:0})\n\tdrawMatrix(player.matrix,player.pos);\n}", "title": "" }, { "docid": "827efab1ec8bccfa129a02cb276f170d", "score": "0.5956057", "text": "function drawPlayer(player) {\n if (!player.isAlive) return;\n ctx.fillStyle = player.color\n ctx.beginPath();\n ctx.arc((player.x * tileWidth) + (tileWidth / 2), (player.y * tileHeight) + (tileHeight / 2), tileWidth / 3, 0, 2 * Math.PI);\n ctx.fill();\n}", "title": "" }, { "docid": "dd3c8e6bde6f8c4db05b24698b0e5676", "score": "0.5952891", "text": "function drawPieces(board) {\n // iterate over each row index\n for (var i = 0; i < board.length; i++)\n {\n // store size of tile\n var tile_size = canvas.width/8\n // iterate over each column index\n for (var x = 0; x < board[0].length; x++)\n {\n // if player 1's regular piece\n if (board[i][x] == 1)\n {\n // place white regular piece on tile\n context2D.fillStyle = \"White\";\n context2D.fillRect(x* tile_size+tile_size/4, i*tile_size+tile_size/4, tile_size/2, tile_size/2 );\n }\n // if player 1's king piece\n else if (board[i][x] == 2)\n { \n // place yellow king piece on tile\n context2D.fillStyle = \"Yellow\";\n context2D.fillRect(x* tile_size+tile_size/4, i*tile_size+tile_size/4, tile_size/2, tile_size/2 );\n }\n // if other player's regular piece\n if (board[i][x] == 3)\n {\n // place black regular piece on tile\n context2D.fillStyle = \"Black\";\n context2D.fillRect(x* tile_size+tile_size/4, i*tile_size+tile_size/4, tile_size/2, tile_size/2 );\n }\n // if other player's king piece\n if (board[i][x] == 4)\n {\n // place purple king piece on tile\n context2D.fillStyle = \"Purple\";\n context2D.fillRect(x* tile_size+tile_size/4, i*tile_size+tile_size/4, tile_size/2, tile_size/2 );\n }\n }\n }\n}", "title": "" }, { "docid": "e12066600af728ddcc8b13cdf2bd52ad", "score": "0.5939813", "text": "resetPosition(firstPlayer){\n this.x = firstPlayer ? 20 : canvas.width - 20*2;\n this.y = (this.context.canvas.height / 2) - (this.height / 2);\n }", "title": "" }, { "docid": "b1139b685f45d778d71ff45cb5b2ce13", "score": "0.59357566", "text": "function newTicTacToeGame(player1Token, player2Token) {\n if(!player1Token) player1Token = 'X';\n if(!player2Token) player2Token = 'Y';\n\n const gameBoard = grid.makeGrid(3, 3);\n\n let turn = player1;\n let winnerMessage = false;\n \n function changeTurn () {\n turn = turn === player1 ? player2 : player1\n }\n\n function currentToken() {\n return turn === player1 ? player1Token : player2Token\n }\n\n function checkForWin () {\n let matchResults = checkForMatchingRowsColunmsOrDiagonals();\n if(gameBoard.isGridFull() && matchResults.length === 0) return stalemate;\n return matchResults.length > 0 ? matchResults : false;\n\n function checkForMatchingRowsColunmsOrDiagonals() {\n let horizontalMatches = gameBoard.getHorizontalMatchingValues();\n let verticalMatches = gameBoard.getVerticalMatchingValues();\n let diagonalMatches = gameBoard.getDiagonalMatchingValues();\n return horizontalMatches.concat(verticalMatches, diagonalMatches)\n }\n }\n \n let publicMethods = {\n getCurrentGameState(){\n //returns a 2d array representing the game\n return gameBoard.gridStateAs2dArray();\n },\n\n getCurrentTurn() {\n return turn;\n },\n \n placeToken(xCoordinate, yCoordinate) {\n if (winnerMessage) return winnerMessage;\n let didPlaceToken = gameBoard.setValueAt(currentToken(), xCoordinate, yCoordinate);\n return generateGameMessage()\n\n function generateGameMessage() {\n if (didPlaceToken === valueAdded) {\n return placeTokenResult()\n } else {\n return didPlaceToken;\n }\n }\n \n //helper functions\n function placeTokenResult () {\n winnerMessage = checkForWin();\n if(winnerMessage) return winnerMessage;\n changeTurn();\n return turn === player1 ? player2PlacedToken : player1PlacedToken\n }\n },\n\n isAValidMoveMessage(message) {\n return (\n message === player1PlacedToken\n || message === player2PlacedToken\n || message === stalemate\n || isWinMessage(message)\n );\n\n function isWinMessage (message) {\n return (\n Array.isArray(message)\n && message[0].hasOwnProperty('matchType')\n );\n }\n }\n }\n\n return publicMethods;\n}", "title": "" }, { "docid": "63b2e635594b67467678ece009fffb19", "score": "0.59355265", "text": "function movePlayer() {\n var playerX = selectedCharacter.x,\n playerY = selectedCharacter.y,\n destX = path[0][0],\n destY = path[0][1];\n\n if (playerX < destX && playerY < destY) {\n selectedCharacter.x += MOVEMENT_STEP;\n selectedCharacter.y += MOVEMENT_STEP / 2;\n\n selectedCharacter.hp_bar.x += MOVEMENT_STEP;\n selectedCharacter.hp_bar.y += MOVEMENT_STEP / 2;\n } else if (playerX > destX && playerY > destY) {\n selectedCharacter.x -= MOVEMENT_STEP;\n selectedCharacter.y -= MOVEMENT_STEP / 2;\n\n\n selectedCharacter.hp_bar.x -= MOVEMENT_STEP;\n selectedCharacter.hp_bar.y -= MOVEMENT_STEP / 2;\n } else if (playerX < destX && playerY > destY) {\n selectedCharacter.x += MOVEMENT_STEP;\n selectedCharacter.y -= MOVEMENT_STEP / 2;\n\n\n selectedCharacter.hp_bar.x += MOVEMENT_STEP;\n selectedCharacter.hp_bar.y -= MOVEMENT_STEP / 2;\n } else if (playerX > destX && playerY < destY){\n \tselectedCharacter.x -= MOVEMENT_STEP;\n \tselectedCharacter.y += MOVEMENT_STEP / 2;\n\n\n selectedCharacter.hp_bar.x -= MOVEMENT_STEP;\n selectedCharacter.hp_bar.y += MOVEMENT_STEP / 2;\n }\n\n if ((playerX === destX) && (playerY === destY)) {\n path.splice(0,1);\n if (path.length == 0) {\n\n \tsortIndices(selectedCharacter);\n movingPlayer = false;\n selectedCharacter.canMove = 0;\n\n\t\tshowActionMenuNextToPlayer(selectedCharacter);\n }\n }\n\n sortIndices(selectedCharacter);\n //stage.update();\n changed = true;\n}", "title": "" }, { "docid": "22d30776f574547204e3ca97c46cf262", "score": "0.59052396", "text": "draw() {\n config.ctx.clearRect(0, 0, config.canvas.width, config.canvas.height);\n config.ctx.fillStyle = '#000';\n config.ctx.fillRect(0, 0, config.canvas.width, config.canvas.height);\n config.ctx.fillStyle = '#FFF';\n config.ctx.fillRect(\n config.player.x,\n config.player.y,\n config.player.width,\n config.player.height\n );\n config.ctx.fillRect(\n config.cpuPlayer.x,\n config.cpuPlayer.y,\n config.cpuPlayer.width,\n config.cpuPlayer.height\n );\n config.ctx.fillRect(\n config.ball.x,\n config.ball.y,\n config.ball.width,\n config.ball.height\n );\n config.ctx.font = '80px Arial';\n config.ctx.textAlign = 'center';\n config.ctx.fillText(\n config.player.score.toString(),\n config.canvas.width / 2 - 300,\n 100\n );\n\n config.ctx.fillText(\n config.cpuPlayer.score.toString(),\n config.canvas.width / 2 + 300,\n 100\n );\n\n config.ctx.beginPath();\n config.ctx.setLineDash([10, 10]);\n config.ctx.moveTo(config.canvas.width / 2, config.canvas.height);\n config.ctx.lineTo(config.canvas.width / 2, 0);\n config.ctx.strokeStyle = '#FFF';\n config.ctx.stroke();\n }", "title": "" }, { "docid": "70e09a5ed0ac6c3369d71248071b1a03", "score": "0.5882218", "text": "function eraseAndDrawPlayerTiles(){\n\t\tremoveTilesDrawing(\"playerBoard\", \"tileVertical\");\n\t\tdrawPlayerTiles(playerTiles, numberToString);\n\t}", "title": "" }, { "docid": "820eaebe055f331968bdffe0bb0cf635", "score": "0.5869992", "text": "function updatePlayerInfo() {\n\n\t// CAPTURED TOKENS\n\n\tdocument.getElementById('p2-captured-tokens').innerHTML = player2.capturedTokens;\n\tdocument.getElementById('p1-captured-tokens').innerHTML = player1.capturedTokens;\n\n\t// PASSED\n\n\tif (player1.passed) {\n\t\t$('#p1-passed').css('visibility','visible');\n\t} else {\n\t\t$('#p1-passed').css('visibility','hidden');\n\t}\n\n\tif (player2.passed) {\n\t\t$('#p2-passed').css('visibility','visible');\n\t} else {\n\t\t$('#p2-passed').css('visibility','hidden');\n\t}\n\t\n\t// HIGHLIGHT CURRENT PLAYER\n\n\tif (currPlayer == 1) {\t// if player 1 is current player\n\t\t$('#player-1').addClass(\"curr-player\");\n\t\t$('#player-2').removeClass(\"curr-player\");\n\t} else {\n\t\t$('#player-1').removeClass(\"curr-player\");\n\t\t$('#player-2').addClass(\"curr-player\");\n\t}\n}", "title": "" }, { "docid": "cc40812475f50480351f23a6cc533114", "score": "0.5867657", "text": "function onsendNodePlacement(_node, _piece) {\n \n \n console.log(props.currentplayer.current, props.playernumber);\nif(props.currentplayer.current == props.playernumber){\n \n \n if (_node.split(\"_\")[1] === \"yellow\" && _node.split(\"_\")[0] === _piece) {\n colored = [];\n\n reRender(colored);\n } else if (\n _node.split(\"_\")[1] === \"green\" &&\n _node.split(\"_\")[0] === _piece\n ) {\n if (props.currentplayer.current === \"1\") {\n p1Positions.current = ({ ...p1Positions.current, [current.current]: _node.split(\"_\")[0] });\n \n \n \n colored = [];\n onBoardSend(gameBoardinit, p1Positions, p2Positions);\n reRender(colored, true);\n \n } else if (props.currentplayer.current === \"2\") {\n p2Positions.current = ({ ...p2Positions.current, [current.current]: _node.split(\"_\")[0] });\n \n \n \n colored = [];\n onBoardSend(gameBoardinit, p1Positions, p2Positions);\n reRender(colored, true);\n \n }\n } else if (_node.split(\"_\")[1] === \"red\") {\n let node = _node.split(\"_\")[0];\n let letter = node.split(\"\")[0];\n let number = node.split(\"\")[1];\n\n if (props.playernumber == \"1\") {\n\n\n props.onPieceKnockout(isOccu(letter, number), \"2\");\n p2Positions.current = ({ ...p2Positions.current, [isOccu(letter, number)]: \"d10\" });\n p1Positions.current = ({ ...p1Positions.current, [current.current]: node });\n\n \n\n \n\n \n\n \n onBoardSend(gameBoardinit, p1Positions, p2Positions); \n \n\n } else if (props.playernumber == \"2\") {\n \n props.onPieceKnockout(isOccu(letter, number), \"1\");\n p1Positions.current = ({ ...p1Positions.current, [isOccu(letter, number)]: \"d10\" });\n p2Positions.current = ({ ...p2Positions.current, [current.current]: node });\n \n \n \n onBoardSend(gameBoardinit, p1Positions, p2Positions); \n \n \n }\n } else {\n \n\n if(_piece.slice(-1) === props.currentplayer.current){\n\n current.current = _piece;\n \n if (_piece.includes(\"pieceq\")) {\n \n setColoredTiles(\"q\", _node, current.current);\n }\n if (_piece.includes(\"piecet\")) {\n setColoredTiles(\"t\", _node, current.current);\n }\n if (_piece.includes(\"piecel\")) {\n setColoredTiles(\"l\", _node, current.current);\n }\n if (_piece.includes(\"piecep\")) {\n setColoredTiles(\"p\", _node, _piece.slice(-1));\n }\n \n if (_piece.includes(\"piecek\")) {\n setColoredTiles(\"k\", _node, current.current);\n }\n if (_piece.includes(\"pieceh\")) {\n setColoredTiles(\"h\", _node, current.current);\n }\n\n }\n \n }\n\n }\n else{\n console.log(\"wrong client\");\n }\n\n\n\n }", "title": "" }, { "docid": "fc797b0199cb5719b389a64f773d1d9f", "score": "0.5865798", "text": "function movePlayer(player, newX, newY) {\n // \"draw over\" the previous player's tile\n drawTile(tiles[player.y][player.x])\n player.x = newX\n player.y = newY\n}", "title": "" }, { "docid": "835f169de06ab5957544046870f9ec4f", "score": "0.5864967", "text": "function startGame() {\n \n var canvas = document.getElementById(\"canvas\");\n var ctx = canvas.getContext(\"2d\");\n canvas.width = 530;\n canvas.height = 800;\n \n \n //linea green \n ctx.fillStyle = \"green\";\n ctx.fillRect(0,0,50,800)\n //linea grey\n ctx.fillStyle = \"grey\";\n ctx.fillRect(50,0,10,800)\n //linea grey\n ctx.fillStyle = \"grey\";\n ctx.fillRect(70,0,400,800)\n //linea grey\n ctx.fillStyle = \"grey\";\n ctx.fillRect(480,0,10,800)\n \n //linea green\n ctx.fillStyle = \"green\";\n ctx.fillRect(490,0,50,800)\n \n //lineas blancas \n \n ctx.setLineDash([25, 20]);/*dashes are 5px and spaces are 3px*/\n \n ctx.beginPath();\n \n ctx.lineWidth=5;\n ctx.strokeStyle = \"white\";\n ctx.moveTo(260,0);\n ctx.lineTo(260, 800);\n ctx.stroke();\n ctx.closePath();\n //image\n var carImg = document.createElement('img');\n carImg.src = 'images/car.png';\n carImg.onload = function(){\n ctx.drawImage(carImg, 200, 550, 100, 200);\n }\n \n function Player(carImg) {\n this.width = 100;\n this.height = 200;\n this.x = 200;\n this.y =550;\n \n this.left = function(){\n if(this.x < 70)\n this.x +=65;\n } \n \n this.right = function(){\n if(this.x > 470)\n this.x +=65;\n }\n \n }\n\n var player1 = new Player(carImg);\n\n //document events:\n\n document.addEventListener(\"keydown\", function(e){\n switch(e.keyCode){\n case 37:\n player1.left();\n break;\n case 39:\n player1.right();\n break;\n }\n\n \n });\n \n }", "title": "" }, { "docid": "d7a2568d97b554e844e660ae782d8f64", "score": "0.5858012", "text": "function move(event){\n player.elem.innerHTML =\"Gold Digger\";\n //change x or y position acordingly\n //left arrow\n if(event.keyCode===37 && player.xpos>0){\n player.xpos--;\n } //right arrow\n if(event.keyCode===39 && player.xpos<4 ){\n player.xpos++;\n }//up arrow\n if(event.keyCode===38 && player.ypos>0){\n player.ypos--;\n } //down arrow\n if(event.keyCode===40 && player.ypos<4){\n player.ypos++ \n }\n \n //make it dissapear\n player.elem.parentNode.removeChild(player.elem);\n \n \n //makes it apear \n document.getElementById(\"spot\" + player.xpos + player.ypos).appendChild(player.elem);\n \n position1();\n position2();\n position3(); \n}", "title": "" }, { "docid": "bb5eef508026dcb75ecaafb732e71032", "score": "0.5851239", "text": "function draw() {\r\n\r\n //end of level\r\n\r\n if(timer <= 0){ \r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n rockets.splice(0,rockets.length);\r\n satellites.splice(0,satellites.length)\r\n lvl++;\r\n lvl_multiplier+=0.5; \r\n \r\n lvlMessage();\r\n }\r\n\r\n\r\n if(succesRate <= 0){\r\n gameOver();\r\n }\r\n ctx.setTransform(1, 0, 0, 1, 0, 0);\r\n \r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n ctx.drawImage(bg,0,0, canvas.width, canvas.height);\r\n ctx.drawImage(antenna,canvas.width/2 - canvas.width / 3,canvas.height-120, 70, 150);\r\n timer-=0.01;\r\n if(timer <= prevTime - 5){slideIndex++; prevTime = timer;}\r\n ctx.font = \"25px Raleway\";\r\n \r\n ctx.fillText(Math.round(timer),50,50);\r\n ctx.fillText(succesRate,canvas.width - 100,50);\r\n\r\n ctx.strokeStyle = \"white\";\r\n ctx.beginPath();\r\n ctx.moveTo(0, canvas.height/2 - canvas.height/3);\r\n ctx.lineTo(canvas.width/2 + canvas.height /7 , canvas.height/2 - canvas.height/3);\r\n ctx.stroke();\r\n ctx.moveTo(canvas.width/2 + canvas.height / 2, canvas.height/2- canvas.height/3);\r\n ctx.lineTo(canvas.width, canvas.height/2- canvas.height/3);\r\n ctx.stroke();\r\n var geosynchronous = \"geosynchronous orbit\";\r\n ctx.font = \"italic 17px Arial\";\r\n ctx.save();\r\n\r\n ctx.fillText(geosynchronous,canvas.width/2 + canvas.height /3 , canvas.height/2 - canvas.height/3.05);\r\n \r\n ctx.fillStyle = \"rgba(0,0,0,0.6)\";\r\n ctx.rect(canvas.width/2 - canvas.width/5,canvas.height/2 + canvas.height/3.5,canvas.width * 0.6 ,canvas.height/5);\r\n ctx.fill();\r\n ctx.fillStyle = \"white\";\r\n ctx.font = \"14px Raleway\"\r\n infoSlider(Math.round(timer));\r\n \r\n //randomly add satellites within each height category\r\n var timedRelease = Math.random();\r\n if(timedRelease < 0.01){\r\n if(!(filled_1)){satellites.push(new satellite(channel_1)); filled_1 = true;}\r\n else if(!(filled_2)){satellites.push(new satellite(channel_2)); filled_2 = true;}\r\n else if(!(filled_3)){satellites.push(new satellite(channel_3)); filled_3 = true;}\r\n else if(!(filled_4)){satellites.push(new satellite(channel_4)); filled_4 = true;}\r\n }\r\n \r\n \r\n //show fired comm signals\r\n if(firePressed == true){\r\n for(i = 0; i < rockets.length; i++){\r\n //move the rockets\r\n ctx.strokeStyle = \"rgba(255,215,0,0.6)\";\r\n ctx.lineWidth = 2;\r\n rockets[i].x -= rockets[i].dx;\r\n rockets[i].y -= dy;\r\n \r\n ctx.beginPath(); \r\n ctx.moveTo((canvas.width/2), (canvas.height/2)-canvas.height/3);\r\n ctx.lineTo(rockets[i].x, rockets[i].y);\r\n ctx.stroke(); \r\n\r\n //remove comm signal once it goes off screen\r\n if(rockets[i].y > canvas.height||rockets[i].x > canvas.width - 50 || rockets[i].x <0 ){rockets.splice(i,1);}\r\n }\r\n }\r\n\r\nfor(j = 0; j < satellites.length; j++){\r\n if(satellites[j].connected == true){\r\n if(!(satellites[j].returnTime >= timer + 1)){\r\n ctx.strokeStyle = \"rgba(255,215,0,0.6)\";\r\n ctx.lineWidth = 2;\r\n ctx.beginPath();\r\n ctx.moveTo((canvas.width/2), (canvas.height/2)-canvas.height/3);\r\n ctx.lineTo(canvas.width/2 - canvas.width / 3.25,canvas.height-120, 70, 150);\r\n ctx.stroke();\r\n //ctx.fillText(\"Space-to-Space Link\", canvas.width /2 + satellites[j].dx, satellites[j].channel);\r\n //sctx.fillText(\"Space-to-Ground Link\", canvas.width/2 - canvas.width / 2.5,canvas.height-130);\r\n }\r\n }\r\n }\r\n //draw tdrs!\r\n tdrs(); \r\n ctx.restore();\r\n\r\n //draw satellites\r\n for(i = 0; i < satellites.length; i++){ \r\n ctx.drawImage(satellites[i].glow, satellites[i].x-satellites[i].glowOffset, satellites[i].channel-satellites[i].glowOffset,100,100);\r\n ctx.drawImage(satellites[i].img,satellites[i].x, satellites[i].channel,satellites[i].size,satellites[i].size);\r\n \r\n satellites[i].x += satellites[i].dx;\r\n //remove satellites when they go offscreen and free up height channel\r\n if(satellites[i].x > canvas.width || satellites[i].x < -5){ \r\n if(satellites[i].channel == channel_1){\r\n filled_1 = false;\r\n }\r\n if(satellites[i].channel == channel_2){\r\n filled_2 = false;\r\n\r\n }\r\n if(satellites[i].channel == channel_3){\r\n filled_3 = false;\r\n }\r\n if(satellites[i].channel == channel_4){\r\n filled_4 = false;\r\n }\r\n \r\n succesRate -=satellites[i].score ;\r\n satellites.splice(i,1);\r\n }\r\n }\r\n\r\n\r\n //check for comm signal touching satellite\r\n for(j = 0; j<satellites.length; j++){\r\n for(i = 0; i<rockets.length; i++){\r\n \r\n if(satellites[j].connected == false && (rockets[i].x >= (satellites[j].x - 20)) && (rockets[i].x<= (satellites[j].x + 20)) &&\r\n (rockets[i].y >= (satellites[j].channel - 50)) && (rockets[i].y <= (satellites[j].channel + 150))){\r\n succesRate += satellites[j].score;\r\n satellites[j].glow = document.getElementById(\"green\");\r\n satellites[j].connected = true;\r\n satellites[j].returnTime = timer;\r\n rockets.splice(i,1);\r\n }\r\n \r\n }\r\n //move tdrs based on user input \r\n\r\n if(rightPressed && paddleRotate < 90 ) {\r\n //if(mousemoved == true){paddleRotate=0;mousemoved=false;}\r\n paddleRotate+=0.3;\r\n }\r\n else if(leftPressed && paddleRotate > -90) {\r\n // if(mousemoved == true){paddleRotate=0;mousemoved=false;}\r\n paddleRotate-=0.3;\r\n }\r\n \r\n }\r\n }", "title": "" }, { "docid": "9e0be736bd11a8f2a59918c54b5474ac", "score": "0.5848514", "text": "drawPlayer() {\n this.ctx.fillStyle = 'black';\n this.ctx.fillRect(this.window.innerWidth / 2 - 16, this.window.innerHeight / 2 - 16, 32, 32);\n }", "title": "" }, { "docid": "047a5bfc44f8fd02029b55c11791f835", "score": "0.5846868", "text": "function Player(color,board){\n this.color=color;\n this.lastMoveRow=0;\n this.columnLabel=null;\n this.makeAMove=function(column){\n //max sure the board does not go past 6 rows high; let the player know if they cannot play a piece in that column\n\n //semantics with naming of columns\n this.lastMoveColumn=column;\n if(gameBoard.columns[column].length<6){\n //if a valid move push color to the array representing the board\n gameBoard.columns[column].push(color);\n this.lastMoveRow=gameBoard.columns[column].length-1;\n this.columnLabel=parseInt(column);\n gameBoard.setLastMove([gameBoard.columns[column].length-1,parseInt(column)]);\n this.renderPiece();//ln 522 438\n gameBoard.moves++;\n //once 7 moves have been played there is a possibility for a winner;check for it\n } else {\n //cannot play anymore pieces to this column; invalid move\n alert('please choose another move; there is no more room in that column! :D');\n }\n // console.log('after player1 move the board state is:',board);\n };//end of playMove\n\n this.renderPiece=function(){\n //reintialize all matching varialbes to null\n gameBoard.matchDown=0;\n gameBoard.matchLeft=0;\n gameBoard.matchRight=0;\n gameBoard.matchDiagUpLeft=0;\n gameBoard.matchDiagUpRigh=0;\n gameBoard.matchDiagDownLeft=0;\n gameBoard.matchDiagDownRight=0;\n\n\n var col=this.columnLabel;\n var row=this.lastMoveRow.toString();\n gameBoard.lastMove=[col,parseInt(row)];\n //colors a particular square color depend which played played the move. color is an argument in the constructor function 463 464\n $('#row'+row+'> div.space.col-'+col).css('background-color',color);\n if(board.moves>5){\n board.checkForWinner();\n }\n };//end of renderPiece function\n\n}", "title": "" }, { "docid": "09346fe78ac1020bbd6141b55382d8ff", "score": "0.5846192", "text": "function draw() {\n context.fillStyle = '#000';\n context.fillRect(0,0,canvas.width, canvas.height);\n drawMatrix(arena, {x:0, y:0}, context)\n drawMatrix(player.matrix, player.pos, context);\n}", "title": "" }, { "docid": "8480702da491877216104231aa80ab85", "score": "0.5845974", "text": "function drawOnBoard(square, player) {\n square.classList.add(player.symbol);\n square.innerText = player.symbol;\n square.style.pointerEvents = 'none';\n\n // Remove item 'seven' from array\n let nextSymbol = SYMBOLS.filter((e) => { return e !== player.symbol })\n\n /*ADD SYMBOL */\n document.querySelector('#gameInfo #gameTurn').classList.remove(player.symbol);\n document.querySelector('#gameInfo #gameTurn').classList.add(nextSymbol);\n player.clicksArr.push(parseInt(square.id));\n}", "title": "" }, { "docid": "53553a7048c04682b1fbaa82a52a7895", "score": "0.58370936", "text": "draw(ctx){\n if(this.game.lost === true && this.game.gameOver === true){\n \n ctx.save();\n ctx.fillStyle = 'rgba(173, 216, 230, 0.95)';\n ctx.fillRect(this.left, this.top, Game.X_DIMS * 0.6, Game.Y_DIMS * 0.6);\n ctx.font = `${this.fontSize}px Arial`;\n ctx.fillStyle = 'black'\n ctx.fillText(`GAME OVER`, this.left + (Game.X_DIMS * 0.1), this.top + this.fontSize)\n ctx.fillText(`Level ${this.game.progressLevel}`, this.left + (Game.X_DIMS * 0.1), this.top + this.fontSize * 2.5)\n ctx.restore();\n this.makeRestartButton();\n this.restartGame.draw(ctx)\n } else if (this.game.lost === false && this.game.gameOver === true){\n this.makeNextLevButton()\n ctx.save();\n ctx.fillStyle = 'rgba(173, 216, 230, 0.95)';\n ctx.fillRect(this.left, this.top, Game.X_DIMS * 0.6, Game.Y_DIMS * 0.6);\n ctx.font = `${this.fontSize * 0.8}px Arial`;\n ctx.fillStyle = 'black'\n ctx.fillText(`Congrats`, this.left + (Game.X_DIMS * 0.1), this.top + this.fontSize)\n ctx.fillText(`Level ${this.game.progressLevel} Complete!`, this.left + (Game.X_DIMS * 0.1), this.top + this.fontSize * 2)\n ctx.restore()\n this.nextLevel.draw(ctx);\n } else {\n ctx.save();\n ctx.fillStyle = 'rgba(173, 216, 230, 0.75)';\n ctx.fillRect(this.left, this.top *2 , Game.X_DIMS * 0.6, Game.Y_DIMS * 0.3);\n ctx.font = `${this.fontSize}px Arial`;\n ctx.fillStyle = 'black'\n // ctx.fillText(`ITERO`, this.left + (Game.X_DIMS * 0.2), this.top + this.fontSize)\n ctx.restore()\n ctx.save()\n ctx.font = `${20}px Arial`;\n // ctx.fillText('Make your way across the road',\n // this.left + (Game.X_DIMS * 0.25),\n // this.top + this.fontSize * 2\n // )\n // ctx.fillText('Try and avoid traffic',\n // this.left + (Game.X_DIMS * 0.25),\n // this.top + this.fontSize * 2 + Game.Y_DIMS * 0.05\n // )\n // ctx.fillText(\"Touching cars causes loss in health\",\n // this.left + (Game.X_DIMS * 0.25),\n // this.top + this.fontSize * 2 + Game.Y_DIMS * 0.05 * 2\n // )\n // ctx.fillText(\"Higher levels increase difficulty\",\n // this.left + (Game.X_DIMS * 0.25),\n // this.top + this.fontSize * 2 + Game.Y_DIMS * 0.05 * 3\n // )\n // ctx.fillText(\"Navigate using 'w', 'a', 's', 'd'\",\n // this.left + (Game.X_DIMS * 0.25),\n // this.top + this.fontSize * 2 + Game.Y_DIMS * 0.05 * 4\n // )\n ctx.fillText(\"Press Enter To Begin, or Pause\",\n this.left + (Game.X_DIMS * 0.25),\n this.top + this.fontSize * 2 + Game.Y_DIMS * 0.05 * 3\n )\n this.makeButtons();\n\n ctx.restore();\n this.start.draw(ctx);\n\n }\n }", "title": "" }, { "docid": "613d25d5a3867746f095cac7822dbedf", "score": "0.583261", "text": "function drawPlayer(playerX, playerY) {\r\n // GOOD practice: save the context, use 2D trasnformations\r\n ctx.save();\r\n \r\n // translate the coordinate system, draw relative to it\r\n ctx.translate(playerX, playerY);\r\n \r\n ctx.fillStyle = 'blue';\r\n // (0, 0) is the top left corner of the monster.\r\n ctx.beginPath();\r\n ctx.arc(0, 0, playerR, 0, 2*Math.PI);\r\n ctx.fill();\r\n \r\n // GOOD practice: restore the context\r\n ctx.restore();\r\n}", "title": "" }, { "docid": "f53d6a6fdbaf469eb3126f74142a1c6f", "score": "0.5826617", "text": "function updatePosition() {\n let dif = Date.now() - lst\n lst = Date.now()\n step = pixs * dif / 1000\n cardsToMove.forEach(el => {\n cards[el.index].x += el.xs * step\n cards[el.index].y += el.ys * step\n })\n mainCard.x += takeCardToMove.xs * step\n mainCard.y += takeCardToMove.ys * step\n let mov = window.requestAnimationFrame(updatePosition)\n\n if ( cards[cardsToMove[0].index].y > fpoint.y ) {\n window.cancelAnimationFrame(mov)\n rectToDraw = []\n let takenToGive = {\n takenCard: null,\n takedCards: []\n }\n clickedCardIndex.forEach(index => {\n cards[index].state = 'taked'\n })\n takenToGive.takedCards = cards.filter(el =>{\n return el.state == 'taked'\n })\n table.cards = table.cards.filter(el => {\n return el.state == 'table'\n })\n takenToGive.takenCard = table.cardTakePosition.splice(0, 1)[0]\n\n // passo la presa al giocatore\n player.taken.push(takenToGive)\n console.log(player)\n }\n }", "title": "" }, { "docid": "8fcefc7cbe6cd19709838978051026c0", "score": "0.58112717", "text": "function drawPlayer() {\n\n\t\tctx.fillStyle = '#EEE';\n\t\tctx.beginPath();\n\t\tctx.arc(player.x, player.y, player.radius, 0, Math.PI * 2, false);\n\t\tctx.fill();\n\t\tctx.closePath();\n\t\tctx.stroke();\n\n\t\t// gun\n\t\tctx.beginPath();\n\t\tctx.arc(gun.x, gun.y, gun.radius, 0, Math.PI * 2, false);\n\t\tctx.fill();\n\t\tctx.closePath();\n\t\tctx.stroke();\n\t}", "title": "" }, { "docid": "a0e87809b6671be92d076d314c5aa718", "score": "0.58111286", "text": "function drawPlayer1Wins() {\n var canvas = document.getElementById(\"gameBoard\");\n var ctx = canvas.getContext(\"2d\");\n ctx.font = \"100px Copperplate\";\n ctx.fillStyle = \"MediumPurple\";\n ctx.strokeStyle = \"purple\";\n ctx.fillText(\"Player One Wins!!!!\", 45, 175);\n ctx.strokeText(\"Player One Wins!!!!\", 45, 175);\n}", "title": "" }, { "docid": "b17de30e94b4fe017b1dd39292e14c3d", "score": "0.58098555", "text": "mark_side2move() {\n\tif(this.is_white2move()) {\n\t document.getElementById(\"id_white2move\").innerHTML =\n\t\t\"<table><tr align=\\\"right\\\" valign=\\\"center\\\"><td valign=\\\"center\\\" style=\\\"font-size:\" +\n\t\tV.getFontSize() + \";\\\">\" + V.WHO2MOVE_POINTER + \"</td><td valign=\\\"center\\\">1</td></tr></table>\";\n\t document.getElementById(\"id_black2move\").innerHTML = \"8\";\n\t} else {\n\t document.getElementById(\"id_white2move\").innerHTML = \"1\";\n\t document.getElementById(\"id_black2move\").innerHTML =\n\t\t\"<table><tr align=\\\"right\\\" valign=\\\"center\\\"><td valign=\\\"center\\\" style=\\\"font-size:\" +\n\t\tV.getFontSize() + \";\\\">\" + V.WHO2MOVE_POINTER + \"</td><td valign=\\\"center\\\">8</td></tr></table>\";\n\t}\n }", "title": "" }, { "docid": "6abb3329e826e700aad988a8c1da5654", "score": "0.5807823", "text": "function drawBoard() {\n let html = \"\";\n\n for (i = 0; i < 4; i++) {\n for (j = 0; j < 4; j++) {\n if (boardGame[i][j] === null) {\n html +=\n '<div id=\"' +\n i +\n \"-\" +\n j +\n '\"' +\n ' class=\"board-position grey\"' +\n 'data-x=\"' +\n i +\n '\"' +\n ' data-y=\"' +\n j +\n '\"></div>';\n } else {\n html +=\n '<div id=\"' +\n i +\n \"-\" +\n j +\n '\"' +\n ' class=\"board-position player ' +\n boardGame[i][j].slice(0, 5) +\n '\" ' +\n 'data-variable=\"' +\n boardGame[i][j] +\n '\" ' +\n 'data-x=\"' +\n i +\n '\"' +\n ' data-y=\"' +\n j +\n '\"' +\n ' data-color=\"' +\n boardGame[i][j].slice(0, 5).toUpperCase() +\n '\"></div>';\n }\n }\n }\n $(\"#boardGame\").html(html);\n\n setClickHandlers();\n setUpdateHandlers();\n defineMode();\n}", "title": "" }, { "docid": "8cd1262ed7fefffa73e3596656c37f8d", "score": "0.5801688", "text": "function move() {\n var left = player.offsetLeft;\n var top = player.offsetTop;\n\n if (downPressed) {\n setPlayerDirection(\"down\");\n top = top + 1;\n }\n\n if (upPressed) {\n setPlayerDirection(\"up\");\n top = top - 1;\n }\n\n if (leftPressed) {\n setPlayerDirection(\"left\");\n left = left - 1;\n }\n\n if (rightPressed) {\n setPlayerDirection(\"right\");\n left = left + 1;\n }\n\n //to get the elements at the coordinates from where the player will move //\n //the corners of the players is checked to avoid collision on all four sides//\n var playerTopLeft = document.elementFromPoint(left, top);\n var playerTopRight = document.elementFromPoint(left + 32, top);\n var playerBottomLeft = document.elementFromPoint(left, top + 48);\n var playerBottomRight = document.elementFromPoint(left + 32, top + 48);\n\n //The class \"blocking\" is used such that the player doesnt move when it collides with a obstacle //\n //The player can only be moved to \"top\" and \"left\" position when its stopped by an obstacle//\n if (\n !playerTopLeft.classList.contains(\"blocking\") &&\n !playerTopRight.classList.contains(\"blocking\") &&\n !playerBottomLeft.classList.contains(\"blocking\") &&\n !playerBottomRight.classList.contains(\"blocking\")\n ) {\n player.style.left = left + \"px\";\n player.style.top = top + \"px\";\n }\n// the \"spaceBarPressed\" class is added so that when the spacebar is clicked it fires an arrow //\n if (spaceBarPressed) {\n spaceBarPressed = false;\n player.classList.add(\"fire\");\n var arrow = createArrow(playerDirection, left, top);\n playerArrows.appendChild(arrow);\n }\n //This part shows whether the player moves when they are pressed with their respective keys//\n else if (leftPressed || rightPressed || upPressed || downPressed) {\n player.classList.add(\"walk\");\n player.classList.remove(\"stand\");\n } \n //Otherwise, when no keys are pressed the player is made to stand still//\n else {\n player.classList.add(\"stand\");\n player.classList.remove(\"walk\");\n player.classList.remove(\"fire\");\n }\n\n moveArrows();\n}", "title": "" }, { "docid": "a634c76a0c51a10da0bb105e586e6aa4", "score": "0.57986456", "text": "redraw()\n {\n this._context.clearRect(0, 0,this._width, this._height);\n this._context.fillStyle = 'black';\n for (var id in this._enemies) {\n var enemy = this._enemies[id];\n if(enemy.shouldExplode) {\n this.drawExplosion(enemy.position,enemy._radius);\n continue;\n }\n this._context.save();\n enemy.draw(this._context);\n this._context.restore();\n }\n\n for (var id in this._projectiles) {\n var projectile = this._projectiles[id];\n this._context.save();\n projectile.draw(this._context);\n this._context.restore();\n }\n this._context.save();\n if(this.player.shouldExplode)\n this.drawExplosion(this.player.position,this.player._radius);\n else if(this.player.blink) {\n if(this.frame === 0)\n this.player.draw(this._context, this.player.position.x, this.player.position.y, this.player.a);\n this.frame += 1;\n this.frame %= 15;\n } else\n this.player.draw(this._context, this.player.position.x, this.player.position.y, this.player.a);\n for (let i=0; i< this.player._lives; i++){\n this.player.draw(this._context, SHIP_SIZE + i * SHIP_SIZE * 1.2, SHIP_SIZE, 0.5 * Math.PI, \"white\");\n }\n\n for (let id in this._asteroids) {\n let asteroid = this._asteroids[id];\n if(asteroid.shouldExplode) {\n this.drawExplosion(asteroid.position,asteroid._radius);\n } else\n asteroid.draw(this._context);\n }\n\n this._context.restore();\n }", "title": "" }, { "docid": "26b4be91917a016f2c11c2cd6523f625", "score": "0.5798601", "text": "draw()\n {\n this.ctx.clearRect(0,0,innerWidth,innerHeight/2);\n if(this.graphpoint[0] > innerWidth)\n {\n this.ctx.clearRect(0,0,innerWidth,innerHeight);\n this.graphpoint[0] = 0\n }\n this.ctx.fillStyle = \"#FFFFFF\";// color the player to red\n this.ctx.fillRect(this.graphpoint[0], this.graphpoint[1], 2, 2);\t//draw player\n this.player.draw(this.ctx);// draw the player\n this.goal.draw(this.ctx,this.player.goalHit(this.goal.Position,this.goal.Size)); \n this.ground.draw(this.ctx); \n\n console.log(this.graphpoint[0] );\n console.log(innerWidth);\n\n \n if(this.player.envelope === 0)\n {\n this.ctx.fillStyle = \"#FFFFFF\";// color the player to white\n }\n if(this.player.envelope === 1)\n {\n this.ctx.fillStyle = \"#FF0000\";// color the player to red\n }\n if(this.player.envelope === 2)\n {\n this.ctx.fillStyle = \"#FFF000\";// color the player to yellow\n }\n this.ctx.fillRect(this.graphpoint[0], this.graphpoint[1], 2, 2);\t//draw player\n\n }", "title": "" }, { "docid": "b13c3c482d46ecf05286d1cb24ab0719", "score": "0.57923853", "text": "function moveToken(total){\n\n // The token we wish to move\n //let token = document.querySelector('#' + document.body.getAttribute('turn') + 'token')\n let token = document.querySelector('#board > .token[player=\"' + turn + '\"]')\n\n // The position the token is currently at\n let startPosition = parseInt(token.getAttribute('position'))\n\n // The place we wish the token to end up\n // Note - adding a negative number will subtract it. Therefore we want to\n // add it regardless of whether it's positive or negative\n let endPosition = startPosition + total\n\n // If the end position is less than 39 (so not passing Go), set the token's position attribute to that number. Otherwise set it to the end position minus 40 (so resetting once you pass Go) \n //endPosition <= 39 ? token.setAttribute('position', endPosition) : token.setAttribute('position', endPosition - 40)\n players[turn - 1].position = endPosition \n\n\n // If we're going to jail, do that, otherwise animate the token\n if (endPosition === 30){\n // TODO - we should animate the token even if we're going to jail.\n goToJail(token)\n addToFeed(players[turn-1].name + ' landed on \\'Go To Jail\\'.', 'go-to-jail')\n } else{\n\n let i = startPosition\n\n // Moving backwards\n if (total < 0){\n\n endPosition <= 39 ? token.setAttribute('position', endPosition) : token.setAttribute('position', endPosition - 40)\n\n let myInterval = setInterval(function(){\n \n if (i >= endPosition){\n positionToken(token, i)\n i--\n\n // If we've landed back on Go, we need to reset where we're moving to.\n if (i < 0){\n\n endPosition = 40 + endPosition\n i = 39\n\n }\n\n } else{\n // Once the token has reached where it needs to be, stop the animation\n window.clearInterval(myInterval)\n specialEndPositions(endPosition)\n }\n }, 100)\n\n\n // Moving forwards\n } else{\n\n endPosition <= 39 ? token.setAttribute('position', endPosition) : token.setAttribute('position', endPosition - 40)\n\n\n let myInterval = setInterval(function(){\n if (i <= endPosition){\n \n // The space after 39 is 0, not 40\n if (i === 40){\n positionToken(token, 0)\n } else{\n positionToken(token, i)\n }\n \n i++\n \n // If i is 40, that means we've landed back on 'Go.\n // Reset i and endPosition and give the player £200\n if (i === 41){\n i = 0\n endPosition = endPosition - 40\n players[turn - 1].money += 200\n updatePlayerDetails()\n addToFeed(players[turn - 1].name + ' has passed Go and collected ' + generateMoneyText(200), 'advance')\n }\n }\n \n else{\n // Once the token has reached where it needs to be, stop the animation\n window.clearInterval(myInterval)\n specialEndPositions(endPosition)\n }\n \n \n }, 100)\n }\n\n\n\n \n }\n}", "title": "" }, { "docid": "2c1d818931e2e99f7e04269d1c9570c0", "score": "0.57921135", "text": "function draw() {\n\n //just renders the current avatar number and color\n if (screen == \"avatar\") {\n\n background(240, 240, 240);\n imageMode(CENTER);\n tint(COLORS[currentColor]);\n image(avatars[currentAvatar], width / 2, height / 2, avatars[currentAvatar].width * 4, avatars[currentAvatar].height * 4);\n noTint();\n }\n if (screen == \"game\") {\n //draw a background\n background(roomColor);\n\n //iterate through the players\n for (var playerId in players) {\n if (players.hasOwnProperty(playerId)) {\n\n var p = players[playerId];\n\n //make sure the coordinates are non null since I may have created a player\n //but I may still be waiting for the first update\n if (p.x != null && p.y != null) {\n\n //position and destination are different, move\n if (p.x != p.destinationX || p.y != p.destinationY) {\n\n //a series of vector operations to move toward a point at a linear speed\n\n // create vectors for position and dest.\n var destination = createVector(p.destinationX, p.destinationY);\n var position = createVector(p.x, p.y);\n\n // Calculate the distance between your destination and position\n var distance = destination.dist(position);\n\n // this is where you actually calculate the direction\n // of your target towards your rect. subtraction dx-px, dy-py.\n var delta = destination.sub(position);\n\n // then you're going to normalize that value\n // (normalize sets the length of the vector to 1)\n delta.normalize();\n\n // then you can multiply that vector by the desired speed\n var increment = delta.mult(SPEED * deltaTime / 1000);\n\n /*\n IMPORTANT\n deltaTime The system variable deltaTime contains the time difference between \n the beginning of the previous frame and the beginning of the current frame in milliseconds.\n the speed is not based on the client framerate which can be variable but on the actual time that passes\n between frames. Replace deltaTime with 30 and uncomment the random frameRate at the beginning\n */\n\n //increment the position\n position.add(increment);\n\n //calculate new distance\n var newDistance = position.dist(createVector(p.destinationX, p.destinationY));\n\n //if I got farther than I was originally I overshot so set position to destination\n if (newDistance > distance) {\n p.x = p.destinationX;\n p.y = p.destinationY;\n }\n else {\n p.x = position.x;\n p.y = position.y;\n }\n\n\n }\n\n //draw the avatar\n imageMode(CENTER);\n image(p.avatarGraphics, p.x, p.y, p.avatarGraphics.width * 2, p.avatarGraphics.height * 2);\n\n //check if the player has messages\n if (p.messageTime != null) {\n\n //check if the last message expired\n if (p.messageTime > 0) {\n //draw the message\n fill(COLORS[p.color]);\n textSize(20);\n textAlign(CENTER, BASELINE);\n text(p.message, p.x, p.y - 30);\n //decrease the counter\n p.messageTime -= deltaTime / 1000;\n }\n }\n\n\n }\n\n }\n }\n }\n\n //\n\n}", "title": "" }, { "docid": "904435dc1aae94d68d86e8f7b87ebaf1", "score": "0.57892364", "text": "function animate () {\n // Clear\n context.clearRect(0, 0, canvasWidth, canvasHeight)\n\n // DRAW\n\n // platform\n context.fillStyle = farbePlatform\n context.strokeStyle = farbePlatformRand\n context.lineWidth = breitePlatformRand\n context.beginPath()\n context.arc(platformX, platformY, platformOuterRadius, 0, Math.PI * 2, true)\n context.closePath()\n context.fill()\n context.stroke()\n\n // aiming line\n if (playerSelected) {\n context.strokeStyle = farbeLinie\n context.lineWidth = 3\n context.beginPath()\n context.moveTo(player.x, player.y)\n context.lineTo(powerX, powerY)\n context.closePath()\n context.stroke()\n\n if (zielLinie) {\n context.strokeStyle = farbeZielLinie\n context.lineWidth = 3\n context.beginPath()\n context.moveTo(player.x, player.y)\n let zy = player.y\n let zdy = Math.abs(powerY - player.y)\n if (powerY > player.y) {\n zy -= zdy * 100\n } else {\n zy += zdy * 100\n }\n let zx = player.x\n let zdx = Math.abs(powerX - player.x)\n if (powerX > player.x) {\n zx -= zdx * 100\n } else {\n zx += zdx * 100\n }\n context.lineTo(zx, zy)\n context.closePath()\n context.stroke()\n }\n context.fillStyle = 'rgb(255, 255, 255)'\n context.font = 'normal 20pt Lobster'\n context.fillText('power: ' + power, 10, 560)\n if (playerAngle <= 90 && playerAngle >= -90) {\n context.fillText('angle: ' + playerAngle + '°', 10, 580)\n }\n }\n // boundary check\n if (player.x !== playerOriginalX && player.y !== playerOriginalY) {\n if (player.vX === 0 && player.vY === 0) {\n resetPlayer()\n } else if (player.x + player.radius < 0) {\n resetPlayer()\n } else if (player.x - player.radius > canvasWidth) {\n resetPlayer()\n } else if (player.y + player.radius < 0) {\n resetPlayer()\n } else if (player.y - player.radius > canvasHeight) {\n resetPlayer()\n }\n };\n\n // asteroid\n\n var deadAsteroids = []\n\n var asteroidsLength = asteroids.length\n\n for (var i = 0; i < asteroidsLength; i++) {\n var tmpAsteroid = asteroids[i]\n\n for (var j = i + 1; j < asteroidsLength; j++) {\n var tmpAsteroidB = asteroids[j]\n\n var dX = tmpAsteroidB.x - tmpAsteroid.x\n var dY = tmpAsteroidB.y - tmpAsteroid.y\n var distance = Math.sqrt((dX * dX) + (dY * dY))\n if (distance < tmpAsteroid.radius + tmpAsteroidB.radius) {\n var angle = Math.atan2(dY, dX)\n var sine = Math.sin(angle)\n var cosine = Math.cos(angle)\n // Rotate asteroid position\n var x = 0\n var y = 0\n // Rotate asteroidB position\n var xB = dX * cosine + dY * sine\n var yB = dY * cosine - dX * sine\n // Rotate asteroid velocity\n var vX = tmpAsteroid.vX * cosine + tmpAsteroid.vY * sine\n var vY = tmpAsteroid.vY * cosine - tmpAsteroid.vX * sine\n // Rotate asteroidB velocity\n var vXb = tmpAsteroidB.vX * cosine + tmpAsteroidB.vY * sine\n var vYb = tmpAsteroidB.vY * cosine - tmpAsteroidB.vX * sine\n // Conserve momentum\n var vTotal = vX - vXb\n vX = ((tmpAsteroid.mass - tmpAsteroidB.mass) * vX + 2 * tmpAsteroidB.mass *\n vXb) / (tmpAsteroid.mass + tmpAsteroidB.mass)\n vXb = vTotal + vX\n // Move asteroids apart\n xB = x + (tmpAsteroid.radius + tmpAsteroidB.radius)\n // Rotate asteroid positions back\n tmpAsteroid.x = tmpAsteroid.x + (x * cosine - y * sine)\n tmpAsteroid.y = tmpAsteroid.y + (y * cosine + x * sine)\n tmpAsteroidB.x = tmpAsteroid.x + (xB * cosine - yB * sine)\n tmpAsteroidB.y = tmpAsteroid.y + (yB * cosine + xB * sine)\n // Rotate asteroid velocities back\n tmpAsteroid.vX = vX * cosine - vY * sine\n tmpAsteroid.vY = vY * cosine + vX * sine\n tmpAsteroidB.vX = vXb * cosine - vYb * sine\n tmpAsteroidB.vY = vYb * cosine + vXb * sine\n };\n };\n\n // Calculate new position\n tmpAsteroid.x += tmpAsteroid.vX\n tmpAsteroid.y += tmpAsteroid.vY\n\n // Friction\n if (Math.abs(tmpAsteroid.vX) > 0.1) {\n tmpAsteroid.vX *= tmpAsteroid.friction\n } else {\n tmpAsteroid.vX = 0\n };\n if (Math.abs(tmpAsteroid.vY) > 0.1) {\n tmpAsteroid.vY *= tmpAsteroid.friction\n } else {\n tmpAsteroid.vY = 0\n };\n\n // check if asteroid is off the platform\n if (!tmpAsteroid.player) {\n var dXp = tmpAsteroid.x - platformX\n var dYp = tmpAsteroid.y - platformY\n var distanceP = Math.sqrt((dXp * dXp) + (dYp * dYp))\n if (distanceP > platformOuterRadius) {\n if (tmpAsteroid.radius > 0) {\n tmpAsteroid.radius -= 2\n } else {\n deadAsteroids.push(tmpAsteroid)\n };\n };\n };\n\n if (tmpAsteroid.player) {\n context.fillStyle = farbeSpielerKugel\n } else {\n context.fillStyle = farbeKugeln\n }\n context.beginPath()\n context.arc(tmpAsteroid.x, tmpAsteroid.y, tmpAsteroid.radius, 0, Math.PI * 2, true)\n context.closePath()\n context.fill()\n };\n\n // splice dead asteroids\n var deadAsteroidsLength = deadAsteroids.length\n if (deadAsteroidsLength > 0) {\n for (var di = 0; di < deadAsteroidsLength; di++) {\n var tmpDeadAsteroid = deadAsteroids[di]\n asteroids.splice(asteroids.indexOf(tmpDeadAsteroid), 1)\n };\n };\n\n var remaining = asteroids.length - 1 // Remove player from asteroid count\n uiRemaining.html(remaining)\n if (remaining === 0) {\n // Winner!\n playGame = false\n uiStats.hide()\n uiComplete.show()\n $(window).unbind('mousedown')\n $(window).unbind('mousemove')\n $(window).unbind('mouseup')\n };\n\n if (playGame) {\n // Run the animation loop again in 33 milliseconds\n setTimeout(animate, zeitZurAnimation)\n };\n }", "title": "" }, { "docid": "2577a8adfa767fbb44da698e9b562bef", "score": "0.578667", "text": "function Draw() {\n\tcanvas.width = canvas.width; //clean board\n\tlblScore.value = score;\n\tlblTime.value = (timeLimit - time_elapsed).toPrecision(5);\n\tif (lblTime.value < 0){\n\t\tlblTime.value = 0.000;\n\t}\n\tlblLife.value = life;\n\tlblUser.value = currLogged;\n\tvar toDelete = 0;\n\tfor (var i = 0; i < 10; i++) {\n\t\tfor (var j = 0; j < 10; j++) {\n\t\t\tvar center = new Object();\n\t\t\tcenter.x = i * 60 + 30;\n\t\t\tcenter.y = j * 60 + 30;\n\t\t\tif (board[i][j] == 2) {\n\t\t\t\tif (dirPacman == \"up\"){\n\t\t\t\t\tdrawDirectedPacman(1.65, 1.35, center.x, center.y, -15, -5);\n\t\t\t\t}\n\t\t\t\telse if (dirPacman == \"down\"){\n\t\t\t\t\tdrawDirectedPacman(0.65, 0.35, center.x, center.y, 15, 5);\n\t\t\t\t}\n\t\t\t\telse if (dirPacman == \"left\"){\n\t\t\t\t\tdrawDirectedPacman(1.15, 0.85, center.x, center.y, -5, -15);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tdrawDirectedPacman(0.15, 1.85, center.x, center.y, 5, -15);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else if (board[i][j] == 5) {\n\t\t\t\tdrawCircles(center.x, center.y, 0, 0, color5, 5);\n\t\t\t\ttoDelete++;\n\n\t\t\t} else if (board[i][j] == 15) {\n\t\t\t\tdrawCircles(center.x, center.y, 0, 0, color15, 10);\n\t\t\t\ttoDelete++;\n\n\t\t\t} else if (board[i][j] == 25) {\n\t\t\t\tdrawCircles(center.x, center.y, 0, 0, color25, 15);\n\t\t\t\ttoDelete++;\n\n\t\t\t} else if (board[i][j] == 1) {\n\t\t\t\tcontext.beginPath();\n\t\t\t\tcontext.rect(center.x - 30, center.y - 30, 60, 60);\n\t\t\t\tcontext.fillStyle = \"black\";\n\t\t\t\tcontext.fill();\n\t\t\t}\n\n\t\t\tif (isMovingEaten == false) {\n\t\t\t\tcontext.drawImage(movingScoreImage, movingScore.i*60, movingScore.j*60, 60, 60);\t\t\n\t\t\t}\n\n\t\t\tfor (var k = 0; k < numOfMonsters; k++){\n\t\t\t\tcontext.drawImage(monsters[k].monsterImage, monsters[k].i*60, monsters[k].j*60, 60, 60);\n\t\t\t}\n\t\t}\n\t}\n\n\t// the clock appear to few moments and than disappear\n\tif (clockIterator % 13 > 11 && isClockEaten == false){\n\t\tdrawClock();\n\t}\n\telse{\n\t\tclockCell = undefined;\n\t\tif (clockIterator % 13 < 11){\n\t\t\tisClockEaten = false;\n\t\t}\n\t}\n\tclockIterator += 0.1;\n\n\t// the pill appear to few moments and than disappear.\n\t// if the pacman eat the pill, there will be no more pills\n\tif (pillIterator % 15 > 12 && isPillEaten == false){\n\t\tdrawPill();\n\t}\n\tpillIterator += 0.1;\n}", "title": "" }, { "docid": "233a77a341b347742abf5918ed7dd1e2", "score": "0.57842916", "text": "movePawn(pos) {\n console.log('Pawn');\n let newBoard = this.state.board.slice();\n\n if (this.state.board[this.state.moveFrom[0]][this.state.moveFrom[1]].color === 'white' && pos[0] === this.state.moveFrom[0]-1 && pos[1] === this.state.moveFrom[1] && this.state.board[pos[0]][pos[1]].color !== 'black') {\n this.updateBoard(pos);\n } else if (this.state.board[this.state.moveFrom[0]][this.state.moveFrom[1]].color === 'black' && pos[0] === this.state.moveFrom[0]+1 && pos[1] === this.state.moveFrom[1] && this.state.board[pos[0]][pos[1]].color !== 'white') {\n\n this.updateBoard(pos);\n //first move. two spaces up\n } else if (this.state.moveFrom[0] === 6 && this.state.board[this.state.moveFrom[0]][this.state.moveFrom[1]].color === 'white' && pos[0] === this.state.moveFrom[0]-2 && pos[1] === this.state.moveFrom[1] && this.state.board[this.state.moveFrom[0]-1][this.state.moveFrom[1]].occupied === null && this.state.board[pos[0]][pos[1]].color !== 'black') {\n this.updateBoard(pos);\n } else if (this.state.moveFrom[0] === 1 && this.state.board[this.state.moveFrom[0]][this.state.moveFrom[1]].color === 'black' && pos[0] === this.state.moveFrom[0]+2 && pos[1] === this.state.moveFrom[1] && this.state.board[this.state.moveFrom[0]+1][this.state.moveFrom[1]].occupied === null && this.state.board[pos[0]][pos[1]].color !== 'white') {\n this.updateBoard(pos);\n //piece detection. can't take a piece moving forward\n } else if (this.state.board[this.state.moveFrom[0]][this.state.moveFrom[1]].color === 'white'\n && this.state.board[pos[0]][pos[1]].color === 'black' && ((this.state.moveFrom[0]-1 === pos[0] && this.state.moveFrom[1]-1 === pos[1])\n || (this.state.moveFrom[0]-1 === pos[0] && this.state.moveFrom[1]+1 === pos[1]))) {\n this.updateBoard(pos);\n } else if (this.state.board[this.state.moveFrom[0]][this.state.moveFrom[1]].color === 'black'\n && this.state.board[pos[0]][pos[1]].color === 'white' && ((this.state.moveFrom[0]+1 === pos[0] && this.state.moveFrom[1]-1 === pos[1])\n || (this.state.moveFrom[0]+1 === pos[0] && this.state.moveFrom[1]+1 === pos[1]))) {\n this.updateBoard(pos);\n }\n }", "title": "" }, { "docid": "f34b71c4db81384e94562484c0e61e30", "score": "0.5780822", "text": "function drawPossibleMoves_EndRound() {\n if (game.player1Turn) {\n game.player1Turn = false;\n game.player1.canAttack = true;\n possibleMoves(game.player2, gameConstant.PLAYER1);\n } else {\n game.player1Turn = true;\n game.player2.canAttack = true;\n possibleMoves(game.player1, gameConstant.PLAYER2);\n }\n}", "title": "" }, { "docid": "5dbc51523476dfcc928598ec36446b25", "score": "0.5769565", "text": "function animatePaths(){\n // Creating a shallow copy of the gamePath and move it forward by two.\n const tempPath = gamePath.slice(2);\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n drawBoard();\n decorateBoard();\n\n // Differentiate player and gamePath by using different coloration.\n drawPath(path, \"blue\");\n drawPath(tempPath, \"pink\");\n frameCount++;\n}", "title": "" }, { "docid": "14bc0bbcc49960700fc18ab72a870cd3", "score": "0.5766086", "text": "function updateBoard() {\n canvas.width = canvas.width;\n canvas.height = canvas.height;\n var xPos = 0;\n var yPos = 0;\n\n for (var x = 0; x < game.board.layout.length; x++) {\n for (var y = 0; y < game.board.layout[x].length; y++) {\n\n c.strokeRect(xPos, yPos, 80, 80);\n\n\n if (game.board.layout[x][y] == gameConstant.BUSH) {\n c.drawImage(bushImage, xPos, yPos);\n }\n\n if (game.board.layout[x][y] == gameConstant.GUN_BALOON) {\n //create animation here\n c.drawImage(w1, xPos, yPos);\n }\n\n if (game.board.layout[x][y] == gameConstant.GUN_BAT) {\n //create animation here\n c.drawImage(w2, xPos, yPos);\n }\n\n if (game.board.layout[x][y] == gameConstant.GUN_BALL) {\n c.drawImage(w3, xPos, yPos);\n }\n\n if (game.board.layout[x][y] == gameConstant.GUN_BOMB) {\n c.drawImage(w4, xPos, yPos);\n }\n\n if (game.board.layout[x][y] == gameConstant.PLAYER1) {\n c.drawImage(p1, xPos, yPos);\n }\n\n if (game.board.layout[x][y] == gameConstant.PLAYER2) {\n c.drawImage(p2, xPos, yPos);\n }\n\n xPos += 80;\n }\n xPos = 0;\n yPos += 80;\n }\n\n if (game.gameOn == false) {\n var finalText;\n\n if (game.player1.hp <= 0) {\n finalText = \"Player2 Won!\";\n } else {\n finalText = \"Player1 Won!\";\n }\n\n c.clearRect(0, 0, canvas.width, canvas.height);\n c.font = \"bold 30px Comic Sans MS\";\n c.fillStyle = \"#be0000\";\n c.textAlign = \"center\";\n\n\n c.fillText(finalText, canvas.width / 2, canvas.height / 2);\n }\n}", "title": "" }, { "docid": "36d9f6510fb0d981fae0430eb4bd4da6", "score": "0.57640886", "text": "function draw() {\n background(menuBackground);\n gameOver();\n \n if (state === \"mainMenu\"){\n mainMenu();\n }\n\n //Creates player one and the AI, using a timer to set the AI move speed.\n else if (state === \"Solo\"){\n displayGrid(grid, rows, cols);\n playerOne = new Bomb(playerOneX * cellSize, playerOneY * cellSize, rangeUp1);\n playerOne.display();\n bot = new Bomb(playerTwoX * cellSize, playerTwoY * cellSize, rangeUp2);\n bot.display2();\n if (timeToMove){\n computer();\n timeToMove = false;\n }\n else if(millis() > timer + wait){\n timer = millis();\n timeToMove = true;\n keyCode = 32;\n }\n}\n\n //Creates both controllable players.\n else if (state === \"Multi\"){\n displayGrid(grid, rows, cols);\n playerOne = new Bomb(playerOneX * cellSize, playerOneY * cellSize, rangeUp1);\n playerOne.display();\n playerTwo = new Bomb(playerTwoX * cellSize, playerTwoY * cellSize, rangeUp2);\n playerTwo.display2();\n }\n\n //Displays controls on how to play.\n else if (state === \"Options\"){\n fill(\"yellow\");\n textSize(30);\n textFont(\"Algerian\");\n text(\"Player One:\\nWASD, Spacebar Places Bomb\", 175, height/2);\n text(\"Player Two:\\nArrow Keys, Shift Places Bomb\", 175, height/2 + 100);\n }\n\n //Victory message for player 1.\n else if (state === \"P1W\"){\n background(winner);\n fill(\"white\");\n textSize(35);\n textFont(\"Algerian\");\n text(\"Player One Wins! Take that, Player Two!\", 25, height/2 - 150);\n }\n\n //Victory message for player 2 or AI.\n else if (state === \"P2W\"){\n background(winner);\n fill(\"white\");\n textSize(35);\n textFont(\"Algerian\");\n text(\"Player Two Wins! Get good, Player One!\", 25, height/2 - 150);\n }\n}", "title": "" }, { "docid": "7c5dfd2440c8d29578ef9eb222294215", "score": "0.57561976", "text": "resetPlayer1pos(){\n //Set x and y to starting x and y\n this.x = this.xStart;\n this.y = this.yStart;\n }", "title": "" }, { "docid": "21260c8580d5907bfecc7d23a04da506", "score": "0.57544374", "text": "function start(){\n document.getElementById(\"reset\").addEventListener(\"click\", start, false);\n document.getElementById(\"switchColorBlack\").addEventListener(\"click\", switchColorBlack, false);\n document.getElementById(\"switchColorWhite\").addEventListener(\"click\", switchColorWhite, false);\n document.getElementById(\"switchCountFunction\").addEventListener(\"click\", switchCountFunction, false);\n document.getElementById(\"switchPVP\").addEventListener(\"click\", switchPVP, false);\n playerTurn = BLACK;\n\n /*initialize each play square*/ \n for(var i = 1; i <= 64; i++){\n canvas[i] = document.getElementById(i);\n canvas[i].locationValue = 0;\n canvas[i].fill = EMPTY;\n canvas[i].addEventListener(\"mouseover\", mouseOver, false);\n canvas[i].addEventListener(\"mouseout\", mouseOut, false);\n canvas[i].addEventListener(\"mousedown\", mouseDown, false);\n context = canvas[i].getContext(\"2d\");\n context.fillStyle = \"blue\";\n context.fillRect(0,0,46,46);\n if (i == 28 || i == 37){\n context.fillStyle = \"white\";\n context.beginPath();\n context.arc(23, 23, 18, 0, Math.PI * 2);\n context.fill();\n canvas[i].fill = WHITE;\n }\n if (i == 29 || i == 36){\n context.fillStyle = \"black\";\n context.beginPath();\n context.arc(23, 23, 18, 0, Math.PI * 2);\n context.fill();\n canvas[i].fill = BLACK;\n }\n }\n updateScore();\n checkValidMoves();\n if (player2 == BLACK && !PVP){ \n window.setTimeout(computerTurn, 500);\n }\n}", "title": "" }, { "docid": "32f6c605cde194d015aba6ec8de60922", "score": "0.5754384", "text": "function refreshGame() {\n context.clearRect(0, 0, width, height);\n drawGameBoard();\n drawPlayerMoves();\n}", "title": "" }, { "docid": "7d2c74fcd06fb2f6e9e4e4cd6033daca", "score": "0.57495224", "text": "function takeTurn(e){\n const squareArray=Array.from(squares)\n const index=squareArray.indexOf(e.target)\n //Phase one: fill the board w/dots\n if (turn<36){\n if (!squares[index].classList.contains('taken')){\n squares[index].classList.add(currentPlayer,'taken')\n turn+=1\n if (turn%3===0){\n currentPlayer=players[turn%2]\n\n //displayCurrentPlayer.innerHTML=currentPlayer\n if (currentPlayer==='player1'){\n //displayCurrentPlayer.style.color='darkmagenta'\n\n }\n else {\n //displayCurrentPlayer.style.color='gold'\n }\n\n if (currentPlayer==='player2'){\n computerMove()\n }\n }\n }\n }\n\n //phase two: Splatter!\n else{\n if (squares[index].classList.contains(currentPlayer) && !squares[index].classList.contains('splattered')){\n splatter(index,splatterMode,currentPlayer);\n turn+=1;\n currentPlayer=players[(turn+1)%2]\n let gameOver=true;\n for (i=0;i<squares.length;i++){\n\n if (!squares[i].classList.contains('splattered') && squares[i].classList.contains('player2')){\n\n gameOver=false\n }\n }\n if (gameOver)\n {\n //displayCurrentPlayer.style.visibility=\"hidden\"\n displayResult.innerHTML=`${players[(turn)%2]} WINS!!!`\n squares.forEach((square) => {\n square.classList.add('splattered')\n });\n\n }\n else {\n //displayCurrentPlayer.style.color='gold'\n computerMove();\n }\n //displayCurrentPlayer.innerHTML=currentPlayer\n\n\n\n }\n\n }\n }", "title": "" }, { "docid": "55a296c70eb1e04cefe17c0723125284", "score": "0.57480055", "text": "function render() {\n /*\n game.debug.text('Internal grid for debugging (comment out)', 700, 20);\n game.debug.text(grid[0], 700, 32);\n game.debug.text(grid[1], 700, 44);\n game.debug.text(grid[2], 700, 56);\n game.debug.text(grid[3], 700, 68);\n game.debug.text('pointerRow='+pointerRow+': pointerCol='+pointerCol, 700, 1090);\n */ \n \n \n game.debug.text('Welcome to Rock/Paper/Scissors draw 4', 50, 20);\n game.debug.text('Find 2 friends and each of you selects a a type to be, rock/paper/scissors', 50, 32);\n game.debug.text('Use the arrows to navigate to a square and place your mark by hitting the button when its your turn', 50, 45);\n game.debug.text('The first player to draw 4 in a row horizontally/vertically/diagonally wins!', 50, 58);\n game.debug.text('In this game, Rock deletes Scissors, Scissors deletes Paper and Paper deletes rock', 50, 71)\n game.debug.text('A mark with 2 sides around it holding a mark that deletes it, is removed', 50, 84);\n game.debug.text('A mark is safe from deletion if it has at least 2 of the same mark on its side', 50, 97);\n game.debug.text('Good luck!', 50, 110);\n \n\n var player;\n if(playerTurn == 1){player = 'Rock';}\n if(playerTurn == 2){player = 'Scissor';}\n if(playerTurn == 3){player = 'Paper';}\n\n var victoryText;\n if(playerWonType == 'r'){victoryText = 'Rock has won!';}\n if(playerWonType == 's'){victoryText = 'Scissors has won!';}\n if(playerWonType == 'p'){victoryText = 'Paper has won!';}\n \n game.debug.text('Currently players turn: '+player, 675, 132);\n if(playerHasWon){game.debug.text(victoryText, 675, 144);}\n if(noMoveLeft && (playerHasWon == false)){game.debug.text('Draw, no moves left', 675, 144)}\n }", "title": "" }, { "docid": "c3e465b0c6ca9c148273b4de9ba73729", "score": "0.5746399", "text": "function draw_pointers() {\n\n if (this_player && this_player.alive) {\n\n var player_position = this_player.position;\n var goal_area = game_data.map.goal_area;\n\n var player_is = {\n above: Boolean(player_position.y < goal_area.y1 - canvas.height / 4),\n below: Boolean(player_position.y > goal_area.y2 + canvas.height / 4),\n right: Boolean(player_position.x > goal_area.x2 + canvas.width / 4),\n left: Boolean(player_position.x < goal_area.x1 - canvas.width / 4)\n };\n\n\n if (player_is.above || player_is.below || player_is.right || player_is.left) {\n\n ctx.save();\n\n ctx.translate(canvas.width / 2, canvas.height / 2);\n\n var half_image_size = 25 / 2;\n var degrees;\n var x = this_player.radius * 2;\n var y = -1 * half_image_size;\n\n\n //all compound checks before simple checks\n if (player_is.right && player_is.below) {\n degrees = 180 + 45;\n } else if (player_is.right && player_is.above) {\n degrees = 180 - 45;\n } else if (player_is.left && player_is.below) {\n degrees = 0 - 45;\n } else if (player_is.left && player_is.above) {\n degrees = 0 + 45;\n } else if (player_is.right) {\n degrees = 180;\n } else if (player_is.below) {\n degrees = 270;\n } else if (player_is.left) {\n degrees = 0;\n } else if (player_is.above) {\n degrees = 90;\n }\n\n ctx.rotate(degrees * Math.PI / 180);\n\n ctx.drawImage(game_images.pointer, x, y, half_image_size * 2, half_image_size * 2);\n\n ctx.restore();\n }\n }\n}", "title": "" }, { "docid": "0678adbf5cf47d50a2fd2243c707162a", "score": "0.5745938", "text": "function draw2d()\r\n{\r\n\t// !!! Maybe I don't need to set these things every step...\r\n\tthis.originX = 0;\r\n\tthis.originY = 600;\r\n\r\n\tswitch (playState){\r\n\t\tcase 0:\r\n\t\t\t//draw loading screen\r\n\t\t\tbreak;\r\n\t\tcase 1:\r\n\t\t\t//Default Game state\r\n\t\t\t\r\n\t\t\t//Draw background for HUD\r\n\t\t\tctx.fillStyle = '#444400';\r\n\t\t\tctx.fillRect(10, 10, cWidth - 20, 80);\r\n\t\t\r\n\t\t\tctx.fillStyle = 'black';\r\n\t\t\tctx.font = \"15pt Calibri\";\t\t\r\n\t\t\tctx.fillText(\"Gold: \" + player.gold, this.originX + 20, this.originY + 30);\r\n\t\t\tctx.fillText(\"Steel: \" + player.steel, this.originX + 20, this.originY + 50);\t\r\n\t\t\tctx.fillText(\"Plasma: \" + player.plasma, this.originX + 20, this.originY + 70);\t\r\n\t\t\tctx.fillText(\"Antimatter: \" + player.antimatter, this.originX + 20, this.originY + 90);\t\t\t\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase 2: // ??\r\n\t\t\tbreak;\r\n\t\tcase 3: // ??\r\n\t\t\tbreak;\r\n\t}\r\n}", "title": "" }, { "docid": "7b6d1684422103e085f4fa4731975516", "score": "0.5731857", "text": "draw(){\n super.draw();\n let x = this.x - player.x + CTXWIDTH/2;\n //let y = this.y - player.y + CTXHEIGHT/2 - this.height/2 - 20; \n\n ctx.save();\n ctx.fillStyle = 'red';\n let w = 100 * this.hp / this.maxHp;\n if (w < 0) w = 0;\n ctx.fillRect(x-50,this.y-this.height,w, 10);\n ctx.strokeStyle = 'black';\n ctx.strokeRect(x-50,this.y-this.height,100, 10);\n ctx.restore();\n }", "title": "" }, { "docid": "7c3518d91d7e9f2fbbd20968b49841a7", "score": "0.57306695", "text": "function playerPlay() {\n let gameSq = $('.box'); \n // by the click method choose the next position of the player \n gameSq.on('click', function () {\n let sqClicked = $(this).attr('boxID');\n posNew = getCoordinates(sqClicked);\n //new position of the player chosen by mouse click vertically - coordinate X\n for (let i = Math.min(posOld.x, posNew.x); i <= Math.max(posOld.x, posNew.x); i++) {\n let num = getTileIndex(i, posOld.y);\n let tile = $('.box[boxID= ' + num + ']');\n if (tile.hasClass('obstacle')) {\n $(this).css('cursor', 'not-allowed');\n return;\n }\n if (player1Active) {\n if (tile.hasClass('player2')) {\n return;\n }\n } else {\n if (tile.hasClass('player1')) {\n return;\n }\n }\n }\n //check possible new position of the player chosen by mouse click vertically\n for (let i = Math.min(posOld.y, posNew.y); i <= Math.max(posOld.y, posNew.y); i++) {\n let num = getTileIndex(posOld.x, i);\n let tile = $('.box[boxID= ' + num + ']');\n \n // if new tile includes obstacle - don't move\n if (tile.hasClass('obstacle')) {\n $(this).css('cursor', 'not-allowed');\n return;\n }\n // if new tile includes players - don't move\n if (player1Active) {\n if (tile.hasClass('player2')) {\n return;\n }\n } else {\n if (tile.hasClass('player1')) {\n return;\n }\n }\n }\n if (player1Active) {\n if ($(this).hasClass('player1')){\n return;\n }\n }else{\n if ($(this).hasClass('player2')){\n return;\n }\n }\n\n if (move) {\n // check when the player can move maximum 3 tiles (maximumMoves) horizontally or vertically\n if (posNew.y === posOld.y && posNew.x <= posOld.x + maxMoves && posNew.x >= posOld.x - maxMoves\n || posNew.x === posOld.x && posNew.y <= posOld.y + maxMoves && posNew.y >= posOld.y - maxMoves) {\n // check the position X\n for (let i = Math.min(posOld.x, posNew.x); i <= Math.max(posOld.x, posNew.x); i++) {\n console.log(i);\n console.log(posOld.y);\n let num = getTileIndex(i, posOld.y);\n checkWeapon(num);\n }\n // check the position Y\n for (let i = Math.min(posOld.y, posNew.y); i <= Math.max(posOld.y, posNew.y); i++) {\n let num = getTileIndex(posOld.x, i);\n checkWeapon(num);\n }\n // show cards to the field when players move \n extraPoints();\n whoIsActive();\n // if the player moved, his tile lose a class 'active', which is set to opposite player\n if (player1Active) {\n playerPosition = boxPosition('.player2');\n posOld = getCoordinates(playerPosition);\n $('.player1').removeClass('player1').removeClass('active');\n $(this).addClass('player1');\n $('.player2').addClass('active');\n fight(posNew, posOld);\n player1Active = false;\n\n \n } else {\n playerPosition = boxPosition('.player1');\n posOld = getCoordinates(playerPosition);\n $('.player2').removeClass('player2').removeClass('active');\n $(this).addClass('player2');\n $('.player1').addClass('active');\n fight(posNew, posOld);\n player1Active = true;\n }\n }\n }\n });\n}", "title": "" }, { "docid": "25efbf8598d06649cbb51270435f3b28", "score": "0.57302433", "text": "moveAndDraw(){\n const tab = [...this.soccures,...this.shoots,this.starship];\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n tab.forEach( elt => {\n elt.move(this.canvas);\n elt.draw(this.context);\n });\n this.deleteSaucer();\n this.deleteShoots();\n this.raf = window.requestAnimationFrame(this.moveAndDraw);\n }", "title": "" }, { "docid": "06815b6dc4f53b3c63e6dcdc1d4469d1", "score": "0.57270294", "text": "function move_bot()\n{\n //console.log(g_bot.dir); // used for testing\n g_bot.color = colors[g_bot.x][g_bot.y]; // check color of new cell\n // change direction based on color\n if ( (g_bot.color == 'red') || (g_bot.color == 'blue') ) {\n switch(g_bot.dir) {\n case 'north': g_bot.dir = 'east'; break;\n case 'east': g_bot.dir = 'south'; break;\n case 'south': g_bot.dir = 'west'; break;\n case 'west': g_bot.dir = 'north'; break;\n }\n } \n else {\n switch(g_bot.dir) {\n case 'north': g_bot.dir = 'west'; break;\n case 'east': g_bot.dir = 'north'; break;\n case 'south': g_bot.dir = 'east'; break;\n case 'west': g_bot.dir = 'south'; break; \n }\n }\n // change color of current cell\n switch(g_bot.color) {\n case 'black': g_bot.color = 'red'; break;\n case 'red': g_bot.color = 'yellow'; break;\n case 'yellow': g_bot.color = 'blue'; break;\n case 'blue': g_bot.color = 'green'; break;\n case 'green': g_bot.color = 'black'; break;\n }\n fill(color(g_bot.color));\n stroke(color('white'));\n colors[g_bot.x][g_bot.y] = g_bot.color; // update color in array\n let x = 1 + g_bot.x * g_canvas.cell_size;\n let y = 1 + g_bot.y * g_canvas.cell_size;\n let big = g_canvas.cell_size - 1;\n rect(x, y, big, big);\n \n // bot disappears here (covered by cell colors)\n \n // move to next cell\n switch(g_bot.dir) {\n case 'north': g_bot.y -= 1; break;\n case 'east': g_bot.x += 1; break;\n case 'south': g_bot.y += 1; break;\n case 'west': g_bot.x -= 1; break;\n }\n\n // bot reappears here\n draw_bot();\n}", "title": "" }, { "docid": "a33469d9f08d27e0216824114ce941d3", "score": "0.57190233", "text": "function drawReachablePositions(player, position) { // PARAMETERS : player, position\n\n findReachablePositions(player, position); // run function\n\n $(\".reach\").remove(); // delete old reachable positions\n $(\".reach-fight\").remove(); // delete old reachable positions leading to fight\n\n for (var i = 0; i < reachs.length; i++) { // FOR each reachable position\n\n var reach = document.createElement(\"button\"); // create a <button> element\n $(reach).attr(\"id\", \"RE\" + i); // set automatic id\n\n if (reachs[i].fight === 1) { // IF the position is leading to fight\n $(reach).addClass(\"reach-fight\"); // add dedicated class\n } else { // SINON\n $(reach).addClass(\"reach\"); // add normal class\n }\n\n $(\"#SQ\" + reachs[i].position).append(reach); // incorporate element in related square\n }\n\n moving = 1; // enable the onclick effect (user can click to move)\n\n}", "title": "" }, { "docid": "66b2482ffaba7d99737e98afcc271c40", "score": "0.571673", "text": "function movPlayer() {\n // 0 = up, 3 = right, 6 = down, 9 = left\n var tpActivado = false\n //depende de la posicion del personaje se mueve si no esta en borde \n if (personaje.dir === 0) { personaje.x === 0 ? personaje.x : personaje.x-- }\n if (personaje.dir === 3) { personaje.y === mapaColm -1 ? personaje.y : personaje.y++ }\n if (personaje.dir === 6) { personaje.x === mapaRow -1 ? personaje.x : personaje.x++ }\n if (personaje.dir === 9) { personaje.y === 0 ? personaje.y : personaje.y-- }\n if (personaje.x === tp.x && personaje.y === tp.y && tpActivado === false){\n personaje.x = tp.xtp\n personaje.y = tp.ytp\n tpActivado = true\n }\n if (personaje.x === tp.xtp && personaje.y === tp.ytp && tpActivado === false){\n personaje.x = tp.x\n personaje.y = tp.y\n tpActivado = true\n }\n}", "title": "" }, { "docid": "5b1e032b54529d7bee608d0bc0fd87d0", "score": "0.57113475", "text": "function drawenemy() {\n var canvas = document.getElementById('myCanvas');\n var context = canvas.getContext('2d');\n context.fillStyle=\"green\";\n context.textAlign = 'center';\n context.font = \"20px monospace\";\n \n for(var i = 0; i < enemy.length; i++) {\n // context.fillText(enemy[i][6]-enemy[i][7],enemy[i][0],enemy[i][1]-enemysize*5);\n context.lineWidth = 1;\n context.save();\n // enemyx= enemyx+1;\n enemy[i][0]=enemy[i][0]+enemy[i][3];\n if( enemy[i][0]>canvas.width){\n enemy[i][0]=1;\n }\n enemy[i][7]=enemy[i][7]+1;\n // context.translate(enemyx,enemyy);\n if(enemy[i][7]>enemy[i][6]){\n enemy[i][7]=0;\n enemy[i][5]=\"red\";\n rndx = (Math.round(Math.random() * canvas.width));\n randangle = (Math.round(Math.random() * 5)+1);\n superenemyspeed = (Math.round(Math.random() * 8)+1);\n superenemies.push([enemy[i][0], enemy[i][1], randangle, superenemyspeed, superenemyspeed, \"red\", minePoints*2]);\n }\n if(enemy[i][7]>0 && enemy[i][7]<enemy[i][6]) {\n enemy[i][5]=\"green\";\n }\n context.strokeStyle = enemy[i][5];\n context.translate(enemy[i][0],enemy[i][1]);\n context.beginPath();\n context.strokeRect(-enemysize, -enemysize, enemysize*2, enemysize*2); \n context.arc(0, 0, enemysize*3, 0, Math.PI * 2, true);\n context.closePath();\n context.stroke();\n context.rotate(enemyrotatedeg * Math.PI / 180);\n// context.translate(0, 0);\n for (var b = 0; b < 2; b++) {\n // context.translate(0, 0);\n context.rotate(45*Math.PI/180)\n context.strokeRect(-enemysize*2.5, -enemysize*2.5, enemysize*5, enemysize*5);\n \n }\n context.restore();\n }\n}", "title": "" }, { "docid": "e12a6fd98cbadbefd57850fafda3d537", "score": "0.57079494", "text": "function playTurn(result){\n\n\t//console.log (\"Turn: \", player1, player2); \n\n\tif (player1) {\n\t\tvar el = document.getElementById(board[player1Pos]);\n\t\tconsole.log (\"Element: \" + el.innerHTML);\n\t\tvar image = document.getElementById('player1');\n\t\tconsole.log (\"SubElement: \" + image);\n\t\tel.removeChild(image);\n\t\tconsole.log (\"Element: \" + el.innerHTML);\n\n//Token stands on tile 30 even when he is \"passing\" it. The image of the token is being saved in local storage when he hits tile 30<\n\t\tplayer1Pos += result;\n\n\t\tif (player1Pos >= 30) {\n\t\t\tplayer1Pos = 30;\n\t\t\tvar img = localStorage.getItem('Img1');\n\t\t\tlocalStorage.setItem('winner', '' + img);\n\t\t}\n\n\t} else {\n\t\tvar el = document.getElementById(board[player2Pos]);\n\t\tconsole.log (\"Element: \" + el.innerHTML);\n\t\tvar image = document.getElementById('player2');\n\t\tconsole.log (\"SubElement: \" + image);\n\t\tel.removeChild(image);\n\t\tconsole.log (\"Element: \" + el.innerHTML);\n\n//Token stands on tile 30 even when he is \"passing\" it. The image of the token is being saved in local storage when he hits tile 30<\n\t\tplayer2Pos += result;\n\n\t\tif (player2Pos >= 30) {\n\t\t\tplayer2Pos = 30;\n\t\t\tvar img2 = localStorage.getItem('Img2');\n\t\t\tlocalStorage.setItem('winner', '' + img2);\n\t\t}\n\t}\n\n\n\n//Here are the traps \n\tsetPlayers(player1Pos, player2Pos);\t\n\n\tif (player1Pos == 12 || player2Pos == 12) {\n\t\tsetTimeout (trap1, 1000);\n\t\t\t\n\t} \n\telse if (player1Pos == 17 || player2Pos == 17) {\n\t\tsetTimeout (trap2, 1000);\n\t\t}\n\telse if (player1Pos == 23 || player2Pos == 23) {\n\t\tsetTimeout (trap3, 1000);\n\t\t}\n\telse if (player1Pos == 28 || player2Pos == 28) {\n\t\tsetTimeout (trap4, 1000);\n\t\t}\n\telse if (player1Pos == 4 || player2Pos == 4) {\n\t\tsetTimeout (trap5, 1000);\n\t\t}\n\telse if (player1Pos == 15 || player2Pos == 15) {\n\t\tsetTimeout (forward1, 1000);\n\t\t}\n\telse if (player1Pos == 5 || player2Pos == 5) {\n\t\tsetTimeout (forward2, 500);\n\t\t}\n\n\n\t\n\n\n//Switch player after one has landed on a trap\t\n\telse {\n\t\t//Sends winner to finalpage when hitting or passing tile number 30\n\t\tif (player1Pos == 30 || player2Pos === 30) {\n\t\t\tsetTimeout (finished, 1000)\n\t\t} else if (result == 6){\n\t\t\t//alert (\"Samme spiller omigjen\");\n\t\t\tif (player1 == true) {\n\t\t\t\tdocument.getElementById(\"whichplayer\").textContent = \"It´s STILL Player 1´s turn!\";\n\t\t\t}else{\n\t\t\t\tdocument.getElementById(\"whichplayer\").textContent = \"It´s STILL Player 2´s turn!\";\n\t\t\t}\n\t\t\t\n\t\t\t\n\n\t\t\t \n\t\t} else {\n\t\t\tswitchPlayer();\t\n\t\t\tdocument.getElementById(\"whichplayer\").style.color =\"white\";\n\t\t}\n\t}\n\t\n}", "title": "" }, { "docid": "5fd12e5233c2befcad4335097b2e24d6", "score": "0.56944156", "text": "function drawBoard() {\n ctx.beginPath();\n ctx.ellipse(board.x + board.width / 6, board.y, board.width / 2, board.height / 2, 0, 0, Math.PI * 2);\n ctx.fillStyle = \"#f7e394\";\n ctx.strokeStyle = \"#804C2A\";\n ctx.fill();\n ctx.stroke();\n ctx.beginPath();\n ctx.ellipse(board.x + board.width / 6, board.y, board.width / 3, board.height / 8 * 3, 0, 0, Math.PI * 2);\n ctx.fillStyle = \"#61001E\";\n ctx.fill();\n ctx.beginPath();\n ctx.ellipse(board.x + board.width / 6, board.y, board.width / 16 * 3, board.height / 12 * 3, 0, 0, Math.PI * 2);\n ctx.fillStyle = \"#f7e394\";\n ctx.fill();\n ctx.beginPath();\n ctx.ellipse(board.x + board.width / 6, board.y, board.width / 12, 15, 0, 0, Math.PI * 2);\n ctx.fillStyle = \"#B80800\";\n ctx.fill();\n ctx.fillStyle = \"#000\";\n\n //board out of screen\n if(board.y >= h || board.y <= 0){\n board.dy *= -1;\n }\n\n\n var checkArrowMoveWithBoard1 = false;\n var checkArrowMoveWithBoard2 = false;\n //board move constantly\n if(autoMove){\n board.y += board.dy;\n if(checkArrowMoveWithBoard1){\n arrow1.moveArrowWithBoard(1);\n }\n else if(checkArrowMoveWithBoard2){\n arrow2.moveArrowWithBoard(1);\n }\n }\n else{\n\n if(boardMove){\n //board move 1 unit\n if(Math.abs(board.y - boardY) > 5){\n board.y += board.dy;\n arrow1.moveArrowWithBoard(1);\n arrow2.moveArrowWithBoard(1);\n }\n }\n else{\n //board not move\n if(Math.abs(board.y - boardY) > 5){\n board.y -= board.dy;\n arrow1.moveArrowWithBoard(-1);\n arrow2.moveArrowWithBoard(-1);\n }\n }\n }\n }", "title": "" }, { "docid": "c4e8c4639cd525472a105a7deeac9020", "score": "0.5690819", "text": "function renderCaptured(cell, player1)\n\t\t{\n\t\t\t// Initialize the drawing style\n\t\t\tvar gradient = context.createLinearGradient(cell.hoverLeft, cell.hoverTop, cell.hoverRight, cell.hoverBottom);\n\t\t\tif (player1)\n\t\t\t{\n\t\t\t\tgradient.addColorStop(0, '#e70a0a');\n\t\t\t\tgradient.addColorStop(1, '#771818');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tgradient.addColorStop(0, '#1db112');\n\t\t\t\tgradient.addColorStop(1, '#0e7a06');\n\t\t\t}\n\t\t\t// Draw a circle using arcs\n\t\t\tcontext.strokeStyle = gradient;\n\t\t\tcontext.lineWidth = lineSize;\n\t\t\tcontext.beginPath();\n\t\t\tif (player1)\n\t\t\t{\n\t\t\t\tcontext.arc(cell.centerX, cell.centerY, cell.radius, 0, 360, false);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcontext.moveTo(cell.hoverLeft, cell.hoverTop);\n\t\t\t\tcontext.lineTo(cell.hoverRight, cell.hoverBottom);\n\t\t\t\tcontext.moveTo(cell.hoverLeft, cell.hoverBottom);\n\t\t\t\tcontext.lineTo(cell.hoverRight, cell.hoverTop);\n\t\t\t}\n\t\t\tcontext.stroke();\n\t\t\tcontext.closePath();\n\t\t}", "title": "" }, { "docid": "3b4ca0c7707dc8130e82cfd892a7eafd", "score": "0.56774396", "text": "function surrounded(){ \n drawSprite(pMan.x, pMan.y - cellWidth * 1.3, blinkyDown)\n drawSprite(pMan.x, pMan.y + cellWidth * 1.3, inkyUp)\n drawSprite(pMan.x + cellWidth * 1.3, pMan.y, clydeLeft)\n drawSprite(pMan.x - cellWidth * 1.3, pMan.y, pinkyRight)\n\n ctx.fillStyle = \"red\";\n ctx.font = \"30px arial\"\n ctx.fillText(\"Try again!\", 10.6 * cellWidth, 15 * cellWidth);\n}", "title": "" }, { "docid": "4a43357c7b2ff9642da56e394db19208", "score": "0.56755805", "text": "function drawPaddles(player){\n ctx.rect(player.x,player.y,player.width,player.height);\n ctx.fillStyle = \"#b2ebf2\";\n ctx.fill();\n}", "title": "" }, { "docid": "9319044db36514090cc9cfce2c4dc383", "score": "0.5675465", "text": "function drawPlayer() {\n ctx.beginPath();\n ctx.fillStyle = \"gold\";\n ctx.arc(playerPoint.x, posistionY - playerRadius, playerRadius, 0, 2 * Math.PI);\n ctx.fill();\n}", "title": "" }, { "docid": "6b355f1417741b76027e812ec71f7c68", "score": "0.56752545", "text": "function playerTurn() {\n if (!winner) {\n // Find element clicked and change it with player name\n var col = this.className;\n var row = this.parentElement.className;\n var col2 = col.split(' ');\n var row2 = row.split(' ');\n var playerCol = col2[1];\n var classOfCol = '.' + playerCol;\n var playerRow = row2[1];\n var classOfRow = '.' + playerRow;\n var elementToChange = gameArea[playerRow].indexOf(playerCol);\n // Check if element has already been played or not\n if (elementToChange != -1) {\n gameArea[playerRow][elementToChange] = currentPlayer;\n // Change of player\n if (currentPlayer === player1) {\n $(classOfRow + ' ' + classOfCol).html(player1Token);\n currentPlayer = player2;\n $('.player2').addClass('your-turn');\n $('.player1').removeClass('your-turn');\n totalMoves++;\n //$('.gamearea').off('click', '.col');\n } else if (currentPlayer === player2) {\n $(classOfRow + ' ' + classOfCol).html(player2Token);\n currentPlayer = player1;\n $('.player1').addClass('your-turn');\n $('.player2').removeClass('your-turn');\n totalMoves++;\n }\n } else {\n alert(\"already played\");\n }\n console.log(fontSize);\n $('.token').css('height', fontSize);\n $('footer').html('<p>' + currentPlayer + ' it\\'s your turn');\n console.log('total moves: ' + totalMoves);\n rowWinner();\n verticalWinner();\n diagonalWinner();\n draw();\n console.log(gameArea);\n\n }\n }", "title": "" }, { "docid": "70786934f09f57c17d8477edb4bc484e", "score": "0.56689006", "text": "function moveToken(tokenNumber)\r\n{\r\n if(turn==='A' && posA[tokenNumber]+roll<=28)\r\n {\r\n let currentPos=posA[tokenNumber];\r\n posA[tokenNumber]+=roll;\r\n if(posA[tokenNumber]===28)\r\n {\r\n winA++;\r\n homeA.innerHTML='HOME<br>'+winA+'A';\r\n if(frequencyA(currentPos)===0)\r\n {\r\n document.getElementById('box'+currentPos).textContent='';\r\n }\r\n else\r\n {\r\n document.getElementById('box'+currentPos).textContent='1A';\r\n }\r\n if(winA===2)\r\n {\r\n turnDisplay.style.background='red';\r\n turnDisplay.textContent=\"A WON\";\r\n }\r\n }\r\n if(document.getElementById('box'+posA[tokenNumber]).textContent ==='1B' && posA[tokenNumber]!=14)\r\n {\r\n lockB++;\r\n displayLocker();\r\n posB=removeElement(posB,posA[tokenNumber]);\r\n }\r\n if(document.getElementById('box'+posA[tokenNumber]).textContent ==='2B' && posA[tokenNumber]!=14)\r\n {\r\n lockB+=2;\r\n displayLocker();\r\n posB=removeElement(posB,posA[tokenNumber]);\r\n }\r\n if(frequencyA(currentPos)===0)\r\n {\r\n document.getElementById('box'+currentPos).textContent='';\r\n }\r\n else\r\n {\r\n document.getElementById('box'+currentPos).textContent='1A';\r\n }\r\n\r\n if(frequencyA(posA[tokenNumber])===2)\r\n {\r\n document.getElementById('box'+posA[tokenNumber]).textContent='2A';\r\n }\r\n else\r\n {\r\n document.getElementById('box'+posA[tokenNumber]).textContent='1A';\r\n }\r\n //check check if next box is singly or doubly occupied\r\n }\r\n else\r\n {\r\n if(!(posB[tokenNumber]+roll>14 && posB[tokenNumber]<=14))\r\n {\r\n //check if current box is singly or doubly occupied\r\n let currentPos=posB[tokenNumber];\r\n posB[tokenNumber]+=roll;\r\n posB[tokenNumber]=posB[tokenNumber]>28 ? (posB[tokenNumber]-28) : posB[tokenNumber];\r\n if(posB[tokenNumber]===14)\r\n {\r\n winB++;\r\n homeB.innerHTML='HOME<br>'+winB+'B';\r\n if(frequencyB(currentPos)===0)\r\n {\r\n document.getElementById('box'+currentPos).textContent='';\r\n }\r\n else\r\n {\r\n document.getElementById('box'+currentPos).textContent='1B';\r\n }\r\n if(winB===2)\r\n {\r\n turnDisplay.style.background='blue';\r\n turnDisplay.textContent=\"B WON\";\r\n }\r\n }\r\n if(document.getElementById('box'+posB[tokenNumber]).textContent ==='1A' && posB[tokenNumber]!=28)\r\n {\r\n lockA+=1;\r\n displayLocker();\r\n posA=removeElement(posA,posB[tokenNumber]);\r\n }\r\n if(document.getElementById('box'+posB[tokenNumber]).textContent ==='2A' && posB[tokenNumber]!=28)\r\n {\r\n lockA+=2;\r\n displayLocker();\r\n posA=removeElement(posA,posB[tokenNumber]);\r\n }\r\n if(frequencyB(currentPos)===0)\r\n {\r\n document.getElementById('box'+currentPos).textContent='';\r\n }\r\n else\r\n {\r\n document.getElementById('box'+currentPos).textContent='1B';\r\n }\r\n //check if current box is singly or doubly occupied ends\r\n\r\n //check if next box is singly or doubly occupied\r\n if(frequencyB(posB[tokenNumber])===2)\r\n {\r\n document.getElementById('box'+posB[tokenNumber]).textContent='2B';\r\n }\r\n else\r\n {\r\n document.getElementById('box'+posB[tokenNumber]).textContent='1B';\r\n }\r\n //check check if next box is singly or doubly occupied\r\n }\r\n }\r\n\r\n if(winA===2 || winB===2)\r\n winDisplay();\r\n}", "title": "" }, { "docid": "2a6678a467c7da934c9d48b2d5feface", "score": "0.5668273", "text": "function makeMove() {\n // Temporary variable for the player moving.\n let currentPlayer;\n let nextPlayer;\n // Record the space's row and column.\n const spaceValue = {\n row: this.dataset.space[0],\n col: this.dataset.space[1],\n };\n\n // Increment the turn one higher.\n turn += 1;\n\n // Update the instructions area.\n updateIntro(turn);\n\n // Check which player has played based on number of turns.\n if ((turn % 2) !== 0) {\n currentPlayer = player1;\n nextPlayer = player2;\n } else {\n currentPlayer = player2;\n nextPlayer = player1;\n }\n\n // Add the space played to the player's moves array.\n currentPlayer.moves.push(spaceValue);\n\n // Add the player's symbol to the space played.\n this.textContent = currentPlayer.symbol.toUpperCase();\n\n // Disable the space once played.\n this.setAttribute('disabled', 'true');\n\n // Check if the player has won.\n winCheck(currentPlayer, currentPlayer.moves);\n\n if (turn === spaces.length && !winner) {\n // If the player has not won and all spaces are filled, declare game over\n // and hide the turn message.\n gameOver();\n } else if (!winner) {\n // If the player has not won, set the turn message to the next player.\n turnMsg.textContent = `Player ${nextPlayer.name} (${nextPlayer.symbol}), it's your turn.`;\n }\n}", "title": "" }, { "docid": "a7723e9f8252b0bcab62549276536433", "score": "0.566363", "text": "function turn(squareId, player) {\n\torigBoard[squareId] = player;\n\tdocument.getElementById(squareId).innerText = player;\n\tdocument.getElementById(squareId).style.color = player == Player1.mark ? \"#2ecc71\" : \"#e74c3c\";\n\tcountOfelm();\n\tlet gameWon = checkWin(origBoard, player);\n\tlet gameDraw = checkDraw();\n\tif(gameWon) gameEnd(gameWon);\n}", "title": "" }, { "docid": "851abedf732834392aaa7066f66a127a", "score": "0.5655403", "text": "function drawNext(){\n nextContext.fillStyle = '#000';\n nextContext.fillRect(0, 0, nextCanvas.width, nextCanvas.height);\n drawMatrix(nextArena, {x: 0, y:0}, nextContext);\n drawMatrix(player.next, {x: 1, y: 1}, nextContext);\n}", "title": "" }, { "docid": "33aff09a0a914918d2e97c49e59f092d", "score": "0.5654753", "text": "function drawCurrentPiece(){\n\tcontext.strokeStyle = '#000000';\n\tcontext.fillStyle = hexColors[currentColor];\n\tcontext.lineWidth = 1;\n\tvar w = boardSquareWidth; //width of one tile\n\tvar x = currentPiece.tlX;\n\tvar y = currentPiece.tlY;\n\t//clear any previous pieces\n\t//max width (5w) and height (5w) of any piece (flipped/rotated)\n\t//accounting for half pixel stroke along the border\n\t//draw piece\n\tfor (var i = 0; i < currentPiece.boardRep.length; i++){\n\t\tfor (var j = 0; j < currentPiece.boardRep[0].length; j++){\n\t\t\tif (currentPiece.boardRep[i][j] !== 0){\n\t\t\t\tcontext.fillRect(x + i*w, y + j*w, w, w);\n\t\t\t\tcontext.strokeRect(x + i*w, y + j*w, w, w);\n\t\t\t}\n\t\t}\n\t}\n\t//set piece width/height\n\tcurrentPiece.w = i*w;\n\tcurrentPiece.h = j*w;\n}", "title": "" }, { "docid": "4665f8e52c2547f8f0fe115bbd899eea", "score": "0.5653704", "text": "function draw(){\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n animate();\n drawPlayer();\n //Up and left\n if (direction[38] && direction[37]) {\n if (pY > pR && pX > pR) {\n pY -= pDy;\n pX -= pDx;\n }\n }\n //Down and left\n else if (direction[40] && direction[37]) {\n if (pY < canvas.height - pR && pX > pR) {\n pY += pDy;\n pX -= pDx;\n }\n }\n //Up and right\n else if (direction[38] && direction[39]) {\n if (pY > pR && pX < canvas.width - pR) {\n pY -= pDy;\n pX += pDx;\n }\n }\n //Down and right\n else if (direction[40] && direction[39]) {\n if (pY < canvas.height - pR && pX < canvas.width - pR) {\n pY += pDy;\n pX += pDx;\n }\n }\n //Up\n else if (direction[38]) {\n if (pY > pR) {\n pY -= pDy;\n }\n }\n //Down\n else if (direction[40]) {\n if (pY < canvas.height - pR) {\n pY += pDy;\n }\n }\n //Left\n else if (direction[37]) {\n if (pX > pR) {\n pX -= pDx;\n }\n }\n //Right\n else if (direction[39]) {\n if (pX < canvas.width - pR) {\n pX += pDx;\n }\n }\n\n window.requestAnimationFrame(draw);\n}", "title": "" }, { "docid": "9f0b096d2fa2415a305f7aa1f2177af8", "score": "0.5649519", "text": "function drawRespawnScreen() {\n\t\tframeCount += 1;\n\t\tif (frameCount < (30 * 2)/3) {\n\t\t\tplayer.drawExplosion(context);\n\t\t context.font = \"bold 50px sans-serif\";\n\t\t\tcontext.font = \"bold 50px sans-serif\";\n\t\t\tcontext.fillText(\"3\", canvas.width / 2.5, canvas.height / 2);\n\t\t}\n\t\telse if (frameCount >= (30 * 2)/3 && frameCount < (30 * 4)/3 ) {\n\t\t\tcontext.font = \"bold 50px sans-serif\";\n\t\t\tcontext.font = \"bold 50px sans-serif\";\n\t\t\tcontext.fillText(\"2\", canvas.width / 2.5, canvas.height / 2);\n\t\t\t}\n\t\telse if (frameCount >= (30 * 4)/3 && frameCount <= (30 * 6)/3 ) {\n\t\t\tcontext.font = \"bold 50px sans-serif\";\n\t\t\tcontext.font = \"bold 50px sans-serif\";\n\t\t\tcontext.fillText(\"1\", canvas.width / 2.5, canvas.height / 2);\n\t\t\t}\n\t\telse {\n\t\t context.font = \"bold 50px sans-serif\";\n\t\t\tcontext.font = \"bold 50px sans-serif\";\n\t\t\tcontext.fillText(\"GO!\", canvas.width / 2.5, canvas.height / 2);\n\t\t}\n\t}", "title": "" }, { "docid": "073ba848b2df39a4073a7bb6b9f0300a", "score": "0.5645788", "text": "function move (player, direction, canvId) {\n\n\n // SCENE 1: Start\n\n if (canvId == 'startCanvas') {\n\n switch (direction) {\n // Left\n case 37:\n if (player.x > 360 && player.x < 400 && player.y < 140) { // Stay within vertical sidewalk\n player.x -= 10;\n } else if (player.x > -10 && player.y > 130) { // Stay within horizontal sidewalk\n player.x -= 10;\n }\n break;\n\n // Up\n case 38:\n if (player.y > 140 || (player.x > 350 && player.x < 400 && player.y > 30)) {\n player.y -= 10;\n }\n break;\n\n // Right\n case 39:\n if (player.x > 350 && player.x < 390 && player.y < 140) { // Stay within vertical sidewalk\n player.x += 10;\n } else if (player.x < 710 && player.y > 130) { // Stay within horizontal sidewalk\n player.x += 10;\n }\n break;\n\n // Down\n case 40:\n if (player.y < 170) {\n player.y += 10;\n }\n break;\n\n default:\n break;\n }\n } \n\n // SCENE 2: Aha!\n\n else if (canvId == 'ahaCanvas') {\n\n switch (direction) {\n // Left\n case 37:\n player.x -= 5;\n break;\n\n // Up\n case 38:\n player.y -= 5;\n break;\n\n // Right\n case 39:\n player.x += 5;\n break;\n\n // Down\n case 40:\n player.y += 5;\n break;\n\n default:\n break;\n }\n } \n\n // SCENE 3: Gap\n\n else if (canvId == 'gapCanvas') {\n\n switch (direction) {\n // Left\n case 37:\n player.x -= 5;\n break;\n\n // Up\n case 38:\n player.y -= 5;\n break;\n\n // Right\n case 39:\n player.x += 5;\n break;\n\n // Down\n case 40:\n player.y += 5;\n break;\n\n default:\n break;\n }\n } \n\n // SCENE 4: Survey\n\n else if (canvId == 'survCanvas') {\n\n switch (direction) {\n // Left\n case 37:\n player.x -= 5;\n break;\n\n // Up\n case 38:\n player.y -= 5;\n break;\n\n // Right\n case 39:\n player.x += 5;\n break;\n\n // Down\n case 40:\n player.y += 5;\n break;\n\n default:\n break;\n }\n } \n\n // SCENE 5: Interest\n\n else if (canvId == 'interCanvas') {\n\n switch (direction) {\n // Left\n case 37:\n player.x -= 5;\n break;\n\n // Up\n case 38:\n player.y -= 5;\n break;\n\n // Right\n case 39:\n player.x += 5;\n break;\n\n // Down\n case 40:\n player.y += 5;\n break;\n\n default:\n break;\n }\n } \n\n // SCENE 6: Elevator\n\n else if (canvId == 'elevCanvas') {\n\n switch (direction) {\n // Left\n case 37:\n player.x -= 5;\n break;\n\n // Up\n case 38:\n player.y -= 5;\n break;\n\n // Right\n case 39:\n player.x += 5;\n break;\n\n // Down\n case 40:\n player.y += 5;\n break;\n\n default:\n break;\n }\n } \n\n // Scene 7: End\n\n else {\n\n switch (direction) {\n // Left\n case 37:\n player.x -= 5;\n break;\n\n // Up\n case 38:\n player.y -= 5;\n break;\n\n // Right\n case 39:\n player.x += 5;\n break;\n\n // Down\n case 40:\n player.y += 5;\n break;\n\n default:\n break;\n }\n }\n}", "title": "" }, { "docid": "5ea51387c2a8cd3cf793a156fe96f2b4", "score": "0.56454206", "text": "paintPlayer() {\n // ^ It's so funny, I was running through different ways of efficiently clear the old player position visually. None of the\n // ^ bitwise operation approaches seemed to be a good option because the paint timing would be tricky with the brick paint timing.\n // ^ Then I remembered I was using the DOM and denoting the player visually via an attribute ... so I could just query and remove it :P\n // ! Note that if we do a player size greater than 1 brick we'll need to change this a bit.\n this.clearPlayer()\n const targetRow = this.gridElement.children[this.player.rowIndex]\n targetRow.children[targetRow.childElementCount - Math.log(this.player.columnState) / Math.log(2) - 1].setAttribute(\n 'paint-player',\n true\n )\n }", "title": "" }, { "docid": "3cf8613ef41e4bcdc9aff281cdcebee3", "score": "0.56418717", "text": "function update() {\n if ((!playing && ic.spacePressed()) || (gameOver && ic.spacePressed())) {\n pts1 = generatePoints(1, 10, canvas.height / 2);\n pts2 = generatePoints(2, 10, pts1[pts1.length - 1].y);\n pts3 = generatePoints(3, 10, pts2[pts2.length - 1].y);\n playerPoint = pts1[Math.floor(pts1.length / 3)];\n playing = true;\n gameOver = false;\n score = 0;\n }\n\n if (playing && !gameOver) {\n updateScore();\n updatePlayer();\n updateHills();\n updateObstacles();\n collision();\n }\n}", "title": "" }, { "docid": "f5a83fd26386ccf0fe7ac35004f7f02c", "score": "0.56358576", "text": "function Drawspaceship() {\n\tctx.fillStyle=\"black\"\n\tctx.fillRect(x,y,50,50)\n}", "title": "" }, { "docid": "e744e8b45b7f4b80cc416c2165fa9d8b", "score": "0.56323016", "text": "function nextMove() \n {\n var newMove = GenerateRandomNumber(6);\n alert(\"You got : \" + newMove);\n _currentPos = _currentPos + newMove;\n\n switch (_currentPos) \n {\n //ladder\n case 3:\n _currentPos = 21;\n break;\n //ladder\n case 54:\n _currentPos = 88;\n break;\n //Ladder\n case 87:\n _currentPos = 98;\n break;\n //snake\n case 99:\n _currentPos = 35;\n break;\n //snake\n case 19:\n _currentPos = 2;\n break; \n //snake\n case 39:\n _currentPos = 13;\n break; \n }\n\n var coorintaes = squares[_currentPos];\n coorintaes = coorintaes.split(',');\n\n // context.fillRect(coorintaes[0], coorintaes[1], squareSize, squareSize);\n \n var imgp= new Image();\n imgp.src='Images/pawn.png';\n \n context.drawImage(imgp,coorintaes[0], coorintaes[1], squareSize, squareSize)\n if (_currentPos == 100)\n {\n alert(\"Congratulations, you have won the game :)\");\n initGame();\n }\n }", "title": "" }, { "docid": "0a475ed6e0a00890415d321c7ac5c239", "score": "0.5628804", "text": "function drawPlayerMoves() {\n for (var i = 0; i <= 2; i++) {\n for (var j = 0; j <= 2; j++) {\n //var boardstate\n var cell = boardState[i][j];\n if (cell == 1) {\n drawX(i, j);\n \n } else if (cell == 2) {\n drawCircle(i, j);\n }\n }\n }\n}", "title": "" } ]
19554b78be1ec46707e031882b7c6c06
async function to make http request
[ { "docid": "cd30c6f29d3ab8dfc2decf3d9e349e42", "score": "0.6435239", "text": "async function makeSynchronousRequest(request) {\n try {\n let http_promise = getWordsDB();\n words = await http_promise;\n console.log(words);\n } catch (error) {\n console.log(error);\n }\n}", "title": "" } ]
[ { "docid": "a0951e5e4be459ba24ff12ecbfca27e1", "score": "0.7206276", "text": "async function doRequest(url) {\n return new Promise(function (resolve, reject) {\n request(url, function (error, res, body) {\n if (!error && res.statusCode == 200)\n resolve(body);\n else\n reject(error);\n });\n })\n .catch(function(err) {\n console.log(err);\n });\n}", "title": "" }, { "docid": "87cdd389666b0c8d7ce5d82705d4ba8c", "score": "0.6987037", "text": "async sendHTTPRequest() {\n // console.info(\"sendHTTPRequest ran...\")\n const res = \"\";\n const url = this.getUrl();\n try {\n const response = await axios_1.default.get(url);\n return response.data;\n }\n catch (error) {\n console.error(\"Error at forecast http request!\");\n return \"\";\n }\n // console.debug(url)\n }", "title": "" }, { "docid": "79c29d67bc2ef8e4a9f51c2b3fccda0d", "score": "0.6664534", "text": "async method(){}", "title": "" }, { "docid": "bd3b14f582939d3004e05a71b3102f1d", "score": "0.66020703", "text": "function httpGetAsync(theUrl) {\n return new Promise(resolve => {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {\n resolve(xmlHttp.responseText);\n }\n }\n xmlHttp.open(\"GET\", theUrl, true);\n xmlHttp.send(null);\n });\n }", "title": "" }, { "docid": "9c8727b281d192f024d18778f391a305", "score": "0.65514296", "text": "function httpGetAsync(theUrl)\n{\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.open(\"GET\", theUrl, true); // true for asynchronous\n xmlHttp.send(null);\n}", "title": "" }, { "docid": "06985421912e75e8b1a61a4a785fbcd7", "score": "0.65208215", "text": "function makeGetRequest(url){\n return new Promise(function (resolve,reject){\n let xhr = new XMLHttpRequest();\n xhr.open(\"GET\",url,true);\n xhr.onload = resolve;\n xhr.onerror = reject;\n xhr.send();\n })\n}", "title": "" }, { "docid": "4ce4032fc83e844aefb33e5aa8b15880", "score": "0.6476531", "text": "function myAsync(url){\n return new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n xhr.open('GET', url);\n xhr.onload = () => resolve(xhr.responseText);\n xhr.onerror = () => reject(xhr.statusText);\n xhr.send();\n });\n}", "title": "" }, { "docid": "4e64ce744db68df89b12b0d4bac699fa", "score": "0.6385261", "text": "async function fetchData(){\n const req = api.get\n }", "title": "" }, { "docid": "b227f103c387612152fab33c9424d14d", "score": "0.6377818", "text": "function httpGetAsync(theUrl, callback)\n {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() { \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText);\n }\n xmlHttp.open(\"GET\", theUrl, true); // true for asynchronous \n xmlHttp.send(null);\n }", "title": "" }, { "docid": "d1d0e35b4e8f2202a44f901f0d4b0b44", "score": "0.63692695", "text": "function makeGetRequest (url) {\n return new Promise((resolve, reject) => { // <- for reference this is called the Revealing constructor pattern\n // do async stuff here and call `resolve` when it's completed or `reject` when it fails\n request.get(url, function onComplete (err, response) {\n if (err) {\n // it's an error, we need to reject the promise\n reject(err)\n } else {\n // we have a result, we need to resolve the promise\n resolve(response)\n }\n })\n })\n}", "title": "" }, { "docid": "bef6bb34baaf02e2fca39c3084610bc2", "score": "0.63676953", "text": "async function main() {\n\t// url: string\n\tconst url = await serverUrl(2000);\n\t\n\ttry {\n\t\t// response: Response\n\t\tconst response = await axios.get(url);\n\t\tconsole.log(response.data);\t\n\t} catch(err) {\n\t\tconsole.log('error requesting from server: ' + err.message)\n\t}\n\t\n}", "title": "" }, { "docid": "6f5b8c111aa498671a2741636ff2858b", "score": "0.63473207", "text": "function http(method, url, data){\n var xmlHttp = new XMLHttpRequest();\n var fut = new future();\n xmlHttp.open(method, serverurl+url, true);\n xmlHttp.onreadystatechange = function(){\n if(xmlHttp.readyState == 4 && xmlHttp.status == 200) {\n fut.callsuccess(JSON.parse(xmlHttp.responseText));\n }else if(xmlHttp.readyState == 4 && xmlHttp.status != 200){\n fut.callerror(xmlHttp.responseText);\n }\n }\n xmlHttp.send(JSON.stringify(data));\n return fut;\n }", "title": "" }, { "docid": "4a90ed84812bdf4f21381350d21e1959", "score": "0.6323945", "text": "function HttpGetAsync(query, callback) {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(JSON.parse(xmlHttp.responseText));\n }\n var url = baseurl + user_name + \"@\" + db + \"?key=\" + api_key + \"&q=\" + query;\n\n xmlHttp.open(\"GET\", encodeURI(url), true);\n xmlHttp.send(null);\n}", "title": "" }, { "docid": "4d3eece336a74620d79a287c1a8a689b", "score": "0.63187146", "text": "async function doHttpRequest(url, options = {}) {\n let serverUrl = getServerUrl();\n let response = await fetch(`${serverUrl}/${url}`, options);\n return await response.json();\n}", "title": "" }, { "docid": "cd6d92926a740390a65a356d9cdd2c16", "score": "0.6316499", "text": "function httpGetAsync(theUrl, callback)\n{\n // create the request object\n var xmlHttp = new XMLHttpRequest();\n\n // set the state change callback to capture when the response comes in\n xmlHttp.onreadystatechange = function()\n {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n {\n callback(xmlHttp.responseText);\n }\n }\n\n // open as a GET call, pass in the url and set async = True\n xmlHttp.open(\"GET\", theUrl, true);\n\n // call send with no params as they were passed in on the url string\n xmlHttp.send(null);\n\n return;\n}", "title": "" }, { "docid": "055d720c69e638cff082fd787336d21b", "score": "0.62969935", "text": "async function doWork() {\n try {\n const response = await makeRequest(\"Facebook\"); // create an error by using anything but \"Google\"\n console.log(\"Response Recieved\");\n const processedResponse = await processRequest(response);\n console.log(processedResponse);\n } catch (err) {\n console.log(err);\n }\n}", "title": "" }, { "docid": "7d354fb5e04b2e35183707d81b54194a", "score": "0.62637043", "text": "async function send_req(){\n\n let d1 = new Date();\n let v=Math.random().toString(36).substring(2, 15)+d1.getTime();\n\n performance.clearResourceTimings();\n\n //console.log(npet)\n if(npet==0){\n urlf=\"http://\"+Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15)+\".dnsprivacytester.tlm.unavarra.es/resource.php?t=\";\n }\n\n let urls=urlf+v;\n\n console.log(urls);\n\n let req = new XMLHttpRequest();\n\n if (!req) return false;\n\n if (typeof exito != 'function') exito = function () {};\n error = function () {alert(\"connection error.\");};\n\n req.open(\"GET\", urls, true);\n\n req.onreadystatechange = function(){\n\n if(req.readyState == 4) {\n if(req.status===200) {\n\n console.log()\n\n let p = performance.getEntries();\n let pr=p[p.length-1];\n i=i+1;\n let result=parseFloat(pr['domainLookupEnd']-pr['domainLookupStart']);\n result=result.toFixed(2);\n sendResults(result,urlf);\n }\n }\n }\n req.send();\n\n return false;\n\n}", "title": "" }, { "docid": "c35fce220b64983b46581164beb1e407", "score": "0.6257342", "text": "async function sendRequest(request){\n return fetch(request).then(result => result.json()).then(data => data);\n}", "title": "" }, { "docid": "0ec10d9c668513a7387cac8113ba2911", "score": "0.6256935", "text": "function httpGetAsync(url, callback) {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.readyState == 4) {\n if (xmlHttp.status == 200) {\n callback(xmlHttp.responseText);\n } else {\n callback({err: xmlHttp.statusText})\n }\n\n }\n }\n xmlHttp.open(\"GET\", url, true); // true for asynchronous\n xmlHttp.send(null);\n}", "title": "" }, { "docid": "1dba01c1b0679fa72315a5c173134a49", "score": "0.62292635", "text": "function httpGetLocalAsync(env, args) {\n\t\tvar config = GLang.wrapValueToJsObject(args[1]);\n\t\tvar headers = config.headers || {};\n\t\tvar url = config.url;\n\t\t\n\t\tvar callback = args[0];\n\t\t\n\t\t\n\t\tvar request = new XMLHttpRequest();\n\t\trequest.open(\"GET\", url);\n\t\t\n\t\tfor(var property in headers) {\n\t\t\tconsole.log(property)\n\t\t\trequest.setRequestHeader(property, headers[property]);\t\n\t\t}\n\t\t\n\t\trequest.onreadystatechange = function(event) {\n\t\t\tif (this.readyState == 4) {\n\t\t\t\t//Request is done\n\t\t\t\tGLang.callObject(callback, env, [makeResponseObject(this)])\n\t\t\t}\n\t\t};\n\t\t\n\t\trequest.send();\n\t\treturn GLang.voidValue;\n\t}", "title": "" }, { "docid": "1a4220fe778c23f4b8624a9d37aa2ab3", "score": "0.6218468", "text": "async function fetchUser(){\n // return new Promise((resolve, reject)=>{\n // //do network request in 10secs...\n // resolve('thisis');\n // })\n return 'thsis';\n}", "title": "" }, { "docid": "c3ccf5f76cb90254dc2f066d8ee09884", "score": "0.6218332", "text": "function httpGetAsync(URL, callback)\n{\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() { \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText);\n }\n xmlHttp.open(\"GET\", URL, true);\n xmlHttp.send(null);\n}", "title": "" }, { "docid": "a647baaf4727f33b7d505c620f98e54b", "score": "0.62168545", "text": "function make_API_call(url) {\n return new Promise((resolve, reject) => {\n request(url, { json: true }, (err, res, body) => {\n if (err) reject(err)\n resolve(body)\n });\n })\n}", "title": "" }, { "docid": "c95a4c4ce669a11df007ea78db5ddd38", "score": "0.6204505", "text": "async function doRequest(uri, req, params = {}) {\n let endpoint;\n if (match = uri.match(/api\\/(.*)\\.php/)) {\n endpoint = match[1];\n }\n if (Object.keys(params).length > 0) {\n let query = new URLSearchParams();\n Object.entries(params).forEach(entry => {\n query.append(entry[0], entry[1]);\n });\n uri += '?' + query.toString();\n }\n req.headers || (req.headers = {});\n req.headers['Accept'] = 'application/json';\n\n return fetch(uri, req).then(response => {\n return response.ok ? Promise.resolve(response) : Promise.reject(response);\n }).then(async response => {\n if (response.headers.get('Content-Type').includes('application/json')) {\n data = await response.json();\n if (endpoint) {\n SmartHome.apiListeners.notify([endpoint], data);\n }\n return data;\n } else {\n return response.text();\n }\n });\n}", "title": "" }, { "docid": "c2aef3cda7a39a2e9c7513d9bdb6f269", "score": "0.61907005", "text": "function async_request(method, location, headers, data, callback) {\n var r = new XMLHttpRequest();\n r.open(method, location);\n header_keys = Object.keys(headers);\n for (var i = header_keys.length - 1; i >= 0; i--) {\n r.setRequestHeader(header_keys[i], headers[header_keys[i]]);\n }\n r.onreadystatechange = function() {\n if (r.readyState == 4){\n callback(r.responseText);\n }\n };\n r.send(data);\n}", "title": "" }, { "docid": "66fb534c98df942414221bfe43a5d184", "score": "0.6174571", "text": "function httpGetAsync(theUrl, callback) {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function () {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText);\n }\n xmlHttp.open(\"GET\", theUrl, true); // true for asynchronous \n xmlHttp.send(null);\n}", "title": "" }, { "docid": "5f03d6cd0e4bba0dbd8e22bc186042ef", "score": "0.61704123", "text": "function request(url){\n return new Promise((resolve, reject) => {\n Request(url, {json: true}, (x, y, body) => {\n resolve(body);\n });\n });\n}", "title": "" }, { "docid": "63e50577d27b1cc251073808f1dd9117", "score": "0.61624575", "text": "function http(url, options) {\n if (!url) return Easy.log('[BadDefinition]: Invalid url');\n\n function createXhr(method) {\n if (doc.documentMode && (!method.match(/^(get|post|head|put|delete|options)$/i) || !window.XMLHttpRequest)) {\n return new window.ActiveXObject(\"Microsoft.XMLHTTP\");\n } else if (window.XMLHttpRequest) {\n return new window.XMLHttpRequest();\n }\n throw ({ message: \"This browser does not support XMLHttpRequest.\" });\n }\n\n var self = {}, abortedByTimeout = false;\n (options || {}).keys(function (key, value) { self[key] = value; });\n\n // Setting the default method as get\n self.method ? self.method : 'get';\n var xhr = createXhr(self.method);\n\n self.url = url;\n // If timeout is not defined use the default 2 minute\n self.timeout = self.timeout || 120000;\n\n return new Task(function (resolve) {\n xhr.open(self.method, self.url, self.async || true);\n xhr.timeout = self.timeout; \n\n (options.headers || {}).keys(function (key, value) {\n if (value) xhr.setRequestHeader(key, value);\n });\n\n xhr.onload = function requestLoaded() {\n var statusText = xhr.statusText || '';\n var response = ('response' in xhr) ? xhr.response : xhr.responseText;\n var status = xhr.status === 1223 ? 204 : xhr.status;\n\n if (status === 0) {\n status = response ? 200 : urlResolver(url).protocol === 'file' ? 404 : 0;\n }\n\n self.ok = (status >= 200 && status < 400);\n self.status = status;\n\n completeRequest(status, response, xhr.getAllResponseHeaders(), statusText, 'complete');\n }\n\n var completeRequest = function (status, response, headersString, statusText, xhrStatus) {\n xhr = null;\n self.response = response;\n self.responseHeaders = headersString;\n self.statusText = statusText;\n self.statusMessage = xhrStatus;\n \n resolve(self);\n }\n\n xhr.onerror = function () {\n completeRequest(-1, null, null, '', 'error');\n }\n\n xhr.onabort = function () {\n completeRequest(-1, null, null, '', abortedByTimeout ? 'timeout' : 'abort');\n }\n\n xhr.ontimeout = function () {\n completeRequest(-1, null, null, '', 'timeout');\n }\n\n // (self.eventHandlers || {}).keys(function (key, value) {\n // if (value) xhr.addEventListener(key, value);\n // });\n \n // (self.uploadEventHandlers || {}).keys(function (key, value) {\n // if (value) xhr.addEventListener(key, value);\n // });\n\n if (self.withCredentials)\n xhr.withCredentials = true;\n\n self.type = self.type || '';\n\n try {\n xhr.responseType = self.type;\n } catch (err) {\n if (self.type !== 'json') throw err;\n }\n \n xhr.send(options.body || null);\n return self;\n });\n }", "title": "" }, { "docid": "71d273a33c5a8bfd8921fea5e7b27233", "score": "0.6161912", "text": "function _reg_GET_HTTP(url) {\n\n\t\treturn new Promise((resolve, reject) => {\n\n\t\t\t// load proper library\n\t\t\t// load from reference if it's already loaded\n\t\t\tconst lib = url.search('https') != -1 ? require('https') : require('http');\n\n\t\t\t// collect all data chunks into array\n\t\t\tvar dataChunks = [];\n\n\t\t\t// make a GET request\n\t\t\tlib.get(url, (response) => {\n\n\t\t\t\t// handle http errors\n\t\t\t\tif (response.statusCode != 200) {\n\t\t\t\t\t// create error object\n\t\t\t\t\tvar error = new Error(\"Failed to load, status code: \" + response.statusCode)\n\t\t\t\t\t// piggy back error code\n\t\t\t\t\terror.code = response.statusCode;\n\t\t\t\t\treturn reject(error);\n\t\t\t\t}\n\n\t\t\t\tresponse.setEncoding('utf8');\n\n\t\t\t\t// listen to event 'data' for each indivdiual chunk of data\n\t\t\t\tresponse.on('data', (chunk) => {\n\t\t\t\t\tdataChunks.push(chunk);\n\t\t\t\t});\n\n\t\t\t\t// listen to event 'end' when all chunks of data are transmitted\n\t\t\t\tresponse.on('end', () => {\n\n\t\t\t\t\t// combine all data chunks together\n\t\t\t\t\tlet d = dataChunks.join('');\n\n\t\t\t\t\t// check if data is null\n\t\t\t\t\tif (d == null) {\n\t\t\t\t\t\treturn reject(Baidut.const.error(Baidut.const.errorCode.responseIsNull));\n\t\t\t\t\t}\n\n\t\t\t\t\t// parse into json, and validate for error-free\n\t\t\t\t\tlet json = null;\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// parse data resposne to json\n\t\t\t\t\t\tjson = JSON.parse(d);\n\t\t\t\t\t}\n\t\t\t\t\tcatch(e) {\n\t\t\t\t\t\treturn reject(Baidut.const.error(Baidut.const.errorCode.jsonParsedError, { additional_msg: e.message } ));\n\t\t\t\t\t}\n\n\t\t\t\t\t// check api level error\n\t\t\t\t\t// if only there's no 'error_code' existing then there's no error\n\t\t\t\t\tif (!json.hasOwnProperty(\"error_code\") || \n\t\t\t\t\t\t\tjson.error_code == undefined) {\n\t\t\t\t\t\t// all ok\n\t\t\t\t\t\treturn resolve(json);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// reject with error code as error\n\t\t\t\t\t\treturn reject(Baidut.const.error(json.error_code, { additional_msg: json.message } ));\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// listen to event 'error'\n\t\t\t\tresponse.on('error', (e) => { return reject(Baidut.const.error(Baidut.const.errorCode.responseIsError, { additional_msg: e.message })); } );\n\t\t\t}).on('error', (e) => {\n\n\t\t\t\t// if it relates to internet connection issue, then mark its code\n\t\t\t\tif (_isRelateToInternetConnectionIssue(e.message)) {\n\t\t\t\t\treturn reject(Baidut.const.error(Baidut.const.errorCode.internetConnectionIssue, { additional_msg: e.message }));\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn reject(Baidut.const.error(Baidut.const.errorCode.requestError, { additional_msg: e.message }));\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "bd8b97909bec53d847fc81dba09142aa", "score": "0.6159393", "text": "httpGet(url) {\n return new Promise((resolve, reject) => {\n http.get(this.server + url, (res) => {\n var data = \"\";\n\n res.on('data', (chunk) => {\n data += chunk;\n }).on('end', () => {\n if (res.statusCode === 200) {\n resolve(data);\n } else {\n reject(data);\n }\n }).on('error', (e) => {\n reject(\"Got error: \" + e.message);\n });\n });\n });\n }", "title": "" }, { "docid": "a7a6c64340985fc601dbf7b97562bebc", "score": "0.615418", "text": "async function asyncReq(reqNum) {\n\ttry {\n\t\tawait clientRequest(reqNum);\n\t}\n\tcatch (error) {\n\t\t// Promise rejected\n\t\tconsole.log(error);\n\t}\n}", "title": "" }, { "docid": "2545d7ce46f2ce9da0341949071cd41d", "score": "0.6146516", "text": "async function getVehicle(URL){\r\n let vehicle = await getResponse(URL);\r\n return vehicle; \r\n}", "title": "" }, { "docid": "d9e77d42280ce7239704053caa6c4464", "score": "0.6144499", "text": "async function getAPI(url) {\n return new Promise((resolve, reject) => {\n request(createCutebotRequest(url), (data) => {\n resolve(data);\n })\n })\n}", "title": "" }, { "docid": "8f79c8e4dc0b300abb81b2bdba87e2e2", "score": "0.6135562", "text": "function httpGetAsync(theUrl, callback)\n{\t\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() { \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200){\n// \tlog(\"Response \"+xmlHttp.responseText);\n \tif(callback){\n \t\tcallback(xmlHttp.responseText);\n \t}\n }\n }\n xmlHttp.open(\"GET\", theUrl, true); // true for asynchronous \n xmlHttp.send(null);\n}", "title": "" }, { "docid": "365bdbff9cf33877ccd05f08d01214a5", "score": "0.61347675", "text": "async function main() {\n const auth = new GoogleAuth({\n scopes: 'https://www.googleapis.com/auth/cloud-platform',\n });\n const client = await auth.getClient();\n const projectId = await auth.getProjectId();\n const url = `https://dns.googleapis.com/dns/v1/projects/${projectId}`;\n\n // create a new agent with keepAlive enabled\n const agent = new https.Agent({keepAlive: true});\n\n // use the agent as an Axios config param to make the request\n const res = await client.request({url, agent});\n console.log(res.data);\n\n // Re-use the same agent to make the next request over the same connection\n const res2 = await client.request({url, agent});\n console.log(res2.data);\n}", "title": "" }, { "docid": "e4036229ee833c43e8ba1b2172922c5d", "score": "0.6130325", "text": "function makeAsyncRequest(requestUrl) {\r\n let xmlHttp = new XMLHttpRequest();\r\n xmlHttp.onreadystatechange = () => {\r\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {\r\n\t cardObservable.next(JSON.parse(xmlHttp.responseText));\r\n\t } else if (xmlHttp.readyState == 4 && xmlHttp.status != 200) {\r\n\t \tpickRandomCard();\r\n\t }\r\n }\r\n xmlHttp.open(\"GET\", requestUrl, true);\r\n xmlHttp.send(null);\r\n}", "title": "" }, { "docid": "6950ff8dee796907bd9ec239bb4edbc6", "score": "0.6116374", "text": "async function getNowPlayingAsync() {\n\n try {\n var req = http.get(kflipstatus,\n function (res) {\n //console.log('STATUS: ' + res.statusCode);\n //console.log('HEADERS: ' + JSON.stringify(res.headers));\n\n // Buffer the body entirely for processing as a whole.\n var bodyChunks = [];\n res.on('data',\n function (chunk) {\n // You can process streamed parts here...\n bodyChunks.push(chunk);\n }).on('end',\n function () {\n var body = Buffer.concat(bodyChunks);\n checkForSomethingNew(body.toString());\n\n //console.log('BODY: ' + body);\n });\n });\n\n req.on('error',\n function (e) {\n console.log('ERROR - icecastinfo - Error calling GET kflipstatus - ' + e.message);\n });\n } catch (err) {\n console.log('ERROR - icecastinfo - Exception in getNowPlayingAsync - ' + err.message);\n }\n\n}", "title": "" }, { "docid": "3fcf8977736a104e0294fcad19bab7af", "score": "0.60989994", "text": "function makeRequest(url,async) {\n\tvar httpRequest = \"\";\n\tif (window.XMLHttpRequest) {\n\t\t// Mozilla, Safari, ...\n\t\thttpRequest = new XMLHttpRequest();\n\t} else if (window.ActiveXObject) {\n\t\t// IE\n\t\ttry {\n\t\t\thttpRequest = new ActiveXObject(\"Msxml2.XMLHTTP\");\n\t\t} \n\t\tcatch (e) {\n\t\t\ttry {\n\t\t\t\thttpRequest = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t\t} \n\t\t\tcatch (e) {}\n\t\t}\n\t}\n\n\tif (!httpRequest) {\n\t\tconsole.log('CHANNEL:Giving up : Cannot create an XMLHTTP instance');\n\t\treturn false;\n\t}\n\thttpRequest.open('POST', url,async);\n\thttpRequest.send();\n\treturn httpRequest;\n}", "title": "" }, { "docid": "e7ea5d07f5ddb7c24aa83b361ca9cbeb", "score": "0.6089039", "text": "async function processGetRequest() {\n\tconst response = await axios(`${BASE_URL}/2020`)\n\t\t.then(response => {\n\t\t\tconst data = response.data;\n\t\t\tconsole.log(data);\n\t\t\treturn data;\n\t\t})\n\t\t.then(budgetDataResp)\n\t\t.catch(err => {\n\t\t\tconsole.log('Error: ', err);\n\t\t});\n\tconsole.log(response);\n\treturn response;\n}", "title": "" }, { "docid": "4135517b71d938e444aeeb7529f220a8", "score": "0.60866433", "text": "function myFetch(url){\n return new Promise((resolve, reject) => {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, true); // 10sec\n xhr.send();\n\n xhr.addEventListener('readystatechange', () => {\n if (xhr.readyState === 4) {\n resolve(xhr.responseText)\n }\n })\n })\n}", "title": "" }, { "docid": "18ce62ecaa0717f39ef4efe725bc65bd", "score": "0.6083352", "text": "async get(url) { \n\n\t\t// Awaiting for fetch response \n\t\tconst response = await fetch(url,{\n headers:{\n \"Content-Type\": \"application/json\"\n }\n }); \n\n\t\t// Awaiting for response.json() \n\t\tconst resData = await response.json(); \n\n\t\t// Returning result data \n\t\treturn resData; \n\t}", "title": "" }, { "docid": "870b3ae203c082cf3c34581de5c8ef00", "score": "0.6076857", "text": "function httpGetAsync(theUrl, callback){\n\tvar xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() { \n \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200){\n \tobj = JSON.parse(xmlHttp.responseText);\n \tconsole.log(\"200 \");\n //console.log(obj);\n onResponse(obj);\n }\n else{\n \tconsole.log(\"404\");\n \tonResponse(cacheServer); // if Get request fails, then return cached server JSON\n }\n }\n xmlHttp.open(\"GET\", theUrl); \n xmlHttp.send(null);\n}", "title": "" }, { "docid": "640946ea06c0d2c0b3cbd183fb029a30", "score": "0.6075071", "text": "function httpPostAsync(theUrl) {\n console.log(theUrl);\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.open(\"POST\", theUrl, true); // true for asynchronous \n xmlHttp.send(null);\n}", "title": "" }, { "docid": "ef83d25193dd5550f4897be8c2b3b218", "score": "0.6069636", "text": "async function fetch(url,request){\n request = request || {};\n request.method = request.method || 'GET';\n request.headers = request.headers || {};\n if( session ) {\n let token = await client.createToken(url, session);\n request.credentials = \"include\";\n request.headers.authorization= `Bearer ${token}`;\n }\n return await ifetch(url,request);\n}", "title": "" }, { "docid": "fd1e3f054cfe47ed9752e7d3670792a3", "score": "0.6066655", "text": "_makeRequest(method, endpoint, opts) {\n const requestOpts = _.merge({url:`${this._baseUrl}${endpoint}`, headers: this._opts.headers}, opts);\n\n return request[`${method}Async`](requestOpts).then((response) => JSON.parse(response.body));\n }", "title": "" }, { "docid": "35a4c2ce30513623bce104b7a31b14e1", "score": "0.60403115", "text": "function makeRequest() {\n httpRequest = new XMLHttpRequest();\n httpRequest.onreadystatechange = responseMethod;\n httpRequest.open('GET', url);\n httpRequest.send();\n }", "title": "" }, { "docid": "93fb9fc05b17907225ee9a398211854f", "score": "0.60342616", "text": "async function get_articles() {\n return new Promise(\n function (resolve, reject) {\n var headers = {\n 'Accept': 'Application/xml',\n 'Authorization': 'Client guest:guest'\n };\n var buffer = '';\n var options = {\n host: 'api.tradingeconomics.com',\n port: 443,\n path: '/articles',\n headers: headers\n };\n options.path = options.path.replace (' ','%20');\n callback = function(response) {\n response.on('data', function (chunk) {\n buffer += chunk;\n });\n response.on('end', function () {\n resolve(buffer);\n //console.log(JSON.parse(buffer));\n });\n };\n http.get(options, callback).end();\n });\n}", "title": "" }, { "docid": "a0b992c449dd0b23121112443fb674fd", "score": "0.60338044", "text": "function makeRequest(){\n httpRequest= new XMLHttpRequest();\n httpRequest.onreadystatechange=responseMethod;\n httpRequest.open('GET', url + '&appid='+ apiKey);\n httpRequest.send();\n }", "title": "" }, { "docid": "b6e37fdc169290472fbf35e6c77c5811", "score": "0.6029472", "text": "async function runTest() {\n makeReq('/test')\n}", "title": "" }, { "docid": "47e3bc2423c94b06a43199ebacf1a582", "score": "0.6023457", "text": "function makeRequest(url) {\n console.log('makeRequest is called');\n\n return new Promise(resolve => {\n setTimeout(() => {\n resolve(url);\n }, 2000);\n });\n}", "title": "" }, { "docid": "6d55742c4022ef18d00c89c8e6092765", "score": "0.6018661", "text": "async function communicate(_url) {\n let response = await fetch(_url);\n console.log(response);\n }", "title": "" }, { "docid": "e5feb3c4352a011c17d44b92d5b797db", "score": "0.6017853", "text": "get(url){\n return new Promise( \n (resovle , reject) => {\n this.log(\"Prepare connect url[\" + decodeURIComponent(url) + \"]\");\n request( { url : url }, \n (error, response, body) => {\n if(error) {\n reject(error);\n } else {\n this.log(\"Connect url[\" + decodeURIComponent(url) + \"] Success\");\n resovle([response, body]);\n }\n }\n );\n }\n );\n }", "title": "" }, { "docid": "955286057493344717b2f7c5cfb81034", "score": "0.6010509", "text": "httpGet(url) {\n if (process.env.NODE_ENV === 'development') {\n console.log('URL sent to server: ', this.server + url)\n }\n return new Promise((resolve, reject) => {\n http.get(this.server + url, (res) => {\n var data = \"\";\n\n res.on('data', (chunk) => {\n data += chunk;\n }).on('end', () => {\n if (res.statusCode === 200) {\n resolve(data);\n } else {\n reject(data);\n }\n }).on('error', (e) => {\n reject(\"Got error: \" + e.message);\n });\n });\n });\n }", "title": "" }, { "docid": "558aea07ca9c4029d237ac373ba08d56", "score": "0.6007008", "text": "async function fetchUser() {\n // for example, do network request in 10 seconds\n return \"conan\"; \n}", "title": "" }, { "docid": "c21fa79b268c54d6ae4c4d89440d3777", "score": "0.6006181", "text": "async get(url) {\n \n // Awaiting for fetch response\n const response = await fetch(url);\n \n // Awaiting for response.json()\n const resData = await response.json();\n \n // Returning result data\n return resData;\n }", "title": "" }, { "docid": "d6f7f4757348511eb86571e3248af280", "score": "0.59936804", "text": "function request(url) {\n // Note: returning a promise now!\n return new Promise( function(resolve,reject){\n makeAjaxCall( url, resolve );\n } );\n}", "title": "" }, { "docid": "eec257124aea9bb6edb1e3238145a891", "score": "0.5986978", "text": "async function GenerateCofC(pallet_number)\r\n{\r\n \r\n await axios\r\n .get(\"http://192.168.2.223:9075/Generate_CofC?pallet_number=\"+pallet_number+\"\")\r\n .then(res => {\r\n console.log(res)\r\n console.log(\"checking data........\")\r\n loadCOCResults()\r\n\r\n }).catch(err =>{console.log(err)}); \r\n \r\n}", "title": "" }, { "docid": "b9be072e474b31bf9dbbe2a96907b0f5", "score": "0.5985488", "text": "function asyncGetFile(url) {\n //Your code here\n console.log(\"Getting Text File\");\n return new Promise((resolve, reject)=>{\n const xhr = new XMLHttpRequest();\n xhr.open(\"GET\", url);\n xhr.onload = () => resolve(xhr.responseText);\n xhr.onerror = () => reject(xhr.statusText);\n xhr.send();\n console.log(\"Made Promise\");\n });\n}", "title": "" }, { "docid": "b3b259407f1e1b25fc3cab5e9cd911e4", "score": "0.5950868", "text": "function asyncGetFile(url) {\r\n //Your code here\r\n console.log(\"Getting text file at \", url);\r\n return new Promise((resolve, reject) => {\r\n const xhr = new XMLHttpRequest();\r\n xhr.open(\"GET\", url);\r\n xhr.onload = () => resolve(xhr.responseText);\r\n xhr.onerror = () => reject(xhr.statusText);\r\n xhr.send();\r\n console.log(\"Finished getting text\");\r\n });\r\n\r\n}", "title": "" }, { "docid": "e2756ea6bb90091154d2a7d606e30212", "score": "0.5945036", "text": "function fetchPageAsync() {\n console.log('fetching page');\n http.get({host: 'trafficjamapp.herokuapp.com', path: '/?delay=2000'}, function (res) {\n console.log('data returned from requesting page');\n }).on('error', function (e) {\n console.log(\"There was an error\" + e);\n });\n}", "title": "" }, { "docid": "e0ba49fe8f04c67fab1246b50ee02e2f", "score": "0.5940622", "text": "function doRequest(options) {\n return new Promise(function (resolve, reject) {\n request(options, function (error, res, body) {\n if (!error && res.statusCode == 200) {\n resolve(body);\n } else {\n reject(error);\n }\n });\n });\n}", "title": "" }, { "docid": "49d895ed81ef388db1869df48e253b76", "score": "0.5937696", "text": "function doRequest() {\n https.request('https://www.google.com', res => {\n res.on('data', () => {});\n res.on('end', () => console.log(Date.now() - start));\n }).end();\n}", "title": "" }, { "docid": "dc98881ffd20df3637f86bb5eddccac2", "score": "0.59330004", "text": "async request(url, options) {\n // 判断Query String 参数值是否太大\n assertLongQuery(url);\n\n const defaultOptions = {\n timeout: 30 * 1000\n };\n\n const { method } = options;\n let requestUrl = url;\n let headers = options.header || {};\n let requestOptions = {\n ...defaultOptions, \n ...options,\n method: method ? method.toUpperCase() : 'GET'\n };\n\n // 设置默认 Accept 和 Content-Type\n requestOptions.header = Object.assign({\n Accept: 'application/json, text/plain, */*',\n 'Content-Type': 'application/json; charset=utf-8',\n }, headers);\n\n this.interceptors.request.forEach((interceptor) => {\n const request = interceptor(requestUrl, requestOptions);\n requestUrl = request.url;\n requestOptions = request.options;\n });\n\n const fetchPromise = Taro.request({\n url,\n ...requestOptions\n })\n .then(checkStatus)\n .then((res) => {\n const { data } = res;\n // 直接返回成功数据\n return Promise.resolve(data);\n }).catch((err) => {\n const { data } = err;\n if(!data) {\n return Promise.reject({\n code: '10001',\n data: null,\n message: '服务器异常'\n });\n }\n return Promise.reject(data);\n });\n\n let response = this.timeoutPromise(fetchPromise, requestOptions.timeout);\n\n this.interceptors.response.forEach((interceptor) => {\n response = interceptor(response);\n });\n\n return response;\n }", "title": "" }, { "docid": "b9595ba41b1642bd625e445ee378c1ee", "score": "0.592522", "text": "async function getAtxHTML() {\n const options = {\n hostname: 'www.showlistaustin.com',\n path: '/',\n port: 80,\n method: 'GET',\n };\n\n return new Promise(((resolve, reject) => {\n const request = http.request(options, (response) => {\n let data = '';\n\n response.on('data', (chunk) => {\n data += chunk;\n });\n\n response.on('end', async () => {\n resolve(data);\n });\n });\n\n request.on('error', (error) => {\n reject(error);\n });\n\n request.end();\n }))\n .catch((error) => { console.log(error); });\n}", "title": "" }, { "docid": "7be87cc8f921c4955d1691dc1a298a13", "score": "0.59210485", "text": "function makeRequest() {\n\t\thttpRequest = new XMLHttpRequest();\n\t\thttpRequest.onreadystatechange = responseMethod;\n\t\thttpRequest.open('GET', url + '&appid=' + apiKey);\n\t\thttpRequest.send();\n\t}", "title": "" }, { "docid": "e2ade57804f9fa828d7e367fb769225e", "score": "0.5917913", "text": "function httpGet(theUrl, callback){\n\tconsole.log(\"http get\");\n\tvar Request = require(\"sdk/request\").Request;\n\tvar redditRequest = Request({\n\t\turl: theUrl,\n\t\tonComplete: callback\n\t});\n\tredditRequest.get();\n}", "title": "" }, { "docid": "f42fb96055db82cdf174204f0244259e", "score": "0.5887554", "text": "async function MakeApiCall (url) {\n let response = await fetch(url)\n let json = await response.json()\n return json\n}", "title": "" }, { "docid": "ea43ddbfda6ab280b0a46eb2d24beb36", "score": "0.5885299", "text": "async function getFetch(url){//we want to create moudlar code and stay away frim hard coding\n const res = await fetch(url)\n const data= await res.json()\n return data // if we return datawe are returning the object that has all the data\n \n }//here we abstracted our calls to link the data directly and all it takes is one call", "title": "" }, { "docid": "e6a8b7a5fc43cdd2f01ee892de29a2e7", "score": "0.5881236", "text": "static async method(){}", "title": "" }, { "docid": "45d68246c0810313b5913c7babaebd63", "score": "0.58803964", "text": "async function runQuery(url, query){\n let request = fetch(url+\"?query=\"+ encodeURIComponent(query) +\"&format=json\");\n\n let respons = await request;\n let handleRespons = await respons.json();\n \n return handleRespons;\n }", "title": "" }, { "docid": "c55e8591b9d5ca659570c5a852ebea2c", "score": "0.5876849", "text": "async SetUpRequest() {}", "title": "" }, { "docid": "716f43f2e2446b1c34b99d16318b8e82", "score": "0.58684206", "text": "async function Api(input){\n var o=o||\"\";\n var r = await fetch(`/api/${input}`).then(l => l.json()).then(l => l.response)\n return r;\n }", "title": "" }, { "docid": "66619de6a08c9eb707527d23f31aae9f", "score": "0.5863468", "text": "function httpReqIpAsync(url, callback) {\n var httpReqIp = new XMLHttpRequest();\n httpReqIp.open(\"GET\", url, true)\n httpReqIp.onreadystatechange = function() {\n if(httpReqIp.readyState == 4 && httpReqIp.status == 200) {\n var jsonIp = JSON.parse(httpReqIp.responseText);\n var city = jsonIp[0].name;\n location.innerHTML = `${city}`;\n //calling openweathermap api function\n httpReqWeatherAsync(ipUrl);\n }\n }\n httpReqIp.send();\t\t\t\t\n }", "title": "" }, { "docid": "66619de6a08c9eb707527d23f31aae9f", "score": "0.5863468", "text": "function httpReqIpAsync(url, callback) {\n var httpReqIp = new XMLHttpRequest();\n httpReqIp.open(\"GET\", url, true)\n httpReqIp.onreadystatechange = function() {\n if(httpReqIp.readyState == 4 && httpReqIp.status == 200) {\n var jsonIp = JSON.parse(httpReqIp.responseText);\n var city = jsonIp[0].name;\n location.innerHTML = `${city}`;\n //calling openweathermap api function\n httpReqWeatherAsync(ipUrl);\n }\n }\n httpReqIp.send();\t\t\t\t\n }", "title": "" }, { "docid": "023e1173b004a6988d58ecfa0d90b5b4", "score": "0.58531207", "text": "function YAPI_HTTPRequest_async(str_device, str_request, func_callback, obj_context)\n {\n this.devRequest_async(str_device, str_request, '',\n function(params, yreq) {\n if(yreq.errorType != YAPI_SUCCESS) {\n params.obj._throw(yreq.errorType, yreq.errorMsg, null);\n if(params.cb) params.cb(params.ctx, null);\n return;\n }\n if(params.cb) params.cb(params.ctx, yreq.result);\n },\n {obj:this, cb:func_callback, ctx:obj_context});\n }", "title": "" }, { "docid": "702f215011995b3ede867f437976eaeb", "score": "0.5845571", "text": "async function callApi(url){\n return ((await fetch(url)).json());\n}", "title": "" }, { "docid": "5fa9e126acfa176e6acb0799ad5cbc14", "score": "0.5830413", "text": "function makeGetRequest(callback) {\n http.get(this.url, function (resp) {\n var rawData = '';\n // .on sets up event listeners for each event\n resp.on('data', function(chunk) {\n //chunk is implicitly coerced from a stream into a string with the += (because rawData is type string)\n rawData += chunk;\n }).on('end', function(data) {\n // on success, err=null, response=rawData are fed over to \"callback\" function provided by the async library\n callback(null, rawData);\n }).on('error', function (e) {\n callback(e, 'error occurred');\n });\n });\n}", "title": "" }, { "docid": "9527169e87a81ec2ad308009be356e07", "score": "0.5828995", "text": "function makeRequest(url,async) {\n\tvar httpRequest;\n\tif (window.XMLHttpRequest) {\n\t\t// Mozilla, Safari, ...\n\t\thttpRequest = new XMLHttpRequest();\n\t} else if (window.ActiveXObject) {\n\t\t// IE\n\t\ttry {\n\t\t\thttpRequest = new ActiveXObject(\"Msxml2.XMLHTTP\");\n\t\t} \n\t\tcatch (e) {\n\t\t\ttry {\n\t\t\t\thttpRequest = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t\t} \n\t\t\tcatch (e) {}\n\t\t}\n\t}\n\n\tif (!httpRequest) {\n\t\talert('Giving up :( Cannot create an XMLHTTP instance');\n\t\treturn false;\n\t}\n\thttpRequest.open('POST', url,async);\n\thttpRequest.send();\n\treturn httpRequest;\n}", "title": "" }, { "docid": "9527169e87a81ec2ad308009be356e07", "score": "0.5828995", "text": "function makeRequest(url,async) {\n\tvar httpRequest;\n\tif (window.XMLHttpRequest) {\n\t\t// Mozilla, Safari, ...\n\t\thttpRequest = new XMLHttpRequest();\n\t} else if (window.ActiveXObject) {\n\t\t// IE\n\t\ttry {\n\t\t\thttpRequest = new ActiveXObject(\"Msxml2.XMLHTTP\");\n\t\t} \n\t\tcatch (e) {\n\t\t\ttry {\n\t\t\t\thttpRequest = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t\t} \n\t\t\tcatch (e) {}\n\t\t}\n\t}\n\n\tif (!httpRequest) {\n\t\talert('Giving up :( Cannot create an XMLHTTP instance');\n\t\treturn false;\n\t}\n\thttpRequest.open('POST', url,async);\n\thttpRequest.send();\n\treturn httpRequest;\n}", "title": "" }, { "docid": "fcaec7033af7d3a80717106c30bcc1bb", "score": "0.5827966", "text": "function req(method, url, data) {\n return new Promise(function(resolve, reject) {\n let req = new XMLHttpRequest();\n req.addEventListener('load', function() {\n if (this.status >= 200 && this.status < 300) {\n let data1 = null;\n if (this.responseText) {\n data1 = JSON.parse(this.responseText);\n } \n resolve(data1);\n } else {\n reject(new Error('Invalid status'));\n }\n });\n \n req.open(method, url);\n if (data) {\n req.setRequestHeader('Content-Type', 'application/json');\n req.send(JSON.stringify(data));\n } else {\n req.send();\n }\n });\n}", "title": "" }, { "docid": "f8f5e0d417d432de1bb4e82701a09ff3", "score": "0.5826539", "text": "async function httpReqPost(url, data, func){\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", url, true);\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.setRequestHeader(\"X-CSRFToken\", getCookie('csrftoken'));\n xhr.onreadystatechange = function (response) {\n if (xhr.readyState === 4 && xhr.status === 200) {\n var json = JSON.parse(xhr.responseText);\n func(json);\n }\n };\n xhr.send(JSON.stringify(data));\n}", "title": "" }, { "docid": "249224bc530771b00481f6bbe9b0a40b", "score": "0.5816983", "text": "async query (qs, url) {\n // send get request\n try {\n return await request.get(url, { qs, headers: config.headers, json: true })\n } catch (err) {\n throw new Error(err)\n }\n }", "title": "" }, { "docid": "e725c5834f7e654cd4b629fb1dd70e52", "score": "0.58082324", "text": "function callAsyncFunctions(){window.respimage&&respimage()}", "title": "" }, { "docid": "afa410e570089afa01a6139d3f79ff38", "score": "0.58051896", "text": "function getRequest(url) {\n // Create a promise to handle the resolve and reject operation\n\t\treturn new Promise((resolve, reject) => {\n request.get(url).on('response', data =>\n resolve(data)\n ).on('error', err =>\n reject(err)\n );\n\t\t});\n }", "title": "" }, { "docid": "942177d4b4f871fd7704e74cc5b7b479", "score": "0.58017415", "text": "async function getData() {\n const uri = requestOptions.uri;\n try {\n const data = await fetch(uri, requestOptions);\n const response = await data.json();\n return response.data;\n } catch (error) {\n console.log(error);\n }\n}", "title": "" }, { "docid": "19ee7f2ab3b8d85608cfe4e4048fce9b", "score": "0.5801026", "text": "getContent() {\n var opt = this.option;\n var start = new Date();\n return new Promise((resolve, reject) => {\n\n this.getter.request(opt, res => {\n var delay = new Date() - start;\n this.addRes(res, start, delay);\n resolve();\n }).on('error', err => {\n var delay = new Date() - start;\n this.addRes(null, start, delay, err);\n prompt.alert.log(\"ERROR : host ( \" + this.option.host + \" ) cannot be reached\");\n resolve(); //error are expected due to network or website failure\n }).end();\n });\n }", "title": "" }, { "docid": "724979b280b92ad148857a860206e6ab", "score": "0.57983863", "text": "function GET(url, callback){\n var method = \"GET\";\n var async = true;\n var request = new XMLHttpRequest();\n request.onload = function(){callback(request)};\n request.open(method, url, async);\n request.setRequestHeader(\"Authorization\", token);\n request.setRequestHeader(\"Content-Type\", \"application/json;charset=UTF-8\");\n request.send();\n}", "title": "" }, { "docid": "77dba86fa16a2a5326e87b2b9bb52d25", "score": "0.5796371", "text": "async function getDatos() {\n try {\n let res = await axios(urlAPI);\n return res.data;\n } catch (error) {\n console.log(\"ERROR GET HTTP\", error);\n }\n}", "title": "" }, { "docid": "1fdcfbc36a1b4e3715f9d0ff578ff4b8", "score": "0.57936645", "text": "function sendRequest() {\n\thttpReq = new XMLHttpRequest();\n\thttpReq.onreadystatechange = retrieveContents;\n\thttpReq.open('GET', API_URL, true);\n\thttpReq.send();\n}", "title": "" }, { "docid": "5258fb99cebf3cfd4bd518a641c7b964", "score": "0.57905734", "text": "async function postOrPutDataAsync(url, reqBody, reqMethod) {\r\n\r\n // create request object\r\n // request body\r\n const request = {\r\n method: reqMethod, \r\n headers: HTTP_REQ_HEADERS,\r\n credentials: 'include', // important\r\n mode: 'cors',\r\n body: reqBody\r\n };\r\n\r\n // Try catch \r\n try {\r\n // Call fetch and await the respose\r\n // Initally returns a promise\r\n const response = await fetch(url, request);\r\n\r\n // As Resonse is dependant on fetch, await must also be used here\r\n const json = await response.json();\r\n\r\n // Output result to console (for testing purposes) \r\n console.log(json);\r\n\r\n // Call function( passing he json result) to display data in HTML page\r\n //displayData(json);\r\n return json;\r\n\r\n // catch and log any errors\r\n } catch (err) {\r\n console.log(err);\r\n return err;\r\n }\r\n\r\n}", "title": "" }, { "docid": "395dd4b59a5722675faaba8614c4a86b", "score": "0.5783378", "text": "async function makeURLText(url) {\nlet res;\n try {\n res = await axios.get(url)\n } catch (err) {\n console.error(`${url} not working. ${err}`)\n process.exit(1)\n }\n generate(res.data)\n}", "title": "" }, { "docid": "abc5aa4a110399049a01c317bb15b7e2", "score": "0.57816404", "text": "async afunc() {}", "title": "" }, { "docid": "0af8da4372baa8b53473ac50efa18058", "score": "0.57810426", "text": "function doGetHttp(functionName, url, data) {\n var deferred = $q.defer();\n\n busyCursorStart();\n $http(\n {\n method: 'get',\n url: url,\n headers: {'Authorization': 'Basic YXBwQHBvbGV0dG93ZWIuY29tOnB2aTNFei1EVVFWei1EdzNRYlEtVjk5Qkg'}\n })\n \n .success(function (response) {\n console.log(functionName + \"Success\");\n\n busyCursorEnd();\n\n deferred.resolve(response);\n }).error(function (error) {\n console.log(functionName + \" Error :\" + error);\n\n busyCursorEnd();\n\n deferred.reject(error);\n });\n\n return deferred.promise;\n }", "title": "" }, { "docid": "ed9629653ce97b1f032f6639a80191d3", "score": "0.5775586", "text": "async function apiGet(path) {\n try {\n https.get(resolve(SWAPI_URL, path), {headers: {Accept: \"application/json\"}} \n \n .then(\n (res) => {\n let data = \"\";\n \n res.on(\"data\", chunk => {\n data += chunk;\n });\n\n res.on(\"end\", () => {\n cb(null, data ? JSON.parse(data) : null);\n });\n }\n )\n )\n } catch(error) {\n console.log(error)\n }\n }", "title": "" }, { "docid": "5f62da045b07231264760567b824538e", "score": "0.57750994", "text": "async function sendApiRequest(){\n let response = await fetch(`https://official-joke-api.appspot.com/random_ten`);\n console.log(response)\n let data = await response.json()\n console.log(data)\n useApiData(data)\n}", "title": "" }, { "docid": "fa58be5ae2873355b58a78e4428ec649", "score": "0.5773147", "text": "function makeRequest(path, cb) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', path, true);\n xhr.send(); \n \n xhr.onreadystatechange = function() { \n if (xhr.readyState != 4) return;\n \n if (xhr.status != 200) {\n console.log(xhr.status + ': ' + xhr.statusText);\n } else {\n var data = JSON.parse(xhr.responseText);\n\n cb(data);\n }\n }\n}", "title": "" }, { "docid": "60b2c8b2275da8d80b9348d1c630b430", "score": "0.5771865", "text": "function http_http(_x) {return _http.apply(this, arguments);}", "title": "" }, { "docid": "e0261a59d154ec5b27e5dae5a4b87ac2", "score": "0.577101", "text": "async function getData() {\n\ttry {\n\t\t// This code returns a promise so we tag it with \"await\"\n\t\tvar myData = await axios.get('https://google.com');\n\t\tconsole.log(myData);\n\t} catch (error) {\n\t\t// If things go wrong!\n\t\tconsole.log(error);\n\t}\n}", "title": "" }, { "docid": "ca11f81013cc9a07238a73f249cec1fc", "score": "0.57666934", "text": "function fetchWeatherDetails() {\n if (input.value != '') {\n let url = \"https://api.openweathermap.org/data/2.5/weather?q=\" + input.value + \"&appid=\" + apiKey;\n //console.log(url);\n httpRequestAsync(url);\n }\n}", "title": "" }, { "docid": "5e9565dfdeb55a961d2e36ae8cac1fc7", "score": "0.57654536", "text": "function http_async(args) {\n var urls = [argsv[2], args[3], args[4]];\n var http = require(\"http\");\n\n var messages = [];\n var unfinished = 0;\n\n urls.forEach(function(url, index) {\n http.get(url, function(response) {\n var stringData = \"\";\n unfinished++;\n\n response.setEncoding(\"utf8\");\n response.on(\"error\", console.error);\n\n response.on(\"data\", function(data) {\n stringData += data;\n });\n\n response.on(\"end\", function() {\n unfinished--;\n messages[index] = stringData;\n\n if(unfinished === 0) {\n messages.forEach(function(message) {\n console.log(message);\n });\n }\n });\n });\n });\n}", "title": "" } ]
ef55c5d7dbb3d92d2221d7318a36b1a3
Set highest fitness based on current population pool
[ { "docid": "9d6690ef8b968271d2292c254ecffbd6", "score": "0.0", "text": "function CreateULFromHistory(){\n\tif(!cancelScript && !scriptCompleted){\n\t\tif(aFitnessHistory.length > 0){\n\t\t\t$('#alertHeader').html(\"Creating list of history...\");\n\n\t\t\t// Create the list element:\n\t\t\tvar list = document.createElement('ol');\n\t\t\tlist.setAttribute('id','historyList');\n\n\t\t\tfor(var index = 0, length = aFitnessHistory.length; index < length; ++index) {\n\t\t\t\t// Create the list item:\n\t\t\t\tvar item = document.createElement('li');\n\n\t\t\t\t// Set its contents:\n\t\t\t\titem.appendChild(document.createTextNode(aFitnessHistory[index]));\n\n\t\t\t\t// Add it to the list:\n\t\t\t\tlist.appendChild(item);\n\t\t\t}\n\t\t\t// Remove old one\n\t\t\t$(\"#historyList\").remove();\n\n\t\t\t// Add list to div\n\t\t\t$('#historyListDiv').append(list);\n\t\t}\n\t}\n}", "title": "" } ]
[ { "docid": "4632a517030212c892ae603ee49b3ac9", "score": "0.7109695", "text": "function populationFitness(population, constraints, fitness) {\n population.forEach(chromosome => {\n if(chromosome.fitness === null){\n chromosome.fitness = fitness(chromosome.genes, constraints);\n }\n });\n}", "title": "" }, { "docid": "345cfa1215b24b5031f3998f170606a4", "score": "0.7014871", "text": "setBestPlayer() {\n //get max fitness\n maxf =0;\n maxIndex = 0;\n for (var i =0; i<=this.pop_size - 1; i++) {\n if (this.players[i].fitness > maxf) {\n maxf = this.players[i].fitness;\n maxIndex = i;\n }\n }\n\n this.bestPlayerNo = maxIndex;\n\n //if best this gen is better than the global best score then set the global best as the best this gen\n\n if (this.players[this.bestPlayerNo].score > this.bestScore) {\n this.bestScore = this.players[this.bestPlayerNo].score;\n this.allTimeHigh = this.bestScore;\n this.bestPlayer = this.players[this.bestPlayerNo].clone();\n \n //players[bestPlayerNo].brain.draw_weights();\n }\n //print(\" bestplayer: \" + bestPlayerNo);\n //print(\" bestplayer score: \" + players[bestPlayerNo].score);\n }", "title": "" }, { "docid": "513408a10674727d6b7fae3142e3ec1a", "score": "0.6985985", "text": "function SetGenePool(){\n\tif(!cancelScript && !scriptCompleted){\n\t\tif(aPopulation.length == iPopulationSize && fHighestFitness > 0){\n\t\t\tfor(var index = 0; index < iPopulationSize; ++index){\n\t\t\t\tvar numberTimes = Math.round(aPopulationFitness[index]*100);\n\t\t\t\tfor(var nIndex = 0; nIndex < numberTimes; ++nIndex){\n\t\t\t\t\taMatingPool.push(aPopulation[index]);\n\t\t\t\t}\n\t\t\t}\n\t\t\taPopulation=[];\n\t\t\tmatingPoolFilled = true;\n\t\t}else{\n\t\t\tsetTimeout(SetGenePool, 100);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4d98acfe6d2b3e157806a38a9384b428", "score": "0.6920343", "text": "evaluatePopulation({scoredPopulation}) {\n this.totalFitness = 0;\n\n scoredPopulation.forEach(monkey => {\n this.totalFitness += monkey.fitness;\n let wholeNumberScore = Math.round(monkey.fitness * 100);\n for (let n = 0; n < wholeNumberScore; n++) {\n this.matingPool.push(monkey.dna);\n }\n });\n\n let justScores = scoredPopulation.map(i => Number(i.fitness));\n this.avgFitness = (this.totalFitness / scoredPopulation.length);\n this.maxFitness = Math.max(...justScores);\n\n console.log(\"Generation:\", this.sharedState.generations.length);\n console.log(\"Total Fitness:\", this.totalFitness.toFixed(3));\n console.log(\"Average Fitness:\", this.avgFitness.toFixed(3));\n console.log(\"Best:\", this.maxFitness.toFixed(3));\n console.log(\"---------------------------------------------------------------------------\");\n }", "title": "" }, { "docid": "146386a9ad4b9d264488242ed30eaddc", "score": "0.6919488", "text": "function SetHighestFitness(){\n\tif(!cancelScript && !scriptCompleted){\n\t\tif(!gotHighestFitness){\n\t\t\tif(aPopulation.length == iPopulationSize){\n\t\t\t\tvar fHFitness = 0.0;\n\t\t\t\tvar iHIndex = 0;\n\t\t\t\tfor(var index = 0; index < iPopulationSize; ++index){\n\t\t\t\t\tvar score = 0;\n\t\t\t\t\tfor(var tIndex = 0, length = sTargetText.length; tIndex < length; ++tIndex){\n\t\t\t\t\t\tvar targetChar = sTargetText[tIndex];\n\t\t\t\t\t\tvar geneChar = aPopulation[index][tIndex];\n\t\t\t\t\t\tif(targetChar == geneChar){\n\t\t\t\t\t\t\tscore +=1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tvar tempFitness = score/sTargetText.length;\n\t\t\t\t\taPopulationFitness[index] = tempFitness;\n\t\t\t\t\tif(tempFitness >= fHFitness){\n\t\t\t\t\t\tfHFitness = tempFitness;\n\t\t\t\t\t\tiHIndex = index;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$('#fitnessRow').html(fHFitness.toFixed(3)*100+\"%\");\n\t\t\t\t$('#geneRow').html(aPopulation[iHIndex].join(\"\"));\n\t\t\t\tfHighestFitness = fHFitness;\n\t\t\t\taFitnessHistory.push(fHFitness.toFixed(3)*100);\n\t\t\t\tgotHighestFitness = true;\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1465a2864fda046b62d4b7d69b299eb2", "score": "0.6866272", "text": "naturalSelection(){\n this.matingPool = [];\n // maxFitness = 0;\n for(let i=0; i<this.populationSize; i++){\n if(this.population[i].fitness > this.maxFitness){\n this.maxFitness = this.population[i].fitness;\n }\n }\n // console.log(\"Max fitness = \"+this.maxFitness);\n for(let i=0; i<this.populationSize; i++){\n //Based on wheel of fortune\n let fitness = map(this.population[i].fitness, 0, this.maxFitness, 0, 1); //Normalizing between 0 to 1\n let n = floor(fitness * 100); //This multiplier defines population with hightest fitness has mulipilier amount in matingPool(Eg; 100 space is allocated for hightest fitness)\n // console.log(this.population[i].gene_joint+\"=>\"+this.population[i].fitness);\n // console.log(\"Fitness = \"+fitness);\n // console.log(\"n = \"+n);\n for(let j=0; j<n; j++){\n this.matingPool.push(this.population[i]);\n }\n\n }\n // console.log(\"MatingPool = \"+this.matingPool);\n // console.log(\"MatingPoolLength = \"+this.matingPool.length);\n }", "title": "" }, { "docid": "4a20cda5ca70bfe93f7b3ccb2add8b11", "score": "0.6788954", "text": "function fitness(fee_rate, value, outputs) {\n let best_value = 100000;\n population.forEach((individual) => {\n let waste = getSelectionWaste(individual, fee_rate, value, outputs);\n if (waste < best_value) {\n best_value = waste;\n if (best_solution != individual) {\n console.log(individual);\n console.log(individual.length);\n }\n best_solution = individual;\n }\n });\n}", "title": "" }, { "docid": "d0b21a6637e16997f3c5892be883a90f", "score": "0.6787172", "text": "getFittest()\r\n {\r\n let highestFitness = this.fitnessPool[0];\r\n let best = this.chromPool[0];\r\n \r\n for(let i = 1; i < this.popSize; i++)\r\n {\r\n if(highestFitness < this.fitnessPool[i])\r\n {\r\n highestFitness = this.fitnessPool[i];\r\n best = this.chromPool[i];\r\n }\r\n }\r\n \r\n return best;\r\n }", "title": "" }, { "docid": "9ece1c4f46c7fffb8a34bb228bebe761", "score": "0.6685286", "text": "naturalSelection() {\n // Clear the ArrayList\n this.matingPool = [];\n\n let maxFitness = 0;\n for (let i = 0; i < this.population.genes.length; i++) {\n if (this.population.genes[i].fitness > maxFitness) {\n maxFitness = this.population.genes[i].fitness;\n }\n }\n\n for (let i = 0; i < this.population.genes.length; i++) {\n let fitness = this.p.map(this.population.genes[i].fitness, 0, maxFitness, 0, 1);\n let n = fitness * 100;\n for (let j = 0; j < n; j++) {\n this.matingPool.push(this.population.genes[i]);\n }\n }\n }", "title": "" }, { "docid": "8ba4a5620716d1d7df6bdf4e2d675924", "score": "0.6603156", "text": "updateFitness() {\n let newChampionSpecies = null, \n newMaxFitness = -Infinity\n \n for (const species of this.species)\n if (species.computeFitness(this.config) > newMaxFitness) {\n newChampionSpecies = species\n newMaxFitness = species.maxFitness\n }\n\n if (newMaxFitness <= this.maxFitness) ++this.stagnationCount\n else this.stagnationCount = 0\n\n this.championSpecies = newChampionSpecies\n this.maxFitness = newMaxFitness\n }", "title": "" }, { "docid": "8289a4a38ca80d8f123564458d0bbe21", "score": "0.64589965", "text": "naturalSelection() {\r\n this.matingPool = [];\r\n\r\n for (let i = 0; i < this.population.length; i++) {\r\n // let fitness = map(this.population[i].fitness, 0, 100, 0, 1);\r\n // let reproductionPercentage = floor(fitness * 100);\r\n let reproductionRange = floor(this.population[i].fitness);\r\n for (let j = 0; j < reproductionRange; j++) {\r\n this.matingPool.push(this.population[i]);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "16620463d60693e7d9e3dead275d7acb", "score": "0.6434378", "text": "sortPopulationByFitness() {\n this.population.sort((a, b) => (a.fitness <= b.fitness) ? 1 : -1);\n }", "title": "" }, { "docid": "340e1da6209a4dd1b89b5f423b703555", "score": "0.6332091", "text": "computeFitness(config) {\n let newChampion = null,\n newMaxFitness = -Infinity,\n newSumFitness = 0\n\n for (const genome of this.genomes) {\n genome.fitness = config.fitnessFunc(genome)\n genome.sharedFitness = genome.fitness / this.genomes.length\n if (genome.fitness > newMaxFitness) {\n newChampion = genome\n newMaxFitness = genome.fitness\n }\n newSumFitness += genome.sharedFitness\n }\n\n if (newMaxFitness <= this.maxFitness) ++this.stagnationCount\n else this.stagnationCount = 0\n\n this.champion = newChampion\n this.maxFitness = newMaxFitness\n this.sumFitness = newSumFitness\n\n this.genomes.sort( (g1, g2) => g2.fitness - g1.fitness )\n\n return newMaxFitness\n }", "title": "" }, { "docid": "82005b7caed6b589efda0fa74e2d29d0", "score": "0.6291003", "text": "findBest() {\r\n let worldrecord = 0.0;\r\n let index = 0;\r\n for (let i = 0; i < this.population.length; i++) {\r\n if (this.population[i].fitness > worldrecord) {\r\n index = i;\r\n worldrecord = this.population[i].fitness;\r\n }\r\n }\r\n\r\n this.best = this.population[index];\r\n if (worldrecord === this.perfectScore) {\r\n this.finished = true;\r\n }\r\n }", "title": "" }, { "docid": "4089cc43b6e1baa30325cc98bab91cd5", "score": "0.6287706", "text": "function Population(targetPhrase, mutationRate, num) {\n this.population = [];\n this.matingPool = [];\n this.generations = 0;\n this.finished = false;\n this.target = targetPhrase;\n this.mutationRate = mutationRate;\n this.perfectScore = 1;\n\n this.best = \"\";\n\n // build population\n for (var i = 0; i < num; i++) {\n this.population[i] = new DNA(this.target.length);\n }\n\n // perform fitness calculation for each member of the population\n // this can only be done once the population has been created with a known target\n this.calcFitness = function() {\n for (var i = 0; i < this.population.length; i++) {\n this.population[i].calcFitness(target);\n }\n }\n this.calcFitness();\n\n // generate mating pool based on fitness results of the population\n // inefficient, but a good basic first step in understanding\n this.naturalSelection = function() {\n //clear the matingPool\n this.matingPool = [];\n\n // find max fitness in population\n var maxFitness = 0;\n for (var i = 0; i < this.population.length; i++) {\n if (this.population[i].fitness > maxFitness) {\n maxFitness = this.population[i].fitness;\n }\n }\n\n // each member will be added to the mating pool a number of times proportionate to its relative fitness\n for (var i = 0; i < this.population.length; i++) {\n //normalize fitness value\n var fitness = map(this.population[i].fitness, 0, maxFitness, 0, 1);\n // n will represnet the number of times member is found in the pool\n // directly related to the fitness level (times a constant for scale)\n var n = floor(fitness * 100);\n // add the current member to the pool n number of times.\n for (var j = 0; j < n; j++) {\n this.matingPool.push(this.population[i])\n }\n }\n }\n\n // create a new generation\n // we can now pick from the mating pool which is filled with members proportionate to their fitness values\n this.generate = function() {\n // re-writes the population array with new values pulled from the mating pool\n for (var i = 0; i < this.population.length; i++) {\n // pick two random partners from the pool\n var a = floor(random(this.matingPool.length));\n var b = floor(random(this.matingPool.length));\n var partnerA = this.matingPool[a];\n var partnerB = this.matingPool[b];\n // combine the two partners to give a new child\n var child = partnerA.crossover(partnerB);\n // perform mutation on the new child\n child.mutate(this.mutationRate);\n // add to the new population array\n this.population[i] = child;\n }\n this.generations++;\n }\n\n this.getGenerations = function() {\n return this.generations;\n }\n\n //Calculate the current \"most fit\" member of the population\n this.evaluate = function() {\n var worldRecord = 0;\n var index = 0;\n // find the member with the highest fitness level\n for (var i = 0; i < this.population.length; i++) {\n var itemFitness = this.population[i].fitness;\n if ( itemFitness > worldRecord) {\n index = i;\n worldRecord = itemFitness;\n }\n }\n // set the current best member\n this.best = this.population[index].getPhrase();\n // check to see if the target has been met\n if (worldRecord === this.perfectScore) {\n this.finished = true;\n }\n }\n\n this.getBest = function() {\n return this.best;\n }\n\n this.isFinished = function() {\n return this.finished;\n }\n\n // calculate the average fitness of the entire population\n this.getAverageFitness = function() {\n var total = 0;\n for (var i = 0; i < this.population.length; i++) {\n total += this.population[i].fitness;\n }\n return total / (this.population.length);\n }\n\n // return all previous phrases\n // useful for displaying a list of previous generations to the user\n this.allPhrases = function() {\n var everything = \"\";\n var displayLimit = min(this.population.length, 50);\n for (var i = 0; i < displayLimit; i++) {\n everything += this.population[i].getPhrase() + \"<br>\"\n }\n return everything;\n }\n\n}", "title": "" }, { "docid": "bea70c6e67549ccf9c108c3abffafcd2", "score": "0.6281297", "text": "function updatePopulation(){\n for(let i=0;i<stateFeatures.length;i++){\n let state = idToStates[stateFeatures[i].id]\n let pop = calcAvgPop(yearRange, state);\n if(pop!==stateFeatures[i].population){\n let newElem = {};\n for(let key in stateFeatures[i]){\n newElem[key] = stateFeatures[i][key];\n }\n newElem.population = pop;\n stateFeatures[i] = newElem;\n } \n }\n if(activePollutant!==null){\n drawGraph(selectedState, activePollutant);\n }\n \n }", "title": "" }, { "docid": "20a77ebd11908792edd0e99d7f9ea5a5", "score": "0.62609136", "text": "function processSelection(population) {\n\n totalFitness();\n //console.log(total); \n let matingPool = [];\n\n for(let n = 0; n < population.length; n++) {\n let fit = evalFitness(boards[n]);\n console.log(fit);\n if(fit > 0){\n matingPool.push(population[n]);\n }\n //matingPool = matingPool.concat(Array.from({length: Math.floor(fit * 100)}, () => population[n]));\n }\n\n // console.log(\"mating pool\");\n // console.log(matingPool);\n return matingPool;\n}", "title": "" }, { "docid": "9ffcaadf8d99015195bf6546bd222533", "score": "0.6260256", "text": "calcFitness() {\r\n for (let i = 0; i < this.population.length; i++) {\r\n this.population[i].calcFitness(target);\r\n }\r\n }", "title": "" }, { "docid": "c5fd3c691b04cdf97c741300d788bff7", "score": "0.6245014", "text": "function Population(p, m, num) {\n\n this.population; // Array to hold the current population\n this.matingPool; // ArrayList which we will use for our \"mating pool\"\n this.generations = 0; // Number of generations\n this.finished = false; // Are we finished evolving?\n this.target = p; // Target phrase\n this.mutationRate = m; // Mutation rate\n this.perfectScore = 1;\n\n this.best = \"\";\n\n this.population = [];\n for (var i = 0; i < num; i++) {\n this.population[i] = new DNA(this.target.length);\n }\n this.matingPool = [];\n\n // Fill our fitness array with a value for every member of the population\n this.calcFitness = function() {\n for (var i = 0; i < this.population.length; i++) {\n this.population[i].calcFitness(target);\n }\n }\n this.calcFitness();\n\n // Create a new generation\n this.generate = function() {\n var maxFitness = 0;\n\n for (var i = 0; i < this.population.length; i++) {\n if (this.population[i].fitness > maxFitness) {\n maxFitness = this.population[i].fitness;\n }\n }\n\n // Refill the population with children from the mating pool\n var newPopulation = [];\n for (var i = 0; i < this.population.length; i++) {\n var partnerA = this.acceptReject(maxFitness);\n var partnerB = this.acceptReject(maxFitness);\n var child = partnerA.crossover(partnerB);\n child.mutate(this.mutationRate);\n newPopulation[i] = child;\n }\n this.population = newPopulation;\n this.generations++;\n }\n\n this.acceptReject = function(maxVal) {\n var besafe = 0;\n while (true) {\n var index = floor(random(this.population.length));\n var partner = this.population[index];\n var r = random(maxVal);\n if (r < partner.fitness)\n return partner;\n\n besafe++;\n if (besafe > 10000)\n return null;\n }\n }\n \n this.getBest = function() {\n return this.best;\n }\n\n // Compute the current \"most fit\" member of the population\n this.evaluate = function() {\n var worldrecord = 0.0;\n var index = 0;\n for (var i = 0; i < this.population.length; i++) {\n if (this.population[i].fitness > worldrecord) {\n index = i;\n worldrecord = this.population[i].fitness;\n }\n }\n\n this.best = this.population[index].getPhrase();\n if (worldrecord >= this.perfectScore) {\n this.finished = true;\n }\n }\n\n this.isFinished = function() {\n return this.finished;\n }\n\n this.getGenerations = function() {\n return this.generations;\n }\n\n // Compute average fitness for the population\n this.getAverageFitness = function() {\n var total = 0;\n for (var i = 0; i < this.population.length; i++) {\n total += this.population[i].fitness;\n }\n return total / (this.population.length);\n }\n\n this.allPhrases = function() {\n var everything = \"\";\n\n var displayLimit = min(this.population.length, 50);\n\n\n for (var i = 0; i < displayLimit; i++) {\n everything += this.population[i].getPhrase() + \"<br>\";\n }\n return everything;\n }\n}", "title": "" }, { "docid": "b5924e299d1b9af0a2fba804af6b6356", "score": "0.62411207", "text": "evaluate(gen) {\n this.pool.forEach((item) => {\n item.setValue(this.config.calculate(item.getData(), gen)) ;\n });\n\n let max = 0;\n for (let i = 1; i < this.pool.length; i++) {\n if (this.pool[i].getValue() > this.pool[max].getValue()) {\n max = i;\n }\n }\n\n if (this.best === undefined) {\n this.best = this.pool[max].getValue();\n this.bestData = this.pool[max].getData();\n }\n else if (this.pool[max].getValue() > this.best) {\n this.best = this.pool[max].getValue();\n this.bestData = this.pool[max].getData();\n this.bestGen = gen;\n }\n\n this.chartData.push([\n gen, this.best * this.config.type\n ]);\n }", "title": "" }, { "docid": "d311d895e0fc08b57d8b938152ac993b", "score": "0.62272507", "text": "pickAgent() {\n let randNum = Math.random();\n let i=0;\n while (randNum >= 0 && i < this.population.length) {\n randNum -= this.population[i].fitness;\n i++;\n }\n return this.population[i-1];\n }", "title": "" }, { "docid": "d55b6245f0d70a0a8b7bbfc647567144", "score": "0.6195653", "text": "function pickOne(population, fitness) {\n let index = 0\n\n let r = random(1)\n\n while (r > 0) {\n r = r - fitness[index]\n\n index++\n }\n\n index--\n\n return population[index].slice()\n}", "title": "" }, { "docid": "fbefa2400cf34ef8a93f79e4aa9bcd53", "score": "0.61755854", "text": "select()\n {\n // let i = 0, r; \n // let sum = this.units[0].fitness;\n // let fitnessSum = 0;\n // for(let i = 0; i < this.units.length; i++)\n // {\n // fitnessSum += this.units[i].fitness;\n // }\n\n // r = Rand(0, fitnessSum+1);\n\n // while(sum < r && i+1 < POPULATION_SIZE)\n // {\n // sum += this.units[++i].fitness;\n // }\n // return i;\n\n let unitIndex = 0;\n let fitnessSum = 0;\n // calculate max fitness\n for(let a = 0; a < this.units.length; a++)\n {\n fitnessSum += this.units[a].fitness;\n }\n\n while(unitIndex < this.units.length-2)\n {\n // select random weighted index\n if(Rand(0, fitnessSum) < this.units[unitIndex].fitness)\n {\n return unitIndex;\n }\n\n fitnessSum -= this.units[unitIndex++].fitness;\n }\n return unitIndex;\n \n }", "title": "" }, { "docid": "89e78f39c7efcb10b4c02a7713343801", "score": "0.61718506", "text": "selectPlayer() {\n //this function works by randomly choosing a value between 0 and the sum of all the fitnesses\n //then go through all the players and add their fitness to a running sum and if that sum is greater than the random value generated that player is chosen\n //since players with a higher fitness function add more to the running sum then they have a higher chance of being chosen\n\n //calculate the sum of all the fitnesses\n this.fitnessSum = 0;\n for (var i =0; i<=this.pop_size - 1; i++) {\n this.fitnessSum += this.players[i].fitness;\n //print(fitnessSum);\n }\n var rand = floor(random(this.fitnessSum));\n //summy is the current fitness sum\n var runningSum = 0;\n\n for (var i = 0; i<=this.pop_size - 1; i++) {\n runningSum += this.players[i].fitness; \n if (runningSum > rand) {\n return this.players[i];\n }\n }\n //unreachable code to make the parser happy\n return this.players[0];\n }", "title": "" }, { "docid": "cd138d24d50472863ddff33ab3dce920", "score": "0.6163928", "text": "prepare() {\n const birdList = []\n //Normalize fitness values to 0-1\n let min = null\n let max = null\n this.birds.forEach(bird => {\n birdList.push(bird)\n if (bird.fitness > max || max === null) max = bird.fitness\n if (bird.fitness < min || min === null) min = bird.fitness\n });\n //Use normal js array to store birds so we can use normal js operations\n birdList.forEach(bird => {\n bird.fitness = (bird.fitness - min) / (max - min)\n })\n birdList.sort((a, b) => {\n return a.fitness - b.fitness\n })\n this.birds = birdList\n\n //Pass on 3 best directly\n let bestThree = []\n for (let i = this.birds.length - 1; i > this.birds.length - 4; i--) {\n bestThree.push(this.birds[i])\n }\n\n //Generate offsprings for the rest\n this.parentPool = this.pool(this.birds)\n for (let i = 0; i < 3; i++) {\n this.parentPool[i] = bestThree.pop()\n }\n\n console.log(this.parentPool)\n }", "title": "" }, { "docid": "19f9e6ffe1e5979dc30c8383d896db00", "score": "0.61552083", "text": "function nextGeneration() {\n let newPopulation = []\n\n for (let i = 0; i < population.length; i++) {\n let orderA = pickOne(population, fitness)\n\n let orderB = pickOne(population, fitness)\n\n let order = crossOver(orderA, orderB)\n\n mutate(order, 0.01)\n // Mutation rate was chosen 1% in order not to disturb the genetics\n newPopulation[i] = order\n }\n\n population = newPopulation\n}", "title": "" }, { "docid": "69134a034708211e055a3a1e19282dbf", "score": "0.6089121", "text": "epoch()\n {\n // If this is not a priming run\n if(this._generation >= 0)\n {\n var newPopulation = [];\n\n // Carry over elites from the previous generation\n for(var i = 0; i < this._eliteCount; i++)\n {\n for(var j = 0; j < this._eliteCopies; j++)\n {\n newPopulation.push(this._populationStats[i].genome);\n }\n }\n\n var totalFitness = this._populationStats.reduce((soFar, stat) => soFar + stat.fitness, 0);\n\n var self = this;\n\n // Fill the rest with \"children\" of the old genomes\n while(newPopulation.length < this._populationSize)\n {\n var parent0 = this._impl.selectGenome(this._populationStats, totalFitness);\n var parent1 = this._impl.selectGenome(this._populationStats, totalFitness);\n \n // TODO: Force parents to be different?\n \n // Add all of the children, resulting from this crossover, into the new population, after maybe-mutating them.\n // If this causes the population to become bigger than _populationSize, it will be sliced down after scoring.\n newPopulation = newPopulation.concat(this._maybeCrossover(parent0, parent1).map((genome) => self._maybeMutate(genome)));\n }\n\n this._population = newPopulation;\n this._impl.population = newPopulation;\n }\n \n this._generation++;\n \n // Population stats, sorted from best to worst fitness-wise\n this._populationStats = this._population.map(\n (g) => ({\n genome : g,\n fitness : this._impl.fitness(g)\n })\n ).sort((stat0, stat1) => stat1.fitness - stat0.fitness);\n\n // If population is bigger than _populationSize, slice it down\n if(this._population.length > this._populationSize)\n {\n this._populationStats = this._populationStats.slice(0, this._populationSize);\n this._population = this._populationStats.map((stat) => stat.genome);\n }\n\n // Update current best, median and worst stats\n this._bestStat = this._populationStats[0];\n this._medianStat = this._populationStats[Math.floor(this._populationSize/2)];\n this._worstStat = this._populationStats[this._populationSize-1];\n\n // Keep track of the all-time best genome\n if(this._bestStat.fitness > this._allTimeBestFitness)\n {\n this._allTimeBestFitness = this._bestStat.fitness;\n this._allTimeBestGenome = this._bestStat.genome;\n this._allTimeBestGeneration = this._generation;\n }\n }", "title": "" }, { "docid": "ce83b0a5bb1852e01b1e99c5770db640", "score": "0.6072557", "text": "createPerfection() {\n this.population[0].weights = PERFECT_WEIGHTS;\n this.population[0].fitness = 20;\n }", "title": "" }, { "docid": "e666f289e2222ddef7c13bba4914046e", "score": "0.5988599", "text": "function updateFitness(ids,fitness,generation){\n// var sortNumbers = function(a,b){if(a<b)return -1;if(a>b)return 1;return 0};\n var last = 0;\n var populationInGeneration = population[generation];\n for(var i=0;i<ids.length;i++){\n for(var j=last;j<populationInGeneration.length;j++){\n \tif(ids[i] == populationInGeneration[j]._id){\n population[generation][j].fitness = fitness[i];\n// \t last = j;\n last=0;\n }\n }\n }\n }", "title": "" }, { "docid": "ee01c6016a9fa7596d5a2e6543ec9059", "score": "0.5963617", "text": "updateFitnessScores() {\r\n\t\tthis.fittestGenome = 0;\r\n\t\tthis.bestFitnessScore = 0;\r\n\t\tthis.totalFitnessScore = 0;\r\n\r\n\t\tconst tempMemory = new GameMap(this.matrix, this.entrance, this.exit, this.rows, this.columns);\r\n\t\t// Update the fitness scores and keep a check on fittest so far.\r\n\t\tfor (let i = 0; i < this.populationSize; i++) {\r\n\t\t\t// Decode each genomes chromosome into a vector of directions.\r\n\t\t\tconst directions = this.decode(this.genomes[i].bits);\r\n\t\t\t// Get its fitness score.\r\n\t\t\tthis.genomes[i].fitness = this.bobMap.testRoute(directions, tempMemory.memory);\r\n\t\t\t// Update total.\r\n\t\t\tthis.totalFitnessScore += this.genomes[i].fitness;\r\n\t\t\t// If this is the fittest genome found so far, store results.\r\n\t\t\tif (this.genomes[i].fitness > this.bestFitnessScore) {\r\n\t\t\t\tthis.bestFitnessScore = this.genomes[i].fitness;\r\n\t\t\t\tthis.fittestGenome = i;\r\n\t\t\t\tthis.bobBrain.setMemory(tempMemory.memory);\r\n // Has Bob found the exit?\r\n //console.log('fitness: ' + (this.genomes[i].fitness - 1.0));\r\n\t\t\t\tif (this.genomes[i].fitness == 1.0) {\r\n\t\t\t\t\t// If so, stop the run.\r\n this.busy = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttempMemory.resetMemory();\r\n\t\t} // next genome\r\n }", "title": "" }, { "docid": "ab6dac5a8980b82669c325b8c9b61259", "score": "0.59600246", "text": "function SetPopulation(){\n\tif(!cancelScript && !scriptCompleted){\n\t\tif(matingPoolFilled && aMatingPool.length > 0){\n\t\t\tif(aPopulation.length < iPopulationSize){\n\t\t\t\tdocument.getElementById('alertHeader').innerHTML = \"Running Script...\";\n\t\t\t\tvar iGeneLength = sTargetText.length;\n\t\t\t\tif(IsInt(iGeneLength) && iGeneLength > 0){\n\t\t\t\t\tvar aGene = new Array(iGeneLength);\n\t\t\t\t\tvar p1 = aMatingPool[GetRandomInt(0, aMatingPool.length-1)];\n\t\t\t\t\tvar p2 = aMatingPool[GetRandomInt(0, aMatingPool.length-1)];\n\t\t\t\t\twhile(p1 == p2){\n\t\t\t\t\t\tp2 = aMatingPool[GetRandomInt(0, aMatingPool.length-1)];\n\t\t\t\t\t}\n\t\t\t\t\tfor(var index = 0; index < iGeneLength; ++index){\n\t\t\t\t\t\tvar parent = GetRandomInt(0, 1);\n\n\t\t\t\t\t\tif(parent == 1){\n\t\t\t\t\t\t\taGene[index] = p1[index];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\taGene[index] = p2[index];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\taPopulation[hfIndex] = aGene;\n\t\t\t\t\t++hfIndex;\n\t\t\t\t}\n\t\t\t\tsetTimeout(SetPopulation, 0);\n\t\t\t}else{\n\t\t\t\thfIndex = 0;\n\t\t\t\tmatingPoolFilled = false;\n\t\t\t\tcycleComplete = true;\n\t\t\t\taMatingPool = [];\n\t\t\t\tMutatePopulation();\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "28b1540c09d3ea0439259e298e58aed1", "score": "0.5950336", "text": "function getMaxFitness() {\n var record = 0;\n for (var i = 0; i < specimens.length; i++) {\n if (specimens[i].fitness > record) {\n record = specimens[i].fitness;\n }\n }\n return record;\n \n }", "title": "" }, { "docid": "86b6e746716e03bdaf8a2a11acab559c", "score": "0.5935772", "text": "function grabNBest(n, c, pop) {\n // add the required amount of copies of the n most fittest \n while (n--) {\n for (var i = 0; i < c; ++i) {\n pop.push(population[(popultionSize - 1) - n]);\n }\n }\n }", "title": "" }, { "docid": "db1acce40ad288001e93f4c374a8e854", "score": "0.5917026", "text": "generate() {\r\n if (this.matingPool.length !== 0) {\r\n \r\n let newPop = [];\r\n for (let i = 0; i < this.maxPopulation; i++) {\r\n let parentA = this.matingPool[this.randFloor(0, this.matingPool.length - 1)];\r\n let parentB = this.matingPool[this.randFloor(0, this.matingPool.length - 1)];\r\n let child = this.crossover(parentA.arrayTree, parentB.arrayTree);\r\n\r\n this.mutate(this.mutationRate, child);\r\n this.additionMutate(child, this.values);//mutacion por agregacion\r\n\r\n let tree = this.arrayToTree(child);//se transforma el nuevo hijo que es un array en un arbol\r\n tree.arrayTree = child;\r\n\r\n tree.calcFitness(this.getTreeResult(child, this.values), this.result);\r\n newPop.push(tree);\r\n }\r\n this.population = newPop; //se reemplaza la antigua poblacion\r\n this.generations++;\r\n } else {\r\n alert(\"La reproducción no ha sido favorable, no existe ningún padre apto del cual generar una solución. Pruebe nuevamente\");\r\n }\r\n }", "title": "" }, { "docid": "199fadd2f8af0846f6d7ae777de054e1", "score": "0.59033287", "text": "runEpoch(population, populationProfits, populationSharpes, populationScores) {\n let selectionProb = [];\n let fitnessSum = 0;\n let maxFitness = [0, 0, 0, 0];\n\n for (let i = 0; i < this.populationAmt; i++) {\n\n if (this.mainObjective == 'score') {\n\n if (populationProfits[i] < 0 && populationSharpes[i] < 0) {\n\n populationScores[i] = (populationProfits[i] * populationSharpes[i]) * -1;\n\n } else {\n\n populationScores[i] = Math.tanh(populationProfits[i] / 3) * Math.tanh(populationSharpes[i] / 0.25);\n\n }\n\n if (populationScores[i] > maxFitness[2]) {\n\n maxFitness = [populationProfits[i], populationSharpes[i], populationScores[i], i];\n\n }\n\n } else if (this.mainObjective == 'profit') {\n\n if (populationProfits[i] > maxFitness[0]) {\n\n maxFitness = [populationProfits[i], populationSharpes[i], populationScores[i], i];\n\n }\n\n } else if (this.mainObjective == 'profitForMinSharpe') {\n\n if (populationProfits[i] > maxFitness[0] && populationSharpes[i] >= this.minSharpe) {\n\n maxFitness = [populationProfits[i], populationSharpes[i], populationScores[i], i];\n\n }\n\n }\n\n fitnessSum += populationProfits[i];\n\n }\n\n if (fitnessSum === 0) {\n\n for (let j = 0; j < this.populationAmt; j++) {\n\n selectionProb[j] = 1 / this.populationAmt;\n\n }\n\n } else {\n for (let j = 0; j < this.populationAmt; j++) {\n selectionProb[j] = populationProfits[j] / fitnessSum;\n }\n\n }\n\n let newPopulation = [];\n\n while (newPopulation.length < this.populationAmt * (1 - this.variation)) {\n\n let a, b;\n let selectedProb = randomExt.float(1, 0);\n\n for (let k = 0; k < this.populationAmt; k++) {\n\n selectedProb -= selectionProb[k];\n\n if (selectedProb <= 0) {\n\n a = population[k];\n break;\n\n }\n\n }\n selectedProb = randomExt.float(1, 0);\n\n for (let k = 0; k < this.populationAmt; k++) {\n\n selectedProb -= selectionProb[k];\n\n if (selectedProb <= 0) {\n\n b = population[k];\n break;\n\n }\n\n }\n\n let res = this.crossover(this.mutate(a, this.mutateElements), this.mutate(b, this.mutateElements));\n newPopulation.push(res[0]);\n newPopulation.push(res[1]);\n\n }\n\n for (let l = 0; l < this.populationAmt * this.variation; l++) {\n\n newPopulation.push(this.createGene('all'));\n\n }\n\n return [newPopulation, maxFitness];\n }", "title": "" }, { "docid": "ae279d3b8f94ea2868aabbabf9ca886d", "score": "0.5898348", "text": "constructor(dtSet, iniParent, maxPop, mutRate) {\r\n\r\n //datos iniciales o entradas\r\n this.dataSet = dtSet;\r\n this.initialParent = [this.unidimentionalArrayToTree(iniParent)];\r\n this.maxPopulation = maxPop;\r\n this.mutationRate = mutRate;\r\n\r\n //datos del algoritmo\r\n this.variables = iniParent.filter(v => this.isLetter(v));\r\n this.values = [];\r\n this.result;\r\n this.population = [];\r\n this.matingPool = [];\r\n this.generations = 0;\r\n this.perfectScore = 100;\r\n this.bestSolution = \"\";\r\n this.finished = false;\r\n\r\n //genes para mutacion\r\n this.signs = ['-', '*', '/', \"+\"];\r\n this.numberOrLetter = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];\r\n\r\n //proceso de inicializacion de la poblacion\r\n this.assignValues();\r\n this.initPopulation(this.initialParent);\r\n this.initialPopulation = this.population.slice();//copia de la poblacion inicial\r\n this.includeValuesToGens();\r\n }", "title": "" }, { "docid": "a00285e8be298dc9f8fc68c806f9b1d1", "score": "0.58952093", "text": "function poolSelection(birds) {\n\t// Start at 0\n\tlet index = 0;\n\n\t// Pick a random number between 0 and 1\n\tlet r = random(1);\n\n\t// Keep subtracting probabilities until you get less than zero\n\t// Higher probabilities will be more likely to be fixed since they will\n\t// subtract a larger number towards zero\n\twhile (r > 0) {\n\t\tr -= birds[index].fitness;\n\t\t// And move on to the next\n\t\tindex += 1;\n\t}\n\n\t// Go back one\n\tindex -= 1;\n\n\t// Make sure it's a copy!\n\t// (this includes mutation)\n\treturn birds[index].copy();\n}", "title": "" }, { "docid": "0edf93d957c054fd368310e2e0109023", "score": "0.58916146", "text": "function generateNewPopulation()\n {\n let oldSpeciesRep = species.map((v) => v[Math.floor(Math.random() * v.length)]) // Representative of the old species used to speciate new population\n let newSpecies = [] // Networks separated into new species\n\n // Speciate entire population\n for (let i = 0; i < population.length; i++) {\n let foundSpecies = false\n for (let j = 0; j < oldSpeciesRep.length && !foundSpecies; j++) {\n if (compatibility(population[i].getGenome(), oldSpeciesRep[j], compatibilitySpecs.c1, compatibilitySpecs.c2, compatibilitySpecs.c3) < compatibilitySpecs.threshold) { // If net meets compatibility threshold of rep\n newSpecies[j] = [...(newSpecies[j] ?? []), population[i]] // Add to species\n foundSpecies = true\n }\n }\n\n // If no species found create a new species\n if (!foundSpecies) {\n newSpecies.push([population[i]])\n oldSpeciesRep.push(population[i].getGenome())\n }\n }\n // Order on score\n newSpecies.forEach(s => s.sort((a, b) => a.getScore() - b.getScore()))\n\n // Find fitness of each member relative to their species size\n let adjustedFitnesses = newSpecies.map(v => v.map(n => (n.getScore() / v.length)))\n // Use that to find the species distribution of the new population\n let totalFitness = adjustedFitnesses.reduce((sum, val) => val.reduce((c, v) => c + v, 0) + sum, 0)\n let reproductionDistribution = (totalFitness > 0) \n ? adjustedFitnesses.map((val) => val.reduce((c,v) => c + v, 0) / totalFitness).map((v) => Math.round(v * populationSize))\n : adjustedFitnesses.map((v) => v.length)\n\n // Cull weak members\n let percentileFitnesses = adjustedFitnesses.map((v) => v[Math.round((v.length - 1) * repPercentile)])\n let reproducers = newSpecies.map((v, i) => v.filter((_, j) => adjustedFitnesses[i][j] >= percentileFitnesses[i]))\n\n // Generate new population\n let newPopulation = []\n for (let i = 0; i < reproducers.length; i++) {\n for (let j = 0; j < reproductionDistribution[i]; j++) {\n let net1 = reproducers[i][Math.floor(Math.random() * reproducers[i].length)]\n let net2 = reproducers[i][Math.floor(Math.random() * reproducers[i].length)]\n newPopulation.push(crossover(net1, net2, `${i}_${j}`))\n }\n }\n\n // Mutate weights\n newPopulation.forEach(n => n.mutateWeights(wMutationR))\n\n // Mutate structure\n newPopulation.forEach(n => n.mutateStructure(sMutationR, sMutationSplit, addInnovations))\n\n // Generate networks\n newPopulation.forEach(n => n.generateNetwork())\n\n // Update\n species = newSpecies.map(s => s.map(nn => nn.getGenome())).filter(s => s?.length > 0) // Filter extinct\n population = [...newPopulation]\n }", "title": "" }, { "docid": "08b12dca5e40d613a749bac06fdba6bd", "score": "0.58746", "text": "function Population(numberOfIndividuals, numberOfTraits, possibleTraits, desiredTraits){\n\t\n\tvar Individual = require('./Individual');\n\n\t// PROPERTIES\n\t// TODO: Configuration file.\n\tvar defaultPossibleTraits = new Array( \"red\", \"blue\", \"yellow\", \"green\", \"turquoise\", \"purple\", \"orange\", \"brown\", \"black\", \"white\");\n\tvar defaultDesiredTraits = new Array(\"turquoise\", \"purple\");\n\tvar defaultNumberOfIndividuals = 10;\n\tvar defaultNumberOfTraits = 3;\n\tvar defaultChanceOfMutation = 0.05;\n\n\tthis.numberOfIndividuals = typeof numberOfIndividuals !== 'undefined' ? numberOfIndividuals : defaultNumberOfIndividuals;\n\tthis.numberOfTraits = typeof numberOfTraits !== 'undefined' ? numberOfTraits : defaultNumberOfTraits;\n\tthis.possibleTraits = typeof possibleTraits !== 'undefined' ? possibleTraits : defaultPossibleTraits;\n\tthis.desiredTraits = typeof desiredTraits !== 'undefined' ? desiredTraits : defaultDesiredTraits;\n\n\n\tthis.newGeneration = function(numberOfIndividuals, numberOfTraits, possibleTraits){\n\n\t\tvar numberOfIndividuals = typeof numberOfIndividuals !== 'undefined' ? numberOfIndividuals : defaultNumberOfIndividuals;\n\t\tvar numberOfTraits = typeof numberOfTraits !== 'undefined' ? numberOfTraits : defaultNumberOfTraits;\n\t\tvar possibleTraits = typeof possibleTraits !== 'undefined' ? possibleTraits : defaultPossibleTraits;\n\t\tvar generation = new Array();\n\n\t\tfor (var i = 0; i < this.numberOfIndividuals; i++) {\n\t\t\tvar individual = new Individual(this.numberOfTraits, this.possibleTraits);\n\t\t\tgeneration.push(individual);\n\t\t}\n\n\t\treturn generation;\n\n\t}\n\n\tthis.lastGeneration = new Array();\n\tthis.currentGeneration = this.newGeneration();\n\n\n\t// GENETIC OPERATORS\n\t//TODO: test more\n\t// TODO: make work right\n\tthis.evolve = function(desiredTraits, generation){\n\n\t\tthis.lastGeneration = this.currentGeneration;\n\t\tvar desiredTraits = typeof desiredTraits !== 'undefined' ? desiredTraits : this.desiredTraits;\n\t\tvar generation = typeof generation !== 'undefined' ? generation : this.currentGeneration;\n\t\tvar mostFitParent = this.findAMostFitIndividual(generation);\n\t\tvar selection = this.selectFitMembers(generation.length, generation);\n\t\tvar nextGeneration = new Array();\n\t\tvar indexOfUnfitChild = null;\n\n\t\tnextGeneration = this.crossoverGeneration(selection);\n\t\tnextGeneration = this.mutateGeneration(defaultChanceOfMutation, nextGeneration);\n\n\t\tindexOfUnfitChild = this.findIndexOfALeastFitIndividual(nextGeneration);\n\t\tnextGeneration[indexOfUnfitChild] = mostFitParent;\n\t\tthis.currentGeneration = nextGeneration;\n\n\t\treturn nextGeneration;\n\n\t}\n\n\tthis.evaluate = function(desiredTraits, generation){\n\n\t\tvar desiredTraits = typeof desiredTraits !== 'undefined' ? desiredTraits : this.desiredTraits;\n\t\tvar generation = typeof generation !== 'undefined' ? generation : this.currentGeneration;\n\n\t\tfor (var i = 0; i < generation.length; i++) {\n\t\t\tgeneration[i].evaluate(desiredTraits);\n\t\t}\n\n\t\treturn generation;\n\n\t}\n\n\tthis.averageFitness = function(generation){\n\n\t\tvar generation = typeof generation !== 'undefined' ? generation : this.currentGeneration;\n\t\tvar totalFitness = 0;\n\n\t\tfor (var i = 0; i < generation.length; i++) {\n\t\t\ttotalFitness += generation[i].fitness;\n\t\t}\n\n\t\treturn (totalFitness / generation.length);\n\n\t}\n\n\t// TODO: Always make sure previous fittest individuals survive. \n\t// TODO: When choosing random individuals, always choose fittest members.\n\tthis.selectFitMembers = function(numberOfIndividuals, generation){\n\n\t\tvar numberOfIndividuals = typeof numberOfIndividuals !== 'undefined' ? numberOfIndividuals : defaultNumberOfIndividuals;\n\t\tvar generation = typeof generation !== 'undefined' ? generation : this.currentGeneration;\n\t\tvar fitIndividuals = this.allFitIndividuals(generation);\n\t\tvar selection = new Array();\n\t\tfor (var i = 0; i < numberOfIndividuals; i++) {\n\t\t\t\n\t\t\tif(i < fitIndividuals.length){\n\t\t\t\tselection.push(fitIndividuals[i]);\n\t\t\t} else {\n\t\t\t\tselection.push(this.findRandomFitIndividual(fitIndividuals));\n\t\t\t}\n\n\t\t};\n\n\t\treturn selection;\n\n\t}\n\n\tthis.mutateGeneration = function(chance, generation){\n\n\t\tvar generation = typeof generation !== 'undefined' ? generation : this.currentGeneration;\n\t\tvar chance = typeof chance !== 'undefined' ? chance : defaultChanceOfMutation;\n\t\t\n\t\tfor (var i = 0; i < generation.length; i++) {\n\t\t\tgeneration[i].mutate();\n\t\t}\n\n\t\treturn generation;\n\n\t}\n\n\tthis.crossoverGeneration = function(generation, crossoverPoint){\n\n\t\tvar generation = typeof generation !== 'undefined' ? generation : this.currentGeneration;\n\t\tvar crossoverPoint = typeof crossoverPoint !== 'undefined' ? crossoverPoint : Math.floor(generation[0].traits.length / 2);\n\t\tvar nextGeneration = new Array();\n\n\t\tfor (var i = 0; i < generation.length; i++) {\n\t\t\tnextGeneration.push(this.crossover(generation[i]));\n\t\t}\n\n\t\treturn nextGeneration;\n\n\t}\n\n\t// TODO: Do a real crossover and prouce two children\n\tthis.crossover = function(individual, mate, crossoverPoint, generation){\n\n\t\t// this default mate selection will drive fitness up. yay! except watch for local maximums.\n\t\tvar mate = typeof mate !== 'undefined' ? mate : this.findRandomFitOrFitterIndividual();\n\t\tvar crossoverPoint = typeof crossoverPoint !== 'undefined' ? crossoverPoint : Math.floor(individual.traits.length / 2);\n\t\tvar generation = typeof generation !== 'undefined' ? generation : this.currentGeneration;\n\t\tvar child = new Individual();\n\n\t\tfor (var i = 0; i < child.traits.length; i++) {\n\t\t\tif(i < crossoverPoint){\n\t\t\t\tchild.traits[i] = individual.traits[i];\n\t\t\t} else {\n\t\t\t\tchild.traits[i] = mate.traits[i];\n\t\t\t}\n\t\t}\n\n\t\tchild.evaluate();\n\n\t\treturn child;\n\t}\n\n\tthis.findAMostFitIndividual = function(generation){\n\n\t\tvar generation = typeof generation !== 'undefined' ? generation : this.currentGeneration;\n\t\tvar fittest = new Individual();\n\n\t\tfor (var i = 0; i < generation.length; i++) {\n\t\t\tif(generation[i].fitness >= fittest.fitness){\n\t\t\t\tfittest = generation[i];\n\t\t\t}\n\t\t}\n\n\t\treturn fittest;\n\n\t}\n\n\tthis.findALeastFitIndividual = function(generation){\n\n\t\tvar generation = typeof generation !== 'undefined' ? generation : this.currentGeneration;\n\t\tvar leastFit = new Individual();\n\t\tvar leastFitIndex = 0;\n\n\t\tfor (var i = 0; i < generation.length; i++) {\n\t\t\tif(generation[i].fitness <= leastFit.fitness){\n\t\t\t\tleastFit = generation[i];\n\t\t\t\tleastFitIndex = i;\n\t\t\t}\n\t\t}\n\n\t\treturn leastFit;\n\n\t}\n\n\tthis.findIndexOfALeastFitIndividual = function(generation){\n\n\t\tvar generation = typeof generation !== 'undefined' ? generation : this.currentGeneration;\n\t\tvar leastFit = new Individual();\n\t\tvar leastFitIndex = 0;\n\n\t\tfor (var i = 0; i < generation.length; i++) {\n\t\t\tif(generation[i].fitness <= leastFit.fitness){\n\t\t\t\tleastFit = generation[i];\n\t\t\t\tleastFitIndex = i;\n\t\t\t}\n\t\t}\n\n\t\treturn leastFitIndex;\n\n\t}\n\n\tthis.findRandomFitOrFitterIndividual = function(fitness, generation){\n\n\t\tvar fitness = typeof fitness !== 'undefined' ? fitness : 1;\n\t\tvar fitOrFitterIndividuals = this.allFitIndividuals(generation, fitness);\n\t\tvar generation = typeof generation !== 'undefined' ? generation : this.currentGeneration;\n\n\t\tif (fitOrFitterIndividuals.length != 0){\n\t\t\tvar randomInt = this.getRandomInt(0, fitOrFitterIndividuals.length - 1);\n\t\t\treturn fitOrFitterIndividuals[randomInt];\t\t\t\n\t\t}\n\t\treturn null;\n\n\t}\n\n\tthis.findRandomFitIndividual = function(generation){\n\n\t\tvar generation = typeof generation !== 'undefined' ? generation : this.currentGeneration;\n\t\tvar fitIndividuals = this.allFitIndividuals(generation);\n\n\t\tif (fitIndividuals.length > 0){\n\t\t\tvar randomInt = this.getRandomInt(0, fitIndividuals.length - 1);\n\t\t\treturn fitIndividuals[randomInt];\t\t\t\n\t\t}\n\n\t\treturn null;\n\n\t}\n\n\tthis.allFitIndividuals = function(generation, fitness){\n\n\t\tvar fitness = typeof fitness !== 'undefined' ? fitness : 1;\n\t\tvar generation = typeof generation !== 'undefined' ? generation : this.currentGeneration;\n\n\t\tvar fitIndividuals = new Array();\n\n\t\tfor (var i = 0; i < generation.length; i++) {\n\t\t\tif(generation[i].fitness >= fitness){\n\t\t\t\tfitIndividuals.push(generation[i]);\n\t\t\t}\n\t\t}\n\n\t\treturn fitIndividuals;\n\n\t}\n\n\t// HELPERS\n\tthis.getRandomInt = function(min, max) {\n \treturn Math.floor(Math.random() * (max - min + 1)) + min;\n\t}\n\n\t// PRINTS\n\tthis.prettyPrintGeneration = function(generation){\n\n\t\tvar generation = typeof generation !== 'undefined' ? generation : this.currentGeneration;\n\n\t\tfor (var i = 0; i < generation.length; i++) {\n\t\t\tconsole.log('(' + i + ')');\n\t\t\tgeneration[i].prettyPrint();\n\t\t}\n\n\t}\n\n}", "title": "" }, { "docid": "c6c680fbda3b023756b184d54f1a772c", "score": "0.5867002", "text": "function calculateFitness(idx){\n fitness[idx]= project.fitnessFunction(population[idx]);\n return fitness[idx];\n }", "title": "" }, { "docid": "238fe25397890007fabbfbde3789eebc", "score": "0.5866008", "text": "calculateFitness() {\n this.fitnessScore = this.gameScore ** 2;\n }", "title": "" }, { "docid": "70cf7dbd4bed01eec65d8be9ad12fb02", "score": "0.5861824", "text": "function setbest(){\n\t\t\t\tif(game === 1){\n\t\t\t\t\tgmstats1[0] = level;\n\t\t\t\t\tgmstats1[1] = speed;\n\t\t\t\t\tlocalstore.statstock(\"statsets1\", gmstats1);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tgmstats2[0] = level;\n\t\t\t\t\tgmstats2[1] = speed;\n\t\t\t\t\tlocalstore.statstock(\"statsets2\", gmstats2);\n\t\t\t\t}\n\t\t\t\tbestalert = 0;\n\t\t\t\tuserProgress.notbest();\n\t\t\t\t\n\t\t\t}", "title": "" }, { "docid": "c8c68559e59e8bbf47cf49eaa437a0d3", "score": "0.5860045", "text": "select()\r\n {\r\n // Chooses two random fitness values from two random individuals\r\n let index1 = Math.floor(Math.random(0, 9));\r\n let selection1 = this.fitnessPool[index1];\r\n let index2 = Math.floor(Math.random(0, 9));\r\n let selection2 = this.fitnessPool[index2];\r\n \r\n // Compares an returns chromosome with higher fitness\r\n if(selection1 > selection2)\r\n {\r\n return this.chromPool[index1];\r\n }\r\n else\r\n {\r\n return this.chromPool[index2];\r\n }\r\n }", "title": "" }, { "docid": "dceac02d40a84259b58751495bc19757", "score": "0.5859397", "text": "newGeneration() {\n // Set fitness\n this.setAllFitness();\n // Reset\n this.reset();\n super.newGeneration();\n }", "title": "" }, { "docid": "59c7675639064e6aca94cf973134e7a9", "score": "0.58591104", "text": "function pickOne() {\n // Start at 0\n var index = 0;\n\n // Pick a random number between 0 and 1\n var r = random(1);\n\n // Keep subtracting probabilities until you get less than zero\n // Higher probabilities will be more likely to be fixed since they will\n // subtract a larger number towards zero\n while (r > 0) {\n r -= population[index].fitness;\n // And move on to the next\n index += 1;\n }\n\n // Go back one\n index -= 1;\n\n return population[index];\n}", "title": "" }, { "docid": "59c7675639064e6aca94cf973134e7a9", "score": "0.58591104", "text": "function pickOne() {\n // Start at 0\n var index = 0;\n\n // Pick a random number between 0 and 1\n var r = random(1);\n\n // Keep subtracting probabilities until you get less than zero\n // Higher probabilities will be more likely to be fixed since they will\n // subtract a larger number towards zero\n while (r > 0) {\n r -= population[index].fitness;\n // And move on to the next\n index += 1;\n }\n\n // Go back one\n index -= 1;\n\n return population[index];\n}", "title": "" }, { "docid": "277e69671d5bc96260c4522fc57bf117", "score": "0.5835395", "text": "function poolSelection(birds) {\n // Start at 0\n let index = 0;\n // Pick a random number between 0 and 1\n let r = random(1);\n // Keep subtracting the fitness until you get less than zero\n // Higher fitness will be more likely to be fixed since they will\n // subtract a larger number towards zero\n while (r > 0) {\n r -= birds[index].fitness;\n // And move on to the next\n index += 1;\n }\n // If r < 0 go back one to select the bird that made r < 0\n index -= 1;\n // Copy of the bird, bird.copy() mutates the brain aswell\n return birds[index].copy();\n}", "title": "" }, { "docid": "9544ec5f4b9f0dfad14b23e0a2416950", "score": "0.58180106", "text": "createMatingPool() {\r\n // Clear the past mating pool\r\n this.matingPool = [];\r\n for (let i = 0; i < this.population.length; i++) {\r\n let n = floor(this.population[i].fitness * 10); // Arbitrary multiplier\r\n for (let j = 0; j < n; j++) { // and pick two random numbers\r\n this.matingPool.push(this.population[i]);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "96a248d217f5ee28e4c72fbc92d4d8e2", "score": "0.58173305", "text": "calculateGoal(fitness){\n return 80 * fitness + 2000;\n }", "title": "" }, { "docid": "6a09990e3bd7651a8749a9d0ec1fb7fc", "score": "0.581194", "text": "function Population(m, num) {\n this.mutationRate = m; // Mutation rate\n this.population = []; // Array to hold the current population\n this.matingPool = []; // ArrayList which we will use for our \"mating pool\"\n this.generations = 0; // Number of generations\n this.maxFitness = 9999;\n this.fitestRocket = null;\n //make a new set of creatures\n for (var i = 0; i < num; i++) {\n var location = createVector(width/2,height+20);\n this.population[i] = new Rocket(location, new DNA(), i);\n }\n\n this.live = function() {\n // Run every rocket\n for (var i = 0; i < this.population.length; i++) {\n this.population[i].run();\n }\n };\n\n // Calculate fitness for each creature\n this.fitness = function() {\n for (var i = 0; i < this.population.length; i++) {\n this.population[i].calcFitness();\n }\n };\n\n // Generate a mating pool\n this.selection = function() {\n // Clear the ArrayList\n this.matingPool = [];\n\n // Calculate total fitness of whole population\n var maxFitness = this.maxFitness = this.getMaxFitness();\n // Calculate fitness for each member of the population (scaled to value between 0 and 1)\n // Based on fitness, each member will get added to the mating pool a certain number of times\n // A higher fitness = more entries to mating pool = more likely to be picked as a parent\n // A lower fitness = fewer entries to mating pool = less likely to be picked as a parent\n for (var i = 0; i < this.population.length; i++) {\n var fitnessNormal = map(this.population[i].getFitness(),0,maxFitness,0,1); // In proportion to max fitness\n var n = floor(fitnessNormal * 100); // Arbitrary multiplier\n // console.log(\"Rocket \" + this.population[i].id + \" Number of times added: \", n);\n for (var j = 0; j < n; j++) {\n this.matingPool.push(this.population[i]);\n }\n }\n };\n\n // Making the next generation\n this.reproduction = function() {\n // Refill the population with children from the mating pool\n for (var i = 0; i < this.population.length; i++) {\n // Sping the wheel of fortune to pick two parents\n var m = floor(random(this.matingPool.length));\n var d = floor(random(this.matingPool.length));\n // Pick two parents\n var mom = this.matingPool[m];\n var dad = this.matingPool[d];\n // Get their genes\n var momgenes = mom.getDNA();\n var dadgenes = dad.getDNA();\n // Mate their genes\n var child = momgenes.crossover(dadgenes);\n // Mutate their genes\n child.mutate(this.mutationRate);\n // Fill the new population with the new child\n var location = createVector(width/2,height+20);\n this.population[i] = new Rocket(location, child,i);\n }\n this.generations++;\n };\n\n this.getGenerations = function() {\n return this.generations;\n };\n\n this.getMaxFitnessValue = function () {\n return (this.maxFitness==9999? \"new\" : this.maxFitness);\n }\n\n this.getFitestRocket = function () {\n return this.fitestRocket;\n }\n\n // Find highest fitness for the population\n this.getMaxFitness = function() {\n var record = 0;\n for (var i = 0; i < this.population.length; i++) {\n if(this.population[i].getFitness() > record) {\n record = this.population[i].getFitness();\n this.fitestRocket = this.population[i];\n }\n }\n return record;\n };\n}", "title": "" }, { "docid": "e3c8b72e3d12dc97011aec8237caf986", "score": "0.5809056", "text": "function fitnessProportion(population,mode){\n switch(mode){\n\n case 1 : { // parent selection mode\n\n var newArr = [];\n\n //total fitness\n var totalFitness =getTotalFitness(population);\n\n //calculate proportion\n var i;\n\n for(i=0;i<population.length;i++){\n var proportion = population[i].fitnessScore / totalFitness ;\n \n var obj = {\n s_num : i+1,\n x : population[i].x,\n y : population[i].y,\n fitnessScore : population[i].fitnessScore,\n proportion : proportion\n }\n\n newArr.push(obj)\n \n }\n\n // calculte commutative\n\n var j;\n\n for(j=0;j<newArr.length;j++){\n\n var commutative ;\n\n if(j==0){\n \n commutative = newArr[j].proportion;\n\n }\n else{\n\n commutative = Number(newArr[j].proportion + newArr[j-1].commutative)\n\n }\n\n var obj2 = {\n s_num : newArr[j].s_num,\n x : newArr[j].x,\n y : newArr[j].y,\n fitnessScore : newArr[j].fitnessScore,\n proportion :newArr[j].proportion,\n commutative : commutative\n }\n newArr[j] = obj2\n }\n console.log(newArr)\n\n // create 2 random number from 0 - 1\n\n \n \n\n // find commutation against random number\n \n\n i=0;\n j=0;\n parentArr=[];\n\n for(i=0;i<2;i++){\n var randomNum = (Math.random() * (1 - 0) + 0);\n var find = false;\n j=0;\n console.log(randomNum)\n while(find===false){\n if(newArr[j].commutative>=randomNum){\n parentArr.push(newArr[j]);\n \n find=true;\n }\n j++;\n }\n }\n\n while(parentArr[0].s_num == parentArr[1].s_num){\n i=0;\n j=0;\n parentArr=[];\n\n for(i=0;i<2;i++){\n var randomNum = (Math.random() * (1 - 0) + 0);\n var find = false;\n j=0;\n console.log(randomNum)\n while(find===false){\n if(newArr[j].commutative>=randomNum){\n parentArr.push(newArr[j]);\n \n find=true;\n }\n j++;\n }\n }\n\n }\n\n \n return clearArr(parentArr);\n \n \n \n }\n break;\n\n\n\n case 2 : { // survival selection mode\n\n var newArr = [];\n\n //total fitness\n var totalFitness =getTotalFitness(population);\n\n //calculate proportion\n var i;\n\n for(i=0;i<population.length;i++){\n var proportion = population[i].fitnessScore / totalFitness ;\n \n var obj = {\n s_num : i+1,\n x : population[i].x,\n y : population[i].y,\n fitnessScore : population[i].fitnessScore,\n proportion : proportion\n }\n\n newArr.push(obj)\n \n }\n\n // calculte commutative\n\n var j;\n\n for(j=0;j<newArr.length;j++){\n\n var commutative ;\n\n if(j==0){\n \n commutative = newArr[j].proportion;\n\n }\n else{\n\n commutative = Number(newArr[j].proportion + newArr[j-1].commutative)\n\n }\n\n var obj2 = {\n s_num : newArr[j].s_num,\n x : newArr[j].x,\n y : newArr[j].y,\n fitnessScore : newArr[j].fitnessScore,\n proportion :newArr[j].proportion,\n commutative : commutative\n }\n newArr[j] = obj2\n }\n console.log(newArr)\n\n // create 2 random number from 0 - 1\n\n \n \n\n // find commutation against random number\n \n\n i=0;\n j=0;\n parentArr=[];\n\n while(parentArr.length!=n){\n var randomNum = (Math.random() * (1 - 0) + 0);\n var find = false;\n j=0;\n console.log(randomNum)\n while(find===false){\n if(newArr[j].commutative>=randomNum){\n\n if(i!=0){\n console.log('this1')\n if(parentArr.indexOf(newArr[j])===-1){\n console.log('this2')\n parentArr.push(newArr[j]);\n \n find=true; \n }\n find=true;\n \n }\n else{\n parentArr.push(newArr[j]);\n \n find=true;\n }\n \n }\n j++;\n }\n i++;\n }\n\n console.log(parentArr);\n\n return clearArr(parentArr);\n\n }\n break;\n\n\n }\n}", "title": "" }, { "docid": "bcaa4a8caaa15d20b706e1682bba6883", "score": "0.5800981", "text": "set max(value) {}", "title": "" }, { "docid": "bcaa4a8caaa15d20b706e1682bba6883", "score": "0.5800981", "text": "set max(value) {}", "title": "" }, { "docid": "6f99869d2aaa7fa7fac76dcfd5a7f9b1", "score": "0.5750092", "text": "calculateFitness() {\n for (var i =0; i<= this.pop_size - 1; i++) {\n this.players[i].calculateFitness();\n //print(\" player: \" + i + \" points: \" + players[i].score + \" fitness: \" + players[i].fitness); \n }\n }", "title": "" }, { "docid": "61c909d9134bec6d90602250f244cd9f", "score": "0.57429147", "text": "naturalSelection() {\n\n var newPlayers = [];//Create new players array for the next generation\n this. setBestPlayer();//set which player is the best\n\n newPlayers[0] = this.players[this.bestPlayerNo].clone();//add the best player of this generation to the next generation without mutation\n for (var i = 1; i<=this.pop_size - 1; i++) {\n //for each remaining spot in the next generation\n //if (i<pop_size/3) {\\\n if(i < 35) {\n newPlayers[i] = this.players[this.bestPlayerNo].clone();//select a random player(based on fitness) and clone it\n } else if(i >= 35 && i < 300) {\n newPlayers[i] = this.selectPlayer().clone();\n } else {\n newPlayers[i] = this.selectPlayer().crossover(this.selectPlayer());\n }\n //newPlayers[i].mutate(); //mutate it\n }\n for(var k = 10; k <= this.pop_size -1; k++) {\n newPlayers[k].mutate();\n }\n\n //NEED TO ITERATE THROUGH PLAYERS\n for(var i = 0; i<=this.pop_size - 1; i++) {\n this.players[i] = newPlayers[i].clone();\n }\n this.gen+=1;\n //print(\" `max` fitness: \" + max);\n //print(\" max points: \" + players[maxIndex].score);\n //print(\" max index: \" + maxIndex);\n }", "title": "" }, { "docid": "f02aa058295f70d65929a14af52b588a", "score": "0.5740086", "text": "addFit() {\n this.fitness += 0.25;\n }", "title": "" }, { "docid": "3177fbcb4c541cc453fb05f238f2b716", "score": "0.5737697", "text": "function poolSelection(agents) {\n // Start at 0\n let index = 0;\n\n // Pick a random number between 0 and 1\n let r = Math.random();\n\n\n // Keep subtracting probabilities until you get less than zero\n // Higher probabilities will be more likely to be fixed since they will\n // subtract a larger number towards zero\n while (r > 0) {\n r -= agents[index].fitness;\n // And move on to the next\n index += 1;\n }\n\n // Go back one\n index -= 1;\n\n // Make sure it's a copy!\n // TODO: Crossover\n // (this includes mutation)\n return agents[index].copy();\n}", "title": "" }, { "docid": "caefbc5c5afdadae380e05f47a1ea0cf", "score": "0.57289934", "text": "function getMaxGoodoidFitness() {\n var maxFitness = 0;\n for (var i = 0; i < goodoidsGenotype.population.length; i++) {\n if (goodoidsGenotype.population[i].fitness > maxFitness) {\n maxFitness = goodoidsGenotype.population[i].fitness;\n }\n }\n return maxFitness;\n}", "title": "" }, { "docid": "a37574b0f7dcfe1a9c026ac47d0c042b", "score": "0.5699505", "text": "function calculateFitness() {\n var currentRecord = Infinity;\n for (var i = 0; i < population.length; i++) {\n var d = calcDistance(cities, population[i]);\n if (d < recordDistance) {\n recordDistance = d;\n bestEver = population[i];\n }\n if (d < currentRecord) {\n currentRecord = d;\n currentBest = population[i];\n }\n\n // This fitness function has been edited from the original video\n // to improve performance, as discussed in The Nature of Code 9.6 video,\n // available here: https://www.youtube.com/watch?v=HzaLIO9dLbA\n fitness[i] = 1 / (pow(d, 8) + 1);\n }\n}", "title": "" }, { "docid": "953975c20fdd4e307261c83f1f29a7f3", "score": "0.5693457", "text": "function tournament_selection( tournament_size, pool_size ) {\n var pool = [];\n if ( tournament_size <= 1 ) {\n\treturn new Error (\"Tournament size too small\");\n }\n do {\n\tvar joust = [];\n\tvar best = this.population[ Math.floor(Math.random()*this.population.length) ] ;\n\tfor ( var i = 1; i < tournament_size; i ++) {\n\t var another= this.population[ Math.floor(Math.random()*this.population.length) ];\n\t if ( this.fitness_of[another] > this.fitness_of[best]) {\n\t\tbest = another;\n\t }\n\t}\n\tpool.push( best );\n } while (pool.length < pool_size );\n return pool;\n}", "title": "" }, { "docid": "8fd1552bce3d1c75bf29a3233d0e5890", "score": "0.56483644", "text": "function selection() {\n // Clear the ArrayList\n matingPool = [];\n\n // Calculate total fitness of whole specimens\n let maxFitness = getMaxFitness();\n\n // Calculate fitness for each member of the specimens (scaled to value between 0 and 1)\n // Based on fitness, each member will get added to the mating pool a certain number of times\n // A higher fitness = more entries to mating pool = more likely to be picked as a parent\n // A lower fitness = fewer entries to mating pool = less likely to be picked as a parent\n for (var i = 0; i < specimens.length; i++) {\n var fitnessNormal = map_range(specimens[i].fitness, 0, maxFitness, 0, 1);\n var n = Math.floor(fitnessNormal * 100); // Arbitrary multiplier\n\n for (var j = 0; j < n; j++) {\n matingPool.push(specimens[i]);\n }\n }\n // return matingPool;\n}", "title": "" }, { "docid": "947fb3299203b9b26e0468717cba705b", "score": "0.5620361", "text": "calcFitness() {\n const getFontScore = (size, max) => {\n if (size > max) {\n const score = 100 - (size - max) * (100 / max);\n return score > 0 ? score : 0;\n } else {\n return size * (100 / max);\n }\n };\n\n this.scores = {\n width: (this.genes.width * this.weights.width),\n heigh: (this.genes.heigh * this.weights.heigh),\n posit: (100 * this.weights.posit * this.weights.dirwe[this.genes.posit]),\n anima: (this.genes.anima === 'flicker' ? 100 * this.weights.anima : 50 * this.weights.anima),\n backg: (100 - (Math.abs(this.genes.backg[2] - 50) + (50 - (this.genes.backg[1] / 2)))),\n trans: ((1 - this.genes.trans) * 100),\n fsize: (getFontScore(this.genes.fsize, 30)),\n fcolo: (Math.abs(this.genes.backg[2] - this.genes.fcolo[2])),\n cleng: (100 - this.genes.cleng < 0 ? 0 : 100 - this.genes.cleng),\n ctawi: (this.genes.ctawi* this.weights.ctawi),\n ctahe: (this.genes.ctahe* this.weights.ctahe),\n ctabg: (100 - (Math.abs(this.genes.ctabg[2] - 50) + (50 - (this.genes.ctabg[1] / 2)))),\n ctafc: (Math.abs(this.genes.ctabg[2] - this.genes.ctafc[2])),\n cexpr: (100 - this.genes.cleng < 0 ? 0 : 100 - this.genes.cleng)\n };\n\n this.fitness = 0;\n\n for (var score in this.scores) {\n this.fitness = this.fitness + this.scores[score];\n }\n }", "title": "" }, { "docid": "a009fa11c752c3ecc6e4aca8d65a55a5", "score": "0.5612894", "text": "function processGA(population) {\n let matingPool = processSelection(population);\n boardsTemp = processReproduction(matingPool, population.length);\n\n //console.log(boardsTemp);\n\n for(let g=0;g<artPopSize;g++){\n boards[g].string = boardsTemp[g];\n boards[g].fitness = 0;\n }\n\n ctx.fillStyle = 'gray';\n ctx.fillRect(borderX, borderYtop, drawAreaW, drawAreaH);\n ctx.strokeRect(borderX, borderYtop, drawAreaW, drawAreaH);\n drawBoards();\n}", "title": "" }, { "docid": "f33c3db3c2f48aab2d73c7173075d2e1", "score": "0.5605371", "text": "function poolSelection(Snakes) {\n // Start at 0\n let index = 0;\n\n // Pick a random number between 0 and 1\n let r = random(1);\n\n // Keep subtracting probabilities until you get less than zero\n // Higher probabilities will be more likely to be fixed since they will\n // subtract a larger number towards zero\n while (r > 0) {\n r -= Snakes[index].fitness;\n //console.log(Circles[index].fitness);\n // And move on to the next\n index += 1;\n }\n\n // Go back one\n index -= 1;\n\n // Make sure it's a copy!\n // (this includes mutation)\n return Snakes[index].copy();\n}", "title": "" }, { "docid": "a4cb8962bb0fdcd3eeee808c1d7b6ad3", "score": "0.55933553", "text": "adjustPopulationGrowth() {\n this._i = this.species.length;\n\n while (this._i--) {\n switch (\n true // Population control\n ) {\n case this.census[this.species[this._i]] > this.initialPopulation * 2: // If overpopulation in progress\n this.reproductionChance[this.species[this._i]] *= 0.999; // Reduce reproduction chance\n break;\n\n case this.census[this.species[this._i]] < this.initialPopulation * 0.8: // If extintion in progress\n this.reproductionChance[this.species[this._i]] *= 1.001; // Increase reproduction chance\n break;\n\n default:\n this.reproductionChance[\n this.species[this._i]\n ] = this.initialReproductionChance[this.species[this._i]];\n break;\n }\n }\n }", "title": "" }, { "docid": "8bab38c16c3339fce2ee14570fa897cc", "score": "0.55921334", "text": "rouletteWheelSelection() {\r\n\t\tconst slice = Math.random() * this.totalFitnessScore;\r\n\t\tlet cfTotal = 0.0;\r\n\t\tlet selectedGenome = 0;\r\n\t\tfor (let i = 0; i < this.populationSize; i++) {\r\n\t\t\tconst genome = this.genomes[i];\r\n\t\t\tcfTotal += genome.fitness;\r\n\t\t\tif (cfTotal > slice) {\r\n\t\t\t\tselectedGenome = i;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n }\r\n\t\treturn selectedGenome;\r\n\t}", "title": "" }, { "docid": "a39ce6974e1ff68948f49e95ddc57628", "score": "0.55885327", "text": "function calculateFitness(){\n //This is the sum of all players scores\n sum = 0;\n //This is the best fitness/score\n bestScore = 0;\n //This is the average fitness/score\n avgFitness = 0;\n \n //Calculate sum\n for (let player of savedPlayers){\n sum += player.score;\n }\n \n //Do this for all players\n for (let player of savedPlayers){\n //Make fitness exponential by squaring it\n player.fitness = Math.pow(player.fitness,2);\n //Normalise fitness\n player.fitness = player.score / sum;\n\n //Check if its the best fitness in the generation\n if(player.score > bestScore){\n bestScore = player.score;\n }\n }\n //Calculate average fitness of the generation\n avgFitness = sum/TOTAL;\n //Display stats\n document.getElementById(\"bestfitness\").innerHTML = bestScore;\n document.getElementById(\"averagefitness\").innerHTML = avgFitness;\n\n}", "title": "" }, { "docid": "1714ad0efbc2716c52d46d3d4b766aaf", "score": "0.5581572", "text": "evolve() {\n this.neat.sort();\n\n this.updateStats();\n\n var new_pop = [];\n\n // Elitism\n for (var i = 0; i < this.neat.elitism; i++) {\n new_pop.push(this.neat.population[i]);\n }\n\n // Breed the next individuals\n for (var i = 0; i < this.neat.popsize - this.neat.elitism; i++) {\n new_pop.push(this.neat.getOffspring());\n }\n\n // Replace the old population with the new population\n this.neat.population = new_pop;\n this.neat.mutate();\n\n this.neat.generation++;\n this.initialize();\n }", "title": "" }, { "docid": "0261c7dd60d1652f2a7c5cc62790a835", "score": "0.5554378", "text": "select()\n {\n let unitIndex = 0;\n let fitnessSum = 0;\n // calculate max fitness\n for(let a = 0; a < this.units.length; a++)\n {\n fitnessSum += this.units[a].fitness;\n }\n\n while(unitIndex < this.units.length-2)\n {\n // select random weighted index\n if(Rand(0, fitnessSum) < this.units[unitIndex].fitness)\n {\n return unitIndex;\n }\n\n fitnessSum -= this.units[unitIndex++].fitness;\n }\n return unitIndex;\n \n }", "title": "" }, { "docid": "a4c2b1cbf4bba947dab206401ea0d650", "score": "0.553832", "text": "function assignBest(best,team) {\n team.push = best;\n}", "title": "" }, { "docid": "056c3144e451b0edcdcd09ba84fc3831", "score": "0.5517123", "text": "function evaluation( new_guys ) {\n for (var i in new_guys) {\n\tif ( !this.fitness_of[new_guys[i]]) {\n//\t console.log( \"eval \" + new_guys[i] );\n\t this.fitness_of[new_guys[i]] = this.fitness_obj.apply( new_guys[i]);\n\t}\n }\n}", "title": "" }, { "docid": "e0ff6b9cd8f3cc9ca58c585866bf06d9", "score": "0.55034775", "text": "function poolSelection(landers) {\r\n // Start at 0\r\n let index = 0;\r\n\r\n // Pick a random number between 0 and 1\r\n let r = random(1);\r\n\r\n // Keep subtracting probabilities until you get less than zero\r\n // Higher probabilities will be more likely to be fixed since they will\r\n // subtract a larger number towards zero\r\n while (r > 0) {\r\n r -= landers[index].fitness;\r\n // And move on to the next\r\n index += 1;\r\n }\r\n\r\n // Go back one\r\n index -= 1;\r\n\r\n // Make sure it's a copy!\r\n // (this includes mutation)\r\n return landers[index].copy();\r\n}", "title": "" }, { "docid": "0475e90e0ce7628ae56a4a592201d86d", "score": "0.5491384", "text": "createInitialPopulation() {\r\n\t\t// Clear existing population.\r\n this.genomes = [];\r\n\t\tfor (let i = 0; i < this.populationSize; i++) {\r\n\t\t\tthis.genomes.push(new Genome(this.chromosomeLength));\r\n }\r\n\r\n\t\t// Reset all variables.\r\n\t\tthis.generation = 0;\r\n\t\tthis.fittestGenome = 0;\r\n\t\tthis.bestFitnessScore = 0;\r\n\t\tthis.totalFitnessScore = 0;\r\n }", "title": "" }, { "docid": "dbb27eedd1ac229d6e43621901892399", "score": "0.54780763", "text": "getBest() {\n let worldrecord = 0;\n let index = 0;\n for (let i = 0; i < this.population.genes.length; i++) {\n if (this.population.genes[i].fitness > worldrecord) {\n index = i;\n worldrecord = this.population.genes[i].fitness;\n }\n }\n\n if (worldrecord === this.perfectScore) {\n this.finished = true;\n }\n return this.population.genes[index].genes.join('');\n }", "title": "" }, { "docid": "42c4d87ddc0f9cab5fdf0b4c30137bc1", "score": "0.5475721", "text": "selectBestGenomes(genomes, keepRatio, populationCount) {\n genomes.sort((g1, g2) => g2.fitness - g1.fitness)\n genomes.length = ~~(keepRatio * populationCount)\n return genomes\n }", "title": "" }, { "docid": "3728757b595d41539b52f5ca843ce30a", "score": "0.54679763", "text": "function placeNewVisitor(){\n options = Array.apply(null, Array(numberOfUrinals)).map(function (_, i) {return i;});//range of possible urinal indexes\n newVisitorIndex = null;\n\n //remove currently occupied urinals\n for(i = options.length - 1; i >= 0; i--){\n if(urinals[options[i]].occupied){\n options.splice(i,1); //remove the index because that urinal is busy\n }\n }\n\n //check if there are any free\n if(options.length == 0){\n //all urinals full, exit\n console.log('MAX CAPACITY REACHED');\n return;\n }\n\n //get minimum neighbors\n var minNeighbors = countNeighbors(options[0]);\n\n for(i = 0;i < options.length;i++){\n if(countNeighbors(options[i]) < minNeighbors){\n minNeighbors = countNeighbors(options[i]);\n }\n }\n\n //keep only the highest privacy urinals that are also free\n for(i = options.length - 1;i >= 0; i--){\n if(countNeighbors(options[i]) > minNeighbors){\n options.splice(i,1);\n }\n }\n\n //take first then last urinal if open and has least neighbors\n if(options.indexOf(0) != -1){\n newVisitorIndex = 0;\n }else if(options.indexOf(urinals.length - 1) != -1){\n newVisitorIndex = urinals.length - 1;\n }else{\n //use the lowest index one (closest to the door)\n newVisitorIndex = options[0];\n }\n\n //if theres a spot to put the new visitor in, place them\n if(newVisitorIndex != null){\n //Put first person from line into the optimal urinal\n urinals[newVisitorIndex].visitor = lineOfPeople.pop();\n urinals[newVisitorIndex].occupied = true;\n urinals[newVisitorIndex].uses++;\n }\n \n\n}", "title": "" }, { "docid": "043fcae7fdedb811eaccf918b931a8da", "score": "0.5463654", "text": "calcFitness() {\n for (let i = 0; i < this.population.genes.length; i++) {\n this.population.genes[i].calcDnaFitness(this.target);\n }\n }", "title": "" }, { "docid": "1476dfb45a5dbd4fc9602b141352a5bb", "score": "0.5432706", "text": "normaliseFitnesses() {\n var fitnessTotal = 0;\n for (let i=0; i<this.population.length; i++) {\n fitnessTotal += this.population[i].fitness;\n }\n for (let i=0; i<this.population.length; i++) {\n this.population[i].fitness /= fitnessTotal;\n }\n }", "title": "" }, { "docid": "f28dc4ae61e8a52f38230b24cf2cce0d", "score": "0.5424054", "text": "generateFirstPopulation() {\n let firstPopulation=new Array();\n if (this.haveModel) {\n firstPopulation = this.generateRandomPopulationWithModel(this.populationSize*100);\n }\n else {\n firstPopulation = this.generateRandomPopulation(this.populationSize*100);\n }\n this.population=this.findBestFrom(firstPopulation,this.populationSize);\n }", "title": "" }, { "docid": "57e75399659db1bfedea88c92ce6cff5", "score": "0.5420232", "text": "function poolSelection(Circles) {\n // Start at 0\n let index = 0;\n\n // Pick a random number between 0 and 1\n let r = random(1);\n\n // Keep subtracting probabilities until you get less than zero\n // Higher probabilities will be more likely to be fixed since they will\n // subtract a larger number towards zero\n while (r > 0) {\n r -= Circles[index].fitness;\n //console.log(Circles[index].fitness);\n // And move on to the next\n index += 1;\n }\n\n // Go back one\n index -= 1;\n\n // Make sure it's a copy!\n // (this includes mutation)\n return Circles[index].copy();\n}", "title": "" }, { "docid": "d16f7c1fef2f37948a1a1d427a0690c3", "score": "0.5418334", "text": "function findHighestPopulation(list) {\n let popCounts = countPopulation(list);\n // return popCounts\n return getHighestPop(popCounts);\n}", "title": "" }, { "docid": "39be652ed3d47a89d3d2034ec0bad863", "score": "0.5409419", "text": "function Simulator(p, num) {\n this.simulation; \n\n\n this.averageFitness;\n this.Record;\n\n\n\n this.ranking2;\n this.alive2; \n this.DNA2\n this.empSpaces2;\n this.fitness;\n\n this.generations2 = 0; // Number of generations\n this.finished2 = false; // Are we finished evolving?\n this.target = p; \n this.simulation; // Target phrase\n this.perfectScore = 1;\n\n\n this.best = \"\";\n this.maxFitness2;\n this.bestMut;\n this.bestPop;\n this.bestDie;\n\n this.ranking2=[];\n this.fitness=[];\n this.alive2=[];\n this.empSpaces2=[];\n this.simulation = [];\n this.DNA2=[];\n for (var i = 0; i < num; i++) {\n this.DNA2[i] = new DNA2(3);\n }\n\n // Fill our fitness array with a value for every member of the population\n this.calcFitness = function() {\n //print(\"1\")\n for (var i = 0; i < num; i++) {\n this.simulation[i] = new Population(this.target,this.DNA2[i].getGen(0),this.DNA2[i].getGen(1))\n }\n\n for (var i = 0; i < this.simulation.length; i++) {\n //print(i, this.generations2);\n var j = 0;\n while(j=0){\n this.simulation[i].calcFitness();\n this.simulation[i].evaluate();\n this.simulation[i].naturalSelection(this.DNA2[i].getGen(1)-this.DNA2[i].getGen(2));\n this.simulation[i].generate(this.DNA2[i].getGen(1)-this.DNA2[i].getGen(2),this.DNA2[i].getGen(2));\n if (this.simulation[i].isFinished()) j=1;\n }\n this.fitness[i]=this.simulation[i].getGenerations()*this.DNA2[i].getGen(2);\n }\n //print(\"2\")\n }\n\n // Generate a mating pool\n this.naturalSelection = function(survivors2) {\n // Clear the ArrayList\n this.maxFitness2 = 0;\n for (var i = 0; i < this.simulation.length; i++) {\n if (this.fitness[i] > this.maxFitness2) {\n this.maxFitness2 = this.fitness[i];\n //print(this.maxFitness2);\n }\n }\n\n for (var i = 0; i < this.simulation.length; i++) {\n var rankingH2=0;\n for (var j = 0; j<this.simulation.length; j++) {\n if(this.fitness[i]<this.fitness[j]){\n rankingH2++;\n } \n }\n this.ranking2[i]=rankingH2;\n }\n\n\n this.empSpaces2=[];\n for(var i=0;i<this.simulation.length;i++){\n if(this.ranking2[i]<survivors2){\n this.alive2[i]=true;\n this.bestMut=this.DNA2[i].getGen(0);\n this.bestPop=this.DNA2[i].getGen(1);\n this.bestDie=this.DNA2[i].getGen(2);\n\n\n }\n else{\n this.alive2[i]=false;\n this.empSpaces2.push(i);\n }\n }\n\n \n }\n\n // Create a new generation\n this.generate = function(survivors2, deaths2) {\n this.generations2++;\n var j2 = 0;\n for(var i = 0;i<this.simulation.length;i++){\n if(this.alive2[i]){\n for(var k = 0; k<deaths2/survivors2; k++){\n var a = i;\n var b = floor(random(this.simulation.length)); \n var partnerA = this.DNA2[a];\n var partnerB = this.DNA2[b];\n var child = partnerA.crossover2(partnerA);\n child.mutate(j2);\n this.DNA2[this.empSpaces2[j2]]=child;\n j2++\n }\n }\n }\n\n\n }\n \n\n\n this.getBestFitness = function() {\n return this.maxFitness2;\n }\n\n // Compute the current \"most fit\" member of the population\n this.evaluate = function() {\n var worldrecord = 0.0;\n var index = 0;\n for (var i = 0; i < this.simulation.length; i++) {\n print(this.fitness[i]+1)\n if (this.fitness[i] > worldrecord) {\n index = i;\n worldrecord = this.fitness[i];\n }\n }\n //print(worldrecord);\n\n this.best = this.fitness[i];//.getPhrase();\n if (floor(worldrecord) == this.perfectScore) {\n this.finished = true;\n }\n\n\n\n\n }\n this.getRecord = function(){\n var worldrecord = 0.0;\n for (var i = 0; i < this.simulation.length; i++) {\n if (this.fitness[i]> worldrecord) {\n index = i;\n worldrecord = this.fitness[i];\n }\n }\n return worldrecord;\n }\n\n this.isFinished = function() {\n return this.finished;\n }\n\n this.getGenerations = function() {\n return this.generations2;\n }\n\n // Compute average fitness for the population\n this.getAverageFitness = function() {\n //print(\"1\");\n var total = 0;\n for (var i = 0; i < this.simulation.length; i++) {\n total += this.fitness[i];\n }\n //print(this.simulation[0].getFitness())\n return total / (this.simulation.length);\n \n }\n this.getMut = function(){\n return this.bestMut;\n }\n this.getPop = function(){\n return this.bestPop;\n }\n this.getDie = function(){\n return this.bestDie;\n }\n\n\n this.allPhrases = function() {\n var everything = \"\";\n \n var displayLimit = min(this.population.length,50);\n \n \n for (var i = 0; i < displayLimit; i++) {\n everything += this.population[i].getPhrase() + \"<br>\";\n }\n return everything;\n }\n}", "title": "" }, { "docid": "64738b64ef26c91b4610db9ce00b535b", "score": "0.54069215", "text": "generate() {\r\n // fill the new gen population with children from the mating pool\r\n for (let i = 0; i < this.population.length; i++) {\r\n let a = floor(random(this.matingPool.length));\r\n let b = floor(random(this.matingPool.length));\r\n\r\n let partnerA = this.matingPool[a];\r\n let partnerB = this.matingPool[b];\r\n\r\n let child = partnerA.crossover(partnerB);\r\n child.mutate(this.mutationRate);\r\n\r\n this.population[i] = child;\r\n }\r\n this.numGen++;\r\n }", "title": "" }, { "docid": "31c395f7323a2bed85616ff9dbf3118c", "score": "0.54066473", "text": "function setMaxScore(max) {\n\tmaxScore = max;\n}", "title": "" }, { "docid": "56e3d650ebf30076297296d315a3c4b8", "score": "0.54031396", "text": "winter() { \n let fprom = 0\n for(const specimen of this.population)\n fprom += fprom.fitness\n fprom = fprom / this.population.length\n for(const specie of this.species){\n specie.specimens.sort((a,b)=>b.fitness-a.fitness)\n if(specie.specimens.length>1){\n let newLen = Math.ceil(specie.specimens.length*0.2)\n specie.specimens.length = newLen\n }\n }\n\n }", "title": "" }, { "docid": "56e3d650ebf30076297296d315a3c4b8", "score": "0.54031396", "text": "winter() { \n let fprom = 0\n for(const specimen of this.population)\n fprom += fprom.fitness\n fprom = fprom / this.population.length\n for(const specie of this.species){\n specie.specimens.sort((a,b)=>b.fitness-a.fitness)\n if(specie.specimens.length>1){\n let newLen = Math.ceil(specie.specimens.length*0.2)\n specie.specimens.length = newLen\n }\n }\n\n }", "title": "" }, { "docid": "c7220793fa51f0961351894c044961b1", "score": "0.5387414", "text": "function GA(list, fitness, permutate, include){\n this.list = list;\n this.fitness = fitness;\n this.permutate = permutate;\n this.include = include;\n}", "title": "" }, { "docid": "809a69a6dc51b04b6796ff1ca6a8fdfc", "score": "0.5375264", "text": "getBestFitness() {\n return this._bestFitnessEver;\n }", "title": "" }, { "docid": "a24da4b60df6561e670147b4f1ae57e0", "score": "0.537205", "text": "function computeBest(){\n let total = stockPrices[tracker.high] - stockPrices[tracker.low]\n if( total > tracker.bestProfit ){\n tracker.bestProfit = total \n // Optional -----\n tracker.lowValue = stockPrices[tracker.low]\n tracker.highValue = stockPrices[tracker.high]\n tracker.computeBestCount++\n }\n }", "title": "" }, { "docid": "413a22dec3e4fb6588be23cd2c86b6bb", "score": "0.5370962", "text": "getAverageFitness() {\r\n let total = 0;\r\n for (let i = 0; i < this.population.length; i++) {\r\n total += this.population[i].fitness;\r\n }\r\n return total / (this.population.length);\r\n }", "title": "" }, { "docid": "0dcf994c224534ba45c1030daa608ecf", "score": "0.536821", "text": "constructor(chromosomeSize, populationSize, maxGeneration, eliteSize, geneMutationChance, tournamentSize) {\n this.chromosomeSize=chromosomeSize;\n this.populationSize=populationSize;\n this.maxGeneration=maxGeneration;\n this.eliteSize=eliteSize;\n this.geneMutationChance=geneMutationChance;\n this.tournamentSize = tournamentSize;\n this.population=new Array();\n this.haveModel=false;\n this.stringModel=new String();\n this.weightsArray = new Array();\n }", "title": "" }, { "docid": "c808a4abe61d581e698b60c424725249", "score": "0.5355286", "text": "function nextGeneration() {\n resetGame();\n // Normalize the fitness values 0-1\n normalizeFitness(allBirds);\n // Generate a new set of birds\n activeBirds = generate(allBirds);\n // Copy those birds to another array\n allBirds = activeBirds.slice();\n}", "title": "" }, { "docid": "b23fb903a301d20dbce84a4196e21950", "score": "0.5354838", "text": "search() {\n // use evolutionary search algorithm\n\n // create an initial population\n const collages = this.getInitialIndividuals();\n const population = new Population(collages, this.config.population);\n\n // calculate its fitness data\n population.individuals.forEach(c => this.calculateFitness(c, this.config.targetData.moments));\n\n // render population and fitness data\n // ?\n\n // generate the next generation based on fitness data\n population.next();\n\n // repeat\n }", "title": "" }, { "docid": "cc786c7a586693100aadb579a97fa7c4", "score": "0.5352399", "text": "report(generation) {\n let bestScore=this.elite[0].score;\n let averageScore=this.population.reduce((total,schedule) => total+=schedule.score,0)/this.populationSize;\n console.log(`G: ${generation} Best: ${bestScore} Average: ${averageScore}`);\n }", "title": "" }, { "docid": "6a5921d1fbdded48254f6ec0573afb6f", "score": "0.53435194", "text": "calcFitness(){\n if (this.recordDist < 1) this.recordDist = 1; \n \n //reward finishing faster and getting closer\n this.fitness = 1 / this.finishTime * this.recordDist;\n\n this.fitness = pow(this.fitness, 4);\n\n if (this.hitObstacle) this.fitness *= 0.1; // reduce fitness if obstacle is hit\n if (this.hitTarget) this.fitness *=2; // double the fitness if you finish\n }", "title": "" }, { "docid": "001dc62ee71a310a6c6445b8ebeb7f8f", "score": "0.5335136", "text": "calculateFitness()\n {\n for(let i = 0; i < this.units.length; i++)\n {\n let fitness = 0;\n let score = Distance(startPoint, target);\n\n fitness += (score - this.units[i].distance) * 0.7;\n fitness += (score - this.units[i].bestDistance);\n\n if(this.units[i].bestDistance <= score/4)\n fitness += 100;\n\n if(this.units[i].bestDistance <= score/2)\n fitness += 200;\n\n if(this.units[i].bestDistance <= score/4*3)\n fitness += 300;\n\n fitness += this.units[i].ttc * 0.05;\n\n if(!this.units[i].alive)\n fitness -= 50;\n\n if(this.units[i].win)\n {\n fitness += TIME - this.units[i].ttc*0.1;\n fitness += 500;\n }\n\n if(fitness < 0)\n fitness = 0;\n\n this.units[i].fitness = fitness;\n }\n }", "title": "" }, { "docid": "9662957e5ef6974afdc8393ab69eccf3", "score": "0.5334753", "text": "setHighestInnovation(newInnovation) {\n this.innovation = Math.max(this.innovation, newInnovation);\n }", "title": "" }, { "docid": "c2a41dc7c42a607a956be131e4d4beff", "score": "0.5323446", "text": "randomWeightedIndividual(exclude){\n let pop = this.population.slice(0);\n\n if(exclude && pop.indexOf(exclude) >= 0){\n pop.splice(pop.indexOf(exclude),1);\n }\n\n let rand = Math.random();\n\n let lower = 0;\n let weight = 1/pop.length;\n let upper = weight;\n\n for(let i=0; i<pop.length; i++){\n // if the random number falls between lower and upper bounds, select this individual\n if(rand > lower && rand < upper){\n return pop[i];\n }\n lower = upper;\n upper += 2*weight * ((pop.length-i)/pop.length);\n }\n\n return pop[0];\n }", "title": "" }, { "docid": "820e14f3954917a42795c0ed74f84c05", "score": "0.5316809", "text": "set Optimal(value) {}", "title": "" }, { "docid": "bf9f4d64e56588335672e6655575c3a0", "score": "0.5309916", "text": "get population() {\n\t\treturn this.__population;\n\t}", "title": "" }, { "docid": "d180709c5ac2f81eb708a6637dc0ba7f", "score": "0.52977777", "text": "evaluateGeneration() {\n\n var survivorsOrderedInfo = [];\n\n //ordenado de menor a mayor\n survivorsOrderedInfo = _.sortBy(_.union(this.survivorsInfo, this.deadSurvivors), \"numBugEated\");\n //survivorsOrderedInfo = _.sortBy(this.survivorsInfo, \"numBugEated\");\n\n let lastIdx = survivorsOrderedInfo.length;\n\n var thisGen = {\n BestsurvivorId: 0,\n WorsesurvivorId: 0,\n BestFitness: 0,\n WorseFitness: 0\n };\n\n if (lastIdx > 0) {\n thisGen = {\n BestsurvivorId: survivorsOrderedInfo[lastIdx - 1].collectStats()\n .uid,\n WorsesurvivorId: survivorsOrderedInfo[0].collectStats()\n .uid,\n BestFitness: survivorsOrderedInfo[lastIdx - 1].collectStats()\n .numBugEated,\n WorseFitness: survivorsOrderedInfo[0].collectStats()\n .numBugEated\n };\n //showBest\n let srv = this.survivorsInfo.find(o=>o.uid == thisGen.BestsurvivorId);\n if (srv)\n this.showBestSurvivor(srv);\n }\n\n //console.dir(survivorsOrderedInfo);\n this.generationStats.push(thisGen);\n\n }", "title": "" } ]
d66d51f160e859a48fd49edf66681337
Responding to the style button in the navbar
[ { "docid": "6c9feb67feac51c8833c6751b5ef1e21", "score": "0.0", "text": "function styleEditorContent()\n {\n //get the currunt cursor position of the editor; check between which values that is and look that up\n // after reformatting the text to replace the cursor.\n var pos = thedocument.getCursor();\n var before = thedocument.getRange({line:pos.line,ch:0},pos);\n //regex to find tag segment left of the cursor : <[\\w\\/\\s=\\'\\\"]+$|<[\\w\\/\\s=\\'\\\"]+>$\n var beforesegment = before.match(/<[\\w\\/\\s=\\'\\\"]+$|<[\\w\\/\\s=\\'\\\"]+>[\\w\\s]*$/);\n if (beforesegment !== null)\n {\n before = beforesegment[0];\n }\n var after = thedocument.getRange(pos,{line:pos.line,ch:null});\n //regex to find tag segment to the right of cursor : ^[\\w\\/\\s=\\'\\\"]+>|^<[\\w\\/\\s=\\'\\\"]+> \n var aftersegment = after.match(/^[\\w\\/\\s=\\'\\\"]+>|^<[\\w\\/\\s=\\'\\\"]+>/);\n if (aftersegment !== null)\n {\n after = aftersegment[0];\n }\n\n //search the correct position of the cursor, possibly many similar tags : the index of the search results\n //array is stored\n var cursor = editor.getSearchCursor(before);\n var counter =0 ;\n var original = {line:10000,ch:10000};\n var myindex = -1;\n while (cursor.find() === true)\n { \n var newval = cursor.to();\n if (isTheBetter(pos, newval, original))\n {\n original = newval;\n myindex = counter;\n }\n counter++;\n }\n //now that we know we can find the new cursor position we will format the complete text\n var settings = StaticDataFactory.getFormattingSettings();\n thedocument.setValue(html_beautify(thedocument.getValue(),settings));\n\n //put the cursor back in place\n cursor = editor.getSearchCursor(before);\n for(var i=0 ; i < myindex+1 ;i++)\n {\n cursor.find();\n }\n if(cursor.to())\n {\n thedocument.setCursor(cursor.to());\n }\n editor.focus();\n\n\n function isTheBetter(newpos, oldpos, standard)\n {\n var linedifference1 = Math.abs(standard.line - oldpos.line);\n var linedifference2 = Math.abs(standard.line - newpos.line);\n if (linedifference1 > linedifference2)\n {\n return false;\n }\n if(linedifference2 > linedifference1)\n {\n return true;\n }\n var chardifference1 = Math.abs(standard.ch - oldpos.ch);\n var chardifference2 = Math.abs(standard.ch - newpos.ch);\n if (chardifference1 > chardifference2)\n {\n return false;\n }\n return true;\n }\n }", "title": "" } ]
[ { "docid": "fe212ec7a41166b761e2ba4686f95c35", "score": "0.58902925", "text": "applyActiveBarClass(){\n /* */\n }", "title": "" }, { "docid": "54d1871d1ee9796e7adb9629f5ba3365", "score": "0.58887714", "text": "defaultNavStyles() {\n const btnElements = document.getElementsByClassName(\"HMactionNavs\");\n Array.prototype.forEach.call(btnElements, function (element) {\n element.style.backgroundColor = \"slategray\";\n element.style.color = \"white\";\n });\n const actionElements = document.getElementsByClassName(\"HMmethods\");\n Array.prototype.forEach.call(actionElements, function (action) {\n action.style.display = \"none\";\n });\n }", "title": "" }, { "docid": "ae7b5f844a8066eb7e8876ffeb1f05f8", "score": "0.5877776", "text": "defaultNavStyles() {\n const btnElements = document.getElementsByClassName(\"HactionNavs\");\n Array.prototype.forEach.call(btnElements, function (element) {\n element.style.backgroundColor = \"slategray\";\n element.style.color = \"white\";\n });\n const actionElements = document.getElementsByClassName(\"Hmethods\");\n Array.prototype.forEach.call(actionElements, function (action) {\n action.style.display = \"none\";\n });\n }", "title": "" }, { "docid": "f9dced53029a9a2a5d753ce3bf17ae3e", "score": "0.5859721", "text": "defaultNavStyles() {\n const btnElements = document.getElementsByClassName(\"ALactionNavs\");\n Array.prototype.forEach.call(btnElements, function (element) {\n element.style.backgroundColor = \"slategray\";\n element.style.color = \"white\";\n });\n const actionElements = document.getElementsByClassName(\"ALmethods\");\n Array.prototype.forEach.call(actionElements, function (action) {\n action.style.display = \"none\";\n });\n }", "title": "" }, { "docid": "8a6a294f07fb56b95fc8599416f165ed", "score": "0.57425535", "text": "function ManageNavBarButton() {\n if (screen.width < 870 && button.style.display == 'none'){\n console.log('lasam buton sa se vada');\n navbar.style.display = 'none';\n button.style.display = '';\n }\n if (screen.width > 870 && button.style.display == ''){\n console.log('ascundem buton si navbarMobile daca e deschis');\n button.style.display = 'none';\n navbar.style.display = '';//afisam navbarul\n if (navbarMobile.style.display == '')//daca navbarMobile a ramas pornit\n navbarMobile.style.display = 'none';\n }\n}", "title": "" }, { "docid": "fefc470e665189f080b097253f481215", "score": "0.5683729", "text": "function clickedOnNavBar() {\n $(\"#navbarNavAltMarkup\").find(\".active\").removeClass(\"active\");\n $(this).addClass(\"active\");\n let this_id = $(this).attr('id');\n // Make the right information visible and invisible.\n // bind/unbind clickable when nav changes. Also the resize needs to bind/unbind.\n // Also set the dropdown as active for rooms\n if (this_id == \"nav_about\") {\n initAboutPage();\n } else if (this_id == \"nav_randomize\") {\n initRandomizePage();\n } else if (this_id.startsWith(\"nav_room\")) {\n initRoomPage(this.id);\n }\n}", "title": "" }, { "docid": "538bf6ab5cd43cb9d58be55b9b50afc6", "score": "0.56397706", "text": "function markActiveButton() {\n if (typeof markActiveButton.activeButtonIndex === 'undefined') {\n markActiveButton.activeButtonIndex = -1;\n }\n let activeButtonIndex = markActiveButton.activeButtonIndex;\n let topBarTitle = document.getElementById('top-bar-title').innerText.toLowerCase();\n if (topBarTitle) {\n let menuButtonsSelectedMarks = Array.from(document.getElementsByClassName('menu-button-active-mark'));\n if (activeButtonIndex >= 0) {\n menuButtonsSelectedMarks[activeButtonIndex].setAttribute('data-is-active', false);\n }\n activeButtonIndex = Array.from(document.getElementsByClassName('menu-button-txt'))\n .findIndex((el) => el.innerText.toLowerCase() == topBarTitle);\n if (activeButtonIndex >= 0) {\n menuButtonsSelectedMarks[activeButtonIndex].setAttribute('data-is-active', true);\n }\n }\n}", "title": "" }, { "docid": "f27bdda96bfce456343914b2be0eb840", "score": "0.5605438", "text": "function fixedHeader() {\r\n $(\".navbar-brand\").css(\"font-size\", \"2rem\");\r\n $(\".nav-link\").css(\"font-size\", \"1rem\");\r\n $(\".nav-link\").css(\"margin\", \"0 2px\");\r\n}", "title": "" }, { "docid": "9e9ea75bf0e7f278d43437e75fc0e8d2", "score": "0.5599668", "text": "function switchNavBarTextEffect() {\n if ( $mobile_nav.hasClass('active') ) {\n $mobile_nav_bar_btn_text.find('.text-menu').addClass('active');\n $mobile_nav_bar_btn_text.find('.text-section').removeClass('active');\n } else {\n $mobile_nav_bar_btn_text.find('.text-menu').removeClass('active');\n $mobile_nav_bar_btn_text.find('.text-section').addClass('active');\n }\n }", "title": "" }, { "docid": "ef57dc726f5df9f49ce6e956b303f078", "score": "0.5583215", "text": "function stickyButton() {\n \n if(window.scrollY >= HEADER.offsetHeight) {\n NAVBUTTON.classList.add('sticky-nav-button');\n // menuBar.classList.add('sticky-mobile');\n }\n else {\n NAVBUTTON.classList.remove('sticky-nav-button');\n }\n }", "title": "" }, { "docid": "36995cdece96f310bc1e8c78517c1f81", "score": "0.55777806", "text": "function fundoBotao( elemento) {\n\n $(elemento).removeClass(\"btn-light\");\n $(elemento).addClass(\"btn-danger\");\n $(\".text-secondary\").removeClass(\"text-secondary\");\n $(elemento).addClass(\"text-light\");\n $(elemento).addClass(\"animated rollIn delay-0.5s\");\n $(elemento).unbind(\"click\");\n\n //$(elemento).css({'color':'#fff'});\n\n\n }", "title": "" }, { "docid": "68686319ffd164e32aff317ae73628c8", "score": "0.5558451", "text": "function navFollow(x) { \n if (x.matches) { \n navbar.style.backgroundColor=\"rgba(78, 17, 17, 0)\";\n headerLogo.style.display=\"block\";\n } else {\n navbar.style.backgroundColor=\"rgba(78, 17, 17, 0.6)\";\n headerLogo.style.display=\"block\";\n navbar.style.width=\"100%\";\n }\n }", "title": "" }, { "docid": "8c61196b7a1885938570b0e424391455", "score": "0.5549965", "text": "function buttonUnderlineColor() {\n if (isStyle('underline'))\n document.getElementById('btn_underline').style.backgroundColor = \"#2789b3\";\n else\n document.getElementById('btn_underline').style.backgroundColor = \"#FAFAFA\";\n}", "title": "" }, { "docid": "2e0d438c47eb0e6a6ee1889b3e00986a", "score": "0.5546495", "text": "function OpinionBtn({ type = \"default\", className, children, onClick, style, href }) {\n // console.log('BUTTON STYLE', style);\n return (\n <a href={href} target=\"_blank\">\n <button onClick={onClick} className={[\"btn btn-lg\", `btn-${type}`, className].join(\" \")} style={style} >\n {children}\n </button>\n </a>\n );\n}", "title": "" }, { "docid": "18bb64c81cf278b58d784637fadbc378", "score": "0.5544578", "text": "function controllerNavBtn(btnList) {\n if (btnList instanceof Array){\n btnList.forEach(function(item){\n $(item.selector).on('click.bs.dropdown', function(e) {\n \n $(\".nav\").find(\".active\").removeClass(\"active\");\n $(this).parent().addClass(\"active\");\n \n item.controller();\n \n // Set vie SECTION for each menu item\n setSection(item.section);\n \n return false;\n });\n });\n }\n}", "title": "" }, { "docid": "f713a37b5049236c9fe5b6be4888078f", "score": "0.5538694", "text": "function Nav() {\n //return the nav bar contains search and save\n return (\n <nav className=\"navbar navbar-expand-lg navbar-dark fixed-top\" style={{backgroundColor:\"#ff80aa\"}}> \n {/* //link to the Search */}\n <a className=\"navbar-brand\" href=\"/\">\n Search\n </a>\n {/* //link to the save */}\n <a className=\"navbar-brand\" href=\"/save\">\n Saved\n </a>\n <a className=\"navbar-brand\" href=\"/\" style={{fontSize:\"larger\",margin:\"auto\"}}>\n Google Book Search\n </a>\n </nav>\n );\n}", "title": "" }, { "docid": "a3aac95a20465bcfdcc0d1593ad2434f", "score": "0.5533076", "text": "function changeButton(){\n \n }", "title": "" }, { "docid": "a5a0b2e12f50107a41995a5b3db9c412", "score": "0.5532432", "text": "function bsGnavFunction(element, srollToId) {\n \"use strict\";\n $('.nav_22 li').each(function () {\n if ($(this).hasClass('gnavButton')) {\n $(this).removeClass('hover');\n $(this).removeClass('reverseShadowBoxLight');\n }\n });\n\n $(element).addClass('hover');\n $(element).addClass('reverseShadowBoxLight');\n\n $('.btn-navbar').click();\n $.scrollTo($('#' + srollToId), 800, {\n 'axis': 'y'\n });\n}", "title": "" }, { "docid": "3c6d23a3a3ae8230610e8c6e21570646", "score": "0.5518139", "text": "function CraftARContentButton() {\n}", "title": "" }, { "docid": "f8f300de9c4f7e3a80a240a9614d1ef7", "score": "0.55165476", "text": "function Navbar() {\n return (\n <div className=\"navbar\">\n <div className=\"navbar-container container\">\n NAVLOGO\n <ul className=\"nav-left nav-links\">\n <li className=\"nav-item\">WHY EVERNOTE</li>\n <li className=\"nav-item\">FEATURES</li>\n <li className=\"nav-item\">PLANS</li>\n </ul>\n\n <ul className='nav-right nav-links'>\n <li className=\"nav-item\" >Help</li>\n <li className=\"nav-item\">Log In</li>\n <li className=\"nav-item\" >\n <button className='btn dwnld-btn'>Download</button>\n </li>\n </ul>\n </div>\n </div>\n )\n}", "title": "" }, { "docid": "4ac2bc3721557541f2dd8a45a306390e", "score": "0.5494094", "text": "function navBtnClick(){\n\n var parent = getClosestByClassName(this, 'nav-list');\n var items = parent.getElementsByClassName('nav-item');\n\n if(!parent.dataset.slstatus || parent.dataset.slstatus == 'closed'){\n\n openMenu(parent, items);\n\n }\n else if (parent.dataset.slstatus =='open') {\n\n closeMenu(parent, items);\n }\n else{\n console.log('parent <ul> not found')\n }\n }", "title": "" }, { "docid": "287bb880573a20351eec848473f5f4db", "score": "0.548545", "text": "function goTo(p) {\n\t[].forEach.call(document.querySelectorAll(\"#pageContainer>div\"), el => el.classList.add(\"hidden\"));\n\tdocument.getElementById(p).classList.remove(\"hidden\");\n\t[].forEach.call(document.querySelectorAll(\".navbar>button\"), el => el.classList.remove(\"active\"));\n\tif (p == 'collectionPage') {\n\t\tdocument.getElementById('collectionBtn').classList.add(\"active\");\n\t\tdocument.getElementById('pageContainer').style.backgroundColor = \"#4CAF50\";\n\t} else if (p == 'pairPage') {\n\t\tdocument.getElementById('pairBtn').classList.add(\"active\");\n\t\tdocument.getElementById('pageContainer').style.backgroundColor = \"#7B2A8D\";\n\t} else if (p == 'settingsPage') {\n\t\tdocument.getElementById('settingsBtn').classList.add(\"active\");\n\t\tdocument.getElementById('pageContainer').style.backgroundColor = \"#34A5D5\";\n\t}\n\twindow.onresize();\n}", "title": "" }, { "docid": "487060112473b7559cae048281797216", "score": "0.54804856", "text": "function stickyNavButton(e) {\n if(window.innerWidth <= 767 && window.scrollY >= 10) {\n navButton.classList.add('sticky-nav-button');\n title.classList.add('sticky-title');\n }\n else {\n navButton.classList.remove('sticky-nav-button');\n title.classList.remove('sticky-title');\n }\n}", "title": "" }, { "docid": "3c1c69f8cd6a9ed38f53ecf218da3561", "score": "0.546347", "text": "function setButtonCSS(){\r\n\t$(\"a.button\").css({\r\n\t\t\"cursor\":\"pointer\",\r\n\t\t\"text-decoration\":\"underline\"\r\n\t\t});\r\n}", "title": "" }, { "docid": "0b12d2ca91e8ae1c7b6ea97a24ba2a6c", "score": "0.5459473", "text": "function navScrollStyle() {\r\n const scrolled = navScrollCheck();\r\n // Toggle class if scrolled below navbar height\r\n if (scrolled) {\r\n navigation.classList.add('sm--navbar__scrolled');\r\n } else {\r\n navigation.classList.remove('sm--navbar__scrolled');\r\n }\r\n}", "title": "" }, { "docid": "99da7f09f5b9e909a05ec81926db4089", "score": "0.54576486", "text": "function positionIndicator(event) {\n windowTop = $(window).scrollTop()+200;\n home_button.css(\"color\", \"\");\n menu_button.css(\"color\",\"\");\n\n for (i = menu_button.length-1; i > -1; i--){\n if (($(menu_button[i].hash).position().top - windowTop) < 0) {\n menu_button[i].style.color = blue;\n break;\n }\n else if (i == 0)\n $(\"#erik-home-button\")[0].style.color = blue;\n }\n\n //resizing navbar and items\n if(windowTop > 400){\n $(\".navbar\").animate({\"padding\": \"10px 40px\", \"font-size\":\"1.8rem\"}, 100).clearQueue();\n $(\"#erik-photo\").animate({width:\"35\", height:\"35\", margin:\"5\"},100).clearQueue();\n }\n else {\n $(\".navbar\").animate({\"padding\": \"30px 40px\", \"font-size\":\"2.2rem\"}, 50).clearQueue();\n $(\"#erik-photo\").animate({width:\"45\", height:\"45\", margin:\"0\"},50).clearQueue();\n }\n}", "title": "" }, { "docid": "af6f2eef332ea3f5cd2be16919df3784", "score": "0.5451682", "text": "function changeuserfollowonmouseover(event) {\n if ($(\"#\" + event.id + \" > span\").text().trim().toLowerCase() == \"following\") {\n $(\"#\" + event.id + \" > i\").removeClass('fa fa-check-circle');\n $(\"#\" + event.id + \" > i\").addClass('fa fa-minus-circle');\n\n $(\"#\" + event.id).removeClass();\n $(\"#\" + event.id).addClass('btn btn-xs btn-danger');\n $(\"#\" + event.id + \" > span\").text(\" Unfollow\");\n }\n else {\n // change button css when somone will hover on the follow button and if the text is 'Follow' \n $(\"#\" + event.id).removeClass();\n $(\"#\" + event.id).addClass('btn btn-xs btn-warning');\n $(\"#\" + event.id + \" > i\").attr('style', 'color:white;');\n $(\"#\" + event.id + \" > span\").attr('style', 'color:white;font-weight:bold;');\n }\n}", "title": "" }, { "docid": "db21ad48e44bb426b5b519a8f9483f7e", "score": "0.54506874", "text": "function ContinueBtn(props) {\n return (\n <nav className=\"navbar fixed-bottom\">\n <button className=\"btn btn-primary btn-lg btn-block\" onClick={props.onClick}>\n Continue\n </button>\n </nav>\n );\n}", "title": "" }, { "docid": "8a3f69feef18df0e0814e11452e55957", "score": "0.5435611", "text": "setBtnStyle(type, additional){\n let bt = (type) ? type : \"default\"; // Sets default btn css\n this.btn_css.push(`btn-${bt}`);// Adds to btn_css array for re-renders\n // Conditional loads additional css\n if(additional){\n this.btn_css.push(additional);// Adds to btn_css array for re-renders\n }\n // Returns css for state\n return this.getClasses(this.btn_css); // Returns css string\n }", "title": "" }, { "docid": "4f06ffa9fe86e0666a471c55a47e975f", "score": "0.5424681", "text": "function customize() {\n\t\tlet nav = $(\".Header nav\");\n\t\tif (nav) {\n\t\t\tnav.classList.add(\"ghcn-nav\");\n\t\t\tlet indx, els,\n\t\t\t\tnavStr = \".ghcn-nav\",\n\t\t\t\tsetItems = settings[getLocation()],\n\t\t\t\tlen = setItems.length;\n\t\t\tif (!len) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tels = nav.childNodes;\n\t\t\tindx = els.length;\n\t\t\twhile (indx--) {\n\t\t\t\tnav.removeChild(els[indx]);\n\t\t\t}\n\n\t\t\tfor (indx = 0; indx < len; indx++) {\n\t\t\t\taddToMenu(setItems[indx], navStr);\n\t\t\t}\n\t\t\t// make sure all svg's have an \"octicon\" class name\n\t\t\taddClass($$(navStr + \" svg\"), \"octicon\");\n\n\t\t\tif (editMode) {\n\t\t\t\tupdatePanel();\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "2d180745325cdc0e9f00d46daf7866fc", "score": "0.54225063", "text": "function ClickFollowButton() {\n if ($(this).css('background-color') === 'rgb(255, 255, 255)') {\n $(this).text(\"Follow\");\n $(this).css({\"background-color\": \"purple\", \"color\": \"white\"});\n } else {\n $(this).text(\"Followed\");\n $(this).css({\"background-color\": \"white\", \"color\": \"purple\"});\n\n }\n }", "title": "" }, { "docid": "b1b62a5316479a5dda2e9b9c704eacb9", "score": "0.5407872", "text": "function changeButtonStyleOnClick(view) {\n // selects the button that was clicked\n const currentButton = document.querySelector(`#${view}`);\n // sets the box shadow of the clicked button\n currentButton.style.boxShadow = \"4px 4px 4px rgba(0, 0, 0, 0.10)\";\n // styles the border type of the clicked button\n currentButton.style.border = \"2px solid rgba(0, 0, 0, 0.12)\";\n // styles the right border of the clicked button\n currentButton.style.borderRight = \"4px solid rgba(221, 57, 156, 1)\";\n // iterate through all the buttons ('Schema', 'Code', and 'Visualize')\n for (let j = 0; j < views.length; j++) {\n /*\n if the current button in the iteration is not the button that was clicked... go to line 46\n */\n if (view !== views[j]) {\n // select the current button in the iteration\n const button = document.querySelector(`#${views[j]}`);\n // set the box shadow of the current button in the iteration\n button.style.boxShadow = \"1px 2px 3px rgba(0, 0, 0, 0.10)\";\n // set the border type of the current button in the iteration\n button.style.border = \"none\";\n // set the right border style of the current button in the iteration\n button.style.borderRight = \"1px solid rgba(0, 0, 0, 0.12)\";\n }\n }\n}", "title": "" }, { "docid": "e20361b46add886cb85a0999243126f1", "score": "0.5406871", "text": "function handleClick(e) {\n // prevent the default behavior, but most importantly remove the class of .active from those elements with it\n e.preventDefault();\n links.forEach((link) => {\n if (link.classList.contains('active')) {\n link.classList.remove('active');\n }\n });\n\n // retrieve the option described the link element\n const name = this.textContent.trim().toLowerCase();\n // find in the array the object with the matching name\n // store a reference to its color\n const { color } = navigationOptions.find(item => item.name === name);\n\n // retrieve the custom property for the --hover-c property, to make it so that the properties are updated only when necessary\n const style = window.getComputedStyle(this);\n const hoverColor = style.getPropertyValue('--hover-c');\n // if the two don't match, update the custom property to show the hue with the text and the semi transparent background\n if (color !== hoverColor) {\n this.style.setProperty('--hover-bg', `${color}20`);\n this.style.setProperty('--hover-c', color);\n }\n\n // apply the class of active to animate the svg an show the span element\n this.classList.add('active');\n // change the color of the background of the application to match\n document.querySelector('body').style.background = color;\n}", "title": "" }, { "docid": "03e92ef3ca446454da5d20171635b374", "score": "0.5405793", "text": "function le_btnPesquisaLeitura() {\n/*------------------------------*/\nconsole.log(\"leit.js> *** Executando le_btnPesquisaLeitura() ***\");\n\n /*-- Get do Navbar Top --*/\n pe_getaNavbarTop( \"Pesquisa\" , \"page\" );\n\n /*-- Get do Corpo da Pagina --*/\n pe_getaHtmlPagina( \"\" , \"pesquisa\" ); \n\n /*-- Get do Navbar Bottom --*/\n pe_getaNavbarBottom( \"home\" );\n\n}", "title": "" }, { "docid": "25d47eb36aca43c7922b535b602e6289", "score": "0.5403904", "text": "function StyleSelected(e) {\n for (var i=0; i< FilterStyleButtons.length; i++) {\n FilterStyleButtons[i].className = \"sc-roll\";\n }\n e.target.className = \"sc-roll sc-filter-style-underline\";\n CurrentStyle = e.target.alt;\n Filter();\n}", "title": "" }, { "docid": "a188ac8b189bb2d244ffd5306169c162", "score": "0.5403629", "text": "function navMenuButtonCallback() {\n var nav = document.getElementById('nav');\n nav.classList.toggle('active');\n}", "title": "" }, { "docid": "f0f34e9c9615f0dd5e8d2cbf4a4ff7bf", "score": "0.54033375", "text": "function ChangeButtonStyle($compo, $bs, $fs, $is, $fontrequired, $iconrequired, $iconFirst) {\n if (typeof ($iconFirst) === \"undefined\")\n $iconFirst = false;\n var $button = $compo.find('.com-button');\n var $i = $compo.find('.com-button > i');\n var $span = $compo.find('.com-button > span');\n if ($fontrequired) {\n if ($span.length === 0) {\n var spn = '<span class=\"com-button-text\" contenteditable=\"true\">default text</span>';\n if ($iconFirst)\n $compo.find('a').append(spanEnd);\n else\n $compo.find('a').prepend(spanEnd);\n } else {\n if ($iconFirst)\n $compo.find('a').append($span);\n else\n $compo.find('a').prepend($span);\n }\n SetStyleAttribute($span, $fs);\n } else {\n $span.remove();\n }\n if ($iconrequired) {\n if ($i.length === 0) {\n var i = '<i class=\"fa fa-arrow-right onhovercolor\"></i>';\n if ($iconFirst)\n $compo.find('a').prepend(i);\n else\n $compo.find('a').append(i);\n } else {\n if ($iconFirst)\n $compo.find('a').prepend($i);\n else\n $compo.find('a').append($i);\n }\n SetStyleAttribute($i, $is);\n } else {\n $i.remove();\n }\n if ($button.length > 0) {\n SetStyleAttribute($button, $bs);\n }\n }", "title": "" }, { "docid": "14951d12ebce616c14deb0c14bf7aaa7", "score": "0.54005915", "text": "function le_btnListaLeituras() {\n/*----------------------------*/\nconsole.log(\"leit.js> *** Executando le_btnListaLeituras() ***\");\n\n /*-- Get do Navbar Top --*/\n pe_getaNavbarTop( \"Lista Leituras\" , \"page\" );\n\n /*-- Get do Corpo da Pagina --*/\n pe_getaHtmlPagina( \"\" , \"lista\" ); \n\n /*-- Get do Navbar Bottom --*/\n pe_getaNavbarBottom( \"home\" );\n\n\n}", "title": "" }, { "docid": "6b425e5195cfd9208386d720a8777e91", "score": "0.5394876", "text": "function changetextonmouseover(event) {\n //$(\"#\" + event.id + \" > span\").attr('style', 'color:black;font-weight:bold');\n\n if ($(\"#\" + event.id + \" > span\").text().trim().toLowerCase().search(\"following\") == 0) {\n $(\"#\" + event.id + \" > i\").removeClass('fa fa-check-circle');\n $(\"#\" + event.id + \" > i\").addClass('fa fa-minus-circle');\n $(\"#\" + event.id + \" > i\").attr('style', 'color:white;');\n $(\"#\" + event.id).attr('style', 'background-color:#A5152A;');\n $(\"#\" + event.id + \" > span\").attr('style', 'color:white;font-weight:bold;background-color:#A5152A;');\n $(\"#\" + event.id + \" > span\").text(\" Unfollow\");\n }\n else {\n // change button color when somone will hover on the follow button and if the text is 'Follow'\n $(\"#\" + event.id).attr('style', 'background-color:#2098D1;');\n $(\"#\" + event.id + \" > i\").attr('style', 'color:white;');\n $(\"#\" + event.id + \" > span\").attr('style', 'color:white;font-weight:bold;');\n }\n}", "title": "" }, { "docid": "b035c740609e2efb6c980fa6768756e5", "score": "0.5387703", "text": "function changeNav(){\n //Pega a posição da NAVBAR\n var posY = $('nav').offset().top;\n\n // Se estiver de acordo com as condições, altera o formato da navbar, caso contrario volta ao normal.\n if(posY >= 200 && navAtivada == 0){\n $('nav').addClass('nav-active');\n navAtivada = 1;\n }else if(posY < 200 && navAtivada == 1){\n $('nav').removeClass('nav-active');\n navAtivada = 0;\n }\n}", "title": "" }, { "docid": "6dee4a8b9b86fe57614135a1840643a6", "score": "0.53790945", "text": "'click .side-nav .bold'() {\n $('.button-collapse').sideNav('hide');\n menuDeps.changed();\n }", "title": "" }, { "docid": "edd294feb1a3c627018b2c74b3655142", "score": "0.53737164", "text": "function togglerHandler(){\n const navbarMenuNode = navbarMenu.current;\n const navbarMenuItemNode= navbarMenuItem.current;\n navbarMenuNode.classList.toggle('navbar__menu--responsive');\n for(let i = 0; navbarMenuItemNode.length;i++){\n \n navbarMenuItemNode[i].classList.toggle('navbar__menuItem--responsive');\n }\n }", "title": "" }, { "docid": "d0af3a4b31697132635803c4f15a2c77", "score": "0.5369334", "text": "function applyStyleToButton(){\n cartButton.innerText = \"Added To Cart\";\n cartButton.style.color = \"coral\";\n cartButton.style.backgroundColor = \"white\";\n cartButton.style.border = \"1px solid coral\";\n}", "title": "" }, { "docid": "6c526702da7aa4689e046251a8e1d32f", "score": "0.536043", "text": "function changeButtonTextToClickMe() {\n\n}", "title": "" }, { "docid": "9e541b0deb2c13b6b5e94e1740e25e1b", "score": "0.5342074", "text": "function followedMe(){\r\n followBtn.style.backgroundColor = \"blue\"\r\n followBtn.style.color= \"white\"\r\n \r\n }", "title": "" }, { "docid": "c147947ffdcc34cb6c382bcb6a6cc3b1", "score": "0.5336541", "text": "function change(x) {\n if (x.matches) {\n y.className = 'uk-navbar-right';\n z.style.display = 'block';\n j.style.display = 'none';\n } else {\n y.className = 'uk-navbar-center';\n z.style.display = 'none';\n j.style.display = 'flex';\n };\n}", "title": "" }, { "docid": "8d685020e1c185666603c29decf5c8dd", "score": "0.53341734", "text": "@action changeColor(scrollCloseDescription) {\n if (window.scrollY >= this.Home.offsetTop && window.scrollY < this.Projects.offsetTop - 30) {\n if (window.innerWidth >= 700) this.activeClassNa = \"nav-bar regularSection\"\n this.changeActive('Home');\n this.humbuggerClass = 'humbugger-regular';\n if (window.scrollY < this.Projects.offsetTop - 300) scrollCloseDescription()\n\n } else if (window.scrollY >= this.Projects.offsetTop - 30 && window.scrollY < this.Contact.offsetTop - 50) {\n if (window.innerWidth >= 700) this.activeClassNa = \"nav-bar blackSection\"\n this.changeActive('Projects')\n if(!this.openMenu ) this.humbuggerClass = 'humbugger-gray';\n } else if (window.scrollY >= this.Contact.offsetTop - 50) {\n if (window.innerWidth >= 700) this.activeClassNa = \"nav-bar regularSection\"\n this.changeActive('Contact')\n this.humbuggerClass = 'humbugger-regular';\n scrollCloseDescription();\n }\n }", "title": "" }, { "docid": "f2e515df4b20be8746a930783d330678", "score": "0.53212744", "text": "function buttonItalicsColor() {\n if (isStyle('italic'))\n document.getElementById('btn_italics').style.backgroundColor = \"#2789b3\";\n else\n document.getElementById('btn_italics').style.backgroundColor = \"#FAFAFA\";\n}", "title": "" }, { "docid": "cb84be810d740a4e9ef2dbc21504aede", "score": "0.5315884", "text": "function CustomMe(){\n //setColor('primary')\n setBtnDisable(true)\n }", "title": "" }, { "docid": "0cc16893aefa1a4fb37d355d058f9eb1", "score": "0.53121597", "text": "function ClickLikeButton() {\n if ($(this).css('background-color') === 'rgb(1, 87, 155)') {\n $(this).css('background-color','#868184');\n } else {\n $(this).css('background-color','#01579B');\n }\n }", "title": "" }, { "docid": "9c4f954f0253e23817587467c0e42515", "score": "0.5311983", "text": "function handleClick(e) {\n links.forEach((link) => {\n if (link.classList.contains('active')) {\n link.classList.remove('active');\n this.classList.add('active');\n }\n links.forEach((link) => link.addEventListener('click', handleClick));\n });\n // retrieve the option described the link element\n const name = this.textContent.trim().toLowerCase();\n // find in the array the object with the matching name\n // store a reference to its color\n const { color } = navigationOptions.find((item) => item.name === name);\n \n // retrieve the custom property for the --hover-c property, to make it so that the properties are updated only when necessary\n const style = window.getComputedStyle(this);\n const hoverColor = style.getPropertyValue('--hover-c');\n // if the two don't match, update the custom property to show the hue with the text and the semi transparent background\n if (color !== hoverColor) {\n this.style.setProperty('--hover-bg', `${color}20`);\n this.style.setProperty('--hover-c', color);\n }\n \n // apply the class of active to animate the svg an show the span element\n this.classList.add('active');\n }", "title": "" }, { "docid": "bfbb4669cc4819428c8decfe84bebc97", "score": "0.53074044", "text": "menu() {\n return ((this.state.active === 'true') ? 'menu-btn' : 'menu-btn close')\n }", "title": "" }, { "docid": "bc65ec02bca7ab00cef8f41872bade27", "score": "0.53021854", "text": "static get styles() {\n return [\n ...super.styles,\n css`\n .sr-only {\n position: absolute;\n left: -99999999px;\n width: 0;\n height: 0;\n overflow: hidden;\n }\n :host([disabled]) {\n pointer-events: none;\n }\n :host([danger]) {\n --a11y-menu-button-focus-color: var(\n --hax-toolbar-button-danger-color,\n #882222\n );\n --a11y-menu-button-focus-border: 1px solid\n var(--hax-toolbar-button-danger-color, #882222);\n }\n button {\n display: flex;\n flex-wrap: none;\n align-items: center;\n min-width: 42px;\n padding: var(--hax-menu-button-menu-padding);\n font-family: var(--simple-fields-font-family, sans-serif);\n text-transform: capitalize;\n }\n .label {\n padding: 0 5px;\n }\n #dropdownicon {\n --simple-icon-height: 18px;\n --simple-icon-width: 18px;\n margin-left: -2px;\n }\n #menu {\n width: var(--hax-menu-button-menu-width);\n min-width: var(--hax-menu-button-menu-min-idth);\n }\n absolute-position-behavior {\n --a11y-menu-button-border: 1px solid\n var(--hax-toolbar-button-hover-border-color, #000);\n z-index: 1001;\n }\n `,\n ];\n }", "title": "" }, { "docid": "094d06c7955a167209e311aee7e75bcf", "score": "0.5289883", "text": "changeNavbarBasedOnWindowSize() {\n let brandText;\n if (window.innerWidth > 310) {\n brandText = \"Wine & Art\";\n } else {\n brandText = window.innerWidth > 215 ? \"W&A\" : \"\";\n }\n this.brand.innerText = brandText;\n\n //this.languageElement.placeLanguageSelector();\n }", "title": "" }, { "docid": "0a5f42c8796b5016e6d238b455cb16b9", "score": "0.5281335", "text": "function activeClass(){\n let header = document.getElementById('navbar');\n let btns = header.getElementsByClassName('menu_link');\n for(let i = 0; i <btns.length; i++){\n btns[i].addEventListener('click', function(){\n let current = document.getElementsByClassName('active-nav');\n if(current.length > 0){\n current[0].className = current[0].className.replace(' active-nav', \"\");\n }\n this.className += ' active-nav';\n });\n }\n}", "title": "" }, { "docid": "7dc8934631a2446442629195d5a8fc00", "score": "0.5275396", "text": "function myFunction() {\n if (window.pageYOffset > sticky) {\n\n navbar.classList.add(\"sticky\")\n\n // Add sidenav trigger btn and cart btn here\n\n var sidebarTrigger = $('.sidebarTrigger').html();\n\n $('.sticky-sidbarBtn').html(sidebarTrigger);\n\n $(\".sticky-sidbarBtn\").addClass(\"pr-1 ml-2\");\n\n var stickyCart = $('a.nav-link.cart-btn').html();\n\n $('.sticky-cart').html(stickyCart);\n\n $(\".sticky-cart\").addClass(\"sticky-cart-style\");\n\n } else if (window.pageYOffset <= sticky) {\n navbar.classList.remove(\"sticky\");\n\n $('.sticky-sidbarBtn').html(\" \");\n\n $(\".sticky-sidbarBtn\").removeClass(\"pr-1 ml-2\");\n\n $('.sticky-cart').html(\" \");\n\n $(\".sticky-cart\").removeClass(\"sticky-cart-style\");\n }\n }", "title": "" }, { "docid": "2e7ce2919ee8fd20aca7172d206fed81", "score": "0.5272813", "text": "function setActiveRover(rover) {\n resetErrors();\n\n var roverBtns = document.querySelectorAll(\".rover-btn\");\n [].forEach.call(roverBtns, (btn) => {\n btn.classList.remove(\"active\");\n });\n\n var btn = document.querySelector(`.rover-btn.${rover}`);\n btn.classList.add(\"active\");\n\n setMissionSpan(rover);\n}", "title": "" }, { "docid": "a0843136fb50b53ccb15b116072e42f8", "score": "0.5272145", "text": "function openNav() {\n\tdocument.getElementById(\"myNav\").style.display = \"block\";\n\tlet toggleThemeButton = document.getElementById(\"themeChangeButton\");\n\ttoggleThemeButton.remove();\n\tlet positionOfToggleButtonForSmallScreen = document.getElementById(\"themeChangeButtonSmallScreen\");\n\tpositionOfToggleButtonForSmallScreen.appendChild(toggleThemeButton);\n}", "title": "" }, { "docid": "7b06735d001d1857cb3628db8553bb55", "score": "0.5265472", "text": "function handlenavbarbg() {\n if ( $('#main-wrapper').attr('data-navbarbg') == 'skin6' ) {\n // do this\n $(\".topbar .navbar\").addClass('navbar-light');\n $(\".topbar .navbar\").removeClass('navbar-dark');\n } else {\n // do that\n \n }\n $('.theme-color .theme-item .theme-link').on(\"click\", function() {\n var navbarbgskin = $(this).attr(\"data-navbarbg\");\n $('#main-wrapper').attr(\"data-navbarbg\", navbarbgskin);\n $('.topbar .navbar-collapse').attr(\"data-navbarbg\", navbarbgskin);\n if ( $('#main-wrapper').attr('data-navbarbg') == 'skin6' ) {\n // do this\n $(\".topbar .navbar\").addClass('navbar-light');\n $(\".topbar .navbar\").removeClass('navbar-dark');\n } else {\n // do that\n $(\".topbar .navbar\").removeClass('navbar-light');\n $(\".topbar .navbar\").addClass('navbar-dark');\n }\n });\n \n }", "title": "" }, { "docid": "64c44968308be65d25e95821f311a0c3", "score": "0.5264873", "text": "function styleButton (){\n $('button').css('background-color',\"#ff9933\")\n .css('margin-right',\"2%\")\n .css('padding',\"6px 10px\");\n }", "title": "" }, { "docid": "1c3f98747f646305d33f36cd0013a24a", "score": "0.52552664", "text": "function hamburgerTrigger() {\n navbar.classList.toggle('show-nav-links');\n} // Text balance headline, deck, and image captions", "title": "" }, { "docid": "38a519d11389d7c3cd09f6883df91bba", "score": "0.52503324", "text": "function navbarItemClicked() {\n var navbarNav = document.getElementById('nav-bar');\n navbarNav.addEventListener(\"click\", function(event) {\n var lastActive = document.getElementsByClassName('active')[0];\n var targetElement = event.target;\n \n // Prevents the navbar from recieving the 'active' class\n var isNavlink = event.toElement.localName == \"a\";\n\n if (isNavlink) {\n lastActive.classList.remove('active');\n targetElement.classList.add('active');\n }\n });\n}", "title": "" }, { "docid": "1d83233791d127ca97ca92fb4cba3d92", "score": "0.52439314", "text": "function openNav() {\n\tdocument.getElementById('myNav').style.display = 'block';\n\tlet toggleThemeButton = document.getElementById('themeChangeButton');\n\ttoggleThemeButton.remove();\n\tlet positionOfToggleButtonForSmallScreen = document.getElementById('themeChangeButtonSmallScreen');\n\tpositionOfToggleButtonForSmallScreen.appendChild(toggleThemeButton);\n}", "title": "" }, { "docid": "df483121f81104a561bc6ef7491130c2", "score": "0.5239328", "text": "function applyStyles() {\n\n var elements;\n var i;\n var color;\n var linkcolor;\n\n\n\n if (hirebridge_conf.font) {\n document.getElementById('hrbr-widget').style.fontFamily = hirebridge_conf.font;\n }\n if (hirebridge_conf.h3font) {\n elements = document.getElementsByTagName('h3');\n\n for (i = 0; i < elements.length; i++) {\n elements[i].style.fontFamily = hirebridge_conf.h3font;\n }\n }\n\n if (hirebridge_conf.btnfont) {\n elements = document.getElementsByClassName('hrbr-view-button');\n\n for (i = 0; i < elements.length; i++) {\n elements[i].style.fontFamily = hirebridge_conf.btnfont;\n }\n\n elements = document.getElementById('hrbr-swap-page').getElementsByTagName('a');\n\n for (i = 0; i < elements.length; i++) {\n elements[i].style.fontFamily = hirebridge_conf.btnfont;\n }\n }\n\n if (hirebridge_conf.fontsize) {\n\n document.getElementById('hrbr-widget').style.fontSize = hirebridge_conf.fontsize;\n\n }\n\n if (hirebridge_conf.btnsize) {\n\n elements = document.getElementsByClassName('hrbr-btn');\n for (i = 0; i < elements.length; i++) {\n //console.log(elements)\n element = elements[i].getElementsByTagName('a')[0];\n\n elements[i].classList.remove('hrbr-btn-sm');\n elements[i].classList.add(hirebridge_conf.btnsize);\n\n }\n\n elements = document.getElementById('hrbr-swap-page').getElementsByTagName('a');\n\n for (i = 0; i < elements.length; i++) {\n elements[i].classList.remove('hrbr-btn-sm');\n elements[i].classList.add(hirebridge_conf.btnsize);\n }\n }\n }", "title": "" }, { "docid": "a0607a1854bcef5764bb9bb8705220f4", "score": "0.5236876", "text": "function addButtons() {\n\taddButtonToMenu(\"Redraw\", false, fit);\n\taddButtonToMenu(\"Highlight superconcepts\", true, highlightSuperconcepts);\n\taddButtonToMenu(\"Highlight subconcepts\", true, highlightSubConcepts)\n}", "title": "" }, { "docid": "2f92ed693678cc4b8a9149e3072c6878", "score": "0.5235242", "text": "function navbar_dynamic(nav_name) {\n // managing navbar\n var url = window.location.href;\n $('.sidebar-menu li').each(function() {\n if ($(this).contents().children('span').text() == nav_name) {\n $(this).addClass('active');\n }\n });\n }", "title": "" }, { "docid": "9bba5515cc7b9c504fa89885ec071b05", "score": "0.5234025", "text": "function mark() {\n\n var currentPage = window.location.href;\n\n var links_container = document.getElementsByTagName('nav');\n var links = links_container[0].getElementsByTagName('a');\n for (let index = 0; index < links.length; index++) {\n\n if ((sub_name(links[index].href) == sub_name(currentPage)) && sub_name(currentPage) != \"signup.php\" &&\n sub_name(currentPage) != \"index.php\" && sub_name(currentPage) != \"#\" && sub_name(currentPage) != \"login.php\") {\n links[index].style.color = \"whitesmoke\";\n links[index].style.background = \"#383736\";\n links[index].parentElement.style.background = \"#383736\";\n }\n\n }\n}", "title": "" }, { "docid": "ddc2e0994bde7c3fb8a303431f01261a", "score": "0.5233292", "text": "function changeActiveNavbarLink(element) {\n // deactivate current navbar link\n for (let i = 0; i < navbarlinks.length; i++) {\n navbarlinks[i].classList.remove('active-nav-link');\n }\n // activate new navbar link\n element.classList.add('active-nav-link');\n}", "title": "" }, { "docid": "603da8b38582548e2a5ef1c377b87887", "score": "0.52282304", "text": "function navbarToggleClicked() {\n var navbarToggleBtn = document.getElementsByClassName('navbar-toggle')[0];\n\n navbarToggleBtn.addEventListener(\"click\", function() {\n var navbarNav = document.getElementById('nav-bar');\n var isVisible = navbarNav.classList.contains('navbar-mobile-visible');\n\n if (!isVisible) {\n navbarNav.classList.add('navbar-mobile-visible');\n } else {\n navbarNav.classList.remove('navbar-mobile-visible');\n }\n\n });\n}", "title": "" }, { "docid": "4dfbec07a76179db7aca260072791969", "score": "0.5227728", "text": "function buttonBoldColor() {\n if (isStyle('bold'))\n document.getElementById('btn_bold').style.backgroundColor = \"#2789b3\";\n else\n document.getElementById('btn_bold').style.backgroundColor = \"#FAFAFA\";\n}", "title": "" }, { "docid": "849ee6a095ee4afe8dc2b2fc44efc107", "score": "0.52221256", "text": "function linkAction() {\n // active link \n navLink.forEach(i => i.classList.remove(\"active\"))\n this.classList.add(\"active\")\n\n // Remove menu Mobile\n const navMenu = document.querySelector(\"#nav-menu\")\n navMenu.classList.remove(\"show\")\n}", "title": "" }, { "docid": "76d6d65b37147f77cbce89290645ea15", "score": "0.52214307", "text": "function toggle_button( tag )\n{\n\t//--------------------------------------------\n\t// Change the button status\n\t// Ensure we're not looking for FONT, SIZE or COLOR as these\n\t// buttons don't exist, they are select lists instead.\n\t//--------------------------------------------\n\t\t\t\n\tif ( (tag == 'font') || (tag == 'size') )\n\t{\n\t\treturn;\n\t}\n\t\n\tif ( opentags[ tag ] )\n\t{\n\t\tdocument.getElementById( tags_to_div[ tag ] ).className = 'rteimage';\n\t\t\n\t\t// Turn off\n\t\topentags[ tag ] = 0;\n\t}\n\telse\n\t{\n\t\tdocument.getElementById( tags_to_div[ tag ] ).className = 'rteImageRaised';\n\t\t\n\t\t// Turn on\n\t\topentags[ tag ] = 1;\n\t}\n}", "title": "" }, { "docid": "b41489604c70d5bec0eb100bcf94db46", "score": "0.5220921", "text": "function forsmallmedia() {\n if(window.innerWidth <= 991) {\n navbarTogglerButton.onclick = function() {\n navbar.style.padding = \".5rem 1rem\";\n navbar.style.backgroundColor = \"#24252a\";\n navbar.classList.add(\"shadow-scroll\");\n navbarlogo.classList.add(\"rounded-circle\");\n }\n }\n}", "title": "" }, { "docid": "a82d7ddb8d03c8bf49486ece8e582fa0", "score": "0.5218461", "text": "function toggleNavBar() {\n if (navBar.classList.contains(\"navbar-hidden\")) {\n navBar.classList.remove(\"navbar-hidden\");\n } else {\n navBar.classList.add(\"navbar-hidden\");\n } \n }", "title": "" }, { "docid": "faf143c85e12d0c90c7d820738c00494", "score": "0.52107257", "text": "function changesnav(classe) {\r\n\t\t$(\"#nav a\").removeClass(\"color\");\r\n\t\tclasse.addClass(\"color\");\r\n\t}", "title": "" }, { "docid": "cd637a731861546367ee40e1ad1882b7", "score": "0.52097553", "text": "function openNav() {\n document.getElementById(\"midiquinze-mobile-navbar-overlay\").style.height = \"100vh\";\n // document.querySelector(\".midiquinze-navbar-mobile\").classList.add(\"background-color-black\");\n }", "title": "" }, { "docid": "d5c1fc77d14a642066f9eb22aaca5d46", "score": "0.52063614", "text": "function ToggleAR() {\n let base_colour = 'color-grey';\n let colour = 'color-yellow';\n if ($('#ar-btn').hasClass(colour)) {\n $('#ar-btn').removeClass(colour);\n $('#ar-btn').addClass(base_colour);\n } else {\n $('#ar-btn').addClass(colour);\n $('#ar-btn').removeClass(base_colour);\n }\n\n $('#ar').contents().find('#blur').fadeToggle();\n}", "title": "" }, { "docid": "37b7d2086cb3eddf002b4daf0461e905", "score": "0.52048093", "text": "function navbarCheck() {\n\t\t\tif (navbar.length > 0 && navbar.hasClass('navbar-transparent')) {\n\t\t\t\tnavbatTrans = true;\n\t\t\t} else {\n\t\t\t\tnavbatTrans = false;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "b8b658d57be8366d89d73765162bfffd", "score": "0.5192274", "text": "function setActive() {\n linkedPage = document.querySelector('.app-navbar').getElementsByTagName('a');\n navbarLi = document.querySelectorAll('.app-navbar__menu-item');\n for(i = 0 ; i < linkedPage.length; i++) {\n if(document.location.href.indexOf(linkedPage[i].href) >= 0) {\n navbarLi[i].className='open';\n }\n }\n }", "title": "" }, { "docid": "de5759be9fc6e071be72e8bdc4a10469", "score": "0.519065", "text": "function gpHeaderMobileNav() {\n\t\t$( '#gp-mobile-nav-button' ).click( function() {\n\t\t\t$( 'body' ).addClass( 'gp-mobile-nav-active' );\n\t\t});\n\t\t\n\t\t$( '#gp-mobile-nav-close-button' ).click( function() {\n\t\t\t$( 'body' ).removeClass( 'gp-mobile-nav-active' );\n\t\t});\t\t\n\t}", "title": "" }, { "docid": "b52046dd390b2596218e071d543f0995", "score": "0.5190533", "text": "function showNav () {\n const navBar = document.querySelector('nav ol')\n const navBurger = document.querySelector('nav svg')\n if(navBar.className === \"\"){\n navBar.classList.add('d-flex')\n navBurger.style.color = 'white'\n } else {\n navBar.classList.remove('d-flex')\n navBurger.style.color = '#24376f'\n }\n }", "title": "" }, { "docid": "c62335cb5e58862d3a4acb128b8290c3", "score": "0.5187942", "text": "function onToolbarButtonClicked(el) {\n // if (el != selectedToolbarButton) {\n // selectedToolbarButton.removeClass('button-selected');\n // el.addClass('button-selected');\n selectedToolbarButton.removeClass('label-clicked');\n // selectedToolbarButton.removeClass('label-clicked-bacground');\n el.addClass('label-clicked');\n // el.addClass('label-clicked-bacground');\n\n selectedToolbarButton = el;\n\n switch (el.data('window')) {\n case \"upload\":\n $('#window-shop').hide();\n $('#window-upload').show();\n break;\n\n case \"show\":\n $('#window-shop').hide();\n $('#window-upload').hide();\n break;\n\n case \"shop\":\n $('#window-upload').hide();\n $('#window-shop').show();\n break;\n\n default:\n console.error(\"You should not come here\");\n }\n // }\n}", "title": "" }, { "docid": "7d3815d60a590ca5e8ff461f65fbba1c", "score": "0.5186683", "text": "function selectConfigFooter(event) {\n event.preventDefault();\n\n $(\"#apartado-config-footer\").css('display', 'block');\n\n $(\"#apartado-config-mail\").css('display', 'none');\n\n $(\"#apartado-config-avanzada\").css('display', 'none');\n\n $(\"#config-footer-button\").removeAttr('class').addClass('btn btn-primary');\n\n $(\"#config-mail-button\").removeAttr('class').addClass('btn btn-light');\n\n $(\"#config-avanzada-button\").removeAttr('class').addClass('btn btn-danger');\n\n}", "title": "" }, { "docid": "c8b3ce78ae584c5ee219899def8c2c51", "score": "0.518593", "text": "function onNavBarToggle() {\n\t\t$(Selector.NAVBAR_SIDEBAR).toggleClass(ClassName.SIDEBAR_OPEN);\n\t\tif ($(Selector.NAVBAR_SIDEBAR).hasClass(ClassName.NAVBAR_SIDEBAR) && $(Selector.NAVBAR_SIDEBAR).hasClass(ClassName.SIDEBAR_OPEN)) {\n\t\t\t$(Selector.OVERLAY).addClass(ClassName.OVERLAY_ACTIVE);\n\t\t\t$(Selector.BODY).addClass(ClassName.BODY_OPEN);\n\t\t} else {\n\t\t\t$(Selector.OVERLAY).removeClass(ClassName.OVERLAY_ACTIVE);\n\t\t\t$(Selector.BODY).addClass(ClassName.BODY_OPEN);\n\t\t}\n\t}", "title": "" }, { "docid": "1798bca10fcd372acde7192cd6f0dd3f", "score": "0.51840967", "text": "function onNavBarToggle() {\n\t\t$(Selector.NAVBAR_SIDEBAR).toggleClass(ClassName.OPEN);\n\t\tif ($(Selector.NAVBAR_SIDEBAR).hasClass(ClassName.NAVBAR_SIDEBAR) && $(Selector.NAVBAR_SIDEBAR).hasClass(ClassName.OPEN)) {\n\t\t\t$(Selector.OVERLAY).addClass(ClassName.OVERLAY_ACTIVE);\n\t\t\t$(Selector.BODY).addClass(ClassName.BODY_OPEN);\n\t\t} else {\n\t\t\t$(Selector.OVERLAY).removeClass(ClassName.OVERLAY_ACTIVE);\n\t\t\t$(Selector.BODY).addClass(ClassName.BODY_OPEN);\n\t\t}\n\t}", "title": "" }, { "docid": "2e10c91b0323994949d7cc40f1098a11", "score": "0.5182442", "text": "function beerStyles(){\n styleFilter.forEach(function(style) {\n $('#styles').append('<button class=\"btn-primary filter-button btn-on\">' + style + '</button> ')\n });\n }", "title": "" }, { "docid": "0d4ecbbc0886c49d2524139e195420d1", "score": "0.5182005", "text": "function NavHandler() {\n let navList = document.querySelector('.navbar-collapse');\n if (navList.classList.contains('show')) {\n document.querySelector('.top-information').classList.remove('hide');\n document.querySelector('.slides').classList.remove('hide');\n } else {\n document.querySelector('.top-information').classList.add('hide');\n document.querySelector('.slides').classList.add('hide');\n }\n}", "title": "" }, { "docid": "d5888b1f1bd0e715e551a629f1fc77e4", "score": "0.5173415", "text": "function addService(name, icon, color) {\n var ul = document.getElementById('ultitlebuttons')\n var li = document.createElement('li')\n var btn = document.createElement('button')\n\n li.setAttribute('class', 'lititlebutton')\n \n btn.setAttribute('class', 'btntitlebutton')\n btn.setAttribute('id', 'btnservice' + name)\n btn.style.background = 'url(' + icon + ')'\n\n btn.addEventListener('click', () => {\n window.selectService(name)\n if (color != 'nochange') {\n titlebar.style.backgroundColor = color;\n }\n })\n\n\n li.append(btn)\n\n ul.appendChild(li)\n}", "title": "" }, { "docid": "0e9d5b29b78f481d5effa71b72b37179", "score": "0.5173254", "text": "styleClickedLink2() {\n const clickedLinkSyle = `\n .selected-slider {\n text-align: center;\n margin: 5px;\n background-color: #65226D !important;\n color: white !important;\n border-radius: 10px;\n padding: 8px;\n font-weight: bold;\n box-sizing: border-box;\n }\n `\n\n \n const clickedLinkStyleSheet = document.createElement('style');\n clickedLinkStyleSheet.innerText = clickedLinkSyle\n document.head.appendChild(clickedLinkStyleSheet)\n }", "title": "" }, { "docid": "18d46fe4170fd9b004d8e0a5795f4a1c", "score": "0.5164658", "text": "function navigation() {\n // Toggle Nav List\n $navContainer.toggleClass($active);\n // Toggle Nav Button Color and \"Close/Menu\" innerHTML display\n $navButton.toggleClass($active);\n $navButton.toggleClass($notActive);\n $navButtonClose.toggleClass($active);\n}", "title": "" }, { "docid": "5923e31c3a36129ea2eb8225d7f6c220", "score": "0.5158157", "text": "checkActiveBtn(marker) {\n if (Array.from(this.nodes.wrapper.classList).includes(marker)) {\n return 'text-blue-500';\n } else {\n return 'text-gray-600';\n }\n }", "title": "" }, { "docid": "0fa5578e80afa9bc002e7136f35e5730", "score": "0.51547134", "text": "function toggleNavBarClass(e) {\n const navbar = document.querySelector(\"#main-menu\");\n if(window.pageYOffset == 0) {\n navbar.classList.add('navbar-at-top');\n }\n else navbar.classList.remove('navbar-at-top');\n}", "title": "" }, { "docid": "b9538b501900cbff430fed6e342618c1", "score": "0.5151086", "text": "function Buttons() {\n return (\n <div className = \"Bus\" >\n \n \n \n < a href=\"google\" className = \"Buttons\" >Google Search</ a>\n \n \n\n \n \n \n \n \n </div>\n )\n }", "title": "" }, { "docid": "3630af8a5d2b19f873044b11b4b7b9eb", "score": "0.51504755", "text": "function highlightNavbarLink() {\n $('.navbar a[href=\"' + this.location.pathname + '\"]').parent().addClass('active');\n}", "title": "" }, { "docid": "e2232b879022a18180a3ae97825c4d36", "score": "0.5146705", "text": "currentPage(input) {\n return this.state.page === `${input}` ? \"navbar-button selected\" : \"navbar-button\";\n }", "title": "" }, { "docid": "dfe24d7766e4a972a64c84032bfa261b", "score": "0.51466894", "text": "function changeNavbarColor(background, border, color, activeColor, opacity) {\n $('nav').animate({\n 'background-color': background,\n color: color,\n 'border-color': background\n }, 300);\n\n\n $('nav').css('opacity', opacity);\n }", "title": "" }, { "docid": "4f18eeba63d905d617cb0345a6aec58d", "score": "0.5138934", "text": "function menu_controller_on(){\n\t// IDENTIFICAR ELEMENTOS -----------------\n\t// Boton \n\tvar btn_dash = $('#btn-dash-menu');\n\t// Contenedor Botones\n\tvar cont_btns = $('#list-btns-fun');\n\t// Incono Boton Dash\n\tvar icon_btn_dash = $('#ico-dash');\n\t// Rol de usuario\n\tvar user_rol = $(\"#navigation-user\").attr(\"dtr\");\n\t// Contenedor Info Usuario\n\tvar nav_info = $(\"#nav-info\");\n\t// Botones Vistas\n\tvar btns_views = document.getElementsByClassName('btn-fun-user');\n\tconsole.log(\"btns_views\", btns_views.length);\n\t// btns_views.fadeIn();\n\t\n\t// INICIAR ANIMACIONES -----------------\n\t// Apagar Contenedor Info\n\tnav_info.hide();\n\t\n\t// Ancho de la barra segun Usuario ==========================\n\tswitch (user_rol) {\n\t\t\n\t\t\n\t\tcase \"2\": //Digitador Auxiliar\n\t\t\t// statements_1\n\t\t\tcont_btns.css({width:'400px'});\n\t\t\tbreak;\n\n\t\tcase \"3\": //Evaluador Elegibilidad\n\t\t\t// statements_1\n\t\t\tcont_btns.css({width:'700px'});\n\t\t\tbreak;\n\n\t\tcase \"4\": //Evaluador Viabilidad\n\t\t\t// statements_1\n\t\t\tcont_btns.css({width:'700px'});\n\t\t\tbreak;\n\t\t\n\t\tcase \"5\": //Gestor Tecnico\n\t\t\t// statements_1\n\t\t\tcont_btns.css({width:'1300px'});\n\t\t\tbreak;\n\t\t\n\t\tcase \"6\": //Usuario Juridico\n\t\t\t// statements_1\n\t\t\tcont_btns.css({width:'700px'});\n\t\t\tbreak;\n\n\t\tcase \"7\": //Colombia Productiva\n\t\t\t// statements_1\n\t\t\tcont_btns.css({width:'1150px'});\n\t\t\tbreak;\n\t\t\n\t\tcase \"8\": //usuario Sena\n\t\t\t// statements_1\n\t\t\tcont_btns.css({width:'1150px'});\n\t\t\tbreak;\n\t\t\n\t\tdefault: //Opcion por defecto\n\t\t\tcont_btns.css({width:'1300px'});\n\t\t\tbreak;\n\t}\n\t// Icono de despliegue\n\ticon_btn_dash.css({transform:'rotate(180deg)'});\n\t// $('.btn-fun-user').show();\n\tbtn_dash.attr('onclick', 'menu_controller_off()');\n\tsetTimeout(function(){btns_views[7].style.display = 'inline';}, 150)\n\tsetTimeout(function(){btns_views[6].style.display = 'inline';}, 200)\n\tsetTimeout(function(){btns_views[5].style.display = 'inline';}, 260)\n\tsetTimeout(function(){btns_views[4].style.display = 'inline';}, 320)\n\tsetTimeout(function(){btns_views[3].style.display = 'inline';}, 390)\n\tsetTimeout(function(){btns_views[2].style.display = 'inline';}, 500)\n\tsetTimeout(function(){btns_views[1].style.display = 'inline';}, 650)\n\tsetTimeout(function(){btns_views[0].style.display = 'inline';}, 800)\t\n}", "title": "" }, { "docid": "fc89f9b0f86fb88b738988319e8020a5", "score": "0.51387334", "text": "function selectConfigAvanzada(event) {\n event.preventDefault();\n\n $(\"#apartado-config-avanzada\").css('display', 'block');\n\n $(\"#apartado-config-mail\").css('display', 'none');\n\n $(\"#apartado-config-footer\").css('display', 'none');\n\n $(\"#config-avanzada-button-button\").removeAttr('class').addClass('btn btn-primary');\n\n $(\"#config-mail-button\").removeAttr('class').addClass('btn btn-light');\n $(\"#config-footer-button\").removeAttr('class').addClass('btn btn-light');\n\n}", "title": "" }, { "docid": "21ca3791629915b1a8df33d71d24d4e9", "score": "0.51355135", "text": "function linkAction() {\n \n // Action link \n navlink.forEach(n => n.classList.remove('active'));\n this.classList.add('active');\n\n //Remove mobile menu\n const navMenu = document.getElementById('nav-menu');\n navMenu.classList.remove('show');\n}", "title": "" }, { "docid": "af78c80c710b2b25879751c6fd84ac3e", "score": "0.51275814", "text": "function toggleButton(){ /*Toggle function, grabs the navList, classList and we want a toggle with a future class (show)*/\n navList.classList.toggle('show')\n}", "title": "" }, { "docid": "81c77702721abbc3cd8b03d574cfcece", "score": "0.51259923", "text": "tag() {\n return \"detroit-main-menu\";\n }", "title": "" } ]
a7318eae6ccf085df699aa8b9b3c0cf6
For 16 bit unsigned numbers we can do all the casting that we want to do.
[ { "docid": "0e963d811b6868007a649aabc170a4d4", "score": "0.5134837", "text": "function rgint16(buffer, endian, offset)\n{\n\tvar val = 0;\n\n\tif (endian == 'big') {\n\t\tval = buffer[offset] << 8;\n\t\tval |= buffer[offset+1];\n\t} else {\n\t\tval = buffer[offset];\n\t\tval |= buffer[offset+1] << 8;\n\t}\n\n\treturn (val);\n\n}", "title": "" } ]
[ { "docid": "e06802a18d636600b54b354ba22fc47b", "score": "0.72015184", "text": "function ToUint16(v) { return v & 0xFFFF; }", "title": "" }, { "docid": "56835f8a1494d2cb3250da4921c3b4b4", "score": "0.68183416", "text": "function ToInt16(v) { return (v << 16) >> 16; }", "title": "" }, { "docid": "946cd4fcb9385cd41fbf77978df95945", "score": "0.6675088", "text": "function CONVERSION16()\n{\t\n\tb16= document.getElementById('base16');\n\tif(!isNaN(b16.value))\n\t{\n\t\tdocument.getElementById('base2').value = (b16.value-0).toString(2);\n\t\tdocument.getElementById('base10').value = (b16.value - 0).toString(10);\n\t\tb16.value = (b16.value - 0).toString(16);\t\n\t}else{\n\t\tdocument.getElementById('base2').value = parseInt(document.getElementById('base2').value,16);\n\t\tdocument.getElementById('base10').value = parseInt(document.getElementById('base10').value,16);\n\t\tb16.value = parseInt(b16.value,16);\t\n\t}\n\t\n}", "title": "" }, { "docid": "48afad3be716831e4bd6adc06e7324f2", "score": "0.63325226", "text": "function signedInt16ArrayToUnsigned(arr) {\r\n var returnString = \"\";\r\n for (i = 0; i < arr.length; i++) {\r\n sample = arr[i];\r\n if (sample >= 0) {\r\n var r = integerToByte_LittleEndian(sample); }\r\n else if (sample < 0) {\r\n sample = sample + 65536; // (16^4)\r\n var r = integerToByte_LittleEndian(sample); }\r\n returnString = returnString.concat(r); }\r\n return returnString; }", "title": "" }, { "docid": "dc421c5a1ff5e9d77e2ee421ba3222c2", "score": "0.63166505", "text": "function setU16(data) {view.setUint16(pos, data, true); pos += 2}", "title": "" }, { "docid": "efe71aac21a7e813a99f028c660a7df2", "score": "0.6241725", "text": "function YInputCaptureData_decodeU16(sdata,ofs)\n {\n var v; // int;\n v = (sdata).charCodeAt(ofs);\n v = v + 256 * (sdata).charCodeAt(ofs+1);\n return v;\n }", "title": "" }, { "docid": "7845b286bd5e2492ef1d7fbeb4c324d5", "score": "0.6164272", "text": "readUint16() {\n const value = this.dataView.getUint16(this.index, this.littleEndian);\n this.index += 2;\n return value;\n }", "title": "" }, { "docid": "1bb4c26a114ce54d985d0e6591c75312", "score": "0.61314267", "text": "loadU16(offset) {\n return this.view.getUint16(offset & this.mask, true);\n }", "title": "" }, { "docid": "a9167771051c548091f8ffa8883e9ff3", "score": "0.6120826", "text": "function asInt16 (value) {\n return new Int16Array([value])[0]\n}", "title": "" }, { "docid": "009fe0d0b4869249e9ef5ff6b8f0ae75", "score": "0.6118624", "text": "function asInt16(value) {\n return new Int16Array([value])[0];\n}", "title": "" }, { "docid": "cca9d64cfc9808590140576a0b3adf75", "score": "0.6074269", "text": "function add16(a, b) {\n return (a + b) & 0xFFFF;\n}", "title": "" }, { "docid": "8c048e3c4171ea17ea4809d698cb6ee4", "score": "0.5982381", "text": "readUint16() {\n const value = this._data.getUint16(this.offset, this.littleEndian);\n this.offset += 2;\n return value;\n }", "title": "" }, { "docid": "8c048e3c4171ea17ea4809d698cb6ee4", "score": "0.5982381", "text": "readUint16() {\n const value = this._data.getUint16(this.offset, this.littleEndian);\n this.offset += 2;\n return value;\n }", "title": "" }, { "docid": "bafa2e15f0729e1eed507e031c74afeb", "score": "0.59739745", "text": "function write_u16(num, littleEndian=true) {\n const data = [num & 255, (num >> 8) & 255];\n return !littleEndian ? data.reverse() : data;\n}", "title": "" }, { "docid": "165b6ab8967241d4cc81646c8a508591", "score": "0.5948545", "text": "function wgint16(val, endian, buffer, offset)\n\t{\n\t\tif (endian == 'big') {\n\t\t\tbuffer[offset] = (val & 0xff00) >>> 8;\n\t\t\tbuffer[offset+1] = val & 0x00ff;\n\t\t} else {\n\t\t\tbuffer[offset+1] = (val & 0xff00) >>> 8;\n\t\t\tbuffer[offset] = val & 0x00ff;\n\t\t}\n\t}", "title": "" }, { "docid": "165b6ab8967241d4cc81646c8a508591", "score": "0.5948545", "text": "function wgint16(val, endian, buffer, offset)\n\t{\n\t\tif (endian == 'big') {\n\t\t\tbuffer[offset] = (val & 0xff00) >>> 8;\n\t\t\tbuffer[offset+1] = val & 0x00ff;\n\t\t} else {\n\t\t\tbuffer[offset+1] = (val & 0xff00) >>> 8;\n\t\t\tbuffer[offset] = val & 0x00ff;\n\t\t}\n\t}", "title": "" }, { "docid": "4f9724492e331288305d5f103158f188", "score": "0.59181046", "text": "function dec2hex(v) {return v.toString(16);}", "title": "" }, { "docid": "614a16b34091c508a90f78bc5b17e734", "score": "0.5915468", "text": "function read_u16(data, littleEndian=true) {\n const [a, b] = data.splice(0, 2);\n\n return littleEndian ? (b << 8 | a) : (a << 8 | b);\n}", "title": "" }, { "docid": "08e3a8a93c5d6f24251993db55ae90e3", "score": "0.5908508", "text": "function wgint16(val, endian, buffer, offset)\n{\n\tif (endian == 'big') {\n\t\tbuffer[offset] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset+1] = val & 0x00ff;\n\t} else {\n\t\tbuffer[offset+1] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset] = val & 0x00ff;\n\t}\n}", "title": "" }, { "docid": "08e3a8a93c5d6f24251993db55ae90e3", "score": "0.5908508", "text": "function wgint16(val, endian, buffer, offset)\n{\n\tif (endian == 'big') {\n\t\tbuffer[offset] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset+1] = val & 0x00ff;\n\t} else {\n\t\tbuffer[offset+1] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset] = val & 0x00ff;\n\t}\n}", "title": "" }, { "docid": "08e3a8a93c5d6f24251993db55ae90e3", "score": "0.5908508", "text": "function wgint16(val, endian, buffer, offset)\n{\n\tif (endian == 'big') {\n\t\tbuffer[offset] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset+1] = val & 0x00ff;\n\t} else {\n\t\tbuffer[offset+1] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset] = val & 0x00ff;\n\t}\n}", "title": "" }, { "docid": "08e3a8a93c5d6f24251993db55ae90e3", "score": "0.5908508", "text": "function wgint16(val, endian, buffer, offset)\n{\n\tif (endian == 'big') {\n\t\tbuffer[offset] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset+1] = val & 0x00ff;\n\t} else {\n\t\tbuffer[offset+1] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset] = val & 0x00ff;\n\t}\n}", "title": "" }, { "docid": "08e3a8a93c5d6f24251993db55ae90e3", "score": "0.5908508", "text": "function wgint16(val, endian, buffer, offset)\n{\n\tif (endian == 'big') {\n\t\tbuffer[offset] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset+1] = val & 0x00ff;\n\t} else {\n\t\tbuffer[offset+1] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset] = val & 0x00ff;\n\t}\n}", "title": "" }, { "docid": "08e3a8a93c5d6f24251993db55ae90e3", "score": "0.5908508", "text": "function wgint16(val, endian, buffer, offset)\n{\n\tif (endian == 'big') {\n\t\tbuffer[offset] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset+1] = val & 0x00ff;\n\t} else {\n\t\tbuffer[offset+1] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset] = val & 0x00ff;\n\t}\n}", "title": "" }, { "docid": "4a8fc00ee8603bac08d7a5e4f19b663d", "score": "0.58765256", "text": "function be_pack16 (index, n) {\n\t\t// swap bytes\n\t\twav[index] = (n & 255) * 256 + ((n >> 8) & 255)\n\t}", "title": "" }, { "docid": "4e33b6ef193d88573a3df13e485d0293", "score": "0.58571917", "text": "function float32Toint16(view, offset, input){\n var i = 0, len = input.length, sample;\n for ( ; i < len; i++, offset += 2 ){\n sample = input[i] < -1 ? -1 : input[i] > 1 ? 1 : input[i];\n view.setInt16(offset, sample < 0 ? sample * 0x8000 : sample * 0x7FFF, true);\n }\n}", "title": "" }, { "docid": "4cc36ad005d8403878111121c83edd24", "score": "0.58240616", "text": "function TwoBytesToUInt16(stream) {\n\n var uInt16Data = stream.slice(0,2);\n var uInt16View = new DataView(new ArrayBuffer(2));\n var uInt16Result;\n\n for (var i = 0; i < stream.length; i++) {\n if (stream[i] > 0xFF) {\n throw 'Byte value overflow!';\n }\n }\n\n uInt16Data.forEach(function (b,i) {\n uInt16View.setUint8(i, b);\n });\n uInt16Result = uInt16View.getUint16(0);\n return(uInt16Result);\n}", "title": "" }, { "docid": "254d1489691ff4886eeb259d97d56471", "score": "0.5802644", "text": "function getUShort(dataView, offset) {\n return dataView.getUint16(offset, false);\n } // Retrieve a signed 16-bit short from the DataView.", "title": "" }, { "docid": "54f1076b5380af2f883aa0d8c9635a95", "score": "0.5789354", "text": "function test16()\n{\n\tvar data = new Buffer(4);\n\t/* Test signed values first */\n\tdata[0] = 0;\n\tdata[1] = 0x23;\n\tdata[2] = 0x42;\n\tdata[3] = 0x3f;\n\n\tASSERT.equal(0x23, mod_ctype.ruint16(data, 'big', 0));\n\tASSERT.equal(0x2342, mod_ctype.ruint16(data, 'big', 1));\n\tASSERT.equal(0x423f, mod_ctype.ruint16(data, 'big', 2));\n\n\tASSERT.equal(0x2300, mod_ctype.ruint16(data, 'little', 0));\n\tASSERT.equal(0x4223, mod_ctype.ruint16(data, 'little', 1));\n\tASSERT.equal(0x3f42, mod_ctype.ruint16(data, 'little', 2));\n\n\tdata[0] = 0xfe;\n\tdata[1] = 0xfe;\n\n\tASSERT.equal(0xfefe, mod_ctype.ruint16(data, 'big', 0));\n\tASSERT.equal(0xfefe, mod_ctype.ruint16(data, 'little', 0));\n}", "title": "" }, { "docid": "d1a48d823e666f7e753f12a9974dec29", "score": "0.5736015", "text": "function set16(data) {\n\t\t\tview.setUint16(pos, data, lsb);\n\t\t\tpos += 2\n\t\t}", "title": "" }, { "docid": "f979a2c8245288484d4e3dd320b69d88", "score": "0.57200927", "text": "function getUShort(dataView, offset) {\n return dataView.getUint16(offset, false);\n} // Retrieve a signed 16-bit short from the DataView.", "title": "" }, { "docid": "da8e879eed8c735d37ec3a3aefbe9e3f", "score": "0.5622801", "text": "function _base36To16(value) {\n return (new BN(value, 36)).toString(16);\n }", "title": "" }, { "docid": "d37921abc850e60dac6003c855024012", "score": "0.56156033", "text": "function addr16ToAddr32(a16) { //deduce numeric page and numeric device from numeric addr16\n}", "title": "" }, { "docid": "984d2de3c57e0da20446702323d800d2", "score": "0.5598754", "text": "function uint16_to_be_hex(num) {\n result = num.toString(16)\n fill_length = 8 - result.length\n\n if (fill_length > 0) {\n result = \"0\".repeat(fill_length) + result\n }\n\n return result\n}", "title": "" }, { "docid": "6d8bb959174f2c9b1905f1dfb7ba8d91", "score": "0.55969715", "text": "function decodeFloat16(bin) {\n\t\t\tconst exp=(bin>>>10)-15; // bin must represent a positive/0 float\n\t\t\treturn exp>=0? ((bin&0x3FF|0x400)<<exp)/0x400:0;\n\t\t}", "title": "" }, { "docid": "0bb48149152f923ca53c0deda4d3b3cf", "score": "0.5594299", "text": "function swap16(val) {\n return ((val & 0xFF) << 8)\n | ((val >> 8) & 0xFF);\n }", "title": "" }, { "docid": "b8a897778cea222c22c5510d6c7524ac", "score": "0.5588837", "text": "function convertFloat32ToInt16(buffer) {\n let l = buffer.length;\n let buf = new Int16Array(l / 3);\n\n while (l--) {\n if (l % 3 == 0) {\n buf[l / 3] = buffer[l] * 0xffff;\n }\n }\n return buf.buffer;\n}", "title": "" }, { "docid": "a9a3da612ba38e076ba6c9e58f156b79", "score": "0.55707645", "text": "function getdevice(a16) { ///// this prolly could be converted into an array???????????\n\tswitch (a16 & 0xc000) {\n\t\tcase 0x0000: return(0);\n\t\tcase 0x4000: return(slot4000dv);\n\t\tcase 0x8000: return(slot8000dv);\n\t\tcase 0xC000: return(1);\n\t}\n}", "title": "" }, { "docid": "2016bda3e52c42e4970e937ed3549efe", "score": "0.55544835", "text": "function getUShort(dataView, offset) {\n return dataView.getUint16(offset, false);\n }", "title": "" }, { "docid": "28896d8bb9b9b1a0ff478016850c0050", "score": "0.5541068", "text": "function readInt16() {\n\t var result = (str.charCodeAt(position) << 8) + str.charCodeAt(position + 1);\n\t position += 2;\n\t return result;\n\t }", "title": "" }, { "docid": "14d3ecc6b907dc014cc0671699d31ef5", "score": "0.5538113", "text": "function getUShort(dataView, offset) {\n return dataView.getUint16(offset, false);\n }", "title": "" }, { "docid": "9d4fc379bacdfc73b251b0c589c6fdfe", "score": "0.5530152", "text": "function _base36To16(value) {\n return (new BN(value, 36)).toString(16);\n}", "title": "" }, { "docid": "9d4fc379bacdfc73b251b0c589c6fdfe", "score": "0.5530152", "text": "function _base36To16(value) {\n return (new BN(value, 36)).toString(16);\n}", "title": "" }, { "docid": "9d4fc379bacdfc73b251b0c589c6fdfe", "score": "0.5530152", "text": "function _base36To16(value) {\n return (new BN(value, 36)).toString(16);\n}", "title": "" }, { "docid": "9d4fc379bacdfc73b251b0c589c6fdfe", "score": "0.5530152", "text": "function _base36To16(value) {\n return (new BN(value, 36)).toString(16);\n}", "title": "" }, { "docid": "9d4fc379bacdfc73b251b0c589c6fdfe", "score": "0.5530152", "text": "function _base36To16(value) {\n return (new BN(value, 36)).toString(16);\n}", "title": "" }, { "docid": "ba22756a1ed492f95b9890be638b263f", "score": "0.55183536", "text": "function dec (hex) {return parseInt(hex, 16);}", "title": "" }, { "docid": "9195a62bc50f0ae2cfafa4fa477535ce", "score": "0.5487147", "text": "function readInt16() {\n\t\tvar result = ( (str.charCodeAt(position) << 8) + str.charCodeAt(position + 1));\n\t\tposition += 2;\n\t\treturn result;\n\t}", "title": "" }, { "docid": "82f84493008c1cba228423206c92d602", "score": "0.54861647", "text": "function getUShort(dataView, offset) {\n\t return dataView.getUint16(offset, false);\n\t}", "title": "" }, { "docid": "576e0918a690743aee412d016edb54d9", "score": "0.5470922", "text": "function swap16(val) {\n return ((val & 0xFF) << 8) | ((val >> 8) & 0xFF);\n}", "title": "" }, { "docid": "3855fca8e16cd495fda36ffdfc0685ca", "score": "0.54689765", "text": "function parseIntFromHex(val){return parseInt(val,16);}", "title": "" }, { "docid": "6e884e471acdd53045fe783a19566a32", "score": "0.54661757", "text": "function int16_BE(bytes, idx) { return int_BE(bytes, 2, idx); }", "title": "" }, { "docid": "1f1cbc73b4b576806e4675ec896fa5bd", "score": "0.54030627", "text": "function readInt16() {\n var result = (\n (str.charCodeAt(position) << 8)\n + str.charCodeAt(position + 1));\n position += 2;\n return result;\n }", "title": "" }, { "docid": "6adf5bcfd466a55edab2fbb064613288", "score": "0.53941274", "text": "readInt16() {\n const value = this._data.getInt16(this.offset, this.littleEndian);\n this.offset += 2;\n return value;\n }", "title": "" }, { "docid": "6adf5bcfd466a55edab2fbb064613288", "score": "0.53941274", "text": "readInt16() {\n const value = this._data.getInt16(this.offset, this.littleEndian);\n this.offset += 2;\n return value;\n }", "title": "" }, { "docid": "723a9da31b18cd12a59fdbd2c220d9b2", "score": "0.5373635", "text": "function getUShort(dataView, offset) {\n return dataView.getUint16(offset, false);\n}", "title": "" }, { "docid": "723a9da31b18cd12a59fdbd2c220d9b2", "score": "0.5373635", "text": "function getUShort(dataView, offset) {\n return dataView.getUint16(offset, false);\n}", "title": "" }, { "docid": "723a9da31b18cd12a59fdbd2c220d9b2", "score": "0.5373635", "text": "function getUShort(dataView, offset) {\n return dataView.getUint16(offset, false);\n}", "title": "" }, { "docid": "723a9da31b18cd12a59fdbd2c220d9b2", "score": "0.5373635", "text": "function getUShort(dataView, offset) {\n return dataView.getUint16(offset, false);\n}", "title": "" }, { "docid": "e295d0c939045b34fb111f7473a79f1a", "score": "0.5362691", "text": "function h2d(h) {\n return parseInt(h, 16);\n }", "title": "" }, { "docid": "6d6d10ca169c9b3345d0a0193bea9de6", "score": "0.53579634", "text": "function clampToInt16(x) {\n return Math.max(Math.min(Math.round(x), 32767), -32768);\n}", "title": "" }, { "docid": "56d8494ce8ecead7200fc93e647944f0", "score": "0.53570056", "text": "function unhex(str) { return parseInt(str, 16); }", "title": "" }, { "docid": "d77fe2537c51397ea0f21012e950f8b4", "score": "0.5341463", "text": "function h2d(h) {\n return parseInt(h, 16);\n }", "title": "" }, { "docid": "5e228205f008fe9f1e310194a157edc3", "score": "0.5319105", "text": "load16(offset) {\n return this.view.getInt16(offset & this.mask, true);\n }", "title": "" }, { "docid": "c4c398231f5adc4ecba881f2b073f8a3", "score": "0.5307911", "text": "function ascTo16(str) \n{\n\tvar dbyte = new Array(16);\n\tvar i;\n for( i=0; i<16; i++ )\n {\n dbyte[i] = str.charCodeAt(i);\n }\n\n\treturn dbyte;\n}", "title": "" }, { "docid": "5120a04d24deb27ef729646891c8102a", "score": "0.5304902", "text": "function getFloat16Decoder() {\n // Algorithm is based off of\n // http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf\n // Cache lookup tables\n const mantisaTable = computeFloat16MantisaTable();\n const exponentTable = computeFloat16ExponentTable();\n const offsetTable = computeFloat16OffsetTable();\n return (quantizedArray) => {\n const buffer = new ArrayBuffer(4 * quantizedArray.length);\n const bufferUint32View = new Uint32Array(buffer);\n for (let index = 0; index < quantizedArray.length; index++) {\n const float16Bits = quantizedArray[index];\n const float32Bits = mantisaTable[offsetTable[float16Bits >> 10] + (float16Bits & 0x3ff)] +\n exponentTable[float16Bits >> 10];\n bufferUint32View[index] = float32Bits;\n }\n return new Float32Array(buffer);\n };\n}", "title": "" }, { "docid": "47fc7c4bb0c8430bc0a9b60edfb26824", "score": "0.5267539", "text": "function ToUint32(v) { return v >>> 0; }", "title": "" }, { "docid": "4a87d864aefc9372fb7d0da7d3137c5e", "score": "0.5264919", "text": "function dec_fix(num) {\n return parseInt(Number('0x' + (num < 0 ? (0xFFFFFFFF + num + 1).toString(16).slice(2) : num.toString(16))), 10);\n}", "title": "" }, { "docid": "6fc5ba99f41c052ad55cd66fc6307593", "score": "0.5263752", "text": "function bytesToInt16(bytes) {\n var val = bytes[1]<<8 | bytes[0];\n return (val < 0x8000) ? val : val - 0x10000;\n }", "title": "" }, { "docid": "687cf2a818acbe37e731f4dea58b4336", "score": "0.5260194", "text": "function wuint16(value, endian, buffer, offset)\n{\n\tvar val;\n\n\tif (value === undefined)\n\t\tthrow (new Error('missing value'));\n\n\tif (endian === undefined)\n\t\tthrow (new Error('missing endian'));\n\n\tif (buffer === undefined)\n\t\tthrow (new Error('missing buffer'));\n\n\tif (offset === undefined)\n\t\tthrow (new Error('missing offset'));\n\n\tif (offset + 1 >= buffer.length && buffer instanceof Buffer)\n\t\tthrow (new Error('Trying to write beyond buffer length'));\n\n\tval = prepuint(value, 0xffff);\n\tif (endian == 'big') {\n\t\tbuffer[offset] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset+1] = val & 0x00ff;\n\t} else {\n\t\tbuffer[offset+1] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset] = val & 0x00ff;\n\t}\n}", "title": "" }, { "docid": "1df48c59f7f1609bb61cc95ca322b2bc", "score": "0.5258798", "text": "function getFloat16Decoder() {\n // Algorithm is based off of\n // http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf\n // Cache lookup tables\n var mantisaTable = computeFloat16MantisaTable();\n var exponentTable = computeFloat16ExponentTable();\n var offsetTable = computeFloat16OffsetTable();\n return function (quantizedArray) {\n var buffer = new ArrayBuffer(4 * quantizedArray.length);\n var bufferUint32View = new Uint32Array(buffer);\n for (var index = 0; index < quantizedArray.length; index++) {\n var float16Bits = quantizedArray[index];\n var float32Bits = mantisaTable[offsetTable[float16Bits >> 10] + (float16Bits & 0x3ff)] + exponentTable[float16Bits >> 10];\n bufferUint32View[index] = float32Bits;\n }\n return new Float32Array(buffer);\n };\n}", "title": "" }, { "docid": "9b600b440867e45d3948509f7e1523eb", "score": "0.5220544", "text": "function bnShortValue(){return 0==this.t?this.s:this[0]<<16>>16}", "title": "" }, { "docid": "49c31a365d99576ee482cbb83e2b8e7c", "score": "0.52123994", "text": "function wsint16(value, endian, buffer, offset)\n{\n\tvar val;\n\n\tif (value === undefined)\n\t\tthrow (new Error('missing value'));\n\n\tif (endian === undefined)\n\t\tthrow (new Error('missing endian'));\n\n\tif (buffer === undefined)\n\t\tthrow (new Error('missing buffer'));\n\n\tif (offset === undefined)\n\t\tthrow (new Error('missing offset'));\n\n\tif (offset + 1 >= buffer.length)\n\t\tthrow (new Error('Trying to read beyond buffer length'));\n\n\tval = prepsint(value, 0x7fff, -0x8000);\n\tif (val >= 0)\n\t\twgint16(val, endian, buffer, offset);\n\telse\n\t\twgint16(0xffff + val + 1, endian, buffer, offset);\n\n}", "title": "" }, { "docid": "49c31a365d99576ee482cbb83e2b8e7c", "score": "0.52123994", "text": "function wsint16(value, endian, buffer, offset)\n{\n\tvar val;\n\n\tif (value === undefined)\n\t\tthrow (new Error('missing value'));\n\n\tif (endian === undefined)\n\t\tthrow (new Error('missing endian'));\n\n\tif (buffer === undefined)\n\t\tthrow (new Error('missing buffer'));\n\n\tif (offset === undefined)\n\t\tthrow (new Error('missing offset'));\n\n\tif (offset + 1 >= buffer.length)\n\t\tthrow (new Error('Trying to read beyond buffer length'));\n\n\tval = prepsint(value, 0x7fff, -0x8000);\n\tif (val >= 0)\n\t\twgint16(val, endian, buffer, offset);\n\telse\n\t\twgint16(0xffff + val + 1, endian, buffer, offset);\n\n}", "title": "" }, { "docid": "49c31a365d99576ee482cbb83e2b8e7c", "score": "0.52123994", "text": "function wsint16(value, endian, buffer, offset)\n{\n\tvar val;\n\n\tif (value === undefined)\n\t\tthrow (new Error('missing value'));\n\n\tif (endian === undefined)\n\t\tthrow (new Error('missing endian'));\n\n\tif (buffer === undefined)\n\t\tthrow (new Error('missing buffer'));\n\n\tif (offset === undefined)\n\t\tthrow (new Error('missing offset'));\n\n\tif (offset + 1 >= buffer.length)\n\t\tthrow (new Error('Trying to read beyond buffer length'));\n\n\tval = prepsint(value, 0x7fff, -0x8000);\n\tif (val >= 0)\n\t\twgint16(val, endian, buffer, offset);\n\telse\n\t\twgint16(0xffff + val + 1, endian, buffer, offset);\n\n}", "title": "" }, { "docid": "49c31a365d99576ee482cbb83e2b8e7c", "score": "0.52123994", "text": "function wsint16(value, endian, buffer, offset)\n{\n\tvar val;\n\n\tif (value === undefined)\n\t\tthrow (new Error('missing value'));\n\n\tif (endian === undefined)\n\t\tthrow (new Error('missing endian'));\n\n\tif (buffer === undefined)\n\t\tthrow (new Error('missing buffer'));\n\n\tif (offset === undefined)\n\t\tthrow (new Error('missing offset'));\n\n\tif (offset + 1 >= buffer.length)\n\t\tthrow (new Error('Trying to read beyond buffer length'));\n\n\tval = prepsint(value, 0x7fff, -0x8000);\n\tif (val >= 0)\n\t\twgint16(val, endian, buffer, offset);\n\telse\n\t\twgint16(0xffff + val + 1, endian, buffer, offset);\n\n}", "title": "" }, { "docid": "49c31a365d99576ee482cbb83e2b8e7c", "score": "0.52123994", "text": "function wsint16(value, endian, buffer, offset)\n{\n\tvar val;\n\n\tif (value === undefined)\n\t\tthrow (new Error('missing value'));\n\n\tif (endian === undefined)\n\t\tthrow (new Error('missing endian'));\n\n\tif (buffer === undefined)\n\t\tthrow (new Error('missing buffer'));\n\n\tif (offset === undefined)\n\t\tthrow (new Error('missing offset'));\n\n\tif (offset + 1 >= buffer.length)\n\t\tthrow (new Error('Trying to read beyond buffer length'));\n\n\tval = prepsint(value, 0x7fff, -0x8000);\n\tif (val >= 0)\n\t\twgint16(val, endian, buffer, offset);\n\telse\n\t\twgint16(0xffff + val + 1, endian, buffer, offset);\n\n}", "title": "" }, { "docid": "49c31a365d99576ee482cbb83e2b8e7c", "score": "0.52123994", "text": "function wsint16(value, endian, buffer, offset)\n{\n\tvar val;\n\n\tif (value === undefined)\n\t\tthrow (new Error('missing value'));\n\n\tif (endian === undefined)\n\t\tthrow (new Error('missing endian'));\n\n\tif (buffer === undefined)\n\t\tthrow (new Error('missing buffer'));\n\n\tif (offset === undefined)\n\t\tthrow (new Error('missing offset'));\n\n\tif (offset + 1 >= buffer.length)\n\t\tthrow (new Error('Trying to read beyond buffer length'));\n\n\tval = prepsint(value, 0x7fff, -0x8000);\n\tif (val >= 0)\n\t\twgint16(val, endian, buffer, offset);\n\telse\n\t\twgint16(0xffff + val + 1, endian, buffer, offset);\n\n}", "title": "" }, { "docid": "f98063915373e7bb5d5b0eb5ad2afe17", "score": "0.5178029", "text": "function rgint16(buffer, endian, offset)\n\t{\n\t\tvar val = 0;\n\n\t\tif (endian == 'big') {\n\t\t\tval = buffer[offset] << 8;\n\t\t\tval |= buffer[offset+1];\n\t\t} else {\n\t\t\tval = buffer[offset];\n\t\t\tval |= buffer[offset+1] << 8;\n\t\t}\n\n\t\treturn (val);\n\n\t}", "title": "" }, { "docid": "f98063915373e7bb5d5b0eb5ad2afe17", "score": "0.5178029", "text": "function rgint16(buffer, endian, offset)\n\t{\n\t\tvar val = 0;\n\n\t\tif (endian == 'big') {\n\t\t\tval = buffer[offset] << 8;\n\t\t\tval |= buffer[offset+1];\n\t\t} else {\n\t\t\tval = buffer[offset];\n\t\t\tval |= buffer[offset+1] << 8;\n\t\t}\n\n\t\treturn (val);\n\n\t}", "title": "" }, { "docid": "63caff7b914d9ea243a65455f5713c25", "score": "0.51740664", "text": "function hex2utf16le(input) {\n var output = '';\n for (var i = 0, l = input.length; i < l; i += 4) {\n output += '\\\\u' + input.slice(i+2, i+4) + input.slice(i, i+2);\n }\n return JSON.parse('\"' + output + '\"');\n}", "title": "" }, { "docid": "bff2663d4c254599618d2a23c90d7916", "score": "0.5158933", "text": "function dec_a_hex(d){ //U: Me devuelve el digito hexadecimal correcto para mi número (ej: 15=F)\n\tvar\tr= d % 16;\n\tif (d - r == 0){\n\t\treturn valores[r];\n\t}\telse {\n\t\treturn (dec_a_hex( (d - r)/16 ) + valores[r]);\n\t}\n}", "title": "" }, { "docid": "61c37cf6329d6ae903889e276df85b11", "score": "0.5155125", "text": "function computeFloat16MantisaTable() {\n var convertMantissa = function (i) {\n var m = i << 13;\n var e = 0;\n while ((m & 0x00800000) === 0) {\n e -= 0x00800000;\n m <<= 1;\n }\n m &= ~0x00800000;\n e += 0x38800000;\n return m | e;\n };\n var mantisaTable = new Uint32Array(2048);\n mantisaTable[0] = 0;\n for (var i = 1; i < 1024; i++) {\n mantisaTable[i] = convertMantissa(i);\n }\n for (var i = 1024; i < 2048; i++) {\n mantisaTable[i] = 0x38000000 + (i - 1024 << 13);\n }\n return mantisaTable;\n}", "title": "" }, { "docid": "03fcea136ffc931d966aae0c44b71adf", "score": "0.5154956", "text": "function wsint16(value, endian, buffer, offset)\n\t{\n\t\tvar val;\n\n\t\tif (value === undefined)\n\t\t\tthrow (new Error('missing value'));\n\n\t\tif (endian === undefined)\n\t\t\tthrow (new Error('missing endian'));\n\n\t\tif (buffer === undefined)\n\t\t\tthrow (new Error('missing buffer'));\n\n\t\tif (offset === undefined)\n\t\t\tthrow (new Error('missing offset'));\n\n\t\tif (offset + 1 >= buffer.length)\n\t\t\tthrow (new Error('Trying to read beyond buffer length'));\n\n\t\tval = prepsint(value, 0x7fff, -0x8000);\n\t\tif (val >= 0)\n\t\t\twgint16(val, endian, buffer, offset);\n\t\telse\n\t\t\twgint16(0xffff + val + 1, endian, buffer, offset);\n\n\t}", "title": "" }, { "docid": "03fcea136ffc931d966aae0c44b71adf", "score": "0.5154956", "text": "function wsint16(value, endian, buffer, offset)\n\t{\n\t\tvar val;\n\n\t\tif (value === undefined)\n\t\t\tthrow (new Error('missing value'));\n\n\t\tif (endian === undefined)\n\t\t\tthrow (new Error('missing endian'));\n\n\t\tif (buffer === undefined)\n\t\t\tthrow (new Error('missing buffer'));\n\n\t\tif (offset === undefined)\n\t\t\tthrow (new Error('missing offset'));\n\n\t\tif (offset + 1 >= buffer.length)\n\t\t\tthrow (new Error('Trying to read beyond buffer length'));\n\n\t\tval = prepsint(value, 0x7fff, -0x8000);\n\t\tif (val >= 0)\n\t\t\twgint16(val, endian, buffer, offset);\n\t\telse\n\t\t\twgint16(0xffff + val + 1, endian, buffer, offset);\n\n\t}", "title": "" }, { "docid": "0f603db7ab2e4bc0d50f78920ab64705", "score": "0.5134141", "text": "function getByte(dataView, offset) {\n return dataView.getUint8(offset);\n } // Retrieve an unsigned 16-bit short from the DataView.", "title": "" }, { "docid": "e50b0a7f34037b2f04c6fefc3f421b20", "score": "0.5132516", "text": "function UTF16ToUNICODE(data) {\n var results = [];\n var i = 0;\n var len = data && data.length;\n var isLE = false;\n var first = true;\n var c1, c2;\n\n while (i < len) {\n c1 = data[i++];\n c2 = data[i++];\n\n if (first && i === 2) {\n first = false;\n if (c1 === 0xFE && c2 === 0xFF) {\n isLE = false;\n } else if (c1 === 0xFF && c2 === 0xFE) {\n // Little-endian\n isLE = true;\n } else {\n isLE = isUTF16LE(data);\n i = 0;\n }\n continue;\n }\n\n if (isLE) {\n if (c2 === 0) {\n results[results.length] = c1;\n } else {\n results[results.length] = ((c2 & 0xFF) << 8) | (c1 & 0xFF);\n }\n } else {\n if (c1 === 0) {\n results[results.length] = c2;\n } else {\n results[results.length] = ((c1 & 0xFF) << 8) | (c2 & 0xFF);\n }\n }\n }\n\n return results;\n}", "title": "" }, { "docid": "31664cac1f3b29515d566b65dfafa2f5", "score": "0.5110929", "text": "static toInternal(value) {\r\n return value*1609.34;\r\n }", "title": "" }, { "docid": "9c1477460faec000b4bf064aa2299ba6", "score": "0.5110224", "text": "writeUint16(value) {\n this.ensureAvailable(2);\n this._data.setUint16(this.offset, value, this.littleEndian);\n this.offset += 2;\n this._updateLastWrittenByte();\n return this;\n }", "title": "" }, { "docid": "9c1477460faec000b4bf064aa2299ba6", "score": "0.5110224", "text": "writeUint16(value) {\n this.ensureAvailable(2);\n this._data.setUint16(this.offset, value, this.littleEndian);\n this.offset += 2;\n this._updateLastWrittenByte();\n return this;\n }", "title": "" }, { "docid": "ce8cd3e6bafd1dbeb0d6372eb764832f", "score": "0.51021695", "text": "function getShort(dataView, offset) {\n return dataView.getInt16(offset, false);\n }", "title": "" }, { "docid": "678988fffbb1879e5adb60c999fcbc3b", "score": "0.50900644", "text": "function _base16To36(value){return new BN(value,16).toString(36);}", "title": "" }, { "docid": "33852570086da78651efa4fbb69df526", "score": "0.50848114", "text": "function getShort(dataView, offset) {\n return dataView.getInt16(offset, false);\n }", "title": "" }, { "docid": "fbb950295def7e102d7082b81c6391e9", "score": "0.5084719", "text": "function computeFloat16MantisaTable() {\n const convertMantissa = (i) => {\n let m = i << 13;\n let e = 0;\n while ((m & 0x00800000) === 0) {\n e -= 0x00800000;\n m <<= 1;\n }\n m &= ~0x00800000;\n e += 0x38800000;\n return m | e;\n };\n const mantisaTable = new Uint32Array(2048);\n mantisaTable[0] = 0;\n for (let i = 1; i < 1024; i++) {\n mantisaTable[i] = convertMantissa(i);\n }\n for (let i = 1024; i < 2048; i++) {\n mantisaTable[i] = 0x38000000 + ((i - 1024) << 13);\n }\n return mantisaTable;\n}", "title": "" }, { "docid": "58b3b1c989da18306e5f1bbfb34ebe09", "score": "0.5084038", "text": "function d(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}", "title": "" } ]
0039eae6692df19d04e6686466717fed
Assert condition is true
[ { "docid": "9b0b78ddc49676fb4477d030f5374184", "score": "0.0", "text": "function assert(condition, errMsg = 'Assert failed') {\r\n if (!condition) {\r\n console.trace(errMsg);\r\n throw new Error(errMsg);\r\n }\r\n}", "title": "" } ]
[ { "docid": "1924d732dc675a10819837793fbc403a", "score": "0.72786856", "text": "beTrue(){\n\t\tthis.callback('pre');\n\t\tthis.assertions.last().b = true;\n\t\tthis.assertions.last().result = !!this.assertions.last().a;\n\t\tthis.assertions.last().assertion = 'Expected ' + this.assertions.last().a + ' to be true.';\n\t\tthis.callback('post');\n\t\tif (this.verbose) this.result(this.assertions.last());\n\t}", "title": "" }, { "docid": "8445c2999dc36701a59b91fa94bee7f4", "score": "0.71731514", "text": "function assert(condition,message){ /* istanbul ignore if */if(!condition){throw new Error('ASSERT: '+message);}}", "title": "" }, { "docid": "25dd6fc059cf82d135435303e4d03829", "score": "0.7034877", "text": "function _isTrue(arg,msg){\r\n\t\t_ass.assertTrue(arg,msg);\r\n\t}", "title": "" }, { "docid": "73790c62c5de6eeda89c2c2f1c2ec563", "score": "0.69902885", "text": "function assert(condition, message) {\n if (condition !== true) {\n assertFail(message || ('condition: ' + condition));\n }\n }", "title": "" }, { "docid": "200923800babcb28fdad2ba7d0fa4da7", "score": "0.6986326", "text": "function assert (condition, message) {\n if (!condition) {\n console.error(message)\n }\n}", "title": "" }, { "docid": "200923800babcb28fdad2ba7d0fa4da7", "score": "0.6986326", "text": "function assert (condition, message) {\n if (!condition) {\n console.error(message)\n }\n}", "title": "" }, { "docid": "36b4c14b41147d485da06b0f820ff706", "score": "0.69854414", "text": "function assert(cond, msg) {\r\n if ( ! cond ) {\r\n\t karelsim.errorMessage('ASSERTION FAILED: ' + msg);\r\n\t}\r\n}", "title": "" }, { "docid": "3b8e009d921ce6f1ff6beefe54ae1a93", "score": "0.6940034", "text": "function ok(value,message){if(!value)fail(value,true,message,'==',assert.ok);}", "title": "" }, { "docid": "3b8e009d921ce6f1ff6beefe54ae1a93", "score": "0.6940034", "text": "function ok(value,message){if(!value)fail(value,true,message,'==',assert.ok);}", "title": "" }, { "docid": "3b8e009d921ce6f1ff6beefe54ae1a93", "score": "0.6940034", "text": "function ok(value,message){if(!value)fail(value,true,message,'==',assert.ok);}", "title": "" }, { "docid": "25f76f4e519dafd9759dbc79611dc6a9", "score": "0.6915811", "text": "function assert(condition) {\n if (!condition) {\n throw new Error('assertion failure');\n }\n}", "title": "" }, { "docid": "3c3c2f1d8206e0042f27907ea4f7c6d9", "score": "0.68313396", "text": "function _assert(cond, msg){\n\t// TODO: see qunit.js extractStacktrace()\n\tif(!cond){\n\t\tmsg = msg ? \": \" + msg : \"\";\n\t\t// consoleApply(\"assert\", [!!cond, msg]);\n\t\t$.error(\"Fancytree assertion failed\" + msg);\n\t}\n}", "title": "" }, { "docid": "576e8095f4b41ef55b0938a11d0514b4", "score": "0.6793009", "text": "function assert(condition, message) {\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n }", "title": "" }, { "docid": "df75a34ee1560c7099b2d5e9d7b55b3e", "score": "0.6783434", "text": "function assert(condition, message) {\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n }", "title": "" }, { "docid": "22d48695164ab5488cb83d347f9da384", "score": "0.67800415", "text": "function assert(condition, message) {\n if (!condition) {\n alert(message || \"Assertion failed\");\n }\n}", "title": "" }, { "docid": "350f98515bf6a31d2530f5f8abe8c8b0", "score": "0.67450905", "text": "function assert(cond) {\n if (!cond) {\n if (typeof console !== 'undefined') {\n console.error('domita assertion failed');\n console.trace();\n }\n throw new Error(\"Domita assertion failed\");\n }\n }", "title": "" }, { "docid": "aca2bce506bf1a3c5b1b56ff31401775", "score": "0.6700928", "text": "function ok(value, message) {\n if (!value) fail(value, true, message, '==', assert.ok);\n }", "title": "" }, { "docid": "28c03a39c0d0f3ee34248285a046fa33", "score": "0.6681009", "text": "function ok(value, message) {\n if (!value) fail(value, true, message, '==', assert.ok);\n }", "title": "" }, { "docid": "0166c0898b35354d7d85092ffe830b9b", "score": "0.6656394", "text": "function assertWellFormed(cond, msg) {\n if (!cond)\n error(msg);\n }", "title": "" }, { "docid": "32493a4bcf4dbff252e26a7400b0e675", "score": "0.6654128", "text": "assertion(expected, actual) {\n try {\n assert(expected === actual);\n this.log('Assertion passed');\n } catch (e) {\n this.log('Assertion failed: could not find match expected and actual');\n }\n }", "title": "" }, { "docid": "cd4a847225f0f1be1ee72df84622f46a", "score": "0.66535044", "text": "function assert(condition, message) {\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n }", "title": "" }, { "docid": "cd4a847225f0f1be1ee72df84622f46a", "score": "0.66535044", "text": "function assert(condition, message) {\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n }", "title": "" }, { "docid": "cd4a847225f0f1be1ee72df84622f46a", "score": "0.66535044", "text": "function assert(condition, message) {\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n }", "title": "" }, { "docid": "dddd373f210aea0a330cc2b116a7f5b7", "score": "0.66517407", "text": "function assertTrue (msg, v) {\r\n if (!v) { throw new Error(\"[assertTrue] \" + msg); }\r\n return true;\r\n}", "title": "" }, { "docid": "9339e151c925e1a9d2ae23063a954dc8", "score": "0.6650816", "text": "function ok(value, message) {\n if (!value) fail(value, true, message, '==', assert.ok);\n }", "title": "" }, { "docid": "0bf4d601862c1624cbd9ea544ee1a32b", "score": "0.6647465", "text": "function assertTrue(assertion) {\n return assert.strictEqual(true, assertion);\n}", "title": "" }, { "docid": "2f912eaca960c2de4284bfbb58ed4485", "score": "0.6639371", "text": "function assert(condition, message) {\n\t if (!condition) {\n\t throw new Error('ASSERT: ' + message);\n\t }\n\t }", "title": "" }, { "docid": "62a5423878babaee8ec7f5453862dc8e", "score": "0.663036", "text": "function assertWellFormed(cond, msg) {\n if (!cond)\n error(msg);\n}", "title": "" }, { "docid": "c016b408337f481cbc761dddddfe3215", "score": "0.66242224", "text": "function assert(condition, message)\n{\n if (!condition)\n {\n log(message);\n throw new Error(\"Assertion failed: \" + message);\n }\n}", "title": "" }, { "docid": "f2f63f6de6cc4a09cc7cc3c7f43862e1", "score": "0.66104823", "text": "function ok(value, message) {\n if (!value) fail(value, true, message, \"==\", assert.ok);\n }", "title": "" }, { "docid": "1184efb973db96317bb21148d3d39ece", "score": "0.65915424", "text": "function assert(b) {\n if (!b) {\n console.log('fail');\n }\n}", "title": "" }, { "docid": "3cc9b9000b34738cdd027cc3d80d659e", "score": "0.6588992", "text": "function ok(value, message) {\n if (!value) fail(value, true, message, '==', assert.ok);\n }", "title": "" }, { "docid": "3cc9b9000b34738cdd027cc3d80d659e", "score": "0.6588992", "text": "function ok(value, message) {\n if (!value) fail(value, true, message, '==', assert.ok);\n }", "title": "" }, { "docid": "602b05a71b6e5359d13a9cb9dd692abc", "score": "0.6583781", "text": "function assert(condition, message) {\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n }", "title": "" }, { "docid": "602b05a71b6e5359d13a9cb9dd692abc", "score": "0.6583781", "text": "function assert(condition, message) {\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n }", "title": "" }, { "docid": "602b05a71b6e5359d13a9cb9dd692abc", "score": "0.6583781", "text": "function assert(condition, message) {\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n }", "title": "" }, { "docid": "602b05a71b6e5359d13a9cb9dd692abc", "score": "0.6583781", "text": "function assert(condition, message) {\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n }", "title": "" }, { "docid": "602b05a71b6e5359d13a9cb9dd692abc", "score": "0.6583781", "text": "function assert(condition, message) {\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n }", "title": "" }, { "docid": "602b05a71b6e5359d13a9cb9dd692abc", "score": "0.6583781", "text": "function assert(condition, message) {\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n }", "title": "" }, { "docid": "602b05a71b6e5359d13a9cb9dd692abc", "score": "0.6583781", "text": "function assert(condition, message) {\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n }", "title": "" }, { "docid": "602b05a71b6e5359d13a9cb9dd692abc", "score": "0.6583781", "text": "function assert(condition, message) {\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n }", "title": "" }, { "docid": "602b05a71b6e5359d13a9cb9dd692abc", "score": "0.6583781", "text": "function assert(condition, message) {\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n }", "title": "" }, { "docid": "602b05a71b6e5359d13a9cb9dd692abc", "score": "0.6583781", "text": "function assert(condition, message) {\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n }", "title": "" }, { "docid": "602b05a71b6e5359d13a9cb9dd692abc", "score": "0.6583781", "text": "function assert(condition, message) {\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n }", "title": "" }, { "docid": "602b05a71b6e5359d13a9cb9dd692abc", "score": "0.6583781", "text": "function assert(condition, message) {\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n }", "title": "" }, { "docid": "602b05a71b6e5359d13a9cb9dd692abc", "score": "0.6583781", "text": "function assert(condition, message) {\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n }", "title": "" }, { "docid": "602b05a71b6e5359d13a9cb9dd692abc", "score": "0.6583781", "text": "function assert(condition, message) {\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n }", "title": "" }, { "docid": "0ecf7f307504b7c7b0ef21af12a4182d", "score": "0.65773904", "text": "isTrue(condition, message) {\n if (!this.addAssertion(Data.Assertion.IsTrue, condition, 'true', condition === true)) {\n throw new Error(message || `The given value is not true.`);\n }\n }", "title": "" }, { "docid": "0278e548ac132adb5e55496ccd6d5c9d", "score": "0.65737796", "text": "function assert(cond, descr){\n descr = descr || \"Undescribed condition.\";\n if(!cond){\n print(\"Assertion FAILED: \"+descr);\n throw new Error(\"Assertion failed: \"+descr);\n // aarrgghh. Exceptions are of course swallowed by\n // the AJAX layer, to keep from killing a browser's\n // script environment.\n }else{\n if(TestApp.verbose) print(\"Assertion OK: \"+descr);\n }\n}", "title": "" }, { "docid": "90bcf48471ef60fb948b1f1b86d9f855", "score": "0.6565698", "text": "assertTrue(value, message) {\n\t\t\t\tif (!value) {\n\t\t\t\t\tthrow new TestError(\"Expected true: \" + this.ensureValidMsg(message));\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "aebefae23aaea1ea15562d6dab672de3", "score": "0.65602285", "text": "function ok(value, message) {\n\t if (!value) fail(value, true, message, '==', assert.ok);\n\t}", "title": "" }, { "docid": "aebefae23aaea1ea15562d6dab672de3", "score": "0.65602285", "text": "function ok(value, message) {\n\t if (!value) fail(value, true, message, '==', assert.ok);\n\t}", "title": "" }, { "docid": "aebefae23aaea1ea15562d6dab672de3", "score": "0.65602285", "text": "function ok(value, message) {\n\t if (!value) fail(value, true, message, '==', assert.ok);\n\t}", "title": "" }, { "docid": "aebefae23aaea1ea15562d6dab672de3", "score": "0.65602285", "text": "function ok(value, message) {\n\t if (!value) fail(value, true, message, '==', assert.ok);\n\t}", "title": "" }, { "docid": "aebefae23aaea1ea15562d6dab672de3", "score": "0.65602285", "text": "function ok(value, message) {\n\t if (!value) fail(value, true, message, '==', assert.ok);\n\t}", "title": "" }, { "docid": "aebefae23aaea1ea15562d6dab672de3", "score": "0.65602285", "text": "function ok(value, message) {\n\t if (!value) fail(value, true, message, '==', assert.ok);\n\t}", "title": "" }, { "docid": "aebefae23aaea1ea15562d6dab672de3", "score": "0.65602285", "text": "function ok(value, message) {\n\t if (!value) fail(value, true, message, '==', assert.ok);\n\t}", "title": "" }, { "docid": "aebefae23aaea1ea15562d6dab672de3", "score": "0.65602285", "text": "function ok(value, message) {\n\t if (!value) fail(value, true, message, '==', assert.ok);\n\t}", "title": "" }, { "docid": "aebefae23aaea1ea15562d6dab672de3", "score": "0.65602285", "text": "function ok(value, message) {\n\t if (!value) fail(value, true, message, '==', assert.ok);\n\t}", "title": "" }, { "docid": "aebefae23aaea1ea15562d6dab672de3", "score": "0.65602285", "text": "function ok(value, message) {\n\t if (!value) fail(value, true, message, '==', assert.ok);\n\t}", "title": "" }, { "docid": "aebefae23aaea1ea15562d6dab672de3", "score": "0.65602285", "text": "function ok(value, message) {\n\t if (!value) fail(value, true, message, '==', assert.ok);\n\t}", "title": "" }, { "docid": "aebefae23aaea1ea15562d6dab672de3", "score": "0.65602285", "text": "function ok(value, message) {\n\t if (!value) fail(value, true, message, '==', assert.ok);\n\t}", "title": "" }, { "docid": "aebefae23aaea1ea15562d6dab672de3", "score": "0.65602285", "text": "function ok(value, message) {\n\t if (!value) fail(value, true, message, '==', assert.ok);\n\t}", "title": "" }, { "docid": "aebefae23aaea1ea15562d6dab672de3", "score": "0.65602285", "text": "function ok(value, message) {\n\t if (!value) fail(value, true, message, '==', assert.ok);\n\t}", "title": "" }, { "docid": "aebefae23aaea1ea15562d6dab672de3", "score": "0.65602285", "text": "function ok(value, message) {\n\t if (!value) fail(value, true, message, '==', assert.ok);\n\t}", "title": "" }, { "docid": "aebefae23aaea1ea15562d6dab672de3", "score": "0.65602285", "text": "function ok(value, message) {\n\t if (!value) fail(value, true, message, '==', assert.ok);\n\t}", "title": "" }, { "docid": "aebefae23aaea1ea15562d6dab672de3", "score": "0.65602285", "text": "function ok(value, message) {\n\t if (!value) fail(value, true, message, '==', assert.ok);\n\t}", "title": "" }, { "docid": "aebefae23aaea1ea15562d6dab672de3", "score": "0.65602285", "text": "function ok(value, message) {\n\t if (!value) fail(value, true, message, '==', assert.ok);\n\t}", "title": "" }, { "docid": "aebefae23aaea1ea15562d6dab672de3", "score": "0.65602285", "text": "function ok(value, message) {\n\t if (!value) fail(value, true, message, '==', assert.ok);\n\t}", "title": "" }, { "docid": "aebefae23aaea1ea15562d6dab672de3", "score": "0.65602285", "text": "function ok(value, message) {\n\t if (!value) fail(value, true, message, '==', assert.ok);\n\t}", "title": "" }, { "docid": "23b54eab028b374a2737d35298082f21", "score": "0.6554886", "text": "function assert(shouldBeTruthy, message) {\r\t\t\tif (!shouldBeTruthy) {\r\t\t sangu_alert({message: message || \"(broken assertion)\"});\r\t\t\t}\r\t\t}", "title": "" }, { "docid": "dd77702112f9dfca6c47bcbbce70b4da", "score": "0.65514433", "text": "function ok(value, message) {\n if (!value) fail(value, true, message, \"==\", assert.ok);\n }", "title": "" }, { "docid": "859cb17dffd16280337ef22ffc8fd975", "score": "0.65448403", "text": "function ok(value, message) {\n if (!value) fail(value, true, message, '==', assert.ok);\n }", "title": "" }, { "docid": "af929a276358f8bed597139b78a51d79", "score": "0.65444434", "text": "function assert(test, message, test_number) {\n if (!test) {\n console.log(test_number + \"false\");\n throw \"ERROR: \" + message;\n }\n console.log(test_number + \"true\");\n return true;\n}", "title": "" }, { "docid": "af929a276358f8bed597139b78a51d79", "score": "0.65444434", "text": "function assert(test, message, test_number) {\n if (!test) {\n console.log(test_number + \"false\");\n throw \"ERROR: \" + message;\n }\n console.log(test_number + \"true\");\n return true;\n}", "title": "" }, { "docid": "af929a276358f8bed597139b78a51d79", "score": "0.65444434", "text": "function assert(test, message, test_number) {\n if (!test) {\n console.log(test_number + \"false\");\n throw \"ERROR: \" + message;\n }\n console.log(test_number + \"true\");\n return true;\n}", "title": "" }, { "docid": "af929a276358f8bed597139b78a51d79", "score": "0.65444434", "text": "function assert(test, message, test_number) {\n if (!test) {\n console.log(test_number + \"false\");\n throw \"ERROR: \" + message;\n }\n console.log(test_number + \"true\");\n return true;\n}", "title": "" }, { "docid": "af929a276358f8bed597139b78a51d79", "score": "0.65444434", "text": "function assert(test, message, test_number) {\n if (!test) {\n console.log(test_number + \"false\");\n throw \"ERROR: \" + message;\n }\n console.log(test_number + \"true\");\n return true;\n}", "title": "" }, { "docid": "af929a276358f8bed597139b78a51d79", "score": "0.65444434", "text": "function assert(test, message, test_number) {\n if (!test) {\n console.log(test_number + \"false\");\n throw \"ERROR: \" + message;\n }\n console.log(test_number + \"true\");\n return true;\n}", "title": "" }, { "docid": "af929a276358f8bed597139b78a51d79", "score": "0.65444434", "text": "function assert(test, message, test_number) {\n if (!test) {\n console.log(test_number + \"false\");\n throw \"ERROR: \" + message;\n }\n console.log(test_number + \"true\");\n return true;\n}", "title": "" }, { "docid": "af929a276358f8bed597139b78a51d79", "score": "0.65444434", "text": "function assert(test, message, test_number) {\n if (!test) {\n console.log(test_number + \"false\");\n throw \"ERROR: \" + message;\n }\n console.log(test_number + \"true\");\n return true;\n}", "title": "" }, { "docid": "af929a276358f8bed597139b78a51d79", "score": "0.65444434", "text": "function assert(test, message, test_number) {\n if (!test) {\n console.log(test_number + \"false\");\n throw \"ERROR: \" + message;\n }\n console.log(test_number + \"true\");\n return true;\n}", "title": "" }, { "docid": "af929a276358f8bed597139b78a51d79", "score": "0.65444434", "text": "function assert(test, message, test_number) {\n if (!test) {\n console.log(test_number + \"false\");\n throw \"ERROR: \" + message;\n }\n console.log(test_number + \"true\");\n return true;\n}", "title": "" }, { "docid": "af929a276358f8bed597139b78a51d79", "score": "0.65444434", "text": "function assert(test, message, test_number) {\n if (!test) {\n console.log(test_number + \"false\");\n throw \"ERROR: \" + message;\n }\n console.log(test_number + \"true\");\n return true;\n}", "title": "" }, { "docid": "af929a276358f8bed597139b78a51d79", "score": "0.65444434", "text": "function assert(test, message, test_number) {\n if (!test) {\n console.log(test_number + \"false\");\n throw \"ERROR: \" + message;\n }\n console.log(test_number + \"true\");\n return true;\n}", "title": "" }, { "docid": "af929a276358f8bed597139b78a51d79", "score": "0.65444434", "text": "function assert(test, message, test_number) {\n if (!test) {\n console.log(test_number + \"false\");\n throw \"ERROR: \" + message;\n }\n console.log(test_number + \"true\");\n return true;\n}", "title": "" }, { "docid": "af929a276358f8bed597139b78a51d79", "score": "0.65444434", "text": "function assert(test, message, test_number) {\n if (!test) {\n console.log(test_number + \"false\");\n throw \"ERROR: \" + message;\n }\n console.log(test_number + \"true\");\n return true;\n}", "title": "" }, { "docid": "af929a276358f8bed597139b78a51d79", "score": "0.65444434", "text": "function assert(test, message, test_number) {\n if (!test) {\n console.log(test_number + \"false\");\n throw \"ERROR: \" + message;\n }\n console.log(test_number + \"true\");\n return true;\n}", "title": "" }, { "docid": "af929a276358f8bed597139b78a51d79", "score": "0.65444434", "text": "function assert(test, message, test_number) {\n if (!test) {\n console.log(test_number + \"false\");\n throw \"ERROR: \" + message;\n }\n console.log(test_number + \"true\");\n return true;\n}", "title": "" }, { "docid": "af929a276358f8bed597139b78a51d79", "score": "0.65444434", "text": "function assert(test, message, test_number) {\n if (!test) {\n console.log(test_number + \"false\");\n throw \"ERROR: \" + message;\n }\n console.log(test_number + \"true\");\n return true;\n}", "title": "" }, { "docid": "af929a276358f8bed597139b78a51d79", "score": "0.65444434", "text": "function assert(test, message, test_number) {\n if (!test) {\n console.log(test_number + \"false\");\n throw \"ERROR: \" + message;\n }\n console.log(test_number + \"true\");\n return true;\n}", "title": "" }, { "docid": "af929a276358f8bed597139b78a51d79", "score": "0.65444434", "text": "function assert(test, message, test_number) {\n if (!test) {\n console.log(test_number + \"false\");\n throw \"ERROR: \" + message;\n }\n console.log(test_number + \"true\");\n return true;\n}", "title": "" }, { "docid": "af929a276358f8bed597139b78a51d79", "score": "0.65444434", "text": "function assert(test, message, test_number) {\n if (!test) {\n console.log(test_number + \"false\");\n throw \"ERROR: \" + message;\n }\n console.log(test_number + \"true\");\n return true;\n}", "title": "" }, { "docid": "af929a276358f8bed597139b78a51d79", "score": "0.65444434", "text": "function assert(test, message, test_number) {\n if (!test) {\n console.log(test_number + \"false\");\n throw \"ERROR: \" + message;\n }\n console.log(test_number + \"true\");\n return true;\n}", "title": "" }, { "docid": "af929a276358f8bed597139b78a51d79", "score": "0.65444434", "text": "function assert(test, message, test_number) {\n if (!test) {\n console.log(test_number + \"false\");\n throw \"ERROR: \" + message;\n }\n console.log(test_number + \"true\");\n return true;\n}", "title": "" }, { "docid": "af929a276358f8bed597139b78a51d79", "score": "0.65444434", "text": "function assert(test, message, test_number) {\n if (!test) {\n console.log(test_number + \"false\");\n throw \"ERROR: \" + message;\n }\n console.log(test_number + \"true\");\n return true;\n}", "title": "" }, { "docid": "af929a276358f8bed597139b78a51d79", "score": "0.65444434", "text": "function assert(test, message, test_number) {\n if (!test) {\n console.log(test_number + \"false\");\n throw \"ERROR: \" + message;\n }\n console.log(test_number + \"true\");\n return true;\n}", "title": "" }, { "docid": "af929a276358f8bed597139b78a51d79", "score": "0.65444434", "text": "function assert(test, message, test_number) {\n if (!test) {\n console.log(test_number + \"false\");\n throw \"ERROR: \" + message;\n }\n console.log(test_number + \"true\");\n return true;\n}", "title": "" }, { "docid": "af929a276358f8bed597139b78a51d79", "score": "0.65444434", "text": "function assert(test, message, test_number) {\n if (!test) {\n console.log(test_number + \"false\");\n throw \"ERROR: \" + message;\n }\n console.log(test_number + \"true\");\n return true;\n}", "title": "" }, { "docid": "af929a276358f8bed597139b78a51d79", "score": "0.65444434", "text": "function assert(test, message, test_number) {\n if (!test) {\n console.log(test_number + \"false\");\n throw \"ERROR: \" + message;\n }\n console.log(test_number + \"true\");\n return true;\n}", "title": "" }, { "docid": "af929a276358f8bed597139b78a51d79", "score": "0.65444434", "text": "function assert(test, message, test_number) {\n if (!test) {\n console.log(test_number + \"false\");\n throw \"ERROR: \" + message;\n }\n console.log(test_number + \"true\");\n return true;\n}", "title": "" } ]
a495591c289bf03cc46aa688f5abc3fb
Luodaan sarjoista hakemisto, jonka avaimena toimii sarjan id
[ { "docid": "fd5d0fac8198b6c07b3b0e7a75246f46", "score": "0.6300646", "text": "function _teeSarjaHakemisto() {\n let sarjaMap = new Map();\n _data.sarjat.forEach(sarja => sarjaMap.set(sarja.id, sarja));\n\n return sarjaMap;\n }", "title": "" } ]
[ { "docid": "52a3439cb2590ba3e916c8b3807409d2", "score": "0.67345446", "text": "function createSarjaId() {\n\n hardDebug && console.debug(`createsarjaid().`); \n // Haetaan sarjojen idt. \n var sarjaIDt = getSarjat().map(x => x.id);\n \n let uniqueID = 0;\n while (sarjaIDt.includes(uniqueID) || tallentamattomatSarjaIdt.includes(uniqueID)) {\n uniqueID = Math.round(Math.random() * 500000);\n }\n\n tallentamattomatSarjaIdt.push(uniqueID);\n return uniqueID;\n}", "title": "" }, { "docid": "4c6cca0abb724dd05e6d6f104cf63f59", "score": "0.65118235", "text": "function aikaLeimaaSarjat() {\n var sarjat = getSarjat();\n for (let x of sarjat) {\n if (x.alkuaika === null) {\n var kisa = getKisa(x.id);\n x.alkuaika = kisa.alkuaika;\n x.loppuaika = kisa.loppuaika;\n }\n }\n}", "title": "" }, { "docid": "2cb77e58b025e0eae920302faa6db7ab", "score": "0.65040755", "text": "function rastiTorasti(jRasti, rastit) {\n var jRastiToString = jRasti.id.toString();\n var oikeaRasti = rastit.find(x => jRastiToString === x.id.toString());\n if (oikeaRasti === undefined) console.error(`rastiTorasti: jRasti.id === ${jRasti.id} ei loydy vastaavaa rastia!`);\n return oikeaRasti;\n}", "title": "" }, { "docid": "26766a4d5c8d08e42a5bce5b42f8f2d6", "score": "0.6484142", "text": "function haeJoukkue(haettavaId) {\n for (let kilpailu of data) {\n for (let sarja of kilpailu.sarjat) {\n for (let joukkue of sarja.joukkueet) {\n if (joukkue.id == haettavaId) {\n return joukkue;\n }\n }\n }\n }\n}", "title": "" }, { "docid": "da58b6a5b64b87e432c66aa22b8a3400", "score": "0.6461529", "text": "function createJoukkueId() {\n\n hardDebug && console.debug(`createJoukkueId().`); \n // Haetaan joukkueiden idt.\n var joukkueIDt = data.joukkueet.map(x => x.id);\n \n // Etsitaan uniikki id. Kaipa tuo 500000 riittaa ainakin tassa tehtavassa.\n let uniqueID = 0;\n while (joukkueIDt.includes(uniqueID)) {\n uniqueID = Math.round(Math.random() * 500000);\n }\n \n return uniqueID;\n}", "title": "" }, { "docid": "535e7e20c5c45fc6d1b73046b0bfed5d", "score": "0.622085", "text": "function haeJoukkueidenTiedot() {\n //luodaan uusi taulukko joukkueiden tallentamista varten\n let joukkueet = new Map();\n\n //luodaan joukkueista ja pisteistä objekteja, lisätään taulukkoon\n _data.joukkueet.forEach(joukkue => {\n if (joukkue.hasOwnProperty('nimi')) {\n let joukkueenRastit = _haeLeimatutRastit(joukkue);\n\n //lisätään palautettavaan taulukkoon joukkueen suoritus\n joukkueet.set(joukkue.id, {\n id: joukkue.id,\n nimi: joukkue.nimi,\n jasenet: joukkue.jasenet,\n sarja: haeSarjaIdlla(joukkue.sarja).nimi,\n pisteet: _laskePisteet(joukkueenRastit),\n aika: _laskeAika(joukkueenRastit),\n matka: _laskeMatka(joukkueenRastit)\n });\n }\n });\n\n return joukkueet;\n }", "title": "" }, { "docid": "d428f66cf3a3f1929340ae6f132fec72", "score": "0.6175533", "text": "function _teeJoukkueHakemisto() {\n let joukkueMap = new Map();\n _data.joukkueet.forEach(joukkue => joukkueMap.set(joukkue.id, joukkue));\n\n return joukkueMap;\n }", "title": "" }, { "docid": "9c833c2ff14a53a65d8574dcf2fd7438", "score": "0.61626875", "text": "function haeRastit() {\n for (let kilpailu of data) {\n for (let rasti of kilpailu.rastit) {\n kaikkiRastit.set(parseInt(rasti.id), {\n koodi: rasti.koodi,\n lat: rasti.lat,\n lon: rasti.lon\n });\n }\n }\n}", "title": "" }, { "docid": "658ba2bb5e567dbb15f9a8abec5a536e", "score": "0.6158701", "text": "constructor(huisId, maaltijdId){\n this.huisId = huisId;\n this.maaltijdId = maaltijdId;\n }", "title": "" }, { "docid": "b022b12a4a2403b0d19ff4321d505b68", "score": "0.61503875", "text": "function muokkaaJoukkue(joukkue) {\n let _joukkue = _joukkueet.get(joukkue.id);\n\n _joukkue.nimi = joukkue.nimi;\n\n _joukkue.jasenet = joukkue.jasenet;\n\n _joukkue.leimaustapa = joukkue.leimaustapa;\n\n _joukkue.rastit = joukkue.rastit;\n\n console.log(_data.joukkueet);\n\n return joukkue;\n }", "title": "" }, { "docid": "b2e966dad7383d19f8b99ff5ce89c2f7", "score": "0.6091935", "text": "function palautaJunanTiedot(asemakoodi, data) {\n return data.findIndex(x => x.stationShortCode === asemakoodi);\n }", "title": "" }, { "docid": "af002d282d915dac14e8620d5dba89ac", "score": "0.60669214", "text": "function createSarjat(kisaId) {\n hardDebug && console.debug(`createSarjat(${kisaId}).`); \n var sarjat = [];\n var protoKisa = data.kisat[0];\n var nykyinenKisa = data.kisat.find(z => z.id === kisaId);\n\n // Hubbabubbaa, mutta toimii nyt.\n var nykyinenKisaTallennettu = true;\n\n // Kisaa ei oltu viela tallennettu! \n if (nykyinenKisa === undefined) {\n nykyinenKisaTallennettu = false;;\n }\n for (let x of protoKisa.sarjat) {\n if (nykyinenKisaTallennettu === false) {\n sarjat.push({alkuaika: null, id: createSarjaId(), kesto: x.kesto , kilpailu: kisaId, loppuaika: null, matka: x.matka, nimi: x.nimi});\n }\n else sarjat.push({alkuaika: nykyinenKisa.alkuaika, id: createSarjaId(), kesto: x.kesto , kilpailu: kisaId, loppuaika: nykyinenKisa.loppuaika, matka: x.matka, nimi: x.nimi}); \n }\n return sarjat;\n}", "title": "" }, { "docid": "a3795553adde4461ba3029e5bee46ae9", "score": "0.6063072", "text": "function BuscarIndiceAnuncio(id){\n //Validar datos\n for(let i=0; i<listaAnuncios.length; i++){\n if(listaAnuncios[i].id == id)\n return i;\n }\n \n return -1;\n}", "title": "" }, { "docid": "9cbdf3418629e517c8e57dd7e28bef7a", "score": "0.6060177", "text": "function poliyaId(id){\n kursService.getById(id,malumotQuy,console.log(\"xato\")); \n}", "title": "" }, { "docid": "07f0ac8fc86c1e8361b5fd948e0266ba", "score": "0.60535634", "text": "function obtenerLetra(id, TodosID) {\r\n\t\tvar esteCanto = {'id': '000', 'letra':'letra', 'titulo':\"Título\"};\r\n\t\tvar valor = Number(id);\r\n\t\testeCanto.id = TodosID.indexOf(valor);\r\n\t\testeCanto.letra = cantos[esteCanto.id].Letra;\r\n\t\testeCanto.titulo = cantos[esteCanto.id].Titulo;\r\n\t\treturn esteCanto;\r\n\t}", "title": "" }, { "docid": "3505ee43ecfb0c71225dcc9f1a86046f", "score": "0.6023904", "text": "function buscar(data){\n\t\tvar index=-1;\n\t\tvar n=MARCADORES.length;\n\t for(var i=0;i<n;i++){\n\t \t//alert('metodo buscar marcadores:'+MARCADORES[i].getId());\n\t \t if(MARCADORES[i].getId()===data.id){\n\t \t \tindex=i;\n\t \t \tbreak;\n\t \t }\n\t }\n\t return index;\n\t}", "title": "" }, { "docid": "ce27733c73f3b3fa2d723b45a33eab77", "score": "0.6006457", "text": "function createSarjaMappings() {\n var mappings = [];\n for (let x of data.kisat[0].sarjat) {\n mappings.push({id: x.id, nimi: x.nimi});\n }\n return mappings.sort((x,y) => x.nimi.localeCompare(y.nimi));\n}", "title": "" }, { "docid": "ef2efb5d1a0b0f35e00810a7e9a1aa76", "score": "0.60002756", "text": "function luoId(tiedot) {\n let nro = parseInt(Math.random() * 100000);\n if (tiedot.some(tieto => tieto.id == nro)) {\n return luoId(tiedot);\n }\n return nro;\n}", "title": "" }, { "docid": "6b2eee2434a95ee60bcb3808cc98fa6c", "score": "0.60001194", "text": "function createKisaId() {\n\n hardDebug && console.debug(`createKisaId().`); \n // Haetaan kisojen idt.\n var kisaIDt = data.kisat.map(x => x.id);\n \n let uniqueID = 0;\n while (kisaIDt.includes(uniqueID)) {\n uniqueID = Math.round(Math.random() * 500000);\n }\n return uniqueID;\n}", "title": "" }, { "docid": "ff389ab41f9bdd079877369aaf3e80f7", "score": "0.59999424", "text": "function laskePisteet(joukkueidenRastit, rastit) {\n let lahto = false;\n let loppu = false;\n\n for (let joukkue of joukkueidenRastit.joukkueet) {\n for (let rasti of joukkue.rastit) {\n for (let rastiId of rastit) {\n if (parseInt(rasti.rasti) === parseInt(rastiId.id)) {\n if (rastiId.koodi === \"LAHTO\") lahto = true;\n if (rastiId.koodi === \"MAALI\" && lahto === true) loppu = true;\n if (!isNaN(rastiId.koodi.charAt(0)) && lahto == true && loppu == false) {\n joukkue.pisteet += parseInt(rastiId.koodi.charAt(0));\n } \n }\n }\n if (parseInt(rasti.rasti) === parseInt(joukkue.rastit[joukkue.rastit.length - 1][\"rasti\"])) {\n lahto = false;\n loppu = false;\n }\n }\n}\n}", "title": "" }, { "docid": "a85c26c8b3780b61dc5f16c72f5bbfe2", "score": "0.59940434", "text": "function getIdRuta(nro_punto){\n // 2 -- > 2, 3 -- > 4, 4 -- > 6, 5 -- > 8\n if(nro_punto == 2){\n return 2;\n }\n\n return (nro_punto + (nro_punto - 2));\n }", "title": "" }, { "docid": "05b75542b0829633198a930a49d9e231", "score": "0.59593225", "text": "function laskeMatka(joukkueidenRastit, rastit) {\n let lahto = false;\n let loppu = false;\n\n let lahtoaika;\n let loppuaika;\n\n let pituus = 0;\n let edellinenPaikka = [];\n\n for (let joukkue of joukkueidenRastit.joukkueet) {\n if (joukkue.rastit.length === 0) joukkue.pituus = 0;\n for (let rasti of joukkue.rastit) {\n for (let rastiId of rastit) {\n if (parseInt(rasti.rasti) === parseInt(rastiId.id)) {\n if (rastiId.koodi === \"LAHTO\") {lahto = true; edellinenPaikka = [rastiId.lat, rastiId.lon]; lahtoaika = new Date(rasti.aika)}\n if (rastiId.koodi === \"MAALI\" && lahto === true) {\n loppu = true;\n pituus += getDistanceFromLatLonInKm(edellinenPaikka[0],edellinenPaikka[1],rastiId.lat,rastiId.lon);\n loppuaika = new Date(rasti.aika);\n joukkue.kulutettuAika = laskeAika(lahtoaika,loppuaika);\n } \n if (!isNaN(rastiId.koodi.charAt(0)) && lahto == true && loppu == false) {\n if (edellinenPaikka.length >= 2) {\n pituus += getDistanceFromLatLonInKm(edellinenPaikka[0],edellinenPaikka[1],rastiId.lat,rastiId.lon);\n edellinenPaikka = [rastiId.lat, rastiId.lon]; \n }\n } \n }\n }\n if (parseInt(rasti.rasti) === parseInt(joukkue.rastit[joukkue.rastit.length - 1][\"rasti\"])) {\n lahto = false;\n loppu = false;\n if (typeof pituus != \"undefined\") joukkue.pituus = pituus;\n else joukkue.pituus = 0;\n pituus = 0;\n edellinenPaikka = [];\n }\n }\n}\n}", "title": "" }, { "docid": "b9cdf86ade270a8a4a92dca6dbafa78b", "score": "0.5927617", "text": "function sacar(id){\n console.log(id, \"<z<zzzzzzzzzzzzzzzzzzzzzzzzzzz\")\n fetch('http://localhost:3000/api/OneCita/'+id)\n .then(resp => resp.json())\n .then(resp =>{\n\n add(resp,resp[0].id)\n console.log(citas_dia, '>>>>>>>>>>>>>>>>>>>>>>>)')\n });\n}", "title": "" }, { "docid": "993ff323c4446b94bad406d284c07147", "score": "0.5899052", "text": "function buscarPosicionHotel(id_h){\n\t\t\t\t//alert(listAsociados.length);\n\t\t\t\tfor(var j=0; j < listHospedajes.length; j++)\n\t\t\t\t\tif(listHospedajes[j][0]==id_h)\n\t\t\t\t\t\treturn j;\n\t\t\t}", "title": "" }, { "docid": "45aedbfb88d3867765a8aa0ccfda447e", "score": "0.58766896", "text": "function frageMitAntwortenHolen(id){\n\n}", "title": "" }, { "docid": "a400be8d511cf294e2d61a83a2dcc281", "score": "0.58718526", "text": "function tallennaKisa() {\n hardDebug && console.debug(`tallennaKisa().`); \n\n // Haetaan kentat.\n var kisaNimi = document.getElementById(\"kisaNimi\");\n var kesto = document.getElementById(\"kesto\");\n var alkuaika = document.getElementById(\"alkuaika\");\n var loppuaika = document.getElementById(\"loppuaika\");\n \n var uusiKisa = createNewKisa();\n uusiKisa.alkuaika = convertoiCustomAikaToDate(alkuaika.value.trim());\n uusiKisa.loppuaika = convertoiCustomAikaToDate(loppuaika.value.trim());\n uusiKisa.kesto = kesto.value.trim();\n uusiKisa.nimi = kisaNimi.value.trim();\n\n data.kisat.push(uusiKisa);\n\n // Tama taytyy tehda pushin jalkeen.\n uusiKisa.sarjat = createSarjat(uusiKisa.id);\n\n // Tyhjennetaan kentat.\n kisaNimi.value = \"\";\n kesto.value = \"\";\n alkuaika.value = \"\";\n loppuaika.value = \"\";\n\n // Asetetaan sarjojen kisaId:ksi nyt luotavan kisan id.\n// for (let x of uusiKisa.sarjat) {\n// x.kisa = uusiKisa.id;\n// }\n\n // Paivitetaan sarjojen alku- ja loppuajat.\n aikaLeimaaSarjat();\n}", "title": "" }, { "docid": "5bdf705297f290c34913151673bdea50", "score": "0.58458316", "text": "function getJoukkue(key) {\n hardDebug && console.debug(`getJoukkue(${key}).`); \n if (typeof key === 'string') key = key.trim();\n if (typeof key === 'number') {\n for (let x of data.joukkueet) {\n if (key === x.id) {\n return x;\n }\n }\n return null;\n }\n else if (typeof key === 'string') {\n for (let x of data.joukkueet) {\n if (key === x.nimi.trim()) {\n return x;\n }\n }\n debug && console.debug(`getJoukkue(${key}): joukkuetta ei loydy`);\n return null;\n }\n else {\n debug && console.debug(`getJoukkue(${key}):.`);\n return null;\n }\n}", "title": "" }, { "docid": "d03db124e76e97ee6f948d6ad8d4e613", "score": "0.582855", "text": "function jai_lu(id) {\n\tif (!est_lu(id)) {\n\t\tsedna_nouv--;\n\t\tvar cookie = readCookie(\"sedna_lu\");\n\t\tcookie = cookie ? (id + '-' + cookie) : id;\n\t\tcookie = cookie.substring(0,3000);\n\t\tcreateCookie(\"sedna_lu\", cookie, 365);\n\t\tvar a = document.getElementById('news'+id);\n\t\ta.className='linkvu'; /* ce lien change de style */\n\t\tdocument.title = sedna_title+' ('+sedna_nouv+'/'+sedna_total+')';\n\t}\n}", "title": "" }, { "docid": "438d08dbfbdee72ccc3a8f137b49ea9b", "score": "0.57912576", "text": "sjekkInteresse(medlemsnr, arrid, callback) {\n connection.query(\"SELECT 1 FROM Interesse WHERE Medlemsnr = ? AND Arrid = ?\", [medlemsnr, arrid], (error, result) => {\n if (error) throw error;\n\n callback(result[0]);\n });\n }", "title": "" }, { "docid": "2da22b3bc731500e44fbbae35ead29c8", "score": "0.5787755", "text": "function getSarja(key) {\n hardDebug && console.debug(`getSarja(${key}).`); \n var typeofkey = typeof key; \n for (let i of data.kisat) {\n for (let k of i.sarjat) {\n if (typeofkey === 'number') {\n if (k.id === key) return k;\n }\n else { console.error(`getSarja(${key}): ${key} ei ole tyyppia number.`); return null; }\n }\n }\n // Ei loytynyt sarjaa.\n return null;\n}", "title": "" }, { "docid": "6c85e6b0fa4db914ab545451f41a3ef9", "score": "0.5772574", "text": "function _teeRastiHakemisto() {\n let rastiMap = new Map();\n _data.rastit.forEach(rasti => rastiMap.set(rasti.id, rasti));\n\n return rastiMap;\n }", "title": "" }, { "docid": "6f97f077be00bae157a20665b4e6a8ff", "score": "0.5760814", "text": "async function loadId(lista) {\n // Vendo se id passado está no firabase\n await firebase.firestore().collection( 'chamados' ).doc( id ) // acessando doc com id passado\n .get()\n // vai acessar o snapshot e enviar para os estados a propriedade contendo o valor\n .then( ( snapshot ) => {\n setServico( snapshot.data().servico )\n setStatus( snapshot.data().status )\n setComplemento( snapshot.data().complemento )\n \n // Achando o cliente usando o id passado\n let index = lista.findIndex(item => item.id === snapshot.data().clienteID)\n setClienteSelect( index )\n // Se conseguiu achar, então está editando\n setIdCliente(true)\n } )\n .catch( ( erro ) => {\n console.log( erro );\n toast.error('ID não encontrado')\n setIdCliente(false)\n })\n }", "title": "" }, { "docid": "9338f158f23ad5bbcb4dc5df138bfa1b", "score": "0.5756616", "text": "async getHorasEspecialista(id) {\n return await Hora.find({ idEspecialista: id });\n }", "title": "" }, { "docid": "49ab8765aa2e198468154817193ea14d", "score": "0.57561594", "text": "function obtenerIdMarca(){\n\t\t\n\t\tvar res = \"marca\" + pm_g_marcas_array_indice;\n\t\t\n\t\tpm_g_marcas_array_indice++;\n\t\t\n\t\treturn res;\n\t\t\n\t}", "title": "" }, { "docid": "2406bc7a16867bcf09d90bcdebbd1aef", "score": "0.57502955", "text": "function Recuperarestado(id){\n\tconst found = Arrayciudades.find(element => element.id == id); \n\treturn found;\n}", "title": "" }, { "docid": "0781a00ed619d0df7dc3743aa9758ef8", "score": "0.5730024", "text": "function SeacrhMahasiswa() {\n console.log('=======================================================');\n rl.question(\"Masukan Nim:\", (nim) => {\n const sql = `SELECT * FROM mahasiswa WHERE nim=?`;\n db.get(sql, [nim], (err, mahasiswa) => {\n if (err) throw err;\n\n if (mahasiswa) {\n console.log('NIM : ', `${mahasiswa.nim}`);\n console.log('nama : ', `${mahasiswa.nama_mhs}`);\n console.log('alamat : ', `${mahasiswa.alamat}`);\n console.log('jurusan : ', `${mahasiswa.jurusan_id}`);\n\n }\n else\n console.log(\"NIM tidak terdaftar!\");\n menu_mahasiswa();\n })\n })\n}", "title": "" }, { "docid": "2943fd4945496dcb1a18836d064b8938", "score": "0.5717205", "text": "function getNomineeId() {\n $scope.insuranceNominee.FirstName = $scope.nominee.firstName;\n $scope.insuranceNominee.LastName = \"--\";\n // $scope.insuranceNominee.referenceKey = referenceKey;\n personInsuranceLogic.getNomineeId($scope.insuranceNominee).then(function(response) {\n console.log(response);\n var nomineePersonId = null;\n if (appConfig.APP_MODE == 'offline') {\n nomineePersonId = response.insertId;\n } else {\n\n nomineePersonId = response.data.insertId;\n }\n // generateUUID();\n addInsurance(nomineePersonId);\n\n }, function(err) {\n appLogger.error('ERR' + err);\n\n });\n }", "title": "" }, { "docid": "c365bc911e0629c4f6f3903c3526fb7e", "score": "0.56882477", "text": "function getSesionById(id)\n{\n\tlet sesionEncontrada = null;\n\tconsole.log(\"buscando sesion: \" + id);\n\n\tfor(let indiceSesion = 0; indiceSesion < listaSesiones.length && sesionEncontrada === null; ++indiceSesion)\n\t\tif(Number(listaSesiones[indiceSesion].id) === Number(id))\n\t\t\tsesionEncontrada = listaSesiones[indiceSesion];\n\n\tconsole.log(\"Sesion encontrada: \" + sesionEncontrada);\n\n\n\treturn sesionEncontrada;\n}", "title": "" }, { "docid": "4a9578a3cada04181ab139b82f235383", "score": "0.5683156", "text": "function tallennaJoukkue() {\n hardDebug && console.debug(`tallennaJoukkue().`); \n globalJoukkue.nimi = document.getElementById(\"joukkueNimi\").value.trim();\n globalJoukkue.jasenet = jasenet.filter(b => b.trim().length > 0).map(x => x.trim());\n\n // Muutetaan luontiaika oikeaan muotoon ja laitetaan joukkueelle luontiajaksi.\n globalJoukkue.luontiaika = convertoiCustomAikaToDate(document.getElementById(\"luontiaika\").value); \n globalJoukkue.leimaustapa = Array.from(leimaustapaSet);\n var sarjat = document.querySelectorAll(\"#sarja input\");\n var sarja = undefined;\n for (let x of sarjat) {\n if (x.checked === true) { sarja = x.value; break; }\n }\n if (sarja === undefined) console.error(`tallennaJoukkue(): sarjaa ei voitu maariteltya.`);\n globalJoukkue.sarja = getSarjaByKisa(globalKisa.id, sarja).id; \n\n debug && console.debug(\"Tallennetaan joukkuetta\");\n debug && console.debug(globalJoukkue);\n\n // Luodaan rastit.\n var rastit = [];\n var leimausTrt = document.querySelectorAll('#rastileimausTable tr');\n for (let i=1; i<leimausTrt.length - 1; i++) {\n var koodi = leimausTrt[i].childNodes[0].childNodes[0]; \n var aika = leimausTrt[i].childNodes[1].childNodes[0]; \n var poista = leimausTrt[i].childNodes[2].childNodes[0]; \n if (poista.checked === true) {\n continue;\n }\n var rastiId = data.rastit.find(b => b.koodi.toString() === koodi.value.trim());\n if (rastiId === null || rastiId === undefined) console.error(\"tallennaJoukkue(): rastiId === null||undefined.\");\n rastit.push({aika: convertoiPisteMuotoToViiva(aika.value), id: rastiId.id}); // TODO\n }\n globalJoukkue.rastit = rastit;\n var tableInputit = document.querySelector('#rastileimausTable td');\n var table = document.querySelector('#rastileimausTable');\n\n // Tarkistetaan loytyyko joukkue jo datasta. Jos ei loydy, niin lisataan se sinne. Muussa tapauksessa kyseessa oli jo olemassa \n // olevan joukkueen muokkaus.\n var joukkueet = getJoukkueet();\n if (joukkueet.find(x => x === globalJoukkue)) {\n debug && console.log(`Muokataan jo olemassa olevaa joukkuetta.`);\n }\n else {\n debug && console.log(`Lisataan data.joukkueet rakenteeseen uusi joukkue.`);\n data.joukkueet.push(globalJoukkue);\n }\n listaaJoukkueet();\n}", "title": "" }, { "docid": "197322ec312bb395854cb6599fd4ec68", "score": "0.56797636", "text": "SetIdentitasMahasiswa(data, res/*need params*/) {\n\t\tconsole.log(data.body)\n\t\tvar nim = data.body.nim,\n\t\t\ttanggal_lulus = moment(data.body.tanggal_lulus).locale('id').format('DD MMMM YYYY');\n\t\tmahasiswa\n\t\t\t.findOne({\n\t\t\t\twhere: {\n\t\t\t\t\t/*sementara*/\n\t\t\t\t\tnim_mahasiswa: nim\n\t\t\t\t},\n\t\t\t\tinclude:[{\n\t\t\t\t\tmodel: departemen\n\t\t\t\t}]\n\t\t\t})\n\t\t\t.then((mahasiswas) => {\n\t\t\t\tthis.idmahasiswa = mahasiswas.id\n\t\t\t\tthis.nama = mahasiswas.nama_mahasiswa\n\t\t\t\tthis.NIM = mahasiswas.nim_mahasiswa\n\t\t\t\tthis.prodi = mahasiswas.departemen.nama_departemen\n\t\t\t\tthis.tanggallulus = tanggal_lulus\n\t\t\t\tthis.resource = this.resource.replace('{{Nama}}', this.nama)\n\t\t\t\tthis.resource = this.resource.replace('{{Nama}}', this.nama)\n\t\t\t\tthis.resource = this.resource.replace('{{Nama}}', this.nama)\n\t\t\t\tthis.resource = this.resource.replace('{{NIM}}', this.NIM)\n\t\t\t\tthis.resource = this.resource.replace('{{NIM}}', this.NIM)\n\t\t\t\tthis.resource = this.resource.replace('{{NIM}}', this.NIM)\n\t\t\t\tthis.resource = this.resource.replace('{{Prodi}}', this.prodi)\n\t\t\t\tthis.resource = this.resource.replace('{{Prodi}}', this.prodi)\n\t\t\t\tthis.resource = this.resource.replace('{{Prodi}}', this.prodi)\n\t\t\t\tthis.resource = this.resource.replace('{{Prodi}}', this.prodi)\t\t\t\t\n\t\t\t\tthis.resource = this.resource.replace('{{Tanggal}}', this.tanggallulus)\n\t\t\t\tthis.resource = this.resource.replace('{{Tanggal}}', this.tanggallulus)\n\t\t\t\tthis.GetDataSKPI(data, res)\n\t\t\t})\n\t}", "title": "" }, { "docid": "bd3e537718239dc9432dba25b8fa5657", "score": "0.56722987", "text": "function id(e,t,a){var s=e+\" \";switch(a){case\"ss\":return s+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\";case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return s+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\";case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return s+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\";case\"dd\":return s+=1===e?\"dan\":\"dana\";case\"MM\":return s+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\";case\"yy\":return s+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\"}}", "title": "" }, { "docid": "659c55b6c754654189b9e1ffeaff8350", "score": "0.5662818", "text": "function unePompe(k) {\n var arr = [];\n var i;\n\n if(localStorage.getItem('pompes') != null)\n arr = JSON.parse(localStorage.getItem('pompes'))\n for (i = 0; i < arr.length; i++) {\n if (arr[i].id == k) {\n return arr[i].nom;\n }\n }\n\n}", "title": "" }, { "docid": "56569f854f12e8b27c6ee13b80c61bdf", "score": "0.56439024", "text": "async function selecionarLinha(cod_linha) {\n coleta.map((coletaItem) => {\n if (coletaItem.id == cod_linha) {\n const id = coleta.indexOf(coletaItem);\n save_linhaID(id);\n AsyncStorage.setItem('@idlinha', JSON.stringify(id));\n }\n })\n await AsyncStorage.setItem('@linha', cod_linha);\n save_linha(cod_linha);\n navigation.navigate('Coleta');\n }", "title": "" }, { "docid": "49db2ab2fb612a6d5ab137da1a1f9a51", "score": "0.5642403", "text": "function getDescSala(idSala){\n\t\treturn salasIdDesc[idSala];\n\t}", "title": "" }, { "docid": "206da4bee39029071ef53d693c6b6300", "score": "0.56379956", "text": "function pegarId(id) {\n erro = id;\n}", "title": "" }, { "docid": "71b9806be530c9a964c47a870a2415c4", "score": "0.5633484", "text": "encontrarPorId(i) {\n return this.http.get(`https://proyectofinalurda.herokuapp.com/api/etiquetas/${i}`);\n }", "title": "" }, { "docid": "1f84e30642b659a7041dab3b2dac139f", "score": "0.56265295", "text": "function Id(a,b,c,d){var e={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return b?e[c][0]:e[c][1]}", "title": "" }, { "docid": "1f84e30642b659a7041dab3b2dac139f", "score": "0.56265295", "text": "function Id(a,b,c,d){var e={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return b?e[c][0]:e[c][1]}", "title": "" }, { "docid": "47044d9d8bb47df48e2bf52e7b470927", "score": "0.5622028", "text": "function autoId(tipo){\n var tmp ;\n var nuevoId = 0;\n if (tipo === \"oferta\") {\n for (pos = 0; pos <= ofertas.length-1; pos++) {\n tmp = ofertas[pos];\n if (tmp[\"Id\"] > parseInt(nuevoId)) {\n nuevoId = tmp[\"Id\"];\n }\n }\n }else {\n if (tipo === \"reserva\") {\n for (pos = 0; pos <= reservas.length-1; pos++) {\n tmp = reservas[pos];\n if (tmp[\"IdReserva\"] > parseInt(nuevoId)) {\n nuevoId = tmp[\"IdReserva\"];\n }\n }\n }\n }\n if (tipo === \"Favorito\") {\n for (pos = 0; pos <= favoritos.length-1; pos++) {\n tmp = favoritos[pos];\n if (tmp[\"Id\"] > parseInt(nuevoId)) {\n nuevoId = tmp[\"Id\"];\n }\n }\n }\n if (tipo === \"usuario\") {\n for (pos = 0; pos <= usuarios.length-1; pos++) {\n tmp = usuarios[pos];\n if (tmp[\"Id\"] > parseInt(nuevoId)) {\n nuevoId = tmp[\"Id\"];\n }\n }\n }\n nuevoId = (nuevoId + 1);\n return nuevoId;\n}", "title": "" }, { "docid": "1542f2ae81bcc50449869987933086c4", "score": "0.5603628", "text": "function Murid(nama, nim, email, jurusan) {\n this.nama = nama;\n this.nim = nim;\n this.email = email;\n this.jurusan = jurusan;\n}", "title": "" }, { "docid": "28c0fd003b93be0346ac813ac7d5958b", "score": "0.5600648", "text": "function buscarPosicionDia(id_d){\n\t\t\t\t//alert(listAsociados.length);\n\t\t\t\tfor(var j=0; j < listDias.length; j++)\n\t\t\t\t\tif(listDias[j][0]==id_d)\n\t\t\t\t\t\treturn j;\n\t\t\t}", "title": "" }, { "docid": "fe962b646e4c87706ba6f11a96f742d0", "score": "0.55983573", "text": "function pitanja(tim) {\n\n let spisakPitanja = [\n 'Zbog čega se prijavljuješ baš za ' +\n tim +\n ' tim i na koji način želiš da doprineseš radu ovog tima?',\n 'Koja iskustva imaš, a misliš da će ti značiti u radu ovog tima',\n 'Šta želiš da naučiš radom u ovom timu?',\n 'Šta je najvažnije što mora postojati kako bi ovaj tim dobro funkcionisao i zašto?',\n 'Koja su tvoja očekivanja od koordinatora tima?'\n ];\n\n for (let i = 0; i < spisakPitanja.length; i++) {\n let rbr = i + 1;\n let id = 'pitanje#' + rbr;\n document.getElementById(id).innerText = spisakPitanja[i];\n }\n\n for (let i = spisakPitanja.length + 1; i <= maxBrojPitanja; i++) {\n let idQ = 'pitanje#' + i;\n let idA = 'pitanje #' + i;\n document.getElementById(idQ).style.display = 'none';\n document.getElementById(idA).style.display = 'none';\n }\n\n if (tim === 'CR') {\n rbr = spisakPitanja.length + 1;\n let id = 'pitanje#' + rbr;\n let idQ = id;\n let idA = 'pitanje #' + rbr;\n document.getElementById(id).innerText = 'Šta je burek?';\n document.getElementById(idQ).style.display = 'block';\n document.getElementById(idA).style.display = 'block';\n }\n\n document.getElementById('pitanja').style.display = 'block';\n}", "title": "" }, { "docid": "852fde5a5cae063e6bfaa38278d7097d", "score": "0.55955905", "text": "function cualvideodelaserie(thiss){\r\n esteelevideoqueveodeseri=\"\";\r\n esteelevideoqueveodeseri=thiss.id;\r\n\r\n\r\n \r\n\r\n\r\n\r\nabrirvideodeserie();\r\n\r\n}", "title": "" }, { "docid": "bbcb77b288e47a1901be1a46b5510e5c", "score": "0.559391", "text": "function luoVuoroOsoitin() {\n var body = document.getElementsByTagName(\"body\")[0];\n\n var varit = [\"red\", \"blue\"];\n \n var vuoroOsoitin = luoYmpyra(varit[0], 30);\n vuoroOsoitin.setAttribute(\"id\", \"vuoro-osoitin\");\n vuoroOsoitin.vuoro = 0;\n \n /**\n * Vaihtaa vuoroa tämänhetkiseltä pelaajalta toiselle.\n */\n vuoroOsoitin.vaihdaVuoroa = function() {\n if (this.vuoro < 0 || this.vuoro >= varit.length) this.vuoro = 0;\n \n this.vuoro = 1 - this.vuoro; // Vaihtaa 0 -> 1, 1 -> 0\n this.vaihdaVaria(varit[this.vuoro]);\n \n if (this.getLiikuteltavatNappulat().length === 0) {\n var voittaja = 1 - this.vuoro;\n this.naytaVoittaja(voittaja);\n this.vaihdaVaria(varit[voittaja]);\n }\n };\n \n /**\n * Palauttaa vuoron pelin aloittajalle.\n */\n vuoroOsoitin.alusta = function() {\n this.vuoro = 0;\n this.vaihdaVaria(varit[this.vuoro]);\n \n var voittoIlmoitus = document.getElementById(\"voitto-ilmoitus\");\n if (voittoIlmoitus) voittoIlmoitus.parentNode.removeChild(voittoIlmoitus);\n };\n \n /**\n * Palauttaa tiedon, onko annetun pelinappulan pelaajalla pelivuoro.\n * @param pelaaja Tarkasteltavan pelaajan numero.\n * @return true, jos pelinappulan omistavalla pelaajalla on pelivuoro.\n */\n vuoroOsoitin.isVuoro = function(pelaaja) {\n return this.vuoro === pelaaja;\n };\n \n /**\n * Palauttaa taulukon kaikista pelinappuloista, joita voi tällä\n * vuorolla liikuttaa.\n * @return Taulukko kaikista tällä vuorolla liikuteltavista pelinappuloista.\n */\n vuoroOsoitin.getLiikuteltavatNappulat = function() {\n var taulukko = body.getElementsByTagName(\"table\")[0];\n var kaikki = taulukko.getKaikkiNappulat();\n var pelaajan = [];\n var syovat = [];\n \n for (var i = 0; i < kaikki.length; i++) {\n var nappula = kaikki[i];\n if (this.isVuoro(nappula.getPelaaja()) && nappula.voiLiikuttaa()) {\n pelaajan.push(nappula);\n \n if (nappula.voiSyoda()) {\n syovat.push(nappula);\n }\n }\n }\n \n if (syovat.length > 0) return syovat;\n return pelaajan;\n };\n \n /**\n * Näyttää annetun pelaajan voittajana käyttäjälle.\n * @param voittaja Pelin voittaja. (0 = pelaaja 1, 1 = pelaaja 2)\n */\n vuoroOsoitin.naytaVoittaja = function(voittaja) {\n var voittoIlmoitus = document.getElementById(\"voitto-ilmoitus\");\n if (!voittoIlmoitus)\n voittoIlmoitus = luoIlmoitus(\"voitto-ilmoitus\", \"Pelaaja \" + (voittaja + 1) + \" voitti pelin!\");\n \n if (voittaja) voittoIlmoitus.setAttribute(\"class\", \"sininen\");\n else voittoIlmoitus.setAttribute(\"class\", \"punainen\");\n \n this.parentNode.insertBefore(voittoIlmoitus, this);\n };\n \n var div = document.createElement(\"div\");\n div.appendChild(vuoroOsoitin);\n \n body.appendChild(div);\n\n return vuoroOsoitin;\n}", "title": "" }, { "docid": "c47de2555225bb56b8d8ff7f7dbd584e", "score": "0.5590307", "text": "function getInformazioni(idCasella)\r\n{\r\n informazioni=\r\n {ora: \"\", giorno: \"\", mese: \"\", anno: \"\"};\r\n var res = idCasella.split(\"-\");\r\n j=0;\r\n for (i in informazioni)\r\n {\r\n informazioni[i]=res[j];\r\n j++;\r\n }\r\n if($(\"#\"+idCasella).is(\".has-events\")) informazioni.appuntamento= res[j];\r\n return informazioni\r\n}", "title": "" }, { "docid": "8654ca6f95069d12a8410e941b14d840", "score": "0.5570523", "text": "function ajoutEst(id_tournoi){\r\n for (let i=0; i<joueurs_est.length; i++){\r\n nom_prenom_est = joueurs_est[i].split(' ');\r\n let queryAjoutJoueurEst = \"INSERT INTO `joueur` (nom, prenom, score, classement, id_tournoi) VALUES ('\"+nom_prenom_est[0]+\"' , '\"+nom_prenom_est[1]+\"','\"+0 +\"', '\"+ 0 + \"' , '\"+id_tournoi+\"')\";\r\n\r\n db.query(queryAjoutJoueurEst, (err, result) => {\r\n if (err) {\r\n return res.status(500).send(err);\r\n }\r\n joueurs_est[i] = result.insertId;\r\n });\r\n }\r\n }", "title": "" }, { "docid": "d3c1ac50e1e19ca456598dad676a0e58", "score": "0.5549241", "text": "async getIdMaleza(req, res) {\n const { id } = req.params;\n const rows = await malezaModel.getIdMaleza(id);\n return rows != null ? res.status(200).send(rows) : res.status(404).send({ message: \"Control de Maleza no encontrado\" });\n }", "title": "" }, { "docid": "de3c28df674078c448694ea25d92f73d", "score": "0.5540935", "text": "static getId(cible,cime,valeur,couleur,nb,cb){\n\t\tquery.execute(conn, 'echec','select ?c where {:'+cime+' :'+nb+' ?c}',\n\t\t'application/sparql-results+json', {\n\t\t\toffset:0,\n\t\t\treasoning: true\n\t\t}).then(({body})=>{\n\t\t\tvar data = body.results.bindings;\n\t\t\tvar id = parseInt(data[0].c.value) +1;\n\t\t\tthis.addCime(cible,cime,valeur, couleur,id,cb);\n\t\t\tupdate.deleteOldId(cime, nb, id-1, id);\n\t\t\t//this.deleteOldId(cime,nb,id);\n\t\t}).catch(e=> {console.log(e);});\t\n\t}", "title": "" }, { "docid": "740ccab9e955975d4424853a2cc6a76f", "score": "0.5531105", "text": "function sekoitaKolikot() {\n\tvuoroLaskuri--;\n\n\tif (vuoroLaskuri < 1) {\n\t\tfor (var i = 0; i < kolikot.length; i++) {\n\t\t\tif(kolikot[i][0] >= 0) {\n\t\t\t\tlet uusiX = Math.floor(Math.random() * korkeus);\n\t\t\t\tlet uusiY = Math.floor(Math.random() * leveys);\n\n\t\t\t\tif (onkoTyhja(uusiX, uusiY)) {\n\t\t\t\t\tkolikot[i][0] = uusiY;\n\t\t\t\t\tkolikot[i][1] = uusiX;\n\t\t\t\t}\n\t\t\t} \n\t\t}\n\n\t\tvuoroLaskuri = 5;\n\t}\n}", "title": "" }, { "docid": "0ff25f16210b50f1f0d2d1e9faaf2f5d", "score": "0.5526203", "text": "function Id(a,b,c,d){var e={s:[\"thodde secondanim\",\"thodde second\"],m:[\"eka mintan\",\"ek minute\"],mm:[a+\" mintanim\",a+\" mintam\"],h:[\"eka horan\",\"ek hor\"],hh:[a+\" horanim\",a+\" hor\"],d:[\"eka disan\",\"ek dis\"],dd:[a+\" disanim\",a+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[a+\" mhoineanim\",a+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[a+\" vorsanim\",a+\" vorsam\"]};return b?e[c][0]:e[c][1]}", "title": "" }, { "docid": "0ff25f16210b50f1f0d2d1e9faaf2f5d", "score": "0.5526203", "text": "function Id(a,b,c,d){var e={s:[\"thodde secondanim\",\"thodde second\"],m:[\"eka mintan\",\"ek minute\"],mm:[a+\" mintanim\",a+\" mintam\"],h:[\"eka horan\",\"ek hor\"],hh:[a+\" horanim\",a+\" hor\"],d:[\"eka disan\",\"ek dis\"],dd:[a+\" disanim\",a+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[a+\" mhoineanim\",a+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[a+\" vorsanim\",a+\" vorsam\"]};return b?e[c][0]:e[c][1]}", "title": "" }, { "docid": "f76872436fb7b2cde1abae6f2f5ea18a", "score": "0.5511085", "text": "function localizarCasilla(y, x) {\n for(var i = 0; i<mapa.length;i++) {\n if(mapa[i].id == \"\"+x+\"\"+y) {\n var cas = mapa[i];\n }\n }\n return cas;\n}", "title": "" }, { "docid": "71aec6299ad66c50d6f18d7999ac5d19", "score": "0.5508871", "text": "function ajoutSud(id_tournoi){\r\n for (let i=0; i<joueurs_sud.length; i++){\r\n nom_prenom_sud = joueurs_sud[i].split(' ');\r\n let queryAjoutJoueurSud = \"INSERT INTO `joueur` (nom, prenom, score, classement, id_tournoi) VALUES ('\"+nom_prenom_sud[0]+\"' , '\"+nom_prenom_sud[1]+\"','\"+0 +\"', '\"+ 0 + \"' , '\"+id_tournoi+\"')\";\r\n\r\n db.query(queryAjoutJoueurSud, (err, result) => {\r\n if (err) {\r\n return res.status(500).send(err);\r\n }\r\n joueurs_sud[i] = result.insertId;\r\n });\r\n }\r\n }", "title": "" }, { "docid": "c3a1f4c5f70cfee0f0ce2a4a2bfafdab", "score": "0.5501763", "text": "function getIdPunto(nro_punto){\n // 1 --> 1, 2 -- > 3, 3 -- > 5, 4 -- > 7\n if(nro_punto == 1){\n return 1;\n }\n\n return ((2*nro_punto) - 1);\n }", "title": "" }, { "docid": "578318fa035ce5911e9c379cd3c9b14f", "score": "0.54922104", "text": "function buscarPosicionPonente(id_p){\n\t\t\t\t//alert(listAsociados.length);\n\t\t\t\tfor(var j=0; j < listPonentes.length; j++)\n\t\t\t\t\tif(listPonentes[j][0]==id_p)\n\t\t\t\t\t\treturn j;\n\t\t\t}", "title": "" }, { "docid": "8b3eaab6ce9c12509d98a86dd0438d46", "score": "0.54694074", "text": "function Objektai(){\n function lala(mas){\n var x=mas,vid;\n var sk=0,skaicius=0;\n //console.log(x.length);\n for (var i=0; i<x.length;i++){\n //var nnn= x.split(\",\",i);\n var ss= x.substr(i, 1);\n if(ss==\",\" || ss==\"0\"){\n continue;\n }\n else if(x.substr(i,1)==\"1\"){\n sk = sk + parseInt(x.substr(i, 1))*10;\n console.log( parseInt(x.substr(i, 1)));\n skaicius= skaicius +1;\n }\n else{\n sk = sk+parseInt(ss);\n skaicius= skaicius +1;\n //console.log(sk);\n }\n }\n vid = sk/skaicius;\n //console.log(sk+\" \"+vid+\" \"+x.length);\n return vid;\n }\n var obj1 = {name:\"Tomas\", lastname:\"Valinskas\", age:18, skaiciai: lala(\"5,10,10,10,10\")};\n var obj2 = {name:\"Agne\", lastname:\"Valinskas\", age:21,skaiciai: lala(\"5,6,4,8,8,8\")};\n if (obj1.lastname==obj2.lastname){\n console.log(\"O Valinskai\");\n }\n console.log(obj1);\n console.log(obj2);\n //console.log(\"nhkjh\"+eks);\n // var xx=\"6,5,4,8\";\n // var xe = parseInt(xx.split(0,1));\n // console.log(xe);\n\n }", "title": "" }, { "docid": "073e435f1b7e691b0700d060e03494f4", "score": "0.54690385", "text": "constructor(\n public _id: string, // Mongon oma id\n public tuotecode: string,\n public name: string,\n public tuoteinfo: string,\n public ryhmacode: string) {}", "title": "" }, { "docid": "ccfc7d9cba8c60953af5c425e68a4feb", "score": "0.5462094", "text": "function save(puan = 10, ogrenci) // yukarıdaki student ile alakası yok. isim benzerliği gibi düşün. student idi 01:25:00\n{\n console.log(ogrenci.name + \" : \" + puan)\n}", "title": "" }, { "docid": "e7d06b90fd79bc61b6feeb2718b6b3d1", "score": "0.5459301", "text": "function nombreCarta(){\r\n var num = this.id.substring(1,3); \r\n var palo = this.id.substring(0,1);\r\n alert(\"Has pulsado en el \" + num + \" de \" + variablesg.palos[palo]);\r\n}", "title": "" }, { "docid": "a89654c48c1bd105a7d405ec2d22eec6", "score": "0.5443369", "text": "function findWithId() {\n bookId = books.find(book => book.id === 873495);\n console.log(`Le livre qui a l' ID 873495 est : ${bookId.title}`);\n}", "title": "" }, { "docid": "f6132a22b176a4cec664ca7b24d52c9c", "score": "0.5443241", "text": "function jogada(id){\n\t\tvar icone = '';\n\t\tvar ponto = 0;\n\n\t\tif((rodada % 2) == 1){\n\t\t\ticone = 'url(\"imagens/marcacao_1.png\")';\n\t\t\tponto = -1;\n\t\t}else{\n\t\t\ticone = 'url(\"imagens/marcacao_2.png\")';\n\t\t\tponto = 1;\n\t\t}\n\n\t\trodada++;\n\n\t\t$('#'+id).css('background-image', icone);\n\t\n\t\tvar linha_coluna = id.split('-');\n\n\t\tmatriz_jogo[linha_coluna[0]][linha_coluna[1]] = ponto;\n\n\t\tverifica_combinacao();\n\t}", "title": "" }, { "docid": "d0ea3d0b2f4b76275c77dd913b41ff14", "score": "0.5442366", "text": "function cualtemporada(thiss){\r\n\r\n arraytengoestatemporada=[];\r\n stestatemporadaen=thiss.id;\r\n \r\n for(var i in arraytengolastemporadasseries ){\r\nif(arraytengolastemporadasseries[i].idname==stestatemporadaen){\r\n\r\n arraytengoestatemporada.push(arraytengolastemporadasseries[i]);\r\n\r\n break;\r\n}\r\n \r\n }\r\n\r\n\r\n\r\n \r\n elforparacrearvideosdetempora();\r\n}", "title": "" }, { "docid": "d6ba41b81de8141239bca3a202e37cf5", "score": "0.54421955", "text": "function sekolah(){\n var pengajar ={\n nama: \"MUSTIKA RATU\",\n umur: 25,\n jp: \"Perempuan\",\n status: \"PENGAJAR\",\n muridku: murid2(),\n siapa1: m3()\n }\n console.log(\"Berikut Nama Pengajar\", pengajar.nama);\n console.log (\"Identitas Murid Laki Laki Yaitu : \", pengajar.muridku);\n console.log( \"Identitas Murid Perempuan Yaitu :\", pengajar.siapa1);\n}", "title": "" }, { "docid": "e3c5ee2a74aaa01d37797b34bbb2f2e5", "score": "0.54298425", "text": "function ajoutNord(id_tournoi){\r\n console.log(joueurs_nord);\r\n for (let i=0; i<joueurs_nord.length; i++){\r\n nom_prenom_nord = joueurs_nord[i].split(' ');\r\n let queryAjoutJoueurNord = \"INSERT INTO `joueur` (nom, prenom, score, classement, id_tournoi) VALUES ('\"+nom_prenom_nord[0]+\"' , '\"+nom_prenom_nord[1]+\"','\"+0 +\"', '\"+ 0 + \"' , '\"+id_tournoi+\"')\";\r\n\r\n db.query(queryAjoutJoueurNord, (err, result) => {\r\n if (err) {\r\n return res.status(500).send(err);\r\n }\r\n joueurs_nord[i] = result.insertId;\r\n });\r\n }\r\n }", "title": "" }, { "docid": "fa22f7294ef4b9bf070e441477234a03", "score": "0.54272", "text": "function Guadaestado(id, estado){\n\tconst found = Arrayciudades.find(element => element.id == id);\n\tfound.estadoled = estado;\n\tconsole.log(Arrayciudades); \n\treturn found;\n}", "title": "" }, { "docid": "ccbe5472dad9dd95749dd6f469d0a54e", "score": "0.5420276", "text": "async getID(coordenadas) {\n let id;\n try {\n await $.ajax({\n method: \"GET\",\n url: `https://api.openweathermap.org/data/2.5/weather?lat=${\n coordenadas.latitud\n }&lon=${\n coordenadas.longitud\n }&appid=acf3ea683407fd3d8ba8d12e5c57f2b9&units=metric`,\n dataType: \"json\"\n })\n .done(function(data) {\n return data;\n })\n .then(data => (id = data.id));\n this.id = id;\n return id;\n } catch (error) {\n console.log(error);\n alert(\"Something went wrong\");\n }\n }", "title": "" }, { "docid": "f524ce672a499a7d0588a78a22f847fa", "score": "0.54117054", "text": "function id(n) {\r\n let ordem = n\r\n if (typeof n === \"object\") ordem = colunas(n)\r\n\r\n let array_id = []\r\n\r\n for (let i1 = 0; i1 < ordem; i1++) {\r\n array_id.push(1)\r\n for (let i2 = 0; i2 < ordem; i2++) {\r\n array_id.push(0)\r\n }\r\n }\r\n return array_toMatriz(array_id, ordem, ordem)\r\n}", "title": "" }, { "docid": "6336196670ccc9b64769d519af72642d", "score": "0.5406807", "text": "static async show(request, response) {\n const { id } = request.params;\n try {\n const pessoa = await database.Turmas.findOne({ where: {id: Number(id) }});\n return response.status(200).json(turma);\n } catch(error) {\n return response.status(500).json(error.message);\n }\n }", "title": "" }, { "docid": "5e00970570b29b97677c0c3cd81de9cb", "score": "0.539303", "text": "function promesa_id() {\n return new Promise((resolve, reject) => {\n try {\n const req = http.request(options, function (res) {\n const chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n const body = Buffer.concat(chunks);\n cuerpodeResultado = JSON.parse(body);\n resultado_id = body.toString();\n getInterestingPlaces()\n resolve(getPlaceID());\n });\n });\n req.end();\n }catch (error){\n throw error;\n }\n });\n }", "title": "" }, { "docid": "3135897fbff29373cd2782bef6c77fa3", "score": "0.5391006", "text": "async buscarPorId(req, res) {\n const { id } = req.params;\n\n // busca o aluno pela chave\n let aluno = await Aluno.findByPk(id, { raw: true });\n\n // verifica se o aluno não foi encontrado\n if (!aluno) {\n return res.status(404).send({ erro: \"Aluno não encontrado\" });\n }\n\n delete aluno.senha;\n\n // retorna o aluno encontrado\n res.send(aluno);\n }", "title": "" }, { "docid": "a28eae6303af550eea4fdd748d5cd9d8", "score": "0.5379982", "text": "getlernort_id(){\n return this.lernort_id;\n }", "title": "" }, { "docid": "3c6a7ad234d49ee52d540f358f1fd02d", "score": "0.5378166", "text": "function ajoutOuest(id_tournoi){\r\n for (let i=0; i<joueurs_ouest.length; i++){\r\n nom_prenom_ouest = joueurs_ouest[i].split(' ');\r\n let queryAjoutJoueurOuest = \"INSERT INTO `joueur` (nom, prenom, score, classement, id_tournoi) VALUES ('\"+nom_prenom_ouest[0]+\"' , '\"+nom_prenom_ouest[1]+\"','\"+0 +\"', '\"+ 0 + \"' , '\"+id_tournoi+\"')\";\r\n\r\n db.query(queryAjoutJoueurOuest, (err, result) => {\r\n if (err) {\r\n return res.status(500).send(err);\r\n }\r\n joueurs_ouest[i] = result.insertId;\r\n });\r\n }\r\n }", "title": "" }, { "docid": "96b1f6a8b1f42e6569941c2e86070aa2", "score": "0.5366389", "text": "function napraviNazivKarte (karta) {\n return karta.brojKarte + ' ' + karta.simbol;\n}", "title": "" }, { "docid": "d5bbfed9155755c3347103481691f23a", "score": "0.53427225", "text": "function vrniNazivStranke(strankaId, povratniKlic) {\n pb.all(\n \"SELECT Customer.FirstName || ' ' || Customer.LastName AS naziv \\\n FROM Customer \\\n WHERE Customer.CustomerId = \" + strankaId,\n {},\n function (napaka, vrstica) {\n if (napaka) {\n povratniKlic(\"\");\n } else {\n povratniKlic(vrstica.length > 0 ? vrstica[0].naziv : \"\");\n }\n }\n );\n}", "title": "" }, { "docid": "1d670aad24fb9624a92e151e318aaa87", "score": "0.5339934", "text": "get id() {\n return this.S_.path.J();\n }", "title": "" }, { "docid": "1d670aad24fb9624a92e151e318aaa87", "score": "0.5339934", "text": "get id() {\n return this.S_.path.J();\n }", "title": "" }, { "docid": "9987dc281cf4483af9724b9c513ce602", "score": "0.5331234", "text": "function osoba(){\r\n var osobaBira=this.id; //Napravili smo varijablu osobaBira kojom ćemo dati doznanja da smo mi vlasnici objekta.\r\n document.getElementById(\"Odabir\").innerHTML=\"Birali ste: \"+osobaBira;\r\n //Dio zadatka gdje osoba bira ponuđenu opciju\r\n var racunarBira=Math.random();\r\n //Dio zadatka gdje računar bira ponuđenu opciju\r\n if (racunarBira<=0.33){\r\n racunarBira=\"Papir\";\r\n }\r\n else if(racunarBira>0.66){\r\n racunarBira=\"Kamen\";\r\n }\r\n else{\r\n racunarBira=\"Makaze\";\r\n };\r\n document.getElementById(\"Odabir\").innerHTML=\"Računar je birao: \"+racunarBira;\r\n console.log(rezultat(osobaBira, racunarBira));\r\n //Računar je u \"random-u\" takođe izabrao jednu od opcija, sada će uslijediti poređenje ljudskog i računarskog izbora kako bi se proglasio pobjednik.\r\n function rezultat(osoba_bira, racunar_bira){\r\n if (osoba_bira==racunar_bira){\r\n console.log(\"Rezultat je neriješen, pokušajte ponovo!\");\r\n document.getElementById(\"MyDiv\").innerHTML=\"Rezultat je neriješen, pokušajte ponovo!\";\r\n }\r\n else if(osoba_bira==\"Papir\"){\r\n if(racunar_bira==\"Kamen\"){\r\n console.log(\"Vi ste pobjednik, čestitamo!\");\r\n document.getElementById(\"MyDiv\").innerHTML=\"Vi ste pobjednik, čestitamo!\";\r\n brojacIgrac++;\r\n document.querySelector(\"#player\").innerHTML = \"Igrac: \" + brojacIgrac;\r\n\r\n \r\n \r\n }\r\n else{\r\n console.log(\"Računar je pobjednik!\");\r\n document.getElementById(\"MyDiv\").innerHTML=\"Računar je pobjednik!\";\r\n brojacKompjuter++;\r\n document.querySelector(\"#computer\").innerHTML = \"Kompjuter: \" + brojacKompjuter;\r\n\r\n \r\n \r\n }\r\n }\r\n else if(osoba_bira==\"Makaze\"){\r\n if(racunar_bira==\"Papir\"){\r\n console.log(\"Vi ste pobjednik, čestitamo!\");\r\n document.getElementById(\"MyDiv\").innerHTML=\"Vi ste pobjednik, čestitamo!\";\r\n brojacIgrac++;\r\n document.querySelector(\"#player\").innerHTML = \"Igrac: \" + brojacIgrac;\r\n\r\n \r\n \r\n }\r\n else{\r\n console.log(\"Računar je pobjednik!\");\r\n document.getElementById(\"MyDiv3\").innerHTML=\"Računar je pobjednik!\";\r\n brojacKompjuter++;\r\n document.querySelector(\"#computer\").innerHTML = \"Kompjuter: \" + brojacKompjuter;\r\n\r\n \r\n \r\n \r\n }\r\n }\r\n else if(osoba_bira==\"Kamen\"){\r\n if(racunar_bira==\"Makaze\"){\r\n console.log(\"Vi ste pobjednik, čestitamo!\");\r\n document.getElementById(\"MyDiv\").innerHTML=\"Vi ste pobjednik, čestitamo!\";\r\n brojacIgrac++;\r\n document.querySelector(\"#player\").innerHTML = \"Igrac: \" + brojacIgrac;\r\n\r\n \r\n }\r\n else{\r\n console.log(\"Računar je pobjednik!\");\r\n document.getElementById(\"MyDiv\").innerHTML=\"Računar je pobjednik!\";\r\n brojacKompjuter++;\r\n document.querySelector(\"#computer\").innerHTML = \"Kompjuter: \" + brojacKompjuter;\r\n\r\n \r\n \r\n }\r\n }\r\n }\r\n \r\n }", "title": "" }, { "docid": "86af3bee1d931e666bf6f9cd2fdf82b4", "score": "0.53137547", "text": "function retirerAuditeur(idAuditeur) {\n var nIteration = repartitionTache.length;\n for (var i = 0; i < nIteration; i++) {\n var taches = $.map(repartitionTache, function (obj, index) {\n if (obj.auditeur == idAuditeur) {\n return index;\n }\n });\n if (taches != \"\") {\n repartitionTache.splice(taches[0], 1);\n console.log(repartitionTache);\n } else {\n console.log(\"Cet auditeur n'a aucune tâche\");\n break;\n }\n }\n console.log(repartitionTache);\n }", "title": "" }, { "docid": "0b8601c9979496d6c172889da12e4549", "score": "0.5309478", "text": "function userFind(aux,user){\r\n let back=false;\r\n user.forEach(a=>{\r\n \r\n if(a.legajo==aux)\r\n {\r\n back= a.id;\r\n }\r\n\r\n })\r\n return back; \r\n}", "title": "" }, { "docid": "b1e6ce343b7bc14dc67fd13ea54f8d0a", "score": "0.5295396", "text": "function hetu_checksum(id) {\n\t\t\t// luodaan iso luku äsken luetuista numeroista ja samalla lasketaan tarkiste\n\t\t\tvar n = (id.n + id.yy*1000 + id.mm*100000 + id.dd*10000000)%31;\n\t\t\tvar s = '0123456789ABCDEFHJKLMNPRSTUVWXY';\n\t\t\treturn s[n];\n\t\t}", "title": "" }, { "docid": "a84ded1542d94ceb9130add7b71a296b", "score": "0.5292753", "text": "function laskeJoukkueenMatka(joukkue) {\n let pituus = 0;\n let edellinenRasti;\n let matka = haeSallitutRastit(joukkue);\n for (let i = 0; i < matka.length; i++) {\n if (i == 0) {\n edellinenRasti = matka[0];\n }\n else {\n pituus += getDistanceFromLatLonInKm(edellinenRasti.lat,edellinenRasti.lon,matka[i].lat,matka[i].lon);\n edellinenRasti = matka[i];\n }\n }\n return pituus.toFixed(0);\n}", "title": "" }, { "docid": "856ce82be48070935de329b9126da56c", "score": "0.52927244", "text": "function generirajPodatke(stPacienta) {\n ehrId = \"\";\n\nif(stPacienta == 1) {\n $(\"#user\").append('<option value=\"657482ea-c19f-40b4-9013-4bbcdac3f959\">Janez Kranjski</option>');\n $(\"#user\").append('<option value=\"bd66d802-017f-4e09-abb1-2e14c1f8bae8\">Micka Okrogla</option>');\n $(\"#user\").append('<option value=\"b490b00d-0d0c-4baf-a654-ebdfa88e45d4\">Tim Gorenc</option>');\n}\n\n return ehrId;\n}", "title": "" }, { "docid": "034782665fe8225cca121cb52959d4c7", "score": "0.5292644", "text": "function elementId(idb, datos) {\n var res = null;\n for (let i = 0; i < datos.length; i++) {\n if(datos[i].id==idb)\n {\n res = datos[i];\n break;\n } \n }\n return res;\n}", "title": "" }, { "docid": "43f633b8ce14dfe9c44aa5d158326032", "score": "0.528713", "text": "function showMensajeinfoAcademicaDefectoAno(id,id_mensaje_usuario){\n \n $.post(entorno+\"mensajeusuario/\"+id_mensaje_usuario+\"/leido\"); \n $.get(entorno+\"mensaje/\"+id+\"/show\",function(data){\n $(\"#contenido_principal\").html(data); \n $(\"#flass_tmp\").html(\"<span>listo!!!</span>\");\n \n }); \n}", "title": "" }, { "docid": "8957b3f2f1bd4860495f1af372b9304b", "score": "0.5284156", "text": "async getHorariosEspecialista(id) {\n return await Horario.find({ idEspecialista: id });\n }", "title": "" }, { "docid": "90dca6ddaf90f68531a2dce6082bffa6", "score": "0.5282114", "text": "function encontrarObjeto(id)\n{\n var objeto=\"\";\n\n for(let i=0;i<dias.length;i++)\n {\n if(id==dias[i].id)\n {\n objeto=dias[i];\n }\n }\n\n return objeto;\n}", "title": "" }, { "docid": "2b7524976f309dc27cbd240a896931b7", "score": "0.52742726", "text": "agregarPersona(id, nombre, sala) {\n // datos que se necesitan grabar como parte de una persona\n let persona = { id, nombre, sala };\n\n // Agregar la persona al arreglo de personas que se maneja \n this.personas.push(persona);\n\n // Obtener todas las personas que se encuentran en un chat\n return this.personas;\n }", "title": "" }, { "docid": "d5cbd18f852b58aa0f15a656b94bc1b8", "score": "0.52711457", "text": "async getUsuarioId({ id }) {\n const usuario = await Usuarios.findByPk(id);\n if(!usuario ) {\n return {\n error: true,\n msg: 'No se logró encontrar ningun usuario',\n status: 400\n };\n }\n return usuario; \n }", "title": "" }, { "docid": "525a836199c809f3baea12a8902868f4", "score": "0.5270491", "text": "agregarPersona(id, nombre, sala) {\n // creo la persona\n let persona = {\n id,\n nombre,\n sala\n };\n // agrego una persona al arreglo\n this.personas.push(persona);\n // retorno todas las personas del chat\n return this.personas;\n }", "title": "" }, { "docid": "c0f2faa7d82c9c5f421a174a4a208456", "score": "0.52701354", "text": "function intensidadr(luz, id) {\n\tlet valor = document.getElementById(id).value;\n\tipuntual[0] = valor;\n\tluz.intensidad[0] = valor;\n}", "title": "" } ]
ca12b789836e94fe973a12eb8f514aaa
Return a potentiallymapped jQuery.cssProps or vendor prefixed property
[ { "docid": "765e2bda601ac508cd4dbc29c4ccf33a", "score": "0.0", "text": "function finalPropName( name ) {\n\tvar final = jQuery.cssProps[ name ] || vendorProps[ name ];\n\n\tif ( final ) {\n\t\treturn final;\n\t}\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\treturn vendorProps[ name ] = vendorPropName( name ) || name;\n}", "title": "" } ]
[ { "docid": "46bb006245aa08935352186631c860ae", "score": "0.7950512", "text": "function vendorPropName(name){// Check for vendor prefixed names\nvar capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}// Return a potentially-mapped jQuery.cssProps or vendor prefixed property", "title": "" }, { "docid": "46bb006245aa08935352186631c860ae", "score": "0.7950512", "text": "function vendorPropName(name){// Check for vendor prefixed names\nvar capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}// Return a potentially-mapped jQuery.cssProps or vendor prefixed property", "title": "" }, { "docid": "8eb144a649adfeb2286a4eb40ab576f3", "score": "0.78401226", "text": "function vendorPropName(name){// Shortcut for names that are not vendor prefixed\nif(name in emptyStyle){return name;}// Check for vendor prefixed names\nvar capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}// Return a property mapped along what jQuery.cssProps suggests or to", "title": "" }, { "docid": "8eb144a649adfeb2286a4eb40ab576f3", "score": "0.78401226", "text": "function vendorPropName(name){// Shortcut for names that are not vendor prefixed\nif(name in emptyStyle){return name;}// Check for vendor prefixed names\nvar capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}// Return a property mapped along what jQuery.cssProps suggests or to", "title": "" }, { "docid": "8eb144a649adfeb2286a4eb40ab576f3", "score": "0.78401226", "text": "function vendorPropName(name){// Shortcut for names that are not vendor prefixed\nif(name in emptyStyle){return name;}// Check for vendor prefixed names\nvar capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}// Return a property mapped along what jQuery.cssProps suggests or to", "title": "" }, { "docid": "8eb144a649adfeb2286a4eb40ab576f3", "score": "0.78401226", "text": "function vendorPropName(name){// Shortcut for names that are not vendor prefixed\nif(name in emptyStyle){return name;}// Check for vendor prefixed names\nvar capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}// Return a property mapped along what jQuery.cssProps suggests or to", "title": "" }, { "docid": "8eb144a649adfeb2286a4eb40ab576f3", "score": "0.78401226", "text": "function vendorPropName(name){// Shortcut for names that are not vendor prefixed\nif(name in emptyStyle){return name;}// Check for vendor prefixed names\nvar capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}// Return a property mapped along what jQuery.cssProps suggests or to", "title": "" }, { "docid": "f3d4562c1d34858d64c86b738e60949b", "score": "0.74690884", "text": "function vendorPropName(name) {\n // Check for vendor prefixed names\n var capName = name[0].toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[i] + capName;\n\n if (name in emptyStyle) {\n return name;\n }\n }\n } // Return a potentially-mapped jQuery.cssProps or vendor prefixed property", "title": "" }, { "docid": "f3d4562c1d34858d64c86b738e60949b", "score": "0.74690884", "text": "function vendorPropName(name) {\n // Check for vendor prefixed names\n var capName = name[0].toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[i] + capName;\n\n if (name in emptyStyle) {\n return name;\n }\n }\n } // Return a potentially-mapped jQuery.cssProps or vendor prefixed property", "title": "" }, { "docid": "f3d4562c1d34858d64c86b738e60949b", "score": "0.74690884", "text": "function vendorPropName(name) {\n // Check for vendor prefixed names\n var capName = name[0].toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[i] + capName;\n\n if (name in emptyStyle) {\n return name;\n }\n }\n } // Return a potentially-mapped jQuery.cssProps or vendor prefixed property", "title": "" }, { "docid": "f3d4562c1d34858d64c86b738e60949b", "score": "0.74690884", "text": "function vendorPropName(name) {\n // Check for vendor prefixed names\n var capName = name[0].toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[i] + capName;\n\n if (name in emptyStyle) {\n return name;\n }\n }\n } // Return a potentially-mapped jQuery.cssProps or vendor prefixed property", "title": "" }, { "docid": "0e5e007bab193dec7f8b67a70d22f765", "score": "0.7443594", "text": "function vendorPropName(name) {\n // Check for vendor prefixed names\n var capName = name[0].toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[i] + capName;\n\n if (name in emptyStyle) {\n return name;\n }\n }\n } // Return a potentially-mapped jQuery.cssProps or vendor prefixed property", "title": "" }, { "docid": "0e5e007bab193dec7f8b67a70d22f765", "score": "0.7443594", "text": "function vendorPropName(name) {\n // Check for vendor prefixed names\n var capName = name[0].toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[i] + capName;\n\n if (name in emptyStyle) {\n return name;\n }\n }\n } // Return a potentially-mapped jQuery.cssProps or vendor prefixed property", "title": "" }, { "docid": "0e5e007bab193dec7f8b67a70d22f765", "score": "0.7443594", "text": "function vendorPropName(name) {\n // Check for vendor prefixed names\n var capName = name[0].toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[i] + capName;\n\n if (name in emptyStyle) {\n return name;\n }\n }\n } // Return a potentially-mapped jQuery.cssProps or vendor prefixed property", "title": "" }, { "docid": "50b0443094794faa8cbdd2e154961110", "score": "0.7259563", "text": "function finalPropName(name){var ret=jQuery.cssProps[name];if(!ret){ret=jQuery.cssProps[name]=vendorPropName(name)||name;}return ret;}", "title": "" }, { "docid": "50b0443094794faa8cbdd2e154961110", "score": "0.7259563", "text": "function finalPropName(name){var ret=jQuery.cssProps[name];if(!ret){ret=jQuery.cssProps[name]=vendorPropName(name)||name;}return ret;}", "title": "" }, { "docid": "50b0443094794faa8cbdd2e154961110", "score": "0.7259563", "text": "function finalPropName(name){var ret=jQuery.cssProps[name];if(!ret){ret=jQuery.cssProps[name]=vendorPropName(name)||name;}return ret;}", "title": "" }, { "docid": "50b0443094794faa8cbdd2e154961110", "score": "0.7259563", "text": "function finalPropName(name){var ret=jQuery.cssProps[name];if(!ret){ret=jQuery.cssProps[name]=vendorPropName(name)||name;}return ret;}", "title": "" }, { "docid": "50b0443094794faa8cbdd2e154961110", "score": "0.7259563", "text": "function finalPropName(name){var ret=jQuery.cssProps[name];if(!ret){ret=jQuery.cssProps[name]=vendorPropName(name)||name;}return ret;}", "title": "" }, { "docid": "4d2550aef171c2e576e80caf9d8952f3", "score": "0.697913", "text": "function finalPropName( name ) {\n var ret = jQuery.cssProps[ name ];\n if ( !ret ) {\n ret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n }\n return ret;\n }", "title": "" }, { "docid": "d68bef2bde4472e287049b84047991db", "score": "0.6875921", "text": "function finalPropName( name ) {\r\n\tvar ret = jQuery.cssProps[ name ];\r\n\tif ( !ret ) {\r\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\r\n\t}\r\n\treturn ret;\r\n}", "title": "" }, { "docid": "d68bef2bde4472e287049b84047991db", "score": "0.6875921", "text": "function finalPropName( name ) {\r\n\tvar ret = jQuery.cssProps[ name ];\r\n\tif ( !ret ) {\r\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\r\n\t}\r\n\treturn ret;\r\n}", "title": "" }, { "docid": "1c57e5df0693bf2cbf97f938ed77e9bb", "score": "0.6771433", "text": "function finalPropName( name ) {\n var ret = jQuery.cssProps[ name ];\n if ( !ret ) {\n ret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n }\n return ret;\n }", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "5a8c9a264b476e84ee844e408289ea5f", "score": "0.67465645", "text": "function finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}", "title": "" } ]
076a402f79dd5b9f6d0ed7f37899c2b0
Shows register from in modal
[ { "docid": "af593f98b8cb815d74f23cf7fb02a11d", "score": "0.7134105", "text": "function showRegister() {\n $state.go('register');\n }", "title": "" } ]
[ { "docid": "708ca7f94e6a50c9bbfc4d0d9fa863a7", "score": "0.77402043", "text": "function register() {\n $('#login').modal();\n $('#register').modal();\n}", "title": "" }, { "docid": "40f8a30b978a2c85692843f9a0b88810", "score": "0.73612976", "text": "function showModal() { // eslint-disable-line no-unused-vars\n $('#showpw').show();\n $('#edit-form').trigger('reset');\n $('#title').text('Add a user');\n $('#edit').modal('show');\n}", "title": "" }, { "docid": "da2c828aeb94664f5259cb6d380b1ad3", "score": "0.71906424", "text": "function openRegisterModal() {\n showRegisterForm();\n setTimeout(function() {\n $('#loginModal').modal('show');\n }, 230);\n}", "title": "" }, { "docid": "1d4822d9b6b877ebf5c78b267211fc44", "score": "0.7104777", "text": "function authReg() {\n let modal = modals('authRegOpen', authRegContent, function () {\n modal.destroy();\n }, function () {\n authRegContent.style.display = 'block';\n }\n );\n modal.addFooterBtn('Зарегистрироваться', 'reg-btn', function () {\n console.log('reg');\n });\n modal.addFooterBtn('Войти', 'enter-btn', function () {\n console.log('enter');\n });\n modal.open();\n }", "title": "" }, { "docid": "3de8595fb1f363945bf39f26b6c1f52f", "score": "0.6975398", "text": "function file_register_modal() {\n $('#confirmMemberModal').fadeIn( 500, function() {\n $('#confirmMemberModal').css('display', 'block');\n });\n }", "title": "" }, { "docid": "9def0653108ca5c9f6e7e7f02b18dcb1", "score": "0.69143736", "text": "function toRegister() {\n\t$(\"#login\").hide()\n\t$(\"#register\").show()\n}", "title": "" }, { "docid": "3f0d8ba4a513346294dfb13e2e94bfe3", "score": "0.6889654", "text": "function newMemberSignUp(){\n\tsignInModal.style.display = \"none\";\n\tsignUpModal.style.display = \"block\";\n\t\n}", "title": "" }, { "docid": "34c99e880aaeb49153f02cc14fc5f5b6", "score": "0.68601793", "text": "function goToRegister(){\r\n\t\t$(\"#reg\").click(() => {\r\n\t\t$(\"#login_1\").hide(500);\r\n\t\t$(\"#reg_1\").show(500);\r\n\t});\r\n\t}", "title": "" }, { "docid": "a776b98102b21125ea305a1d9298eeca", "score": "0.68592423", "text": "registerModal() {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function* () {\n this.dismissLogin();\n const registerModal = yield this.modalController.create({\n component: _register_register_page__WEBPACK_IMPORTED_MODULE_5__[\"RegisterPage\"]\n });\n return yield registerModal.present();\n });\n }", "title": "" }, { "docid": "878fc6359fbea88d8d96e7114c6766df", "score": "0.6755646", "text": "function showCreateAccount(){\n $(\"#newAccountModal\").modal();\n}", "title": "" }, { "docid": "972dd8112548250ce6dda43a8cbb4082", "score": "0.6733276", "text": "function showRegisterForm() {\n $('.loginBox').fadeOut('fast', function() {\n $('.registerBox').fadeIn('fast');\n $('.login-footer').fadeOut('fast', function() {\n $('.register-footer').fadeIn('fast');\n });\n $('.modal-title').html('Register with');\n });\n $('.error')\n .removeClass('alert alert-danger')\n .html('');\n}", "title": "" }, { "docid": "fe45f154a290b5383eee3f0f15453a5e", "score": "0.672436", "text": "function login_profile() {\n $('#register').modal('hide');\n $('#login').modal('show');\n}", "title": "" }, { "docid": "fe45f154a290b5383eee3f0f15453a5e", "score": "0.672436", "text": "function login_profile() {\n $('#register').modal('hide');\n $('#login').modal('show');\n}", "title": "" }, { "docid": "aaf840c29481da302f24f4dad913559d", "score": "0.66475946", "text": "function openSignUpModal() {\n modalin.style.display = \"none\";\n modalup.style.display = \"block\";\n}", "title": "" }, { "docid": "d2d4d41133597e0f8725d09301d98707", "score": "0.6613886", "text": "function openSignupModal(){\n self.signupModalToggle = !self.signupModalToggle;\n }", "title": "" }, { "docid": "0c16898b84e2332722ddab4158f65ae8", "score": "0.6613621", "text": "function showRegister() {\n \"use strict\";\n \n hideElement(\"login\");\n showElement(\"register\");\n}", "title": "" }, { "docid": "22361f6924326b9f8276e95b79c2c285", "score": "0.6611444", "text": "function signupForFree(){\n $('#rigsterModal').modal('show'); \n \n $('#free4User').val(1);\n }", "title": "" }, { "docid": "2fc795575da0e72b50530a1197255d77", "score": "0.66051435", "text": "displayRegister() {\n this.props.setAuthState({\n register: true,\n showUserForm: true\n })\n }", "title": "" }, { "docid": "3f01be5a720f30019bd8c34b96347a19", "score": "0.66041493", "text": "function abrirModalUsuarios(){\n $('#tituloModal').text(\"Buscar Usuarios\");\n $('#modal_usuarios').modal('show');\n }", "title": "" }, { "docid": "913e974c2dd024b48522f4a9cfc71789", "score": "0.6566462", "text": "function showProfilFrom() {\n _get('profile_add','', 'contentModalProfil', '');\n _showModal('frmProfilModal');\n}", "title": "" }, { "docid": "6a8e4bfe1b5fe1cfb08d9d47c46cf2af", "score": "0.6553419", "text": "function setup_minionsignup_modal()\n {\n jQuery(\"#div_signupheader\").html('<h4 id=\"myModalLabel\">Sign Up as a Minion</h4>');\n jQuery(\"#div_signup_subheader\").html('Not a Minion? Go ahead sign up to get one <a href=\"#\" id=\"show_employerreg\">here</a>');\n jQuery(\"#signup_role\").val('minyawn');\n if (jQuery(\"#usr_role\").length > 0)\n {\n jQuery(\"#usr_role\").val(\"minyawn\");\n }\n else\n {\n jQuery(\"#wp-fb-ac-fm\").append('<input type=\"hidden\" name =\"usr_role\" id=\"usr_role\" value=\"minyawn\" /> '); //jQuery(\"#usr_role\").val('minyawn');\n }\n\n if (jQuery(\"#fb_chk_usersigninform\").length > 0)\n {\n jQuery(\"#fb_chk_usersigninform\").remove();\n }\n jQuery(\"#div_alreadyregister\").html(\"Already a Minyawn?\");\n jQuery(\"#signup_fname\").attr(\"placeholder\", \"First Name\");\n jQuery(\"#signup_lname\").attr(\"placeholder\", \"Last Name\");\n jQuery(\"#signup_fname\").show()\n jQuery(\"#signup_lname\").show()\n jQuery(\"#signup_email\").show()\n jQuery(\"#signup_password\").show()\n jQuery(\"#signup_company\").hide();\n jQuery(\"#div_signupmsg\").html(\"\");\n validator_signup.resetForm();\n jQuery(\"#signup_email\").val(\"\");\n jQuery(\"#signup_password\").val(\"\");\n jQuery(\"#signup_fname\").val(\"\");\n jQuery(\"#signup_lname\").val(\"\");\n jQuery(\"#signup_email\").removeClass('error');\n }", "title": "" }, { "docid": "41ab293b11f310dcb21e943f1337e88f", "score": "0.65265197", "text": "function showRegisterForm() {\n $(`#login-page`).hide()\n $(`#register-page`).show()\n}", "title": "" }, { "docid": "4d277dd035352efcfce43a9a68de19e6", "score": "0.65221727", "text": "function displaySignup() {\r\n showLogin(false);\r\n }", "title": "" }, { "docid": "776a4f45944e7b0002fcc7dba187543a", "score": "0.6510185", "text": "showRegistrationBox() {\n\t\t$('.register-link').trigger('click');\n\t\treturn false; // prevent default behaviour.\n\t}", "title": "" }, { "docid": "3588059070ed2427d60283f3922ef63e", "score": "0.6501133", "text": "function showRegisterForm(){\n \"use strict\";\n $('.loginBox').fadeOut('fast',function(){\n $('.registerBox').fadeIn('fast');\n $('.login-footer').fadeOut('fast',function(){\n $('.register-footer').fadeIn('fast');\n });\n $('.modal-title').html('Create an Account');\n $('.modal-subtitle').html('Begin a 30-day free trial of SmartMVP');\n });\n $('.error').removeClass('alert alert-danger').html('');\n}", "title": "" }, { "docid": "b619395aa96824d52e74441280af3039", "score": "0.64889675", "text": "function openModalCreateUser() {\n\t$('.modal-user-title').text(\"Thêm người dùng mới\");\n\t$('#modal-user').modal({\n\t\tshow : 'true'\n\t});\n}", "title": "" }, { "docid": "b619395aa96824d52e74441280af3039", "score": "0.64889675", "text": "function openModalCreateUser() {\n\t$('.modal-user-title').text(\"Thêm người dùng mới\");\n\t$('#modal-user').modal({\n\t\tshow : 'true'\n\t});\n}", "title": "" }, { "docid": "f15f733040e9cae72139ec537c6f1c95", "score": "0.6488564", "text": "_showCreateFormUser() {\n let url = Routing.generate('open_orchestra_user_admin_new');\n Application.getRegion('content').html(new LoaderView().render().$el);\n FormBuilder.createFormFromUrl(url, (form) => {\n let userFormView = new NewUserFormView({form: form});\n Application.getRegion('content').html(userFormView.render().$el);\n }, this._user.toJSON());\n this.$el.modal('hide');\n }", "title": "" }, { "docid": "88f9eb7a59dca7d6ce11461c5432e469", "score": "0.64459264", "text": "function showModal() { // eslint-disable-line no-unused-vars\r\n $('#title').text('Add a new user');\r\n $('#edit').modal('show');\r\n}", "title": "" }, { "docid": "fe40d901ab36516ff66f6a83ca391028", "score": "0.64315", "text": "function showSignUpForm() {\n console.log(\"new user is invoked\")\n modalBody.html('')\n modalBody.append(`\n <form class=\" bg-dark\"> \n <div class=\"mb-3\">\n <label for=\"exampleInputEmail1\" class=\"form-label\">user id: </label>\n <input type=\"text\" class=\"form-control \" name=\"id\" >\n </div>\n <div class=\"mb-3\">\n <label for=\"exampleInputPassword1\" class=\"form-label\">first name: </label>\n <input type=\"text\" class=\"form-control\" name=\"first_name\">\n </div>\n <div class=\"mb-3\">\n <label for=\"exampleInputPassword1\" class=\"form-label\">last name: </label>\n <input type=\"text\" class=\"form-control\" name=\"last_name\">\n </div>\n <div class=\"mb-3\">\n <label for=\"exampleInputPassword1\" class=\"form-label\">email address: </label>\n <input type=\"text\" class=\"form-control\" name=\"email\">\n </div>\n <div class=\"mb-3\">\n <label for=\"exampleInputPassword1\" class=\"form-label\">picture URL: </label>\n <input type=\"text\" class=\"form-control\" name=\"avatar\">\n </div>\n </form>\n `)\n modalFooter.html(`\n <button id=\"save-new\" class=\" btn btn-outline-success offset-left my-3\" data-bs-dismiss=\"modal\"> Save </button>\n `)\n console.log(users)\n}", "title": "" }, { "docid": "2a60903ec7411af2771805839dad720a", "score": "0.6412498", "text": "open() {\n return super.open('register');\n }", "title": "" }, { "docid": "ce6ad6e636f7f32959927527c01806c5", "score": "0.6386037", "text": "function insert_modal() {\n document.getElementById('id-modal-signup').innerHTML = signup_modal;\n document.getElementById('id-modal-signin').innerHTML = signin_modal;\n}", "title": "" }, { "docid": "7f2735593a5c1875421cee9aa9b930db", "score": "0.6363627", "text": "function signup(){\n\tdocument.getElementById('register').style.display = 'block'; \n\tdocument.getElementById('login').style.display = 'none';\n}", "title": "" }, { "docid": "98924ac68e9c180e421d1e2a86eb3918", "score": "0.6356203", "text": "function setupemployersignup_modal()\n {\n jQuery(\"#div_signupheader\").html('<h4 id=\"myModalLabel\">Sign Up as an Employer </h4> ');\n\n jQuery(\"#div_signup_subheader\").html('Looking for a job? Sign in as a <a href=\"#\" id=\"show_minionreg\">Minion</a>');\n jQuery(\"#signup_role\").val('employer');\n if (jQuery(\"#usr_role\").length > 0)\n {\n jQuery(\"#usr_role\").val(\"employer\");\n }\n else\n {\n jQuery(\"#wp-fb-ac-fm\").append('<input type=\"hidden\" name =\"usr_role\" id=\"usr_role\" value=\"employer\" /> '); ////jQuery(\"#usr_role\").val('employer');\n }\n if (jQuery(\"#fb_chk_usersigninform\").length > 0)\n {\n jQuery(\"#fb_chk_usersigninform\").remove();\n }\n jQuery(\"#div_alreadyregister\").html(\"Already registered at Minyawns?\");\n jQuery(\"#signup_fname\").attr(\"placeholder\", \"First Name\");\n jQuery(\"#signup_lname\").attr(\"placeholder\", \"Last Name\");\n jQuery(\"#signup_fname\").show();\n jQuery(\"#signup_lname\").show();\n jQuery(\"#signup_email\").show();\n jQuery(\"#signup_password\").show();\n jQuery(\"#signup_company\").show();\n jQuery(\"#div_signupmsg\").html(\"\");\n validator_signup.resetForm();\n jQuery(\"#signup_email\").val(\"\");\n jQuery(\"#signup_password\").val(\"\");\n jQuery(\"#signup_fname\").val(\"\");\n jQuery(\"#signup_lname\").val(\"\");\n jQuery(\"#signup_email\").removeClass(\"error\");\n }", "title": "" }, { "docid": "e3043753fca639cb2f003273d7474534", "score": "0.63513756", "text": "function showLoginEmail() {\n $('#withGmail').modal('show'); \n}", "title": "" }, { "docid": "caec56711ccb072ce1464dd15a890762", "score": "0.632535", "text": "function pageRegistration() {\n $(\"#registerDiv\").show();\n $(\"#tableProjectionWithSearch\").hide();\n $(\"#loginRegisterDiv\").hide();\n $(\"#buttonMovies\").hide();\n $(\"#movieDiv\").hide();\n }", "title": "" }, { "docid": "fda167a349c4d2d83a74732ebd6157fe", "score": "0.63134533", "text": "renderRegistration() {\r\n this.form.append(this.title, this.inputEmail,\r\n this.inputFirstName,\r\n this.inputLastName,\r\n this.inputPassword, this.signInLink, this.button);\r\n this.container.appendChild(this.form);\r\n }", "title": "" }, { "docid": "b9fec8739f8454159caab6872c364a9f", "score": "0.63104737", "text": "function showRegisterForm(){\n $('.loginBox').fadeOut('fast',function(){\n $('.registerBox').fadeIn('fast');\n $('.login-footer').fadeOut('fast',function(){\n $('.register-footer').fadeIn('fast');\n });\n $('.modal-title').html('Register with');\n }); \n $('.error').removeClass('alert alert-danger').html('');\n \n}", "title": "" }, { "docid": "306055ad97739ce9c68e92f0cda276e7", "score": "0.6303117", "text": "function register(userInfo) {\n var form = document.querySelector(\"form\");\n Babble.register(userInfo);\n sendRequestToServer('GET', 'login', null,\n function(e) {\n var userId = e.id;\n document.querySelector('.modal-popup').style.visibility = 'hidden';\n }, function() {\n register(userInfo);\n });\n}", "title": "" }, { "docid": "0d804b9f50398e94dd020440bf260d6a", "score": "0.62977445", "text": "function modalNuevaAltaReg() {\n $('#contratoDetallesmodal').modal();\n $('#form-registrar').modal('hide');\n limpiarNuevosDatosAltaReg();\n validacionNuevaAltaReg();\n $('#btnAgregarContrato').prop('disabled', false);\n}", "title": "" }, { "docid": "5738357e28276f7f55e951e68696ee74", "score": "0.62966716", "text": "function activateSignUp() {\n // initialize modal element\n var modalEl = document.createElement('div');\n modalEl.style.width = '28em';\n modalEl.style.height = '28em';\n modalEl.style.margin = '100px auto';\n modalEl.style.backgroundColor = '#fff';\n \n modalEl.innerHTML = `<div class='mui-container-fluid' style='padding-top: 3em;'>` + `<div class='mui-row'>` + `<div class='mui-col-md-8 mui-col-md-offset-2'>` +\n `<form class='mui-form'>\n <legend>Sign Up</legend>\n <div class='mui-textfield mui-textfield--float-label'>\n <input type='text' name='muser' id='muser'>\n <label for='muser'>Email</label>\n </div>\n <p id='emailerr' style='color:red;'></p>\n\n <div class='mui-textfield mui-textfield--float-label'>\n <input type='password' name='mpass' id='mpass'>\n <label for='mpass'>Password</label>\n </div>\n <p id='passerr' style='color:red;'></p>\n\n <div class='mui-textfield mui-textfield--float-label'>\n <input type='password' name='cpass' id='cpass'>\n <label for='cpass'>Confirm Password</label>\n </div>\n <p id='matcherr' style='color:red;'></p>\n</form> \n<button type='submit' class='mui-btn mui-btn--raised' id='btnSignUp' onclick='submitFunc()'>Submit</button>\n<button type='cancel' class='mui-btn mui-btn--raised' id='btncancel' onclick='cancelFunc()'>Cancel</button>\n</div></div></div>`;\n\n // show modal\n mui.overlay('on', modalEl);\n}", "title": "" }, { "docid": "9b4dbd22ccc6ccbca5773b542345d3b9", "score": "0.62898225", "text": "function showRegisterForm() {\n const data = document.querySelector(\"#btn-register\");\n data.addEventListener(\"click\", (event) => {\n event.preventDefault();\n const dataShow = document.querySelector(\"#form-register\");\n const login = document.querySelector(\"#form-login\");\n const removeMessage = document.querySelector(\"#message-show p\");\n if (removeMessage) removeMessage.remove(); // Elimina el contenido del div de mostrar errores\n login.classList.remove(\"d-flex\");\n login.classList.add(\"d-none\");\n dataShow.classList.remove(\"d-none\");\n dataShow.classList.add(\"d-flex\");\n });\n}", "title": "" }, { "docid": "654d0108092367f38e6d6f2223e779f1", "score": "0.62719184", "text": "function exibirCadastrarEntregador(){\r\n\t $('#editar_entregador').modal('show');\r\n }", "title": "" }, { "docid": "1ad21406bf607963f9ca2fa53112b385", "score": "0.6246153", "text": "function showRegisterForm(){\n $('.loginBox').fadeOut('fast',function(){\n $('.registerBox').fadeIn('fast');\n $('.login-footer').fadeOut('fast',function(){\n $('.register-footer').fadeIn('fast');\n });\n $('.modal-title').html('Create Your Free Account');\n }); \n $('.error').removeClass('alert alert-danger').html('');\n \n}", "title": "" }, { "docid": "46a6d42ce3bdd1c7e5e7c7878d006b3a", "score": "0.624578", "text": "function MostrarFormAgregarHerramientas(){\n \n $(\"#ModalAgregarMaterial\").modal('show');\n \n \n}", "title": "" }, { "docid": "e34432137418a81b241e319f5022a8f9", "score": "0.624077", "text": "register() {\n this.form.loading = true;\n const user = accountTransformer.send(this.form.data());\n userService.store(user)\n .then(() => {\n this.showModalCreate = false;\n this.form.resetFields();\n this.all(1, 50);\n this.loading = false;\n })\n .catch((errors) => {\n this.form.loading = true;\n this.form.recordErrors(errors);\n });\n }", "title": "" }, { "docid": "8a94f23357ace34674089d0335631f01", "score": "0.6239572", "text": "function openModalPerfil() {\n $(\"#modalFormPerfilUsuario\").modal(\"show\");\n}", "title": "" }, { "docid": "fb54dc4b93042b16afbabe98f68967ea", "score": "0.6237573", "text": "function changeOwnPasswordModal() {\n $('#modChangePassword').modal('show');\n}", "title": "" }, { "docid": "2e31809d9e4d23c1ecec94132a5a71ef", "score": "0.6204263", "text": "function showRegisterBox() {\n\tdocument.getElementById(\"loginBox\").style.display = \"none\";\n\tdocument.getElementById(\"registerBox\").style.display = \"block\";\n\tdocument.getElementById(\"registerUserName\").focus();\n}", "title": "" }, { "docid": "dea38c25bb75d0d5dee0510c2c132bc3", "score": "0.618821", "text": "_handleSignUpClick() {\n $('Button#sign-up-btn').click((e) => {\n const signupModal = new SignUpModal('signup-modal-form');\n });\n }", "title": "" }, { "docid": "98fb656e6886a52d5b65623d0d13fc12", "score": "0.6159455", "text": "function showRegisterUserForm(callback) {\n\n\n updateMasterForm = callback;\n\n // Manage the form container\n $(\"<DIV id='form' ></DIV>\").addClass(\"popupForm\").css({ 'width': '425px', 'height': '350px', 'top': '75px', 'left': '100px' }).appendTo('body');\n $(\"<DIV id='header' ></DIV>\").appendTo('#form');\n $(\"<p></p>\").addClass(\"pageHeader\").text('Register User').appendTo('#header');\n\n\n\n // Add the row containing the name input box a\n $(\"<DIV id='UsernameRowContainer' ></DIV>\").addClass(\"formRow\").appendTo('#form');\n // Add the name label and input text box\n $(\"<DIV id='UsernameLabelContainer' ></DIV>\").addClass(\"labelColumn\").appendTo('#UsernameRowContainer');\n $(\"<P>Username</p>\").appendTo('#UsernameLabelContainer');\n $(\"<DIV id='UsernameInputContainer' ></DIV>\").addClass(\"inputColumn\").css({ 'left': '150px' }).appendTo('#UsernameRowContainer');\n $(\"<INPUT type='text' id='txtUsername' ></INPUT>\").addClass(\"formTextBox\").appendTo(\"#UsernameInputContainer\");\n\n\n // Add the row containing the Contact name input box a\n $(\"<DIV id='PasswordRowContainer' ></DIV>\").addClass(\"formRow\").appendTo('#form');\n // Add the name label and input text box\n $(\"<DIV id='PasswordLabelContainer' ></DIV>\").addClass(\"labelColumn\").appendTo('#PasswordRowContainer');\n $(\"<P>Password</p>\").appendTo('#PasswordLabelContainer');\n $(\"<DIV id='PasswordInputContainer' ></DIV>\").addClass(\"inputColumn\").css({ 'left': '150px' }).appendTo('#PasswordRowContainer');\n $(\"<INPUT type='text' id='txtPassword' ></INPUT>\").addClass(\"formTextBox\").appendTo(\"#PasswordInputContainer\");\n\n // Add the row containing the Contact alias input box a\n $(\"<DIV id='ConfirmationRowContainer' ></DIV>\").addClass(\"formRow\").appendTo('#form');\n // Add the name label and input text box\n $(\"<DIV id='ConfirmationLabelContainer' ></DIV>\").addClass(\"labelColumn\").appendTo('#ConfirmationRowContainer');\n $(\"<P>Confirmation</p>\").appendTo('#ConfirmationLabelContainer');\n $(\"<DIV id='ConfirmationInputContainer' ></DIV>\").addClass(\"inputColumn\").css({ 'left': '150px' }).appendTo('#ConfirmationRowContainer');\n $(\"<INPUT type='text' id='txtConfirmation' ></INPUT>\").addClass(\"formTextBox\").appendTo(\"#ConfirmationInputContainer\");\n\n\n\n // Add the first row containing the company label and the company combo box box\n $(\"<DIV id='CompanyRowContainer' ></DIV>\").addClass(\"formRow\").appendTo('#form');\n // Add the name lable and input text box\n $(\"<DIV id='CompanyLabelContainer' ></DIV>\").addClass(\"labelColumn\").appendTo('#CompanyRowContainer');\n $(\"<P>Company</p>\").appendTo('#CompanyLabelContainer');\n $(\"<DIV id='companyInput' ></DIV>\").addClass(\"inputColumn\").css({ 'left': '150px' }).appendTo('#CompanyRowContainer');\n $(\"<SELECT id='formCompanyList' ></SELECT>\").addClass(\"basicComboBox\").appendTo(\"#companyInput\");\n\n // Add the active flag container\n $(\"<DIV id='notificationFlagRow' ></DIV>\").addClass(\"formRow\").appendTo('#form');\n $(\"<DIV id='notificationflagLabelContainer' ></DIV>\").addClass(\"labelColumn\").appendTo('#notificationFlagRow');\n $(\"<input type='checkbox' id='notificationFlag' />\").addClass(\"basicCheckBox\").appendTo(\"#notificationflagLabelContainer\")\n $(\"<label for='notificationFlag'>Notify user</label>\").addClass(\"inputColumn\").css({ 'left': '25px', 'width': '250px' }).appendTo(\"#notificationflagLabelContainer\");\n $(\"#notificationFlag\").prop('checked',true);\n\n // Add the navigation bar to the bottom\n $(\"<DIV id='navBar' ></DIV>\").addClass(\"navigationBar\").appendTo('#form');\n $(\"<p id='navParagraph'></p>\").css({ 'text-align': 'center' }).appendTo('#navBar');\n $(\"<button id='btnRegister'></button>\").addClass(\"cellButton\").css({'width':'70px'}).prop('disabled', false).text(\"Register\").appendTo(\"#navParagraph\");\n $(\"<button id='btnCancel'></button>\").addClass(\"cellButton\").css({ 'width': '70px' }).prop('disabled', false).text(\"Close\").appendTo(\"#navParagraph\");\n// $(\"<b></b>\").addClass(\"SelectButton\").text(\"Close\").on(\"click\", closeRegisterUserFormHandler).appendTo(\"#navParagraph\");\n\n // Create the event handlers for teh save and update buttongs\n $(\"#btnRegister\").click(registerUserHandler);\n $(\"#btnCancel\").click(closeRegisterUserFormHandler);\n // $(\"#btnUpdate\").click(updateCompanyHandler);\n\n\n // Load the company data if required\n// if (mode == 'SuperUser') {\n var token;\n\n token = loadCompanyData(refreshCompanyComboData, errorHandler);\n// }\n }", "title": "" }, { "docid": "cc9027000351587eb2f2c135728e897d", "score": "0.6148499", "text": "function confirmaElimUsuario() {\n\t$(\"#modal_confirma_elimina\").modal(\"show\")\n\n}", "title": "" }, { "docid": "97e449833e64588084d66981b7cfda95", "score": "0.6144811", "text": "function show_registerform(){\n\tload_template('registerform.html', {}, function(html){\n\t\t$('#submit-container').html(html);\n\t\t$('#register_form').submit(function() {\n\t\t\t\n\t\t\tvar url = '/users/'; \n\t\t\t$.ajax({\n\t\t\t\ttype: 'PUT',\n\t\t\t\turl: url, \n\t\t\t\tsuccess: login,\n\t\t\t\tdata : {\n\t\t\t\t\tusername: $('#username').val(),\n\t\t\t\t\temail: $('#email').val(),\n\t\t\t\t\tpassword1: $('#password1').val(),\n\t\t\t\t\tpassword2: $('#password2').val()\n\t\t\t\t\t}, \n\t\t\t\tdataType: 'json'\n\t\t\t})\n\t\t\t\n\t\t\treturn false;\n\t\t});\t\n\t});\n\t\n}", "title": "" }, { "docid": "6201ed49c5d79339d0cd5d0747ebc740", "score": "0.6130338", "text": "function agregar() {\r\n // se llama la funcion para limpiar los campos del formulario ubicado ene el modal\r\n limpiarCAmpos();\r\n // se cambian los botones del modal para mejor funcionabilidad\r\n $(\".modal-footer\").html(`<button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">Cerrar</button>\r\n <button type=\"button\" class=\"btn btn-primary\" onclick=\"guardar()\">Guardar</button>`);\r\n $(\"#modalProductos\").modal(\"show\");\r\n}", "title": "" }, { "docid": "8f633b69fc8b46831dcfc4df9996da9f", "score": "0.6126641", "text": "function Addnewuser(){\n $('#myModalLabel').text('ADD NEW USER');\n }", "title": "" }, { "docid": "5aaf5886ec6c7c0063b07ee6cc454139", "score": "0.6119091", "text": "function showModalAccountDetails(){\n $('#modalAccountDetails').modal('show');\n}", "title": "" }, { "docid": "e8cf3cbe6420f7ba7e402317de53fd65", "score": "0.61058974", "text": "function openadduser(){\n adduserwin = dhtmlmodal.open(\"adduser\", \"iframe\", \"admin/adduser.html\", \"add new user\",\n \"width=460px,height=300px,center=1,resize=0,scrolling=1\", \"recal\");\n\n adduserwin.onclose=function(){ //Run custom code when window is being closed (return false to cancel action):\n return window.confirm(\"Do you want to close this form?\");\n }\n }", "title": "" }, { "docid": "a90dbe668ab59eed30a89494226e8476", "score": "0.6092989", "text": "function showLoginForm() {\n $('#loginModal .registerBox').fadeOut('fast', function() {\n $('.loginBox').fadeIn('fast');\n $('.register-footer').fadeOut('fast', function() {\n $('.login-footer').fadeIn('fast');\n });\n\n $('.modal-title').html('Login with');\n });\n $('.error')\n .removeClass('alert alert-danger')\n .html('');\n}", "title": "" }, { "docid": "a08d9cceae95af0647fcf91ec8132d87", "score": "0.6081734", "text": "function confirmaCancelaUsuario() {\n\t$(\"#modal_confirma_cancela\").modal(\"show\")\n}", "title": "" }, { "docid": "5069c398acf8b128cb4a1a123d23287f", "score": "0.607179", "text": "function handle_register_for_modal_window() {\r\n var register_email = jQuery('#register_email').val();\r\n var register_user = jQuery('#register_user').val();\r\n\r\n if(td_mod_pattern_email.test(register_email) && register_user){\r\n //empty error display div\r\n //td_modala_empty_err_div();\r\n\r\n modala_add_remove_class(['.td_display_err', 1, \"td_display_msg_ok\"]);\r\n jQuery('.td_display_err').show();\r\n td_modala_write_err_div(td_please_wait);\r\n\r\n //call ajax\r\n td_modala_call_ajax('td_mod_register', register_email, register_user, '');\r\n } else {\r\n jQuery('.td_display_err').show();\r\n td_modala_write_err_div(td_email_user_incorrect);\r\n }\r\n}", "title": "" }, { "docid": "0c7ab06be8ed75197a473847ff4c2981", "score": "0.606098", "text": "function showLogin(){\n $(\"#logModal\").modal(\"show\");\n}", "title": "" }, { "docid": "ca8686eacd4f6b6b2646137a7d9ff50e", "score": "0.60578954", "text": "function showSignup() {\n deleteErrorSuccessBox(dom.errorBoxERROR);\n dom.signUpBox.style.display = \"block\";\n}", "title": "" }, { "docid": "eb30c7836ee7113707426c0843e433a3", "score": "0.6054784", "text": "function signup()\n{\n // Hide all login fields\n hideOrShow('log-in', false);\n hideOrShow('Signup-btn', false);\n hideOrShow('Login-btn', false);\n\n // Show all Sign up fields\n hideOrShow('sign-up', true);\n\n}", "title": "" }, { "docid": "67ca063623e592399cf2e224c31a59d0", "score": "0.60286206", "text": "function showAccountDetails() {\n $('#modal').modal('show');\n modalTitle('Account Details');\n\n //utils.showMessage('Loading account details, please be patient!', 'thumb', 'loading.gif');\n utils.makeRequest(\n \"action=getUser&userId=\" + coreData.currUser.userId,\n function(data){\n if (data != \"\") {\n coreData.currUser = new coreData.User(data.data[0]);\n modalBodyTmpl(\"user-info-tmpl\");\n }\n },\n true\n );\n\n $(\"#save-btn\").hide();\n }", "title": "" }, { "docid": "a913eac77521745e16982f5cb0b887d8", "score": "0.60284734", "text": "function signupButton(){\n hideLoginForm();\n showSignupForm();\n}", "title": "" }, { "docid": "76d5ea9377b21b79874228af86eb4a70", "score": "0.60146123", "text": "function signUpFormShow(){\n document.getElementById('signInModal').className = \"signup\";\n document.getElementById('signinDiv').style.display = \"none\";\n document.getElementById('userSignup').style.display = \"block\";\n}", "title": "" }, { "docid": "aa9b5fd319f03964b7da1f6f64a1bf99", "score": "0.6010187", "text": "function registre(id){\n if(id==\"aqui\"){\n document.getElementById(\"register-form\").style.display=\"block\";\n document.getElementById(\"login-form\").style.display=\"none\";\n }\n else{\n document.getElementById(\"register-form\").style.display=\"none\";\n document.getElementById(\"login-form\").style.display=\"block\";\n }\n }", "title": "" }, { "docid": "0220ae3c24473d6bd6c22aa08f468601", "score": "0.59991366", "text": "function toLogin() {\n\t$(\"#login\").show()\n\t$(\"#register\").hide()\n}", "title": "" }, { "docid": "d112fe48b28fef965317bb4575dcc3a4", "score": "0.59973365", "text": "_showNewEmailModal() {\n this.newEmailModal.show();\n }", "title": "" }, { "docid": "ea654bc5702935d4c034fce098048404", "score": "0.59960085", "text": "navigateToSignUp(){\n\t\tresources.signUpButton().click();\n\t}", "title": "" }, { "docid": "5e66f645869e355d02ce22cd9c80781b", "score": "0.5992476", "text": "loadRegistration(){\n let registerButton = document.querySelector(\".register__button\")\n registerButton.addEventListener(\"click\", clickEvent => {\n renderRegis()\n })\n \n }", "title": "" }, { "docid": "a73d7d4b754ca9432004d99c6498c49c", "score": "0.5992322", "text": "function showLogin() { \n loginModal.$promise.then(loginModal.show);\n }", "title": "" }, { "docid": "122213ff8cb53b1c512e45d10511cb56", "score": "0.5986112", "text": "function registrarContatoPessoas(pes_id){\n $.ajax({\n type: 'get',\n url: '../../pessoas/find/' + pes_id,\n dataType: 'json',\n }).done(function(data){\n if(data){\n $(\"#modalContatoPessoas .doadorName\").html(data.pes_nome);\n $(\"#modalContatoPessoas #formStoreContatoPessoas #ccs_pes_id\").val(data.pes_id);\n } else {\n $(\"#modalContatoPessoas .doadorName\").html(' ');\n $(\"#modalContatoPessoas #formStoreContatoPessoas #ccs_pes_id\").val(0);\n }\n }).fail(function(){\n toastr.remove();\n toastr.error(\"Erro ao pesquisar doador!\");\n });\n $('#modalContatoPessoas').modal('show');\n}", "title": "" }, { "docid": "e41179bdb0f00785b7c4b8be251ffc6e", "score": "0.59837127", "text": "function _open_account_modal(){\n $.post('/v1/api/data/user',{\n data: JSON.stringify({\n id: userData['id'],\n token: userData['token'],\n status: 1,\n })\n }, function (e) {\n console.log(e)\n if(e.status == '00'){\n $('#edit_account_name').val(e.data.name)\n $('#edit_account_email').val(e.data.email)\n $('#edit_account_phone').val(e.data.phone_number)\n $('#edit_account_id').val(e.data.id);\n open_sideform('edit_account_modal');\n }\n }).fail(function(){\n notif('danger', 'Mohon kontak IT Administrator');\n }).done(function(){\n _loading(0);\n });\n}", "title": "" }, { "docid": "3d0f84acbb76868eacbb21ff4dbb767b", "score": "0.59820294", "text": "function register() {\n var form = document.querySelector('.login form');\n if (!form) { return; }\n var userInfo = GetFormContent(form);\n HideSectionLogin();\n Babble.register(userInfo);\n}", "title": "" }, { "docid": "10af0811f829d55135a07f2e049311d0", "score": "0.5956099", "text": "login() {\n window.gigya.accounts.showScreenSet({screenSet: 'Default-RegistrationLogin'});\n }", "title": "" }, { "docid": "5d4ce88a327c328c0f36e8033647eca4", "score": "0.5948565", "text": "function signInFormShow(){\n document.getElementById('signinDiv').style.display = \"block\";\n document.getElementById('userSignup').style.display = \"none\";\n document.getElementById('signInModal').className = \"signin\";\n}", "title": "" }, { "docid": "187d68f7fc027340d5a4baa311321673", "score": "0.5943154", "text": "opnAddNewUserModal() {\n this.setState({ addNewUserModal: true });\n }", "title": "" }, { "docid": "0ca312abd554696f7459efb0083b8e83", "score": "0.59401655", "text": "function showNewTerrModal() {\n $(\"#newTerrModal\").modal();\n }", "title": "" }, { "docid": "345993a2c6811e0c8f142a4280db04ce", "score": "0.59348017", "text": "function modalCreateAccount(){\n $('.popup').html(`<span class=\"i close\"></span><p class=\"tit\">계정 만들기</p>\n <p class=\"msg\">이미 계정이 있으십니까?<a href=\"javascript:modalLogin()\">로그인</a></p>\n <form action=\"#\" method=\"post\"><fieldset>\n <div class=\"txt_field\">\n <label for=\"email\">이메일 주소</label>\n <input type=\"email\" name=\"email\" id=\"email\">\n <p class=\"msg_error\"></p>\n </div>\n <div class=\"txt_field\">\n <label for=\"user_name\">이름</label>\n <input type=\"text\" name=\"user_name\" id=\"user_name\">\n <p class=\"msg_error\"></p>\n </div>\n <div class=\"txt_field\">\n <label for=\"pass\">암호</label>\n <input type=\"password\" name=\"pass\" id=\"pass\">\n <p class=\"msg_error\"></p>\n </div>\n <div class=\"txt_field\">\n <label for=\"chk_pass\">암호 확인</label>\n <input type=\"password\" name=\"chk_pass\" id=\"chk_pass\">\n <p class=\"msg_error\"></p>\n </div>\n </fieldset>\n <div class=\"chkUp_terms\">\n <div class=\"terms_item\">\n <input type=\"checkbox\" name=\"terms1\" id=\"terms1\">\n <label for=\"terms1\">(선택) 이메일 수신에 동의합니다.</label>\n </div>\n <div class=\"terms_item\">\n <input type=\"checkbox\" name=\"terms2\" id=\"terms2\">\n <label for=\"terms2\">(필수) <a href=\"\">사용 약관</a> 및\n <a href=\"\">개인정보보호 정책</a>을 읽었으며 이에 동의합니다.</label>\n </div>\n </div><button class=\"btn g f\">계정 만들기</button></form>`);\n $('.i.close').click(function(){\n $('.modal_login').css('display', 'none');\n location.reload('.modal_login');\n });\n $('input').focus(function(){\n $(this).parent().addClass('active');\n });\n $('input').blur(function(){\n $(this).parent().removeClass('active');\n });\n $('form').submit(function(e){\n e.preventDefault();\n checkInputs();\n if($('#terms2').is(':checked') == false){\n alert(\"필수 항목에 동의해 주십시오.\");\n return false;\n }\n clickBtnCreateAccount();\n })\n $('input').keyup(checkInputs);\n}", "title": "" }, { "docid": "e2b1462ff7eeb562b703eba089212fc1", "score": "0.5919983", "text": "function _openModal() {\n $modal.open({\n animation: true,\n templateUrl: 'thankYouSignup.html',\n controller: ['$modalInstance', '$scope', function($modalInstance, $scope){\n /**\n * Closes the modal\n */\n $scope.close = function(){\n $modalInstance.close();\n }\n }],\n size: 'sm'\n });\n }", "title": "" }, { "docid": "d1702ae9229c54f7f945b01c38ef9c34", "score": "0.5919588", "text": "function addPersonModal(){\n clearInputs(['#form_add_person_name','#form_add_person_email',\n '#form_add_person_phone', '#form_add_person_organisation']);\n\n $('#form_add_person_organisation').prop('selectedIndex', 0);\n $('#form_add_person_organisation').formSelect();\n\n $('#addPersonModal').modal('open');\n}", "title": "" }, { "docid": "a46077047042ecde706f86cede7c2bfb", "score": "0.5913872", "text": "function signUp() {\n props.Close();\n props.signupOpen();\n }", "title": "" }, { "docid": "0a0c8e9128c4cef5d6067aba71bf6579", "score": "0.5905151", "text": "function showLoginModal() {\n var modalInstance = $uibModal.open({\n animation: true,\n ariaLabelledBy: 'modal-title',\n ariaDescribedBy: 'modal-body',\n template : `<div class='modal-content'>\n <div class='modal-header'> \n <h4>Login to FloSports Scoreboard</h4> \n </div>\n <div class='modal-body'>\n <div id=\"firebaseui-auth-container\"></div> \n </div> \n </div>`,\n controller: 'floAuthController',\n controllerAs: 'vm',\n size: 'sm',\n scope: $scope,\n opened: floAuthService.showLogin(floAuthService.firebaseUIConfig)\n });\n\n modalInstance.result.then(function (result) {\n //Flash.clear();\n if (result) {\n onInit();\n } else {\n showLoginModal();\n }\n }, function (reason) {})\n }", "title": "" }, { "docid": "d7bff652201b34c2deca6975d69b7cf0", "score": "0.59001374", "text": "readyModalForInsert() {\n this.clearUser();\n }", "title": "" }, { "docid": "4d9a107c196274ea4e1220a3326750ec", "score": "0.5895261", "text": "function signInModalShow(){\n document.getElementById('signInModal').style.display = \"block\";\n document.getElementById('signinDiv').style.display = \"block\";\n document.getElementById('userSignup').style.display = \"none\";\n document.getElementById('signInModal').className = \"signin\";\n}", "title": "" }, { "docid": "bcb1a9ff58e072e40d1eec4deb3572b8", "score": "0.5887199", "text": "function login_profile1() {\n $('#forgotPassword').modal('hide');\n $('#login').modal('show');\n}", "title": "" }, { "docid": "bcb1a9ff58e072e40d1eec4deb3572b8", "score": "0.5887199", "text": "function login_profile1() {\n $('#forgotPassword').modal('hide');\n $('#login').modal('show');\n}", "title": "" }, { "docid": "bdf5ea8dbe61c658c3e5b7443dc36747", "score": "0.5885894", "text": "function openCustomerForm()\n{\n //rests the supplier form\n document.getElementById(\"customer_form\").reset();\n\n //resets the supplier form save button\n document.getElementById(\"customer_saveBtn\").value=\"\";\n \n document.getElementById(\"customer_header\").innerHTML=\"<i class=\\\"glyphicon glyphicon-plus\\\"></i> Add Customer\";\n document.getElementById(\"customer_saveBtn\").innerHTML=\"Add Customer\";\n //triger the modal\n $('#customer_modal').modal('show'); \n}", "title": "" }, { "docid": "b12edf63595d072b33300639626ca741", "score": "0.58847064", "text": "function openModal() {\n\t//inicializar el modal que sea nuevo rol\n\tdocument.querySelector('#idRol').value = '';//limpiar el value del input hiden del modal\n\tdocument.querySelector('#titleModal').innerHTML = 'Nuevo Rol';\n\tdocument.querySelector('.modal-header').classList.replace('headerUpdate', 'headerRegistrer');\n\tdocument.querySelector('#btnActionForm').classList.replace('btn-info', 'btn-primary');\n\tdocument.querySelector('#btnText').innerHTML = 'Guardar';\n\tdocument.querySelector('#formRol').reset();\n\t$(\"#modalRol\").modal(\"show\");\n}", "title": "" }, { "docid": "6706f406b7ae2e34f029cfe381e73bd0", "score": "0.5880894", "text": "showAuthModal() {\n const nonErroredAuthenticators = this.authenticators.filter((authenticator) => !authenticator.isErrored());\n // if we don't have any authenticators not in an errored stat reset them\n if (nonErroredAuthenticators.length === 0) {\n this.resetAuthenticators();\n }\n this.reset();\n this.showAuthenticatorSelection();\n document.getElementById('ual-modal').style.display = 'block';\n }", "title": "" }, { "docid": "d6344cda7beb442e861c4131746663f2", "score": "0.58759254", "text": "open() {\n return super.open('https://karentenenbaum.github.io/qa-automation-forms/html/register.html');\n }", "title": "" }, { "docid": "3cdc23db0e7459930a7ea52752aa2852", "score": "0.5874584", "text": "async function onRegister(){\n if(password===repeatPassword){\n try{\n await firebase.register(name,email,password)\n setIsModalRegVisible(false)\n // o modal de registro fecha automaticamente ao completar registro\n } catch(error){\n alert(error.message)\n }\n }\n else alert(\"Passwords do not match\")\n }", "title": "" }, { "docid": "a476c77073000a48ff0e1342195c59f7", "score": "0.58730793", "text": "function showRegistrationInfo(info) {\n dom.setInner(\"#email\", info.email);\n\n if (info.returnTo) {\n dom.setInner(\".website\", info.returnTo);\n updateRedirectTimeout();\n dom.show(\".siteinfo\");\n }\n }", "title": "" }, { "docid": "41737f8154d3982329bd2d57a86375ee", "score": "0.58718985", "text": "function addNewEvent() {\n $('#AddEvent').modal('show');\n}", "title": "" }, { "docid": "252dfb3fb0b56a2fd0193c51f4f0f191", "score": "0.5871804", "text": "show_modal(id) {\n this.member_data = this.members[id]\n this.student_email = this.member_data.Student_email\n this.showModal = true\n data.accept_content = this.member_data.Student_name + data.accept_content\n }", "title": "" }, { "docid": "a953261b26cac343a82f023155aa14d2", "score": "0.58714473", "text": "function openModalLookupCreate() {\n\tsetModalLookupModus(true);\n\t\n\t$(\"#modal-lookup\").modal('show');\t\n}", "title": "" }, { "docid": "c086ae440d7454174da53f0b0dcece56", "score": "0.58704597", "text": "openSignupModal() {\n let signupModal = Modal.create(SignupPage);\n this.nav.present(signupModal);\n signupModal.onDismiss(data => {\n /*if(data!=null){\n this.doLogin();\n }*/\n });\n }", "title": "" }, { "docid": "40b2cf298ae5abfe0d28bd425c108d58", "score": "0.58650327", "text": "function registerButtonTapped() {\n Frame.topmost().navigate({\n moduleName: \"drawers/pop/org/register/register-page\"\n });\n}", "title": "" }, { "docid": "b641c7c8d838cccba8e70882b811d26e", "score": "0.5864286", "text": "function ShowCaseRegis(){\n save_method = 'add';\n $(\"#dateregis\").datepicker({\n dateFormat: 'yy-mm-dd'\n });\n $('#formLAID')[0].reset(); // reset form on modals\n $('#ModalCaseRegis').modal('show'); // show bootstrap modal\n $('.modal-title').text('Add new case'); // Set Title to Bootstrap modal title\n }", "title": "" } ]
06a97b8750e447c284e5a25402fbe460
nests all other methods from the base class
[ { "docid": "39ff0d0bcdfd4e08a3e3e96a209ada2b", "score": "0.0", "text": "function eXcell_aced(cell)//the eXcell name is defined here\r\n{ \r\n\tif (cell){ // the default pattern, just copy it\r\n this.cell = cell;\r\n this.grid = this.cell.parentNode.grid;\r\n //eXcell_ed.call(this); //uses methods of the \"ed\" type\r\n }\r\n\tthis.edit=function(){\r\n\t\tthis.cell.atag=(!this.grid.multiLine)?\"INPUT\":\"TEXTAREA\";\r\n\t\tthis.val=this.getValue();\r\n\t\tthis.obj=document.createElement(this.cell.atag);\r\n\t\tthis.obj.setAttribute(\"autocomplete\",\"off\");\r\n\t\tthis.obj.style.height=(this.cell.offsetHeight-(_isIE?4:4))+\"px\";\r\n\t\tthis.obj.className=\"dhx_combo_edit\";\r\n\t\tthis.obj.wrap=\"soft\";this.obj.style.textAlign=this.cell.style.textAlign;\r\n\t\tthis.obj.onclick=function(c){(c||event).cancelBubble=true};\r\n\t\tthis.obj.onmousedown=function(c){(c||event).cancelBubble=true};\r\n\t\tthis.obj.onselectstart=function(c){if(!c){c=event}c.cancelBubble=true};\r\n\t\tthis.obj.value=this.val;\r\n\t\tthis.cell.innerHTML=\"\";\r\n\t\t\r\n\t\tvar _div =document.createElement('div');\r\n\t\t_div.className=\"input_grid\";\r\n\t\t_div.appendChild(this.obj);\r\n\r\n\t\tthis.cell.appendChild(_div);\r\n\t\t\r\n\t\t$('input,select').keypress(function(event) {return event.keyCode != 13;}); \r\n\t\t\r\n\t\t//Object return and set AC\r\n\t\tif(typeof setGridAc == \"function\") setGridAc(this.grid, this.cell);\r\n\r\n\t\t$(this.cell).find('input').focus();\r\n\t\t\r\n\r\n\t\treturn true;\r\n }\r\n\tthis.detach=function(){\r\n // sets the new value\r\n // this.setValue($(this.cell).find('input').val()); \r\n if(typeof $(this.cell).find('input').val() != \"undefined\")\r\n \tthis.setCValue($(this.cell).find('input').val(),$(this.cell).find('input').val()); \r\n \r\n return true; // compares the new and the old values\r\n }\r\n this.setValue=function(val){\r\n this.setCValue(val,val); \r\n }\r\n}", "title": "" } ]
[ { "docid": "b9aa4d3385014ff7c9d31f4788191a29", "score": "0.62055016", "text": "baseMethod() { }", "title": "" }, { "docid": "04ce0271f33b14e8af2b014742189bd3", "score": "0.61767286", "text": "function inheritance() {\n }", "title": "" }, { "docid": "2f83124dd1e6ffd476e099b77d8f2081", "score": "0.5922551", "text": "function SuperclassBare() {}", "title": "" }, { "docid": "d0701f73be0c2da0b30ddad1c01b22f5", "score": "0.5911957", "text": "function subclass() {}", "title": "" }, { "docid": "9ebc6aebde3c70c311645a35b84f68d0", "score": "0.5835484", "text": "function NormalBasicMethod() {\n _super.call(this);\n }", "title": "" }, { "docid": "d8b10c95a60b237f4419ea1e531e4acd", "score": "0.57188463", "text": "poo() {\n super.poo();\n }", "title": "" }, { "docid": "d6b2956e39b0ced2ba2372c20fb2823c", "score": "0.564187", "text": "privateOverriddenMethod() { }", "title": "" }, { "docid": "633252bda1acae2be5db4d63c9b1cb75", "score": "0.5465379", "text": "_superMethod(method, ...args) {\n return this.constructor.__super__[method].apply(this, args);\n }", "title": "" }, { "docid": "d15976a0a7e268e3a5a22bf5a4800ab0", "score": "0.54527473", "text": "walk() {\n super.walk();\n console.log(\"Walk nice in a leash\");\n }", "title": "" }, { "docid": "1e247013ab7d0dcc0818946b28b223bd", "score": "0.5364014", "text": "_method7(){}", "title": "" }, { "docid": "7f02120282c44f6277874db041f9b4cf", "score": "0.5269885", "text": "extend () {}", "title": "" }, { "docid": "801ed3b17fc29c2fd8123cd0974007b2", "score": "0.52630824", "text": "baseSetup() {\n this.scope[this.objectType].push(this);\n }", "title": "" }, { "docid": "0477bf2fadb80af0de37722c914a9cc5", "score": "0.52434546", "text": "function parent(){}", "title": "" }, { "docid": "625fd8852db4d9a69064809d1f65b0ce", "score": "0.52034396", "text": "function _super(superClass, method, args) {\n return superClass.prototype[method].apply(this, args);\n }", "title": "" }, { "docid": "0707e2276203dfe049e92d77ca4d36f7", "score": "0.51803654", "text": "extend() {}", "title": "" }, { "docid": "eb355dff6fec6b6f827245d58cc359b0", "score": "0.5169729", "text": "print(){\n console.log('test from child class');\n }", "title": "" }, { "docid": "f7f0680435a2c16643b47229e6ac77ea", "score": "0.51447994", "text": "function LightingMethodBase() {\n return _super.call(this) || this;\n }", "title": "" }, { "docid": "216bb04041c04d46a928e54fee6a0ca9", "score": "0.51366735", "text": "async setup() {\n throw new Error(\"Must be overridden in child class.\");\n }", "title": "" }, { "docid": "60886ea794d8e0e19e019a1322bb0649", "score": "0.51116085", "text": "advanced() {\n var _super_x = (..._args)=>super.x(..._args)\n , _super_method = (..._args)=>super[\"x\"](..._args)\n , _super_x3 = ()=>super.x\n , _super_method3 = ()=>super[\"x\"]\n , _super_x4 = (_args)=>// property access (assign)\n super.x = _args\n , _super_method4 = (_args)=>// element access (assign)\n super[\"x\"] = _args\n , _super_x5 = ()=>super.x\n , _super_method5 = ()=>super[\"x\"]\n , _super_x6 = (..._args)=>super.x(..._args)\n , _super_method6 = (..._args)=>super[\"x\"](..._args)\n , _super_x7 = (..._args)=>super.x(..._args)\n , _super_method7 = (..._args)=>super[\"x\"](..._args)\n ;\n return _asyncToGenerator(function*() {\n const f = ()=>{\n };\n // call with property access\n _super_x();\n // call with element access\n _super_method();\n // property access (read)\n const a = _super_x3();\n // element access (read)\n const b = _super_method3();\n _super_x4(f);\n _super_method4(f);\n // destructuring assign with property access\n ({ f: _super_x5() } = {\n f\n });\n // destructuring assign with element access\n ({ f: _super_method5() } = {\n f\n });\n // property access in arrow\n (()=>_super_x6()\n );\n // element access in arrow\n (()=>_super_method6()\n );\n // property access in async arrow\n _asyncToGenerator(function*() {\n return _super_x7();\n });\n // element access in async arrow\n _asyncToGenerator(function*() {\n return _super_method7();\n });\n })();\n }", "title": "" }, { "docid": "470e3ee34e11294b2b8c7f669b8848dd", "score": "0.51111823", "text": "function iWillExtend() {\n}", "title": "" }, { "docid": "d723cef80604f0bc868743c99ab1d6ef", "score": "0.510988", "text": "sayHello(){\n super.sayHello() // Using function from parent class\n console.log(\"I\\'m super man !\")\n }", "title": "" }, { "docid": "e74c64fb0256d0d94d966f74cc51d8a5", "score": "0.5093194", "text": "function _super(superClass, method, args) {\n return superClass.prototype[method].apply(this, args);\n }", "title": "" }, { "docid": "ef61ea500d962136f3a6ab2e4efd79c3", "score": "0.50587934", "text": "function _subclassObject(tree, base, extension, extName) {\n\t\t// $.ui.fancytree.debug(\"_subclassObject\", tree, base, extension, extName);\n\t\tfor (var attrName in extension) {\n\t\t\tif (typeof extension[attrName] === \"function\") {\n\t\t\t\tif (typeof tree[attrName] === \"function\") {\n\t\t\t\t\t// override existing method\n\t\t\t\t\ttree[attrName] = _makeVirtualFunction(\n\t\t\t\t\t\tattrName,\n\t\t\t\t\t\ttree,\n\t\t\t\t\t\tbase,\n\t\t\t\t\t\textension,\n\t\t\t\t\t\textName\n\t\t\t\t\t);\n\t\t\t\t} else if (attrName.charAt(0) === \"_\") {\n\t\t\t\t\t// Create private methods in tree.ext.EXTENSION namespace\n\t\t\t\t\ttree.ext[extName][attrName] = _makeVirtualFunction(\n\t\t\t\t\t\tattrName,\n\t\t\t\t\t\ttree,\n\t\t\t\t\t\tbase,\n\t\t\t\t\t\textension,\n\t\t\t\t\t\textName\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t$.error(\n\t\t\t\t\t\t\"Could not override tree.\" +\n\t\t\t\t\t\t\tattrName +\n\t\t\t\t\t\t\t\". Use prefix '_' to create tree.\" +\n\t\t\t\t\t\t\textName +\n\t\t\t\t\t\t\t\"._\" +\n\t\t\t\t\t\t\tattrName\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Create member variables in tree.ext.EXTENSION namespace\n\t\t\t\tif (attrName !== \"options\") {\n\t\t\t\t\ttree.ext[extName][attrName] = extension[attrName];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "b75659dc4b6b70bc8e4a3fa6a46301cb", "score": "0.5056646", "text": "init() {\n const host = this.host\n const rules = this.rules\n const routes = this.routes;\n\n // init build-in lowlevel apis\n ['get', 'post', 'put', 'delete'].forEach(method =>\n this[method] = lowLevel(host, method, rules))\n\n // init custom apis\n Object.keys(routes).forEach(key => {\n let route = routes[key]\n let api = {\n url: typeof(route) === 'string' ? route : route.url\n }\n\n ;['method', 'callback'].forEach(item => {\n if (route[item])\n api[item] = route[item]\n })\n\n this[key] = highLevel(host, api, rules)\n })\n\n return this\n }", "title": "" }, { "docid": "3c5279ffae00a4ec71696d24b74ace32", "score": "0.50555176", "text": "function Base() {\n\n}", "title": "" }, { "docid": "431457f50b2e3dcb8d5dbd04e4a77721", "score": "0.50409687", "text": "function MethodBase() {\n var _this = _super.call(this) || this;\n _this._textures = new Array();\n _this._owners = new Array();\n _this._counts = new Array();\n return _this;\n }", "title": "" }, { "docid": "80f1f2b96b5470bee0a9ef91f692348a", "score": "0.50385755", "text": "extend(method, code) {\n console.log(\"Extending \"+this.content+\"'s \"+method+\" with \"+code.toString());\n let ti = this, m = ti[method];\n return function(){\n console.log(\"Extension of \"+method+\" for \"+ti.content+\" (\"+ti.type+\")\");\n if (m.apply(ti,arguments) == Abort)\n return Abort;\n console.log(\"Extension PROCEEDS (NOT aborted)\");\n return code.apply(ti,arguments);\n }\n }", "title": "" }, { "docid": "3bd8f90baa687a62dae19c4e382c5da6", "score": "0.50357676", "text": "function StructureSubGroup() {\r\n}", "title": "" }, { "docid": "43a0057869209905e3acc5a09aad75bb", "score": "0.50268507", "text": "function initialize(method){\n\t\t//Recursivly execute parent methods.\n\t\tif(method.parent instanceof Function){\n\t\t\tinitialize.apply(this,[method.parent]);\n\t\t\tthis.super = cloneCopy(this,\n\t\t\t\t_(this,this.constructor)\n\t\t\t);\n\t\t}\n\t\tmethod.apply(this, arguments);\n\t}", "title": "" }, { "docid": "e0679664791bf5564939b3846649c9bc", "score": "0.50111395", "text": "_appendChildren(props) {\n/* Declare regexp that will help is determine whether or not the render() method\nhas been overridden or not.... We also need the method's source code to inspect....*/\n let renderRE = /...Markup Here..../g,\n renderFuncSource = this.render.toString()\n// Set props on a class variable...\n // this.props = props\n/* If we don't get a match with the regexp, then the method has been overridden\nwith markup that needs appended ....*/\n if (!renderRE.test(renderFuncSource)) {\n return this.appendChild(\n Node.createNode(\n this.render(\n this.props\n )\n )\n )\n }\n }", "title": "" }, { "docid": "377ac26be535ab7a7b1721e831abf794", "score": "0.5008812", "text": "function _subclassObject(tree, base, extension, extName){\n\t// $.ui.fancytree.debug(\"_subclassObject\", tree, base, extension, extName);\n\tfor(var attrName in extension){\n\t\tif(typeof extension[attrName] === \"function\"){\n\t\t\tif(typeof tree[attrName] === \"function\"){\n\t\t\t\t// override existing method\n\t\t\t\ttree[attrName] = _makeVirtualFunction(attrName, tree, base, extension, extName);\n\t\t\t}else if(attrName.charAt(0) === \"_\"){\n\t\t\t\t// Create private methods in tree.ext.EXTENSION namespace\n\t\t\t\ttree.ext[extName][attrName] = _makeVirtualFunction(attrName, tree, base, extension, extName);\n\t\t\t}else{\n\t\t\t\t$.error(\"Could not override tree.\" + attrName + \". Use prefix '_' to create tree.\" + extName + \"._\" + attrName);\n\t\t\t}\n\t\t}else{\n\t\t\t// Create member variables in tree.ext.EXTENSION namespace\n\t\t\tif(attrName !== \"options\"){\n\t\t\t\ttree.ext[extName][attrName] = extension[attrName];\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4e18eb778df14006a9297e9147872578", "score": "0.50017935", "text": "function baseAll(d) {\n if (d.children) {\n d.children.forEach(baseAll);\n base(d);\n }\n}", "title": "" }, { "docid": "458d52ad2505db3d838794d2397b126b", "score": "0.49884868", "text": "function RunnerBase() {\n}", "title": "" }, { "docid": "b5fce97995ff9a6f0a4ce8fa02c79bdc", "score": "0.49829006", "text": "function Base(){}", "title": "" }, { "docid": "8559338e7d068f66553d82258c33ba36", "score": "0.49810937", "text": "birds(){\n // method body\n }", "title": "" }, { "docid": "7dc4bafb81d979c8a42d3b8f6396ad20", "score": "0.49738318", "text": "displayItems(containerId) {\n console.log(\"called from HappyMeal\");\n //call original method from parent class\n super.displayItems(containerId);\n //call additional method\n this.addSpecial(containerId);\n }", "title": "" }, { "docid": "4b0f346c6eea08041ea699e9a3153b5e", "score": "0.49530292", "text": "function _navigate() {\n throw 'Undefined method. Navigate method needs to be defined by the inheriting objects.';\n}", "title": "" }, { "docid": "bb89c5605fb4a6f43afc478a4d81d009", "score": "0.49484208", "text": "function ExportedMethods () {\n}", "title": "" }, { "docid": "8475146219c80cf215120337d30c5692", "score": "0.49372533", "text": "function Mixin() {\n\t}", "title": "" }, { "docid": "7bf220252ac930947f092139de57f934", "score": "0.49297795", "text": "function _subclassObject(tree, base, extension, extName){\n $.ui.fancytree.debug(\"_subclassObject\", base, extension, extName);\n for(var attrName in extension){\n if(typeof extension[attrName] === \"function\"){\n if(typeof tree[attrName] === \"function\"){\n // override existing method\n tree[attrName] = _makeVirtualFunction(attrName, tree, extension);\n }else if(attrName.charAt(0) === \"_\"){\n // Create private methods in tree.EXTENSION namespace\n tree[extName][attrName] = $.proxy(extension[attrName], tree);\n }else{\n $.error(\"Could not override tree.\" + attrName + \". Use prefix '_' to create tree.\" + extName + \"._\" + attrName);\n }\n }else{\n // Create member variables in tree.EXTENSION namespace\n if(attrName !== \"options\"){\n tree[extName][attrName] = base[attrName];\n }\n }\n }\n}", "title": "" }, { "docid": "39b40f2c35563f086715dcc3dfec96db", "score": "0.49223575", "text": "run() {\n super.run();\n }", "title": "" }, { "docid": "2e693d33a77024c8a87d3af60d7dbca3", "score": "0.49186245", "text": "function BaseAction() { }", "title": "" }, { "docid": "dc1de2eb9663ee00d4466b20378923fc", "score": "0.49124658", "text": "_extendDefaults () {\n super._extendDefaults();\n this._calcPosData();\n }", "title": "" }, { "docid": "60206540ddfb191db30b699e8e86c28f", "score": "0.49096024", "text": "run() {\n throw new Error(\"The run method wasn't overwritten!\");\n }", "title": "" }, { "docid": "0dc730151e0577c872a397c39299c9f6", "score": "0.4908925", "text": "function Helpers() {\r\n }", "title": "" }, { "docid": "77fc197368c1c02a59cb93bc4055de79", "score": "0.48979303", "text": "function visitAllMethods(visitor) {\n\n var classes = clover.pageData.classes;\n for (var i = 0; i < classes.length; i++) {\n var classData = classes[i];\n var methods = classData.methods;\n for (var j = 0; j < methods.length; j++) {\n var method = methods[j];\n visitor(method);\n }\n }\n}", "title": "" }, { "docid": "1467ff775f1fa2b3e6f6e900ba71a4d1", "score": "0.48933014", "text": "surprise(name) {\n throw new Error('This method to be implemented by the sub-class');\n }", "title": "" }, { "docid": "6c763d8731cad7189659792c4b2c0199", "score": "0.48908302", "text": "function Internal(){\n\n\t}", "title": "" }, { "docid": "5f1586d510a19055602ecf5cdecbb471", "score": "0.48894408", "text": "function _super(methodName, args) {\n\n // Keep track of how far up the prototype chain we have traversed,\n // in order to handle nested calls to _super.\n if (!this._superCallObjects) {\n this._superCallObjects = {};\n }\n var currentObject = this._superCallObjects[methodName] || this,\n parentObject = findSuper(methodName, currentObject);\n this._superCallObjects[methodName] = parentObject;\n\n var result = parentObject[methodName].apply(this, args || []);\n delete this._superCallObjects[methodName];\n return result;\n }", "title": "" }, { "docid": "06010261374fcce93529a9b91ba569cb", "score": "0.4888995", "text": "childFunction() {\n // by using super, we can call the parent method\n let message = super.parentFunction();\n console.log(message);\n }", "title": "" }, { "docid": "10ecbd935b81c6d0905799629d638e6e", "score": "0.4867588", "text": "constructor() {\n super(...arguments);\n this.state = this.constructor.getInitialState();\n\n // Need to bind 'this' to all of the methods (functions) of the news_block class. Listing them all individually started\n // to get long, so instead we request all the methods on the 'this' object, and then bind 'this' to them if they're\n // one of our 'get' or 'update' methods\n\n }", "title": "" }, { "docid": "f5707620095e6033a1b0235e28563216", "score": "0.48622715", "text": "introduce() {\n super.introduce();\n console.log('I will turn you into a frog');\n }", "title": "" }, { "docid": "bc5982dd700cb330c952c79b421e2ae9", "score": "0.48493555", "text": "sayHi() {\n // call parent method\n super.say(`Hello ${this.name}`); // (*)\n }", "title": "" }, { "docid": "0377fcbea5ad70cda303bf3213d2cf07", "score": "0.4842064", "text": "walk() {\n console.log(this.name);\n console.log('class method walking ....')\n }", "title": "" }, { "docid": "b710ac1beb28a076d4d32e1b303c5b8e", "score": "0.48340067", "text": "childFunction(){\n // by using super, we can call the parent method\n const message = super.parentFunction();\n console.log(`${message}`);\n }", "title": "" }, { "docid": "ff9884c2cbb5b43dc08b92df9f04a255", "score": "0.48304006", "text": "constructor() {\n // run super eden\n super();\n\n // bind methods\n this.build = this.build.bind(this);\n\n // bind private methods\n this.postUser = this.postUser.bind(this);\n this.postCreate = this.postCreate.bind(this);\n this.postChannel = this.postChannel.bind(this);\n\n // run build method\n this.build();\n }", "title": "" }, { "docid": "b41fc6116af0e0a25e84708e65367fd9", "score": "0.48262805", "text": "function superCall(context, methodName) {\n\t var args = zrUtil.slice(arguments, 2);\n\t return this.superClass.prototype[methodName].apply(context, args);\n\t }", "title": "" }, { "docid": "b41fc6116af0e0a25e84708e65367fd9", "score": "0.48262805", "text": "function superCall(context, methodName) {\n\t var args = zrUtil.slice(arguments, 2);\n\t return this.superClass.prototype[methodName].apply(context, args);\n\t }", "title": "" }, { "docid": "b41fc6116af0e0a25e84708e65367fd9", "score": "0.48262805", "text": "function superCall(context, methodName) {\n\t var args = zrUtil.slice(arguments, 2);\n\t return this.superClass.prototype[methodName].apply(context, args);\n\t }", "title": "" }, { "docid": "b41fc6116af0e0a25e84708e65367fd9", "score": "0.48262805", "text": "function superCall(context, methodName) {\n\t var args = zrUtil.slice(arguments, 2);\n\t return this.superClass.prototype[methodName].apply(context, args);\n\t }", "title": "" }, { "docid": "b41fc6116af0e0a25e84708e65367fd9", "score": "0.48262805", "text": "function superCall(context, methodName) {\n\t var args = zrUtil.slice(arguments, 2);\n\t return this.superClass.prototype[methodName].apply(context, args);\n\t }", "title": "" }, { "docid": "b41fc6116af0e0a25e84708e65367fd9", "score": "0.48262805", "text": "function superCall(context, methodName) {\n\t var args = zrUtil.slice(arguments, 2);\n\t return this.superClass.prototype[methodName].apply(context, args);\n\t }", "title": "" }, { "docid": "b41fc6116af0e0a25e84708e65367fd9", "score": "0.48262805", "text": "function superCall(context, methodName) {\n\t var args = zrUtil.slice(arguments, 2);\n\t return this.superClass.prototype[methodName].apply(context, args);\n\t }", "title": "" }, { "docid": "88c858ea3576f278308446fcb1b21abf", "score": "0.4815721", "text": "getInformacao() {\n // para chamar o metodo sobrescrito utiliza-se a palavra\n // reservada \"super\" e o nome do metodo\n super.getInformacao();\n console.log(`Elevador: ${this.elevador}`);\n }", "title": "" }, { "docid": "9e1ffc188429146c91d3d4286ce29839", "score": "0.48154667", "text": "constructor() {\n super(...arguments);\n }", "title": "" }, { "docid": "496ee4bbf742e4dd98395c72b114b6b0", "score": "0.48127037", "text": "next() {\r\n assert(false, 'Object is trying to call abstract method. Implement it in base class');\r\n }", "title": "" }, { "docid": "143dc1398e3382b0e320f551b1d29c63", "score": "0.48017994", "text": "async process() {\n throw new Error('Implement this method in the derived class')\n }", "title": "" }, { "docid": "731ae3bdb1929cf7f8d5a021e768d043", "score": "0.4792656", "text": "function superCall(context, methodName) {\r\n\t var args = zrUtil.slice(arguments, 2);\r\n\t return this.superClass.prototype[methodName].apply(context, args);\r\n\t}", "title": "" }, { "docid": "b91efcb1db7713e45defeb78cf7f0ce8", "score": "0.47885093", "text": "browse() {\n throw new AnotherClassificationMustImplementMethod()\n }", "title": "" }, { "docid": "28ac5520325b548b0551c934e7165a41", "score": "0.47794086", "text": "constructor() {\n\t super();\n\t }", "title": "" }, { "docid": "a60d554218fbdc68ecf8eecacf52c59b", "score": "0.47789428", "text": "constructor(_extends) {\n super();\n this._extends = _extends;\n }", "title": "" }, { "docid": "b7dd22109510f91861bd309d623002dc", "score": "0.47788197", "text": "function BaseAdapter() {\n }", "title": "" }, { "docid": "f8503ed905b46e17fd7bcb517f7c414e", "score": "0.4767242", "text": "move() {\n super.move(); // This allows to reuse some of the code from the parent class\n console.log(\"circle move\");\n }", "title": "" }, { "docid": "1bca55856ae3a7cc928d9ea6b7819359", "score": "0.47622597", "text": "function inner() {\n console.log(\"line no 11\");\n console.log(this.name);\n }", "title": "" }, { "docid": "af8beeae4b1ca0b5c4dd0366e4b34a22", "score": "0.47548565", "text": "__removeFromFloorplan() {\n //Stub the sub-classes need to implement this functionality\n }", "title": "" }, { "docid": "deaf5abd27331ad23510a7247e675b03", "score": "0.47541502", "text": "_generateMethod () {\n METHODS.forEach(method => {\n /**\n * This function will help the developer at build routes\n * all method defined on http module exist on this function\n * @param {String} path\n * @param {Function} callback\n */\n Ibaro.prototype[method.toLowerCase()] = function (path, ...args) {\n this._requestParams(path, [...args], method)\n return this\n }\n })\n }", "title": "" }, { "docid": "281e6241eb769b25f251a3f3c147148b", "score": "0.47505972", "text": "constructor () {\n // Run super\n super();\n\n }", "title": "" }, { "docid": "c9ff6235cea21e159b922cc4ed21c9e9", "score": "0.47438473", "text": "function modulePrivateMethod () {\n return;\n }", "title": "" }, { "docid": "c3ec337a6b4ff6c4da526c90613095d9", "score": "0.47435084", "text": "extend() {\n Element.prototype.query = function (selector) {\n return this.querySelector(selector);\n }\n\n Element.prototype.queryAll = function (selector) {\n return this.querySelectorAll(selector);\n }\n }", "title": "" }, { "docid": "77e116d4db27a53195cad03df18711da", "score": "0.4740994", "text": "visitSpecial(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "6f27bcf0267a4a56f21e08eb7b91a59f", "score": "0.4739506", "text": "eat(){\r\n super.eat();\r\n console.log(`${this.name} eating Rice`);\r\n }", "title": "" }, { "docid": "5408e4a4de4e5f4b5bfa97220cfdbe11", "score": "0.47278443", "text": "function Parent() {}", "title": "" }, { "docid": "05f051205dbe8f22111e23cb3f8e7208", "score": "0.47263336", "text": "virtualMethod() {\n\n }", "title": "" }, { "docid": "75a337d7942e094b85593bebf48be770", "score": "0.4725477", "text": "_sendOutstandingMethods() {\n var self = this;\n\n if (isEmpty(self._outstandingMethodBlocks)) {\n return;\n }\n\n self._outstandingMethodBlocks[0].methods.forEach(m => {\n m.sendMessage();\n });\n }", "title": "" }, { "docid": "f989ed256741060951277be2fada5d0c", "score": "0.47203046", "text": "constructor(attributes){\n super(attributes);\n //any special methods for the child go here\n }", "title": "" }, { "docid": "940d5b03e217def4206debade468e0d3", "score": "0.47150812", "text": "delegateHandlers (type, parentObj, parentKey, parentObjectArrayBool, obj) {\n if (arguments.length === 5) {\n return this[type](obj, parentObj, parentKey, parentObjectArrayBool);\n }\n return this[type](parentObj, parentKey, parentObjectArrayBool);\n }", "title": "" }, { "docid": "03d72221dd637715c1bc5360e34e93d1", "score": "0.4714117", "text": "function StructureGroup() {\r\n}", "title": "" }, { "docid": "b3908e13fa40c6c32e41943d70f6d140", "score": "0.47076342", "text": "function ChainFrame() {\n // create a Method queue\n this._methodQueue = new MethodQueues(this);\n}", "title": "" }, { "docid": "dac20dc56bf0c528b38c542593014a82", "score": "0.47025833", "text": "static mix(SuperClass) {\n Object.defineProperty(SuperClass.prototype, \"who\", {\n get() {\n if (this.person === \"second\") {\n return Grammar.pronoun(\n \"subjective\",\n this.multiple,\n this.person,\n this.gender\n )\n } else if (this.name) {\n return this.name\n } else {\n return `the ${this.title}`\n }\n },\n })\n\n Object.defineProperty(SuperClass.prototype, \"whose\", {\n get() {\n if (this.person === \"second\") {\n return Grammar.pronoun(\n \"determiner\",\n this.multiple,\n this.person,\n this.gender\n )\n } else {\n return `${this.who}'s`\n }\n },\n })\n\n /** he/she/they/it */\n Object.defineProperty(SuperClass.prototype, \"they\", {\n get() {\n return Grammar.pronoun(\n \"subjective\",\n this.multiple,\n this.person,\n this.gender\n )\n },\n })\n\n /** him/her/them/it */\n Object.defineProperty(SuperClass.prototype, \"them\", {\n get() {\n return Grammar.pronoun(\n \"objective\",\n this.multiple,\n this.person,\n this.gender\n )\n },\n })\n\n /** his/her/their/its */\n Object.defineProperty(SuperClass.prototype, \"their\", {\n get() {\n return Grammar.pronoun(\n \"determiner\",\n this.multiple,\n this.person,\n this.gender\n )\n },\n })\n\n /** his/hers/theirs/its */\n Object.defineProperty(SuperClass.prototype, \"theirs\", {\n get() {\n return Grammar.pronoun(\n \"possessive\",\n this.multiple,\n this.person,\n this.gender\n )\n },\n })\n\n /** himself/herself/themself/itself */\n Object.defineProperty(SuperClass.prototype, \"themself\", {\n get() {\n return Grammar.pronoun(\n \"reflexive\",\n this.multiple,\n this.person,\n this.gender\n )\n },\n })\n }", "title": "" }, { "docid": "bc1b2394beb5951722eaf2f32ff5d041", "score": "0.4702408", "text": "function SubSystem1() {\n this.method1 = function () {\n console.log(\"called SubSystem1.method1\");\n };\n}", "title": "" }, { "docid": "e36f009b5b4b657332025ec427ef52df", "score": "0.46938533", "text": "parentMethod(id){\n console.log(\"#parentMethod=\" + id )\n }", "title": "" }, { "docid": "df74c51f39597b4e5a4eee818ff53b13", "score": "0.46835792", "text": "constructor() { \n BaseResponse.initialize(this);Audit1.initialize(this);\n Audit.initialize(this);\n }", "title": "" }, { "docid": "216c5390c2f8af4aa6396736b6586ed1", "score": "0.46816462", "text": "function BaseClass() {}", "title": "" }, { "docid": "8570591b78a18d9f4406b417a86622b3", "score": "0.46768028", "text": "init() {\n ['post', 'get', 'put', 'patch', 'delete'].forEach((method) => {\n moduleUtils$b.patchModule(\n 'superagent',\n method,\n superagentWrapper\n );\n });\n }", "title": "" }, { "docid": "a00ffa5ae9856e7bcb40eb237d902b62", "score": "0.4676471", "text": "function BaseClass(){}", "title": "" }, { "docid": "a00ffa5ae9856e7bcb40eb237d902b62", "score": "0.4676471", "text": "function BaseClass(){}", "title": "" }, { "docid": "a00ffa5ae9856e7bcb40eb237d902b62", "score": "0.4676471", "text": "function BaseClass(){}", "title": "" }, { "docid": "a9daa7b0202f3ccc9b4a7702a75aab3a", "score": "0.46758783", "text": "traverse(fn) {\n fn(this)\n\n const children = Private(this).__children\n for (let i = 0, l = children.length; i < l; i++) {\n children[i].traverse(fn)\n }\n }", "title": "" }, { "docid": "2fa52c545a61240ebe631c7625879ded", "score": "0.46748006", "text": "function r(e,t){this.topLevelType=e,this.nativeEvent=t,this.ancestors=[]}", "title": "" }, { "docid": "8c15519c11a361135a2129261fe0d81f", "score": "0.46706104", "text": "function ComInheritance(num, lineArr) {\n\n var cp;\n for (i = num; i < lineArr.length; i++) {\n\n if (lineArr[i + 1].includes(\"extends\")) {\n cp = ComInheritance(i + 1);\n\n }\n var mc = MethodCom(i + 1, lineArr);\n //equation to calculate total complexity due to inheritance\n var ci = cp + mc;\n return ci;\n }\n\n\n\n}", "title": "" }, { "docid": "4d9284a606bfcb131d9a30ced564fd23", "score": "0.46689215", "text": "createCustomHelpers() {\n\t\tthis.createInjectHelper();\n\t\tthis.createConfigHelper();\n\t\tthis.createRouteHelper();\n\t\tthis.createTranslateHelper();\n\t\tthis.createDumpHelper();\n\t}", "title": "" } ]
80e03b81600259b24147327a5fe7b3d1
function to handle goals from data
[ { "docid": "13195711c42af0b1c096fe1645f3a48b", "score": "0.0", "text": "handleYourInformationFormData(data){\n this.setState({ creatorData: Object.assign({}, this.state.creatorData, { username: data.username }) });\n this.setState({ creatorData: Object.assign({}, this.state.creatorData, { alterEGO: data.alterEGO }) });\n this.setState({ creatorData: Object.assign({}, this.state.creatorData, { aboutYou: data.aboutYou }) });\n }", "title": "" } ]
[ { "docid": "391b99f87675ce445a481bba8964f656", "score": "0.6011546", "text": "function getGoal () {\n let goals = [\n \"Explore\",\n \"Recover\",\n \"Plunder\",\n \"Destroy\",\n \"Protect\",\n \"Deliver\",\n \"Capture\",\n \"Find/Locate\",\n \"Negotiate\",\n \"Scout\",\n \"Divert\",\n \"Distract\",\n \"Unveil\",\n \"Hide\",\n \"Understand\",\n \"Prove\",\n \"Disprove\",\n \"Steal\",\n \"Infiltrate\",\n \"Rescue\"\n ]\n\n let personObjective = [\n \"Civilian\",\n \"Roll\",\n \"Militia\",\n \"Soldier\",\n \"Scholar\",\n \"Insane genius\",\n \"Fugitive\",\n \"Criminal\",\n \"Spy\",\n \"Traitor\",\n \"Mercenary\",\n `Priest or priestess of ${rollOn(religiousTenents)}`,\n \"Noble\",\n \"Historian\",\n \"Politician\",\n \"Sorcerer\",\n \"Archaeologist\",\n \"Heir/heiress\",\n \"Smuggler\"\n ]\n\n personObjective = personObjective.concat([`Wounded ${rollOn(personObjective)}`])\n personObjective = personObjective.concat([`Royal ${rollOn(personObjective)}`])\n\n let objectives = [\n `an ally who is a ${rollOn(personObjective).toLowerCase()}`,\n `an enemy (${getAntagonist().toLowerCase()})`,\n `identity of a person (${getAntagonist().toLowerCase()})`,\n `${getOpponent().toLowerCase()}`,\n `${getOpponent().toLowerCase()}`,\n `documents or secrets (${rollEither(knowledgeObjective, personObjective).toLowerCase()})`,\n `documents or secrets (${rollEither(knowledgeObjective, personObjective).toLowerCase()})`,\n `${getArtifact().toLowerCase()}`,\n `${getArtifact().toLowerCase()}`,\n `${getLocation().toLowerCase()}`,\n `${getLocation().toLowerCase()}`,\n `an ancient map to ${rollOn(sinister).toLowerCase()}`,\n `an ancient map to ${rollOn(sinister).toLowerCase()}`,\n `an otherworldly creature's body part (${getCreature().toLowerCase()})`,\n `an otherworldly creature's body part (${getCreature().toLowerCase()})`,\n `the current antagonist`,\n `the current antagonist`,\n `${rollOn(cult)}`,\n `${rollOn(cult)}`,\n `a legendary character (${rollOn(legendaryCharacter)})`\n ]\n\n return rollOn(goals) + ' ' + rollOn(objectives)\n}", "title": "" }, { "docid": "0ced4203ee27cdd5bede9a03ebb69db5", "score": "0.59971976", "text": "getGoalAchieved(membr,newAssessment){\n \n// need to iterate throgh the open goals, find goalcategory and goal\n// then compare with latest assessment\n logger.info('Check to see any goals have be accomplished',);\n let attained = false;\n const membrGoals = membr.goals;\n let goalCategory = \"\"\n let goalValue = 0.00;\n let d0 = new Date(newAssessment.date);\n let d1 = d0.valueOf(); \n logger.info('assessment date is ',d0);\n \n // d1 represents the number of seconds since a particular date, 1970\n // this allows for comparison of date objects\n \n // goals are held in a goals array, some will be open others closed.\n // need to iterate through them to find the status of gaols which are open or not achieved yet\n for (let i = 0; i < membrGoals.length; i++) {\n \n if(membrGoals[i].status === \"open\" || membrGoals[i].status === \"not achieved yet, but within timeframe\" ) {\n logger.info('goal status is ',membrGoals[i].status);\n goalCategory = membrGoals[i].goalcategory;\n goalValue = parseFloat(membrGoals[i].goal);\n // once we find a goal that is open or not achieved yet \n // we extract the goal category and the value of the goal\n // the new Assessment the we received has many properties, so we need to loop through each\n // to see if a match with the goal category\n for(let propt in newAssessment){\n\n if (propt === goalCategory) {\n logger.info('Assessment property match found',goalCategory);\n let d22 = new Date(membrGoals[i].Gdate);\n let d2 = d22.valueOf();\n // goal date, which is the target date, is converted to number to allow comparison with Assessment date \n \n if ((parseFloat(newAssessment[propt]) === goalValue) && (d1 <= d2)) {\n \n membrGoals[i].status = \"achieved within time frame\";\n logger.info('goal status ',membrGoals[i].status);\n membrGoals[i].achieveddate = newAssessment.date;\n attained = true;\n \n } else if ((parseFloat(newAssessment[propt]) === goalValue) && (d1 > d2)) {\n \n membrGoals[i].status = \"achieved outside time frame\";\n logger.info('goal status ',membrGoals[i].status);\n membrGoals[i].achieveddate = newAssessment.date;\n attained = true;\n \n }else if ((parseFloat(newAssessment[propt]) !== goalValue) && (d1 < d2)) {\n \n membrGoals[i].status = \"not achieved yet, but within timeframe\";\n logger.info('goal status not ach date ',d2);\n } else {\n logger.info('else d1',d1);\n logger.info('else d2',d2);\n membrGoals[i].status = \"missed target\";\n }\n\n } \n }\n \n }\n }\n return attained\n }", "title": "" }, { "docid": "95f56714489b5014baf0834b5722cb4c", "score": "0.5848384", "text": "function break_down(data,ran){\n if(web_url[ran] == 'https://official-joke-api.appspot.com/jokes/random'){\n raw_data = {\n text_1: data.setup,\n text_2: data.punchline,\n line: 2\n }\n //console.log(raw_data)\n }\n if(web_url[ran] == 'https://api.adviceslip.com/advice'){\n raw_data = {\n text: data.slip.advice,\n line: 1\n }\n //console.log(raw_data)\n }\n if(web_url[ran] == 'https://api.chucknorris.io/jokes/random'){\n raw_data = {\n text: data.value,\n line: 1\n }\n //console.log(raw_data)\n }\n if(web_url[ran] == 'https://quote-garden.herokuapp.com/quotes/random'){\n raw_data = {\n text_1: data.quoteText,\n text_2: data.quoteAuthor,\n line: 2,\n create: true\n }\n //console.log(raw_data)\n }\n set_data(raw_data)\n like_btn_press('normal')\n }", "title": "" }, { "docid": "52de1274588c54d7539276ebcb607937", "score": "0.5846952", "text": "function getGoals(data) {\n let uniqueCountries = [];\n let recordCountry = \"\";\n let recordAvgGoals = 0;\n\n data.forEach(function(teams) {\n if(uniqueCountries.length > 0) {\n let homeCountry = false;\n let awayCountry = false;\n for(let i = 0; i < uniqueCountries.length; i++) {\n if(uniqueCountries[i] === teams['Home Team Name']) homeCountry = true;\n if(uniqueCountries[i] === teams['Away Team Name']) awayCountry = true;\n }\n if(!homeCountry) {\n uniqueCountries.push(teams['Home Team Name']);\n }\n if(!awayCountry) {\n uniqueCountries.push(teams['Away Team Name']);\n }\n } else {\n uniqueCountries.push(teams['Home Team Name']);\n uniqueCountries.push(teams['Away Team Name']);\n }\n });\n // I should now have an array of Unique Country names\n\n for(let country = 0; country < uniqueCountries.length; country++) {\n let gamesTeamPlayed = 0;\n let goalsCounted = data.reduce(function(accumulatedGoals, currentGoals) {\n if(uniqueCountries[country] === currentGoals['Home Team Name']) {\n gamesTeamPlayed++;\n return accumulatedGoals + currentGoals['Home Team Goals'];\n } else if(uniqueCountries[country] === currentGoals['Away Team Name']) {\n gamesTeamPlayed++;\n return accumulatedGoals + currentGoals['Away Team Goals'];\n } else {\n return accumulatedGoals + 0;\n }\n }, 0);\n // I should have total Goals and total games played at this point\n if((goalsCounted / gamesTeamPlayed) > recordAvgGoals) {\n // New Record! Update variables\n recordCountry = uniqueCountries[country];\n recordAvgGoals = Number(Math.round((goalsCounted / gamesTeamPlayed)+'e2')+'e-2');\n }\n }\n\n return \"\" + recordCountry + \" is the country with the highest average points scored per game at \" + recordAvgGoals + \" points.\";\n}", "title": "" }, { "docid": "4a06b47aea3b5ce682572fb7e3651a53", "score": "0.5842169", "text": "function getGoals(data) {\n const winners = getFinals(data).map((el) => {\n const HomeGoals = data.reduce((sum, elData) => {\n if (elData.Year === el.Year) {\n if (elData[\"Home Team Name\"] === el[\"Home Team Name\"])\n sum += elData[\"Home Team Goals\"];\n else if (elData[\"Away Team Name\"] === el[\"Home Team Name\"])\n sum += elData[\"Away Team Goals\"];\n }\n return sum;\n }, 0);\n\n const HomeAppearances = data.reduce((count, elData) => {\n if (elData.Year === el.Year) {\n if (elData[\"Home Team Name\"] === el[\"Home Team Name\"]) count++;\n else if (elData[\"Away Team Name\"] === el[\"Home Team Name\"]) count++;\n }\n return count;\n }, 0);\n\n const AwayGoals = data.reduce((sum, elData) => {\n if (elData.Year === el.Year) {\n if (elData[\"Home Team Name\"] === el[\"Away Team Name\"])\n sum += elData[\"Home Team Goals\"];\n else if (elData[\"Away Team Name\"] === el[\"Away Team Name\"])\n sum += elData[\"Away Team Goals\"];\n }\n return sum;\n }, 0);\n\n const AwayAppearances = data.reduce((count, elData) => {\n if (elData.Year === el.Year) {\n if (elData[\"Home Team Name\"] === el[\"Away Team Name\"]) count++;\n else if (elData[\"Away Team Name\"] === el[\"Away Team Name\"]) count++;\n }\n return count;\n }, 0);\n\n const HomeGoalsFor = HomeGoals / HomeAppearances;\n const AwayGoalsFor = AwayGoals / AwayAppearances;\n\n if (HomeGoalsFor === AwayGoalsFor)\n return `${el[\"Home Team Name\"]} and ${el[\"Away Team Name\"]} had the same average goals per appearance`;\n else if (HomeGoalsFor > AwayGoalsFor)\n return `In ${el.Year}: ${el[\"Home Team Name\"]} had a better offence with an average goals per appearance of ${HomeGoalsFor}.`;\n else\n return `In ${el.Year}: ${el[\"Away Team Name\"]} had a better offence with an average goals per appearance of ${AwayGoalsFor}.`;\n });\n return winners;\n}", "title": "" }, { "docid": "32888bf6b77829150dcf2dc5724af1ae", "score": "0.5709156", "text": "function proccessData(data) {\n return data.matches.map(match => {\n // 2018-05-26 10:30:44 GMT\n // moment doesnt know what GMT represents\n match.time = moment(\n match.time\n .split(\" \")\n .slice(0, -1)\n .join(\" \")\n );\n function getDuration(str) {\n return moment.duration(`00:${str}`);\n }\n match.duration = getDuration(match.duration);\n match.waitTime = getDuration(match.waitTime);\n // mark Banned players\n match.teams.team1.players = match.teams.team1.players.map(markPlayersBans(match));\n match.teams.team2.players = match.teams.team2.players.map(markPlayersBans(match));\n // tags the match\n // win/loss/draw\n // the map\n // has cheater\n match.chips = [];\n if (match.replayLink) match.chips.push(\"Has Replay\");\n const hasCheater =\n match.teams.team1.players.filter(a => a.bans.isBanned).length > 0 ||\n match.teams.team2.players.filter(a => a.bans.isBanned).length > 0;\n if (hasCheater) match.chips.push(\"Has Banned Players\");\n match.chips.push(match.map.split(\" \")[1], _capFirstLetter(match.result));\n // player names\n const playerNames = [\n ...match.teams.team1.players.map(a => a.name),\n ...match.teams.team2.players.map(a => a.name)\n ];\n match.tags = [\n match.result,\n match.map.split(\" \")[1],\n ...playerNames,\n hasCheater ? \"hasBanned\" : \"noBanned\"\n ].map(a => a.toLowerCase());\n return match;\n });\n}", "title": "" }, { "docid": "6a3c079bb3b5620b2ed255ebcb00defe", "score": "0.5696851", "text": "function getSubgoalInfo(){\n var subgoalList= getSubgoalArrayFromLocal();\n\n var fullEntry = \"\";\n for (var j in subgoalList) {\n var subgoalEntry = [];\n var currSubgoal = subgoalList[j]; //Current Input\n subgoalEntry.push(\"\\n\");\n subgoalEntry.push(\"\\n\"); // new row\n subgoalEntry.push(\"Subgoal \" + (j+1));\n subgoalEntry.push(sanitizeString(currSubgoal.name));\n subgoalEntry.push(\"\\n\"); // new row\n subgoalEntry.push(\"Will the persona have formed this subgoal as a step to their overall goal?\");\n subgoalEntry.push(\"\\n\"); // new row\n subgoalEntry.push(\"Yes\");\n subgoalEntry.push(\"No\");\n subgoalEntry.push(\"Maybe\");\n subgoalEntry.push(\"Why?\");\n subgoalEntry.push(\"\\n\"); // new row\n subgoalEntry.push(currSubgoal.ynm[\"yes\"]);\n subgoalEntry.push(currSubgoal.ynm[\"no\"]);\n subgoalEntry.push(currSubgoal.ynm[\"maybe\"]);\n subgoalEntry.push(sanitizeString(currSubgoal.why));\n subgoalEntry.push(\"\\n\"); // new row\n subgoalEntry.push(\"Subgoal Facets:\");\n subgoalEntry.push(\"\\n\"); // new row\n subgoalEntry.push(\"Motivation\");\n subgoalEntry.push(\"Information Processing\");\n subgoalEntry.push(\"Computer Self Efficacy\");\n subgoalEntry.push(\"Attitude Toward Risk\");\n subgoalEntry.push(\"Tinkering\"); //FIX\n subgoalEntry.push(\"\\n\"); // new row\n subgoalEntry.push(currSubgoal.facetValues[\"motiv\"]);\n subgoalEntry.push(currSubgoal.facetValues[\"info\"]);\n subgoalEntry.push(currSubgoal.facetValues[\"selfE\"]);\n subgoalEntry.push(currSubgoal.facetValues[\"risk\"]);\n subgoalEntry.push(currSubgoal.facetValues[\"tinker\"]);\n subgoalEntry.push(\"\\n\"); // new row\n\n var subgoalString = subgoalEntry.join(\",\");\n // This for loop is really weird --> TODO cleanup\n var currentAction = 0;\n for (var i in currSubgoal.actions) {\n if(i.id !== currentAction) {\n currentAction = i.id;\n console.log(\"action\" + i);\n var actionString = getActionInfo(currSubgoal.actions, j);\n subgoalString = subgoalString + actionString;\n }\n }\n fullEntry = fullEntry + subgoalString;\n }\n // Add any uncompleted action\n // The assumption here is that uncompleted actions will always belong to the last subgoal\n // This assumption may need to be updated later on\n if(localStorage.getItem(\"inMiddleOfAction\")===\"true\" && !localStorage.getItem(\"finishedGM\")){\n console.log(\"middle of action!\");\n var actString = getActionInfo([getVarFromLocal(\"currPreAction\")]);\n fullEntry = fullEntry + actString;\n }\n return fullEntry;\n}", "title": "" }, { "docid": "39942f2f03c01676e968e0bada099405", "score": "0.560959", "text": "function processData(project) {\n var success;\n var fail;\n var miss;\n var upstreamSuccess;\n var upstreamFail;\n var upstreamMiss;\n\n project = project.toLowerCase();\n\n try {\n success = window[project+'Success'];\n fail = window[project+'Fail'];\n miss = window[project+'Miss'];\n } catch (err) {\n success = []; \n fail = [];\n miss = [];\n }\n\n try {\n upstreamSuccess = window['upstream'+project+'Success'];\n upstreamFail = window['upstream'+project+'Fail'];\n upstreamMiss = window['upstream'+project+'Miss'];\n } catch (err) {\n upstreamSuccess = []; \n upstreamFail = [];\n upstreamMiss = []; \n }\n\n var outage = [];\n for (var i=0; i<miss.length; ++i) {\n var date = miss[i][0];\n var found = false;\n for (var j=0; j<success.length; ++j) {\n if (success[j][0] == date) {\n found = true;\n break;\n }\n }\n if (found)\n continue;\n for (var j=0; j<fail.length; ++j) {\n if (fail[j][0] == date) {\n found = true;\n break;\n }\n }\n if (!found)\n outage.push([date,0]);\n }\n var sums = [sum(success),sum(fail),sum(miss)];\n var results = [{label: 'Success', color: '#356AA0', data: success, points: {show: true, symbol: \"triangle\"}}, \n {data: success, color: '#356AA0', lines: {show: true, lineWidth: 2}, curvedLines: {apply: true} },\n\t\t{label: 'Failed', color: '#CD4B4B', data: fail, points: {show: true, symbol: \"square\"}},\n {data: fail, color: '#CD4B4B', lines: {show: true, lineWidth: 2}, curvedLines: {apply: true} },\n\t\t{label: 'Missed', color: '#555', data: miss, points: {show: true, symbol: \"circle\"}},\n {data: miss, color: '#555', lines: {show: true, lineWidth: 2}, curvedLines: {apply: true} },\n\t\t{label: 'Upstream Success', color: '#6755E3', data: upstreamSuccess, points: {show: true, symbol: \"triangle\"}},\n {data: upstreamSuccess, color: '#6755E3', lines: {show: true, lineWidth: 2}, curvedLines: {apply: true} },\n\t\t{label: 'Upstream Failed', color: '#01FCEF', data: upstreamFail, points: {show: true, symbol: \"square\"}},\n {data: upstreamFail, color: '#01FCEF', lines: {show: true, lineWidth: 2}, curvedLines: {apply: true} },\n\t\t{label: 'Upstream Missed', color: '#59DF00', data: upstreamMiss, points: {show: true, symbol: \"circle\"}},\n {data: upstreamMiss, color: '#59DF00', lines: {show: true, lineWidth: 2}, curvedLines: {apply: true} },\n\t\t{label: 'Outage', color: 'RED', data: outage, points: {show: true, symbol: \"exclamation\"}, lines: {show: false}}]\n return [sums,results];\n}", "title": "" }, { "docid": "4b7804707e47576af093e0c3647fb0ac", "score": "0.5560938", "text": "function getGoals(/* code here */) {\n\n /* code here */\n\n}", "title": "" }, { "docid": "4b7804707e47576af093e0c3647fb0ac", "score": "0.5560938", "text": "function getGoals(/* code here */) {\n\n /* code here */\n\n}", "title": "" }, { "docid": "4b7804707e47576af093e0c3647fb0ac", "score": "0.5560938", "text": "function getGoals(/* code here */) {\n\n /* code here */\n\n}", "title": "" }, { "docid": "4b7804707e47576af093e0c3647fb0ac", "score": "0.5560938", "text": "function getGoals(/* code here */) {\n\n /* code here */\n\n}", "title": "" }, { "docid": "ec3ea2ea9846c31faa94a827baa2c0c9", "score": "0.5547678", "text": "function goal(goal_id) {\n yaCounter36635055.reachGoal(goal_id);\n }", "title": "" }, { "docid": "2c3a480b18b851c748e511bb309c4468", "score": "0.554153", "text": "function badDefense(data) {\n let uniqueCountries = [];\n let badCountry = \"\";\n let badGoals = 0;\n \n data.forEach(function(teams) {\n if(uniqueCountries.length > 0) {\n let homeCountry = false;\n let awayCountry = false;\n for(let i = 0; i < uniqueCountries.length; i++) {\n if(uniqueCountries[i] === teams['Home Team Name']) homeCountry = true;\n if(uniqueCountries[i] === teams['Away Team Name']) awayCountry = true;\n }\n if(!homeCountry) {\n uniqueCountries.push(teams['Home Team Name']);\n }\n if(!awayCountry) {\n uniqueCountries.push(teams['Away Team Name']);\n }\n } else {\n uniqueCountries.push(teams['Home Team Name']);\n uniqueCountries.push(teams['Away Team Name']);\n }\n });\n // I should now have an array of Unique Country names\n \n for(let country = 0; country < uniqueCountries.length; country++) {\n let gamesTeamPlayed = 0;\n let goalsCounted = data.reduce(function(accumulatedGoals, currentGoals) {\n if(uniqueCountries[country] === currentGoals['Home Team Name']) {\n gamesTeamPlayed++;\n return accumulatedGoals + currentGoals['Away Team Goals'];\n } else if(uniqueCountries[country] === currentGoals['Away Team Name']) {\n gamesTeamPlayed++;\n return accumulatedGoals + currentGoals['Home Team Goals'];\n } else {\n return accumulatedGoals + 0;\n }\n }, 0);\n // I should have total Goals and total games played at this point\n if((goalsCounted / gamesTeamPlayed) > badGoals) {\n // New Record! Update variables\n badCountry = uniqueCountries[country];\n badGoals = Number(Math.round((goalsCounted / gamesTeamPlayed)+'e2')+'e-2');\n }\n }\n \n return \"\" + badCountry + \" is the country with the highest average points scored against them per game at \" + badGoals + \" points.\";\n}", "title": "" }, { "docid": "096df8227223c5a1033796ad7e96770d", "score": "0.5495633", "text": "function story(step){\n var text;\n\n switch(step){\n case 1:\n text = \"This bubble chart is made based on the PISA 2012 survey data, \\\n which shows the relation between learning time and learning achievement \\\n in math of each country (or district). <br><br>\\\n From this chart, we can see there is no significant relation \\\n between learning time and achievement in general, \\\n but we can find some special countries from this map\"\n break\n case 2:\n text = \"Students in Korea (green stroke) spend time less than \\\n most of the countries but perform very well ( rank fifth ). \\\n However, Students in Chile (red stroke) spend far more time \\\n on learning but perform not quite well.\"\n updateHighlightCountry('korea', thisObj.reservedColors[0])\n updateHighlightCountry('chile', thisObj.reservedColors[2])\n updateICTColor(false)\n break\n case 3:\n text = \"Add one more variable - ICT resource and look again. \\\n This variable shows the information and communication technology resource \\\n students have in each country. <br><br> \\\n I split it into five level from A to E, \\\n A means the highest and E the lowest. With the help of technology, \\\n students may spend less time on learning and get better achievement. <br><br>\\\n In this chart we can see, generally, \\\n the higher the ICT resource a country have, the better their students perform, \\\n which may explain some of the achievement gaps between Korea and Chile. \\\n However, there are still some exceptions.\"\n updateICTColor(true)\n break\n case 4:\n text = \"Let's look at some countries which don't follow the general trend. <br><br>\\\n Students in China Shanghai (green) perform best but only have C-level ICT resource. <br><br>\\\n Students in Qatar (red) have highest ICT resource but still perform poorly, \\\n in the contrast, \\\n students in Vietnam (orange) have lowest ICT resource but perform not bad. <br><br>\\\n Educational researchers may take further research at these particular countries \\\n and see which variables have a greater impact on performance.\"\n updateHighlightCountry('china-shanghai', thisObj.reservedColors[0])\n updateHighlightCountry('vietnam', thisObj.reservedColors[1])\n updateHighlightCountry('qatar', thisObj.reservedColors[2])\n break\n case 5:\n text = \"Now, you can choose the countries you are interested in to highlight \\\n and open or close the ICT resource color hue on your own. <br><br>\\\n Moreover, since there are three subjects in the PISA research (Math, Language, Science), \\\n you can choose to look the other two subjects and adjust all the variables mentioned above. \\\n <br><br> Good luck :)\"\n break\n default:\n $('#pida-data-story').hide()\n $('#pida-control-panel').show()\n\n }\n\n $('#story-content p').html(text)\n\n }", "title": "" }, { "docid": "8ee3e09f3c97da71969c2c3dd526fadc", "score": "0.54717106", "text": "function information(location, response) {\n var regex = new RegExp(location.opponent().toLowerCase());\n for (let d of response.fixtures) {\n var homeTeam = d.homeTeamName.toLowerCase();\n var awayTeam = d.awayTeamName.toLowerCase();\n\n // if (location.opponent().toLowerCase().indexOf('brighton') !== -1) {\n // console.log(location.opponent().toLowerCase());\n // }\n if (location.home() == 'A') {\n\n if (d.result.goalsHomeTeam === null) {\n d.result.goalsHomeTeam = 'N/A ';\n }\n if (d.result.goalsAwayTeam === null) {\n d.result.goalsAwayTeam = ' N/A';\n }\n\n if (regex.test(homeTeam)) {\n text = '<div class=\"infoHeaderLeft\">' + 'Away Result: ' +\n d.homeTeamName + ' vs. ' + d.awayTeamName + '<br/>' + 'Status: ' + d.status + '<br/>' + 'Final Score: ' + d.result.goalsHomeTeam + ':' + d.result.goalsAwayTeam + '</div>';\n break;\n }\n } else {\n if (regex.test(awayTeam)) {\n text = '<div class=\"infoHeaderLeft\">' + 'Home Result: ' +\n d.homeTeamName + ' vs. ' + d.awayTeamName + '<br/>' + 'Status: ' + d.status + '<br/>' + 'Final Score: ' + d.result.goalsHomeTeam + ':' + d.result.goalsAwayTeam + '</div>';\n break;\n }\n }\n }\n return text;\n }", "title": "" }, { "docid": "19b3526273966142867962fca58947db", "score": "0.5457884", "text": "function handle_load_data() {\n if (this.status === 200) {\n data = JSON.parse(this.responseText);\n if (data !== null) {\n last_data = data;\n for (var i=0;i<data.length;i++) {\n var val = data[i].val;\n var label = data[i].label;\n if (label === 'Beam Available') {\n var icon = 'up.png';\n if (val) icon = 'down.png';\n chrome.browserAction.setIcon({'path': icon});\n } else if (label == 'Comment') {\n chrome.browserAction.setTitle({ \n 'title': val\n });\n } else if (label === 'Beam Current') {\n chrome.browserAction.setBadgeText({ \n 'text': Math.round(val).toString()\n });\n }\n }\n return;\n }\n }\n whoops(); // never get here in successful case\n}", "title": "" }, { "docid": "b2a75d7d23c78f2df3ef8b976ce95acc", "score": "0.5451399", "text": "function getWinners(data, getFinals) {\n let winners = []; \n const result = getFinals(data); \n\n // look through each item in result\n // if home team goals > away team goal, push Home Team Name\n // if away team goals > home team goals, push Away Team Name\n // if home team goals === away team goals, check win conditions and push team name\n\n result.forEach(item => {\n // console.log(`${item['Home Team Name']} ${item['Home Team Goals']} ${item['Away Team Name']} ${item['Away Team Goals']}`)\n\n if (item['Home Team Goals'] > item['Away Team Goals']) {\n winners.push(`${item['Home Team Name']}`)\n } else if (item['Away Team Goals'] > item['Home Team Goals']) {\n winners.push(`${item['Away Team Name']}`)\n } else if (item['Home Team Goals'] === item['Away Team Goals']) {\n // console.log(item['Win conditions']); \n let winner = item['Win conditions'].split(' ', 1);\n winners.push(`${winner}`);\n }\n\n });\n\n\n return winners; \n \n}", "title": "" }, { "docid": "05244a60d9828bbaa434018c2e545e4e", "score": "0.5396416", "text": "getStepData({ isBeforeHook, stepLineToKeywordMap, stepLineToPickledStepMap, testStep, testStepAttachments, testStepResult }) {\n const data = {};\n\n if (testStep.sourceLocation) {\n const { line } = testStep.sourceLocation;\n const pickleStep = stepLineToPickledStepMap[line];\n data.arguments = helpers.formatStepArguments(pickleStep.arguments, buildStepArgumentIterator);\n data.keyword = getStepKeyword({pickleStep, stepLineToKeywordMap});\n data.line = line;\n data.name = pickleStep.text;\n } else {\n data.keyword = isBeforeHook ? 'Before' : 'After';\n data.hidden = true;\n }\n if (testStep.actionLocation) {\n data.match = { location: formatLocation(testStep.actionLocation) };\n }\n data.result = { failures: 0, errors: 0, skipped: 0 };\n if (testStepResult) {\n const {exception, status} = testStepResult;\n data.result = Object.assign({}, {status}, data.result);\n if (testStepResult.duration) {\n data.result.duration = testStepResult.duration;\n }\n switch(status) {\n case Status.PASSED:\n break;\n case Status.FAILED:\n if (testStep.sourceLocation) {\n data.result.failures += 1;\n }\n else {\n data.result.errors += 1;\n }\n if (exception) {\n let {name} = exception;\n data.result.error_name = name;\n data.result.error_message = format(exception);\n }\n break;\n case Status.PENDING:\n data.result.failures += 1;\n data.result.error_message = 'Pending';\n data.result.error_name = 'Pending';\n break;\n case Status.UNDEFINED:\n data.result.failures += 1;\n data.result.error_message = `Undefined step. Implement with the following snippet:\\n ${data.keyword.trim()}(/^${data.name}$/, function(callback) {\\n // Write code here that turns the phrase above into concrete actions\\n callback(null, 'pending');\\n });`;\n data.result.error_name = data.result.error_message.split(\"\\n\").shift();\n break;\n case Status.SKIPPED:\n data.result.skipped += 1;\n break;\n case Status.AMBIGUOUS:\n data.result.errors += 1;\n if (exception) {\n data.result.error_message = format(exception);\n }\n break;\n default:\n break;\n }\n }\n if (Object.keys(testStepAttachments).length > 0) {\n data.embeddings = testStepAttachments.map(\n attachment => ({\n data: attachment.data,\n mime_type: attachment.media.type\n })\n );\n }\n return data;\n }", "title": "" }, { "docid": "caeb5623bc13b4bb43b5ae944b249602", "score": "0.539455", "text": "function processData(values) {\n\n let airports = values[0];\n let flights = values[1];\n let yearData = values[2];\n let hourData = values[3];\n let isLineShow = values[4];\n let isAirplaneShow = values[5];\n let isAirportShow = values[6];\n let arrivalShow = values[7];\n let isDelayCount = values[8];\n let airplaneCompany = values[9];\n let selectedDepartureAirport = values[10];\n let selectedArrivalAirport = values[11];\n let selectedCompany = values[12];\n let allairport = values[13];\n\n flights = flights.filter(flight => flight.FL_DATE == yearData);\n if (hourData%2 == 0){\n flights = flights.filter(flight => flight.ARR_TIME >= hourData*50 && flight.DEP_TIME <= hourData*50);\n }\n else{\n flights = flights.filter(flight => flight.ARR_TIME >= hourData*50-20 && flight.DEP_TIME <= hourData*50-20);\n }\n\n<<<<<<< HEAD\n<<<<<<< HEAD\n=======\n test_flights = flights.slice(0, 10)\n w_drawFlight(allairport, test_flights)\n>>>>>>> cdb0e66f9ad063b5afbdb930faec10ee882383ed\n\n // convert airports array (pre filter) into map for fast lookup\n let iata = new Map(allairport.map(node => [node.airport, node]));\n=======\n // test_flights = flights.slice(0, 10)\n // w_drawFlights(allairport, test_flights)\n // w_drawAirplanes(allairport, test_flights, hourData);\n w_drawFlights(allairport, flights)\n w_drawAirplanes(allairport, flights, hourData);\n // convert airports array (pre filter) into map for fast lookup\n let iata = new Map(allairport.map(node => [node.iata, node]));\n // let alliata = new Map(allairport.map(node => [node.iata, node]));\n>>>>>>> cd1f46dd152f1b5a7e94ff1408f8b79e30b3323a\n\n // // remove airports out of bounds\n // let old = airports.length;\n // airports = airports.filter(airport => airport.x >= 0 && airport.y >= 0);\n // console.log(\" removed: \" + (old - airports.length) + \" airports out of bounds\");\n\n\n // // remove airports with NA state\n // old = airports.length;\n // airports = airports.filter(airport => airport.state !== \"NA\");\n // console.log(\" removed: \" + (old - airports.length) + \" airports with NA state\");\n\n // // remove airports without any flights\n // old = airports.length;\n // airports = airports.filter(airport => airport.outgoing > 0 && airport.incoming > 0);\n // console.log(\" removed: \" + (old - airports.length) + \" airports without flights\");\n\n // // sort airports by outgoing degree\n // airports.sort((a, b) => d3.descending(a.outgoing, b.outgoing));\n\n // // keep only the top airports\n // old = airports.length;\n // airports = airports.slice(0, 50);\n // console.log(\" removed: \" + (old - airports.length) + \" airports with low outgoing degree\");\n\n // done filtering airports can draw\n// let selectedtime = 0;\n// let selectedyear = 2012;\n airports = airports.filter(airports => airports.time == hourData && airports.year == yearData);\n //******************************************\n //insert user selection here!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n //please update!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n //important!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n if (arrivalShow == false && isDelayCount == '0'){\n airports.forEach(function(link){\n link.outgoing = link.arrcount;});\n }else if (arrivalShow == true && isDelayCount== '0'){\n airports.forEach(function(link){\n link.outgoing = link.depcount;});\n }else if (arrivalShow == false && isDelayCount == '1'){\n airports.forEach(function(link){\n link.outgoing = link.arrsum;});\n }else {\n airports.forEach(function(link){\n link.outgoing = link.depsum;});\n }\n if (isAirportShow ==true) {\n drawAirports(airports);\n }\n\n // reset map to only include airports post-filter\n // airplaneCompany\n if(selectedDepartureAirport!='all'){\n flights = flights.filter(flight => flight.ORIGIN == selectedDepartureAirport);\n }\n if(selectedArrivalAirport!='all'){\n flights = flights.filter(flight => flight.DEST == selectedArrivalAirport);\n }\n // flights = flights.filter(flight => flight.OP_CARRIER == selectedCompany);\n\n\n// if (selectedArrivalAirport!=null){\n// flights = flights.filter(flight => flight.DEP_TIME <= app.d_time*100 && flight.DEP_TIME > (app.d_time-1)*100);\n// flights = flights.filter(flight => flight.ARR_TIME <= app.a_time*100 && flight.ARR_TIME > (app.a_time-1)*100);\n\n // calculate incoming and outgoing degree based on flights\n // flights are given by airport iata code (not index)\n flights.forEach(function(link) {\n link.source = iata.get(link.ORIGIN);\n link.target = iata.get(link.DEST);\n // link.source.outgoing += link.count;\n // link.target.incoming += link.count;\n });\n\n // filter out flights that are not between airports we have leftover\n\n flights = flights.filter(link => iata.has(link.source.iata) && iata.has(link.target.iata));\n\n\n // console.log(flights);\n // done filtering flights can draw\n \n\n // if (isLineShow == true) {\n // w_drawFlights(airports, flights);\n // }\n\n // // draw airplanes\n // if (isAirplaneShow ==true) {\n // w_drawAirplanes(airports, flights);\n // }\n\n}", "title": "" }, { "docid": "df797de8e5b0ee0f098efeb00a31b9c6", "score": "0.5388164", "text": "function ReadProjectGoalsCallback(data){\r\n rows = data.values;\r\n\r\n\r\n for(var i in rows){\r\n AddProjectRow(data, rows[i][0], rows[i][1], rows[i][2], rows[i][3], rows[i][4]);\r\n }\r\n\r\n}", "title": "" }, { "docid": "6b8874364154be4aabb4b524c225b856", "score": "0.53822345", "text": "function process_getAgentDeals(data, agent_name, condition_year) {\n\n let rows = data.feed.entry;\n let deals = rows.map(row => row);\n\n let agent_deals = [];\n\n deals.forEach(deal => {\n if (deal.gsx$agent.$t === agent_name && deal.gsx$conditionyr.$t === condition_year) {\n agent_deals.push(deal);\n }\n });\n\n display_myDeals(agent_deals);\n count_deals.innerHTML = agent_deals.length;\n}", "title": "" }, { "docid": "da290ad24856cf3bfe0cded7ff4c516f", "score": "0.5380685", "text": "jgq_good(person, team, totals, stats) {\n person.fg += 1;\n person.fa += 1;\n person.tp += 2;\n totals.fg += 1;\n totals.fa += 1;\n\n //increase bench points\n if(!person.starter) {\n stats.benchpts += 1;\n console.log(\"benchpts: \" + stats.benchpts)\n }\n\n // add to score\n if(home) {\n app.home_score += 2;\n score = app.home_score;\n }\n else {\n app.vis_score += 2;\n score = app.vis_score;\n }\n\n totals.tp = score;\n // add to play by play\n app.add_play(`${person.name} made a jump shot`);\n\n var total_attempts = 0;\n var total_fgs = 0;\n for(players = 0; players < team.length; players++)\n {\n total_attempts += (team[players].fa + team[players].a3);\n total_fgs += (team[players].fg + team[players].m3);\n }\n stats.fg = Number.parseFloat((total_fgs/total_attempts)*100).toFixed(2);\n\n // change possession\n if(home) {\n app.vis_possession();\n }\n else {\n app.home_possession();\n }\n }", "title": "" }, { "docid": "43dc72f848560308f636d3495d2ef115", "score": "0.5355203", "text": "_followGoals(response, goalName, intentResolveCB) {\n var convo = this.convoEngine;\n\n var listGoals = (action)=>{debug(`[${action}] goals to meet: `, convo._getGoalsRaw(response));}\n var topGoalWithState = (goalNdx)=>{listGoals('top'); return convo.mostRecentGoalStates(response, goalNdx);}\n var updateGoalState = (goalNdx, goalWithState)=>{listGoals('updateState'); return convo.updateMostRecentGoalStates(response, goalNdx, goalWithState); }\n var removeGoal = (goalName)=>{listGoals(`remove ${goalName}`); convo.clearGoal(response, goalName);}\n var resolveGoal = function(resolveCB, goalNameToResolve) {\n var result = resolveCB(response);\n if (result && result.next)\n result = co(result); // generator return - run the rest of generator [co fortunately allow the genObj as a paramer and not just genFunc]\n else\n result = Promise.resolve(result) // primarily to convert non-promises to promises\n\n return result.then((result)=>{\n if (result!=false) removeGoal(goalNameToResolve);\n });\n };\n // XXXXXXXXXXXXX\n var goalDefQueryable = (goalDef)=>{return goalDef.prompt || goalDef.ask; }\n\n // debug('--> Triggered Goal [_followGoals]: ' + goalName);\n var p = null;\n if (intentResolveCB)\n p = resolveGoal(intentResolveCB, goalName, response);\n else\n p = Promise.resolve();\n\n var moreGoalsToSeek = true;\n var lastGoalWithState = null;\n var goalNdx = -1;\n if (convo.clearAlert) convo.clearAlert('{{unmetGoals}}');\n\n // the core goals loop - following all queued goals until no more\n return p.then(()=>{return utils.promiseWhile(\n ()=>{return response.outputMgr.asked<1 && moreGoalsToSeek == true;},\n ()=>{\n if (response.goalStateChanged) { // reset goal processing\n response.goalStateChanged = false;\n goalNdx = -1;\n }\n goalNdx+=1;\n var goalWithState = topGoalWithState(goalNdx);\n if (!goalWithState || goalWithState == lastGoalWithState) {\n // no need to follow goals if (a) we have nothing queued or (b) the\n // current goals cannot be added or removed\n moreGoalsToSeek=false;\n return Promise.resolve();\n }\n\n var tgtGoalDef = convo.convo.registeredGoals[goalWithState.key];\n lastGoalWithState = goalWithState;\n if (!tgtGoalDef) {\n console.error('ERROR: Goal not defined - ' + goalWithState.key);\n moreGoalsToSeek=false;\n return Promise.resolve();\n }\n\n // debug('--> Trying to meet goal: ' + goalWithState.key);\n // debug('--> registeredGoals: ', convo.convo.registeredGoals);\n // debug('--> tgtGoalDef: ', tgtGoalDef);\n if (tgtGoalDef.resolve) {\n return resolveGoal(tgtGoalDef.resolve, goalWithState.key, response);\n } else if (goalDefQueryable(tgtGoalDef) && goalWithState.queried) {\n debug(`Goal: ${goalWithState.key} -- already queried. Skipping`);\n } else if (goalDefQueryable(tgtGoalDef) && !goalWithState.queried) {\n if (tgtGoalDef.prompt) {\n response.outputMgr.prompt(response, tgtGoalDef.prompt);\n } else if (tgtGoalDef.ask) {\n response.outputMgr.ask(response, tgtGoalDef.ask);\n } else {\n }\n goalWithState.queried = true;\n updateGoalState(goalNdx, goalWithState);\n } else {\n debug(`*** Goal: ${goalWithState.key} -- does not have resolve or prompt`);\n }\n return Promise.resolve();\n })});\n }", "title": "" }, { "docid": "c762064068a6189cd6fbde2b1768f4c2", "score": "0.53476477", "text": "function parseSubgoalArray(){\n var userInput= getSubgoalArrayFromLocal();\n var entry = []; //corresponds to a single row in the csv\n var entries = [];\n\n for (var j in userInput) {\n var currI = userInput[j]; //Current Input\n\n entry = [sanitizeString(currI.name),\n sanitizeString(currI.why),\n currI.ynm[\"yes\"],\n currI.ynm[\"no\"],\n currI.ynm[\"maybe\"],\n currI.facetValues[\"motiv\"],\n currI.facetValues[\"info\"],\n currI.facetValues[\"selfE\"],\n currI.facetValues[\"risk\"],\n currI.facetValues[\"tinker\"],\n ];\n for(var i in currI.actions){\n //get new line and to the right part of csv\n entry.push(\"\\n, , , , , , , , ,\");\n\n //pre action question\n //console.log(\"action name\", currI.actions[i].preAction.why, currI.actions[i].postAction.why)\n entry.push(currI.actions[i].name);\n entry.push(sanitizeString(currI.actions[i].preAction.why));\n entry.push(currI.actions[i].preAction.ynm[\"yes\"]);\n entry.push(currI.actions[i].preAction.ynm[\"no\"]);\n entry.push(currI.actions[i].preAction.ynm[\"maybe\"]);\n entry.push(currI.actions[i].preAction.facetValues[\"motiv\"]);\n entry.push(currI.actions[i].preAction.facetValues[\"info\"]);\n entry.push(currI.actions[i].preAction.facetValues[\"self\"]);\n entry.push(currI.actions[i].preAction.facetValues[\"risk\"]);\n entry.push(currI.actions[i].preAction.facetValues[\"tinker\"]);\n\n //post action question\n entry.push(sanitizeString(currI.actions[i].postAction.why));\n entry.push(currI.actions[i].postAction.ynm[\"yes\"]);\n entry.push(currI.actions[i].postAction.ynm[\"no\"]);\n entry.push(currI.actions[i].postAction.ynm[\"maybe\"]);\n entry.push(currI.actions[i].postAction.facetValues[\"motiv\"]);\n entry.push(currI.actions[i].postAction.facetValues[\"info\"]);\n entry.push(currI.actions[i].postAction.facetValues[\"self\"]);\n entry.push(currI.actions[i].postAction.facetValues[\"risk\"]);\n entry.push(currI.actions[i].postAction.facetValues[\"tinker\"]);\n\n //url currently is about 4X as long as longest cell allowed in excel, so instead just downloading image as part of zip\n //entry.push('\\\"' +currI.actions[i].imgURL+'\\\"');\n\n var newName = currI.actions[i].name;\n if(currI.actions[i].name[0] == \"\\\"\"){\n newName = currI.actions[i].name.slice(1)\n }\n if(currI.actions[i].name[currI.actions[i].name.length-1] == \"\\\"\"){\n newName = newName.slice(0, newName.length-1)\n }\n\n downloadURI(currI.actions[i].imgURL, \"S\"+(1 + parseInt(j))+\"A\"+(1 + parseInt(i))+\"_\"+newName);\n }\n\n if (entry.length != 0) {\n entries.push(entry);\n }\n }\n return entries;\n}", "title": "" }, { "docid": "d0ba7829f4d6a152d612c6f354c20a11", "score": "0.5347263", "text": "function makeDetailedStatistics() {\n var totalTime = 0;\n var totalTimeNoFirst = 0;\n\n if (data.phases.length > 0) {\n totalTime =_.pluck(data.phases, \"duration\").reduce(function(memo, i) {\n return memo + i;\n });\n\n totalTimeNoFirst = _.pluck(_.reject(data.phases, function(phase) {\n return phase.order === 0;\n }), \"duration\").reduce(function(memo, i) {\n return memo + i;\n });\n }\n\n data.phaseDuration = {\n totalTime: totalTime,\n totalTimeNoFirst: totalTimeNoFirst\n };\n\n _.each(data.phases, function(phase) {\n phase.durationPercentage = (phase.duration > 0 && phase.order !== 0)\n ? phase.duration / totalTimeNoFirst * 100 : 0;\n\n phase.durationPercentageTotal = (phase.duration > 0) ? phase.duration / totalTime * 100 : 0;\n });\n\n _.each(data.stories.data, function(story) {\n story.tasks = {\n data: [],\n cntTotal: 0,\n cntDone: 0,\n progress: 0\n };\n\n story.tasks.data = _.filter(data.tasks.data, function(task) {\n return task.storyId === story.id;\n });\n\n story.tasks.cntTotal = story.tasks.data.length;\n\n story.tasks.cntDone = _.reduce(story.tasks.data, function(memo, task) {\n return (task.isDone) ? memo + 1 : memo;\n }, 0);\n\n if (story.tasks.cntDone > 0) {\n story.tasks.progress = Math.round(story.tasks.cntDone / story.tasks.cntTotal * 100);\n }\n });\n\n // Sort stories by tasks progress, story title and priority\n data.stories.data.sort(HelperService.dynamicSortMultiple(\"!tasks.progress\", \"title\", \"priority\"));\n\n /**\n * Iterate fetched sprints and add story data and stories statistics\n * data to it\n */\n _.each(data.sprints.data, function(sprint) {\n sprint.stories = {\n data: [],\n cntTotal: 0,\n cntDone: 0,\n progress: 0\n };\n\n sprint.stories.data = _.filter(data.stories.data, function(story) {\n return story.sprintId === sprint.id;\n });\n\n sprint.stories.cntTotal = sprint.stories.data.length;\n\n sprint.stories.cntDone = _.reduce(sprint.stories.data, function(memo, story) {\n return (story.isDone) ? memo + 1 : memo;\n }, 0);\n\n if (sprint.stories.cntDone > 0) {\n sprint.stories.progress = Math.round(sprint.stories.cntDone / sprint.stories.cntTotal * 100);\n\n if (sprint.stories.cntDone === sprint.stories.cntTotal) {\n data.sprints.cntDone = data.sprints.cntDone + 1;\n }\n }\n });\n\n // Calculate sprints total progress if we have any done sprint\n if (data.sprints.cntDone > 0) {\n data.sprints.progress = Math.round(data.sprints.cntDone / data.sprints.cntTotal * 100);\n }\n\n _.each(data.milestones.data, function(milestone) {\n milestone.stories = {\n data: [],\n cntTotal: 0,\n cntDone: 0,\n progress: 0\n };\n\n milestone.stories.data = _.filter(data.stories.data, function(story) {\n return story.milestoneId === milestone.id;\n });\n\n milestone.stories.cntTotal = milestone.stories.data.length;\n\n milestone.stories.cntDone = _.reduce(milestone.stories.data, function(memo, story) {\n return (story.isDone) ? memo + 1 : memo;\n }, 0);\n\n if (milestone.stories.cntDone > 0) {\n milestone.stories.progress = Math.round(milestone.stories.cntDone / milestone.stories.cntTotal * 100);\n\n if (milestone.stories.cntDone === milestone.stories.cntTotal) {\n data.milestones.cntDone = data.milestones.cntDone + 1;\n }\n }\n });\n\n if (data.milestones.cntDone > 0) {\n data.milestones.progress = Math.round(data.milestones.cntDone / data.milestones.cntTotal * 100);\n }\n }", "title": "" }, { "docid": "39b5b6881719c2b688e679d46ccd7792", "score": "0.53203285", "text": "function generateGoal(goals) {\n return goals[Math.floor(Math.random() * goals.length)];\n }", "title": "" }, { "docid": "1e9acb8cd76dadb2627b8c5f2aa925c5", "score": "0.53187996", "text": "function attributeTeamAndGoals(){\r\n for(var i=0;i<$scope.players.length;i++){\r\n var player = $scope.players[i];\r\n player.played = player.wins + player.draws + player.losses;\r\n player.points = rankingService.points(player);\r\n player.gpm = rankingService.goalsPerMatch(player);\r\n if(_.contains($scope.game.teamA.teammateRefs, player._id)){\r\n player.teamRef = \"A\";\r\n $scope.game.teamA.totalgpm += player.gpm;\r\n $scope.game.teamA.totalpts += player.points;\r\n $scope.game.teamA.totalrating += player.rating;\r\n player.scored = _.reduce($scope.game.teamA.scorersRefs, function(memo, scorerRef){ return player._id == scorerRef ? memo+1 : memo; }, 0);\r\n player.ownGoals = _.reduce($scope.game.teamB.scorersRefs, function(memo, scorerRef){ return player._id == scorerRef ? memo+1 : memo; }, 0);\r\n } else if (_.contains($scope.game.teamB.teammateRefs, player._id)){\r\n player.teamRef = \"B\";\r\n $scope.game.teamB.totalgpm += player.gpm;\r\n $scope.game.teamB.totalpts += player.points;\r\n $scope.game.teamB.totalrating += player.rating;\r\n player.scored = _.reduce($scope.game.teamB.scorersRefs, function(memo, scorerRef){ return player._id == scorerRef ? memo+1 : memo; }, 0);\r\n player.ownGoals = _.reduce($scope.game.teamA.scorersRefs, function(memo, scorerRef){ return player._id == scorerRef ? memo+1 : memo; }, 0);\r\n } else {\r\n player.teamRef = \"N\";\r\n }\r\n }\r\n }", "title": "" }, { "docid": "0fef31a3038a8aee0a0aafb66cd0262b", "score": "0.53137845", "text": "function getAverageGoals(data) {\n let arrayForAverageHome = [];\n let arrayForAverageAway = [];\n let numberWeWantHome = 0;\n let numberWeWantAway = 0;\n\n for(let i = 0; i < data.length; i++)\n {\n arrayForAverageHome.push(data[i][\"Home Team Goals\"]);\n arrayForAverageAway.push(data[i][\"Away Team Goals\"]);\n }\n\n for (let i = 0; i < arrayForAverageHome.length; i++)\n {\n numberWeWantHome += arrayForAverageHome[i];\n numberWeWantAway += arrayForAverageAway[i];\n }\n\n numberWeWantHome = numberWeWantHome / arrayForAverageHome.length;\n numberWeWantAway = numberWeWantAway / arrayForAverageAway.length;\n\n return `The average goal for Home is ${numberWeWantHome} and the average goal for Away is ${numberWeWantAway}!`;\n}", "title": "" }, { "docid": "2fca03ee8419563b9d32f2c5a6e89bed", "score": "0.5310232", "text": "fill_in_data(data) {\n for(let tuple of this.items) { // [stmt, response, emotion]\n let text = tuple[0];\n let name = this.response_name;\n let known_response = data.lookup(text, name).response;\n tuple[1] = known_response;\n }\n }", "title": "" }, { "docid": "191efc6721da70f6e67308b9c858c3d5", "score": "0.52958953", "text": "function processData(data) {\n // console.log(\"here are the games\");\n // console.log(data);\n data.forEach(retrieveSingleGame);\n}", "title": "" }, { "docid": "1e0a00bb271666a7fca9c4f45e270351", "score": "0.52954435", "text": "function dataLoaded(data) {\n // get a random condiment\n randomCondiment = getRandomElement(data.condiments);\n // if the condiment is in plural, change the verb to are\n if (randomCondiment.charAt(randomCondiment.length - 1) === \"s\") {\n verb = \"are \";\n }\n\n // get a random cat\n cat = getRandomElement(data.cats);\n // if verb is are, add an s to the cat name\n if (verb === \"are \") {\n cat += \"s\";\n }\n\n // get a random room\n room = getRandomElement(data.rooms);\n // if the first letter of the room is a vowel, add an to the preposition\n // otherwise add an a\n let firstLetter = room.toLowerCase().charAt(0);\n if (firstLetter === \"a\" || firstLetter === \"e\" || firstLetter === \"i\" || firstLetter === \"o\" || firstLetter === \"u\") {\n preposition += \"an \";\n } else {\n preposition += \"a \";\n }\n}", "title": "" }, { "docid": "421695c4e7c77279f5f27a528cbbbb7b", "score": "0.5291981", "text": "function makeHealthPlan() {\n\tvar actualCalories = totalCalories();\n\tvar idealCalories = idealCaloriesGoal();\n\tif (actualCalories === idealCalories) {\n\t\treturn\"You are on the right track\";\n\t\t\t} if (actualCalories > idealCalories) {\n\t\t\treturn\"No more doughnuts on you\"; \n\t} else {\n\t\treturn \"Lets visit McDonalds\";\n\t}\n \n}", "title": "" }, { "docid": "a5c78bcbdadcac9a8f580c480c58d951", "score": "0.52860117", "text": "createGoal() {\n\n }", "title": "" }, { "docid": "baedcbfb0ce1b51f7b612b0c2db489ce", "score": "0.526737", "text": "function badDefense(data) {\n const losers = getFinals(data).map((el) => {\n const HomeGoalsAgainst = data.reduce((sum, elData) => {\n if (elData.Year === el.Year) {\n if (elData[\"Home Team Name\"] === el[\"Home Team Name\"])\n sum += elData[\"Away Team Goals\"];\n else if (elData[\"Away Team Name\"] === el[\"Home Team Name\"])\n sum += elData[\"Home Team Goals\"];\n }\n return sum;\n }, 0);\n\n const HomeAppearances = data.reduce((count, elData) => {\n if (elData.Year === el.Year) {\n if (elData[\"Home Team Name\"] === el[\"Home Team Name\"]) count++;\n else if (elData[\"Away Team Name\"] === el[\"Home Team Name\"]) count++;\n }\n return count;\n }, 0);\n\n const AwayGoalsAgainst = data.reduce((sum, elData) => {\n if (elData.Year === el.Year) {\n if (elData[\"Home Team Name\"] === el[\"Away Team Name\"])\n sum += elData[\"Away Team Goals\"];\n else if (elData[\"Away Team Name\"] === el[\"Away Team Name\"])\n sum += elData[\"Home Team Goals\"];\n }\n return sum;\n }, 0);\n\n const AwayAppearances = data.reduce((count, elData) => {\n if (elData.Year === el.Year) {\n if (elData[\"Home Team Name\"] === el[\"Away Team Name\"]) count++;\n else if (elData[\"Away Team Name\"] === el[\"Away Team Name\"]) count++;\n }\n return count;\n }, 0);\n\n const HomeGoalsAgainstAvg = HomeGoalsAgainst / HomeAppearances;\n const AwayGoalsAgainstAvg = AwayGoalsAgainst / AwayAppearances;\n\n if (HomeGoalsAgainstAvg === AwayGoalsAgainstAvg)\n return `${el[\"Home Team Name\"]} and ${el[\"Away Team Name\"]} had the same average goals per appearance`;\n else if (HomeGoalsAgainstAvg > AwayGoalsAgainstAvg)\n return `In ${el.Year}: ${el[\"Home Team Name\"]} had a bad defense with an average goals against per appearance of ${HomeGoalsAgainstAvg}.`;\n else\n return `In ${el.Year}: ${el[\"Away Team Name\"]} had a bad defense with an average goals against per appearance of ${AwayGoalsAgainstAvg}.`;\n });\n return losers;\n}", "title": "" }, { "docid": "96a2909151f14c03449b8fd404bb1c6e", "score": "0.5261446", "text": "function companyBotStrategy(data) {\n const newArr = [];\n\n for (let i = 0; i < data.length; i++) {\n if (data[i][1] === 1) {\n newArr.push(data[i][0]);\n }\n }\n\n return newArr.reduce((total, num) => total + num, 0) / newArr.length || 0;\n}", "title": "" }, { "docid": "3d314600567da6a4c7463986022ef81d", "score": "0.5260121", "text": "function ConvertResults(data) {\n if (data.Results === \"Fail\") {\n result.push(3);\n } else if (data.Results === \"Pass w/ Conditions\") {\n result.push(2);\n } else if (data.Results === \"Pass\") {\n result.push(1);\n }\n return result;\n}", "title": "" }, { "docid": "0fdfe595e9e4164515c41719049e44d0", "score": "0.5259415", "text": "function _activityParse(data) {\n $.each(data, function (index, value) {\n value.jsonResponse = JSON.parse(value.rawResponse);\n value.activityTypeInfo = { message: null, icon: null, color: null, date: value.idCreated, statuschange: null };\n //switch (value.activityTypeId) {\n // case 4:\n // value.activityTypeInfo.message = \"was created.\";\n // value.activityTypeInfo.icon = \"zmdi zmdi-star\";\n // value.activityTypeInfo.color = \"blue\";\n // break;\n // case 5:\n // value.activityTypeInfo.message = \"was updated.\";\n // value.activityTypeInfo.icon = \"zmdi zmdi-check-circle\";\n // value.activityTypeInfo.color = \"green\";\n // break;\n // case 6:\n // value.activityTypeInfo.message = \"was deleted.\";\n // value.activityTypeInfo.icon = \"zmdi zmdi-minus-circle\";\n // value.activityTypeInfo.color = \"red\";\n // break;\n // //testing; only activityTypeId 10 works right now, and targetValue = JobStatus\n // default:\n // value.activityTypeInfo.message = \"was changed.\";\n // value.activityTypeInfo.icon = \"zmdi zmdi-check-circle\";\n // value.activityTypeInfo.color = \"green\";\n // break;\n //}\n\n //checking if targetValue matches JobStatus and if so, assigns that id to statuschange.\n for (var i = 0; i < vm.jobStatus.length; i++) {\n if (vm.jobStatus[i].id == value.targetValue.toString()) {\n value.activityTypeInfo.statuschange = vm.jobStatus[i].id;\n break;\n }\n }\n\n switch (value.activityTypeInfo.statuschange) {\n case \"0\":\n value.activityTypeInfo.message = \"You created a job.\";\n value.activityTypeInfo.icon = \"zmdi zmdi-star\";\n value.activityTypeInfo.color = \"blue\";\n break;\n case \"1\":\n value.activityTypeInfo.message = \"The job has been assigned.\";\n value.activityTypeInfo.icon = \"zmdi zmdi-check-circle\";\n value.activityTypeInfo.color = \"green\";\n break;\n case \"2\":\n value.activityTypeInfo.message = \"Your job is on the way!\";\n value.activityTypeInfo.icon = \"zmdi zmdi-check-circle\";\n value.activityTypeInfo.color = \"green\";\n break;\n case \"3\":\n value.activityTypeInfo.message = \"Your job has been completed.\";\n value.activityTypeInfo.icon = \"zmdi zmdi-check-circle\";\n value.activityTypeInfo.color = \"green\";\n break;\n case \"4\":\n value.activityTypeInfo.message = \"Your job is checked in!\";\n value.activityTypeInfo.icon = \"zmdi zmdi-check-circle\";\n value.activityTypeInfo.color = \"green\";\n break;\n case \"6\":\n value.activityTypeInfo.message = \"Your job has been accepted.\";\n value.activityTypeInfo.icon = \"zmdi zmdi-check-circle\";\n value.activityTypeInfo.color = \"green\";\n break;\n case \"7\":\n value.activityTypeInfo.message = \"Your job has been cancelled.\";\n value.activityTypeInfo.icon = \"zmdi zmdi-minus-circle\";\n value.activityTypeInfo.color = \"red\";\n break;\n case \"8\":\n value.activityTypeInfo.message = \"Your job has been rejected.\";\n value.activityTypeInfo.icon = \"zmdi zmdi-minus-circle\";\n value.activityTypeInfo.color = \"red\";\n break;\n }\n\n });\n\n }", "title": "" }, { "docid": "c9ee6d2e43dda9ac54547f78142cec05", "score": "0.52523404", "text": "achieveGoal(goal, currentState, currentPlan, currentOperatorsUsed) {\n log(\n '%c achieveGoal - START:',\n 'background-color: #bada55',\n goal.get('id'),\n currentState.map((proposition) => proposition.get('id')),\n currentPlan,\n currentOperatorsUsed\n );\n\n let nextState = [...currentState]; // clone currentState\n let nextPlan = [...currentPlan]; // clone currentPlan\n let nextOperatorsUsed = [...currentOperatorsUsed];\n\n if (\n nextState\n .map((proposition) => proposition.get('id'))\n .includes(goal.get('id'))\n ) {\n log(\n '%c achieveGoal - END:',\n 'background-color: #bada55',\n true,\n currentState.map((operator) => operator.get('id')),\n currentPlan\n );\n return [true, currentState, currentPlan];\n } else {\n let selections = this.selectOperators(goal, nextState, nextOperatorsUsed);\n if (!isPresent(selections)) {\n // if no selections, failed to reach goal\n log(\n '%c achieveGoal - END (no selections):',\n 'background-color: #bada55',\n false,\n currentState.map((operator) => operator.get('id')),\n currentPlan\n );\n return [false, currentState, currentPlan, currentOperatorsUsed];\n }\n let success = false;\n selections.forEach((operator) => {\n if (!success) {\n // use the first operator that works\n\n [\n success,\n nextState,\n nextPlan,\n nextOperatorsUsed,\n ] = this.applyOperator(\n goal,\n operator,\n nextState,\n nextPlan,\n nextOperatorsUsed\n );\n }\n });\n\n if (success) {\n log(\n '%c achieveGoal - END:',\n 'background-color: #bada55',\n true,\n nextState.map((operator) => operator.get('id')),\n nextPlan\n );\n return [true, nextState, nextPlan, nextOperatorsUsed];\n } else {\n log(\n '%c achieveGoal - END:',\n 'background-color: #bada55',\n false,\n currentState.map((operator) => operator.get('id')),\n currentPlan\n );\n return [false, currentState, currentPlan, currentOperatorsUsed];\n }\n }\n }", "title": "" }, { "docid": "64c5ff8f1700b0b24251056036e9562d", "score": "0.52512836", "text": "function getAverageGoals(data) {\n //For the record, the instructions above did NOT specify this is only for the Final game each year, like all the previous Tasks, so I'll compute for ALL matches\n let homeCounter = 0;\n let awayCounter = 0;\n\n let avgHomeGoals = data.reduce(function(totalGoals, currentGoals) {\n homeCounter++;\n return totalGoals + currentGoals['Home Team Goals'];\n }, 0);\n \n let avgAwayGoals = data.reduce(function(totalGoals, currentGoals) {\n awayCounter++;\n return totalGoals + currentGoals['Away Team Goals'];\n }, 0);\n\n return \"For all games 1930 - current: Average Home Team Goals total \" + Number(Math.round((avgHomeGoals / homeCounter)+'e2')+'e-2') + \" and Average Away Team Goals total \" + Number(Math.round((avgAwayGoals / awayCounter)+'e2')+'e-2');\n}", "title": "" }, { "docid": "b9da13178879fe65ba97afdd851a7650", "score": "0.52472", "text": "postGoal(data) {\n\n return new TotoAPI().fetch('/diet/goal', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(data)\n }).then((response => response.json()));\n }", "title": "" }, { "docid": "3c8f2a434cf06c5951185f07d36ff973", "score": "0.5245884", "text": "function getGoalsSince1930(data, teamInitials) {\n const goals = data.reduce((sum, elData) => {\n if (elData[\"Home Team Initials\"] === teamInitials)\n sum += elData[\"Home Team Goals\"];\n if (elData[\"Away Team Initials\"] === teamInitials)\n sum += elData[\"Away Team Goals\"];\n return sum;\n }, 0);\n\n return goals;\n}", "title": "" }, { "docid": "71065b65e73f37095232f4bec181a423", "score": "0.5243523", "text": "function next2(){\n\tdocument.getElementById(\"loadingWhat\").innerHTML = \"Preparing Data...\";\n\t\n\t//Count up all the badges, and format them\n\tfor(var k = 0; k < badges.length; k++){\n\t\tbadges[k].earned = false;\n\t\tbadges[k].quested = false;\n\t\tswitch(badges[k].difficulty){\n\t\t\tcase \"easy\":unearned[0]++;break;\n\t\t\tcase \"medium\":unearned[1]++;break;\n\t\t\tcase \"hard\":unearned[2]++;break;\n\t\t\tcase \"impossible\":unearned[3]++;break;\n\t\t}\n\t\tunearned[4] ++;\n\t\tunearned[5] += badges[k].points;\n\t}\n\t\n\t//And the user's badges as well\n\tfor(var i = 0; i < userBadges.length; i++){\n\t\tfor(var j = 0; j < badges.length; j++){\n\t\t\tif(userBadges[i].badge_id == badges[j].id){\n\t\t\t\tbadges[j].earned = true;\n\t\t\t\tbadges[j].user = {};\n\t\t\t\tbadges[j].user = userBadges[i];\n\t\t\t\tswitch(badges[j].difficulty){\n\t\t\t\t\tcase \"easy\":earned[0]++;break;\n\t\t\t\t\tcase \"medium\":earned[1]++;break;\n\t\t\t\t\tcase \"hard\":earned[2]++;break;\n\t\t\t\t\tcase \"impossible\":earned[3]++;break;\n\t\t\t\t}\n\t\t\t\tearned[4] ++;\n\t\t\t\tearned[5] += badges[j].points;\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//And the quests...\n\tfor(var i = 0; i < quests.length; i++){\n\t\tfor(var j = 0; j < quests[i].badges.length; j++){\n\t\t\tfor(k = 0; k < badges.length; k++){\n\t\t\t\tif(quests[i].badges[j] == badges[k].id){\n\t\t\t\t\tbadges[k].quested = true;\n\t\t\t\t\tquests[i].badges[j] = badges[k];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\tbadges.reverse();\n\t\n\t//Displays/hides the UI\n\thide(\"load\");\n\thide(\"update\");\n\thide(\"error\");\n\tshow(\"badges\");\n\tshow(\"filter\");\n\tshow(\"sort\");\n\tshow(\"img\");\n\tshow(\"hint\");\n\tif(SCRIPT_ACCESS){show(\"runJS\")}\n\tif(userName != \"SWBB_NOUSER\"){show(\"stats\")}\n\t//setBody(\"countd\", \"Only \"+(1000-badges.length)+\" badges until we have 1000!\");\n\t//show(\"countd\");\n\t\n\t//And run things\n\tdrawBadges();\n\tgetStats();\n\tdrawQuests();\n\thint();\n\tsetInterval(hint, 10000);\n\tupdateSearch();\n\tupdateTexts();\n}", "title": "" }, { "docid": "48553f8c432475f2a1a64cc2406e4262", "score": "0.5235264", "text": "UPDATE_UPRM_ATHLETE_STATISTICS(state) {//TODO------------------------------------------------------------\n let result = [];\n\n for (let athlete in state.uprmRoster) {\n result.push(\n {\n name: (state.uprmRoster[athlete].middle_name === '' ? state.uprmRoster[athlete].first_name + ' ' + state.uprmRoster[athlete].middle_name + ' ' + state.uprmRoster[athlete].last_names : state.uprmRoster[athlete].first_name + ' ' + state.uprmRoster[athlete].last_names),\n number: state.uprmRoster[athlete].number,\n hit: 0,\n strike: 0,\n ball: 0,\n out: 0,\n atBat: 0,\n run: 0,\n homerun: 0,\n runBattedIn: 0,\n strikeOut: 0,\n baseOnBall: 0,\n leftOnBase: 0\n }\n );\n }\n\n // For each game action, update athlete statistics accordingly.\n for (let index in state.gameActions) {\n let currentAction = state.gameActions[index];\n if (currentAction.team !== \"uprm\") {\n continue;\n }\n let athlete_index = -1;\n for (let athlete in state.uprmRoster) {\n if (state.uprmRoster[athlete].key == \"athlete-\" + currentAction.athlete_id) {\n athlete_index = athlete;\n break;\n }\n }\n // Continue when an athlete has been removed.\n if (athlete_index === -1) {\n continue;\n }\n\n switch (currentAction.action_type) {\n case \"Hit\":\n result[athlete_index].hit++;\n break;\n\n case \"Strike\":\n result[athlete_index].strike++;\n break;\n\n case \"Homerun\":\n result[athlete_index].homerun++;\n result[athlete_index].run++;\n result[athlete_index].hit++;\n break;\n\n case \"Run\":\n result[athlete_index].run++;\n break;\n\n case \"AtBat\":\n result[athlete_index].atBat++;\n break;\n\n case \"RunBattedIn\":\n result[athlete_index].runBattedIn++;\n \n break;\n\n case \"LeftOnBase\":\n result[athlete_index].leftOnBase++;\n break;\n\n case \"Ball\":\n result[athlete_index].ball++;\n break;\n\n case \"BaseOnBall\":\n result[athlete_index].baseOnBall++;\n break;\n\n case \"StrikeOut\":\n result[athlete_index].strikeOut++;\n result[athlete_index].out++;\n break;\n\n case \"Out\":\n result[athlete_index].out++;\n break;\n\n default:\n break;\n }\n }\n\n state.uprmAthleteStatistics = result;\n }", "title": "" }, { "docid": "e69e4d0c7bc3f40045a40959daad38ea", "score": "0.5227462", "text": "function goals (laLigaGoals, copaDelReyGoals, championsLeagueGoals) {\n return laLigaGoals + copaDelReyGoals + championsLeagueGoals\n}", "title": "" }, { "docid": "e32bab091ded3e5525c99aa07803235e", "score": "0.5226635", "text": "function processGameData(dataToProcess) {\n\n let team1Score = 0;\n let team2Score = 0;\n let maxRebounds = 0;\n let maxReboundsName = \"\";\n let threePointMax = 0;\n let threePointMaxName = \"\";\n let stats = \"\";\n let totalBlocks = 0;\n\n const teams = [dataToProcess.hls.pstsg, dataToProcess.vls.pstsg];\n stats += \"Game ID: \" + dataToProcess.gid + \" \" + dataToProcess.gdte + \"\\n =====\";\n\n dataToProcess.hls.pstsg.forEach(function(element) {\n\n team1Score += ((element.fgm - element.tpm) * 2) + element.ftm + (element.tpm * 3);\n\n });\n\n dataToProcess.vls.pstsg.forEach(function(element) {\n\n team2Score += ((element.fgm - element.tpm) * 2) + element.ftm + (element.tpm * 3);\n\n });\n\n stats += \"\\n\" + dataToProcess.vls.tc + \" \" + dataToProcess.vls.tn + \" - \" + team1Score;\n stats += \"\\n\" + dataToProcess.hls.tc + \" \" + dataToProcess.hls.tn + \" - \" + team2Score;\n //console.log(stats);\n\n dataToProcess.vls.pstsg.forEach(function(element) {\n\n if((element.oreb + element.dreb) > maxRebounds) {\n\n maxRebounds = element.oreb + element.dreb;\n maxReboundsName = element.fn;\n\n }\n\n });\n\n dataToProcess.hls.pstsg.forEach(function(element) {\n\n if((element.oreb + element.dreb) > maxRebounds) {\n\n maxRebounds = element.oreb + element.dreb;\n maxReboundsName = element.fn + \" \" + element.ln;\n\n }\n\n });\n\n stats += \"\\n\" + \"*Most rebounds: \" + maxReboundsName + \" with \" + maxRebounds;\n\n teams.forEach(function(team){\n team.filter(function(element) {\n\n return element.tpa >= 5;\n\n }).forEach(function(element) {\n\n if((element.tpm / element.tpa) > threePointMax) {\n\n threePointMax = element.tpm / element.tpa;\n threePointMaxName = element.fn + \" \" + element.ln;\n }\n\n });\n });\n\n stats += \"\\n*player with the highest 3 point percentage that took at least 5 shots: \" + threePointMaxName\n + \" at %\" + threePointMax;\n\n teams.forEach(function(team) {\n\n team.forEach(function(player) {\n\n if(player.blk >= 1) {\n\n totalBlocks++;\n\n }\n\n });\n\n });\n\n stats += \"\\n*There were \" + totalBlocks + \" players that had at least one block\";\n\n let badPlayers = \"\\t\" + dataToProcess.vls.tc + \" \" + dataToProcess.vls.tn + \"\\n\";\n dataToProcess.vls.pstsg.filter(function(element) {\n\n return element.tov > element.ast;\n\n }).forEach(function(element) {\n\n badPlayers += \"\\t*\" + element.fn + \" \" + element.ln + \" has an assist to turnover ratio of \" + element.ast + \":\" + element.tov + \"\\n\";\n\n });\n\n stats += \"\\n*Players with more turnovers than assists: \\n\";\n badPlayers += \"\\n\\t\" + dataToProcess.hls.tc + \" \" + dataToProcess.hls.tn + \"\\n\";\n dataToProcess.hls.pstsg.filter(function(element) {\n\n return element.tov > element.ast;\n\n }).forEach(function(element) {\n\n badPlayers += \"\\t*\" + element.fn + \" \" + element.ln + \" has an assist to turnover ratio of \" + element.ast + \":\" + element.tov +\"\\n\";\n\n });\n\n stats += badPlayers;\n console.log(stats);\n\n}", "title": "" }, { "docid": "2071d9ed492f7b0a6d4bdbb84526d2a6", "score": "0.5220041", "text": "jy_good_3(person, team, totals, stats) {\n person.m3 += 1;\n person.a3 += 1;\n person.tp += 3;\n totals.m3 += 1;\n totals.a3 += 1;\n person.fa += 1;\n person.fg += 1;\n totals.fa += 1;\n totals.fg += 1;\n\n //increase bench points\n if(!person.starter) {\n stats.benchpts += 1;\n console.log(\"benchpts: \" + stats.benchpts)\n }\n\n var total_attempts = 0;\n var total_fgs = 0;\n var total_threes_attmept = 0;\n var total_threes = 0;\n for(players = 0; players < team.length; players++)\n {\n total_attempts += (team[players].fa + team[players].a3);\n total_fgs += (team[players].fg + team[players].m3);\n total_threes += team[players].m3;\n total_threes_attmept += team[players].a3;\n }\n stats.fg = Number.parseFloat(total_fgs/total_attempts).toFixed(2);\n stats.tfg = Number.parseFloat(total_threes/total_threes_attmept).toFixed(2);\n if(home) {\n app.home_score += 3;\n score = app.home_score;\n }\n else {\n app.vis_score += 3;\n score = app.vis_score;\n }\n totals.tp = score;\n // add to play by play - VIS\n app.add_play(`${person.name} hit a 3-point jumper`);\n\n // change possession\n if(home) {\n app.vis_possession();\n }\n else {\n app.home_possession();\n }\n }", "title": "" }, { "docid": "c42119327b146b2fb72b79fd150a6db0", "score": "0.52157116", "text": "function testDataProjections(data)\n{\n\tdata.forEach(function(d, index)\n {\n\t\testimatedAdmissionsChance(d);\n\t});\n}", "title": "" }, { "docid": "16dd64c7cbd911165584a18e2061bae9", "score": "0.5212355", "text": "function getAverageGoals(data) {\n const goalsPerMatch = data.map((element, i) => {\n return element[\"Home Team Goals\"] + element[\"Away Team Goals\"];\n });\n\n const averageGoalsPerMatch =\n goalsPerMatch.reduce((sum, element) => {\n return (sum += element);\n }, 0) / goalsPerMatch.length;\n //console.log(goalsPerMatch);\n\n return averageGoalsPerMatch;\n}", "title": "" }, { "docid": "123c64b89e021e569788168a1a8e7811", "score": "0.52087927", "text": "function addGoalsForNeededProjects() {\n var projectButtons = document.getElementsByClassName('projectButton');\n for (var i = 0; i < projectButtons.length; i++) {\n var costText = projectButtons[i].childNodes[1].data;\n costText = costText.replace(')', '').replace('(', '');\n var costs = costText.split(', ');\n for (var j = 0; j < costs.length; j++) {\n var costSplit = costs[j].split(\" \");\n var number = cleanNumber(costSplit[0]);\n var type = costSplit.length > 0 ? costSplit[1] : \"\";\n if (costSplit[0].indexOf(\"$\") > -1 && number > getNumber('funds')) {\n applyGoal(\"funds\", 1);\n applyGoal(\"secValue\", 10);\n }\n if (type == \"ops\" && number > getNumber('maxOps')) {\n applyGoal(\"operations\", 1);\n }\n if (type == \"creat\") {\n applyGoal(\"creativity\", 1);\n }\n }\n }\n }", "title": "" }, { "docid": "fa79c05b50f62af83bf645f7d5980db9", "score": "0.5208394", "text": "UPDATE_OPP_ATHLETE_STATISTICS(state) {//TODO-----------------------------------------------------------------------\n let result = [];\n\n for (let athlete in state.oppRoster) {\n result.push(\n {\n name: state.oppRoster[athlete].name,\n number: state.oppRoster[athlete].number,\n hit: 0,\n strike: 0,\n ball: 0,\n out: 0,\n atBat: 0,\n run: 0,\n homerun: 0,\n runBattedIn: 0,\n strikeOut: 0,\n baseOnBall: 0,\n leftOnBase: 0\n }\n );\n }\n\n // For each game action, update athlete statistics accordingly.\n for (let index in state.gameActions) {\n let currentAction = state.gameActions[index];\n if (currentAction.team !== \"opponent\") {\n continue;\n }\n let athlete_index = -1;\n for (let athlete in state.oppRoster) {\n if (state.oppRoster[athlete].key == \"athlete-\" + currentAction.athlete_id) {\n athlete_index = athlete;\n break;\n }\n }\n\n // Continue when an athlete has been removed.\n if (athlete_index === -1) {\n continue;\n }\n\n switch (currentAction.action_type) {\n case \"Hit\":\n result[athlete_index].hit++;\n break;\n\n case \"Strike\":\n result[athlete_index].strike++;\n break;\n\n case \"Homerun\":\n result[athlete_index].homerun++;\n result[athlete_index].run++;\n result[athlete_index].hit++;\n break;\n\n case \"Run\":\n result[athlete_index].run++;\n break;\n\n case \"AtBat\":\n result[athlete_index].atBat++;\n break;\n\n case \"RunBattedIn\":\n result[athlete_index].runBattedIn++;\n \n break;\n\n case \"LeftOnBase\":\n result[athlete_index].leftOnBase++;\n break;\n\n case \"Ball\":\n result[athlete_index].ball++;\n break;\n\n case \"BaseOnBall\":\n result[athlete_index].baseOnBall++;\n break;\n\n case \"StrikeOut\":\n result[athlete_index].strikeOut++;\n result[athlete_index].out++;\n break;\n\n case \"Out\":\n result[athlete_index].out++;\n break;\n\n default:\n break;\n }\n }\n\n state.oppAthleteStatistics = result;\n }", "title": "" }, { "docid": "5688c5032372be3ba56f26ba27ae6d42", "score": "0.51975054", "text": "function getPhaseProgramDetail(phase, status) {\n status = status.toLowerCase();\n phase = phase.trim().toLowerCase();\n if (status === 'draft') {\n return {\n nextStepTitle: \"What's Next?\",\n nextStepDescription: \"Hold tight. This challenge will be starting soon.\",\n nextStepAction: \"\",\n nextBadgeImg: \"/mf/i/member-program/svg/Show-Your-Skills-06.svg\",\n nextBadgeTitle: \"Next badge\"\n };\n } else if (status === 'active' && phase === 'registration') {\n return {\n nextStepTitle: \"What's Next?\",\n nextStepDescription: \"Register to participate by clicking the Register button. Then when you're ready, click Submit to upload your submission. Keep an eye on the time limit!\",\n nextStepAction: \"\",\n nextBadgeImg: \"/mf/i/member-program/svg/Show-Your-Skills-06.svg\",\n nextBadgeTitle: \"Step One\"\n };\n } else if (status === 'active' && phase === 'submission') {\n return {\n nextStepTitle: \"What's Next?\",\n nextStepDescription: \"Submit to upload your submission. Keep an eye on the time limit!\",\n nextStepAction: \"\",\n nextBadgeImg: \"/mf/i/member-program/svg/Show-Your-Skills-06.svg\",\n nextBadgeTitle: \"Getting Ready\"\n };\n } else if (status === 'active' && phase === 'review') {\n return {\n nextStepTitle: \"What's Next?\",\n nextStepDescription: \"If you got your submission uploaded in time, then it's time to review your peers.\",\n nextStepAction: \"Click Review to start\",\n nextBadgeImg: \"/mf/i/member-program/svg/Show-Your-Skills-06.svg\",\n nextBadgeTitle: \"Break the Finish\"\n };\n } else if (status === 'completed' || status.indexOf('cancelled') != -1) {\n return {\n nextStepTitle: \"What's Next?\",\n nextStepDescription: \"This challenge has completed.\",\n nextStepAction: \"\",\n nextBadgeImg: \"/mf/i/member-program/svg/Show-Your-Skills-06.svg\",\n nextBadgeTitle: \"Break the Finish\"\n };\n } else { // for default show only badge\n return {\n nextStepTitle: \"\",\n nextStepDescription: \"\",\n nextStepAction: \"\",\n nextBadgeImg: \"/mf/i/member-program/svg/Show-Your-Skills-06.svg\",\n nextBadgeTitle: \"Next badge\"\n };\n }\n }", "title": "" }, { "docid": "d5c47045ff2298a6a1ceba92043505d7", "score": "0.5187737", "text": "practice_law(object, talent, time) {\n switch (talent) {\n case 0:\n //console.log('No talent. Just plow the land')\n return 0\n case 1:\n if ((time = 1)) {\n //Returns the quantized strength value\n return 1\n }\n break\n case 2:\n if ((time = 1)) {\n return 2\n }\n break\n case 3:\n if ((time = 1)) {\n return 3\n }\n break\n case 4:\n if ((time = 1)) {\n return 4\n }\n break\n case 5:\n if ((time = 1)) {\n return 5\n }\n break\n }\n }", "title": "" }, { "docid": "80a8cb92807e4d9dbc0932f148b87edb", "score": "0.51833814", "text": "function createCardsGoals(data) {\n\tvar elements = [];\n data.goals.forEach(function(goal) {\n \telements.push(\n MS.genericElements(\n \"Meta \".concat(goal.goal_number), \n goal.name, \n [MS.genericButtonPostback(payloads.PBK_GOAL_SELECTED, goal.goal_number)], \n urls.URL_PROJECTS_IMG\n\t )\n\t );\n });\n return elements;\n}", "title": "" }, { "docid": "c627745dedd95cae4e80365c4d076945", "score": "0.518203", "text": "function goal_status_label(card, trace, ds_r)\n {\n let status = card.color.kind;\n\n if (!status.includes(\"Yellow\") && card.step.kind != \"Inference\")\n return [];\n\n // console.log('goal_status_label', JSON.stringify(card));\n\n let destinations = [];\n let min_step = 99999999;\n let ds_s = -1;\n let ds_g = -1;\n\n let all_attempts = card.step.value.more_successful_attempts.concat(card.step.value.more_failing_attempts);\n\n\n for(var i = 0; i < all_attempts.length; i++) {\n let step_id = all_attempts[i];\n let runt_id = card.runtime_id;\n let goal_ds = [];\n\n goal_ds[0] = step_id;\n\n for(var j = 0; j < trace.length; j++) {\n if(trace[j].step_id == step_id\n && trace[j].runtime_id == runt_id) {\n goal_ds[1] = goal_id(trace[j].step);\n break;\n }\n }\n \n goal_ds[2] = ids_for_rt_st_gl(ds_r, goal_ds[0], goal_ds[1])[0];\n destinations.push(goal_ds);\n\n }\n return destinations;\n\n\n for(var i = 0; i < all_attempts.length; i++) {\n let step_id = all_attempts[i];\n let runt_id = card.runtime_id;\n\n // console.log('goal_status_label', 'seeking goal id for', step_id, runt_id);\n\n // for(var j = 0; j < trace.length; j++) {\n\n // if(trace[j].step_id == step_id\n // && trace[j].runtime_id == runt_id) {\n\n // goal_ds[0] = trace[j].step_id;\n // goal_ds[1] = goal_id(trace[j].step);\n\n // if (goal_ds[0] != undefined && goal_ds[1] != undefined) {\n // // console.log('goal_status_label', 'pushing', goal_ds[0], goal_ds[1]);\n // destinations.push(goal_ds);\n // }\n // }\n // }\n\n for(var j = 0; j < trace.length; j++) {\n\n if(trace[j].step_id == step_id\n && trace[j].runtime_id == runt_id\n && trace[j].step_id < min_step) {\n\n ds_s = trace[j].step_id;\n ds_g = goal_id(trace[j].step);\n\n min_step = trace[j].step_id;\n }\n }\n }\n\n if (min_step < 99999999) {\n\n let goal_ds = [];\n\n goal_ds[0] = ds_s;\n goal_ds[1] = ds_g;\n goal_ds[2] = ids_for_rt_st_gl(ds_r, ds_s, ds_g)[0];\n\n if (goal_ds[0] != undefined && goal_ds[1] != undefined) {\n // console.log('goal_status_label', 'pushing', goal_ds[0], goal_ds[1]);\n destinations.push(goal_ds);\n }\n }\n\n // (step_id, goal_id, card_index)\n\n // console.log('goal_status_label', '[' + destinations.join(', ') + ']');\n\n return destinations;\n }", "title": "" }, { "docid": "280d802fedeb0ba46dfc2d54122618d6", "score": "0.5159627", "text": "function collectPlayerInfo(player) {\n player.goals = _.size(_.where(dataSource, { G: player.name }));\n player.points = _.size(_.filter(dataSource, function (el) { \n return _.contains([el.G, el.A1, el.A2], player.name);\n }));\n player.goalPercentage = percentage(player.goals / totalGoalCount);\n player.involvement = percentage(player.points / totalGoalCount);\n }", "title": "" }, { "docid": "dd490a9fb68322ad63b7127202e97647", "score": "0.5157983", "text": "function parseAchievements(oneTime = [], tiered = {}) {\n function getAchievementProperties(a) {\n const split = a.split('_');\n const game = split[0];\n split.shift();\n const name = split.join('_').toUpperCase();\n return {\n game,\n name,\n };\n }\n // Initiate the achievements object\n const obj = {};\n Object.keys(achievements).forEach((game) => {\n obj[game] = {\n one_time: [],\n tiered: [],\n completed: 0,\n completed_tiered: 0,\n completed_one_time: 0,\n points_total: 0,\n points_tiered: 0,\n points_one_time: 0,\n };\n });\n // Parse onetime achievements\n // Temp patch to onetime ach possibly containing an empty array\n oneTime.filter(elem => typeof elem === 'string').forEach((achievement) => {\n const { game, name } = getAchievementProperties(achievement);\n const { points = 0 } = achievements[game].one_time[name] || 0;\n obj[game].points_one_time += points;\n obj[game].completed_one_time += 1;\n obj[game].one_time.push(name);\n });\n // Parse tiered achievements\n Object.entries(tiered).forEach((achievement) => {\n const { game, name } = getAchievementProperties(achievement[0]);\n const ach = achievements[game].tiered[name];\n if (ach !== undefined) {\n for (let t = 0; t < ach.tiers.length; t += 1) {\n if (achievement[1] >= ach.tiers[t].amount) {\n obj[game].points_tiered += ach.tiers[t].points;\n obj[game].completed_tiered += 1;\n } else {\n [, obj[game].tiered[name]] = achievement;\n break;\n }\n }\n }\n });\n // Finalise the object\n let achievementPoints = 0;\n Object.keys(obj).forEach((game) => {\n const path = obj[game];\n path.completed = path.completed_tiered + path.completed_one_time;\n path.points_total = path.points_tiered + path.points_one_time;\n achievementPoints += path.points_total;\n });\n obj.achievement_points = achievementPoints;\n return (obj);\n}", "title": "" }, { "docid": "488e98a0ed5c8e80ff6016f2759896cf", "score": "0.5146469", "text": "function getAverageGoals(/* code here */) {\n\n /* code here */\n\n\n}", "title": "" }, { "docid": "f03d016730c5b44660f2fb9a5d75b90f", "score": "0.5142597", "text": "function updateGoals(generatedBall){\n if (generatedBall.goals == 1){\n player.goalsTotal++;\n player.goalsHora++;\n player.goalsRodada++;\n player.goalsTemporada++;\n player.team.goalsRodada++;\n player.team.goalsTemporada++;\n } else if (generatedBall.goals == 2){\n player.goalsTotal += generatedBall.goals;\n player.goalsHora += generatedBall.goals;\n player.goalsRodada += generatedBall.goals;\n player.goalsTemporada += generatedBall.goals;\n player.team.goalsRodada += generatedBall.goals;\n player.team.goalsTemporada += generatedBall.goals;\n } else {\n player.goalsTotal += generatedBall.goals;\n player.goalsHora += generatedBall.goals;\n player.goalsRodada += generatedBall.goals;\n player.goalsTemporada += generatedBall.goals;\n player.team.goalsRodada += generatedBall.goals;\n player.team.goalsTemporada += generatedBall.goals;\n }\n}", "title": "" }, { "docid": "7480ec5687e3d9bb3eb2f05caf94a4bd", "score": "0.5133079", "text": "function processAthletes() {\n //Get the spreadsheets and data from the spreadsheets\n var sa = SpreadsheetApp.getActiveSpreadsheet();\n var athleteSS = sa.getSheetByName(\"Athletes\");\n var athleteDT = getDataValues(athleteSS.getName());\n \n //Get and find the important headers for processing\n var head = athleteDT[0];\n var headers = new Object();\n \n for(var i = 0; i < head.length; i++){\n switch(head[i]) {\n case \"Ref\":\n headers['ref'] = i;\n break;\n case \"Sport1rating\":\n headers['sport1'] = i;\n break;\n case \"Sport2rating\" :\n headers['sport2'] = i;\n break;\n }\n }\n\n //Process through the athletes and create the sport list\n for(i = 1; i < athleteDT.length; i++) {\n var athlete = athleteDT[i];\n var sports = \"\";\n sports += checkArchive(athlete[headers['sport1']-1], athlete[headers['sport1']]);\n sports += checkArchive(athlete[headers['sport2']-1], athlete[headers['sport2']]);\n var sport = sports.slice(0, sports.length-2);\n athleteSS.getRange(i+1, head.length+1).setValue(sport);\n }\n}", "title": "" }, { "docid": "749b46b94abc4fb143213ea80d08e9ed", "score": "0.5114874", "text": "jr_missed(person, team, totals, stats) {\n person.fa += 1;\n totals.fa += 1;\n // add to play by play - VIS\n app.add_play(`${person.name} missed a field goal`);\n var total_attempts = 0;\n var total_fgs = 0;\n for(players = 0; players < team.length; players++)\n {\n total_attempts += (team[players].fa + team[players].a3);\n total_fgs += (team[players].fg + team[players].m3);\n }\n stats.fg = Number.parseFloat((total_fgs/total_attempts)*100).toFixed(2);\n app.rebound();\n }", "title": "" }, { "docid": "66d5a5aa1bb8f4b9de65b73dce6603d6", "score": "0.509987", "text": "AI_player_from_game(AI_players) {\n try {\n var target_team = null;\n\n if (AI_players.BLUE.length > 0) {\n target_team = \"BLUE\";\n } else if (AI_players.RED.length > 0) {\n target_team = \"RED\";\n }\n\n if (target_team) {\n var game_id = AI_players[target_team][0].game_id;\n var AI_player_id = AI_players[target_team][0].id;\n var team = AI_players[target_team][0].team;\n\n this.player_from_team(game_id, AI_player_id, team);\n }\n } catch (error) {\n console.log(error);\n }\n }", "title": "" }, { "docid": "b36d44c5f016dcec23ebe74ee823be3b", "score": "0.50962865", "text": "createGoal( goal ) {\n\t\tif ( goal && goal.title ) {\n\t\t\tgoalist.run( 'add', [ goal.title ] )\n\t\t\t\t.then( ( data ) => {\n\t\t\t\t\t// Update view, clear `newGoal`, and force fetch of 'active' goal data.\n\t\t\t\t\tthis.setState( {\n\t\t\t\t\t\tactiveView: 'active',\n\t\t\t\t\t\tnewGoal: {},\n\t\t\t\t\t\tgoals: {\n\t\t\t\t\t\t\tactive: null,\n\t\t\t\t\t\t},\n\t\t\t\t\t} );\n\t\t\t\t} )\n\t\t\t\t.catch( ( err ) => {\n\t\t\t\t\tconsole.log( err.message );\n\t\t\t\t} );\n\t\t}\n\t}", "title": "" }, { "docid": "d181a28b134efeb6ff4ff5a46f22c485", "score": "0.509278", "text": "async function LiveResult(live_result, teams, span=FULL_SEASON) { // live result parameter could look like this: \"4-2 13:47 P2\" (String)\n let {home, away} = teams;\n console.log(`Live result analysis of ${away} vs ${home}`);\n let home_games = API.getLastXGamesPlayedBy(span, home);\n let away_games = API.getLastXGamesPlayedBy(span, away);\n\n let {score, gameTime} = live_result;\n\n\n\n // TODO: Then one could use this object, to apply a filter/search on all games played, and see what outcomes came\n // in games, where similar or equal results was at the same moment in time, in that/those game/games.\n return Promise.all([home_games, away_games]).then(all_games => {\n let [hGames, aGames] = all_games;\n let hGamesData = hGames.map(g => g.toGameData());\n let aGamesData = aGames.map(g => g.toGameData());\n let homeFilter = makeFilter(home, teams, live_result);\n let awayFilter = makeFilter(away, teams, live_result);\n\n let homeResult = {};\n let awayResult = {};\n\n let outcomesHomeTeam = outcomeAfterResultAt(home, hGamesData, {team: score.home, opponent: score.away}, gameTime);\n let outcomesAwayTeam = outcomeAfterResultAt(away, aGamesData, {team: score.away, opponent: score.home}, gameTime);\n\n if(homeFilter.deficit()) {\n // TODO: look for all the games, where this team has had a deficit, and analyze outcomes\n let games_with_equal_deficit = hGamesData.filter(gd => gd.scoreOrder.hadDifference(home, homeFilter.difference()));\n let result = {\n deficit: true, // this value is crucial, as it defines what properties and their names the returned object will have.\n gamesWithEqualDeficit: games_with_equal_deficit.length,\n gamesWonAfterDeficit: {\n inRegulation: games_with_equal_deficit.filter(gd => gd.winner === home && gd.decidedInRegulation).length,\n total: games_with_equal_deficit.filter(gd => gd.winner === home).length, // those won in regulation & OT/SO\n difference: () => this.total - this.inRegulation\n },\n gamesLostAfterDeficit: {\n inRegulation: games_with_equal_deficit.filter(gd => gd.loser === team && gd.decidedInRegulation).length,\n total: games_with_equal_deficit.filter(gd => gd.loser === home).length\n },\n exact: { // this will also take into account, when in the game the deficit was had, and change for that parameter\n gamesWonAfterDeficit: {\n inRegulation: 0,\n total: 0\n },\n }\n };\n console.log(`Found ${games_with_equal_deficit.length} games where the deficit for ${home} was ${homeFilter.difference()}`)\n } else {\n // TODO: look for all the games, where this team has had a lead, and analyze outcomes\n let games_with_equal_lead = hGamesData.filter(gd => gd.scoreOrder.hadDifference(home, homeFilter.difference()));\n let result = {\n deficit: false, // this value is crucial, as it defines what properties and their names the returned object will have.\n gamesWithEqualLead: games_with_equal_lead.length,\n gamesWonAfterLead: {\n inRegulation: games_with_equal_lead.filter(gd => gd.winner === home && gd.decidedInRegulation).length,\n total: games_with_equal_lead.filter(gd => gd.winner === home).length // those won in regulation & OT/SO\n },\n gamesLostAfterLead: {\n inRegulation: games_with_equal_lead.filter(gd => gd.loser === team && gd.decidedInRegulation).length,\n total: games_with_equal_lead.filter(gd => gd.loser === home).length\n },\n exact: { // this will also take into account, when in the game the deficit was had, and change for that parameter\n gamesWonAfterLead: {\n inRegulation: games_with_equal_lead.filter(gd => gd.winner === home && gd.decidedInRegulation).length,\n total: games_with_equal_lead.filter(gd => gd.winner === home).length\n },\n }\n };\n }\n\n if(awayFilter.deficit()) {\n // TODO: look for all the games, where this team has had a deficit, and analyze outcomes\n } else {\n // TODO: look for all the games, where this team has had a lead, and analyze outcomes\n }\n\n });\n}", "title": "" }, { "docid": "dc4aa4f50bd5b851b938f4f0d94eb50d", "score": "0.5088915", "text": "function setteamStats(data){\n\tfor (var i =0; i < data.length; i++){\n\t\tif(data[i][\"FTR\"] == \"H\"){\n\t\t\tgiveteamStats(data[i][\"Season\"], data[i][\"HomeTeam\"], data[i][\"Matchday\"], [3, data[i][\"FTHG\"], data[i][\"FTAG\"], [data[i][\"B365H\"],data[i][\"BWH\"],data[i][\"GBH\"],data[i][\"IWH\"],data[i][\"LBH\"]], [0,0,0,0,0], [0,0,0,0,0]]);\n\t\t\tgiveteamStats(data[i][\"Season\"], data[i][\"AwayTeam\"], data[i][\"Matchday\"], [0, data[i][\"FTAG\"], data[i][\"FTHG\"], [0,0,0,0,0], [0,0,0,0,0], [data[i][\"B365H\"],data[i][\"BWH\"],data[i][\"GBH\"],data[i][\"IWH\"],data[i][\"LBH\"]]]);\n\t\t}\n\t\tif(data[i][\"FTR\"] == \"D\"){\n\t\t\tgiveteamStats(data[i][\"Season\"], data[i][\"HomeTeam\"], data[i][\"Matchday\"], [1, data[i][\"FTHG\"], data[i][\"FTAG\"], [0,0,0,0,0], [data[i][\"B365D\"],data[i][\"BWD\"],data[i][\"GBD\"],data[i][\"IWD\"],data[i][\"LBD\"]], [0,0,0,0,0]]);\n\t\t\tgiveteamStats(data[i][\"Season\"], data[i][\"AwayTeam\"], data[i][\"Matchday\"], [1, data[i][\"FTAG\"], data[i][\"FTHG\"], [0,0,0,0,0], [data[i][\"B365D\"],data[i][\"BWD\"],data[i][\"GBD\"],data[i][\"IWD\"],data[i][\"LBD\"]], [0,0,0,0,0]]);\n\t\t}\n\t\tif(data[i][\"FTR\"] == \"A\"){\n\t\t\tgiveteamStats(data[i][\"Season\"], data[i][\"HomeTeam\"], data[i][\"Matchday\"], [0, data[i][\"FTHG\"], data[i][\"FTAG\"], [0,0,0,0,0], [0,0,0,0,0], [data[i][\"B365A\"],data[i][\"BWA\"],data[i][\"GBA\"],data[i][\"IWA\"],data[i][\"LBA\"]]]);\n\t\t\tgiveteamStats(data[i][\"Season\"], data[i][\"AwayTeam\"], data[i][\"Matchday\"], [3, data[i][\"FTAG\"], data[i][\"FTHG\"], [data[i][\"B365A\"],data[i][\"BWA\"],data[i][\"GBA\"],data[i][\"IWA\"],data[i][\"LBA\"]], [0,0,0,0,0], [0,0,0,0,0]]);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "097ec562289dd76f62caa939a5451b63", "score": "0.5088779", "text": "function prepareResponse(data) {\n ///// debugJSON for bottom left page results /////\n var debugJSON = JSON.stringify(data, undefined, 2),\n ///// spoken response for what bot says back /////\n spokenResponse = data.result.speech,\n ///// task to check and see if action parameter from API.AI hit/////\n task = data.result.action,\n ///// if above variable exits, it means a task was requested completed /////\n value = data.result.parameters.name\n\n if (task === \"completeTask\") {\n completeTask(value);\n } else {\n createTask(data);\n }\n\n respond(spokenResponse);\n debugRespond(debugJSON);\n }", "title": "" }, { "docid": "db43bfec9ac20f54d669283ee5cab081", "score": "0.50870275", "text": "resolveData(data) {\n if (typeof data === 'string') {\n if (data.includes('.csv')) {\n return () => {\n csv(data).then(d => {\n this.getTotal(d);\n this.data = d;\n this.drawFromFile();\n });\n };\n } else if (data.includes('.tsv')) {\n return () => {\n tsv(data).then(d => {\n this.getTotal(d);\n this.data = d;\n this.drawFromFile();\n });\n };\n }\n } else {\n return () => {\n this.data = data;\n for (let i = 0; i < data.length; ++i) {\n let t = 0;\n let keys = Object.keys(data[i]);\n keys.forEach(d => {\n if (d !== this.labels) {\n t += data[i][d];\n data[i].total = t;\n }\n })\n }\n this.drawFromObject();\n };\n }\n }", "title": "" }, { "docid": "14701f81891750156762e3aa76f95dc0", "score": "0.5086822", "text": "function getAverageGoals(data) {\n let homeAvg = data.reduce((acc, currentValue)=>acc + currentValue[\"Home Team Goals\"], 0);\n let awayAvg = data.reduce((acc, currentValue)=>acc + currentValue[\"Away Team Goals\"], 0);\n return {\n \"Home Teams Average\": (homeAvg / data.length).toFixed(2), \"Away Teams Average\": (awayAvg / data.length).toFixed(2)\n }\n }", "title": "" }, { "docid": "9e5e9d50ce3504caa64d387793b91665", "score": "0.5085293", "text": "function populateAchievementData() {\n achievementData = [];\n achievementData['list'] = [];\n\n achievementData['list'].push('Bigger Coffers');\n achievementData['biggercoffers'] = [];\n achievementData['biggercoffers']['description'] = [\n 'Upgrade a Gold Storage to level 2', // 1 star\n 'Upgrade a Gold Storage to level 5', // 2 stars\n 'Upgrade a Gold Storage to level 10', // 3 stars\n ];\n achievementData['biggercoffers']['experience'] = [\n 10, // 1 star\n 100, // 2 stars\n 1000, // 3 stars\n ];\n achievementData['biggercoffers']['gems'] = [\n 2, // 1 star\n 5, // 2 stars\n 10, // 3 stars\n ];\n achievementData['biggercoffers']['mininum town hall'] = [\n buildingInfo('gold storage', 'required town hall', 2), // 1 star\n buildingInfo('gold storage', 'required town hall', 5), // 2 stars\n buildingInfo('gold storage', 'required town hall', 8), // 3 stars\n ];\n achievementData['biggercoffers']['expected town hall'] = [\n buildingInfo('gold storage', 'required town hall', 2), // 1 star\n buildingInfo('gold storage', 'required town hall', 5), // 2 stars\n buildingInfo('gold storage', 'required town hall', 8), // 3 stars\n ];\n\n achievementData['list'].push('Get those Goblins!');\n achievementData['getthosegoblins'] = [];\n achievementData['getthosegoblins']['description'] = [\n 'Win 10 stars on the Campaign Map', // 1 star\n 'Win 50 stars on the Campaign Map', // 2 stars\n 'Win 150 stars on the Campaign Map', // 3 stars\n ];\n achievementData['getthosegoblins']['experience'] = [\n 10, // 1 star\n 100, // 2 stars\n 1000, // 3 stars\n ];\n achievementData['getthosegoblins']['gems'] = [\n 5, // 1 star\n 10, // 2 stars\n 20, // 3 stars\n ];\n achievementData['getthosegoblins']['mininum town hall'] = [\n 1, // 1 star\n 1, // 2 stars\n 1, // 3 stars\n ];\n achievementData['getthosegoblins']['expected town hall'] = [\n 3, // 1 star\n 4, // 2 stars\n 8, // 3 stars\n ];\n\n achievementData['list'].push('Bigger & Better');\n achievementData['biggerbetter'] = [];\n achievementData['biggerbetter']['description'] = [\n 'Upgrade Town Hall to level 3', // 1 star\n 'Upgrade Town Hall to level 5', // 2 stars\n 'Upgrade Town Hall to level 8', // 3 stars\n ];\n achievementData['biggerbetter']['experience'] = [\n 10, // 1 star\n 100, // 2 stars\n 1000, // 3 stars\n ];\n achievementData['biggerbetter']['gems'] = [\n 5, // 1 star\n 10, // 2 stars\n 20, // 3 stars\n ];\n achievementData['biggerbetter']['mininum town hall'] = [\n 3, // 1 star\n 5, // 2 stars\n 8, // 3 stars\n ];\n achievementData['biggerbetter']['expected town hall'] = [\n 3, // 1 star\n 5, // 2 stars\n 8, // 3 stars\n ];\n\n achievementData['list'].push('Nice and Tidy');\n achievementData['niceandtidy'] = [];\n achievementData['niceandtidy']['description'] = [\n 'Remove 5 obstacles (trees, rocks, bushes)', // 1 star\n 'Remove 50 obstacles (trees, rocks, bushes)', // 2 stars\n 'Remove 500 obstacles (trees, rocks, bushes)', // 3 stars\n ];\n achievementData['niceandtidy']['experience'] = [\n 10, // 1 star\n 100, // 2 stars\n 1000, // 3 stars\n ];\n achievementData['niceandtidy']['gems'] = [\n 5, // 1 star\n 10, // 2 stars\n 20, // 3 stars\n ];\n achievementData['niceandtidy']['mininum town hall'] = [\n 1, // 1 star\n 1, // 2 stars\n 1, // 3 stars\n ];\n achievementData['niceandtidy']['expected town hall'] = [\n 2, // 1 star\n 3, // 2 stars\n 5, // 3 stars\n ];\n\n achievementData['list'].push('Release the Beasts');\n achievementData['releasethebeasts'] = [];\n achievementData['releasethebeasts']['description'] = [\n 'Unlock Archer in the Barracks', // 1 star\n 'Unlock Wall Breaker in the Barracks', // 2 stars\n 'Unlock Dragon in the Barracks', // 3 stars\n ];\n achievementData['releasethebeasts']['experience'] = [\n 10, // 1 star\n 100, // 2 stars\n 1000, // 3 stars\n ];\n achievementData['releasethebeasts']['gems'] = [\n 5, // 1 star\n 10, // 2 stars\n 20, // 3 stars\n ];\n achievementData['releasethebeasts']['mininum town hall'] = [\n buildingInfo('barracks', 'required town hall', troopInfo('archer', 'barracks level')), // 1 star\n buildingInfo('barracks', 'required town hall', troopInfo('wallbreaker', 'barracks level')), // 2 stars\n buildingInfo('barracks', 'required town hall', troopInfo('dragon', 'barracks level')), // 3 stars\n ];\n achievementData['releasethebeasts']['expected town hall'] = [\n buildingInfo('barracks', 'required town hall', troopInfo('archer', 'barracks level')), // 1 star\n buildingInfo('barracks', 'required town hall', troopInfo('wallbreaker', 'barracks level')), // 2 stars\n buildingInfo('barracks', 'required town hall', troopInfo('dragon', 'barracks level')), // 3 stars\n ];\n\n achievementData['list'].push('Gold Grab');\n achievementData['goldgrab'] = [];\n achievementData['goldgrab']['description'] = [\n 'Steal 20,000 Gold', // 1 star\n 'Steal 1,000,000 Gold', // 2 stars\n 'Steal 100,000,000 Gold', // 3 stars\n ];\n achievementData['goldgrab']['experience'] = [\n 10, // 1 star\n 100, // 2 stars\n 1000, // 3 stars\n ];\n achievementData['goldgrab']['gems'] = [\n 5, // 1 star\n 10, // 2 stars\n 20, // 3 stars\n ];\n achievementData['goldgrab']['mininum town hall'] = [\n 1, // 1 star\n 1, // 2 stars\n 1, // 3 stars\n ];\n achievementData['goldgrab']['expected town hall'] = [\n 3, // 1 star\n 5, // 2 stars\n 8, // 3 stars\n ];\n\n achievementData['list'].push('Elixir Escapade');\n achievementData['elixirescapade'] = [];\n achievementData['elixirescapade']['description'] = [\n 'Steal 20,000 Elixir', // 1 star\n 'Steal 1,000,000 Elixir', // 2 stars\n 'Steal 100,000,000 Elixir', // 3 stars\n ];\n achievementData['elixirescapade']['experience'] = [\n 10, // 1 star\n 100, // 2 stars\n 1000, // 3 stars\n ];\n achievementData['elixirescapade']['gems'] = [\n 5, // 1 star\n 10, // 2 stars\n 20, // 3 stars\n ];\n achievementData['elixirescapade']['mininum town hall'] = [\n 1, // 1 star\n 1, // 2 stars\n 1, // 3 stars\n ];\n achievementData['elixirescapade']['expected town hall'] = [\n 3, // 1 star\n 5, // 2 stars\n 8, // 3 stars\n ];\n\n achievementData['list'].push('Sweet Victory!');\n achievementData['sweetvictory'] = [];\n achievementData['sweetvictory']['description'] = [\n 'Achieve a total of 75 trophies in Multiplayer battles', // 1 star\n 'Achieve a total of 750 trophies in Multiplayer battles', // 2 stars\n 'Achieve a total of 1,250 trophies in Multiplayer battles', // 3 stars\n ];\n achievementData['sweetvictory']['experience'] = [\n 10, // 1 star\n 100, // 2 stars\n 1000, // 3 stars\n ];\n achievementData['sweetvictory']['gems'] = [\n 5, // 1 star\n 10, // 2 stars\n 450, // 3 stars\n ];\n achievementData['sweetvictory']['mininum town hall'] = [\n 1, // 1 star\n 1, // 2 stars\n 1, // 3 stars\n ];\n achievementData['sweetvictory']['expected town hall'] = [\n 3, // 1 star\n 5, // 2 stars\n 6, // 3 stars\n ];\n\n achievementData['list'].push('Empire Builder');\n achievementData['empirebuilder'] = [];\n achievementData['empirebuilder']['description'] = [\n 'Rebuild the Clan Castle', // 1 star\n 'Upgrade Clan Castle to Level 2', // 2 stars\n 'Upgrade Clan Castle to Level 4', // 3 stars\n ];\n achievementData['empirebuilder']['experience'] = [\n 10, // 1 star\n 100, // 2 stars\n 1000, // 3 stars\n ];\n achievementData['empirebuilder']['gems'] = [\n 5, // 1 star\n 10, // 2 stars\n 20, // 3 stars\n ];\n achievementData['empirebuilder']['mininum town hall'] = [\n buildingInfo('clan castle', 'required town hall', 1), // 1 star\n buildingInfo('clan castle', 'required town hall', 2), // 2 stars\n buildingInfo('clan castle', 'required town hall', 4), // 3 stars\n ];\n achievementData['empirebuilder']['expected town hall'] = [\n buildingInfo('clan castle', 'required town hall', 1), // 1 star\n buildingInfo('clan castle', 'required town hall', 2), // 2 stars\n buildingInfo('clan castle', 'required town hall', 4), // 3 stars\n ];\n\n achievementData['list'].push('Wall Buster');\n achievementData['wallbuster'] = [];\n achievementData['wallbuster']['description'] = [\n 'Destroy 10 Walls in Multiplayer battles', // 1 star\n 'Destroy 100 Walls in Multiplayer battles', // 2 stars\n 'Destroy 2,000 Walls in Multiplayer battles', // 3 stars\n ];\n achievementData['wallbuster']['experience'] = [\n 10, // 1 star\n 100, // 2 stars\n 1000, // 3 stars\n ];\n achievementData['wallbuster']['gems'] = [\n 5, // 1 star\n 10, // 2 stars\n 20, // 3 stars\n ];\n achievementData['wallbuster']['mininum town hall'] = [\n 1, // 1 star\n 1, // 2 stars\n 1, // 3 stars\n ];\n achievementData['wallbuster']['expected town hall'] = [\n 3, // 1 star\n 5, // 2 stars\n 7, // 3 stars\n ];\n\n achievementData['list'].push('Humiliator');\n achievementData['humiliator'] = [];\n achievementData['humiliator']['description'] = [\n 'Destroy 10 Town Halls in Multiplayer battles', // 1 star\n 'Destroy 100 Town Halls in Multiplayer battles', // 2 stars\n 'Destroy 2,000 Town Halls in Multiplayer battles', // 3 stars\n ];\n achievementData['humiliator']['experience'] = [\n 10, // 1 star\n 100, // 2 stars\n 1000, // 3 stars\n ];\n achievementData['humiliator']['gems'] = [\n 5, // 1 star\n 10, // 2 stars\n 50, // 3 stars\n ];\n achievementData['humiliator']['mininum town hall'] = [\n 1, // 1 star\n 1, // 2 stars\n 1, // 3 stars\n ];\n achievementData['humiliator']['expected town hall'] = [\n 3, // 1 star\n 6, // 2 stars\n 9, // 3 stars\n ];\n\n achievementData['list'].push('Union Buster');\n achievementData['unionbuster'] = [];\n achievementData['unionbuster']['description'] = [\n 'Destroy 25 Builder\\'s Huts in Multiplayer battles', // 1 star\n 'Destroy 250 Builder\\'s Huts in Multiplayer battles', // 2 stars\n 'Destroy 2,500 Builder\\'s Huts in Multiplayer battles', // 3 stars\n ];\n achievementData['unionbuster']['experience'] = [\n 10, // 1 star\n 100, // 2 stars\n 1000, // 3 stars\n ];\n achievementData['unionbuster']['gems'] = [\n 5, // 1 star\n 10, // 2 stars\n 30, // 3 stars\n ];\n achievementData['unionbuster']['mininum town hall'] = [\n 1, // 1 star\n 1, // 2 stars\n 1, // 3 stars\n ];\n achievementData['unionbuster']['expected town hall'] = [\n 3, // 1 star\n 6, // 2 stars\n 8, // 3 stars\n ];\n\n achievementData['list'].push('Conqueror');\n achievementData['conqueror'] = [];\n achievementData['conqueror']['description'] = [\n 'Win 25 Multiplayer battles', // 1 star\n 'Win 250 Multiplayer battles', // 2 stars\n 'Win 5,000 Multiplayer battles', // 3 stars\n ];\n achievementData['conqueror']['experience'] = [\n 10, // 1 star\n 100, // 2 stars\n 1000, // 3 stars\n ];\n achievementData['conqueror']['gems'] = [\n 5, // 1 star\n 10, // 2 stars\n 20, // 3 stars\n ];\n achievementData['conqueror']['mininum town hall'] = [\n 1, // 1 star\n 1, // 2 stars\n 1, // 3 stars\n ];\n achievementData['conqueror']['expected town hall'] = [\n 4, // 1 star\n 6, // 2 stars\n 10, // 3 stars\n ];\n\n achievementData['list'].push('Unbreakable');\n achievementData['unbreakable'] = [];\n achievementData['unbreakable']['description'] = [\n 'Successfully defend against 10 attacks', // 1 star\n 'Successfully defend against 250 attacks', // 2 stars\n 'Successfully defend against 5,000 attacks', // 3 stars\n ];\n achievementData['unbreakable']['experience'] = [\n 10, // 1 star\n 100, // 2 stars\n 1000, // 3 stars\n ];\n achievementData['unbreakable']['gems'] = [\n 5, // 1 star\n 50, // 2 stars\n 100, // 3 stars\n ];\n achievementData['unbreakable']['mininum town hall'] = [\n 1, // 1 star\n 1, // 2 stars\n 1, // 3 stars\n ];\n achievementData['unbreakable']['expected town hall'] = [\n 5, // 1 star\n 8, // 2 stars\n 10, // 3 stars\n ];\n\n achievementData['list'].push('Friend in Need');\n achievementData['friendinneed'] = [];\n achievementData['friendinneed']['description'] = [\n 'Donate 100 Clan Castle capacity worth of reinforcements', // 1 star\n 'Donate 5,000 Clan Castle capacity worth of reinforcements', // 2 stars\n 'Donate 25,000 Clan Castle capacity worth of reinforcements', // 3 stars\n ];\n achievementData['friendinneed']['experience'] = [\n 10, // 1 star\n 100, // 2 stars\n 1000, // 3 stars\n ];\n achievementData['friendinneed']['gems'] = [\n 5, // 1 star\n 25, // 2 stars\n 250, // 3 stars\n ];\n achievementData['friendinneed']['mininum town hall'] = [\n buildingInfo('clan castle', 'required town hall', 1), // 1 star\n buildingInfo('clan castle', 'required town hall', 1), // 2 stars\n buildingInfo('clan castle', 'required town hall', 1), // 3 stars\n ];\n achievementData['friendinneed']['expected town hall'] = [\n 4, // 1 star\n 6, // 2 stars\n 8, // 3 stars\n ];\n\n achievementData['list'].push('Mortar Mauler');\n achievementData['mortarmauler'] = [];\n achievementData['mortarmauler']['description'] = [\n 'Destroy 25 Mortars in Multiplayer battles', // 1 star\n 'Destroy 500 Mortars in Multiplayer battles', // 2 stars\n 'Destroy 5,000 Mortars in Multiplayer battles', // 3 stars\n ];\n achievementData['mortarmauler']['experience'] = [\n 10, // 1 star\n 100, // 2 stars\n 1000, // 3 stars\n ];\n achievementData['mortarmauler']['gems'] = [\n 5, // 1 star\n 10, // 2 stars\n 20, // 3 stars\n ];\n achievementData['mortarmauler']['mininum town hall'] = [\n 1, // 1 star\n 1, // 2 stars\n 1, // 3 stars\n ];\n achievementData['mortarmauler']['expected town hall'] = [\n 4, // 1 star\n 7, // 2 stars\n 10, // 3 stars\n ];\n\n achievementData['list'].push('Heroic Heist');\n achievementData['heroicheist'] = [];\n achievementData['heroicheist']['description'] = [\n 'Steal 20,000 Dark Elixir', // 1 star\n 'Steal 250,000 Dark Elixir', // 2 stars\n 'Steal 1,000,000 Dark Elixir', // 3 stars\n ];\n achievementData['heroicheist']['experience'] = [\n 10, // 1 star\n 100, // 2 stars\n 1000, // 3 stars\n ];\n achievementData['heroicheist']['gems'] = [\n 5, // 1 star\n 10, // 2 stars\n 20, // 3 stars\n ];\n achievementData['heroicheist']['mininum town hall'] = [\n 1, // 1 star\n 1, // 2 stars\n 1, // 3 stars\n ];\n achievementData['heroicheist']['expected town hall'] = [\n 7, // 1 star\n 8, // 2 stars\n 9, // 3 stars\n ];\n\n achievementData['list'].push('League All-Star');\n achievementData['leagueallstar'] = [];\n achievementData['leagueallstar']['description'] = [\n 'Join the Crystal League', // 1 star\n 'Reach the Master League', // 2 stars\n 'Become a Champion!', // 3 stars\n ];\n achievementData['leagueallstar']['experience'] = [\n 100, // 1 star\n 500, // 2 stars\n 2000, // 3 stars\n ];\n achievementData['leagueallstar']['gems'] = [\n 250, // 1 star\n 1000, // 2 stars\n 2000, // 3 stars\n ];\n achievementData['leagueallstar']['mininum town hall'] = [\n 1, // 1 star\n 1, // 2 stars\n 1, // 3 stars\n ];\n achievementData['leagueallstar']['expected town hall'] = [\n 8, // 1 star\n 9, // 2 stars\n 10, // 3 stars\n ];\n\n achievementData['list'].push('X-Bow Exterminator');\n achievementData['xbowexterminator'] = [];\n achievementData['xbowexterminator']['description'] = [\n 'Destroy 1 X-Bow in a Multiplayer battle', // 1 star\n 'Destroy 250 X-Bows in a Multiplayer battle', // 2 stars\n 'Destroy 2,500 X-Bows in a Multiplayer battle', // 3 stars\n ];\n achievementData['xbowexterminator']['experience'] = [\n 50, // 1 star\n 100, // 2 stars\n 1000, // 3 stars\n ];\n achievementData['xbowexterminator']['gems'] = [\n 50, // 1 star\n 100, // 2 stars\n 200, // 3 stars\n ];\n achievementData['xbowexterminator']['mininum town hall'] = [\n 1, // 1 star\n 1, // 2 stars\n 1, // 3 stars\n ];\n achievementData['xbowexterminator']['expected town hall'] = [\n 7, // 1 star\n 9, // 2 stars\n 10, // 3 stars\n ];\n\n achievementData['list'].push('Firefighter');\n achievementData['firefighter'] = [];\n achievementData['firefighter']['description'] = [\n 'Destroy 10 Inferno Towers in a Multiplayer battle', // 1 star\n 'Destroy 250 Inferno Towers in a Multiplayer battle', // 2 stars\n 'Destroy 5,000 Inferno Towers in a Multiplayer battle', // 3 stars\n ];\n achievementData['firefighter']['experience'] = [\n 50, // 1 star\n 500, // 2 stars\n 5000, // 3 stars\n ];\n achievementData['firefighter']['gems'] = [\n 100, // 1 star\n 200, // 2 stars\n 1000, // 3 stars\n ];\n achievementData['firefighter']['mininum town hall'] = [\n 1, // 1 star\n 1, // 2 stars\n 1, // 3 stars\n ];\n achievementData['firefighter']['expected town hall'] = [\n 8, // 1 star\n 10, // 2 stars\n 10, // 3 stars\n ];\n\n achievementData['list'].push('War Hero');\n achievementData['warhero'] = [];\n achievementData['warhero']['description'] = [\n 'Score 10 stars for your clan in War Battles', // 1 star\n 'Score 150 stars for your clan in War Battles', // 2 stars\n 'Score 1,000 stars for your clan in War Battles', // 3 stars\n ];\n achievementData['warhero']['experience'] = [\n 50, // 1 star\n 500, // 2 stars\n 1000, // 3 stars\n ];\n achievementData['warhero']['gems'] = [\n 50, // 1 star\n 200, // 2 stars\n 1000, // 3 stars\n ];\n achievementData['warhero']['mininum town hall'] = [\n buildingInfo('clan castle', 'required town hall', 1), // 1 star\n buildingInfo('clan castle', 'required town hall', 1), // 2 stars\n buildingInfo('clan castle', 'required town hall', 1), // 3 stars\n ];\n achievementData['warhero']['expected town hall'] = [\n 6, // 1 star\n 8, // 2 stars\n 10, // 3 stars\n ];\n\n achievementData['list'].push('Spoils of War');\n achievementData['spoilsofwar'] = [];\n achievementData['spoilsofwar']['description'] = [\n 'Collect 800,000 Gold in Clan War bonuses', // 1 star\n 'Collect 15,000,000 Gold in Clan War bonuses', // 2 stars\n 'Collect 100,000,000 Gold in Clan War bonuses', // 3 stars\n ];\n achievementData['spoilsofwar']['experience'] = [\n 100, // 1 star\n 500, // 2 stars\n 5000, // 3 stars\n ];\n achievementData['spoilsofwar']['gems'] = [\n 25, // 1 star\n 100, // 2 stars\n 1000, // 3 stars\n ];\n achievementData['spoilsofwar']['mininum town hall'] = [\n buildingInfo('clan castle', 'required town hall', 1), // 1 star\n buildingInfo('clan castle', 'required town hall', 1), // 2 stars\n buildingInfo('clan castle', 'required town hall', 1), // 3 stars\n ];\n achievementData['spoilsofwar']['expected town hall'] = [\n 7, // 1 star\n 9, // 2 stars\n 10, // 3 stars\n ];\n}", "title": "" }, { "docid": "89124f1d7874e56cea9cb97f5094b3e2", "score": "0.5085238", "text": "function algoritmoAnalisi()\n{\n //Verifica la presenza del 1° Punto\n if(primoPunto !== null)\n {\n //Verifica se supera criterio IMA Acuto\n if(primoPunto >= 100) //Then\n {\n //Rule In = IMA Acuto\n return \"Rule-In = IMA Acuto (Troponina maggiore o uguale a 100 ng/L\";\n }\n else\n {\n //Verifica se possibile Rule-Out con 1 solo punto\n if(!altoRischio && ecg && treOre && primoPunto <= lod)//Then\n {\n //Rule-Out con un solo punto\n return \"Rule-Out (Dolore da più di 3 ore; ECG non significativo; Troponina inferiore o uguale al livello di rilevazione)\";\n }\n else\n {\n //Verifica la presenza del 2° Punto\n if(secondoPunto !== null)//Then\n {\n //Verifica se 1° punto maggiore o minore dell'URL\n if(primoPunto <= url)//Then\n {\n //Ramo 1° Punto minore/uguale dell'URL\n //Valutazione del possibile Rule-In\n if((secondoPunto > url) && (delta1 > 0.5 * url))//Then\n {\n //Rule-In perchè superamento dell'URL e delta positivo\n return \"Rule-In = Danno miocardico acuto (URL superato in 1 punto con Delta significativo)\";\n }\n else\n {\n //Controllo se possibile Rule-Out per assenza di Delta positivo e non superamento dell'URL\n if((secondoPunto <= url && (delta1 > 0.5 * url)) || (secondoPunto > url) || (altoRischio) )//Then\n {\n //Verifica la presenza del 3° Punto\n if(terzoPunto!==null)//Then\n {\n //Verifica se 2° punto maggiore o minore dell'URL\n if(secondoPunto <= url)//Then\n {\n //Ramo 2° Punto minore o uguale dell'URL\n //Valutazione del possibile Rule-In\n if(terzoPunto > url && (delta2 > 0.5 * url))//Then\n {\n //Rule-In perchè superamento dell'URL e delta positivo\n return \"Rule-In = Danno miocardico acuto (URL superato in 1 punto con Delta significativo)\";\n }\n else\n {\n if(((terzoPunto <= url) && (delta2 > 0.5 * url)) || (terzoPunto > url) || (altoRischio))//Then\n {\n //Zona di grigio\n return \"Zona di grigio = NON Rule-In, NON Rule-Out\";\n }\n else\n {\n //Rule-out dopo 3° punto\n return \"Rule-Out (anche il 3° punto non supera l'URL e il Delta non è significativo, e non c'è rischio clinico)\";\n }\n }\n }\n else\n {\n //Ramo 2° Punto Maggiore dell'URL\n //Verifica del Rule-In al 3° Punto\n if((terzoPunto > url) && (delta2 > 0.2 * primoPunto))//Then\n {\n //Rule-In perchè superamento dell'URL (per 3 volte) e delta significativo\n return \"Rule-In = Danno miocardico acuto (URL superato in 2 punti con Delta significativo)\";\n }\n else\n {\n //Verifica possibilità di Rule-Out\n if((terzoPunto > url) || (altoRischio))//Then\n {\n //Zona grigia\n return \"Zona di grigio = NON Rule-In, NON Rule-Out\";\n }\n else\n {\n //Rule-Out perchè il 3° punto è sceso sotto l'URL\n return \"Rule-Out (il 3° Punto è sceso sotto l'URL, e non c'è rischio clinico\";\n }\n }\n }\n }\n else\n {\n //Manca il 3° punto\n return \"Fare il 3° Punto\";\n }\n }\n else\n {\n //Rule-out dopo 2° punto\n return \"Rule-Out (anche il 2° punto non supera l'URL e il Delta non è significativo, e non c'è rischio clinico)\";\n }\n }\n }\n else\n {\n //Ramo 1° Punto maggiore dell'URL\n if(secondoPunto > url && delta1 > 0.2 * primoPunto)//Then\n {\n //Rule-In perchè superamento dell'URL (per 2 volte) e delta significativo\n return \"Rule-In = Danno miocardico acuto (URL superato in 2 punti con Delta significativo)\";\n }\n else\n {\n //Verifica se possibile Rule-Out perchè 2° punto sceso sotto URL\n if((secondoPunto > url) || (altoRischio))//Then\n {\n //Verifica la presenza del 3° Punto\n if(terzoPunto!==null)//Then\n {\n //Ramo in cui il 1° punto e il 2° punto sono maggiori dell'URL ma il denta non è significativo\n if(terzoPunto > url && delta2 > 0.2 * primoPunto)//Then\n {\n //Rule-In perchè superamento dell'URL (per 3 volte) e delta significativo\n return \"Rule-In = Danno miocardico acuto (URL superato in 3 punti con Delta significativo)\";\n }\n else\n {\n //Verifica se possibile Rule-Out perchè 3° punto sceso sotto URL\n if((terzoPunto > url) || (altoRischio))//Then\n {\n //Zona di grigio\n return \"Zona di grigio = NON Rule-In, NON Rule-Out\";\n }\n else\n {\n //Rule-Out perchè il 3° punto è sceso sotto l'URL\n return \"Rule-Out (il 3° punto è sceso sotto l'URL, e non c'è rischio clinico)\";\n }\n }\n }\n else\n {\n //Manca il 3° punto\n return \"Fare il 3° Punto\";\n }\n }\n else\n {\n //Rule-Out perchè il 2° punto è sceso sotto l'URL\n return \"Rule-Out (il 2° punto è sceso sotto l'URL)\";\n }\n }\n \n }\n }\n else\n {\n //Manca il 2° punto\n return \"Fare il 2° Punto\";\n }\n }\n }\n }\n else\n {\n //Manca il 1° punto\n return \"Fare il 1° Punto\";\n }\n}", "title": "" }, { "docid": "21175f447cd3433836c722f2a199f98f", "score": "0.5078303", "text": "async _postWalkthroughItems(thisObj, data, userInfo, datasetName) {\n var result = thisObj._dbManager.queryFailureResult(); \n var queryList, queryResults;\n \n queryList = {\n addset:\n 'call add_walkthroughset (' +\n userInfo.userId + ', ' +\n '\"' + datasetName + '\" ' + \n ')'\n }\n\n queryResults = await this._dbManager.dbQueries(queryList); \n if (!queryResults.success) {\n result.details = queryResults.details;\n return result;\n }\n \n let walkthroughSetId = queryResults.data.addset[0][0].walkthroughsetid;\n \n queryList = {};\n queryList.add = 'insert into walkthroughitem (walkthroughsetid, criterionid, itemvalue, itemdate) values ';\n \n for (var i = 0; i < data.length; i++) {\n var item = data[i];\n \n if (i > 0) queryList.add += ', ';\n queryList.add += \n '(' +\n walkthroughSetId + ', ' +\n item.criterionId + ', ' +\n '\"' + item.criterionValue + '\", ' +\n '\"' + item.criterionDate + '\" ' +\n ') '; \n }\n\n queryResults = await this._dbManager.dbQueries(queryList); \n \n if (queryResults.success) {\n result.success = true;\n result.details = 'query succeeded';\n \n } else {\n result.details = queryResults.details;\n }\n \n return result;\n }", "title": "" }, { "docid": "81800f3af1fdc1594df30b0c940c60c2", "score": "0.50723475", "text": "function generalProcessData(data) {\n if (!data.previously && !data.player) return;\n\n if ((data.player && data.player.activity === 'menu') || (data.player.state.health === 0 || data.player.steamid !== data.provider.steamid) || (data.round && data.round.phase !== \"live\")) {\n // Let's play some music\n if (spotifyReady) {\n if (config.application.operationMode === 1) {\n if (!isPlaying) {\n global.log.info(`[CS::GO] Let's start some music`);\n spotifyHelper.player.play();\n isPlaying = true;\n }\n } else if (config.application.operationMode === 2) {\n if (!isPlaying) {\n global.log.trace(\"[CS::GO] Started getting system volume\");\n\n global.log.info(`[CS::GO] Let's start some music`);\n spotifyHelper.player.play();\n }\n }\n } else {\n global.log.warn(`[SPOTIFY] Isn't ready to handle requests`);\n }\n } else {\n // Let's be serious so quit the music\n if (spotifyReady) {\n if (config.application.operationMode === 1) {\n if (isPlaying) {\n global.log.info(`[CS::GO] Stop the music`);\n spotifyHelper.player.pause();\n isPlaying = false;\n }\n } else if (config.application.operationMode === 2) {\n if (isPlaying) {\n global.log.info(`[CS::GO] Stop the music`);\n spotifyHelper.player.pause();\n isPlaying = false;\n }\n }\n } else {\n global.log.warn(`[SPOTIFY] Isn't ready to handle requests`);\n }\n }\n}", "title": "" }, { "docid": "584fabbb83f54ce5544dc3205ef936d0", "score": "0.5072069", "text": "prepareData() {\n super.prepareData();\n\n const actorData = this.data;\n const data = actorData.data;\n const flags = actorData.flags;\n\n // Make separate methods for each Actor type (character, npc, etc.) to keep\n // things organized.\n \n data.status.absorption.total = data.status.absorption.base + data.status.absorption.armor\n // loop through stats, calculate total and bonus.\n for (let s of Object.values(data.stats)) {\n s.value = s.initial + s.improvements + (s.modifier || 0)\n s.bonus = Math.floor(s.value / 10)\n //CALCULATE COST TO ADVANCE HERE\n }\n\n if (actorData.type === 'character') this._prepareCharacterData(actorData);\n\n let [hp, thp, bloodied, absorption, enc] = this._calculateDerivedStats(actorData);\n if (data.status.hp.max != hp) {// If change detected, reassign max and current wounds\n data.status.hp.max = hp;\n }\n if (data.status.thp.max != thp){\n data.status.thp.max = thp;\n }\n if (data.status.bloodied.value != bloodied){\n data.status.bloodied.value = bloodied;\n }\n if (data.status.absorption.base != absorption){\n data.status.absorption.base = absorption;\n data.status.absorption.total = data.status.absorption.base + data.status.absorption.armor\n }\n if (data.status.encumbrance.max != enc){\n data.status.encumbrance.max = enc;\n }\n\n // this.prepareItems();\n console.log(this.data);\n }", "title": "" }, { "docid": "1e9ac0e39bb898356722c55bb82f3089", "score": "0.5070903", "text": "function reportEvent(info) {\n switch (info.type) {\n case Frogger.enums.Event.ReachHome:\n \n if(info.hitEntity.components.appearance.sprite==1){ // gator\n info.entity.components.collision.killed = true;\n }\n else if(info.hitEntity.components.appearance.sprite==0){ // bonus\n totalScore -= 100;\n info.hitEntity.components.appearance.sprite = 2;\n info.entity.components.collision.home = true;\n numHomes++;\n totalScore += info.totalTime;\n }\n else{\n info.hitEntity.components.appearance.sprite = 2;\n info.entity.components.collision.home = true;\n numHomes++;\n totalScore += info.totalTime;\n }\n\n if(numHomes == 5){\n Frogger.systems.Highscores.add(Math.round(totalScore/100));\n Frogger.systems.keyboardInput.cancelNextRequest = true;\n } \n break;\n\n case Frogger.enums.Event.HitSomething:\n info.entity.components.collision.killed = true;\n\n break;\n\n case Frogger.enums.Event.Ride:\n info.entity.components.collision.riding = true;\n info.entity.components.collision.objectRiding = info.hitEntity;\n info.entity.components.movable.direction = info.hitEntity.components.movable.facing;\n info.entity.components.movable.directionInterval = info.hitEntity.components.movable.moveInterval;\n info.entity.components.movable.directionElapsedInterval = info.hitEntity.components.movable.elapsedInterval;\n\n if (info.hitEntity.components.turtle && info.hitEntity.components.appearance.sprite==3){\n info.entity.components.collision.killed = true;\n info.entity.components.collision.riding = false;\n }\n else if(info.hitEntity.components.alligator){\n let frogSquare = Math.round(info.entity.components.position.x);\n let mouthPos = Math.round(info.hitEntity.components.position.x) + (info.hitEntity.components.appearance.width*15)/2;\n if (info.hitEntity.components.appearance.sprite==1 && mouthPos == frogSquare){\n info.entity.components.collision.killed = true;\n info.entity.components.collision.riding = false;\n }\n }\n\n break;\n }\n }", "title": "" }, { "docid": "2d71aa759fec0326d8739871f6abefdd", "score": "0.5070774", "text": "function openLifePlannerPage(datasetData){\n\tif(utils.GetUserType() != \"FLS\"){\n\t\tif(datasetData.Meeting_Status == \"Met\" && utils.GetUserType() != \"AGPS\" && datasetData.Sub_Activity != \"Recruitment\" && datasetData.Lead_Type != \"Renewal\" && utils.GetUserType() != \"ENADV\"){\n\t\t\tgotoLifePlanner();\n\t\t}else{\n\t\t\t$m.setResult(true);\n\t \tutils.ClosePage();\n\t\t}\t\n\t}else{\n\t\tif(datasetData.Meeting_Status == \"Met\" && datasetData.Activity === \"Converted\"){\n\t\t\tgotoLifePlanner();\n\t\t}else{\n\t\t\t$m.setResult(true);\n\t \tutils.ClosePage();\n\t\t}\t\n\t}\n}", "title": "" }, { "docid": "9b4dd3406c7fddcdc91acff62d92ceee", "score": "0.5070765", "text": "function p1gameProgressor() {\n var p1pointScore = $p1points.text();\n var p1count = parseInt(p1pointScore);\n if (p1count === 0 || p1count === 15) {\n p1count +=15\n } else if (p1count === 30) {\n p1count +=10\n } else if (p1count === 40) {\n if ((parseInt($p2points.text()) === 40) && ($p2adv.text() === 'AD')) {\n $p2adv.text('');\n p1count === 40;\n } else if ((parseInt($p2points.text()) === 40) && ($p1adv.text() !== 'AD')) {\n $p1adv.text('AD');\n p1count === 40;\n } else if ((parseInt($p2points.text()) === 40) && ($p1adv.text() === 'AD')) {\n $p1adv.text('');\n $p2adv.text('');\n p1count = 0;\n $p2points.text(0);\n if (p1games < 7) {\n p1games +=1;\n if (p2serving === true) {\n p2servesBroken += 1;\n };\n p1gamesWon += 1;\n serveChecker();\n activeSetSelector(activeSet);\n $p1activeSet.text(p1games);\n if (p1games === 7) {\n p1gamesWon += 1;\n if (p2serving === true) {\n p2servesBroken += 1;\n };\n serveChecker();\n activeSet += 1;\n p1setsWon += 1;\n $p1setsWon.text(p1setsWon);\n p1games = 0;\n p2games = 0;\n activeSetSelector(activeSet);\n }\n }\n } else {\n p1count = 0;\n $p2points.text(0);\n if (p1games < 7) {\n p1games +=1;\n p1gamesWon += 1;\n if (p2serving === true) {\n p2servesBroken += 1;\n };\n serveChecker();\n activeSetSelector(activeSet);\n $p1activeSet.text(p1games);\n if (p1games === 7) {\n p1gamesWon += 1;\n if (p2serving === true) {\n p2servesBroken += 1;\n };\n serveChecker();\n activeSet += 1;\n p1setsWon += 1;\n $p1setsWon.text(p1setsWon);\n p1games = 0;\n p2games = 0;\n activeSetSelector(activeSet);\n }\n }\n }\n }\n $p1points.text(p1count);\n p1pointFaults = 0;\n p2pointFaults = 0;\n }", "title": "" }, { "docid": "deeddf7b1c79a30eb532828d0ccfe962", "score": "0.5069847", "text": "getGoal() {\n return new TotoAPI().fetch('/diet/goal').then((response) => response.json());\n }", "title": "" }, { "docid": "068ed83f7bf95411e31f9dc03a033ef0", "score": "0.5067549", "text": "madeShot() {\n const stats = this._obj.pbp.statistics__list;\n\n if (!stats) {\n return false;\n } else if (stats.hasOwnProperty('fieldgoal__list')) {\n return stats.fieldgoal__list.made === 'true';\n } else if (stats.hasOwnProperty('freethrow__list')) {\n return stats.freethrow__list.made === 'true';\n }\n\n return false;\n }", "title": "" }, { "docid": "85f156d45573140fda6fd4688c941d9b", "score": "0.50571454", "text": "function extractPlayerDetails(html) {\n let selTool = cherrio.load(html);\n let detailsElem = selTool(\".event .match-info.match-info-MATCH .description\");\n let detailText = detailsElem.text();\n //console.log(detailText);\n let detailsArr = detailText.split(\",\");\n // console.log(detailsArr);\n let venue = detailsArr[1].trim();\n let date = detailsArr[2].trim();\n //console.log(venue);\n //console.log(date);\n\n let resultElem = selTool(\".event .match-info.match-info-MATCH .status-text\");\n let result = resultElem.text();\n console.log(result);\n\n let NameoFTeams = selTool(\".Collapsible h5\");\n let BatsmanTableoFTeams = selTool(\".Collapsible .table.batsman\");\n for(let i =0; i < NameoFTeams.length; i++) {\n let cteamName = selTool(NameoFTeams[i]);\n let allRowsOfCurrentTeam = selTool(BatsmanTableoFTeams[i]).find(\"tbody tr\");\n for(let j =0; j < allRowsOfCurrentTeam.length; j++) {\n let allcols = selTool(allRowsOfCurrentTeam[j]).find(\"td\");\n if(allcols.length == 8) {\n // valid row\n // opponent team Name -> player -> team.team\n // Runs, balls, sixes, fours , sr\n // date, venue , result\n // teamName\n let myTeamName = selTool(NameoFTeams[i]).text().split(\"INNINGS\")[0];\n console.log(myTeamName);\n myTeamName = myTeamName.trim();\n let opponentTeamName = i == 0 ? selTool(NameoFTeams[1]).text() : selTool(NameoFTeams[0]).text();\n opponentTeamName = opponentTeamName.split(\"INNINGS\")[0].trim();\n let name = selTool(allcols[0]).text();\n let runs = selTool(allcols[2]).text();\n let balls = selTool(allcols[3]).text();\n let fours = selTool(allcols[5]).text();\n let sixex = selTool(allcols[6]).text();\n let sr = selTool(allcols[7]).text();\n\n\n console.log(`teamName ${myTeamName} playerName ${name} venue ${venue} Date ${date}\n opponent ${opponentTeamName} result ${result} runs ${runs} balls ${balls} fours ${fours} sixes ${sixex} sr ${sr}`);\n console.log(\"```````````````````````````````````\");\n processPlayer(myTeamName, name, venue, date, opponentTeamName, result, runs, balls, fours, sixex, sr); \n }\n }\n }\n\n}", "title": "" }, { "docid": "3abfc4cd7993b5b6a023245001264064", "score": "0.5052649", "text": "function goalScored(team, shooter, servOne, servTwo) {\n $One.val(servOne);\n $Two.val(servTwo);\n\n //Display timeline event with shooter's name\n if (shooter != undefined) {\n timeline_data.push({\n date: new Date(),\n title: 'Goal!',\n content: \"Team \" + team + \" Captain \" + shooter + \" scores!\"\n });\n reloadTimeline();\n } else {\n //Report new score \n timeline_data.push({\n date: new Date(),\n title: 'Goal!',\n content: team + ' team scores!'\n });\n reloadTimeline();\n }\n }", "title": "" }, { "docid": "a5dbfd000aeea0d9dbaf1656713f04f0", "score": "0.50415415", "text": "function parseDataFromAttributes(){\n if($scope.team && $scope.team.id){\n // we've been given the team data directly, there's nothing to fetch.\n fetchHandler($scope.team);\n return;\n }\n if($scope.playerIds){\n // we were passed player IDs. hit the team API to find a matching team.\n teamsService.getTeamByPlayers($scope.playerIds).then(fetchHandler).catch(fetchErrorHandler);\n return;\n }\n if($scope.teamId){\n // we were passed a team ID, fetch it via the API.\n teamsService.getTeam($scope.teamId).then(fetchHandler).catch(fetchErrorHandler);\n return;\n }\n }", "title": "" }, { "docid": "c7c32b0650209940dafeec2a0ab3cc38", "score": "0.50413257", "text": "function openOrSenior(data) {\n // ...\n // create an empty variable to store results\n let memberStatus = [];\n\n //loop through the data to get each individual array\n for (let memberData of data) {\n let age = memberData[0];\n let handicap = memberData[1];\n\n //check seniority\n if (age >= 55 && handicap > 7) {\n memberStatus.push(\"Senior\");\n } else {\n memberStatus.push(\"Open\");\n }\n }\n return memberStatus;\n}", "title": "" }, { "docid": "48e7ea0db48b11b842f9fc725be6e92a", "score": "0.5038146", "text": "function analyzeBackToBackGames(team, games) {\n\n}", "title": "" }, { "docid": "7b9ef9faa9ffd67f2064c57996ad416c", "score": "0.5037146", "text": "data(step) {\n return step >= 0 ? scope.meta[step].data || this.data(step - 1) : [];\n }", "title": "" }, { "docid": "73b75731add602ac7382704cd5f7407a", "score": "0.5034196", "text": "oneDaySyntheticActivityData() {\n let data = [\n this.generateActivityData(MiBand2ServiceModel.DATA_NOT_WEARING_SAMPLE, 1),\n this.generateActivityData(MiBand2ServiceModel.DATA_DEEP_SLEEP_SAMPLE, 4),\n this.generateActivityData(MiBand2ServiceModel.DATA_LIGHT_SLEEP_SAMPLE, 4),\n this.generateActivityData(MiBand2ServiceModel.DATA_WALKING_SAMPLE, 2),\n this.generateActivityData(MiBand2ServiceModel.DATA_SITTING_SAMPLE, 2),\n this.generateActivityData(MiBand2ServiceModel.DATA_WALKING_SAMPLE, 1),\n this.generateActivityData(MiBand2ServiceModel.DATA_RUNNING_SAMPLE, 1),\n this.generateActivityData(MiBand2ServiceModel.DATA_SITTING_SAMPLE, 4),\n this.generateActivityData(MiBand2ServiceModel.DATA_WALKING_SAMPLE, 5)\n ];\n\n return this.postProcess(data);\n }", "title": "" }, { "docid": "5f5df3e482d3527fe8286eae7b1be54f", "score": "0.503011", "text": "handleWord(data){\n console.log(\"<------ handling word ------>\");\n\n // figure out what the word is\n let firstMsgWord = data.msg.split(\" \").shift();\n let lastMsgWord = data.msg.split(\" \").pop();\n\n let word = firstMsgWord === 'Congrats!' ?\n data.word : lastMsgWord;\n\n // purely for keeping track of record\n if (firstMsgWord === 'Congrats!') {\n solved++;\n total++;\n } else {\n missed++;\n total++;\n }\n\n console.log(`solved: ${solved} | missed: ${missed} | total: ${total} | success rate ${(solved / total)*100}`);\n\n if (this.isNewWord) {\n console.log('this is a new word!!!');\n this.saveWord(word);\n } else {\n console.log('yay this word was in my dictionary!');\n }\n }", "title": "" }, { "docid": "e5bf7643240c40d4ef13aaef18f0400e", "score": "0.50236654", "text": "getNextGoal() {\n const { board } = this;\n const possibleGoals = board.goals.filter((goal) => {\n return !this.completedGoals.includes(board.getGoalId(goal));\n });\n const index = Math.floor(Math.random() * possibleGoals.length);\n\n return (possibleGoals.length > 0 ? possibleGoals[index] : null);\n }", "title": "" }, { "docid": "4eba0b4ac5308733caae796156ca3927", "score": "0.50204456", "text": "function getCountryWins(data, tmI) {\n // create an array with every game that team played in\n // going to seperate out home and away games to simplify totally goals at later step\n const allHomeGames = data.filter( game => game['Home Team Initials'] === tmI);\n const allAwayGames = data.filter( game => game['Away Team Initials'] === tmI); \n\n // use reduce to add up total home/away goals respectively\n const homeGoals = allHomeGames.reduce((acc,item) => acc + item['Home Team Goals'],0); \n const awayGoals = allAwayGames.reduce((acc,item) => acc + item['Away Team Goals'],0); \n\n // return home + away totals\n return homeGoals + awayGoals; \n}", "title": "" }, { "docid": "e76252a8a43d0fdb29bea240b1e1853b", "score": "0.5015775", "text": "function assignDesc(activity) {\n var desc;\n switch(activity) {\n case \"boardGames\":\n desc = \"Board games are a great way to pass some time with friends! Grab your favorite and get playing.\";\n return desc;\n break;\n case \"read\":\n desc = \"Some say you're defined by the people you associate with and the books you read. Start reading a great book!\";\n return desc;\n break;\n case \"cleanHouse\":\n desc = \"Chances are there is something in your house or apartment that needs to be cleaned. Get to it!\";\n return desc;\n break;\n case \"goShopping\":\n desc = \"It's a perfect day to go shopping and spend some of your hard earned cash. Pick up something for me!\";\n return desc;\n break;\n case \"cook\":\n desc = \"Learn about a new recipe, then mess it up! Add a new meal to your arsenal.\";\n return desc;\n break;\n case \"write\":\n desc = \"Try your hand at some writing then put it online! You never know who will see your work.\";\n return desc;\n break;\n case \"videoGames\":\n desc = \"Video games are a great way to waste a day away. Go rent a new game or dust off an old favorite!\";\n return desc;\n break;\n case \"hotChocolate\":\n desc = \"Baby, it's cold outside! Grab a blanket and fill up with some hot chocolate.\";\n return desc;\n break;\n case \"ski\":\n desc = \"Go tear up that mountain and test that new powder bruh! Avalanche!\";\n return desc;\n break;\n case \"buildSnowman\":\n desc = \"Building a man of snow is an old favorite on a snowey day. Go build one and post it online!\";\n return desc;\n break;\n case \"goOutside\":\n desc = \"Get off your tuckus and go for a hike, bike ride, or whatever. Just go outside and get your blood flowing!\";\n return desc;\n break;\n case \"flyKite\":\n desc = \"It's windy enough to fly a kite outside and excite your inner child. Grab one and get going.\";\n return desc;\n break;\t\t\t\t\t\t\t\t\t\t\n }\n }", "title": "" }, { "docid": "1fa070bc608e308608566763251d81b1", "score": "0.5014405", "text": "function parseRailData (info) {\n console.log(\"parseRailData: \", data)\n var data = info.items\n for ( var i = 0; i < data.length; i++ ) {\n \n var stop = data[i]\n var direction = stop['run_id']\n\n var destination = destinations[direction]\n var minutes = stop['minutes']\n\n displayColor(minutes, destination)\n\n console.log(\"destination: \", destination, \"minutes: \", minutes);\n\n $('#stop-info').append(\"<li> destination: \" + destination + \" departing in: \" + minutes+ \"</li>\")\n\n }\n\n }", "title": "" }, { "docid": "6e6596d29f36ef0bf763a4bbd81a6232", "score": "0.5007954", "text": "_parseData(data) {\n if (!data) {\n return data;\n }\n\n const { value, oldValue, change } = data;\n const percentageChange = (change / oldValue) * 100;\n\n let direction;\n\n if (change > 0) {\n direction = 'up';\n } else if (change < 0) {\n direction = 'down';\n } else {\n direction = 'flat';\n }\n\n // TODO: standardize the data structure\n return {\n value,\n change: {\n value: change,\n direction,\n effect: 'positive',\n percentage: percentageChange,\n },\n };\n }", "title": "" }, { "docid": "aff0538d56b57c17d704002cc7134b32", "score": "0.500701", "text": "getLeagueResults(day) {\n switch (day) {\n case 'tuesday':\n\n return [\n {\n player: 'Kevin',\n played: 2,\n won: 1,\n draw: 0,\n lost: 1,\n ps: 0,\n doOut: 0,\n late: 0,\n votes: 0,\n mom: 0,\n total: 0,\n ave: 0,\n },\n {\n player: 'Millen',\n played: 2,\n won: 1,\n draw: 0,\n lost: 1,\n ps: 0,\n doOut: 0,\n late: 0,\n votes: 10,\n mom: 1,\n total: 0,\n ave: 0,\n },\n {\n player: 'Sageeth',\n played: 2,\n won: 0,\n draw: 0,\n lost: 2,\n ps: 0,\n doOut: 0,\n late: 0,\n votes: 0,\n mom: 0,\n total: 0,\n ave: 0,\n },\n {\n player: 'Tony',\n played: 3,\n won: 2,\n draw: 0,\n lost: 1,\n ps: 0,\n doOut: 0,\n late: 0,\n votes: 5,\n mom: 0,\n total: 0,\n ave: 0,\n },\n {\n player: 'Theepan',\n played: 3,\n won: 2,\n draw: 0,\n lost: 1,\n ps: 0,\n doOut: 0,\n late: 0,\n votes: 3,\n mom: 0,\n total: 0,\n ave: 0,\n },\n {\n player: 'Brandon',\n played: 1,\n won: 0,\n draw: 0,\n lost: 1,\n ps: 0,\n doOut: 0,\n late: 0,\n votes: 0,\n mom: 0,\n total: 0,\n ave: 0,\n },\n {\n player: 'Sat',\n played: 2,\n won: 0,\n draw: 0,\n lost: 2,\n ps: 0,\n doOut: 0,\n late: 0,\n votes: 0,\n mom: 0,\n total: 0,\n ave: 0,\n },\n {\n player: 'Ben',\n played: 2,\n won: 0,\n draw: 0,\n lost: 2,\n ps: 0,\n doOut: 0,\n late: 0,\n votes: 0,\n mom: 0,\n total: 0,\n ave: 0,\n },\n {\n player: 'Av',\n played: 3,\n won: 2,\n draw: 0,\n lost: 1,\n ps: 1,\n doOut: 0,\n late: 0,\n votes: 1,\n mom: 0,\n total: 0,\n ave: 0,\n },\n {\n player: 'Vanid',\n played: 2,\n won: 1,\n draw: 0,\n lost: 1,\n ps: 0,\n doOut: 0,\n late: 0,\n votes: 0,\n mom: 0,\n total: 0,\n ave: 0,\n },\n {\n player: 'Brinthan',\n played: 3,\n won: 1,\n draw: 0,\n lost: 2,\n ps: 0,\n doOut: 0,\n late: 0,\n votes: 0,\n mom: 0,\n total: 0,\n ave: 0,\n },\n {\n player: 'Gin',\n played: 3,\n won: 3,\n draw: 0,\n lost: 0,\n ps: 1,\n doOut: 0,\n late: 1,\n votes: 4,\n mom: 0,\n total: 0,\n ave: 0,\n },\n {\n player: 'Muz',\n played: 3,\n won: 1,\n draw: 0,\n lost: 2,\n ps: 0,\n doOut: 0,\n late: 0,\n votes: 5,\n mom: 1,\n total: 0,\n ave: 0,\n },\n {\n player: 'James',\n played: 3,\n won: 2,\n draw: 0,\n lost: 1,\n ps: 0,\n doOut: 0,\n late: 0,\n votes: 8,\n mom: 1,\n total: 0,\n ave: 0,\n },\n {\n player: 'Arun',\n played: 3,\n won: 3,\n draw: 0,\n lost: 0,\n ps: 0,\n doOut: 0,\n late: 0,\n votes: 4,\n mom: 0,\n total: 0,\n ave: 0,\n },\n {\n player: 'Brana',\n played: 3,\n won: 2,\n draw: 0,\n lost: 1,\n ps: 0,\n doOut: 0,\n late: 0,\n votes: 1,\n mom: 0,\n total: 0,\n ave: 0,\n },\n {\n player: 'Dane',\n played: 1,\n won: 0,\n draw: 0,\n lost: 1,\n ps: 0,\n doOut: 0,\n late: 0,\n votes: 0,\n mom: 0,\n total: 0,\n ave: 0,\n },\n {\n player: 'Teebz',\n played: 1,\n won: 0,\n draw: 0,\n lost: 1,\n ps: 0,\n doOut: 0,\n late: 0,\n votes: 0,\n mom: 0,\n total: 0,\n ave: 0,\n }];\n\n case 'thursday':\n return [\n {\n player: 'Redon',\n played: 1,\n won: 1,\n draw: 0,\n lost: 0,\n ps: 0,\n doOut: 0,\n loy: 0,\n late: 0,\n mom: 0,\n total: 0,\n ave: 0,\n },\n {\n player: 'Gracie',\n played: 1,\n won: 1,\n draw: 0,\n lost: 0,\n ps: 0,\n doOut: 0,\n loy: 0,\n late: 0,\n mom: 1,\n total: 0,\n ave: 0,\n },\n {\n player: 'Brandon',\n played: 1,\n won: 1,\n draw: 0,\n lost: 0,\n ps: 0,\n doOut: 0,\n loy: 0,\n late: 0,\n mom: 0,\n total: 0,\n ave: 0,\n },\n {\n player: 'Crouch',\n played: 1,\n won: 1,\n draw: 0,\n lost: 0,\n ps: 0,\n doOut: 0,\n loy: 0,\n late: 0,\n mom: 0,\n total: 0,\n ave: 0,\n },\n {\n player: 'Kelly',\n played: 1,\n won: 1,\n draw: 0,\n lost: 0,\n ps: 0,\n doOut: 0,\n loy: 0,\n late: 0,\n mom: 0,\n total: 0,\n ave: 0,\n },\n {\n player: 'Sat',\n played: 1,\n won: 1,\n draw: 0,\n lost: 0,\n ps: 0,\n doOut: 0,\n loy: 0,\n late: 0,\n mom: 0,\n total: 0,\n ave: 0,\n },\n {\n player: 'Rob',\n played: 1,\n won: 0,\n draw: 0,\n lost: 1,\n ps: 0,\n doOut: 0,\n loy: 0,\n late: 0,\n mom: 0,\n total: 0,\n ave: 0,\n },\n {\n player: 'Turner',\n played: 1,\n won: 0,\n draw: 0,\n lost: 1,\n ps: 0,\n doOut: 0,\n loy: 0,\n late: 0,\n mom: 0,\n total: 0,\n ave: 0,\n },\n {\n player: 'Ben',\n played: 1,\n won: 0,\n draw: 0,\n lost: 1,\n ps: 0,\n doOut: 0,\n loy: 0,\n late: 0,\n mom: 0,\n total: 0,\n ave: 0,\n },\n {\n player: 'Leigh',\n played: 1,\n won: 0,\n draw: 0,\n lost: 1,\n ps: 0,\n doOut: 0,\n loy: 0,\n late: 0,\n mom: 0,\n total: 0,\n ave: 0,\n },\n {\n player: 'Kurt',\n played: 1,\n won: 0,\n draw: 0,\n lost: 1,\n ps: 0,\n doOut: 0,\n loy: 0,\n late: 0,\n mom: 0,\n total: 0,\n ave: 0,\n },\n {\n player: 'Muz',\n played: 1,\n won: 0,\n draw: 0,\n lost: 1,\n ps: 0,\n doOut: 0,\n loy: 0,\n late: 0,\n mom: 0,\n total: 0,\n ave: 0,\n }];\n\n default:\n break;\n }\n\n return false;\n }", "title": "" }, { "docid": "1e78cf210d8a6a8044684ec07ba4a115", "score": "0.5003797", "text": "function getPoints(data) {\nvar runTimes = {};\n\n//Region = vob\n//cause = testcase\n//country = lib, bin\n\nvar points = [],\n\t\tregion_p, //vob object\n\t\tregion_val, //number of tests in vob\n\t\tregion_colorVal, //average fail color\n\t\tregion_i, //vob id\n\t\tcountry_p, //lib/bin object\n\t\tcountry_i, //lib/bin id\n\t\tcountry_colorVal, //average fail color\n\t\tcause_p, //test object\n\tcause_i,\n\t\tcause_name = [];\n\tcause_name['Communicable & other Group I'] = 'Communicable diseases';\n\tcause_name['Noncommunicable diseases'] = 'Non-communicable diseases';\n\tcause_name['Injuries'] = 'Injuries';\n\tregion_i = 0;\n\tfor (var region in data) {\n\t\tvar regionRunTimes = 0;\n\t\tregion_val = 0;\n\t\tregion_colorVal = 0;\n\t\tregion_p = {\n\t\t\tid: \"id_\" + region_i,\n\t\t\tname: region,\n\t\t};\n\t\t//Working on lib/bin\n\t\tcountry_i = 0; \n\t\tfor (var country in data[region]) {\n\t\t\tvar countryRunTimes = 0;\n\t\t\tcountry_colorVal = 0;\n\t\t\tcountry_p = {\n\t\t\t\tid: region_p.id + \"_\" + country_i,\n\t\t\t\tname: country,\n\t\t\t\tparent: region_p.id\n\t\t\t};\n\t\t\t//Working on all testcases for a lib/bin\n\t\t\tcause_i = 0;\n\t\t\tfor (var cause in data[region][country]) {\n\t\t\t\tcause_p = {\n\t\t\t\t\tid: country_p.id + \"_\" + cause_i,\n\t\t\t\t\tname: cause,\n\t\t\t\t\tparent: country_p.id,\n\t\t\t\t\tvalue: 1, \n\t\t\t\t\tcolorValue: data[region][country][cause].fail*100\n\t\t\t\t};\n\t\t\t\t//summing run times\n\t\t\t\trunTimes[cause] = data[region][country][cause].runTime;\n\t\t\t\tcountryRunTimes += runTimes[cause];\n\t\t\t\tregionRunTimes += runTimes[cause];\n\t\t\t\t\n\t\t\t\t//counting the number of tests in vob\n\t\t\t\tregion_val += cause_p.value;\n\n\t\t\t\t//Average fail color\n\t\t\t\tcountry_colorVal += cause_p.colorValue;\n\t\t\t\tpoints.push(cause_p);\n\t\t\t\tcause_i++;\n\t\t\t}\n\t\t\t//Calculate fail color for lib/bin\n\t\t\tcountry_p.colorValue = Math.round(country_colorVal/cause_i);\n\t\t\t\n\t\t\t//Get average fail color for vob\n\t\t\tregion_colorVal += country_p.colorValue;\n\t\t\tpoints.push(country_p);\n\n\t\t\t//save runtime\n\t\t\trunTimes[country] = countryRunTimes;\n\n\t\t\tcountry_i++;\n\t\t}\n\t\t//number of tests in vob\n\t\tregion_p.value = region_val;\n\t\t\n\t\t//Calculate fail color for vob\n\t\tregion_p.colorValue = Math.round((region_colorVal/country_i));\n\t\tpoints.push(region_p);\n\t\t\n\t\t//save runtime\n\t\trunTimes[region] = regionRunTimes;\n\n\t\t\n\t\tregion_i++;\n\t}\nreturn [points, runTimes];\n}", "title": "" }, { "docid": "5dba1fb41c15b9a1145fa25c4c62e324", "score": "0.50004995", "text": "function unit1(tGameID) {\n tGameID = 'mission1';\n\n function onData(missionData) {\n\n /*Earth to jupiter test\n Output from PaGMO:\n \n print prob.pretty(pop.champion.x,extended_output=True)\n \n First Leg: earth to venus\n Departure: 2015-Sep-17 13:49:13.018828 (5.738575845125329e+03 mjd2000)\n Duration: 1.507046600570814e+02 days\n r_dep: [149583595557.75269, -15337960616.091324, 548575.35572931892]\n v_dep: [3.5334116211911351, 25232.374564243608, 10.735098755528009]\n VINF_dep: 4.990055266783869e+03 m/sec\n r_arr: [-24057420511.669647, -105935429575.91315, -64140441.994200706]\n v_arr: [31097.041747761625, -18272.317776357406, -9.5870961783174042]\n VINF_arr: 1.094470796223111e+04 m/sec\n DSM after 9.136592768999805e+00 days\n DSM magnitude: 2.742936762540357e+02 m/s\n\n leg no: 2: venus to earth\n Duration: 3.419969460459592e+02 days\n Fly-by epoch: 2016-Feb-15 06:43:55.647760 (5.889280505182410e+03 mjd2000) \n Fly-by radius: 1.840531035090356e+00 planetary radii\n r_dep: [-24057420511.669647, -105935429575.91315, -64140441.994200706]\n v_dep: [35372.459518480355, -18562.94215610536, -83.113815145994579]\n VINF_dep: 1.094470796223111e+04 m/sec\n r_arr: [-78452831459.389038, 124591551468.78223, -4835891.8083695658]\n v_arr: [-20109.753861700523, -24601.892914603603, 91.561260236048497]\n VINF_arr: 1.026803366180529e+04 m/sec\n DSM after 9.140539925562753e+01 days\n DSM magnitude: 1.256212502921448e+03m/s\n\n leg no: 3: earth to earth\n Duration: 1.099851096430831e+03 days\n Fly-by epoch: 2017-Jan-22 06:39:31.786131 (6.231277451228370e+03 mjd2000) \n Fly-by radius: 5.987001833434425e+00 planetary radii\n r_dep: [-78452831459.389038, 124591551468.78223, -4835891.8083695658]\n v_dep: [-21742.469866704316, -25459.523146788677, 237.95417521138438]\n VINF_dep: 1.026803366180529e+04 m/sec\n r_arr: [-87302996707.747314, 118637493987.40306, -5412028.9030173849]\n v_arr: [-20076.948222886087, -26979.107290030002, 205.26624741208707]\n VINF_arr: 1.021062062188797e+04 m/sec\n DSM after 6.612792893993073e+02 days\n DSM magnitude: 1.912616373723135e+02m/s\n\n leg no: 4: earth to jupiter\n Duration: 8.606481314913921e+02 days\n Fly-by epoch: 2020-Jan-27 03:05:06.517755 (7.331128547659200e+03 mjd2000) \n Fly-by radius: 3.780328848710509e+01 planetary radii\n r_dep: [-87302996707.747314, 118637493987.40306, -5412028.9030173849]\n v_dep: [-20339.037643596203, -27101.764890136525, 71.570311220487028]\n VINF_dep: 1.021062062188797e+04 m/sec\n r_arr: [737418501401.09229, -90667650738.883972, -16126736596.559322]\n v_arr: [1001.454778433676, 5059.5289201269507, -74.897730861805243]\n VINF_arr: 8.537998315687802e+03 m/sec\n DSM after 1.377456958553074e+02 days\n DSM magnitude: 1.613507623256787e+04m/s\n\n Arriving at jupiter\n Arriving epoch: 2022-Jun-05 18:38:25.078611 (8.191776679150593e+03 mjd2000) \n Arriving Vinf: 8.537998315687802e+03m/s\n Total mission time: 6.716497834429197e+00 years\n \n */\n\n var centralBodyData = missionData.mission.centralBody;\n var sun = new gui.CentralBody(1, centralBodyData.name, centralBodyData.sgp, centralBodyData.radius, centralBodyData.scale, centralBodyData.isStar, centralBodyData.meshMaterialURL);\n\n var venusData = missionData.mission.orbitingBodies['4'];\n var venus = new gui.OrbitingBody(2, venusData.name, sun, venusData.orbitalElements, venusData.orbitalElementDerivatives, venusData.refEpoch, venusData.sgp, venusData.radius, venusData.minRadiusFactor, venusData.maxRadiusFactor, venusData.maxTimeOfFlight, venusData.maxLaunchDelay, venusData.arrivingOption, venusData.scale, venusData.meshMaterialURL, venusData.surface);\n\n var earthData = missionData.mission.orbitingBodies['5'];\n var earth = new gui.OrbitingBody(2, earthData.name, sun, earthData.orbitalElements, earthData.orbitalElementDerivatives, earthData.refEpoch, earthData.sgp, earthData.radius, earthData.minRadiusFactor, earthData.maxRadiusFactor, earthData.maxTimeOfFlight, earthData.maxLaunchDelay, earthData.arrivingOption, earthData.scale, earthData.meshMaterialURL, earthData.surface);\n\n var jupiterData = missionData.mission.orbitingBodies['7'];\n var jupiter = new gui.OrbitingBody(2, jupiterData.name, sun, jupiterData.orbitalElements, jupiterData.orbitalElementDerivatives, jupiterData.refEpoch, jupiterData.sgp, jupiterData.radius, jupiterData.minRadiusFactor, jupiterData.maxRadiusFactor, jupiterData.maxTimeOfFlight, jupiterData.maxLaunchDelay, jupiterData.arrivingOption, jupiterData.scale, jupiterData.meshMaterialURL, jupiterData.surface);\n\n var referenceChromosome = [5694.703447279246 + 51544,\n 0.5592076998636516,\n 0.6603929565806119,\n 4305.108010971594,\n 0.11370665594868822,\n 158.317062323004,\n 4.070798349768714,\n 1.7787431900564028,\n 0.5893383424248945,\n 314.0791211177477,\n 5.1541622014528805,\n 1.57861328849236,\n 0.10007192012704758,\n 844.8559777549118,\n -1.6651989511241556,\n 1.4848141962553134,\n 0.04440580781718439,\n 651.723019311254];\n\n console.log('Test 1: Chromosome validation');\n\n var sequence = [earth, venus, earth, earth, jupiter];\n var launchLeg = new gui.LaunchLeg(referenceChromosome.slice(0, 6), sequence[0], sequence[1])\n var firstProb = new astrodynamics.MGA1DSMLaunch(sequence[0], sequence[1], [0, 0], [0, 0], [0, 0]);\n var firstIndividual = new datastructure.Individual(firstProb, referenceChromosome.slice(0, 6));\n console.log(firstIndividual.getFitness());\n var velocityInf = launchLeg.getArrivalVelocityInf();\n var epoch = referenceChromosome[0]\n console.log(velocityInf.clone().add(sequence[1].orbitalStateVectorsAtEpoch(epoch + referenceChromosome[5]).velocity).toString());\n epoch += referenceChromosome[5];\n for (var i = 0; i < 3; i++) {\n var currentChromosome = referenceChromosome.slice(i * 4 + 6, 6 + i * 4 + 4);\n var leg = new gui.FlybyLeg(currentChromosome, sequence[i + 1], sequence[i + 2], velocityInf, epoch);\n var problem = new astrodynamics.MGA1DSMFlyby(sequence[i + 1], sequence[i + 2], epoch, velocityInf, [0, 0], [0, 0], [0, 0]);\n var individual = new datastructure.Individual(problem, currentChromosome);\n var deltaV = individual.getFitness();\n\n velocityInf = leg.getArrivalVelocityInf();\n console.log(deltaV);\n console.log(velocityInf.clone().add(sequence[i + 2].orbitalStateVectorsAtEpoch(epoch + currentChromosome[3]).velocity).toString());\n epoch += currentChromosome[3];\n }\n\n console.log(\"\\n\\n\");\n /* Chromosome Check\n PaGMO output:\n Lower bounds: [5000, 0, 0, 0, 1.0000000000000001e-05, 120, -6.2831853071795862, 1.1000000000000001, 1.0000000000000001e-05, 300, -6.2831853071795862, 1.1000000000000001, 1.0000000000000001e-05, 720, -6.2831853071795862, 1.1000000000000001, 1.0000000000000001e-05, 300]\n\t Upper bounds: [7000, 1, 1, 5000, 0.99999000000000005, 180, 6.2831853071795862, 100, 0.99999000000000005, 350, 6.2831853071795862, 100, 0.99999000000000005, 900, 6.2831853071795862, 100, 0.99999000000000005, 1000]\n \n */\n console.log('Test 2: Chromosome approximation');\n\n bounds = [\n [[5694.6977525757984 + 51544, 5694.7091419826929 + 51544],\n [0.55920714065595178, 0.55920825907135141],\n [0.66039229618765538, 0.66039361697356846],\n [4305.1037058635829, 4305.1123160796051],\n [0.11370654224203226, 0.11370676965534417],\n [158.31690400594167, 158.31722064006632]]\n,\n [[4.0707942789703644, 4.0708024205670643],\n [1.7787414113132127, 1.7787449687995929],\n [0.58933775308655201, 0.58933893176323693],\n [314.07880703862662, 314.07943519686881]]\n,\n [[5.1541570472906795, 5.1541673556150815],\n [1.5786117098790715, 1.5786148671056486],\n [0.10007182005512745, 0.1000720201989677],\n [844.85513289893402, 844.85682261088959]]\n\n,\n [[-1.6651972859252044, -1.6652006163231068],\n [1.4848127114411172, 1.4848156810695097],\n [0.044405763411376573, 0.044405852222992204],\n [651.72236758823465, 651.72367103427337]]\n];\n\n var testChromosome = [];\n var velocityInf = null;\n var epoch = 0;\n var totalDeltaV = 0;\n for (var i = 0; i < sequence.length - 1; i++) {\n var currentBounds = bounds[i];\n if (i == 0) {\n var problem = new astrodynamics.MGA1DSMLaunch(sequence[i], sequence[i + 1], currentBounds[0], currentBounds[3], currentBounds[5]);\n var solver = new algorithm.JDE(problem, 50);\n while (!solver.isFinished()) {\n solver.evolve();\n }\n var individual = solver.getSolution();\n var currentChromosome = individual.getChromosome();\n var deltaV = individual.getFitness();\n console.log('Leg ' + (i + 1));\n console.log('DeltaV: ' + deltaV);\n console.log('ToF: ' + currentChromosome[5]);\n totalDeltaV += deltaV;\n epoch = currentChromosome[0] + currentChromosome[5];\n var leg = new gui.LaunchLeg(currentChromosome, sequence[i], sequence[i + 1]);\n velocityInf = leg.getArrivalVelocityInf();\n testChromosome.push.apply(testChromosome, currentChromosome);\n } else {\n var problem = new astrodynamics.MGA1DSMFlyby(sequence[i], sequence[i + 1], epoch, velocityInf, currentBounds[3], currentBounds[1], currentBounds[0]);\n var solver = new algorithm.JDE(problem, 50);\n while (!solver.isFinished()) {\n solver.evolve();\n }\n var individual = solver.getSolution();\n var currentChromosome = individual.getChromosome();\n var deltaV = individual.getFitness();\n console.log('Leg ' + (i + 1));\n console.log('DeltaV: ' + deltaV);\n console.log('ToF: ' + currentChromosome[3]);\n totalDeltaV += deltaV;\n var currentChromosome = individual.getChromosome();\n var leg = new gui.FlybyLeg(currentChromosome, sequence[i], sequence[i + 1], velocityInf, epoch);\n epoch += currentChromosome[3];\n velocityInf = leg.getArrivalVelocityInf();\n testChromosome.push.apply(testChromosome, currentChromosome);\n }\n }\n console.log('Approximated chromosome:');\n console.log(testChromosome.prettyPrint());\n console.log('Absolute chromosome differences:');\n for (var i = 0; i < testChromosome.length; i++) {\n console.log(Math.abs(referenceChromosome[i] - testChromosome[i]));\n }\n console.log('DeltaV ' + totalDeltaV);\n\n }\n\n $.ajax({\n type: 'GET',\n url: '/missions/mission1.json',\n dataType: 'json',\n success: onData\n });\n }", "title": "" }, { "docid": "96e7d0d82bae17d44fbbddf3c2ef0bf8", "score": "0.49960575", "text": "function listenForGoalComplete() {\n const completeButton = document.getElementById('complete-goal')\n completeButton.addEventListener('click', event => {\n fetch(`${BACKEND_URL}/goals/${runnerGoal.id}`, {\n method: 'PATCH',\n headers: {\n \"Content-Type\": \"application/json\",\n 'Accept': 'application/json'\n },\n body: JSON.stringify({\n active: false\n })\n })\n .then(response => response.json())\n .then(updatedGoal => {\n runnerGoal = updatedGoal;\n showAddGoal();\n hideGoalCompleteBtn();\n initialGoalView();\n getAwardAfterCompleteGoal();\n })\n })\n }", "title": "" }, { "docid": "f5f3f682e7a379ad93711c53cdb38b37", "score": "0.49958467", "text": "function rep_report_process_data(args) {\n var meta_data = args.meta_data;\n var rep_data = args.rep_data;\n var lytd_data = args.lytd_data;\n var ytd_data = args.ytd_data;\n var dyn_col_arr = args.dynamic_cols;\n //\n // making lytd and ytd data an object keyd by rep id\n var lytd_obj = {};\n for (var i = 0; i < lytd_data.length; i++) {\n lytd_obj[lytd_data[i]['rep_id']] = lytd_data[i];\n }\n var ytd_obj = {};\n for (var i = 0; i < ytd_data.length; i++) {\n ytd_obj[ytd_data[i]['rep_id']] = ytd_data[i];\n }\n //\n // making dynamic cols an object keyed by column_name\n var dynamic_cols = {};\n for (var i = 0; i < dyn_col_arr.length; i++) {\n dynamic_cols[dyn_col_arr[i]['column_name']] = dyn_col_arr[i];\n }\n args.dynamic_cols = dynamic_cols;\n //\n // initializing rep data ytd and lytd totals\n for (var i = 0; i < rep_data.length; i++) {\n rep_data[i].lytd_total = 0.0;\n rep_data[i].ytd_total = 0.0;\n //\n if (!!(lytd_obj[rep_data[i]['rep_id']])) { rep_data[i].lytd_total = lytd_obj[rep_data[i]['rep_id']]['lytd_total'];}\n if (!!(ytd_obj[rep_data[i]['rep_id']])) { rep_data[i].ytd_total = ytd_obj[rep_data[i]['rep_id']]['ytd_total'];}\n }\n //\n // handling report data precalculations\n args.called_funs = {};\n for (var col in dynamic_cols) {\n col = args.dynamic_cols[col];\n if (col.column_type != 'precalculate') { continue;}\n var col_funct = REPORT_FUNCTIONS[col.col_function]\n if (!(col_funct)) {console.log('Error: No function for column: '+col.column_name); continue;}\n col_funct(col.column_name,args);\n }\n //\n // calling final creation function\n build_rep_report(args);\n}", "title": "" }, { "docid": "ff79f105210ae1776a6bc3806225743c", "score": "0.499536", "text": "function scoreData()\n{\n var input1Score = 0;\n var input2Score = 0;\n var input3Score = 0;\n for(var i = 0; i < gameInput.length; i +=1)\n {\n switch(gameInput[i].input)\n {\n case 1:\n input1Score += 1;\n break;\n case 2:\n input2Score += 1;\n break;\n case 3:\n input3Score += 1;\n break;\n default:\n console.log(\"Player made an invalid input\");\n break;\n };\n }\n var check = [\n {value: 1, score: input1Score},\n {value: 2, score: input2Score},\n {value: 3, score: input3Score}\n ];\n var toReward = [check[0]];\n for(var i = 1; i < check.length; i += 1) {\n if (check[i].score > toReward[0].score) {\n toReward = [];\n toReward.push(check[i])\n }\n else if (check[i].score === toReward[0].score) {\n toReward.push(check[i])\n }\n }\n io.emit(\"got-winners\", {winners: toReward});\n for(var i = 0; i < toReward.length; i +=1)\n {\n rewardScore(toReward[i].value);\n }\n}", "title": "" }, { "docid": "bcdb8fa79eefd6298084707157ca8360", "score": "0.49948186", "text": "function parseDietResults(results) {\r\n\t\tresults.forEach(element => {\r\n\t\t\tif (element.diet_no_meat === 1) element.diet_no_meat = \"Yes\";\r\n\t\t\telse element.diet_no_meat = \"No\";\r\n\r\n\t\t\tif (element.diet_no_dairy === 1) element.diet_no_dairy = \"Yes\";\r\n\t\t\telse element.diet_no_dairy = \"No\";\r\n\r\n\t\t\tif (element.diet_no_nuts === 1) element.diet_no_nuts = \"Yes\";\r\n\t\t\telse element.diet_no_nuts = \"No\";\r\n\r\n\t\t\tif (element.diet_no_shellfish === 1) element.diet_no_shellfish = \"Yes\";\r\n\t\t\telse element.diet_no_shellfish = \"No\";\r\n\r\n\t\t\tif (element.diet_no_carbs === 1) element.diet_no_carbs = \"Yes\";\r\n\t\t\telse element.diet_no_carbs = \"No\";\r\n\r\n\t\t\tif (element.diet_no_animal_products === 1) element.diet_no_animal_products = \"Yes\";\r\n\t\t\telse element.diet_no_animal_products = \"No\";\r\n\r\n\t\t\tif (element.diet_no_gluten === 1) element.diet_no_gluten = \"Yes\";\r\n\t\t\telse element.diet_no_gluten = \"No\";\r\n\r\n\t\t\tif (element.diet_no_soy === 1) element.diet_no_soy = \"Yes\";\r\n\t\t\telse element.diet_no_soy = \"No\";\r\n\t\t});\r\n }", "title": "" }, { "docid": "1d5baa0f54b99b0f769053331222da17", "score": "0.4994791", "text": "processData(data) {\n\t\t// d3 enter/update/exit\n\t}", "title": "" }, { "docid": "e8e035140993b5563865b306737666d4", "score": "0.4986875", "text": "handle(event, context) {\n return __awaiter(this, void 0, void 0, function* () {\n const failedGoal = event.data.SdmGoal[0];\n if (failedGoal.state !== \"failure\") { // atomisthq/automation-api#395\n automation_client_1.logger.debug(`Nevermind: failure reported when the state was=[${failedGoal.state}]`);\n return Promise.resolve(automation_client_1.Success);\n }\n const id = repoRef_1.repoRefFromSdmGoal(failedGoal, yield RequestDownstreamGoalsOnGoalSuccess_1.fetchScmProvider(context, failedGoal.repo.providerId));\n const goals = RequestDownstreamGoalsOnGoalSuccess_1.sumSdmGoalEventsByOverride(yield fetchGoalsOnCommit_1.fetchGoalsForCommit(context, id, failedGoal.repo.providerId), [failedGoal]);\n const goalsToSkip = goals.filter(g => isDependentOn(failedGoal, g, mapKeyToGoal(goals)))\n .filter(g => g.state === \"planned\");\n yield Promise.all(goalsToSkip.map(g => storeGoals_1.updateGoal(context, g, {\n state: \"skipped\",\n description: `Skipped ${g.name} because ${failedGoal.name} failed`,\n })));\n return automation_client_1.Success;\n });\n }", "title": "" }, { "docid": "cd40d67e6798677014a07b3d32379df7", "score": "0.49808183", "text": "fill_in_data(data) {\n for(let tuple of this.questions) { // [question, response]\n let text = tuple[0];\n let name = this.response_name;\n let known_response = data.lookup(text, name).response;\n tuple[1] = known_response;\n }\n }", "title": "" } ]
1bb1a7497a6a08a8e3b68be17acb2c1d
Open the canvas effect
[ { "docid": "cc4820a48a7c74aea02e9be10bcde034", "score": "0.67006296", "text": "function openCanvas(id) {\n var canvas = document.getElementById('canvas');\n var element = document.getElementById(id);\n\n if (canvas.classList.contains('open')) return;\n\n element.classList.remove('hidden');\n\n canvas.classList.add('open');\n canvas.classList.add('split');\n\n setTimeout(function() {\n document.getElementById('siteTop').classList.add('shadow');\n document.getElementById('siteBottom').classList.add('shadow');\n }, 40);\n\n setTimeout(function() {\n element.classList.add('in');\n }, 1000);\n}", "title": "" } ]
[ { "docid": "65f85195c5928891013fcf70868fa5c4", "score": "0.6829126", "text": "function CanvasTool() {}", "title": "" }, { "docid": "a2cd521facecfe3313d2c0792720f9d7", "score": "0.68096375", "text": "function openCanvas() {\n requestPointerLock();\n var cnv = createCanvas(windowWidth, windowHeight);// take the divide by 2 out for full screen.\n cnv.position(0, 0, 'fixed');\n pixelDensity(1); // for high-denstity displays\n background(255, 0, 0);\n return;\n}", "title": "" }, { "docid": "e316fee4c449b18fccbb3306ebd7d65f", "score": "0.6623087", "text": "function _onOpen() {\n\tdraw();\n}", "title": "" }, { "docid": "58bff679c1d5ed059ca37cb142432a10", "score": "0.6589324", "text": "function openCanvas() {\n document.getElementById(\"myCanvas\").style.width = \"100%\";\n\tdocument.getElementById(\"myCanvas\").style.backgroundColor = \"rgba(0, 0, 0, 0.9)\";\n\tdocument.getElementById(\"canvasImage\").style.opacity = \"1\";\n\tdocument.getElementById(\"canvasImage\").style.backgroundColor = \"white\";\n\tdocument.getElementById(\"canvasImage\").style.border = \"10px solid #A9A9A9\";\n\tdocument.getElementById(\"closeCanvasBtn\").style.opacity = \"1\";\n\tdocument.getElementById(\"saver\").style.visibility = \"visible\";\n}", "title": "" }, { "docid": "6e45b9c60b1da47cb2cd907ee22bd70d", "score": "0.6570357", "text": "function fire() {\n show('canvas')\n show('off-button')\n show('on-angle')\n hide('on-button')\n\n}", "title": "" }, { "docid": "34d85a311d2bc69c440f2b08f4393276", "score": "0.6493673", "text": "function openCanvas() {\n \n canvas = document.createElement(\"canvas\");\n canvas.width = CANVAS_WIDTH;\n canvas.height = CANVAS_HEIGHT;\n\tvar div = document.getElementById(\"levelCreator\");\n div.appendChild(canvas);\n \n}", "title": "" }, { "docid": "282b93993981f6cf975ecd98bd74b859", "score": "0.64841694", "text": "function setup(){\n var imgs = document.querySelectorAll('img[data-wea-src]');\n imgs.forEach(function(i){\n i.addEventListener('click',drawFacs);\n });\n document.getElementById('facs_closer').addEventListener('click', function(){\n var body = document.getElementsByTagName('body')[0];\n body.classList.remove('facs-overlay');\n var fcv = document.getElementById('facsViewerContainer');\n fcv.classList.remove('open');\n fcv.classList.remove('loaded');\n if (window.stop !== undefined){\n window.stop();\n }\n else if (document.execCommand !== undefined){\n document.execCommand(\"Stop\", false);\n }\n \n });\n var canvas = document.getElementsByTagName('canvas')[0];\n canvas.setAttribute('data-width', canWidth);\n canvas.setAttribute('data-height', canHeight);\n/* addFullScreenHandling();*/\n}", "title": "" }, { "docid": "35d3f7437af9abbbccf63f45b471587e", "score": "0.6422679", "text": "function _canvas()\n {\n\n }", "title": "" }, { "docid": "b7d2fee941dc74705fe7c9d6e0f5a508", "score": "0.6305269", "text": "function showChalkboard() {\n\t\t//console.log(\"showChalkboard\");\n\t\tclearTimeout(touchTimeout);\n\t\ttouchTimeout = null;\n\t\tdrawingCanvas[0].sponge.style.visibility = 'hidden'; // make sure that the sponge from touch events is hidden\n\t\tdrawingCanvas[1].sponge.style.visibility = 'hidden'; // make sure that the sponge from touch events is hidden\n\t\tdrawingCanvas[1].container.style.opacity = 1;\n\t\tdrawingCanvas[1].container.style.visibility = 'visible';\n\t\tmode = 1;\n\t}", "title": "" }, { "docid": "923d26ec7cd3cef338de1cb9cc07a8e9", "score": "0.627429", "text": "function start() {\n // Define mouse event handlers\n canvas.onmouseup = function (e) {\n mouse.down = false;\n e.preventDefault();\n };\n canvas.onmousemove = function (e) {\n mouse.px = mouse.x;\n mouse.py = mouse.y;\n var rect = canvas.getBoundingClientRect();\n mouse.x = e.clientX - rect.left,\n mouse.y = e.clientY - rect.top,\n mouse.down = true;\n e.preventDefault();\n };\n // Define touch event handlers (for mobile)\n canvas.ontouchstart = function (e) {\n mouse.down = true;\n e.preventDefault();\n };\n canvas.ontouchmove = function (e) {\n mouse.px = mouse.x;\n mouse.py = mouse.y;\n var rect = canvas.getBoundingClientRect();\n mouse.x = e.touches[0].clientX - rect.left,\n mouse.y = e.touches[0].clientY - rect.top;\n e.preventDefault();\n };\n canvas.ontouchend = function (e) {\n mouse.down = false;\n e.preventDefault();\n };\n // Prevent context menu on touch and long press\n canvas.oncontextmenu = function (e) {\n e.preventDefault();\n };\n // Set canvas bounds\n boundsx = canvas.width - 1;\n boundsy = canvas.height - 1;\n // Set stroke color\n ctx.strokeStyle = 'goldenrod';\n // Initialize the cloth simulation\n cloth = new Cloth();\n cloth.initClothWithRandomColors();\n // Start the animation loop\n isAnimating = true;\n animate();\n}", "title": "" }, { "docid": "f55161209e69f814ce997b157150a36b", "score": "0.62709576", "text": "initCanvas(canvas) {\n canvas.style.border = \"solid 1px black\";\n canvas.style.background = \"black\";\n canvas.width = this.canvasWidth;\n canvas.height = this.canvasHeight;\n // lighter creates bright highlight points as the events overlap each other\n //this.ctx.globalCompositeOperation = \"lighter\";\n }", "title": "" }, { "docid": "f748870e4ff5d09d1a228c9f72da2549", "score": "0.6210462", "text": "function Canvas(){}", "title": "" }, { "docid": "77be1c02bf89592717641d62204dc3e0", "score": "0.62015104", "text": "function showCanvas(next){\n $('#mr_Canvas').fadeTo('fast',1);\n //next();\n}", "title": "" }, { "docid": "0ae507bab4bb5acdd89571790cc88469", "score": "0.6191903", "text": "show(canvas){\n canvas = (canvas == undefined)? mainCanvas : canvas;\n canvas.push();\n canvas.noStroke(); //Without borders\n canvas.fill(this.c); //Fill with sticker's color\n //Place at correct position\n canvas.rotateX(this.rX); //Rotate on the X axis\n canvas.rotateY(this.rY); //Rotate on the Y axis\n canvas.translate(0,0, this.width * 0.52); //Translate to the face of the cube (width * (0.5 + offset to see the sticker)).\n \n canvas.plane(this.width * this.wPercent); //Draw the sticker a bit smaller than the piece\n canvas.pop();\n }", "title": "" }, { "docid": "0a3a18374e5fbad349f2c6dd070398cc", "score": "0.61907965", "text": "show(){\n stroke(180, 180, 180, 180);\n fill(this.red, this.green, this.blue, this.alpha);\n ellipse(this.pos.x, this.pos.y, this.r);\n }", "title": "" }, { "docid": "0e56d3f7316037b1cd508bc669f1e35b", "score": "0.6159709", "text": "show() {\n // if the inky is in eaten mode\n // set the inky to be translucent\n if (this.mode.eaten) {\n fill(0, 255, 255, 30);\n\n // if the inky is in frightened mode\n // set the inky to be blue\n } else if (this.mode.frightened) {\n fill(0, 0, 255);\n\n } else {\n // if the inky is in either scatter or chase mode, just put to aqua (original colour)\n fill(0, 255, 255);\n }\n noStroke();\n ellipse(this.currentPosition.x, this.currentPosition.y, this.width);\n }", "title": "" }, { "docid": "7b44f5e0bce2406bd3a30413d869aab4", "score": "0.615942", "text": "show(){\n // Make the Goal red\n fill(200, 0, 0);\n ellipse(this.pos.x, this.pos.y, 20, 20);\n }", "title": "" }, { "docid": "2e873b7b09100bc6c4ae9aac7cd8e8b4", "score": "0.6157591", "text": "show() {\n // if the pinky is in eaten mode\n // set the pinky to be translucent\n if (this.mode.eaten) {\n fill(255, 184, 255, 30);\n\n // if the pinky is in frightened mode\n // set the pinky to be blue\n } else if (this.mode.frightened) {\n fill(0, 0, 255);\n\n } else {\n // if the pinky is in either scatter or chase mode, just put to pink (original colour)\n fill(255, 184, 255);\n }\n noStroke();\n ellipse(this.currentPosition.x, this.currentPosition.y, this.width);\n }", "title": "" }, { "docid": "ede9a805fe7a79ff7d696cded2245ad8", "score": "0.61499745", "text": "function createCanvas() {\n\t\tinit();\t\t\t\t\t\t\t\t// initialize canvas\n\t\tanimate();\t\t\t\t\t\t\t// inimates cloud objects\n\t}", "title": "" }, { "docid": "cbbef3ae185886340bc4f337ee9fadb4", "score": "0.6104523", "text": "run () {\n this.canvasEngine.run()\n }", "title": "" }, { "docid": "97c9b6cb6be853331585eaf94cb4d498", "score": "0.6091809", "text": "show() {\n drawCircleFx(this.fx_, this.fy_,this.r_,this.color_);\n }", "title": "" }, { "docid": "08e985b8925f40ad5c9a0006021ed892", "score": "0.6087229", "text": "show() {\n if (this.closeCallback !== undefined) {\n this.closeCallback();\n this.closeCallback = undefined;\n }\n\n this.applied = false;\n this.frame.style.display = 'block';\n this._generateHueCircle();\n }", "title": "" }, { "docid": "70770facb8767a4f66c2d13c0bee0d78", "score": "0.60686404", "text": "function setTarget(){\n ctx.drawImage(cible,CX,CY);\n}", "title": "" }, { "docid": "eebdda2c864043eac8b68ffc3edc2880", "score": "0.60191256", "text": "function canvasMain(canvasName) {\n // Create new c3dl.Scene object\n scn = new c3dl.Scene();\n scn.setCanvasTag(canvasName);\n var canvas = scn.getCanvas();\n var myWidth = window.innerWidth; \n CANVAS_WIDTH = canvas.width = Math.floor(myWidth*0.6);\n CANVAS_HEIGHT = canvas.height = Math.floor(Math.round(9 * canvas.width / 16));\n //empty hidden feild of objects\n show2d();\n //set widgets\n mWidget = new MoveWidget;\n sWidget = new ScaleWidget;\n rWidget = new RotateWidget;\n // Create GL context\n var renderer = new c3dl.WebGL();\n renderer.createRenderer(this);\n //turn collision off \n scn.setCollision(false);\n // Attach renderer to the scene\n scn.setRenderer(renderer);\n drawRoofandFloor();\n if (scn.init(canvasName)) {\n //remove progress bar \n document.getElementById(\"loading\").setAttribute(\"style\", \"display:none;\");\n lightEffect = new c3dl.Effect();\n lightEffect.init(c3dl.effects.LIGHTSOURCE);\n scn.setCulling(\"All\");\n //skybox\n sm = new c3dl.Collada();\n sm.init(\"./models/sky/skysphere.dae\");\n sm.setTexture(\"./models/sky/sky.jpg\");\n\n // Effect used when widget objects are selected\n selectedEffect = new c3dl.Effect();\n selectedEffect.init(c3dl.effects.SEPIA);\n selectedEffect.setParameter(\"color\", [10, 10, 0]);\n scn.setAmbientLight([0, 0, 0, 0]);\n objects[numObjects] = new SceneObject() \n objects[numObjects].init(CEILINGLIGHT_PATH, 'object', 'ceiling', false, 'Name', 'Description', 'images/sidebar/ceilinglight.jpg', false, true, [0.05, 0.05, 0.05]);\n objects[numObjects].model.setPosition([0, 15 - (objects[numObjects].model.getHeight() / 2), 0]);\n objects[numObjects].light.setPosition(objects[numObjects].model.getPosition());\n scn.addObjectToScene(objects[numObjects++].model);\n\n\n var floor = [];\n var xOffset = -150,\n zOffset = -150;\n for (var i = 0; i < 4; i++) {\n for (var j = 0; j < 4; j++) {\n floor[i] = new c3dl.Collada();\n floor[i].init(FLOOR_PATH);\n floor[i].centerObject();\n floor[i].scale([10, 1, 10]);\n floor[i].setPickable(false);\n scn.addObjectToScene(floor[i]);\n floor[i].setPosition([xOffset, -0.02, zOffset]);\n floor[i].setStatic(true);\n xOffset += 100;\n }\n xOffset = -150;\n zOffset += 100;\n }\n\n //create an object\n createWall([-25, 0, -25], [25, 0, -25]);\n createWall([25, 0, -25], [25, 0, 25]);\n createWall([25, 0, 25], [-25, 0, 25]);\n createWall([-25, 0, 25], [-25, 0, -25]);\n \n cam[0].setPosition([0, 50, 1]);\n zcam[0].setPosition(cam[0].getPosition());\n zcam[0].setLookAtPoint([0.0, 0.0, 0.0]);\n // Place the camera at the origin.\n // Canvas3d uses a right handed co-ordinate system.\n cam[1].setPosition(new Array(0, camHeight, 24));\n newCamHeight = camHeight;\n // Point the camera.\n // Here it is pointed directly along the z-axis\n zcam[1].setPosition(cam[1].getPosition());\n zcam[1].setLookAtPoint([0.0, 5.0, 0.0]);\n cam[2].setPosition(new Array(24, camHeight, 0));\n zcam[2].setPosition(cam[2].getPosition());\n zcam[2].setLookAtPoint([0.0, 5.0, 0.0]);\n cam[3].setPosition(new Array(0, camHeight, -24));\n zcam[3].setPosition(cam[3].getPosition());\n zcam[3].setLookAtPoint([0.0, 5.0, 0.0]);\n cam[4].setPosition(new Array(-24, camHeight, 0));\n zcam[4].setPosition(cam[4].getPosition());\n zcam[4].setLookAtPoint([0.0, 5.0, 0.0]);\n // Add the camera to the scene\n scn.setCamera(zcam[currentCam]);\n scn.setSkyModel(sm);\n // Start the scene\n scn.startScene();\n // tell the scene what function to use when\n // a mouse event is detected\n scn.setUpdateCallback(update);\n scn.setKeyboardCallback(onKeyUp, onKeyDown);\n scn.setMouseCallback(mouseUp, mouseDown, mouseMove, mouseWheel);\n scn.setPickingCallback(pickingHandler);\n }\n }", "title": "" }, { "docid": "f5966cda734e17122328bf314d78e753", "score": "0.60065025", "text": "open() {\n\n this.menuButton.classList.toggle('menu-hidden');\n this.closeButton.classList.toggle('closebtn-hidden');\n this.tween.play();\n }", "title": "" }, { "docid": "8f7b38cc22c9d0e5ed2bef5db3fc5e62", "score": "0.6004882", "text": "show() {\n fill(color(this.color));\n ellipse(this.pos.x, this.pos.y, this.radius * 2, this.radius * 2);\n }", "title": "" }, { "docid": "5b405a37de5e640783bcd5fb124f5409", "score": "0.6002544", "text": "show () {\n this.simulatorCanvas.show();\n this.simulatorCanvas.logic();\n }", "title": "" }, { "docid": "334738d9cd60eb629403c1e3b80e3e39", "score": "0.5996406", "text": "show() {\n if (this.target != null) {\n image(this.image, this.position.x, this.position.y, 70, 70);\n }\n }", "title": "" }, { "docid": "0f6eb974fc907e59864e151b6699c3cd", "score": "0.5990509", "text": "overlay()\n {\n // let grd = this.canvas.createRadialGradient(winWidth, winHeight/2, 0, winWidth/2, winHeight/2, winWidth);\n // grd.addColorStop(0,\"rgba(25,25,54,0.22)\");\n // grd.addColorStop(1,\"rgba(0,0,20,0.01)\");\n // this.canvas.fillStyle=grd;\n\n this.context.fillStyle='rgba(255,255,255,0.1)';//grd;\n this.context.fillRect(0, 0, this.options.canvas.width, this.options.canvas.height);\n }", "title": "" }, { "docid": "96348d41ccc29a6a6cc6f9d25b0680f1", "score": "0.5990322", "text": "function SetCanvasEffects() {\n setInterval(MeterEffects, 1);\n setInterval(pulseE, 1);\n setInterval(pulseHeader, 1);\n g_bgctx.fillStyle = \"rgba(0,0,0,0.5)\";\n setInterval(\"fadeToBlack(g_bgctx, .05)\", 40);\n}", "title": "" }, { "docid": "15729d186e95807ed85e77fe14019e3d", "score": "0.5984336", "text": "function draw()\n{\n canvas1();\n}", "title": "" }, { "docid": "a1520798ebcad9d50d8f977a387b11ea", "score": "0.5984212", "text": "function slide() {\n\t\tvar date = new Date();\n\t\t\n\t\tcontext.globalAlpha = 0;\n\t\tslideInterval = window.setInterval(function() {\n\t\t\tcontext.fillStyle = \"black\";\n\t\t\tcontext.globalAlpha += 0.02;\n\t\t\tcontext.fillRect(0, 0, canvas.width, canvas.height);\n\t\t}, 50);\n\t}", "title": "" }, { "docid": "ca2ea5d0cbd57737b66e21822100b0ba", "score": "0.59486455", "text": "static function draw() {\n if(!draw_controls) return;\n sketch.push();\n sketch.resetMatrix();\n sketch.image(volume_overlay, draw_x, draw_y);\n sketch.pop();\n }", "title": "" }, { "docid": "5d725ed75a275d1d98887c9b620b16b6", "score": "0.5944239", "text": "function Lib() {\n CanvasTool.call(this);\n }", "title": "" }, { "docid": "c186b8fe590f862b35220e5f0cc2d848", "score": "0.59438396", "text": "show() {\n imageMode(CENTER)\n image(circleShape, this.circleX, this.circleY, this.circleW, this.circleW);\n }", "title": "" }, { "docid": "0920193da6acec3278e3b143dd1ef583", "score": "0.59174895", "text": "show(){\n\n //image.width = 100px\n //image.height = 80px\n c.drawImage(lightningCloud, this.x, this.y, this.width, this.height);\n\n }", "title": "" }, { "docid": "a17169189f2545d85d5f604bc88644fd", "score": "0.5916703", "text": "handleCanvasClick(canvas){\n const ctx = canvas.getContext('2d');\n\n if(this.filling){\n ctx.fillRect(0, 0, this.CANVAS_SIZE_WIDTH, this.CANVAS_SIZE_HEIGHT);\n }\n }", "title": "" }, { "docid": "955601b7e05381123e59bf85557aba14", "score": "0.5899337", "text": "function CanvasDrawing()\n{\n}", "title": "" }, { "docid": "44424a65d9fe73bd91fdf5fd09399ab6", "score": "0.588787", "text": "function initial_state_kitschyAnim()\n{\t\n\tstop();\n clear();\n\t//he starts from the right side of the canvas\n x=1200;\n y=225;\n dy=0;\n dx = 3;\n\tif (colourful==0)\n\t\tpicture=\"img3\";\n\telse\n\t\tpicture=\"img7\";\n}", "title": "" }, { "docid": "e03b5d116dfb31d526ac9827d0203edc", "score": "0.58788127", "text": "function drawCanvas() {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n var assetsToBuild = [...assets.values()].flat();\n for (var s in assetsToBuild) {\n var img = document.getElementById(`${assetsToBuild[s].type}-img`);\n ctx.drawImage(img, assetsToBuild[s].x, assetsToBuild[s].y, 50, 50);\n };\n if (tools.activeTool()) {\n var tempImg = document.getElementById(`${tools.activeTool().id}-img`);\n tools.activeTool() ? ctx.drawImage(tempImg, temporaryPosition.x * positionModifier + positionOffset, temporaryPosition.y * positionModifier + positionOffset, 50, 50) : null;\n }\n}", "title": "" }, { "docid": "4dfe4e8ea358248ab3eed41ab39bd5b1", "score": "0.5878093", "text": "function initCanvas(name) {\n var newCanvas = $(\"<canvas>\");\n newCanvas.className(`layer-canvas ${name}-canvas`);\n Project.Canvas.resizeCanvases([newCanvas]);\n Project.Draw[name].canvas = newCanvas;\n Project.Draw[name].ctx = newCanvas[0].getContext(\"2d\");\n $(\".top-canvases\").append(newCanvas);\n }", "title": "" }, { "docid": "87d18935faab3ec19516665e7f533dbe", "score": "0.58780724", "text": "whiten() {\r\n this.context.fillStyle = \"#ffffff\";\r\n this.context.fillRect(0, 0, this.canvas.width, this.canvas.height);\r\n }", "title": "" }, { "docid": "387ebcc9d1009bb2070c34468fc0e760", "score": "0.5867836", "text": "function doWindow(){\n if(imageIsLoaded(windowImage)){\n windowPane();\n windowImage.drawTo(canvas);\n }\n}", "title": "" }, { "docid": "582b8eaeb78c86f5e01974b5f58e3fe0", "score": "0.58646214", "text": "function focusCanvas () {\n canvas.focus();\n }", "title": "" }, { "docid": "8d8d064edcfe234cb1ac84a9d2a357f8", "score": "0.5863067", "text": "function startCanvas() {\n neutralImage = new component(0.45*screen.width, 0.5*screen.height, \"mainImage\", 0.13*screen.width, 0.105*screen.height, \"image\", 0, \"mainImageVisibility\");\n\n shopCanvas = new component(0.55*screen.width, 0.55*screen.height, \"#FBFCFC\", 0.065*screen.width, 0.08*screen.height, \"backgroundColor\", 0, \"menuBackground\");\n shopClose = new createButton(0.07*screen.width, 0.09*screen.height, 0.13*screen.width, 0.15*screen.height, \"closeAll();\", \"shopClose\");\n\n petFoodOne = new component(0.08*screen.width, 0.11*screen.height, \"orange.png\", 0.15*screen.width, 0.14*screen.height, \"image\", 0, \"listOfFoods\");\n petFoodTwo = new component(0.08*screen.width, 0.11*screen.height, \"wheat.png\", 0.30*screen.width, 0.14*screen.height, \"image\", 0, \"listOfFoods\");\n petFoodThree = new component(0.08*screen.width, 0.11*screen.height, \"meat.png\", 0.45*screen.width, 0.14*screen.height, \"image\", 0, \"listOfFoods\");\n petFoodFour = new component(0.08*screen.width, 0.14*screen.height, \"fish_food.png\", 0.155*screen.width, 0.36*screen.height, \"image\", 0, \"listOfFoods\");\n petFoodFive = new component(0.08*screen.width, 0.13*screen.height, \"premium_food.png\", 0.30*screen.width, 0.37*screen.height, \"image\", 0, \"listOfFoods\");\n petFoodSix = new component(0.08*screen.width, 0.12*screen.height, \"earthworm.png\", 0.45*screen.width, 0.38*screen.height, \"image\", 0, \"listOfFoods\");\n\n petToyOne = new component(0.08*screen.width, 0.13*screen.height, \"teddy.png\", 0.15*screen.width, 0.12*screen.height, \"image\", 0, \"listOfToys\");\n petToyTwo = new component(0.08*screen.width, 0.09*screen.height, \"car.png\", 0.30*screen.width, 0.16*screen.height, \"image\", 0, \"listOfToys\");\n petToyThree = new component(0.08*screen.width, 0.13*screen.height, \"train.png\", 0.45*screen.width, 0.12*screen.height, \"image\", 0, \"listOfToys\");\n petToyFour = new component(0.08*screen.width, 0.14*screen.height, \"bone.png\", 0.155*screen.width, 0.36*screen.height, \"image\", 0, \"listOfToys\");\n petToyFive = new component(0.08*screen.width, 0.13*screen.height, \"ball.png\", 0.30*screen.width, 0.37*screen.height, \"image\", 0, \"listOfToys\");\n petToySix = new component(0.08*screen.width, 0.12*screen.height, \"duck_plushie.png\", 0.45*screen.width, 0.38*screen.height, \"image\", 0, \"listOfToys\");\n\n foodOneBuy = new createButton(0.08*screen.width, 0.035*screen.height, 0.204*screen.width, 0.31*screen.height, \"purchaseItem(1);\", \"buyButton\", \"buyButton\", \"Cost: 5 Gold\", \"15px Optima\", \"#708090\");\n foodTwoBuy = new createButton(0.08*screen.width, 0.035*screen.height, 0.35*screen.width, 0.31*screen.height, \"purchaseItem(2);\", \"buyButton\", \"buyButton\", \"Cost: 10 Gold\", \"15px Optima\", \"#708090\");\n foodThreeBuy = new createButton(0.08*screen.width, 0.035*screen.height, 0.5*screen.width, 0.31*screen.height, \"purchaseItem(3);\", \"buyButton\", \"buyButton\", \"Cost: 15 Gold\", \"15px Optima\", \"#708090\");\n foodFourBuy = new createButton(0.08*screen.width, 0.035*screen.height, 0.204*screen.width, 0.56*screen.height, \"purchaseItem(4);\", \"buyButton\", \"buyButton\", \"Cost: 25 Gold\", \"15px Optima\", \"#708090\");\n foodFiveBuy = new createButton(0.08*screen.width, 0.035*screen.height, 0.35*screen.width, 0.56*screen.height, \"purchaseItem(5);\", \"buyButton\", \"buyButton\", \"Cost: 50 Gold\", \"15px Optima\", \"#708090\");\n foodSixBuy = new createButton(0.08*screen.width, 0.035*screen.height, 0.5*screen.width, 0.56*screen.height, \"purchaseItem(6);\", \"buyButton\", \"buyButton\", \"Cost: 100 Gold\", \"15px Optima\", \"#708090\");\n\n foodOneFeed = new createButton(0.08*screen.width, 0.035*screen.height, 0.204*screen.width, 0.31*screen.height, \"useItem(1);\", \"petItemOne\", \"useButton\", \"\", \"15px Optima\", \"#D3D3D3\");\n foodTwoFeed = new createButton(0.08*screen.width, 0.035*screen.height, 0.35*screen.width, 0.31*screen.height, \"useItem(2);\", \"petItemTwo\", \"useButton\", \"\", \"15px Optima\", \"#D3D3D3\");\n foodThreeFeed = new createButton(0.08*screen.width, 0.035*screen.height, 0.5*screen.width, 0.31*screen.height, \"useItem(3);\", \"petItemThree\", \"useButton\", \"\", \"15px Optima\", \"#D3D3D3\");\n foodFourFeed = new createButton(0.08*screen.width, 0.035*screen.height, 0.204*screen.width, 0.56*screen.height, \"useItem(4);\", \"petItemFour\", \"useButton\", \"\", \"15px Optima\", \"#D3D3D3\");\n foodFiveFeed = new createButton(0.08*screen.width, 0.035*screen.height, 0.35*screen.width, 0.56*screen.height, \"useItem(5);\", \"petItemFive\", \"useButton\", \"\", \"15px Optima\", \"#D3D3D3\");\n foodSixFeed = new createButton(0.08*screen.width, 0.035*screen.height, 0.5*screen.width, 0.56*screen.height, \"useItem(6);\", \"petItemSix\", \"useButton\", \"\", \"15px Optima\", \"#D3D3D3\");\n\n shopNextPage = new createButton(0.07*screen.width, 0.09*screen.height, 0.615*screen.width, 0.64*screen.height, \"nextShop();\", \"nextShop\", \"shopPage\");\n shopBackPage = new createButton(0.07*screen.width, 0.09*screen.height, 0.13*screen.width, 0.64*screen.height, \"backShop();\", \"backShop\", \"shopPage\");\n\n rightSideCanvas = new component(0.22*screen.width, 0.8*screen.height, \"#20B2AA\", 0.68*screen.width, 0, \"color\");\n botSideCanvas = new component(0.68*screen.width, 0.1*screen.height, \"#FFDAB9\", 0, 0.7*screen.height, \"color\");\n\n buttonOne = new createButton(0.17*screen.width, 0.06*screen.height, 0.755*screen.width, 0.1*screen.height, \"openYoutube();\", \"buttonOne\", \"menuButton\", \"Watch YouTube\");\n buttonTwo = new createButton(0.17*screen.width, 0.06*screen.height, 0.755*screen.width, 0.2*screen.height, \"openCookie();\", \"buttonTwo\", \"menuButton\", \"Gold Cookie\");\n buttonThree = new createButton(0.17*screen.width, 0.06*screen.height, 0.755*screen.width, 0.3*screen.height, \"openShop();\", \"buttonThree\", \"menuButton\", \"Shop\");\n buttonFour = new createButton(0.17*screen.width, 0.06*screen.height, 0.755*screen.width, 0.4*screen.height, \"openInventory();\", \"buttonFour\", \"menuButton\", \"Inventory\");\n\n infoButton = new createButton(0.07*screen.width, 0.09*screen.height, 0.689*screen.width, 0.7*screen.height, \"openInfo();\", \"infoButton\", \"infoButton\");\n\n cookieClicker = new createButton(0.2*screen.width, 0.3*screen.height, 0.29*screen.width, 0.25*screen.height, \"addGold();\", \"cookieClicker\", \"cookieClicker\");\n\n // Currently, the hungerBar reduces to zero in two hours.\n hungerBar = new component(0.177*screen.width, 0.04*screen.height, \"#F7B267\", 0.7*screen.width, 0.5*screen.height, \"scoreBar\", (20 / (10 * 1000)) * 0.177*screen.width);\n myCanvasArea.start(); // Loads the main canvas.\n}", "title": "" }, { "docid": "25016455c46f076b9e3037fde838dab4", "score": "0.5858656", "text": "function openCanvas() {\n \n canvas = document.createElement(\"canvas\");\n canvas.width = CANVAS_WIDTH;\n canvas.height = CANVAS_HEIGHT;\n\tvar div = document.getElementById(\"gameTest\");\n div.appendChild(canvas);\n \n}", "title": "" }, { "docid": "077814106a62a22e4f66e56956a18991", "score": "0.5857096", "text": "draw(ctx) {}", "title": "" }, { "docid": "334f000783f7500d5bbc80349d854379", "score": "0.5848262", "text": "function keeprunning(){\r\n\tvar app = createApp(document.querySelector(\"canvas\"))\r\n\tdocument.getElementById(\"build\").onclick = app.build\r\n\t}", "title": "" }, { "docid": "8e4dad96f2278084414c48fd2d1a5b37", "score": "0.58429325", "text": "show() {\n fill(127);\n stroke(125);\n push();\n var pos = this.body.position;\n translate(pos.x, pos.y);\n ellipse(0, 0, this.r * 2);\n pop();\n }", "title": "" }, { "docid": "4b08989f3edd5c09bafece01dd0526c3", "score": "0.5840512", "text": "function create() {\n var container = document.getElementById('revealCanvas');\n init(container, 640, 480, '#ddd');;\n}", "title": "" }, { "docid": "92ed4308ab04d9b3fe6c83d936ac17f4", "score": "0.58334434", "text": "show() {\n this.body = canvas.append(\"circle\")\n .attr(\"class\", \"ball\")\n .attr(\"cx\", this.x)\n .attr(\"cy\", this.y)\n .attr(\"r\", this.r)\n .attr(\"fill\", \"red\")\n .attr(\"stroke-width\", 2)\n .attr(\"stroke\", \"darkred\");\n }", "title": "" }, { "docid": "4cdfc920353cc89d8f68f785067b15ad", "score": "0.5831076", "text": "open() {\n if (this.isSurfaceOpen) {\n return;\n }\n this.adapter.notifyOpening();\n this.adapter.saveFocus();\n if (this.isQuickOpen) {\n this.isSurfaceOpen = true;\n this.adapter.addClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);\n this.dimensions = this.adapter.getInnerDimensions();\n this.autoposition();\n this.adapter.notifyOpen();\n }\n else {\n this.adapter.addClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_OPEN);\n this.animationRequestId = requestAnimationFrame(() => {\n this.dimensions = this.adapter.getInnerDimensions();\n this.autoposition();\n this.adapter.addClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);\n this.openAnimationEndTimerId = setTimeout(() => {\n this.openAnimationEndTimerId = 0;\n this.adapter.removeClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_OPEN);\n this.adapter.notifyOpen();\n }, numbers.TRANSITION_OPEN_DURATION);\n });\n this.isSurfaceOpen = true;\n }\n }", "title": "" }, { "docid": "b691ff0d633c742a4e91d19d806ccbbe", "score": "0.5824816", "text": "show() {\r\n noStroke()\r\n fill(this.r, this.g, 0, this.opacity)\r\n ellipse(this.x, this.y, this.size, this.size)\r\n }", "title": "" }, { "docid": "60272f97555812eadaef0121c493f9ed", "score": "0.581318", "text": "function setup() {\n\ncreateCanvas(700, 700);\nsmooth();\nbackground(0);\n\n}", "title": "" }, { "docid": "650970de8de0707e19a3236c3dc3479e", "score": "0.58116764", "text": "function initCanvases() {\n image = img; //Sets the global image variable to the locally created img \n\n image_canvas = document.getElementById('mainImage');\n mesh_canvas = document.getElementById('meshLayer');\n color_canvas = document.getElementById('colorLayer');\n\n image_context = image_canvas.getContext('2d');\n mesh_context = mesh_canvas.getContext('2d');\n color_context = color_canvas.getContext('2d');\n\n //Changing the context functions\n trackTransforms(image_context);\n trackTransforms(mesh_context);\n trackTransforms(color_context);\n\n setCanvasSize(image_canvas);\n\n drawImage();\n createMeshLayer();\n createColorLayer();\n createDummyLayer();\n delete_mode = false; //Because there is no delete_mode initalizer\n\n fidelity = image_canvas.width / 85; //Determines how much help is given for picking a point min value is 0\n vertex_radius = fidelity / 2;\n line_width = vertex_radius * 0.35;\n document.getElementById('vertexRadius').max = fidelity * 1.5;\n \n image_canvas.className = 'decoratedCanvas';\n }", "title": "" }, { "docid": "7fad0d6708be032cb88a0c032ffa2404", "score": "0.5808611", "text": "function createSimpleAnimations() {\n var ctx = getCanvasMethod();\n var imageSource = new Image();\n imageSource.onload = function() {\n ctx.drawImage(imageSource, 10, 10, 80, 80);\n }\n imageSource.src = \"assets/carrot1.png\";\n}", "title": "" }, { "docid": "2706151cf797bc8d557e9f4cfe8d0e59", "score": "0.58064055", "text": "run() {\n const width = 600\n const height = 600\n\n new Canvas(width, height, this.shaderSources)\n }", "title": "" }, { "docid": "f572409dd1634570b7342077ca09af64", "score": "0.5796527", "text": "function begin() \r\n{\r\n\t// Get Canvas element\r\n\tsurface = document.getElementById(canvasId);\r\n\r\n\t// If canvas is supported then load the image.\r\n\tif (surface.getContext) \r\n\t{\r\n\t\twheel = new Image();\r\n\t\twheel.onload = initialDraw;\t\t// Once the image is loaded from file this function is called to draw the image in its starting position.\r\n\t\twheel.src = wheelImageName;\r\n\t}\r\n}", "title": "" }, { "docid": "1b66fb2044ad29a861765bb667b52030", "score": "0.5793975", "text": "function f_canvas() {\n console.log(\"You clicked on the document!\");\n // some random functionality\n // game_over = true;\n}", "title": "" }, { "docid": "68e7a5bf08409aa77932aa3dc4a5006a", "score": "0.5793021", "text": "function activateDemo() {\n\n demo.initialise();\n\n demo.camera.aspect = window.innerWidth / window.innerHeight;\n demo.camera.updateProjectionMatrix();\n\n gui = new dat.GUI({ autoPlace: true });\n gui.add(app, \"effect\", Array.from(demos.keys())).onChange(loadDemo);\n demo.configure(gui);\n aside.appendChild(gui.domElement);\n\n loadingMessage.style.display = \"none\";\n renderer.domElement.style.visibility = \"visible\";\n\n }", "title": "" }, { "docid": "2a860932a5ef8f79f72893a4eba98d47", "score": "0.57901907", "text": "function fireoff() {\n hide('canvas')\n show('on-button')\n hide('off-button')\n hide('anglex')\n hide('angley')\n hide('on-angle')\n hide('off-angle')\n}", "title": "" }, { "docid": "01c7b088acd3afd3a7354c4eba3a59a5", "score": "0.57870483", "text": "drawAttack(drawCanvas){\r\n drawCanvas.drawImage(this.laser, this.pos.x, this.pos.y, 20, 20 );\r\n \r\n }", "title": "" }, { "docid": "7e6cf03d44b4dcaf8f40d24188abc14a", "score": "0.57775193", "text": "function openCanvas(evt, board){\n var i, tabcontent, tablinks;\n Global.activeTab = board;\n\ttabcontent = document.getElementsByClassName(\"tabcontent\");\n\ttablinks = document.getElementsByClassName(\"tablinks\");\n\n\t// Hide currently shown one\n\tfor(i =0; i < tabcontent.length;i++){\n\t\ttabcontent[i].style.display = \"none\";\n\t}\n\n\tfor(i=0; i < tablinks.length; i++){\n\t\ttablinks[i].className = tablinks[i].className.replace(\" active\",\"\");\n\t}\n\n\t// Show the clicked element\n\tdocument.getElementById(board).style.display = \"block\";\n\tevt.currentTarget.className += \" active\";\n}", "title": "" }, { "docid": "6f6b3dbb95b605ba24dc7a52db275166", "score": "0.5773603", "text": "function handleCanvasClick(event) {\n console.log('canvas clicked!');\n }", "title": "" }, { "docid": "45ecc8d82b9598e8c5a56a18c24bea7e", "score": "0.57570535", "text": "function init()\n{\n\t\n\t canvas = document.getElementById(\"canvas\");\n\t ctx = canvas.getContext(\"2d\");\n tabsCanvas = document.getElementById(\"tabsCanvas\");\n\t tabsCtx = tabsCanvas.getContext(\"2d\"); \n\t omw_scrollpane = document.getElementById(\"omw_scrollpane\");\n\t buttonsCanvas = document.getElementById(\"buttonsCanvas\");\n\t buttonsCtx = buttonsCanvas.getContext(\"2d\");\n\t \n\t\taddTab();\n\t\tcreateModule(75,50,\"normal\",1,1);\n\t\tcreateModule(75,50,\"normal\",5,5);\n\t\tcreateModule(75,50,\"normal\",1,1);\n\t\t//createModule(500,200,\"conditional\",10,0);\n\t\tcreateModule(150,150,\"source\",0,1);\n\t\t//myModules[0].addOutput(\"file\");\n\t\tcreateModule(300,300,\"sink\",1,0);\n\t\tmyModules[1].addInput(\"file\");\n\t return setInterval(draw, 10);\n}", "title": "" }, { "docid": "6d4e79cf4942ec80e1422d54ee52bcaf", "score": "0.5752078", "text": "function initialDraw(e)\r\n{\r\n\tvar surfaceContext = surface.getContext('2d');\r\n\tsurfaceContext.drawImage(wheel, 0, 0);\r\n}", "title": "" }, { "docid": "cbb0dfa919699057123aa8de8658d5ee", "score": "0.5746234", "text": "show(img) {\r\n // plz ignore the 4 lines below\r\n // this.r = 125;\r\n // rectMode(CENTER);\r\n // fill(255, 255, 0);\r\n // rect(this.x + 20, this.y + 10,this.r,this.r);\r\n this.img = img;\r\n image(img, this.x - 120, this.y);\r\n }", "title": "" }, { "docid": "41d6df8df076882ab2249f8496d5f4f9", "score": "0.5742966", "text": "function initCanvas() {\n \tif(isCircle)\n \ttizen.power.request(\"SCREEN\", \"SCREEN_NORMAL\");\n \tconsole.log('initCanvas()');\n roundProgressCanvasContext = roundProgressCanvas.getContext('2d');\n roundProgressCanvasContext.strokeStyle = 'rgb(0, 195, 113)';\n roundProgressCanvasContext.lineWidth = 180;\n }", "title": "" }, { "docid": "bf71cf04903985c0ba91b51b7c3accb2", "score": "0.574218", "text": "function onAction(obj) {\n //change fill color to black\n fill(255, 0, 0);\n //draw a circle\n ellipse(obj.x, obj.y, 20, 20);\n}", "title": "" }, { "docid": "352b61d69205ff4f5285b90b386d43da", "score": "0.5718303", "text": "show(context) {\n context.strokeWidth = \"1px\";\n if (this.fill) {\n context.fillStyle = this.color;\n context.fillRect(this.x, this.y, this.width, this.height);\n } else {\n context.strokeStyle = this.color;\n context.strokeRect(this.x, this.y, this.width, this.height);\n }\n }", "title": "" }, { "docid": "93ff5ee19d86e7c4957c55e840fd426e", "score": "0.57175815", "text": "function activateCheat() {\n $('*').css('background-color', '#228B22');\n $('#trexRoar').trigger('play');\n $('.tRexGif').show();\n }", "title": "" }, { "docid": "8d568234c2cbcd7e3b39089870d7c494", "score": "0.5717353", "text": "function canvas1()\n{\n background(0);\n \n image(backdrop,0,0,1000,800);\n panel();\n\n if (flashlocation == 1)\n {\n flashx = 700;\n flashy = 500;\n image(flashlight,flashx,flashy,60,60);\n }\n else if (flashlocation == 2)\n {\n image(flashlight,flashx,flashy,60,60);\n\n flashx = flashx + 2.85;\n flashy = flashy - 6;\n\n if (flashx > 925 || flashy < 25)\n {\n flashx = 925;\n flashy = 25;\n flashlocation = 3;\n }\n }\n else if(flashlocation == 3)\n {\n flashx = 925;\n flashy = 25;\n image(flashlight,flashx,flashy,60,60);\n }\n \n if (flashcan == 4)\n {\n canvas2();\n cursor(HAND);\n image(flashCursor,mouseX-15,mouseY,30,50);\n }\n \n if (mouseX >700 && mouseX < 700+60 && mouseY > 500 && mouseY < 500+60)\n {\n cursor(HAND);\n }\n else \n {\n cursor(ARROW); \n }\n\n if (mouseX > 700 && mouseX < 700+60 && mouseY > 500 && mouseY < 500+60 && mouseIsPressed)\n {\n flashlocation = 2;\n }\n \n if (mouseX > 900 && mouseX < 900+90 && mouseY > 4 && mouseY < 4+90 && flashlocation == 3)\n {\n bigFlash();\n }\n \n if (mouseX > 900 && mouseX < 900+90 && mouseY > 4 && mouseY < 4+90 && mouseIsPressed == true)\n {\n flashcan = 4;\n }\n if(flashcan == 5)\n {\n paperx = 907;\n papery = 115;\n image(tornpap,paperx,papery,85,50);\n image(keyboard,10,10,70,30);\n image(key,keyx,keyy,100,100); \n }\n if (mouseX > 900 && mouseX < 900+90 && mouseY > 4+100 && mouseY < 4+90+100 && paperlocation == 3)\n {\n bigPap();\n }\n if(flashcan == 3)\n {\n canvas3(); \n }\n if(mouseX > 10 && mouseX < 10+70 && mouseY > 10 && mouseY < 10+30 && mouseIsPressed)\n {\n flashcan =3;\n }\n}", "title": "" }, { "docid": "aab97ec32d3b74eeb9a7154698ae47e9", "score": "0.57151884", "text": "function initEasel() {\n var target = get(\"wrapper\");\n target.appendChild(createCanvas(\"canvas\", width, height));\n stage = new createjs.Stage(\"canvas\");\n }", "title": "" }, { "docid": "da06adfb7336de272cb16f79e604ceca", "score": "0.57121813", "text": "function modifyCanvas(){\n $('#daikin-option').removeClass('is-active');\n canvas.discardActiveObject().renderAll();\n $(\".deleteBtn\").remove(); \n // daikin_Nexura.checkQuantity();\n // daikin_Temp.checkQuantity();\n daikin_Us7.checkQuantity();\n daikin_OutDoor.checkQuantity();\n if(state.length - 1 - mods >= 0){\n if(state[state.length - 1 - mods].backgroundImage !== undefined &&\n state[state.length - 1 - mods].backgroundImage.scaleX !== undefined &&\n state[state.length - 1 - mods].backgroundImage.scaleY !== undefined){\n let state_wid = state[state.length - 1 - mods].backgroundImage.width * state[state.length - 1 - mods].backgroundImage.scaleX;\n let state_hei = state[state.length - 1 - mods].backgroundImage.height * state[state.length - 1 - mods].backgroundImage.scaleY;\n canvas.setDimensions({width: state_wid, height: state_hei});\n }\n }\n}", "title": "" }, { "docid": "4de596e6d70f83b1196937f52ec588fe", "score": "0.5699318", "text": "onAdd() {\n const canvas = document.createElement('canvas');\n canvas.width = this.width;\n canvas.height = this.height;\n this.context = canvas.getContext('2d');\n }", "title": "" }, { "docid": "4dec08cac86de2b5621af66be0e1c38c", "score": "0.56988704", "text": "function Canvas(showCanvas) {\n this.getCanvas = document.querySelector(showCanvas);\n this.init();\n}", "title": "" }, { "docid": "9a22bbe31ff99b8cd392cc394482d7b8", "score": "0.5692576", "text": "function canvasClick() {\n drag = true;\n}", "title": "" }, { "docid": "41411fb1e94040bdff28e0bd74316ccd", "score": "0.56877655", "text": "draw() {\n // Resize the canvas\n this.resizeCanvas();\n\n // Clear the canvas\n this.ctx.clearRect(0, 0, this.c.width, this.c.height);\n\n // Draw some circle waves\n for (let i = this.circleWaves.length - 1; i >= 0; --i) {\n this.circleWaves[i].draw(this.ctx);\n }\n\n // Draw Bulby\n this.bulby.draw(this.ctx);\n }", "title": "" }, { "docid": "616542a34aaa57b221c72f5a96445783", "score": "0.56807077", "text": "function StartDrawImg(){\n _DrawImg = true;\n}", "title": "" }, { "docid": "26f7af9ee7a312948acaea4fca9a83f2", "score": "0.5679664", "text": "function init() {\n var s = new CanvasState(document.getElementById('canvas1'));\n \n\n // s.addShape(new Shape(60,140,40,60, 'lightskyblue'));\n\n\n}", "title": "" }, { "docid": "f73f3009543f77a56c0cb2a9ea46a1e7", "score": "0.5677108", "text": "function drawCanvas() {\r\n // Get our Canvas element\r\n surface = document.getElementById(\"doapify\");\r\n\r\n if (surface.getContext) {\r\n // If Canvas is supported, load the images\r\n sunshine = new Image();\r\n sunshine.onload = loadingComplete;\r\n sunshine.src = \"http://doap.com/images/sun.gif\";\r\n }\r\n\r\n\r\n if (surface.getContext) {\r\n // If Canvas is supported, load the images\r\n happy = new Image();\r\n happy.onload = loadingComplete;\r\n happy.src = \"http://doap.com/images/puffy_cloud.gif\";\r\n }\r\n\r\nif (surface.getContext) {\r\n // If Canvas is supported, load the images\r\n cloud2 = new Image();\r\n cloud2.onload = loadingComplete;\r\n cloud2.src = \"http://doap.com/images/puffy_cloud.gif\";\r\n }\r\n\r\n}", "title": "" }, { "docid": "73f6da3a1062b3e84ea38c1cf633b019", "score": "0.56751335", "text": "function drawCone() {\n setMV() ;\n Cone.draw() ;\n}", "title": "" }, { "docid": "4b853addf49f4778ff0157a6c77ac5ae", "score": "0.5672631", "text": "function drawCanvas(){\n\tdrawGridUltimate(context,pix,colors,global);\n\tdrawAroundIndications(context,pix,colors,global);\n\tdrawInsideIndications(context,pix,colors,global);\n\tdrawSpaces(context,pix,colors,global);\n}", "title": "" }, { "docid": "07fd8eefb8003d82e1b7f7227d418ff6", "score": "0.56713253", "text": "function e(){var t=r.CanvasPool.create(this,6,1),e=t.getContext(\"2d\");e.fillStyle=\"rgba(10, 20, 30, 0.5)\",\n// Draw a single pixel\ne.fillRect(0,0,1,1);\n// Get the color values\nvar i=e.getImageData(0,0,1,1);if(i){\n// Plot them to x2\ne.putImageData(i,1,0);\n// Get those values\nvar s=e.getImageData(1,0,1,1);\n// Compare and set\nf.canHandleAlpha=s.data[0]===i.data[0]&&s.data[1]===i.data[1]&&s.data[2]===i.data[2]&&s.data[3]===i.data[3]}\n// Checks whether the Canvas BlendModes are supported by the current browser for drawImage.\ne.globalCompositeOperation=\"multiply\",f.canUseMultiply=\"multiply\"===e.globalCompositeOperation,r.CanvasPool.removeByCanvas(t),PIXI.CanvasTinter.tintMethod=f.canUseMultiply?PIXI.CanvasTinter.tintWithMultiply:PIXI.CanvasTinter.tintWithPerPixel}", "title": "" }, { "docid": "c75181e9c0e17179aa20f9670560054d", "score": "0.5669368", "text": "function startScreen() {\n\tcanvas.style.backgroundColor = \"transparent\";\n\tctx.clearRect(0, 0, canvas.width, canvas.height);\n\tctx.drawImage(title, canvas.width/2 - title.width/2, \n\t\tcanvas.height/3 - title.height/2, title.width, title.height);\n\tctx.drawImage(startButton, canvas.width/3 - startButton.width/2, \n\t\t3*canvas.height/4 - startButton.height/2, startButton.width, \n\t\tstartButton.height);\n\tctx.drawImage(instructButton, 2* canvas.width/3 - instructButton.width/2, \n\t\t3*canvas.height/4 - instructButton.height/2, instructButton.width,\n\t\tinstructButton.height);\n\tctx.drawImage(leftArrow, 0, 0, leftArrow.width, leftArrow.height);\n\tspotlight.addEventListener(\"mousedown\", startScreenClicks);\n}", "title": "" }, { "docid": "f8b36a2b6630ff8bc30f152f0df8459e", "score": "0.56688863", "text": "function runCircle(settings) {\n //大屏\n var defaultSetting = {\n url: 'images/fire.png', //飞机小图地址\n obj: '', //场景添加的canvas id 名\n percent: 1, //圆环转动的百分比 0-1\n circleBottomColor: \"#f2f2f2\",//圆环底色\n innerColorStart: '#ffdd00', //内部圆环 渐变色\n innerColorEnd: '#fc7d37',\n titleIndex: ''\n };\n\n var option = $.extend({}, defaultSetting, settings);\n var fillText = document.getElementsByClassName('anyield');\n var screenW = document.documentElement.offsetWidth;\n var screenH = document.documentElement.offsetHeight;\n var imageUrl = option.url;\n var obj = option.obj;\n var percent = option.percent;\n var innerColorStart = option.innerColorStart;\n var innerColorEnd = option.innerColorEnd;\n var circleBottomColor = option.circleBottomColor;\n var titleIndex = option.titleIndex;\n var fillTextTitle = fillText[titleIndex].attributes['innerText'].value;\n var preA = Math.PI / 180;\n var canvasC = document.getElementById(obj);\n\n /*大屏控制运动*/\n var context = canvasC.getContext('2d');\n var windowW = parseInt($(canvasC).parent().width());\n var lineW1, lineW0;\n var R, R1,iconW = 35,iconH = 35,iconY = 50,tfontSize = 18, pfontSize = 24;\n if (screenW < 1000) {\n lineW1 = 6;\n lineW0 = 2;\n iconW = 20;\n iconH = 20;\n iconY = 40;\n tfontSize = 12;\n pfontSize = 18;\n } else if (screenW > 1000 && screenW < 1440) {\n lineW1 = 8;\n lineW0 = 3;\n iconW = 25;\n iconH = 25;\n iconY = 45;\n tfontSize = 14;\n pfontSize = 21;\n } else if (screenW > 1440) {\n lineW1 = 11;\n lineW0 = 4;\n }\n var canvasW = windowW;\n R = parseInt(canvasW / 2 - 2 * lineW1 - 2 * lineW0 - 10);\n R1 = parseInt(canvasW / 2 - lineW1 - lineW0 - 10);\n var ra = parseInt(canvasW / 2 - lineW0 / 2 - 5);\n var canvasH = canvasW * 1.2;\n var rotateAngle = percent * 360;\n var rotataRadians = preA * rotateAngle;\n canvasC.width = canvasW;\n canvasC.height = canvasH;\n var x = canvasC.width / 2;\n var y = canvasC.height / 2;\n var startAa = -Math.PI / 2;\n var startA = 0;\n var Timer;\n var imageAir = new Image();\n imageAir.src = imageUrl;\n var loading = 0;\n canvasC.setAttribute(\"data-run\", \"1\");\n\n function drawCircle() {\n if (startA < rotataRadians) {\n startA += 0.1;\n }\n //\n\n context.fillStyle = \"#fefefe\";\n context.fillRect(0, 0, canvasC.width, canvasC.height);\n //\n context.save();\n context.setTransform(1, 0, 0, 1, 0, 0);\n context.fillStyle = \"#fefefe\";\n context.fillRect(0, 0, canvasC.width, canvasC.height);\n context.translate(x, y);\n context.rotate(-Math.PI / 2);\n //中环\n context.beginPath();\n context.strokeStyle = circleBottomColor;\n context.lineWidth = lineW1;\n context.arc(15, 0, R1, 0, Math.PI * 2, false);\n context.stroke();\n context.closePath();\n context.beginPath();\n // Linear gradients\n var gradient2 = context.createLinearGradient(R1, 0, -R1, 0);\n gradient2.addColorStop(0, innerColorStart);\n gradient2.addColorStop(1, innerColorEnd);\n context.lineCap = \"round\";\n context.strokeStyle = gradient2;\n context.lineWidth = lineW1;\n context.arc(15, 0, R1, 0, startA, false);\n context.stroke();\n context.closePath();\n\n //内环\n context.beginPath();\n context.strokeStyle = circleBottomColor;\n context.lineWidth = lineW0;\n context.arc(15, 0, R, 0, Math.PI * 2, false);\n context.stroke();\n context.closePath();\n context.restore();\n\n //文字 进度\n context.beginPath();\n context.fillStyle = innerColorEnd;\n loading += (10 / (Math.PI * 2));\n var num = parseInt(loading);\n if (num > percent * 100) {\n num = percent * 100;\n }\n context.fillText(num + \"%\", canvasW / 1.9 - 2, canvasH / 1.7 - 2);\n context.textAlign = 'center';\n context.font = 'bold ' + tfontSize + 'px normal';\n context.closePath();\n //文字 标题\n context.beginPath();\n context.fillStyle = innerColorEnd;\n context.fillText(fillTextTitle, canvasW / 2, canvasH / 1.08);\n context.textAlign = 'center';\n context.font = pfontSize + 'px normal';\n context.closePath();\n\n //中间图标\n context.beginPath();\n var skillIcon = new Image();\n skillIcon.src = imageUrl;\n context.drawImage(skillIcon, canvasW / 2 - (iconW / 2), canvasH / 2 - iconY, iconW, iconH);\n context.save();\n\n //画图\n if (startAa < rotataRadians - Math.PI / 2) {\n startAa += 0.1;\n canvasC.setAttribute(\"data-run\", \"1\")\n } else {\n clearInterval(Timer);\n canvasC.setAttribute(\"data-run\", \"0\")\n }\n context.save();\n context.setTransform(1, 0, 0, 1, 0, 0);\n var ax = ra * Math.cos(startAa);\n var ay = ra * Math.sin(startAa);\n context.translate(x + ax, y + ay);\n context.rotate(startAa);\n // context.drawImage(imageAir, imgX, imgY, imgWidth, imgHeight);\n context.restore();\n }\n\n drawCircle();\n Timer = setInterval(drawCircle, 20);\n\n\n}", "title": "" }, { "docid": "1e18be6eff709e99c5590ffdc13acbdb", "score": "0.56680423", "text": "function showCrossView() {\n black_body_stage.getChildByName(\"crossSectional\").visible = true; /** Display cross sectional view */\n black_body_stage.getChildByName(\"waterAnimation\").visible = true; /** Display the water animation */\n createjs.Ticker.setInterval(100);\n createjs.Ticker.addEventListener(\"tick\", startAnimation); /** Start animation event */\n}", "title": "" }, { "docid": "258155fead09d2a7a8a1bf75d55d0143", "score": "0.56673896", "text": "function animate() \n\t{\n\t\t// Clear\n\t\tcontext.clearRect(0, 0, canvasWidth, canvasHeight);\n\n\t\t// DRAW\n\n\t\t// platform\n\t\tcontext.fillStyle = \"rgb(210,105,30)\";\n\t\tcontext.beginPath();\n\t\tcontext.fillRect(50, 30, platformWidth - 50, platformHeight); // 레일 \n\t\tcontext.closePath();\n\t\tcontext.fill();\n\n\t\t// platform lines\n\t\tfor(var line=50;line < platformWidth + 100;line += 30){\n\t\t\tcontext.strokeStyle = \"rgb(0, 0, 0)\";\n\t\t\tcontext.lineWidth = 3;\n\t\t\tcontext.beginPath();\n\t\t\tcontext.moveTo(line, 30);\n\t\t\tcontext.lineTo(line, canvasHeight);\n\t\t\tcontext.closePath();\n\t\t\tcontext.stroke();\n\t\t}\n\n\t\t// holls\n\t\tcontext.fillStyle = \"rgb(100,10,0)\";\n\t\tcontext.beginPath();\n\t\tcontext.fillRect(0, 30, 50, platformHeight+30); // 레일 \n\t\tcontext.closePath();\n\t\tcontext.fill();\n\n\t\tcontext.fillStyle = \"rgb(100,10,0)\";\n\t\tcontext.beginPath();\n\t\tcontext.fillRect(platformWidth, 30, platformWidth + 50, platformHeight+30); // 레일 \n\t\tcontext.closePath();\n\t\tcontext.fill();\n\n\t\t// aiming line\n\t\tif (playerSelected) \n\t\t{\n\t\t\tcontext.strokeStyle = \"rgb(255, 255, 255)\"; // bar configure\n\t\t\tcontext.lineWidth = 3;\n\t\t\tcontext.beginPath();\n\t\t\tcontext.moveTo(player.x, player.y);\n\t\t\tcontext.lineTo(powerX, powerY);\n\t\t\tcontext.closePath();\n\t\t\tcontext.stroke();\n\n\t\t\tcontext.fillStyle = \"rgb(255, 255, 255)\";\n\t\t\tcontext.font = 'normal 20pt Lobster'\n\t\t\tcontext.fillText(\"power: \" + power, 10, 560); // Text의 위치와 내용\n\t\t\tif (playerAngle <= 90 && playerAngle >= -90)\n\t\t\t{\n\t\t\t\tcontext.fillText(\"angle: \" + playerAngle + \"°\", 10, 580);\t\t\t\t\n\t\t\t};\n\n\t\t};\n\t\t// boundary check\n\t\tif (player.x != playerOriginalX && player.y != playerOriginalY) // 볼링 공이 범위를 벗어나면 다시 초기화\n\t\t{\n\t\t\tif (player.vX == 0 && player.vY == 0) \n\t\t\t{\n\t\t\t\tresetPlayer();\n\t\t\t} \n\t\t\telse if (player.x+player.radius < 0) \n\t\t\t{\n\t\t\t\tresetPlayer();\n\t\t\t} \n\t\t\telse if (player.x-player.radius > canvasWidth) \n\t\t\t{\n\t\t\t\tresetPlayer();\n\t\t\t} \n\t\t\telse if (player.y+player.radius < 0) \n\t\t\t{\n\t\t\t\tresetPlayer();\n\t\t\t} \n\t\t\telse if (player.y-player.radius > canvasHeight) \n\t\t\t{\n\t\t\t\tresetPlayer();\n\t\t\t};\n\t\t};\t\n\n\n\t\tvar deadAsteroids = new Array();\n\n\t\tvar asteroidsLength = asteroids.length;\n\n\t\tfor (var i = 0; i < asteroidsLength; i++) // 공들끼리 영향을 주는 것을 반영\n\t\t{\n\t\t\tvar tmpAsteroid = asteroids[i];\n\t\t\tcontext.fillStyle = \"rgb(255, 255, 255)\"; // pin color\n\t\t\tif(tmpAsteroid.player){\n\t\t\t\tcontext.fillStyle = \"rgb(0,191,255)\";\t// ball color\n\t\t\t}\n\t\t\tfor (var j = i+1; j < asteroidsLength; j++) \n\t\t\t{\n\t\t\t\tvar tmpAsteroidB = asteroids[j];\n\n\t\t\t\tvar dX = tmpAsteroidB.x - tmpAsteroid.x;\n\t\t\t\tvar dY = tmpAsteroidB.y - tmpAsteroid.y;\n\t\t\t\tvar distance = Math.sqrt((dX*dX)+(dY*dY));\n\t\t\t\tif (distance < tmpAsteroid.radius + tmpAsteroidB.radius) \n\t\t\t\t{\n\t\t\t\t\tvar angle = Math.atan2(dY, dX);\n\t\t\t\t\tvar sine = Math.sin(angle);\n\t\t\t\t\tvar cosine = Math.cos(angle);\n\t\t\t\t\t// Rotate asteroid position\n\t\t\t\t\tvar x = 0;\n\t\t\t\t\tvar y = 0;\n\t\t\t\t\t// Rotate asteroidB position\n\t\t\t\t\tvar xB = dX * cosine + dY * sine;\n\t\t\t\t\tvar yB = dY * cosine - dX * sine;\n\t\t\t\t\t// Rotate asteroid velocity\n\t\t\t\t\tvar vX = tmpAsteroid.vX * cosine + tmpAsteroid.vY * sine;\n\t\t\t\t\tvar vY = tmpAsteroid.vY * cosine - tmpAsteroid.vX * sine;\n\t\t\t\t\t// Rotate asteroidB velocity\n\t\t\t\t\tvar vXb = tmpAsteroidB.vX * cosine + tmpAsteroidB.vY * sine;\n\t\t\t\t\tvar vYb = tmpAsteroidB.vY * cosine - tmpAsteroidB.vX * sine;\n\t\t\t\t\t// Conserve momentum\n\t\t\t\t\tvar vTotal = vX - vXb;\n\t\t\t\t\tvX = ((tmpAsteroid.mass - tmpAsteroidB.mass) * vX + 2 * tmpAsteroidB.mass *\n\t\t\t\t\tvXb) / (tmpAsteroid.mass + tmpAsteroidB.mass);\n\t\t\t\t\tvXb = vTotal + vX;\n\t\t\t\t\t// Move asteroids apart\n\t\t\t\t\txB = x + (tmpAsteroid.radius + tmpAsteroidB.radius);\n\t\t\t\t\t// Rotate asteroid positions back\n\t\t\t\t\ttmpAsteroid.x = tmpAsteroid.x + (x * cosine - y * sine);\n\t\t\t\t\ttmpAsteroid.y = tmpAsteroid.y + (y * cosine + x * sine);\n\t\t\t\t\ttmpAsteroidB.x = tmpAsteroid.x + (xB * cosine - yB * sine);\n\t\t\t\t\ttmpAsteroidB.y = tmpAsteroid.y + (yB * cosine + xB * sine);\n\t\t\t\t\t// Rotate asteroid velocities back\n\t\t\t\t\ttmpAsteroid.vX = vX * cosine - vY * sine;\n\t\t\t\t\ttmpAsteroid.vY = vY * cosine + vX * sine;\n\t\t\t\t\ttmpAsteroidB.vX = vXb * cosine - vYb * sine;\n\t\t\t\t\ttmpAsteroidB.vY = vYb * cosine + vXb * sine;\n\t\t\t\t};\n\t\t\t};\n\n\t\t\t// Calculate new position\n\t\t\ttmpAsteroid.x += tmpAsteroid.vX;\n\t\t\ttmpAsteroid.y += tmpAsteroid.vY;\n\n\t\t\t// Friction\n\t\t\tif (Math.abs(tmpAsteroid.vX) > 0.1) \n\t\t\t{\n\t\t\t\ttmpAsteroid.vX *= tmpAsteroid.friction;\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\ttmpAsteroid.vX = 0; // 일정 속도 이하면 정지\n\t\t\t};\n\t\t\tif (Math.abs(tmpAsteroid.vY) > 0.1) \n\t\t\t{\n\t\t\t\ttmpAsteroid.vY *= tmpAsteroid.friction;\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\ttmpAsteroid.vY = 0;\n\t\t\t};\n\n\t\t\t// check if asteroid is off the platform\n\t\t\tif(tmpAsteroid.player)\n\t\t\t{\n\t\t\t\tif(tmpAsteroid.x <= 25){\n\t\t\t\t\ttmpAsteroid.x = 25;\n\t\t\t\t\ttmpAsteroid.vX = 0;\n\t\t\t\t}\n\t\t\t\tif(tmpAsteroid.x >= platformX + 150){\n\t\t\t\t\ttmpAsteroid.x = platformX + 150;\n\t\t\t\t\ttmpAsteroid.vX = 0;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (!tmpAsteroid.player) \n\t\t\t{\n\t\t\t\tvar dXp = tmpAsteroid.x - platformX;\n\t\t\t\tvar dYp = tmpAsteroid.y - platformY;\n\t\t\t\tif (Math.abs(dXp) > 125 || Math.abs(dYp) > 120) \n\t\t\t\t{\n\t\t\t\t\tif (tmpAsteroid.radius > 0) \n\t\t\t\t\t{\n\t\t\t\t\t\ttmpAsteroid.radius -= 2;\n\t\t\t\t\t} \n\t\t\t\t\telse \n\t\t\t\t\t{\n\t\t\t\t\t\tdeadAsteroids.push(tmpAsteroid);\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tif(tmpAsteroid.radius <= 0){\n\t\t\t\ttmpAsteroid.radius = 0;\n\t\t\t};\n\n\t\t\tcontext.beginPath();\n\t\t\tcontext.arc(tmpAsteroid.x, tmpAsteroid.y, tmpAsteroid.radius, 0, Math.PI*2, true);\n\t\t\tcontext.closePath();\n\t\t\tcontext.fill();\n\t\t\tif(!tmpAsteroid.player){\n\t\t\t\tif(tmpAsteroid.radius -6 >= 0 ){\t\n\t\t\t\t\tcontext.fillStyle = \"rgb(255,0,0)\";\n\t\t\t\t\tcontext.beginPath();\n\t\t\t\t\tcontext.arc(tmpAsteroid.x, tmpAsteroid.y, tmpAsteroid.radius -6, 0, Math.PI*2, true);\n\t\t\t\t\tcontext.closePath();\n\t\t\t\t\tcontext.fill();\n\t\t\t\t}\n\t\t\t\tif(tmpAsteroid.radius -7 >= 0){\n\t\t\t\t\tcontext.fillStyle = \"rgb(255,255,255)\";\n\t\t\t\t\tcontext.beginPath();\n\t\t\t\t\tcontext.arc(tmpAsteroid.x, tmpAsteroid.y, tmpAsteroid.radius -7, 0, Math.PI*2, true);\n\t\t\t\t\tcontext.closePath();\n\t\t\t\t\tcontext.fill();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t};\t\t\n\n\t\t// splice dead asteroids\n\t\tvar deadAsteroidsLength = deadAsteroids.length;\n\t\tif (deadAsteroidsLength > 0) \n\t\t{\n\t\t\tfor (var di = 0; di < deadAsteroidsLength; di++) \n\t\t\t{\n\t\t\t\tvar tmpDeadAsteroid = deadAsteroids[di];\n\t\t\t\tasteroids.splice(asteroids.indexOf(tmpDeadAsteroid), 1); // 배열에 요소 제거\n\t\t\t};\n\t\t};\n\n\t\tvar remaining = asteroids.length-1; // Remove player from asteroid count\n\t\tuiRemaining.html(remaining);\n\t\tif (remaining == 0) \n\t\t{\n\t\t\t// Winner!\n\t\t\tplayGame = false;\n\t\t\tuiStats.hide();\n\t\t\tuiComplete.show();\n\t\t\t$(window).unbind(\"mousedown\");\n\t\t\t$(window).unbind(\"mousemove\");\n\t\t\t$(window).unbind(\"mouseup\");\n\t\t};\n\n\t\tif (playGame) \n\t\t{\n\t\t\t// Run the animation loop again in 33 milliseconds\n\t\t\tsetTimeout(animate, 33);\n\t\t};\n\t}", "title": "" }, { "docid": "8fd5e45ec63fc96fdb49c1492a78b6b7", "score": "0.5665588", "text": "show() {\n ellipse(this.x, this.y, this.z, this.z);\n }", "title": "" }, { "docid": "677248531b5388417f43fb9aa7baa898", "score": "0.56647074", "text": "show(){\n noStroke()\n fill(255,0,0,)\n circle(this.x,this.y,this.d)\n }", "title": "" }, { "docid": "cb007c5faa6455a66e0951567ccb7e74", "score": "0.5647189", "text": "function draw() {\n background(255);\n displayEffect();\n\n\n}", "title": "" }, { "docid": "d468bb31aa2e11d568878426bee62eb9", "score": "0.5644871", "text": "draw() {\n ctx.fillStyle = 'rgb(148, 90, 53)';\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n ctx.drawImage(this.icon, 0, 0);\n ctx.font = '30px Calibri';\n ctx.fillStyle = 'black';\n ctx.fillText('click theb ean to start', 20, 100);\n }", "title": "" }, { "docid": "43cdb65243210fe5b216102ba055670b", "score": "0.5642356", "text": "function showInstructions() {\n\n //draw black bar at top of screen\n push();\n strokeWeight(2);\n stroke(0, 0, 0);\n fill(0,50);\n image(topImage, 0,0,canvas.width,60);\n rect(1, 1, canvas.width-2, 60);\n pop();\n\n //write the default Instructions to the screen if not in a mode\n if (buttonManager.modeNo === -1) {\n defaultInstructions.show();\n } else {//otherwise show the modes instructions\n buttonManager.getCurrentMode().instructions.show();\n }\n\n}", "title": "" }, { "docid": "0ec8eb7b6c14299883455f403cae9b5e", "score": "0.56376797", "text": "function initCanvas(el,action){\n\tif(canvas != el){\n//pointer.style.cssText = 'position:absolute;display:block;width:100px;height:100px;border:1px solid red;'\n//document.body.appendChild(pointer)\n\t\t//bind canvas events;\n\t\tcanvas = el;\n\t\tvar i = events.length;\n\t\twhile(i--){\n\t\t\tcanvas.addEventListener(events[i],eventHandler,false);\n\t\t}\n\t\t\n\t\t//canvasContext = canvas.getContext('2d')\n\t\taction && resetAction(action);\n\t}\n}", "title": "" }, { "docid": "662f5e9a094911910d1b79636060c086", "score": "0.56372947", "text": "createCanvas() {\n this.context = document.createElement(\"canvas\").getContext(\"2d\");\n this.setCanvasSize();\n this.clearMask();\n }", "title": "" }, { "docid": "6ef3ada8f0d8b4953f9305e889892f72", "score": "0.5630107", "text": "function initializeCanvas(){\n canvas = document.getElementById('barView');\n context = canvas.getContext('2d');\n draw();\n }", "title": "" }, { "docid": "3083be9a7a9d4b90c308167c0abe73cc", "score": "0.56256974", "text": "function draw() {\n background(255);\n determineMouse();\n fadeQuadrant();\n}", "title": "" }, { "docid": "4f0bddc779f935986dfbbb94c41ee5db", "score": "0.56230235", "text": "render() {\n canvas.beginPath();\n canvas.arc(this.position.x, this.position.y, this.radius, 0, Math.PI * 2, false);\n canvas.fillStyle = this.color;\n canvas.fill();\n }", "title": "" }, { "docid": "de3f15d6ad6a50c9b4f428741f7e0ee1", "score": "0.562302", "text": "function goMovie()\r\n{\r\n initCanvas();\r\n initDots(dot_multiplier * can_w);\r\n window.requestAnimationFrame(render);\r\n}", "title": "" }, { "docid": "c52bca0ab677982d415f182a0fa0abc0", "score": "0.56215376", "text": "function chooseColour(){\r\n clearInterval(introTimer)// remove the timer for the intro screen\r\n //dot animation\r\n var context = canvas.getContext('2d');\r\n context.fillStyle = 'white';\r\n context.fillRect(0,0,canvas.width,canvas.height);\r\n populateHoleObjArray();\r\n drawCanvas();\r\n\r\n printOntoCanvas(\"TYPE AND CLICK ENTER TO CHOOSE\",175,100,\"black\");\r\n\r\n printOntoCanvas(\"RED\",700,150,\"red\");\r\n\r\n redCircle.x = 724;\r\n redCircle.y = 200;\r\n redCircle.colour = \"red\";\r\n context.beginPath();\r\n context.arc(redCircle.x,redCircle.y,40, 0,2*Math.PI);\r\n context.stroke();\r\n context.fill();\r\n\r\n printOntoCanvas(\"BLUE\",700,300,\"blue\");\r\n\r\n blueCircle.x = 724;\r\n blueCircle.y = 350;\r\n blueCircle.colour = \"blue\";\r\n context.beginPath();\r\n context.arc(blueCircle.x,blueCircle.y,40, 0,2*Math.PI);\r\n context.stroke();\r\n context.fill();\r\n\r\n}", "title": "" } ]
f55df7b1867477a217c3071e6cd222dd
function that spawns an enemy
[ { "docid": "8c5f15befafdf93b5ca958f13e285a90", "score": "0.7439463", "text": "function spawnEnemy(){\n\n // variables for min and max speed\n var min_speed = 20,\n \tmax_speed = 100;\n\n // set the default sprite\n var enemy_sprite = 'images/enemy-bug.png';\n\n // we want the enemy to spawn at a new location\n var newStart = randomNum(0, 4);\n\n // so continue to set the newStart until it does not equal the last spawn location\n while(newStart === lastEnemyStart){\n newStart = randomNum(0, 4);\n }\n\n // use a random int to determine when a car will spawn\n var randomInt = randomNum(0, 10);\n\n // spawn a car enemy when the random int is 5, 7 or 0\n if(randomInt === 7 || randomInt === 5 || randomInt === 0){\n\n // make the min and max speeds higher\n min_speed = 150;\n max_speed = 200;\n\n // change to car sprite\n enemy_sprite = 'images/enemy-car.png';\n }\n\n // create the enemy\n var enemy = new Enemy(0, enemyStartLocations[newStart], randomNum(min_speed, max_speed), enemy_sprite);\n\n // set the value of the last spawn location\n lastEnemyStart = newStart;\n\n // push the enemy into the array\n allEnemies.push(enemy);\n\n}", "title": "" } ]
[ { "docid": "deca0766344c8d0a88b973b25c40529e", "score": "0.85321933", "text": "enemyspawn(){\n\n }", "title": "" }, { "docid": "ccea6fb0238fca8f52f5946fe745dbee", "score": "0.8321431", "text": "function spawnEnemy() {\n console.log(\"Create an enemy\");\n}", "title": "" }, { "docid": "e2501cb77c5ca8becead9c0f81d79e44", "score": "0.81461513", "text": "spawnEnemy() {\n // Pick a random x coordinate without set bounds\n // x will be between 25 and 425\n const x = (Math.random() * 400) + 25;\n // Creates the actual enemy object at the given position\n this.createEnemy(x, 0);\n // Set the spawn timer and time between spawns\n this.lastSpawned = this.now();\n this.spawnTime *= .9;\n // Puts a hard limit on how small spawn time can get\n if (this.spawnTime < this.minSpawnTime) {\n this.spawnTime = this.minSpawnTime;\n }\n }", "title": "" }, { "docid": "6e03d78a5865076c0462d0f0299afaaa", "score": "0.79224324", "text": "function spawn_enemy () {\n\tvar x : float = Random.Range(-8.8, 8.8);\n\tvar y : float = 13.0;\n\tInstantiate(enemy_fly, new Vector3(x, y, 0), Quaternion.identity);\n\t//Debug.Log(\"ive been called\");\n}", "title": "" }, { "docid": "f6c079aef05b89914449315586524c47", "score": "0.78078276", "text": "function addEnemy() \n{ \n // Variables to store the X position of the spawn object\n // See image below\n var x1 = transform.position.x - GetComponent.<Renderer>().bounds.size.x/2;\n var x2 = transform.position.x + GetComponent.<Renderer>().bounds.size.x/2;\n\n // Randomly pick a point within the spawn object\n var spawnPoint = new Vector2(Random.Range(x1, x2), transform.position.y);\n\n // Create an enemy at the 'spawnPoint' position\n Instantiate(enemy, spawnPoint, Quaternion.identity);\n}", "title": "" }, { "docid": "dfe0e754e84ef1571c9723920b0eb358", "score": "0.76815104", "text": "function Enemy(){}", "title": "" }, { "docid": "8d0311a76d77da2ed840fbc81b7c725e", "score": "0.7667471", "text": "function summonEnemies() {\r\n \r\n enemy = new Enemy(random(width + 400, width + 800), random(20, height - 20), random(30, 70));\r\n enemies.push(enemy);\r\n \r\n}", "title": "" }, { "docid": "f5e3990cd68625893c28c242a4d697d4", "score": "0.7660051", "text": "function spawn_enemy()\n{\n IsEnemySpawning = true;\n\n let position_x = int( random( player.position.x + 2000, player.position.x - 2000 ) );\n let y_random = random( 0, 10 );\n let y_pos;\n if ( y_random > 5 )\n y_pos = 1;\n else\n y_pos = -1;\n\n let position_y = int( y_pos * sqrt( 2000 * 2000 - position_x * position_x ) );\n\n if ( enemy.length < max_enemy )\n enemy.push( new spaceship( position_x, position_y, 30, enemy_level ) );\n}", "title": "" }, { "docid": "582488a28cdb7bc0cee5b7cbc21c0fd6", "score": "0.76172346", "text": "function spawnEnemy() {\n if (Date.now() - lastEnemy > enemyTimer) {\n lastEnemy = Date.now();\n enemyTimer = (Math.floor(Math.random() * 5000) + 1);\n enemies.push(enemy());\n }\n }", "title": "" }, { "docid": "af7c537f7c9b6c2191525ca180fe0ef8", "score": "0.7510921", "text": "function spawnEnemy(xPos, yPos) {\r\n var index = 'enemy' + numOfEnemies;\r\n\r\n // Not getting summoned correctly\r\n $('#objectLayer').append(\r\n '<div id=\"' + index + '\" class=\"enemy\" draggable=\"false\"></div>'\r\n );\r\n\r\n $('#' + index).css('background-color', 'white'); // Customize - Secondary\r\n $('#' + index).css('height', 50);\r\n $('#' + index).css('width', 50);\r\n\r\n var enemy = {\r\n xAcc: 0,\r\n yAcc: 0,\r\n xVel: 0,\r\n yVel: 0,\r\n xPos: 0,\r\n yPos: 0,\r\n };\r\n\r\n enemyList[numOfEnemies] = enemy;\r\n numOfEnemies += 1;\r\n\r\n $('#' + index).css({ left: xPos + 'px', top: yPos + 'px' });\r\n $('objectLayer > .enemy').css('left', -enemyXRadius - 50 / 2);\r\n $('objectLayer > .enemy').css('top', -enemyYRadius - 50 / 2);\r\n }", "title": "" }, { "docid": "c48904f95f448e2c44108e4194af8d3e", "score": "0.74765223", "text": "function spawnEnemy(x, y) {\n\t for (var i = 0; i < enemies.length; i++) {\n\t if (enemies[i].active == false) {\n\t enemies[i] = genEnemy(x, y);\n return\n\t }\n\t }\n\t enemies.push(genEnemy(x, y));\n\t}", "title": "" }, { "docid": "8212eb692ff19e62c28d8cb9c6b3f7e7", "score": "0.7465504", "text": "function addEnemies()\n{\n create_enemy( [ {x: (TILE_WIDTH * 20), y: (TILE_WIDTH * 20) }, \n {x: (TILE_WIDTH * 20), y: (TILE_WIDTH * 25)} ,\n {x: (TILE_WIDTH * 30), y: (TILE_WIDTH * 25)} ,\n {x: (TILE_WIDTH * 30), y: (TILE_WIDTH * 20)} ],\n \"enemy_1\", \"guard\"\n );\n \n create_enemy( [ {x: (TILE_WIDTH * 30), y: (TILE_WIDTH * 30) }, \n {x: (TILE_WIDTH * 30), y: (TILE_WIDTH * 35)} ,\n {x: (TILE_WIDTH * 40), y: (TILE_WIDTH * 35)} ,\n {x: (TILE_WIDTH * 40), y: (TILE_WIDTH * 30)} ],\n \"enemy_2\", \"boss\"\n );\n}", "title": "" }, { "docid": "2f54d6ad353dbf9cfa406b90f278cae2", "score": "0.74574393", "text": "function enemyAI(){\r\n //creating the enemies inside the maze\r\n //enemy = createSprite(random(10,1200),30,10,10);\r\n enemy = createSprite(random(10,1200),30,20,20);\r\n enemy.shapeColor = \"black\";\r\n enemy.velocityY = 30;\r\n enemy.velocityX = 30;\r\n enemyGroup.add(enemy);\r\n \r\n}", "title": "" }, { "docid": "63cdaf03d0860e09ada2d6721511f702", "score": "0.7415806", "text": "function enemyAI(){\r\n //creating the enemies inside the maze\r\n//enemy = createSprite(random(10,1200),30,10,10);\r\nenemy = createSprite(random(10,1200),30,20,20);\r\nenemy.shapeColor = \"black\";\r\nenemy.velocityY = 10;\r\nenemy.velocityX = 5;\r\nenemyGroup.add(enemy);\r\n\r\n}", "title": "" }, { "docid": "acbbcdcec9bfe76b4ab4a62a911feb60", "score": "0.7358273", "text": "function createEnemy(){\n\n\t//creates new enemy objects\n\tvar enemy = {};\n\t\n\t//adds enemy variables (lots of them)\n\tenemy.runDistance = 0;\n\tenemy.state = enemyState.STATES.STANDING;\n\tenemy.rand = (Math.floor((Math.random() * 5) + 5))/10;\n\tenemy.x = 0;\n\tenemy.y = 1000;\n\tenemy.tickFrame = 1;\n\tenemy.points = 100;\n\tenemy.time = 5;\n\tenemy.playForward = true;\n\tenemy.coolDown = false\n\tenemy.coolDownTime = 60;\n\t\n\t//chooses a enemy type (ranged or melee)\n\tenemy.type = Math.floor((Math.random() * 2) + 1);\n\tif(enemy.type == 1)\n\t\tenemy.coolDownTime = 60;\n\telse if(enemy.type == 2){\n\t\tenemy.coolDownTime = 120;\n\t}\n\t\n\t//adds kunai for the ranged attackers\n\tenemy.kunaiActive = true;\n\tenemy.kunaiX = 0;\n\t\n\t//this is the draw function for the enemies\n\tenemy.draw = function(ctx, x, y, length){\n\t\n\t\t//sets the enemy position, accounting for movement\n\t\tthis.x = x+(length * this.rand) - this.runDistance;\n\t\tthis.y = y - 75;\n\t\t\n\t\t//If Dead, cycle through death animation\n\t\tif(this.state == enemyState.STATES.DEAD){\n\t\t\tctx.drawImage(enemyDeath,1215 - 122*this.tickFrame, 0, 120, 122, this.x - 20, this.y, 90, 90);\n\t\t\t\n\t\t\tif(this.tickFrame < 9)\n\t\t\t\tthis.tickFrame++;\n\t\t}\n\t\t//If attacking, cycle through attacking animation\n\t\telse if(this.state == enemyState.STATES.ATTACKING){\n\t\t\tif(this.type == 1)\n\t\t\t\tctx.drawImage(enemyAttack,1335 - 134*this.tickFrame, 0, 130, 116, this.x - 20, this.y, 100, 90);\n\t\t\telse if(this.type == 2)\n\t\t\t\tctx.drawImage(enemyKunai,950 - 95*this.tickFrame, 0, 90, 114, this.x - 20, this.y, 72, 90);\n\t\t\t\n\t\t\tif((timeKeeper%3) == 0){\n\t\t\t\tif(this.tickFrame < 7 && this.playForward == true){\n\t\t\t\t\tthis.tickFrame+=1;\n\t\t\t\t\tif(this.tickFrame == 7){\n\t\t\t\t\t\tthis.playForward = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(this.tickFrame > 1 && this.playForward == false){\n\t\t\t\t\tthis.tickFrame-=1;\n\t\t\t\t\tif(this.tickFrame == 1){\n\t\t\t\t\t\tthis.state = enemyState.STATES.STANDING;\n\t\t\t\t\t\tthis.playForward = true;\n\t\t\t\t\t\tthis.coolDown = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t}\n\t\t//If running, cycle through running animation\n\t\telse if(this.state == enemyState.STATES.RUNNING){\n\t\t\t\n\t\t\tctx.drawImage(enemyRun,930 - 93*this.tickFrame, 0, 90, 115, this.x - 20, this.y, 70, 90);\n\t\t\t\n\t\t\tif(timeKeeper%3 == 0){\n\t\t\t\tif(this.tickFrame == 9)\n\t\t\t\t\tthis.tickFrame = 0;\n\t\t\t\tif(this.tickFrame < 9)\n\t\t\t\t\tthis.tickFrame++;\n\t\t\t}\n\t\t\t\n\t\t\t//accounts for movement on platform\n\t\t\tthis.runDistance += 3;\n\t\t}\n\t\t//displays standing image if not doing anything\n\t\telse if(this.state == enemyState.STATES.STANDING){\n\t\t\tctx.drawImage(enemyStand,0, 0, 60, 119, this.x, this.y, 46, 90);\n\t\t}\n\t\t\n\t\t//draws kunai if ranged type and it is active\n\t\tif(this.type == 2 && this.kunaiActive == true){\n\t\t\tctx.drawImage(kunai,0, 0, 120, 43, this.kunaiX, this.y+30, 60, 20);\n\t\t}\n\t}\n\t\n\t//this cycles through and sets the character to dead\n\tenemy.die = function(){\n\t\tthis.tickFrame = 1;\n\t\tthis.state = enemyState.STATES.DEAD;\n\t\tscore += this.points\n\t\tplayTimer += this.time;\n\t}\n\t\n\t//object method that updates the enemy\n\tenemy.update = function(){\n\t\t//makes sure the enemy isnt dead first\n\t\tif(this.state != enemyState.STATES.DEAD){\n\t\t\t//checks for attacking, but waits between attacks\n\t\t\tif(this.y < 600 && this.x < 200 && this.state != enemyState.STATES.ATTACKING && this.coolDown == false){\n\t\t\t\tthis.state = enemyState.STATES.ATTACKING;\n\t\t\t\tthis.tickFrame = 1;\n\t\t\t}\n\t\t\t//cycles through the cooldown phase between attacks\n\t\t\telse if(timeKeeper%this.coolDownTime == 0){\n\t\t\t\tthis.coolDown = false;\n\t\t\t}\n\t\t\t//if melee type, run at the character\n\t\t\tif(this.type == 1 && this.state == 0){\n\t\t\t\tif(this.y < 500 && this.x > 200){\n\t\t\t\t\tthis.state = enemyState.STATES.RUNNING;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//if ranged, through kunai at the player when he is on the platform\n\t\t\telse if(this.type == 2 && this.state == 0 && this.coolDown == false){\n\t\t\t\tif(this.y < 500 && this.x > 200 && this.x < 800){\n\t\t\t\t\tthis.state = enemyState.STATES.ATTACKING;\n\t\t\t\t\tthis.kunaiActive = true;\n\t\t\t\t\tthis.kunaiX = this.x;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//updates kunai location in relation to platform\n\t\tif(this.type == 2 && this.kunaiActive == true){\n\t\t\tthis.kunaiX-= 8;\n\t\t\tif(this.kunaiX < -20) this.kunaiActive = false;\n\t\t}\n\t}\n\t\n\t//object method that updates the location of kunai based on speed of character\n\tenemy.increment = function(speed){\n\t\tif(this.type == 2){\n\t\t\tthis.kunaiX -= speed;\n\t\t}\n\t}\n\t\n\t//Adds this to enemy array\n\tenemies.push(enemy);\n\t\n\treturn enemy;\n}", "title": "" }, { "docid": "5740e46bab5a8f894056bf4bc7e575e8", "score": "0.73331153", "text": "function spawnEnemy(className) {\n\tvar enemy;\n\tif (window[className+\"Types\"]) {\n\t\tvar typeInt = randomInt(0,window[className+\"Types\"].length-1);\n\t\tenemy = new window[className](window[window[className+\"Sheets\"][typeInt]][window[className+\"Textures\"][typeInt]], window[className+\"Types\"][typeInt]);\n\t} else {\n\t\tenemy = new window[className](window[window[className+\"Sheets\"][0]][window[className+\"Textures\"][0]]);\n\t}\n\tenemy.x = randomInt(containerBounds.x, containerBounds.width);\n\tenemy.y = randomInt(containerBounds.y, containerBounds.height);\n\tenemy.width = step;\n\tenemy.height = step;\n\tenemy.id = window[className+\"NextId\"]++;\n enemy.radar = enemy.createRadar();\n\tenemyList.push(enemy);\n\tcamera.addChild(enemy);\n\treturn enemy;\n\t/*var enemy = new window[className](Math.floor(Math.random()*x),Math.floor(Math.random()*y));\n\tenemyList.push(enemy);\n\treturn enemy;*/\n}", "title": "" }, { "docid": "0cdfcd0ab7987d7b9c6359e080a76fbf", "score": "0.7285058", "text": "function spawnEnemy()\r\n\t\t{\r\n\t\t\t//selects the enemy randomly from list.\r\n\t\t\tvar selectedEnemy = null;\r\n\t\t\tvar value = Math.random();\r\n\t\t\tvar index = 0;\r\n\t\t\twhile(selectedEnemy == null)\r\n\t\t\t{\r\n\t\t\t\tif (index == enemyTable.length)\r\n\t\t\t\t{\r\n\t\t\t\t\tselectedEnemy = \"Default Enemy\";\r\n\t\t\t\t}\r\n\t\t\t\telse if(value <= enemyTable[index].spawn_rate)\r\n\t\t\t\t{\t\r\n\t\t\t\t\tselectedEnemy = enemyTable[index];\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tvalue -= enemyTable[index].spawn_rate;\r\n\t\t\t\t}\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\r\n\t\t//DIV for Enemy\r\n\t\t\tvar element = document.createElement('DIV');\r\n\t\t\telement.setAttribute('class', 'row');\r\n\t\t\tenemyField.appendChild(element);\r\n\t\t//Node 0: nameLabel\r\n\t\t\tvar nameLabel = document.createElement('LABEL');\r\n\t\t\tnameLabel.innerHTML = selectedEnemy.name;\r\n\t\t\telement.appendChild(nameLabel);\r\n\t\t//Node 1: healthLabel\r\n\t\t\tvar healthLabel = document.createElement('LABEL');\r\n\t\t\thealthLabel.innerHTML = ': Health: ';\r\n\t\t\telement.appendChild(healthLabel);\r\n\t\t//Node 2: hpLabel\r\n\t\t\tvar hpLabel = document.createElement('LABEL');\r\n\t\t\thpLabel.innerHTML = selectedEnemy.health;\r\n\t\t\telement.appendChild(hpLabel);\r\n\t\t//Node 3: defendButton\r\n\t\t\tvar defendButton = document.createElement('BUTTON');\r\n\t\t\tdefendButton.innerHTML = ''.concat('Attack for ', playerDamage);\r\n\t\t\tdefendButton.setAttribute('onClick','attackEnemy(this)');\r\n\t\t\telement.appendChild(defendButton);\r\n\t\t//Node 4: attackButton\r\n\t\t\tvar attackButton = document.createElement('BUTTON');\r\n\t\t\tattackButton.innerHTML = ''.concat('Attacking for ', selectedEnemy.damage);\r\n\t\t\telement.appendChild(attackButton);\r\n\t\t\tattackButton.style.visibility = \"hidden\";\r\n\t\t\tattackButton.setAttribute('onClick','defendEnemy(this)');\r\n\t\t//Input Enemy Relation\r\n\t\t\tvar enemyRelationObject = {enemy: selectedEnemy, position: element};\r\n\t\t\tenemyRelation.push(enemyRelationObject);\r\n\r\n\t\t// Timer for attack\r\n\t\t\twindow.setTimeout(function()\r\n\t\t\t\t{\r\n\t\t\t\t\tenemyAttack(attackButton)\r\n\t\t\t\t}, Math.random()*2000 + 1000);\r\n\t\t}", "title": "" }, { "docid": "0d16347949c00ea6297e966ad4797cf7", "score": "0.72686815", "text": "function spawn(){\n\t$('help').fade('hide');\n\t$('help').style.display = \"none\";\n\t\n\tplayer = new Guy(fWidth/2,fHeight/2);\n\tplayerPausedGame = false;\n\tgamePausedGame = false;\n\n\tenemies = new Array();\n\tordinance = new Array();\n\t\n\t//AND THEN GOD SAID LET THERE BE HELL, AND LET IT CRUMBLE AND FALL FROM THE HEAVENS.\n\t//enemies.push(new MeteorStorm());\n\t//player.health = player.maximumHealth = 9000\n\t\n\thealthy = new HealthCapsule(0,-1);\n\thealthy.xPos += fWidth*2;\n\t\n\tvar timeyTheTimer = new Date();\n\tstartTime = timeyTheTimer.getTime();\n\taccumulatedTime = 0;\n\tmaxTierStartTime = 0;\n\tmaxTierAccumulatedTime = 0;\n\t\n\t\n\ttier = 1;\n\ttierAt = 600;\n\ttierIn = tierAt;\n\ttierMax = 18;\n\t$('tierNumber').innerHTML = tier;\n\t\n\tenemySpawnCounter = new Array();\n\tenemySpawnCounter.push(0); //Tank\n\tenemySpawnCounter.push(0); //Plane\n\n\tenemySpawnAt = new Array();\n\tenemySpawnAt.push(100);\n\tenemySpawnAt.push(145);\n}", "title": "" }, { "docid": "80a087f5ef0e6e2d526db74e6c8f9f81", "score": "0.7255778", "text": "function addEnemy(x, y) {\n var num = enemies.length;\n enemies[num] = enemy.clone();\n enemies[num].name = \"enemy\" + enemies.length;\n enemies[num].x = x * tileSheet._frameWidth + (tileSheet._frameWidth / 2);\n enemies[num].y = y * tileSheet._frameHeight + (tileSheet._frameHeight / 2);\n enemies[num].regX = 0;\n enemies[num].regY = 0;\n enemies[num].speed = 2;\n enemies[num].height = 34;\n enemies[num].width = 34;\n enemies[num].gotoAndPlay(\"stand\");\n\t\tenemies[num].isfire = false;\n\t\tenemies[num].lifeTimer = 0;\n\t\tenemies[num].temperature = EnemyTemp/2;\n\t\tenemies[num].fireNum = -1;\n\t\tenemies[num].dead = false;\t\t\n board.addChild(enemies[num]);\n }", "title": "" }, { "docid": "35a7b631600ecfb74aa92d3371405592", "score": "0.71836555", "text": "newEnemy(){\n\t\t//Check time to enemy summon\n\t\tif(this.timeFromLastEnemy >= this.randomTimeToEnemySummon){\t\n\n\t\t\tlet enemyType = Phaser.Math.Between(0, this.wave);\n\t\t\tlet summ = Phaser.Math.Between(0, this.enemyPathArray.length-1);\n\n\t\t\tlet yVar = Phaser.Math.Between(-20, 15);\n\t\t\t\n\t\t\tswitch(enemyType){\n\t\t\t\tcase 0:{\n\t\t\t\t\tthis.enemyGroup.add(new LigthEnemy(this, this.enemyPathArray[summ].x, this.enemyPathArray[summ].y + yVar, this.enemyFactory.getEnemyConfig(\"light\")));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 1:{\n\t\t\t\t\tthis.enemyGroup.add(new MiddleEnemy(this, this.enemyPathArray[summ].x, this.enemyPathArray[summ].y + yVar, this.enemyFactory.getEnemyConfig(\"middle\")));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 2:{\n\t\t\t\t\tthis.enemyGroup.add(new HeavyEnemy(this, this.enemyPathArray[summ].x, this.enemyPathArray[summ].y + yVar, this.enemyFactory.getEnemyConfig(\"heavy\")));\t\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault:{\n\t\t\t\t\tthis.enemyGroup.add(new HeavyEnemy(this, this.enemyPathArray[summ].x, this.enemyPathArray[summ].y + yVar, this.enemyFactory.getEnemyConfig(\"heavy\")));\t\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.unitsWave++;\n\t\t\tthis.timeFromLastEnemy = 0;\n\t\t\tthis.randomTimeToEnemySummon = Phaser.Math.Between(this.minTimeToEnemySummon, this.maxtimeToEnemySummon);\n\t\t}else this.timeFromLastEnemy++;\n\t}", "title": "" }, { "docid": "42eef6b21030e1ef44143ef9d95048d8", "score": "0.71345156", "text": "function spawnRandomEnemy()\n{\n var enemyType;\n\n if(0 == Math.floor(Math.random() * 35))\n {\n enemyType = 5;\n }\n else \n {\n enemyType = Math.floor(Math.random() * 4 + 1);\n }\n var newPos = new Vector2(Math.floor(Viewport.viewportOffset.x + Math.random() * Viewport.viewportSize.x), Math.floor(Viewport.viewportOffset.y + Viewport.viewportSize.y ));\n\n return spawnEnemyOfType(enemyType, newPos);\n}", "title": "" }, { "docid": "e145dcb5303cab517c3c6e7e85241ceb", "score": "0.71194416", "text": "spawnEnemyBullet() {\n if (!this.ufo) {\n return;\n }\n this.enemyBullet = new EnemyBullet(this.ufo, this.ship);\n audioManager.playBulletSound();\n }", "title": "" }, { "docid": "e590f49ae81f0e25e3aa4e1012adb35b", "score": "0.7113193", "text": "function Enemy() {\n\tthis.srcX = 1000;\n\tthis.srcY = 200;\n\tthis.drawX = Math.random() < 0.5 ? 390 : 530;\n\tthis.drawY = Math.floor(Math.random() * -300);\n\tthis.width = 80;\n\tthis.height = 150;\n\tthis.speed = 7;\n}", "title": "" }, { "docid": "08b720cc806b1e02cf9d7c27acd943cc", "score": "0.70792234", "text": "function spawn_enemy(n_enemy) {\n\t// Initialize new enemy x and y\n\tlet x, y;\n\n\tfor (i = 0; i < n_enemy; ++i) {\n\t\t// randomly select whether enemy will spawn up/down/left/right\n\t\tlet rand_location = Math.floor(Math.random() * 4);\n\n \t\t// x and y are dependent on which side of the screen enemy will spawn\n\t\t// 0 --> up, 1 --> down, 2 --> left, 3 --> right\n\t\tif (rand_location == 0) {\n\t\t\ty = 0;\n\t\t\tx = Math.floor(Math.random() * (window.innerWidth+1));\n\t\t} else if (rand_location == 1) {\n\t\t\ty = window.innerHeight;\n\t\t\tx = Math.floor(Math.random() * (window.innerWidth+1));\n\t\t} else if (rand_location == 2) {\n\t\t\ty = Math.floor(Math.random() * (window.innerHeight+1));\n\t\t\tx = 0;\n\t\t} else {\n\t\t\ty = Math.floor(Math.random() * (window.innerHeight+1));\n\t\t\tx = window.innerWidth;\n\t\t}\n\n \t\t// push into enemy storage array\n\t\tenemy_store.push(new Enemy(x, y));\n\t}\n}", "title": "" }, { "docid": "e8186866440a52409a1e4c23a8be1be4", "score": "0.70285934", "text": "function spawnNewEnemies(num) {\r\n for (i = 0; i < num; i++) {\r\n spawnEnemy(\r\n (Math.random() - 0.5) * (arenaWidth - 100) + arenaWidth / 2,\r\n (Math.random() - 0.5) * (arenaHeight - 100) + arenaHeight / 2\r\n );\r\n }\r\n }", "title": "" }, { "docid": "541ef9b2e518b56be049cb8f7707c294", "score": "0.70256734", "text": "function spawnEnemy() {\n // Add enemy only when the game is not over\n if(isRunning) {\n let numEnemies = Math.floor(score / 75) + 1;\n\n for (let i = 1; i <= numEnemies; i++) {\n let newObstacle = document.createElement(\"div\");\n newObstacle.classList.add(\"eagle\");\n newObstacle.style.bottom = getRandomEnemyPositionY();\n newObstacle.style.left = getRandomEnemyPositionX();\n enemies.appendChild(newObstacle);\n }\n }\n}", "title": "" }, { "docid": "db18733e7ad1cedda1e74e650fb1138c", "score": "0.70221174", "text": "function makeEnemy(x,y){\t\t\n\t\tvar enemy = Crafty.e(\"2D, Canvas, Color\").color(\"blue\").attr({w:ONEBLOCK, h:ONEBLOCK, x: ONEBLOCK*x, y:ONEBLOCK*y}); \t\n\t\treturn enemy;\n\t}", "title": "" }, { "docid": "b7d634f707d67902973ffdb661bcc4a9", "score": "0.699648", "text": "function createEnemy(options) {\n\n const enemy = createElement({\n item: 'mini-demon',\n top: options.top,\n left: options.left\n });\n\n setInterval(() => {\n\n const direction = ['ArrowUp', 'ArrowRight', 'ArrowDown', 'ArrowLeft'];\n const randomIndex = Math.floor(Math.random() * direction.length);\n const randomDirection = direction[randomIndex];\n\n enemy.move(randomDirection);\n\n }, 1500);\n\n }", "title": "" }, { "docid": "62d04d3ec33081f64ee8fdddff9e0d3c", "score": "0.6995976", "text": "addEnemy() {\n var enemySpots = GAME_WIDTH / ENEMY_WIDTH;\n\n var enemySpot;\n // Keep looping until we find a free enemy spot at random\n while (!enemySpot && this.enemies[enemySpot]) {\n enemySpot = Math.floor(Math.random() * enemySpots);\n }\n\n this.enemies[enemySpot] = new Enemy(enemySpot * ENEMY_WIDTH);\n }", "title": "" }, { "docid": "4b39f30d800f0f37c636c1996a587f6b", "score": "0.69175655", "text": "function spawn() {\n setInterval(function() {\n var position = getPosition();\n var speed = getSpeed();\n if (allEnemies.length <= 10) {\n var enemy = new Enemy(position, 3);\n allEnemies.push(enemy);\n }\n }, 1500);\n}", "title": "" }, { "docid": "e85359656696875a45ed35eab6af35f4", "score": "0.6911563", "text": "function spawnEnemyShip(){\n\t\tenemyShipArray.push(new Projectile(Math.max(Math.random()*canvas.width-enemyShipXDimension, 0), 30+Math.random()*20, enemyShipXDimension, enemyShipYDimension, enemyShipXSpeed, enemyShipYSpeed, true));\n\t}", "title": "" }, { "docid": "fc32c627c392b92979f2774af5080bf2", "score": "0.68885046", "text": "function createEnemy()\n{\n //x,y,z position with 0 rotation\n //set the x position\n var xpos:int;\n xpos = GameObject.FindGameObjectWithTag(\"MainCamera\").transform.position.x + Random.Range(14,16);\n //set the y position\n var ypos:int;\n ypos = GameObject.FindGameObjectWithTag(\"MainCamera\").transform.position.y + Random.Range(-8,-8);\n \n //create an enemy relative to the game object\n Instantiate(enemy,Vector3(xpos,ypos,0),Quaternion.identity);\n}", "title": "" }, { "docid": "0ae6f8f0020210d676b4d9ad271a4221", "score": "0.6878622", "text": "enemyEntersTp(x, y) {\n\n\n //TODO: hide the monster!\n\n if (AlienInSound != undefined)\n AlienInSound.play();\n\n //Move the monster to the given coordinates:\n enemy.targetX = x\n enemy.targetY = y\n\n enemy.body.x = x * cellSize\n enemy.body.y = y * cellSize\n\n //Plan the exit of the Tp (a few seconds later):\n game.time.events.add(2000 + Math.random() * 2000, enemyQuitsTp, this);\n }", "title": "" }, { "docid": "cb5a259a549c4803a944509b4e435482", "score": "0.6869529", "text": "function spawnFungi() {\n\t\tif(playing) Enemies.push(new Enemy(canvas.width, player.woundSize, (WOUND_START_HEIGHT + (player.energy * WOUND_GROW_FACTOR)), \"FUNGI\"));\n\t}", "title": "" }, { "docid": "1820a3ad807b5794b85b095d6fafb5bf", "score": "0.68476117", "text": "function spawnProtozoa() {\n\t\tif(playing) Enemies.push(new Enemy(canvas.width, player.woundSize, (WOUND_START_HEIGHT + (player.energy * WOUND_GROW_FACTOR)), \"PROTOZOA\"));\n\t}", "title": "" }, { "docid": "274398163d2cc9cbbe9f5e8560fb4253", "score": "0.6833626", "text": "function Enemy()\r\n{\r\n\tWorldObject.call(this);\r\n\tthis.x = Math.random() * (canvas.width - ENEMY_SIZE);\r\n\tthis.y = ENEMY_SIZE * -1;\r\n\tthis.speed = Math.random() * (ENEMY_MAX_SPEED - ENEMY_MIN_SPEED) + ENEMY_MIN_SPEED;\r\n}", "title": "" }, { "docid": "f70d928233495d560a009a7044ea0c64", "score": "0.68047875", "text": "function SpawnParty() {\n\tlocs = mapp.GetVSpawn();\n\n\tfor (var i = 0; i < locs.length; i++) {\n\t\tif(i >= partySize){break;}\n\t\tvar x = locs[i].x;\n\t\tvar y = locs[i].y;\n\n\t\t//function PlayerUnit(game, key, frame, scale, x, y, health, baseDmg) {\n\t\tpUnit = new PlayerUnit(game, 'knightR','Knight1', 1.5, x * 32, y * 32, 100, 25);\n\t\tpUnit.animations.add('pAttack', Phaser.Animation.generateFrameNames('Knight', 1,9), 10, false); // Attack animation for player unit\n\t\tgame.add.existing(pUnit);\n\t\tvanguard.add(pUnit);\n\t\tmapp.Occupy(x,y + 1, pUnit);\n\n\t}\n\n}", "title": "" }, { "docid": "d8127597546b7788db74b3ce83b63894", "score": "0.6792641", "text": "function generateEnemy(){\n if(frames % 100 === 0){\n var x = Math.floor(Math.random() * 600)\n enemies.push(new Enemy(x))\n }\n}", "title": "" }, { "docid": "cf54e4dec2cb7d0d69a05c24c243d418", "score": "0.67893547", "text": "function newEnemy(en) {\n en.HP = 100;\n en.x = canvas.width / 5 * 4 - 32 - levelCounter;\n en.size = Math.random() * 60 + 15 + (levelCounter * 2);\n en.speed = Math.random() * 5 + (levelCounter / 15);\n en.bulletSize = Math.random() * (en.size - 9) + 3;\n en.bulletSpeed = Math.random() * 10 + (levelCounter / 4);\n en.bulletCD = (Math.random() * (en.bulletSize * 8) * (en.speed * 6) * en.bulletSpeed * 8) / (100 + levelCounter * 2) + en.bulletSize * 10;\n projectiles = [];\n en.frenzy = Math.random() * 100 + 10;\n en.normalColor = randomColor();\n en.color = en.normalColor;\n en.recharge = false;\n en.shootFx = whichShootFx(en.size);\n en.shootFx2 = whichShootFx2(en.size);\n enemyHP.style.backgroundColor = en.normalColor;\n en.shoot = function () {\n bulletsShot2++;\n en.frame = 0;\n en.frameCD = 0;\n projectiles.push({\n x: en.x + en.size / 2 - en.bulletSize / 2,\n y: en.y + en.size - en.bulletSpeed + 3,\n size: en.bulletSize,\n speed: en.bulletSpeed,\n color: en.normalColor,\n damage: en.bulletSize\n });\n if (clickedOnce) {\n if (en.shootFx.paused) {\n en.shootFx.play().catch(function (e) {\n console.log(\"shootfx enem - \" + e)\n });\n } else if (en.shootFx2.paused) {\n en.shootFx2.play().catch(function (e) {\n console.log(\"enem shoot 2 - \" + e)\n });\n }\n }\n };\n\n }", "title": "" }, { "docid": "6520a6b82702e221b029aeb86856eca4", "score": "0.6770536", "text": "function createEnemy() {\n if (lives <= 0) {\n return;\n } else {\n var _left = document.getElementById(\"enemies\").clientWidth - 50;\n var _top = 10;\n for (var i = 0; i < 29; i++) {\n if (level > 1) {\n alien.play();\n }\n enemies.push({ left: _left, top: _top });\n _top += 70;\n if (_top >= document.getElementById(\"enemies\").clientHeight - 120) {\n _top = 10;\n _left += 70;\n }\n }\n }\n}", "title": "" }, { "docid": "9b9dca21ed0bb24b69c4fed826d262f2", "score": "0.6761137", "text": "function createEnemies(horizontalSpawns, verticalSpawns, enemyWidth, enemyHeight, strength, color, moveSpeed, bulletSpeed, bulletPower){\n let clusterWidth = (enemyWidth + enemyXSpacing) * horizontalSpawns - enemyXSpacing;\n if (totalEnemyWidth) {\n totalEnemyWidth = Math.max(totalEnemyWidth, clusterWidth);\n } else {\n totalEnemyWidth = clusterWidth;\n }\n let enemyDrawXLeft = (gameBoardObj.width - clusterWidth) / 2;\n let enemyDrawYTop = enemyStartY;\n enemyMoveDistance = (gameBoardObj.width - totalEnemyWidth - enemyStartX * 2) / 2;\n for (let x = 0; x < horizontalSpawns; x++) {\n for (let y = 0; y < verticalSpawns; y++) {\n const enemy = new Enemy(gameBoardObj, moveSpeed, enemyWidth, enemyHeight, strength, color, '#c30', bulletSpeed, bulletPower, 0);\n const xPos = enemyDrawXLeft + enemyWidth / 2 + (enemyWidth + enemyXSpacing) * x;\n const yPos = enemyDrawYTop + enemyHeight / 2 + (enemyHeight + enemyYSpacing) * y;\n enemyStartY = yPos + enemyHeight / 2 + enemyYSpacing;\n enemy.Set(1, xPos, yPos);\n enemies.push(enemy);\n enemyCount++;\n }\n }\n }", "title": "" }, { "docid": "f0bd8f12db1fe1a31d2145cb39be85c8", "score": "0.67428076", "text": "function spawnBacteria() {\n\t\tif(playing) Enemies.push(new Enemy(canvas.width, player.woundSize, (WOUND_START_HEIGHT + (player.energy * WOUND_GROW_FACTOR)), \"BACTERIA\"));\n\t}", "title": "" }, { "docid": "63371780e09fdfbcee9d8383ba414638", "score": "0.6728085", "text": "function Enemy(){\n\t//set new position for enemy\n\tthis.setNewPos = function(){\n\t\tthis.clearRect();\n\t\tthis.y = Math.floor((Math.random()*this.canvas.height)-this.canvas.height);\n\t\tthis.x = Math.floor(Math.random()*this.canvas.width);\n\t\tthis.isColliding = false;\n\t}\n\t//clears enemy on canvas\n\tthis.clearRect = function(){\n\t\tthis.ctx.clearRect(this.x,this.y,this.width,this.height);\n\t}\n\t//moves enemy\n\tthis.move = function(){\n\t\tif (this.y > this.canvas.height || this.isColliding) {\n\t\t\tthis.setNewPos();\n\t\t}\n\t\telse{\n\t\t\tthis.y += this.speed;\n\t\t}\n\t}\n\t//draws enemy on canvas\n\tthis.draw = function(){\n\t\tthis.ctx.drawImage(this.image, this.x, this.y);\n\t}\n}", "title": "" }, { "docid": "9908a1e08ca0d4b4c732a4749a25bddd", "score": "0.6705603", "text": "function enemyShouldSpawn()\r\n{\r\n\tvar spawn = false;\r\n\t//Spawn immediately if max gap has been exceeded\r\n\tif (enemySpawnTimer.val >= enemySpawnInterval) spawn = true; \r\n\telse \r\n\t{\r\n\t\tvar msPerAttempt = enemySpawnInterval / NUM_OF_POTENTIAL_SPAWNS\r\n\t\tvar nextSpawnAttempt = msPerAttempt * (prevEnemySpawnAttempt + 1); //Next time to potentially spawn in ms\r\n\t\tif (enemySpawnTimer.val >= nextSpawnAttempt)\r\n\t\t{\r\n\t\t\tprevEnemySpawnAttempt ++; //Keeps track of which spawning attempt we're on from 0 to NUM_OF_POTENTIAL_SPAWNS\r\n\t\t\tvar spawnProb = (msPerAttempt * prevEnemySpawnAttempt) / enemySpawnInterval; //Probability of a spawn\r\n\t\t\tif (Math.random() <= spawnProb) spawn = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\tif (spawn)\r\n\t{\r\n\t\tenemySpawnTimer.val = 0;\r\n\t\tprevEnemySpawnAttempt = 0;\r\n\t\tenemySpawnInterval = ENEMY_MAX_SPAWN_INTERVAL - ENEMY_MAX_SPAWN_INTERVAL_DECREASE * score;\r\n\t\tif (enemySpawnInterval < ENEMY_MAX_SPAWN_INTERVAL_MIN) enemySpawnInterval = ENEMY_MAX_SPAWN_INTERVAL_MIN;\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}", "title": "" }, { "docid": "bbde2a253fa7b9a13cbaf43d522f5c3f", "score": "0.66964483", "text": "function spawnEnemies() {\r\n setInterval(() => {\r\n p = player.currentPosition();\r\n const radius = (30 - 6) + 6\r\n let x\r\n let y\r\n if (Math.random() < 0.5) {\r\n const radius = 30\r\n x = Math.random() < 0.5 ? 0 - radius : canvas.width + radius;\r\n y = Math.random() * canvas.height;\r\n }\r\n else {\r\n x = Math.random() * canvas.width;\r\n y = Math.random() < 0.5 ? 0 - radius : canvas.height + radius;\r\n }\r\n y = 0;\r\n const color = `hsl(${Math.random() * 360}, 50% , 50%)`\r\n const angle = Math.atan2(-y + p[1], -x + p[0])\r\n\r\n const velocity = {\r\n x: Math.cos(angle) * 2 * (1 + (score * 0.002)),\r\n y: Math.sin(angle) * 2 * (1 + (score * 0.002)),\r\n }\r\n\r\n enemies.push(new Enemy(x, y, radius, color, velocity));\r\n\r\n }, 1000)\r\n}", "title": "" }, { "docid": "d5eaa9f7bb268854cafcdcd509e71e0b", "score": "0.66933787", "text": "function spawnEnemySprites() {\n if (score > 100 && Math.random() > 0.96 && enemies.length < 3 && platformLength > 5 &&\n (enemies.length ? canvas.width - enemies[enemies.length - 1].x >= platformWidth * 3 ||\n canvas.width - enemies[enemies.length - 1].x < platformWidth : true)) {\n enemies.push(new Sprite(\n canvas.width + platformWidth % player.speed,\n platformBase - platformHeight * platformSpacer - platformWidth,\n Math.random() > 0.5 ? 'spikes' : 'slime'\n ));\n }\n }", "title": "" }, { "docid": "91b9d5279bfc8bd988917b4e150502f9", "score": "0.6692142", "text": "function startEnemy(enemy) {\n if (!enemyStarted) {\n enemyMovement(enemy, 'right');\n enemyStarted = true;\n }\n }", "title": "" }, { "docid": "bbd1ff86ccdea1b973f1b85f1e56d981", "score": "0.66850525", "text": "SpawnEnemies_(plane_position) {\n const numObjects = math.rand_int(1, 2);\n let x_done = new Array(5).fill(false);\n let possible_x = [-1.5, -0.75, 0, 0.75, 1.5];\n let x_index;\n for (let i = 0; i < numObjects; ++i) {\n let obj = null;\n\n if (this.unused_enemies.length > 0) {\n obj = this.unused_enemies.pop();\n obj.mesh.visible = true;\n } else {\n obj = new enemy.Enemy(this.params_);\n }\n\n this.separationDistance_ = math.rand_range(\n SEPARATION_DISTANCE,\n SEPARATION_DISTANCE * 1.5\n );\n obj.position.z = plane_position.z + this.separationDistance_;\n\n do {\n x_index = math.rand_int(0, 4);\n } while (x_done[x_index] == true);\n x_done[x_index] = true;\n obj.position.x = possible_x[x_index];\n obj.position.y = 0.75;\n this.enemies_.push(obj);\n }\n }", "title": "" }, { "docid": "2cc228d0271270b65c5147a119588bf0", "score": "0.66794527", "text": "function TestEnemy() {}", "title": "" }, { "docid": "2b46c531037b20f1dd68f76ce1a13097", "score": "0.6660081", "text": "function EnemyBullet(){}", "title": "" }, { "docid": "8fdd10f9483d6ee9a84102b703fd8dee", "score": "0.6635462", "text": "function spawn_enemy_soldiers()\n{\n\t//Generate random number for random lane\n\tvar randNum = Math.floor((Math.random() * 4) + 1);\n\tvar yPos;\n\tvar zPos;\n\tif (randNum == 1)\n\t{\n\t\tyPos = Lane1;\n\t\tzPos = Lane1;\n\t}\n\telse if (randNum == 2)\n\t{\n\t\tyPos = Lane2;\n\t\tzPos = Lane2;\n\t}\n\telse if (randNum == 3)\n\t{\n\t\tyPos = Lane3;\n\t\tzPos = Lane3;\n\t}\n\telse \n\t{\n\t\tyPos = Lane4;\n\t\tzPos = Lane4;\n\t}\n\t//stickMan(x, y, z, speed, health, atk, rng, fight, type, img_status){\n\tvar soldier = new stickMan(500, yPos, zPos, 1, 200, 2, 15, false, \"grunt\", 0);\n\teArmy.eFootSoldiers.push(soldier);\n}", "title": "" }, { "docid": "7e662dec20cd55d3225ae2281816aedb", "score": "0.66326517", "text": "function Enemy(X, Y) {\n\tthis.X = X;\n\tthis.Y = Y;\n}", "title": "" }, { "docid": "d803c99f6793d48ade0ec66709162c06", "score": "0.661884", "text": "function GenerateEnemy()\n{\n\tvES = new cShip();\n\tvES.vWeapon = new cWeapon();\n\tvar vN : int;\n\tvar vF : float;\n\tvN = Random.Range(0,vEName.length);\n\tvES.vName = vEName[vN];\n\tvN = Random.Range(0,vCS.vHP*2);\n\tvES.vMaxHP = vN;\n\tvES.vHP = vES.vMaxHP;\n\tvN = Random.Range(0,vCS.vMaxShield*1.3);\n\tvES.vMaxShield = vN;\n\tvES.vCurrShield = vES.vMaxShield;\n\t\n\tvN = Random.Range(vCS.vWeapon.vDmg*0.5,vCS.vWeapon.vDmg*3);\n\tvN++;\n\tvES.vWeapon.vDmg = vN;\n\tvN = Random.Range(1,vCS.vWeapon.vReloadtime*2);\n\tvES.vWeapon.vReloadtime = vN;\n\t\n}", "title": "" }, { "docid": "12fdad4ea856e9257199486ec0520e18", "score": "0.6617485", "text": "function drawEnemy() {\n\tfor (var i = 0; i < 9; i++) {\n\t\tif (enemies[i].eShow) {\n \t\tcontext.drawImage(enemies[i].imgEnemy, enemies[i].x, enemies[i].y, enemiesize, enemiesize);\n\t\t\tenemies[i].move();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "cf2898701c9d189a25784b6084eae469", "score": "0.66163075", "text": "function createEnemy(enemy, name, health, radius, size,speed, flying, color,moves,shoots,scale, shootingDelay) {\n enemy.name = name;\n enemy.scale.setTo(scale,scale);\n enemy.anchor.set(0.5, 0.5, 0.5);\n if(flying){\n enemy.animations.add(name + 'Left', [0,1,2,3]);\n enemy.animations.add(name + 'FrontRight', [4,5,6]);\n enemy.animations.add(name + 'Right', [7,8,9,10]);\n enemy.animations.add(name + 'FrontLeft', [11,12,13]);\n enemy.animations.add(name + 'BackRight', [14,15,16]);\n enemy.animations.add(name + 'Back', [17,18,19,20]);\n enemy.animations.add(name + 'BackLeft', [21,22,23]);\n enemy.animations.add(name + 'Front', [24,25,26,27]);\n enemy.animations.play(name + 'Back', this.animationsSpeed, true);\n }\n enemy.maxHealth = health;\n enemy.delay = shootingDelay;\n enemy.delayCounter = 0;\n enemy.moves = moves;\n game.physics.isoArcade.enable(enemy);\n if(!enemy.moves){\n enemy.body.immovable = true;\n }\n enemy.shoots = shoots;\n enemy.health = health;\n enemy.radius = radius;\n enemy.body.collideWorldBounds = true;\n enemy.body.setSize(size,size,size);\n enemy.speed = speed;\n enemy.radiusStart = 0;\n enemy.radiuses = game.add.group();\n enemy.radiuses.visible = false;\n if(flying)\n game.flyingGroup.add(enemy);\n game.enemyGroup.add(enemy);\n var theta = enemy.radiusStart; // angle that will be increased each loop\n var h = enemy.body.x; // x coordinate of circle center\n var k = enemy.body.y; // y coordinate of circle center\n var step = 15; // amount to add to theta each time (degrees)\n while(theta < enemy.radiusStart + 360)\n { \n var xx = radius*Math.cos(theta);\n var yy = radius*Math.sin(theta);\n var out = game.iso.project({x: xx, y: yy, z: 0});\n var sprite = game.add.isoSprite(enemy.body.x+xx,enemy.body.y+yy, 0, 'Radius');\n sprite.alpha = 0.85;\n sprite.scale.setTo(0.3,0.3);\n sprite.radius = enemy.radius;\n sprite.theta = theta;\n sprite.tint = color;\n game.physics.isoArcade.enable(sprite);\n sprite.body.collideWorldBounds = true;\n theta += step;\n enemy.radiuses.add(sprite);\n }\n}", "title": "" }, { "docid": "60df27c7d4e051ec672998b022c9889d", "score": "0.6613586", "text": "function spawnObjects(){\n\n\t// Create instance of hero\n\thero = new characterObject(\"empty\",playerStats.image,canvas.width/2 - 40,canvas.height - 100,256,0,0,\"player\")\n\tobjects.push(hero); // Add hero to list of objects\n\n\t//Define variables to create enemies\n\tlet chosenEnemy;\n\n\t// Create instances of enemies\n\tfor (let i = 0; i < exploreData.enemyCount; i++){\n\t\tlet enemyID = exploreData.enemyList[Math.floor(Math.random()*exploreData.enemyList.length)];//Random enemy ID from list\n\n\t\tfor (j in enemyStats){//Find enemy data based on selected ID\n\t\t\tif (enemyStats[j][\"enemyID\"] == enemyID){\n\t\t\t\tchosenEnemy = enemyStats[j];\n\t\t\t};\n\t\t};\n\n\t\tlet enemyImage = chosenEnemy.enemyImage;//Store image location in variable\n\n\t\tlet randomX = Math.max(Math.random()*(canvas.width - 70),0);//Random x coordinage\n\t\tlet randomY = Math.max(Math.random()*(canvas.height - 200),0);//Random y coordinate\n\t\tlet randomMoveX = 2*Math.random() - 1;//Initial movement direction\n\t\tlet randomMoveY = 2*Math.random() - 1;//Initial movement direction\n\n\t\tenemies[i] = new characterObject(enemyID,enemyImage,randomX,randomY,256,randomMoveX,randomMoveY,\"enemy\")//Create an instance of the enemy\n\t\tobjects.push(enemies[i]); // Add enemy to list of objects\n\t}\n\n}", "title": "" }, { "docid": "642e356f6cfb50d72d6480973cba486b", "score": "0.66041887", "text": "function enemyKill (laser, enemy) {\n\n laser.kill();\n enemy.kill();\n laserSFX.play();\n killCounter++;\n score += 10;\n scoreText.text = 'Score: ' + score;\n if (killCounter == numEnemies) {currSpeedY += 20;}\n var b = enemies.create(50 + (Math.random() * (game.world.width - 100)), 0, 'enemy');\n b.body.velocity.y = currSpeedY + (Math.random() * 100);\n b.checkWorldBounds = true;\n b.events.onOutOfBounds.add(endGame, this);\n\n }", "title": "" }, { "docid": "f7e2846310e9c19ee1b85469afb54189", "score": "0.6601713", "text": "respawn()\n {\n this.x = this.enemyStart.x;//reset monster x-coordinate\n this.y = this.enemyStart.y;//reset monster y-coordinate\n this.body.velocity.y = 0; //reset y.velocity to 0\n\n }", "title": "" }, { "docid": "769e453a532280dc4cac6bcd3084f34c", "score": "0.66016734", "text": "function enemyHandler() {\n //randomShot finds a random number between 0 and 1000 and if the number matches the index of the enemy currently being iterated \n //that enemy will fire a shot. This adds an element of randomness to the game making it feel more dynamic\n let randomShot = round(random(0, enemyShotRate));\n for (let i = 0; i < enemies.length; i++) {\n if (enemies[i].position.y < height + 100) {\n if (i == randomShot) {\n let newShot = createSprite(enemies[i].position.x, enemies[i].position.y);\n fire.play();\n newShot.addImage(enemyShot);\n newShot.scale = 0.3;\n enemyShots.add(newShot);\n }\n //When left is true the enemies move towards the left side of the screen and left=false means right. When they change from left\n //to right and vice versa the down-boolean also changes to true, and the enemies move down the screen towards the player for a bit until the\n //nextY variabel gets to 20. This means the fewer enemies left, the further the enemies move down the screen before stopping.\n if (left) {\n if (down) {\n enemies[i].attractionPoint(0.1, enemies[i].position.x, height);\n nextY += 0.05;\n if (nextY >= 20) down = false;\n }\n if (enemies[i].position.x < 700) enemies[i].position.x += enemyMoveSpeed;\n else {\n nextY = 0;\n down = true;\n left = false;\n }\n }\n else {\n if (down) {\n enemies[i].attractionPoint(0.1, enemies[i].position.x, height);\n nextY += 0.05;\n if (nextY >= 20) down = false;\n }\n if (enemies[i].position.x >= 100) enemies[i].position.x -= enemyMoveSpeed;\n else {\n nextY = 0;\n down = true;\n left = true;\n }\n }\n\n if (enemies[i].position.y > height - 50 || enemies[i].overlap(currentPlayer)) {\n enemies[i].attractionPoint(0.1, enemies[i].position.height - 30);\n if (enemies[i].position.y > height - 10);\n if(enemies[i].overlap(currentPlayer)){\n //Adds the hit-explosion animation\n let thisPlayerHit = createSprite(currentPlayer.position.x, currentPlayer.position.y);\n thisPlayerHit.addAnimation(\"explode\", playerHit);\n playerHitGroup.add(thisPlayerHit);\n append(playerHitList, frameCount);\n\n hit.play();\n }\n enemies[i].remove;\n enemyCounter--;\n lives--;\n }\n //all three player shot groups must be checked to see if a player has hit an enemy, the powerShotLeft and Right check for hits \n //when the player is powered up\n enemyHit(enemies[i], shots, 400, 1000, i);\n enemyHit(enemies[i], powerShotGroupLeft, 400, 1000, i);\n enemyHit(enemies[i], powerShotGroupRight, 400, 1000, i);\n }\n }\n}", "title": "" }, { "docid": "25ffe9f42980290565fe7ee9b630d7c3", "score": "0.6600671", "text": "function enemy(width, height, color, x, y, type) {\r\n this.type = type;\r\n if (type == \"image\") {\r\n this.image = new Image();\r\n this.image.src = color;\r\n }\r\n this.width = width;\r\n this.height = height;\r\n this.x = x;\r\n this.y = y;\r\n this.update = function () {\r\n context.drawImage(this.image, p.x, p.y);\r\n }\r\n }", "title": "" }, { "docid": "e8f2ab01dbc58eb2b1cab7d74831cd57", "score": "0.65775913", "text": "function spawn_Enemy_Bug () {\n if (enemyList.length < 35) {\n //HP, expReward, attackDamage, speed, width, height, imageGiven, movementType\n enemyList.push(new enemy(115, 105, 3, 3, 25, 25, enemy_bug_Pic, \"random\"));\n\n };\n}", "title": "" }, { "docid": "987b4bcc41b7b317a7963d46758328ab", "score": "0.65740985", "text": "function Enemy(x, y, speed = randomSpeed(110, 320)) /* change interval to make the game easyer of harder */ {\n this.sprite = 'images/enemy-bug.png';\n this.x = x;\n this.y = y;\n this.speed = speed;\n}", "title": "" }, { "docid": "adce543b1938ac465823727319dd7f95", "score": "0.65693897", "text": "function spawnEnemy() {\n setInterval(() => {\n const radius = Math.random() * (50 - 5) + 5;\n let x;\n let y;\n if (Math.random() < 0.5) {\n x = Math.random() < 0.5 ? 0 - radius : canvas.width + radius;\n y = Math.random() * canvas.height;\n } else {\n x = Math.random() * canvas.width;\n y = Math.random() < 0.5 ? 0 - radius : canvas.height + radius;\n }\n const rR = Math.random() * 255; // random Red shade\n const rG = Math.random() * 255; // random Green shade\n const rB = Math.random() * 255; // random Blue shade\n\n const color = 'rgba(' + rR + ',' + rG + ',' + rB + ',1)';\n const angle = Math.atan2(center.y - y, center.x - x);\n const speed = {\n x: Math.cos(angle),\n y: Math.sin(angle)\n };\n\n enemies.push(new Enemy(x, y, radius, color, speed));\n }, 1000);\n}", "title": "" }, { "docid": "2141c4c3be631581bebd5114621d4bb8", "score": "0.65603083", "text": "function bossSpawn() {\n if (enemies.length <= 0 && playerHealth >0) {\n setPosition(boss);\n drawbossEnemies();\n movebossEnemies();\n checkCollisionBoss();\n checkCollisionbossEnemies();\n bossMusic.play();\n mainSound.stop();\n if (bossHealth <= 0) {\n bossMusic.stop();\n }\n }\n}", "title": "" }, { "docid": "13a8bb70663adc595da810fe102fdf4a", "score": "0.6559392", "text": "function spawn_enemy_soldiers()\n{\n\t//Generate random number for random lane\n\tvar randNum = Math.floor((Math.random() * 4) + 1);\n\tvar position;\n\tif (randNum == 1)\n\t{\n\t\tposition = 375;\n\t}\n\telse if (randNum == 2)\n\t{\n\t\tposition = 345;\n\t}\n\telse if (randNum == 3)\n\t{\n\t\tposition = 315;\n\t}\n\telse \n\t{\n\t\tposition = 285;\n\t}\n\tvar soldier = new stickMan(400, position, position, 2, 10, 10, 5, 2, false);\n\teArmy.eFootSoldiers.push(soldier);\n\tmaterials += 5;\n}", "title": "" }, { "docid": "08fe8f02f19843e379a88edc83e2c36d", "score": "0.655582", "text": "function createEnemy(controller, pos, direction, speed, orient, boundRadius, health){\n\tvar enemy = new GameObject(controller,pos, direction, speed, orient, boundRadius, health);\n\t\n\tenemy.type = \"Enemy\";\n\tenemy.state = 0;\n\tenemy.innerCounter = 0;\n\n\tenemy.update = function() {\n\t\tthis.pos = this.pos.add(this.direction.mult(this.speed));\n\t};\n\t\n\tenemy.draw = function(ctx) {\n\t\t\n\t\t// Convert direction to angle\n\t\tvar angle = Math.atan2(-this.direction.x, this.direction.y);\n\t\t\t\t\n\t\tctx.fillStyle = 'white';\n\t\t\n\t\tctx.save();\n\t\tctx.translate(this.pos.x, this.pos.y);\n\t\tctx.rotate(angle);\n\t\tctx.fillRect(0-6, 0-6, 12, 12);\n\t\tctx.restore();\n\t\t\n\t};\n\t\n\treturn enemy;\n}", "title": "" }, { "docid": "b6453028488f3bc4480132d9bd883826", "score": "0.6552543", "text": "function draw_enemy() {\n\tconst e_speed = 2;\n\tctx.clearRect(0, 0, enemy_canv.width, enemy_canv.height); // clear canvas to remove past drawings\n\n\tfor (i = 0; i < enemy_store.length; ++i) {\n\t\tenemy_store[i].create();\n\n\t\t// direction: enemy moves towards player\n\t\tlet enemy_dir = Math.atan2(player_y - enemy_store[i].Y, player_x - enemy_store[i].X);\n\t\t\tmove_ex = Math.cos(enemy_dir) * e_speed;\n\t\t\tmove_ey = Math.sin(enemy_dir) * e_speed;\n\n\t\t// update enemy x and y\n\t\tenemy_store[i].X += move_ex;\n\t\tenemy_store[i].Y += move_ey;\n\t}\n}", "title": "" }, { "docid": "2e3a0059bd51a65189a18fe84d8f7c5e", "score": "0.654125", "text": "function Enemy(beginX, beginY, x, y, moveToX, moveToY, finishX, finishY, eShow, eDie, imgEnemy) {\n\tthis.beginX = beginX;\n\tthis.beginY = beginY;\n\tthis.x = x;\n\tthis.y = y;\n\tthis.moveToX = moveToX;\n\tthis.moveToY = moveToY;\n\tthis.finishX = finishX;\n\tthis.finishY = finishY;\n\tthis.eShow = eShow;\n\tthis.eDie = eDie;\n\tthis.imgEnemy = imgEnemy;\n}", "title": "" }, { "docid": "178594c7d7bc97222c1ced3ec570f816", "score": "0.6538905", "text": "function spawnVirus() {\n\t\tif(playing) Enemies.push(new Enemy(canvas.width, player.woundSize, (WOUND_START_HEIGHT + (player.energy * WOUND_GROW_FACTOR)), \"VIRUS\"));\n\t}", "title": "" }, { "docid": "9d028e292bd8157841ff60a1ef5b07d0", "score": "0.6528448", "text": "function createEnemy(x, y, vx, vy) {\n var square = createSquare(x, y, vx, vy, SQUARE_SIZE, 'red');\n enemies.push(square);\n}", "title": "" }, { "docid": "836d6843907c60e474ac25d1411a7552", "score": "0.64923316", "text": "function enemy(color, type) {\n this.color = color,\n this.type = type\n}", "title": "" }, { "docid": "59a0a76772ebf242bf5bcc97457acc2f", "score": "0.64908504", "text": "function spawnEnemy() {\r\n let index = enemyTypes.length - 1;\r\n currentEnemyIndex = Math.round(Math.random()*index);\r\n console.log(enemyTypes[currentEnemyIndex].name);\r\n document.getElementById('btnSpawnEnemy').disabled = true;\r\n InBattle = true;\r\n currentEnemyHp = enemyTypes[currentEnemyIndex].health;\r\n document.getElementById('eCurrentHealth').innerText = currentEnemyHp;\r\n document.getElementById('eMaxHealth').innerText = currentEnemyHp;\r\n document.getElementById('eName').innerText = enemyTypes[currentEnemyIndex].name;\r\n document.getElementById('eLevel').innerText = enemyTypes[currentEnemyIndex].level;\r\n document.getElementById('eMinDmg').innerText = enemyTypes[currentEnemyIndex].minDamage;\r\n document.getElementById('eMaxDmg').innerText = enemyTypes[currentEnemyIndex].maxDamage;\r\n document.getElementById('eDesc').innerText = enemyTypes[currentEnemyIndex].description;\r\n update();\r\n}", "title": "" }, { "docid": "a9c6137cb6ac160bd1191be5553bace0", "score": "0.64770776", "text": "function Enemies() {\n this.spawn = function(number) {\n for (var i = 0; i < number; i++) {\n // Call the getRandomInt function and set the speed of the enemy.\n var speed = getRandomInt(constants.MIN_SPEED, constants.MAX_SPEED);\n // Call the getRandomInt function and set the players y position on the canvas.\n var position = getRandomInt(0, 3);\n // Instatiate a new enemy object and push it into the global allEnemies array\n allEnemies.push(new Enemy(constants.POSITION_Y[position], speed));\n }\n };\n // Reset Enemies -- clear from the canvas\n this.reset = function() {\n allEnemies = [];\n };\n}", "title": "" }, { "docid": "abcc7ccda8445dd0a10d0343c5347ad7", "score": "0.64720035", "text": "function AddEnemy(type){\n var new_enemy = new Enemy(type);\n enemies.push(new_enemy);\n console.log('Added enemy: '+type);\n}", "title": "" }, { "docid": "d2578a96b95d246bed178b3baf723a70", "score": "0.64697665", "text": "function Enemy() {\n\tthis.alive = false;\n\tthis.collidableWith = \"bullet\";\n\tthis.type = \"enemy\";\n\t\n\tthis.spawn = function(x,y,speed){\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.speed = speed;\n\t\tthis.vx = 2;\n\t\tthis.vy = speed;\n\t\tthis.alive = true;\n\t};\n\tthis.draw = function() {\n\t\tthis.context.clearRect(this.x,this.y,this.width,this.height);\n\t\t// bounces around the canvas\n\t\tif (this.x >= 600 - this.width) {\n\t\t\tthis.vx = -this.vx;\n\t\t}\n\t\tif (this.x <= 0) {\n\t\t\tthis.vx = -this.vx;\n\t\t}\n\t\tif (this.y >= 550 - this.height) {\n\t\t\tthis.vy = -this.vy;\n\t\t}\n\t\tif (this.y <= 0) {\n\t\t\tthis.vy = -this.vy;\n\t\t}\n\t\tif (KEY_STATUS.shift) {\n\t\t\tthis.alive = false;\n\t\t\tthis.context.clearRect(this.x,this.y,this.width,this.height);\n\t\t}\n\t\tthis.x += this.vx;\n\t\tthis.y += this.vy;\n\t\tif (!this.isColliding) {\n\t\t\tthis.context.drawImage(imageRepository.enemy,this.x,this.y);\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\tgame.playerScore += 10;\n\t\t\treturn true;\n\t\t}\n\t};\n\n\tthis.clear = function() {\n\t\tthis.x = 0;\n\t\tthis.y = 0;\n\t\tthis.speed = 0;\n\t\tthis.vx = 0;\n\t\tthis.vy = 0;\n\t\tthis.alive = false;\n\t\tthis.isColliding = false;\n\t};\n}", "title": "" }, { "docid": "36ac2c7038aa912e77c0725597bd0615", "score": "0.6466598", "text": "function createEnemies(){\n let randNr = random(1 * wave, 5 * wave);\n let heightHere = -300;\n let multiplier = 70;\n let j = 0;\n if(allDead){\n for(let i = 0; i < randNr; i++){\n if(xConstrainMin + j*multiplier + 50 >= xConstrainMax){heightHere -= 100; j = 0}\n let enemyShip = createSprite(xConstrainMin + j*multiplier + 40, heightHere);\n enemyShip.addImage(enemy);\n enemyShip.scale = 0.2;\n enemies.add(enemyShip);\n j++;\n\n }\n wave++;\n allDead = false;\n }\n}", "title": "" }, { "docid": "cb840697e933c63c07a4390531892adc", "score": "0.6462776", "text": "function Enemy(start_x, start_y) {\r\n\t\r\n\t//settings and config for Enemy \r\n\tvar image_source = 'alien.png';\r\n\tthis.width = 16;\r\n\tthis.height = 12;\r\n\tvar curr_move = 'left';\t//initial direction\r\n\t\r\n\t//Make animating object \r\n\tvar enemy = new GameObject(3);\r\n\tenemy.start_img(image_source, this.width, this.height);\r\n\tenemy.start_position(start_x, start_y);\r\n\r\n\r\n\t//Draws the enemy with the gameobject class onto the canvas\r\n\tthis.draw = function() {\r\n\t\tenemy.draw();\r\n\t}\r\n\r\n\t//get the enemies position at x\r\n\t this.get_x = function() {\r\n\t \treturn enemy.x;\r\n\t }\r\n\r\n\t//get the enemies position at y\r\n\t this.get_y = function() {\r\n\t \treturn enemy.y;\r\n\t }\r\n\r\n\t//moves the enemy left, right\r\n\tthis.step = function() {\r\n\t\tif(curr_move == 'left') {\r\n\t\t\tenemy.go_left();\r\n\t\t}else if(curr_move == 'right') {\r\n\t\t\tenemy.go_right();\r\n\t\t}\r\n\t}\r\n\r\n\t//moves the enemy up\r\n\tthis.up = function() {\r\n\t\tif(curr_move == 'left') {\r\n\t\t\tcurr_move = 'right';\r\n\t\t}else {\r\n\t\t\tcurr_move = 'left';\r\n\t\t}\r\n\t\tenemy.go_front();\r\n\t}\r\n\r\n\t//verifties if the move is needed\r\n\tthis.verify_move = function() {\r\n\t\tif(enemy.x <= 10 && curr_move == 'left') {\r\n\t\t\tcurr_move = 'right';\r\n\t\t}else if(enemy.x >= (WIDTH - 10) && curr_move == 'right') {\r\n\t\t\tcurr_move = 'left';\r\n\t\t}\r\n\t\treturn curr_move;\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "d7374ed06caed63c548c5cb3a30c0ecd", "score": "0.6459049", "text": "createBonusEnemy() {\n /* \n Creamos la nave.\n Se mueve hasta salirse del canvas y se para.\n Cuando salga de la pantalla se hace transparente.\n Despues de 30 seg vuelve a ser visible en la posición de salida.\n */\n this.bonus = new BonusEnemy();\n setTimeout(() => { this.bonus.move(); }, (Math.random() * game.enemiesMovementController.bonusTimeout * 0.5) + (game.enemiesMovementController.bonusTimeout * 0.5));\n }", "title": "" }, { "docid": "fa16a0fc0c5e3cf129a721e7e9fe1534", "score": "0.64533764", "text": "hurtPlayer(player, enemy) {\r\n this.resetShipPos(enemy);\r\n if (this.player.alpha < 1) {\r\n return;\r\n }\r\n var explosion = new Explosion(this, player.x, player.y);\r\n this.explosion_sound.play();\r\n player.disableBody(true, true);\r\n\r\n this.enemy_BaseSpeed = 1;\r\n this.mapSpeed = 0.5;\r\n this.bulletVelocity = 250;\r\n \r\n this.time.addEvent({\r\n delay: 1000,\r\n // reset the player after 1000ms\r\n callback: this.resetPlayer,\r\n callbackScope: this,\r\n loop: false\r\n });\r\n }", "title": "" }, { "docid": "c35adb8d83cd48e5223ad73ac9a96b3b", "score": "0.64524674", "text": "enemyHit(player) {\n this.player.destroy(this.x, this.y - 30);\n }", "title": "" }, { "docid": "0a61bf1d7c400911d7b3d4e0aa46a542", "score": "0.64509994", "text": "function killEnemy() {\r\n enemy_health.innerHTML = \"Defeated!!!\";\r\n dead = true;\r\n round += 1;\r\n // removes bopping animation\r\n enemy.style.animationName = \"none\";\r\n // changes eyes of enemy and spawns new enemy\r\n if ((left_eye === null || left_eye === void 0 ? void 0 : left_eye.style.height) !== undefined &&\r\n (left_eye === null || left_eye === void 0 ? void 0 : left_eye.clientHeight) !== undefined &&\r\n (right_eye === null || right_eye === void 0 ? void 0 : right_eye.style.height) !== undefined &&\r\n (right_eye === null || right_eye === void 0 ? void 0 : right_eye.clientHeight) !== undefined) {\r\n if (left_eye.clientHeight > 3) {\r\n left_eye.style.height = (left_eye === null || left_eye === void 0 ? void 0 : left_eye.clientHeight) / 2 + \"px\";\r\n right_eye.style.height = (right_eye === null || right_eye === void 0 ? void 0 : right_eye.clientHeight) / 2 + \"px\";\r\n }\r\n else if (left_eye.clientHeight !== 0) {\r\n left_eye.style.height = \"0px\";\r\n right_eye.style.height = \"0px\";\r\n }\r\n else {\r\n left_eye.style.height = \"var(--eye_size)\";\r\n right_eye.style.height = \"var(--eye_size)\";\r\n changeEnemyColor();\r\n }\r\n }\r\n // creates new enemy\r\n setTimeout(function () {\r\n newEnemy();\r\n // adds bopping animation\r\n enemy.style.animationName = \"default-enemy-movement\";\r\n //removes money effect\r\n money_effect.style.animationName = \"none\";\r\n }, 2000);\r\n }", "title": "" }, { "docid": "75e15d1d24812c0c3636235dffacb054", "score": "0.64483213", "text": "enter(game, enemy)\n\t{\n\t\t//animations\n\t}", "title": "" }, { "docid": "e466a9896105c58608bce31900ac6b13", "score": "0.64470047", "text": "function enemyMove0 () {\n\t// Movement of Object\n\tfor (j=0;j<=0;j++) {\n\tenemySpawnPosition[j].x -= enemySpeed;\n\tenemy[j].attr({\n\t\t'x': enemySpawnPosition[j].x\n\t});\n\tenemyConditions(j);\n\t}\n}", "title": "" }, { "docid": "32ff8929793653a8da9f8bb6f1915d6d", "score": "0.64428073", "text": "function generateEnemy(x) {\n var enemyAttack = Math.floor(Math.random() * 10);\n var enemyAge = Math.floor(Math.random() * 6);\n for (var i = 0; i < x; i++) {\n var enemyName = \"Warrior\" + i.toString();\n var warrior = new Enemy(enemyName, enemyAge, 100, enemyAttack);\n enemies.push(warrior);\n }\n }", "title": "" }, { "docid": "fb1d25a0ba91a286e049fd35fdac1b34", "score": "0.64386356", "text": "function findSpawn(enemy) {\n\tvar testPath;\n\tvar times = 0;\n\t/**\n\t * test paths until a\n\t */\n\tdo {\n\t\tdo {\n\t\t\t// 0-3 top-left clockwise\n\t\t\tvar x = 0;\n\t\t\tvar y = 0;\n\t\t\tif (side === 0 || side === 2) {\n\t\t\t\tx = random(0, canvasWidth - 1);\n\t\t\t\tif (side === 2) {\n\t\t\t\t\ty = canvasWidth - 1;\n\t\t\t\t}\n\t\t\t} else if (side === 1 || side === 3) {\n\t\t\t\ty = random(0, canvasHeight - 1);\n\t\t\t\tif (side === 1) {\n\t\t\t\t\tx = canvasHeight - 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttimes++\n\t\t\tvar testMap = compile();\n\t\t} while (testMap[x][y].speed === 0 /* && times < canvasWidth * canvasHeight*/ );\n\n\t\tdata.x = x;\n\t\tdata.y = y;\n\t\tdata.pixelX = centerSymmetrical(x, data.size);\n\t\tdata.pixelY = centerSymmetrical(y, data.size);\n\t\ttestPath = getPaths([data], testMap);\n\t} while (!testPath.length)\n\tdata.path = testPath;\n\tdata.targetX = testPath[0].x;\n\tdata.targetY = testPath[0].y;\n\tdata.pathIndex = 0;\n\treturn enemy;\n}", "title": "" }, { "docid": "caa7ce9dc9b0c1ab45365825a92e687a", "score": "0.6437879", "text": "function createEnemies() {\n const enemy_1 = new Enemy( -320, 141, 63, 'enemy-bug');\n const enemy_2 = new Enemy( -200, 58, 145, 'enemy-bug');\n const enemy_3 = new Enemy( -500, 224, 227, 'enemy-bug');\n const enemy_4 = new Enemy( game.width + 100, 141, -120, 'enemy-bug-b');\n\n allEnemies.push(enemy_1, enemy_2, enemy_3, enemy_4);\n}", "title": "" }, { "docid": "14e039c6fd9fd83ea25ef26e7b219143", "score": "0.6437029", "text": "movementBasicEnemy(enemy)\r\n {\r\n //var posPx = new Phaser.Math.Vector2()\r\n var distanciaX = Phaser.Math.Distance.BetweenPoints(this.player.x, malo2.x);\r\n var distanciaY = Phaser.Math.Distance.BetweenPoints(this.player.y, malo2.y);\r\n\r\n //if (distanciaX <= 200 && distanciaY <= 200) \r\n //{\r\n for (var i = 0; i < basicEnemyList.getChildren().length; i++) \r\n { //MOVIMIENTO ENEMIGO-DISPARO ENEMIGO//\r\n var enemy = basicEnemyList.getChildren()[i];\r\n if (enemy.attack == true) \r\n { \r\n enemy.direccion = new Phaser.Math.Vector2(player.x-enemy.x,player.y-enemy.y); \r\n enemy.setVelocityX(velocidad * enemy.direccion.x/2);\r\n enemy.setVelocityY(velocidad * enemy.direccion.y/2);\r\n }\r\n }\r\n if (muerto == false && inmovil == false) \r\n {\r\n /*Phaser.Actions.Call(basicEnemyList.getChildren(), function(go) {\r\n if (go.attack == true) \r\n {\r\n this.physics.moveTo(go, this.player.x, this.player.y, 200);\r\n }\r\n })*/\r\n }\r\n else\r\n {\r\n malo2.setVelocityX(0);\r\n malo2.setVelocityY(0);\r\n }\r\n //}\r\n }", "title": "" }, { "docid": "b97fc5230d2e34d4b0f41e5c9ea31c9b", "score": "0.6433395", "text": "function drawEnemy(screen, body){\n screen.fillStyle = 'green';\n screen.fillRect(body.center.x, body.center.y,\n body.size.x, body.size.y)\n}", "title": "" }, { "docid": "f8576f9e7f9cafe4e9526ac891a4aee0", "score": "0.6430849", "text": "function GenerateEnemy() {\r\n\tlet preload_enemy_img = $(\"#preload_enemy_img\")\r\n\r\n\t// Se calcula aletoriamente la X, la Y y la direccion Vertical y Horizontal del enemigo\r\n\tlet newEnemy_X = Math.round(Math.random() * (WIDTH + 1))\r\n\tlet newEnemy_Y = Math.round(Math.random() * ((HEIGHT - preload_enemy_img.height()) + 1))\r\n\tlet newEnemy_Hgoing = Math.round(Math.random())\r\n\tlet newEnemy_Vgoing = Math.round(Math.random())\r\n\r\n\tif (debug) console.log(\"Enemy created at: x=\" + newEnemy_X + \":y=\" + newEnemy_Y)\r\n\r\n\t// Se crea una instancia del enemigo y se pushea al array principal de enemigos\r\n\tlet enemy = new Enemy(newEnemy_X, newEnemy_Y, newEnemy_Hgoing, newEnemy_Vgoing, \"enemy\" + generatedID++)\r\n\tenemies.push(enemy)\r\n\r\n\t// Parametros visuales del enemigo un DIV con una IMG dentro\r\n\tenemyString = \"<div id='\" + enemy.ID + \"' style='width:\" + enemy.size + \"px; \"\r\n\tenemyString = enemyString + \"position:absolute; left: \" + enemy.X + \"px; \"\r\n\tenemyString = enemyString + \"top: \" + enemy.Y + \"px'>\"\r\n\tenemyString = enemyString + \"<img src = '\" + enemy.src + \"' width = '\" + enemy.size + \"' >\"\r\n\tif (debug) enemyString = enemyString + \"<label style='color:white; font-size:0.8em;' id=label\" + enemy.ID + \"></label>\"\r\n\tenemyString = enemyString + \"</div>\"\r\n\t\r\n\t// Se añade a la ventana de juego\r\n\t$(\"#GameBoundaries\").append(enemyString)\r\n}", "title": "" }, { "docid": "c4eda021eadcfddcc7ae064dcbbb3ac7", "score": "0.64308316", "text": "async function makeNewEnemy(user) {\n locationInfo = await botLevel.findOne({ 'Location': location }, (err, enemy) => {\n });\n let enemyLvl = Math.floor(Math.random() * 11) - 5 + user.level;\n if (enemyLvl < 1) enemyLvl = 1;\n\n let baseStat = enemyLvl / 2 < 1 ? Math.floor(enemyLvl / 2) : 1;\n let minStat = 5;\n // Takes the buff from the db and applies it to the enemies\n const { hp: hpMulti, attack: attackMulti, defense: defenseMulti, speed: speedMulti } = locationInfo._doc.Buff;\n let enemyHP = Math.floor((Math.random() * (Math.exp(enemyLvl) ** (1 / 20)) + minStat * 5 + enemyLvl * 5) * hpMulti);\n let enemyAttack = Math.floor((Math.random() * enemyLvl + minStat + baseStat) * attackMulti);\n let enemyDefense = Math.floor((Math.random() * enemyLvl + minStat + baseStat) * defenseMulti);\n let enemySpeed = Math.floor((Math.random() * enemyLvl + minStat + baseStat) * speedMulti);\n let enemyType = \"undead\";\n let enemy = new Enemy(await generateEnemyName(), enemyHP, enemyAttack, enemyDefense, enemySpeed, enemyType, enemyLvl);\n return enemy;\n }", "title": "" }, { "docid": "f48ef6362cf8cd6f81534b532e9b01f3", "score": "0.6422248", "text": "function chooseEnemy(obj) {\n console.log(\"in chooseEnemy\");\n inGame = true;\n // move the selected enemy to enemyChar side of the battlefield\n $(\"#\"+obj.id).appendTo($(\"#enemyChar\"));\n // enables the attack button\n document.getElementById(\"attack\").disabled = false;\n}", "title": "" }, { "docid": "c52a3bbe2e619eebc4a42025d8038907", "score": "0.64216197", "text": "function generateEnemy(){\n var enemy = new Enemy();\n enemies.push(enemy);\n if (enemies.length > 2) {\n clearInterval(randomEnemy);\n }\n}", "title": "" }, { "docid": "b15a912f95ade3d89e792cafe3d79211", "score": "0.6411549", "text": "function timeDelayEnemy() {\n stage.insert(new Q.Enemy({ x: 700, y: 0 }));\n }", "title": "" }, { "docid": "c40f0cad706191538e7f7dc894a6e1bd", "score": "0.6409665", "text": "spawnPlayer() {\n this.player = new Plane(this, ship.player);\n this.addEntity(this.player);\n }", "title": "" }, { "docid": "e8076c25682d843b59b30f8b0b28b179", "score": "0.6402509", "text": "function Enemy(x, y, speed) {\n this.avatar = 'enemy-bug.png';\n Character.call(this, x, y, this.avatar);\n this.speedX = speed;\n this.width = 90;\n this.height = 60;\n}", "title": "" }, { "docid": "fd2bf52a4daad4d57a4b396ec8a6a1b5", "score": "0.6397692", "text": "function enemyShootingOne(){\n if(enemylaser.x >= 0 ){\n enemylaser.x = Enemyone.x + 30 ;\n enemylaser.y = Enemyone.y - enemylaser.h;\n }\n if(enemylaser5.y >= 0 ){\n enemylaser5.x = Enemyfive.x + 30 ;\n enemylaser5.y = Enemyfive.y - enemylaser5.h;\n }\n if(enemylaser6.y >= 0 ){\n enemylaser6.x = Enemysix.x + 30 ;\n enemylaser6.y = Enemysix.y - enemylaser6.h;\n }\n if(enemylaser10.y >= 0 ){\n enemylaser10.x = Enemyten.x + 30 ;\n enemylaser10.y = Enemyten.y - enemylaser10.h;\n }\n \n \n }", "title": "" }, { "docid": "1867fc23063495e7a8dcec973e66749f", "score": "0.6387486", "text": "constructor(x,y,num){\n this.x=x+30;\n this.y=y+30;\n this.enemySpeed=CONFIG.enemySpeed;// 默认敌人移动距离\n this.enemySize=CONFIG.enemySize;// 默认敌人的尺寸\n this.enemyGap=CONFIG.enemyGap;// 默认敌人之间的间距\n this.enemyIcon=CONFIG.enemyIcon;// 怪兽的图像\n this.enemyBoomIcon=CONFIG.enemyBoomIcon;// 怪兽死亡的图像\n this.enemyDirection=CONFIG.enemyDirection;// 默认敌人\b一开始往右移动\n this.state='live';\n this.num=num;\n }", "title": "" }, { "docid": "744c5f0fed9806e61eacb3cbaacf44b0", "score": "0.6384769", "text": "function Enemy(type, x_pos, y_pos, x_dir){\n this.type = type;\n if (!x_pos){ x_pos = 500}\n if (!y_pos){ y_pos = world_floor+33}\n if (!x_dir){ x_dir = \"left\"}\n this.x = x_pos;\n this.y = y_pos;\n this.y_dir=false;\n this.x_dir= x_dir;\n this.x_speed = 0.9;\n this.y_speed=2;\n this.anim_strut = 20;\n this.anim_strut_count = this.anim_strut;\n this.img_set = new Object();\n this.img_set.main = new Image();\n this.img_set.main.src = \"img/enemies/\"+type+\".png\";\n this.img_set.main2 = new Image();\n this.img_set.main2.src = \"img/enemies/\"+type+\"2.png\"; \n //method to remove enemy\n this.CreateShell = function(){\n //if koopa, offer a shell to the murderer\n if(this.type==\"koopa\" || this.type==\"koopawing\"){\n console.log('CREATE SHELL AT x'+this.x);\n var shell = new Shell(this.x, this.y-10);\n \n shells.push(shell);\n }\n }\n if(type==\"bullet\"){\n this.img_set.main.src=\"img/enemies/bullet.png\";\n this.img_set.main2.src=\"img/enemies/bullet.png\";\n this.x_speed = 3;\n }\n if(type==\"koopawing\"){\n this.x_speed = 0.7;\n this.y_dir=\"up\";\n this.img_set.main.src=\"img/enemies/koopawing.png\";\n this.img_set.main2.src=\"img/enemies/koopawing2.png\";\n }\n if(type==\"pipeplant\"){\n this.x_speed =0;\n this.y_speed=0.4;\n this.anim_strut = 40;\n this.img_set.main.src=\"img/enemies/pipeplant.png\";\n this.img_set.main2.src=\"img/enemies/pipeplant2.png\";\n }\n if(type==\"footballer\"){\n this.x_speed =6;\n this.anim_strut = 15;\n this.img_set.main.src=\"img/enemies/football.png\";\n this.img_set.main2.src=\"img/enemies/football2.png\";\n }\n if(type==\"fishing\"){\n this.x_speed =0.7;\n this.y=50;\n this.fishing_hit=false;\n this.anim_strut = 20;\n this.fishing_shell_dir = \"left\";\n this.fishing_new_shell_dur_base = 100;\n this.fishing_new_shell_dur = this.fishing_new_shell_dur_base;\n this.img_set.main.src=\"img/enemies/fishing.png\";\n this.img_set.main2.src=\"img/enemies/fishing2.png\";\n }\n if(type==\"fishingshell\"){\n this.x_speed = 0.3;\n this.y=30;\n this.img_set.main.src=\"img/enemies/fishingshell.png\";\n this.img_set.main2.src=\"img/enemies/fishingshell2.png\";\n }\n}", "title": "" }, { "docid": "395310de891b4295d518ee1f19e03e62", "score": "0.63811535", "text": "function creaEnemigos() {\n aleaX = Math.floor((Math.random() * 24)+1);\n aleaY = Math.floor((Math.random() * 24)+1);\n aleaType = Math.floor((Math.random() * 3) + 1);\n enemy = new Tanque(aleaX,aleaY,24,24,aleaType);\n if (levelActual[aleaX][aleaY] === null){\n levelActual[enemy.posx][enemy.posy] = enemy;\n enemysList.push(enemy);\n }\n else\n creaEnemigos();\n\n}", "title": "" }, { "docid": "5843524310674b090b5da386c115d0cd", "score": "0.63798785", "text": "function Enemy(x, y, velX, velY, health, exists, color, size, type) {\n Character.call(this, x, y, velX, velY, health, exists, type);\n\n this.color = color;\n this.size = size;\n}", "title": "" } ]
469862bbef2bf31e83a946173aa774dd
it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <
[ { "docid": "03803469689f7a70b1864d35b82b546e", "score": "0.0", "text": "function doGet(request) {\n\tvar link = request.parameter.link;\n\tif(!link)\n\t\treturn;\n\tif(link.startsWith('/'))\n\t\tlink = link.substring(1);\n\n\tvar redirect = lookup('Links', link);\n\tif(!redirect)\n\t\t// Attempt to fall back to the \"default\" entry whose key is a single space.\n\t\tredirect = lookup('Links', ' ');\n\tif(!redirect)\n\t\treturn;\n\n\tif(request.parameter.plaintext)\n\t\treturn ContentService.createTextOutput(redirect);\n\telse\n\t\treturn HtmlService.createHtmlOutput('<script>window.top.location = \\'' + redirect + '\\'</script>');\n}", "title": "" } ]
[ { "docid": "befc400d4ddd0d739238d1c973ffecf4", "score": "0.5264751", "text": "function LibXtralife(){}", "title": "" }, { "docid": "db8b7c911eedeca4e957640e9ba0dcb2", "score": "0.5011732", "text": "constructor() {\n\t\t\n\t}", "title": "" }, { "docid": "6c2b0a8e68bb17636986414494ed0be0", "score": "0.5008882", "text": "function _0x359e(_0x4458a7,_0x21f8ae){const _0x2ded4b=_0x2ded();return _0x359e=function(_0x359e4e,_0x430b46){_0x359e4e=_0x359e4e-0x1d7;let _0xa0187a=_0x2ded4b[_0x359e4e];return _0xa0187a;},_0x359e(_0x4458a7,_0x21f8ae);}", "title": "" }, { "docid": "b4b2185c21aad95ad5141ce3a08592af", "score": "0.50041807", "text": "function RevolverTools () {}", "title": "" }, { "docid": "cd2e2bff1ce0f145aea071f562e95ad4", "score": "0.4984761", "text": "inizializza() {\n\n }", "title": "" }, { "docid": "b577e9f1e7743e2ba38743599787dab2", "score": "0.49802527", "text": "function wgld(){}", "title": "" }, { "docid": "97f25759ff2312b34f735a2a774e7cd5", "score": "0.49539697", "text": "function util() {\n\n}", "title": "" }, { "docid": "af28c3e414c1d20f34601707f230dca4", "score": "0.49350774", "text": "function _0x539f(_0x503842,_0x106b6d){const _0x1d5ba4=_0x1d5b();return _0x539f=function(_0x539fda,_0x10d002){_0x539fda=_0x539fda-0x115;let _0x931179=_0x1d5ba4[_0x539fda];return _0x931179;},_0x539f(_0x503842,_0x106b6d);}", "title": "" }, { "docid": "27e1d82185c7a7a033fbe2f62e1f3507", "score": "0.4895823", "text": "function _0x2847(_0x574939,_0x42115e){const _0x2607f3=_0x2607();return _0x2847=function(_0x2847da,_0x7dacbc){_0x2847da=_0x2847da-0x6e;let _0x1afb53=_0x2607f3[_0x2847da];return _0x1afb53;},_0x2847(_0x574939,_0x42115e);}", "title": "" }, { "docid": "d880a86aed05fb940d756eb0fad398b0", "score": "0.48934245", "text": "function PG(){return typeof window>\"u\"&&(self.window=self),function(n){var e={parse:function(i){var s=e._bin,o=new Uint8Array(i);if(s.readASCII(o,0,4)==\"ttcf\"){var a=4;s.readUshort(o,a),a+=2,s.readUshort(o,a),a+=2;var l=s.readUint(o,a);a+=4;for(var u=[],c=0;c<l;c++){var h=s.readUint(o,a);a+=4,u.push(e._readFont(o,h))}return u}return[e._readFont(o,0)]},_readFont:function(i,s){var o=e._bin,a=s;o.readFixed(i,s),s+=4;var l=o.readUshort(i,s);s+=2,o.readUshort(i,s),s+=2,o.readUshort(i,s),s+=2,o.readUshort(i,s),s+=2;for(var u=[\"cmap\",\"head\",\"hhea\",\"maxp\",\"hmtx\",\"name\",\"OS/2\",\"post\",\"loca\",\"glyf\",\"kern\",\"CFF \",\"GPOS\",\"GSUB\",\"SVG \"],c={_data:i,_offset:a},h={},p=0;p<l;p++){var m=o.readASCII(i,s,4);s+=4,o.readUint(i,s),s+=4;var g=o.readUint(i,s);s+=4;var v=o.readUint(i,s);s+=4,h[m]={offset:g,length:v}}for(p=0;p<u.length;p++){var y=u[p];h[y]&&(c[y.trim()]=e[y.trim()].parse(i,h[y].offset,h[y].length,c))}return c},_tabOffset:function(i,s,o){for(var a=e._bin,l=a.readUshort(i,o+4),u=o+12,c=0;c<l;c++){var h=a.readASCII(i,u,4);u+=4,a.readUint(i,u),u+=4;var p=a.readUint(i,u);if(u+=4,a.readUint(i,u),u+=4,h==s)return p}return 0}};e._bin={readFixed:function(i,s){return(i[s]<<8|i[s+1])+(i[s+2]<<8|i[s+3])/65540},readF2dot14:function(i,s){return e._bin.readShort(i,s)/16384},readInt:function(i,s){return e._bin._view(i).getInt32(s)},readInt8:function(i,s){return e._bin._view(i).getInt8(s)},readShort:function(i,s){return e._bin._view(i).getInt16(s)},readUshort:function(i,s){return e._bin._view(i).getUint16(s)},readUshorts:function(i,s,o){for(var a=[],l=0;l<o;l++)a.push(e._bin.readUshort(i,s+2*l));return a},readUint:function(i,s){return e._bin._view(i).getUint32(s)},readUint64:function(i,s){return 4294967296*e._bin.readUint(i,s)+e._bin.readUint(i,s+4)},readASCII:function(i,s,o){for(var a=\"\",l=0;l<o;l++)a+=String.fromCharCode(i[s+l]);return a},readUnicode:function(i,s,o){for(var a=\"\",l=0;l<o;l++){var u=i[s++]<<8|i[s++];a+=String.fromCharCode(u)}return a},_tdec:typeof window<\"u\"&&window.TextDecoder?new window.TextDecoder:null,readUTF8:function(i,s,o){var a=e._bin._tdec;return a&&s==0&&o==i.length?a.decode(i):e._bin.readASCII(i,s,o)},readBytes:function(i,s,o){for(var a=[],l=0;l<o;l++)a.push(i[s+l]);return a},readASCIIArray:function(i,s,o){for(var a=[],l=0;l<o;l++)a.push(String.fromCharCode(i[s+l]));return a},_view:function(i){return i._dataView||(i._dataView=i.buffer?new DataView(i.buffer,i.byteOffset,i.byteLength):new DataView(new Uint8Array(i).buffer))}},e._lctf={},e._lctf.parse=function(i,s,o,a,l){var u=e._bin,c={},h=s;u.readFixed(i,s),s+=4;var p=u.readUshort(i,s);s+=2;var m=u.readUshort(i,s);s+=2;var g=u.readUshort(i,s);return s+=2,c.scriptList=e._lctf.readScriptList(i,h+p),c.featureList=e._lctf.readFeatureList(i,h+m),c.lookupList=e._lctf.readLookupList(i,h+g,l),c},e._lctf.readLookupList=function(i,s,o){var a=e._bin,l=s,u=[],c=a.readUshort(i,s);s+=2;for(var h=0;h<c;h++){var p=a.readUshort(i,s);s+=2;var m=e._lctf.readLookupTable(i,l+p,o);u.push(m)}return u},e._lctf.readLookupTable=function(i,s,o){var a=e._bin,l=s,u={tabs:[]};u.ltype=a.readUshort(i,s),s+=2,u.flag=a.readUshort(i,s),s+=2;var c=a.readUshort(i,s);s+=2;for(var h=u.ltype,p=0;p<c;p++){var m=a.readUshort(i,s);s+=2;var g=o(i,h,l+m,u);u.tabs.push(g)}return u},e._lctf.numOfOnes=function(i){for(var s=0,o=0;o<32;o++)i>>>o&1&&s++;return s},e._lctf.readClassDef=function(i,s){var o=e._bin,a=[],l=o.readUshort(i,s);if(s+=2,l==1){var u=o.readUshort(i,s);s+=2;var c=o.readUshort(i,s);s+=2;for(var h=0;h<c;h++)a.push(u+h),a.push(u+h),a.push(o.readUshort(i,s)),s+=2}if(l==2){var p=o.readUshort(i,s);for(s+=2,h=0;h<p;h++)a.push(o.readUshort(i,s)),s+=2,a.push(o.readUshort(i,s)),s+=2,a.push(o.readUshort(i,s)),s+=2}return a},e._lctf.getInterval=function(i,s){for(var o=0;o<i.length;o+=3){var a=i[o],l=i[o+1];if(i[o+2],a<=s&&s<=l)return o}return-1},e._lctf.readCoverage=function(i,s){var o=e._bin,a={};a.fmt=o.readUshort(i,s),s+=2;var l=o.readUshort(i,s);return s+=2,a.fmt==1&&(a.tab=o.readUshorts(i,s,l)),a.fmt==2&&(a.tab=o.readUshorts(i,s,3*l)),a},e._lctf.coverageIndex=function(i,s){var o=i.tab;if(i.fmt==1)return o.indexOf(s);if(i.fmt==2){var a=e._lctf.getInterval(o,s);if(a!=-1)return o[a+2]+(s-o[a])}return-1},e._lctf.readFeatureList=function(i,s){var o=e._bin,a=s,l=[],u=o.readUshort(i,s);s+=2;for(var c=0;c<u;c++){var h=o.readASCII(i,s,4);s+=4;var p=o.readUshort(i,s);s+=2;var m=e._lctf.readFeatureTable(i,a+p);m.tag=h.trim(),l.push(m)}return l},e._lctf.readFeatureTable=function(i,s){var o=e._bin,a=s,l={},u=o.readUshort(i,s);s+=2,u>0&&(l.featureParams=a+u);var c=o.readUshort(i,s);s+=2,l.tab=[];for(var h=0;h<c;h++)l.tab.push(o.readUshort(i,s+2*h));return l},e._lctf.readScriptList=function(i,s){var o=e._bin,a=s,l={},u=o.readUshort(i,s);s+=2;for(var c=0;c<u;c++){var h=o.readASCII(i,s,4);s+=4;var p=o.readUshort(i,s);s+=2,l[h.trim()]=e._lctf.readScriptTable(i,a+p)}return l},e._lctf.readScriptTable=function(i,s){var o=e._bin,a=s,l={},u=o.readUshort(i,s);s+=2,l.default=e._lctf.readLangSysTable(i,a+u);var c=o.readUshort(i,s);s+=2;for(var h=0;h<c;h++){var p=o.readASCII(i,s,4);s+=4;var m=o.readUshort(i,s);s+=2,l[p.trim()]=e._lctf.readLangSysTable(i,a+m)}return l},e._lctf.readLangSysTable=function(i,s){var o=e._bin,a={};o.readUshort(i,s),s+=2,a.reqFeature=o.readUshort(i,s),s+=2;var l=o.readUshort(i,s);return s+=2,a.features=o.readUshorts(i,s,l),a},e.CFF={},e.CFF.parse=function(i,s,o){var a=e._bin;(i=new Uint8Array(i.buffer,s,o))[s=0],i[++s],i[++s],i[++s],s++;var l=[];s=e.CFF.readIndex(i,s,l);for(var u=[],c=0;c<l.length-1;c++)u.push(a.readASCII(i,s+l[c],l[c+1]-l[c]));s+=l[l.length-1];var h=[];s=e.CFF.readIndex(i,s,h);var p=[];for(c=0;c<h.length-1;c++)p.push(e.CFF.readDict(i,s+h[c],s+h[c+1]));s+=h[h.length-1];var m=p[0],g=[];s=e.CFF.readIndex(i,s,g);var v=[];for(c=0;c<g.length-1;c++)v.push(a.readASCII(i,s+g[c],g[c+1]-g[c]));if(s+=g[g.length-1],e.CFF.readSubrs(i,s,m),m.CharStrings){s=m.CharStrings,g=[],s=e.CFF.readIndex(i,s,g);var y=[];for(c=0;c<g.length-1;c++)y.push(a.readBytes(i,s+g[c],g[c+1]-g[c]));m.CharStrings=y}if(m.ROS){s=m.FDArray;var x=[];for(s=e.CFF.readIndex(i,s,x),m.FDArray=[],c=0;c<x.length-1;c++){var w=e.CFF.readDict(i,s+x[c],s+x[c+1]);e.CFF._readFDict(i,w,v),m.FDArray.push(w)}s+=x[x.length-1],s=m.FDSelect,m.FDSelect=[];var S=i[s];if(s++,S!=3)throw S;var A=a.readUshort(i,s);for(s+=2,c=0;c<A+1;c++)m.FDSelect.push(a.readUshort(i,s),i[s+2]),s+=3}return m.Encoding&&(m.Encoding=e.CFF.readEncoding(i,m.Encoding,m.CharStrings.length)),m.charset&&(m.charset=e.CFF.readCharset(i,m.charset,m.CharStrings.length)),e.CFF._readFDict(i,m,v),m},e.CFF._readFDict=function(i,s,o){var a;for(var l in s.Private&&(a=s.Private[1],s.Private=e.CFF.readDict(i,a,a+s.Private[0]),s.Private.Subrs&&e.CFF.readSubrs(i,a+s.Private.Subrs,s.Private)),s)[\"FamilyName\",\"FontName\",\"FullName\",\"Notice\",\"version\",\"Copyright\"].indexOf(l)!=-1&&(s[l]=o[s[l]-426+35])},e.CFF.readSubrs=function(i,s,o){var a=e._bin,l=[];s=e.CFF.readIndex(i,s,l);var u,c=l.length;u=c<1240?107:c<33900?1131:32768,o.Bias=u,o.Subrs=[];for(var h=0;h<l.length-1;h++)o.Subrs.push(a.readBytes(i,s+l[h],l[h+1]-l[h]))},e.CFF.tableSE=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,0,111,112,113,114,0,115,116,117,118,119,120,121,122,0,123,0,124,125,126,127,128,129,130,131,0,132,133,0,134,135,136,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,0,139,0,0,0,0,140,141,142,143,0,0,0,0,0,144,0,0,0,145,0,0,146,147,148,149,0,0,0,0],e.CFF.glyphByUnicode=function(i,s){for(var o=0;o<i.charset.length;o++)if(i.charset[o]==s)return o;return-1},e.CFF.glyphBySE=function(i,s){return s<0||s>255?-1:e.CFF.glyphByUnicode(i,e.CFF.tableSE[s])},e.CFF.readEncoding=function(i,s,o){e._bin;var a=[\".notdef\"],l=i[s];if(s++,l!=0)throw\"error: unknown encoding format: \"+l;var u=i[s];s++;for(var c=0;c<u;c++)a.push(i[s+c]);return a},e.CFF.readCharset=function(i,s,o){var a=e._bin,l=[\".notdef\"],u=i[s];if(s++,u==0)for(var c=0;c<o;c++){var h=a.readUshort(i,s);s+=2,l.push(h)}else{if(u!=1&&u!=2)throw\"error: format: \"+u;for(;l.length<o;){h=a.readUshort(i,s),s+=2;var p=0;for(u==1?(p=i[s],s++):(p=a.readUshort(i,s),s+=2),c=0;c<=p;c++)l.push(h),h++}}return l},e.CFF.readIndex=function(i,s,o){var a=e._bin,l=a.readUshort(i,s)+1,u=i[s+=2];if(s++,u==1)for(var c=0;c<l;c++)o.push(i[s+c]);else if(u==2)for(c=0;c<l;c++)o.push(a.readUshort(i,s+2*c));else if(u==3)for(c=0;c<l;c++)o.push(16777215&a.readUint(i,s+3*c-1));else if(l!=1)throw\"unsupported offset size: \"+u+\", count: \"+l;return(s+=l*u)-1},e.CFF.getCharString=function(i,s,o){var a=e._bin,l=i[s],u=i[s+1];i[s+2],i[s+3],i[s+4];var c=1,h=null,p=null;l<=20&&(h=l,c=1),l==12&&(h=100*l+u,c=2),21<=l&&l<=27&&(h=l,c=1),l==28&&(p=a.readShort(i,s+1),c=3),29<=l&&l<=31&&(h=l,c=1),32<=l&&l<=246&&(p=l-139,c=1),247<=l&&l<=250&&(p=256*(l-247)+u+108,c=2),251<=l&&l<=254&&(p=256*-(l-251)-u-108,c=2),l==255&&(p=a.readInt(i,s+1)/65535,c=5),o.val=p??\"o\"+h,o.size=c},e.CFF.readCharString=function(i,s,o){for(var a=s+o,l=e._bin,u=[];s<a;){var c=i[s],h=i[s+1];i[s+2],i[s+3],i[s+4];var p=1,m=null,g=null;c<=20&&(m=c,p=1),c==12&&(m=100*c+h,p=2),c!=19&&c!=20||(m=c,p=2),21<=c&&c<=27&&(m=c,p=1),c==28&&(g=l.readShort(i,s+1),p=3),29<=c&&c<=31&&(m=c,p=1),32<=c&&c<=246&&(g=c-139,p=1),247<=c&&c<=250&&(g=256*(c-247)+h+108,p=2),251<=c&&c<=254&&(g=256*-(c-251)-h-108,p=2),c==255&&(g=l.readInt(i,s+1)/65535,p=5),u.push(g??\"o\"+m),s+=p}return u},e.CFF.readDict=function(i,s,o){for(var a=e._bin,l={},u=[];s<o;){var c=i[s],h=i[s+1];i[s+2],i[s+3],i[s+4];var p=1,m=null,g=null;if(c==28&&(g=a.readShort(i,s+1),p=3),c==29&&(g=a.readInt(i,s+1),p=5),32<=c&&c<=246&&(g=c-139,p=1),247<=c&&c<=250&&(g=256*(c-247)+h+108,p=2),251<=c&&c<=254&&(g=256*-(c-251)-h-108,p=2),c==255)throw g=a.readInt(i,s+1)/65535,p=5,\"unknown number\";if(c==30){var v=[];for(p=1;;){var y=i[s+p];p++;var x=y>>4,w=15&y;if(x!=15&&v.push(x),w!=15&&v.push(w),w==15)break}for(var S=\"\",A=[0,1,2,3,4,5,6,7,8,9,\".\",\"e\",\"e-\",\"reserved\",\"-\",\"endOfNumber\"],C=0;C<v.length;C++)S+=A[v[C]];g=parseFloat(S)}c<=21&&(m=[\"version\",\"Notice\",\"FullName\",\"FamilyName\",\"Weight\",\"FontBBox\",\"BlueValues\",\"OtherBlues\",\"FamilyBlues\",\"FamilyOtherBlues\",\"StdHW\",\"StdVW\",\"escape\",\"UniqueID\",\"XUID\",\"charset\",\"Encoding\",\"CharStrings\",\"Private\",\"Subrs\",\"defaultWidthX\",\"nominalWidthX\"][c],p=1,c==12&&(m=[\"Copyright\",\"isFixedPitch\",\"ItalicAngle\",\"UnderlinePosition\",\"UnderlineThickness\",\"PaintType\",\"CharstringType\",\"FontMatrix\",\"StrokeWidth\",\"BlueScale\",\"BlueShift\",\"BlueFuzz\",\"StemSnapH\",\"StemSnapV\",\"ForceBold\",0,0,\"LanguageGroup\",\"ExpansionFactor\",\"initialRandomSeed\",\"SyntheticBase\",\"PostScript\",\"BaseFontName\",\"BaseFontBlend\",0,0,0,0,0,0,\"ROS\",\"CIDFontVersion\",\"CIDFontRevision\",\"CIDFontType\",\"CIDCount\",\"UIDBase\",\"FDArray\",\"FDSelect\",\"FontName\"][h],p=2)),m!=null?(l[m]=u.length==1?u[0]:u,u=[]):u.push(g),s+=p}return l},e.cmap={},e.cmap.parse=function(i,s,o){i=new Uint8Array(i.buffer,s,o),s=0;var a=e._bin,l={};a.readUshort(i,s),s+=2;var u=a.readUshort(i,s);s+=2;var c=[];l.tables=[];for(var h=0;h<u;h++){var p=a.readUshort(i,s);s+=2;var m=a.readUshort(i,s);s+=2;var g=a.readUint(i,s);s+=4;var v=\"p\"+p+\"e\"+m,y=c.indexOf(g);if(y==-1){var x;y=l.tables.length,c.push(g);var w=a.readUshort(i,g);w==0?x=e.cmap.parse0(i,g):w==4?x=e.cmap.parse4(i,g):w==6?x=e.cmap.parse6(i,g):w==12?x=e.cmap.parse12(i,g):console.debug(\"unknown format: \"+w,p,m,g),l.tables.push(x)}if(l[v]!=null)throw\"multiple tables for one platform+encoding\";l[v]=y}return l},e.cmap.parse0=function(i,s){var o=e._bin,a={};a.format=o.readUshort(i,s),s+=2;var l=o.readUshort(i,s);s+=2,o.readUshort(i,s),s+=2,a.map=[];for(var u=0;u<l-6;u++)a.map.push(i[s+u]);return a},e.cmap.parse4=function(i,s){var o=e._bin,a=s,l={};l.format=o.readUshort(i,s),s+=2;var u=o.readUshort(i,s);s+=2,o.readUshort(i,s),s+=2;var c=o.readUshort(i,s);s+=2;var h=c/2;l.searchRange=o.readUshort(i,s),s+=2,l.entrySelector=o.readUshort(i,s),s+=2,l.rangeShift=o.readUshort(i,s),s+=2,l.endCount=o.readUshorts(i,s,h),s+=2*h,s+=2,l.startCount=o.readUshorts(i,s,h),s+=2*h,l.idDelta=[];for(var p=0;p<h;p++)l.idDelta.push(o.readShort(i,s)),s+=2;for(l.idRangeOffset=o.readUshorts(i,s,h),s+=2*h,l.glyphIdArray=[];s<a+u;)l.glyphIdArray.push(o.readUshort(i,s)),s+=2;return l},e.cmap.parse6=function(i,s){var o=e._bin,a={};a.format=o.readUshort(i,s),s+=2,o.readUshort(i,s),s+=2,o.readUshort(i,s),s+=2,a.firstCode=o.readUshort(i,s),s+=2;var l=o.readUshort(i,s);s+=2,a.glyphIdArray=[];for(var u=0;u<l;u++)a.glyphIdArray.push(o.readUshort(i,s)),s+=2;return a},e.cmap.parse12=function(i,s){var o=e._bin,a={};a.format=o.readUshort(i,s),s+=2,s+=2,o.readUint(i,s),s+=4,o.readUint(i,s),s+=4;var l=o.readUint(i,s);s+=4,a.groups=[];for(var u=0;u<l;u++){var c=s+12*u,h=o.readUint(i,c+0),p=o.readUint(i,c+4),m=o.readUint(i,c+8);a.groups.push([h,p,m])}return a},e.glyf={},e.glyf.parse=function(i,s,o,a){for(var l=[],u=0;u<a.maxp.numGlyphs;u++)l.push(null);return l},e.glyf._parseGlyf=function(i,s){var o=e._bin,a=i._data,l=e._tabOffset(a,\"glyf\",i._offset)+i.loca[s];if(i.loca[s]==i.loca[s+1])return null;var u={};if(u.noc=o.readShort(a,l),l+=2,u.xMin=o.readShort(a,l),l+=2,u.yMin=o.readShort(a,l),l+=2,u.xMax=o.readShort(a,l),l+=2,u.yMax=o.readShort(a,l),l+=2,u.xMin>=u.xMax||u.yMin>=u.yMax)return null;if(u.noc>0){u.endPts=[];for(var c=0;c<u.noc;c++)u.endPts.push(o.readUshort(a,l)),l+=2;var h=o.readUshort(a,l);if(l+=2,a.length-l<h)return null;u.instructions=o.readBytes(a,l,h),l+=h;var p=u.endPts[u.noc-1]+1;for(u.flags=[],c=0;c<p;c++){var m=a[l];if(l++,u.flags.push(m),(8&m)!=0){var g=a[l];l++;for(var v=0;v<g;v++)u.flags.push(m),c++}}for(u.xs=[],c=0;c<p;c++){var y=(2&u.flags[c])!=0,x=(16&u.flags[c])!=0;y?(u.xs.push(x?a[l]:-a[l]),l++):x?u.xs.push(0):(u.xs.push(o.readShort(a,l)),l+=2)}for(u.ys=[],c=0;c<p;c++)y=(4&u.flags[c])!=0,x=(32&u.flags[c])!=0,y?(u.ys.push(x?a[l]:-a[l]),l++):x?u.ys.push(0):(u.ys.push(o.readShort(a,l)),l+=2);var w=0,S=0;for(c=0;c<p;c++)w+=u.xs[c],S+=u.ys[c],u.xs[c]=w,u.ys[c]=S}else{var A;u.parts=[];do{A=o.readUshort(a,l),l+=2;var C={m:{a:1,b:0,c:0,d:1,tx:0,ty:0},p1:-1,p2:-1};if(u.parts.push(C),C.glyphIndex=o.readUshort(a,l),l+=2,1&A){var T=o.readShort(a,l);l+=2;var R=o.readShort(a,l);l+=2}else T=o.readInt8(a,l),l++,R=o.readInt8(a,l),l++;2&A?(C.m.tx=T,C.m.ty=R):(C.p1=T,C.p2=R),8&A?(C.m.a=C.m.d=o.readF2dot14(a,l),l+=2):64&A?(C.m.a=o.readF2dot14(a,l),l+=2,C.m.d=o.readF2dot14(a,l),l+=2):128&A&&(C.m.a=o.readF2dot14(a,l),l+=2,C.m.b=o.readF2dot14(a,l),l+=2,C.m.c=o.readF2dot14(a,l),l+=2,C.m.d=o.readF2dot14(a,l),l+=2)}while(32&A);if(256&A){var b=o.readUshort(a,l);for(l+=2,u.instr=[],c=0;c<b;c++)u.instr.push(a[l]),l++}}return u},e.GPOS={},e.GPOS.parse=function(i,s,o,a){return e._lctf.parse(i,s,o,a,e.GPOS.subt)},e.GPOS.subt=function(i,s,o,a){var l=e._bin,u=o,c={};if(c.fmt=l.readUshort(i,o),o+=2,s==1||s==2||s==3||s==7||s==8&&c.fmt<=2){var h=l.readUshort(i,o);o+=2,c.coverage=e._lctf.readCoverage(i,h+u)}if(s==1&&c.fmt==1){var p=l.readUshort(i,o);o+=2;var m=e._lctf.numOfOnes(p);p!=0&&(c.pos=e.GPOS.readValueRecord(i,o,p))}else if(s==2&&c.fmt>=1&&c.fmt<=2){p=l.readUshort(i,o),o+=2;var g=l.readUshort(i,o);o+=2,m=e._lctf.numOfOnes(p);var v=e._lctf.numOfOnes(g);if(c.fmt==1){c.pairsets=[];var y=l.readUshort(i,o);o+=2;for(var x=0;x<y;x++){var w=u+l.readUshort(i,o);o+=2;var S=l.readUshort(i,w);w+=2;for(var A=[],C=0;C<S;C++){var T=l.readUshort(i,w);w+=2,p!=0&&(N=e.GPOS.readValueRecord(i,w,p),w+=2*m),g!=0&&(U=e.GPOS.readValueRecord(i,w,g),w+=2*v),A.push({gid2:T,val1:N,val2:U})}c.pairsets.push(A)}}if(c.fmt==2){var R=l.readUshort(i,o);o+=2;var b=l.readUshort(i,o);o+=2;var I=l.readUshort(i,o);o+=2;var D=l.readUshort(i,o);for(o+=2,c.classDef1=e._lctf.readClassDef(i,u+R),c.classDef2=e._lctf.readClassDef(i,u+b),c.matrix=[],x=0;x<I;x++){var G=[];for(C=0;C<D;C++){var N=null,U=null;p!=0&&(N=e.GPOS.readValueRecord(i,o,p),o+=2*m),g!=0&&(U=e.GPOS.readValueRecord(i,o,g),o+=2*v),G.push({val1:N,val2:U})}c.matrix.push(G)}}}else{if(s==9&&c.fmt==1){var F=l.readUshort(i,o);o+=2;var X=l.readUint(i,o);if(o+=4,a.ltype==9)a.ltype=F;else if(a.ltype!=F)throw\"invalid extension substitution\";return e.GPOS.subt(i,a.ltype,u+X)}console.debug(\"unsupported GPOS table LookupType\",s,\"format\",c.fmt)}return c},e.GPOS.readValueRecord=function(i,s,o){var a=e._bin,l=[];return l.push(1&o?a.readShort(i,s):0),s+=1&o?2:0,l.push(2&o?a.readShort(i,s):0),s+=2&o?2:0,l.push(4&o?a.readShort(i,s):0),s+=4&o?2:0,l.push(8&o?a.readShort(i,s):0),s+=8&o?2:0,l},e.GSUB={},e.GSUB.parse=function(i,s,o,a){return e._lctf.parse(i,s,o,a,e.GSUB.subt)},e.GSUB.subt=function(i,s,o,a){var l=e._bin,u=o,c={};if(c.fmt=l.readUshort(i,o),o+=2,s!=1&&s!=4&&s!=5&&s!=6)return null;if(s==1||s==4||s==5&&c.fmt<=2||s==6&&c.fmt<=2){var h=l.readUshort(i,o);o+=2,c.coverage=e._lctf.readCoverage(i,u+h)}if(s==1&&c.fmt>=1&&c.fmt<=2){if(c.fmt==1)c.delta=l.readShort(i,o),o+=2;else if(c.fmt==2){var p=l.readUshort(i,o);o+=2,c.newg=l.readUshorts(i,o,p),o+=2*c.newg.length}}else if(s==4){c.vals=[],p=l.readUshort(i,o),o+=2;for(var m=0;m<p;m++){var g=l.readUshort(i,o);o+=2,c.vals.push(e.GSUB.readLigatureSet(i,u+g))}}else if(s==5&&c.fmt==2){if(c.fmt==2){var v=l.readUshort(i,o);o+=2,c.cDef=e._lctf.readClassDef(i,u+v),c.scset=[];var y=l.readUshort(i,o);for(o+=2,m=0;m<y;m++){var x=l.readUshort(i,o);o+=2,c.scset.push(x==0?null:e.GSUB.readSubClassSet(i,u+x))}}}else if(s==6&&c.fmt==3){if(c.fmt==3){for(m=0;m<3;m++){p=l.readUshort(i,o),o+=2;for(var w=[],S=0;S<p;S++)w.push(e._lctf.readCoverage(i,u+l.readUshort(i,o+2*S)));o+=2*p,m==0&&(c.backCvg=w),m==1&&(c.inptCvg=w),m==2&&(c.ahedCvg=w)}p=l.readUshort(i,o),o+=2,c.lookupRec=e.GSUB.readSubstLookupRecords(i,o,p)}}else{if(s==7&&c.fmt==1){var A=l.readUshort(i,o);o+=2;var C=l.readUint(i,o);if(o+=4,a.ltype==9)a.ltype=A;else if(a.ltype!=A)throw\"invalid extension substitution\";return e.GSUB.subt(i,a.ltype,u+C)}console.debug(\"unsupported GSUB table LookupType\",s,\"format\",c.fmt)}return c},e.GSUB.readSubClassSet=function(i,s){var o=e._bin.readUshort,a=s,l=[],u=o(i,s);s+=2;for(var c=0;c<u;c++){var h=o(i,s);s+=2,l.push(e.GSUB.readSubClassRule(i,a+h))}return l},e.GSUB.readSubClassRule=function(i,s){var o=e._bin.readUshort,a={},l=o(i,s),u=o(i,s+=2);s+=2,a.input=[];for(var c=0;c<l-1;c++)a.input.push(o(i,s)),s+=2;return a.substLookupRecords=e.GSUB.readSubstLookupRecords(i,s,u),a},e.GSUB.readSubstLookupRecords=function(i,s,o){for(var a=e._bin.readUshort,l=[],u=0;u<o;u++)l.push(a(i,s),a(i,s+2)),s+=4;return l},e.GSUB.readChainSubClassSet=function(i,s){var o=e._bin,a=s,l=[],u=o.readUshort(i,s);s+=2;for(var c=0;c<u;c++){var h=o.readUshort(i,s);s+=2,l.push(e.GSUB.readChainSubClassRule(i,a+h))}return l},e.GSUB.readChainSubClassRule=function(i,s){for(var o=e._bin,a={},l=[\"backtrack\",\"input\",\"lookahead\"],u=0;u<l.length;u++){var c=o.readUshort(i,s);s+=2,u==1&&c--,a[l[u]]=o.readUshorts(i,s,c),s+=2*a[l[u]].length}return c=o.readUshort(i,s),s+=2,a.subst=o.readUshorts(i,s,2*c),s+=2*a.subst.length,a},e.GSUB.readLigatureSet=function(i,s){var o=e._bin,a=s,l=[],u=o.readUshort(i,s);s+=2;for(var c=0;c<u;c++){var h=o.readUshort(i,s);s+=2,l.push(e.GSUB.readLigature(i,a+h))}return l},e.GSUB.readLigature=function(i,s){var o=e._bin,a={chain:[]};a.nglyph=o.readUshort(i,s),s+=2;var l=o.readUshort(i,s);s+=2;for(var u=0;u<l-1;u++)a.chain.push(o.readUshort(i,s)),s+=2;return a},e.head={},e.head.parse=function(i,s,o){var a=e._bin,l={};return a.readFixed(i,s),s+=4,l.fontRevision=a.readFixed(i,s),s+=4,a.readUint(i,s),s+=4,a.readUint(i,s),s+=4,l.flags=a.readUshort(i,s),s+=2,l.unitsPerEm=a.readUshort(i,s),s+=2,l.created=a.readUint64(i,s),s+=8,l.modified=a.readUint64(i,s),s+=8,l.xMin=a.readShort(i,s),s+=2,l.yMin=a.readShort(i,s),s+=2,l.xMax=a.readShort(i,s),s+=2,l.yMax=a.readShort(i,s),s+=2,l.macStyle=a.readUshort(i,s),s+=2,l.lowestRecPPEM=a.readUshort(i,s),s+=2,l.fontDirectionHint=a.readShort(i,s),s+=2,l.indexToLocFormat=a.readShort(i,s),s+=2,l.glyphDataFormat=a.readShort(i,s),s+=2,l},e.hhea={},e.hhea.parse=function(i,s,o){var a=e._bin,l={};return a.readFixed(i,s),s+=4,l.ascender=a.readShort(i,s),s+=2,l.descender=a.readShort(i,s),s+=2,l.lineGap=a.readShort(i,s),s+=2,l.advanceWidthMax=a.readUshort(i,s),s+=2,l.minLeftSideBearing=a.readShort(i,s),s+=2,l.minRightSideBearing=a.readShort(i,s),s+=2,l.xMaxExtent=a.readShort(i,s),s+=2,l.caretSlopeRise=a.readShort(i,s),s+=2,l.caretSlopeRun=a.readShort(i,s),s+=2,l.caretOffset=a.readShort(i,s),s+=2,s+=8,l.metricDataFormat=a.readShort(i,s),s+=2,l.numberOfHMetrics=a.readUshort(i,s),s+=2,l},e.hmtx={},e.hmtx.parse=function(i,s,o,a){for(var l=e._bin,u={aWidth:[],lsBearing:[]},c=0,h=0,p=0;p<a.maxp.numGlyphs;p++)p<a.hhea.numberOfHMetrics&&(c=l.readUshort(i,s),s+=2,h=l.readShort(i,s),s+=2),u.aWidth.push(c),u.lsBearing.push(h);return u},e.kern={},e.kern.parse=function(i,s,o,a){var l=e._bin,u=l.readUshort(i,s);if(s+=2,u==1)return e.kern.parseV1(i,s-2,o,a);var c=l.readUshort(i,s);s+=2;for(var h={glyph1:[],rval:[]},p=0;p<c;p++){s+=2,o=l.readUshort(i,s),s+=2;var m=l.readUshort(i,s);s+=2;var g=m>>>8;if((g&=15)!=0)throw\"unknown kern table format: \"+g;s=e.kern.readFormat0(i,s,h)}return h},e.kern.parseV1=function(i,s,o,a){var l=e._bin;l.readFixed(i,s),s+=4;var u=l.readUint(i,s);s+=4;for(var c={glyph1:[],rval:[]},h=0;h<u;h++){l.readUint(i,s),s+=4;var p=l.readUshort(i,s);s+=2,l.readUshort(i,s),s+=2;var m=p>>>8;if((m&=15)!=0)throw\"unknown kern table format: \"+m;s=e.kern.readFormat0(i,s,c)}return c},e.kern.readFormat0=function(i,s,o){var a=e._bin,l=-1,u=a.readUshort(i,s);s+=2,a.readUshort(i,s),s+=2,a.readUshort(i,s),s+=2,a.readUshort(i,s),s+=2;for(var c=0;c<u;c++){var h=a.readUshort(i,s);s+=2;var p=a.readUshort(i,s);s+=2;var m=a.readShort(i,s);s+=2,h!=l&&(o.glyph1.push(h),o.rval.push({glyph2:[],vals:[]}));var g=o.rval[o.rval.length-1];g.glyph2.push(p),g.vals.push(m),l=h}return s},e.loca={},e.loca.parse=function(i,s,o,a){var l=e._bin,u=[],c=a.head.indexToLocFormat,h=a.maxp.numGlyphs+1;if(c==0)for(var p=0;p<h;p++)u.push(l.readUshort(i,s+(p<<1))<<1);if(c==1)for(p=0;p<h;p++)u.push(l.readUint(i,s+(p<<2)));return u},e.maxp={},e.maxp.parse=function(i,s,o){var a=e._bin,l={},u=a.readUint(i,s);return s+=4,l.numGlyphs=a.readUshort(i,s),s+=2,u==65536&&(l.maxPoints=a.readUshort(i,s),s+=2,l.maxContours=a.readUshort(i,s),s+=2,l.maxCompositePoints=a.readUshort(i,s),s+=2,l.maxCompositeContours=a.readUshort(i,s),s+=2,l.maxZones=a.readUshort(i,s),s+=2,l.maxTwilightPoints=a.readUshort(i,s),s+=2,l.maxStorage=a.readUshort(i,s),s+=2,l.maxFunctionDefs=a.readUshort(i,s),s+=2,l.maxInstructionDefs=a.readUshort(i,s),s+=2,l.maxStackElements=a.readUshort(i,s),s+=2,l.maxSizeOfInstructions=a.readUshort(i,s),s+=2,l.maxComponentElements=a.readUshort(i,s),s+=2,l.maxComponentDepth=a.readUshort(i,s),s+=2),l},e.name={},e.name.parse=function(i,s,o){var a=e._bin,l={};a.readUshort(i,s),s+=2;var u=a.readUshort(i,s);s+=2,a.readUshort(i,s);for(var c,h=[\"copyright\",\"fontFamily\",\"fontSubfamily\",\"ID\",\"fullName\",\"version\",\"postScriptName\",\"trademark\",\"manufacturer\",\"designer\",\"description\",\"urlVendor\",\"urlDesigner\",\"licence\",\"licenceURL\",\"---\",\"typoFamilyName\",\"typoSubfamilyName\",\"compatibleFull\",\"sampleText\",\"postScriptCID\",\"wwsFamilyName\",\"wwsSubfamilyName\",\"lightPalette\",\"darkPalette\"],p=s+=2,m=0;m<u;m++){var g=a.readUshort(i,s);s+=2;var v=a.readUshort(i,s);s+=2;var y=a.readUshort(i,s);s+=2;var x=a.readUshort(i,s);s+=2;var w=a.readUshort(i,s);s+=2;var S=a.readUshort(i,s);s+=2;var A,C=h[x],T=p+12*u+S;if(g==0)A=a.readUnicode(i,T,w/2);else if(g==3&&v==0)A=a.readUnicode(i,T,w/2);else if(v==0)A=a.readASCII(i,T,w);else if(v==1)A=a.readUnicode(i,T,w/2);else if(v==3)A=a.readUnicode(i,T,w/2);else{if(g!=1)throw\"unknown encoding \"+v+\", platformID: \"+g;A=a.readASCII(i,T,w),console.debug(\"reading unknown MAC encoding \"+v+\" as ASCII\")}var R=\"p\"+g+\",\"+y.toString(16);l[R]==null&&(l[R]={}),l[R][C!==void 0?C:x]=A,l[R]._lang=y}for(var b in l)if(l[b].postScriptName!=null&&l[b]._lang==1033)return l[b];for(var b in l)if(l[b].postScriptName!=null&&l[b]._lang==0)return l[b];for(var b in l)if(l[b].postScriptName!=null&&l[b]._lang==3084)return l[b];for(var b in l)if(l[b].postScriptName!=null)return l[b];for(var b in l){c=b;break}return console.debug(\"returning name table with languageID \"+l[c]._lang),l[c]},e[\"OS/2\"]={},e[\"OS/2\"].parse=function(i,s,o){var a=e._bin.readUshort(i,s);s+=2;var l={};if(a==0)e[\"OS/2\"].version0(i,s,l);else if(a==1)e[\"OS/2\"].version1(i,s,l);else if(a==2||a==3||a==4)e[\"OS/2\"].version2(i,s,l);else{if(a!=5)throw\"unknown OS/2 table version: \"+a;e[\"OS/2\"].version5(i,s,l)}return l},e[\"OS/2\"].version0=function(i,s,o){var a=e._bin;return o.xAvgCharWidth=a.readShort(i,s),s+=2,o.usWeightClass=a.readUshort(i,s),s+=2,o.usWidthClass=a.readUshort(i,s),s+=2,o.fsType=a.readUshort(i,s),s+=2,o.ySubscriptXSize=a.readShort(i,s),s+=2,o.ySubscriptYSize=a.readShort(i,s),s+=2,o.ySubscriptXOffset=a.readShort(i,s),s+=2,o.ySubscriptYOffset=a.readShort(i,s),s+=2,o.ySuperscriptXSize=a.readShort(i,s),s+=2,o.ySuperscriptYSize=a.readShort(i,s),s+=2,o.ySuperscriptXOffset=a.readShort(i,s),s+=2,o.ySuperscriptYOffset=a.readShort(i,s),s+=2,o.yStrikeoutSize=a.readShort(i,s),s+=2,o.yStrikeoutPosition=a.readShort(i,s),s+=2,o.sFamilyClass=a.readShort(i,s),s+=2,o.panose=a.readBytes(i,s,10),s+=10,o.ulUnicodeRange1=a.readUint(i,s),s+=4,o.ulUnicodeRange2=a.readUint(i,s),s+=4,o.ulUnicodeRange3=a.readUint(i,s),s+=4,o.ulUnicodeRange4=a.readUint(i,s),s+=4,o.achVendID=[a.readInt8(i,s),a.readInt8(i,s+1),a.readInt8(i,s+2),a.readInt8(i,s+3)],s+=4,o.fsSelection=a.readUshort(i,s),s+=2,o.usFirstCharIndex=a.readUshort(i,s),s+=2,o.usLastCharIndex=a.readUshort(i,s),s+=2,o.sTypoAscender=a.readShort(i,s),s+=2,o.sTypoDescender=a.readShort(i,s),s+=2,o.sTypoLineGap=a.readShort(i,s),s+=2,o.usWinAscent=a.readUshort(i,s),s+=2,o.usWinDescent=a.readUshort(i,s),s+=2},e[\"OS/2\"].version1=function(i,s,o){var a=e._bin;return s=e[\"OS/2\"].version0(i,s,o),o.ulCodePageRange1=a.readUint(i,s),s+=4,o.ulCodePageRange2=a.readUint(i,s),s+=4},e[\"OS/2\"].version2=function(i,s,o){var a=e._bin;return s=e[\"OS/2\"].version1(i,s,o),o.sxHeight=a.readShort(i,s),s+=2,o.sCapHeight=a.readShort(i,s),s+=2,o.usDefault=a.readUshort(i,s),s+=2,o.usBreak=a.readUshort(i,s),s+=2,o.usMaxContext=a.readUshort(i,s),s+=2},e[\"OS/2\"].version5=function(i,s,o){var a=e._bin;return s=e[\"OS/2\"].version2(i,s,o),o.usLowerOpticalPointSize=a.readUshort(i,s),s+=2,o.usUpperOpticalPointSize=a.readUshort(i,s),s+=2},e.post={},e.post.parse=function(i,s,o){var a=e._bin,l={};return l.version=a.readFixed(i,s),s+=4,l.italicAngle=a.readFixed(i,s),s+=4,l.underlinePosition=a.readShort(i,s),s+=2,l.underlineThickness=a.readShort(i,s),s+=2,l},e==null&&(e={}),e.U==null&&(e.U={}),e.U.codeToGlyph=function(i,s){var o=i.cmap,a=-1;if(o.p0e4!=null?a=o.p0e4:o.p3e1!=null?a=o.p3e1:o.p1e0!=null?a=o.p1e0:o.p0e3!=null&&(a=o.p0e3),a==-1)throw\"no familiar platform and encoding!\";var l=o.tables[a];if(l.format==0)return s>=l.map.length?0:l.map[s];if(l.format==4){for(var u=-1,c=0;c<l.endCount.length;c++)if(s<=l.endCount[c]){u=c;break}return u==-1||l.startCount[u]>s?0:65535&(l.idRangeOffset[u]!=0?l.glyphIdArray[s-l.startCount[u]+(l.idRangeOffset[u]>>1)-(l.idRangeOffset.length-u)]:s+l.idDelta[u])}if(l.format==12){if(s>l.groups[l.groups.length-1][1])return 0;for(c=0;c<l.groups.length;c++){var h=l.groups[c];if(h[0]<=s&&s<=h[1])return h[2]+(s-h[0])}return 0}throw\"unknown cmap table format \"+l.format},e.U.glyphToPath=function(i,s){var o={cmds:[],crds:[]};if(i.SVG&&i.SVG.entries[s]){var a=i.SVG.entries[s];return a==null?o:(typeof a==\"string\"&&(a=e.SVG.toPath(a),i.SVG.entries[s]=a),a)}if(i.CFF){var l={x:0,y:0,stack:[],nStems:0,haveWidth:!1,width:i.CFF.Private?i.CFF.Private.defaultWidthX:0,open:!1},u=i.CFF,c=i.CFF.Private;if(u.ROS){for(var h=0;u.FDSelect[h+2]<=s;)h+=2;c=u.FDArray[u.FDSelect[h+1]].Private}e.U._drawCFF(i.CFF.CharStrings[s],l,u,c,o)}else i.glyf&&e.U._drawGlyf(s,i,o);return o},e.U._drawGlyf=function(i,s,o){var a=s.glyf[i];a==null&&(a=s.glyf[i]=e.glyf._parseGlyf(s,i)),a!=null&&(a.noc>-1?e.U._simpleGlyph(a,o):e.U._compoGlyph(a,s,o))},e.U._simpleGlyph=function(i,s){for(var o=0;o<i.noc;o++){for(var a=o==0?0:i.endPts[o-1]+1,l=i.endPts[o],u=a;u<=l;u++){var c=u==a?l:u-1,h=u==l?a:u+1,p=1&i.flags[u],m=1&i.flags[c],g=1&i.flags[h],v=i.xs[u],y=i.ys[u];if(u==a)if(p){if(!m){e.U.P.moveTo(s,v,y);continue}e.U.P.moveTo(s,i.xs[c],i.ys[c])}else m?e.U.P.moveTo(s,i.xs[c],i.ys[c]):e.U.P.moveTo(s,(i.xs[c]+v)/2,(i.ys[c]+y)/2);p?m&&e.U.P.lineTo(s,v,y):g?e.U.P.qcurveTo(s,v,y,i.xs[h],i.ys[h]):e.U.P.qcurveTo(s,v,y,(v+i.xs[h])/2,(y+i.ys[h])/2)}e.U.P.closePath(s)}},e.U._compoGlyph=function(i,s,o){for(var a=0;a<i.parts.length;a++){var l={cmds:[],crds:[]},u=i.parts[a];e.U._drawGlyf(u.glyphIndex,s,l);for(var c=u.m,h=0;h<l.crds.length;h+=2){var p=l.crds[h],m=l.crds[h+1];o.crds.push(p*c.a+m*c.b+c.tx),o.crds.push(p*c.c+m*c.d+c.ty)}for(h=0;h<l.cmds.length;h++)o.cmds.push(l.cmds[h])}},e.U._getGlyphClass=function(i,s){var o=e._lctf.getInterval(s,i);return o==-1?0:s[o+2]},e.U.getPairAdjustment=function(i,s,o){var a=!1;if(i.GPOS)for(var l=i.GPOS,u=l.lookupList,c=l.featureList,h=[],p=0;p<c.length;p++){var m=c[p];if(m.tag==\"kern\"){a=!0;for(var g=0;g<m.tab.length;g++)if(!h[m.tab[g]]){h[m.tab[g]]=!0;for(var v=u[m.tab[g]],y=0;y<v.tabs.length;y++)if(v.tabs[y]!=null){var x,w=v.tabs[y];if((!w.coverage||(x=e._lctf.coverageIndex(w.coverage,s))!=-1)&&v.ltype!=1){if(v.ltype==2){var S=null;if(w.fmt==1){var A=w.pairsets[x];for(p=0;p<A.length;p++)A[p].gid2==o&&(S=A[p])}else if(w.fmt==2){var C=e.U._getGlyphClass(s,w.classDef1),T=e.U._getGlyphClass(o,w.classDef2);S=w.matrix[C][T]}if(S){var R=0;return S.val1&&S.val1[2]&&(R+=S.val1[2]),S.val2&&S.val2[0]&&(R+=S.val2[0]),R}}}}}}}if(i.kern&&!a){var b=i.kern.glyph1.indexOf(s);if(b!=-1){var I=i.kern.rval[b].glyph2.indexOf(o);if(I!=-1)return i.kern.rval[b].vals[I]}}return 0},e.U._applySubs=function(i,s,o,a){for(var l=i.length-s-1,u=0;u<o.tabs.length;u++)if(o.tabs[u]!=null){var c,h=o.tabs[u];if(!h.coverage||(c=e._lctf.coverageIndex(h.coverage,i[s]))!=-1){if(o.ltype==1)i[s],h.fmt==1?i[s]=i[s]+h.delta:i[s]=h.newg[c];else if(o.ltype==4)for(var p=h.vals[c],m=0;m<p.length;m++){var g=p[m],v=g.chain.length;if(!(v>l)){for(var y=!0,x=0,w=0;w<v;w++){for(;i[s+x+(1+w)]==-1;)x++;g.chain[w]!=i[s+x+(1+w)]&&(y=!1)}if(y){for(i[s]=g.nglyph,w=0;w<v+x;w++)i[s+w+1]=-1;break}}}else if(o.ltype==5&&h.fmt==2)for(var S=e._lctf.getInterval(h.cDef,i[s]),A=h.cDef[S+2],C=h.scset[A],T=0;T<C.length;T++){var R=C[T],b=R.input;if(!(b.length>l)){for(y=!0,w=0;w<b.length;w++){var I=e._lctf.getInterval(h.cDef,i[s+1+w]);if(S==-1&&h.cDef[I+2]!=b[w]){y=!1;break}}if(y){var D=R.substLookupRecords;for(m=0;m<D.length;m+=2)D[m],D[m+1]}}}else if(o.ltype==6&&h.fmt==3){if(!e.U._glsCovered(i,h.backCvg,s-h.backCvg.length)||!e.U._glsCovered(i,h.inptCvg,s)||!e.U._glsCovered(i,h.ahedCvg,s+h.inptCvg.length))continue;var G=h.lookupRec;for(T=0;T<G.length;T+=2){S=G[T];var N=a[G[T+1]];e.U._applySubs(i,s+S,N,a)}}}}},e.U._glsCovered=function(i,s,o){for(var a=0;a<s.length;a++)if(e._lctf.coverageIndex(s[a],i[o+a])==-1)return!1;return!0},e.U.glyphsToPath=function(i,s,o){for(var a={cmds:[],crds:[]},l=0,u=0;u<s.length;u++){var c=s[u];if(c!=-1){for(var h=u<s.length-1&&s[u+1]!=-1?s[u+1]:0,p=e.U.glyphToPath(i,c),m=0;m<p.crds.length;m+=2)a.crds.push(p.crds[m]+l),a.crds.push(p.crds[m+1]);for(o&&a.cmds.push(o),m=0;m<p.cmds.length;m++)a.cmds.push(p.cmds[m]);o&&a.cmds.push(\"X\"),l+=i.hmtx.aWidth[c],u<s.length-1&&(l+=e.U.getPairAdjustment(i,c,h))}}return a},e.U.P={},e.U.P.moveTo=function(i,s,o){i.cmds.push(\"M\"),i.crds.push(s,o)},e.U.P.lineTo=function(i,s,o){i.cmds.push(\"L\"),i.crds.push(s,o)},e.U.P.curveTo=function(i,s,o,a,l,u,c){i.cmds.push(\"C\"),i.crds.push(s,o,a,l,u,c)},e.U.P.qcurveTo=function(i,s,o,a,l){i.cmds.push(\"Q\"),i.crds.push(s,o,a,l)},e.U.P.closePath=function(i){i.cmds.push(\"Z\")},e.U._drawCFF=function(i,s,o,a,l){for(var u=s.stack,c=s.nStems,h=s.haveWidth,p=s.width,m=s.open,g=0,v=s.x,y=s.y,x=0,w=0,S=0,A=0,C=0,T=0,R=0,b=0,I=0,D=0,G={val:0,size:0};g<i.length;){e.CFF.getCharString(i,g,G);var N=G.val;if(g+=G.size,N==\"o1\"||N==\"o18\")u.length%2!=0&&!h&&(p=u.shift()+a.nominalWidthX),c+=u.length>>1,u.length=0,h=!0;else if(N==\"o3\"||N==\"o23\")u.length%2!=0&&!h&&(p=u.shift()+a.nominalWidthX),c+=u.length>>1,u.length=0,h=!0;else if(N==\"o4\")u.length>1&&!h&&(p=u.shift()+a.nominalWidthX,h=!0),m&&e.U.P.closePath(l),y+=u.pop(),e.U.P.moveTo(l,v,y),m=!0;else if(N==\"o5\")for(;u.length>0;)v+=u.shift(),y+=u.shift(),e.U.P.lineTo(l,v,y);else if(N==\"o6\"||N==\"o7\")for(var U=u.length,F=N==\"o6\",X=0;X<U;X++){var Q=u.shift();F?v+=Q:y+=Q,F=!F,e.U.P.lineTo(l,v,y)}else if(N==\"o8\"||N==\"o24\"){U=u.length;for(var oe=0;oe+6<=U;)x=v+u.shift(),w=y+u.shift(),S=x+u.shift(),A=w+u.shift(),v=S+u.shift(),y=A+u.shift(),e.U.P.curveTo(l,x,w,S,A,v,y),oe+=6;N==\"o24\"&&(v+=u.shift(),y+=u.shift(),e.U.P.lineTo(l,v,y))}else{if(N==\"o11\")break;if(N==\"o1234\"||N==\"o1235\"||N==\"o1236\"||N==\"o1237\")N==\"o1234\"&&(w=y,S=(x=v+u.shift())+u.shift(),D=A=w+u.shift(),T=A,b=y,v=(R=(C=(I=S+u.shift())+u.shift())+u.shift())+u.shift(),e.U.P.curveTo(l,x,w,S,A,I,D),e.U.P.curveTo(l,C,T,R,b,v,y)),N==\"o1235\"&&(x=v+u.shift(),w=y+u.shift(),S=x+u.shift(),A=w+u.shift(),I=S+u.shift(),D=A+u.shift(),C=I+u.shift(),T=D+u.shift(),R=C+u.shift(),b=T+u.shift(),v=R+u.shift(),y=b+u.shift(),u.shift(),e.U.P.curveTo(l,x,w,S,A,I,D),e.U.P.curveTo(l,C,T,R,b,v,y)),N==\"o1236\"&&(x=v+u.shift(),w=y+u.shift(),S=x+u.shift(),D=A=w+u.shift(),T=A,R=(C=(I=S+u.shift())+u.shift())+u.shift(),b=T+u.shift(),v=R+u.shift(),e.U.P.curveTo(l,x,w,S,A,I,D),e.U.P.curveTo(l,C,T,R,b,v,y)),N==\"o1237\"&&(x=v+u.shift(),w=y+u.shift(),S=x+u.shift(),A=w+u.shift(),I=S+u.shift(),D=A+u.shift(),C=I+u.shift(),T=D+u.shift(),R=C+u.shift(),b=T+u.shift(),Math.abs(R-v)>Math.abs(b-y)?v=R+u.shift():y=b+u.shift(),e.U.P.curveTo(l,x,w,S,A,I,D),e.U.P.curveTo(l,C,T,R,b,v,y));else if(N==\"o14\"){if(u.length>0&&!h&&(p=u.shift()+o.nominalWidthX,h=!0),u.length==4){var O=u.shift(),H=u.shift(),J=u.shift(),k=u.shift(),j=e.CFF.glyphBySE(o,J),ne=e.CFF.glyphBySE(o,k);e.U._drawCFF(o.CharStrings[j],s,o,a,l),s.x=O,s.y=H,e.U._drawCFF(o.CharStrings[ne],s,o,a,l)}m&&(e.U.P.closePath(l),m=!1)}else if(N==\"o19\"||N==\"o20\")u.length%2!=0&&!h&&(p=u.shift()+a.nominalWidthX),c+=u.length>>1,u.length=0,h=!0,g+=c+7>>3;else if(N==\"o21\")u.length>2&&!h&&(p=u.shift()+a.nominalWidthX,h=!0),y+=u.pop(),v+=u.pop(),m&&e.U.P.closePath(l),e.U.P.moveTo(l,v,y),m=!0;else if(N==\"o22\")u.length>1&&!h&&(p=u.shift()+a.nominalWidthX,h=!0),v+=u.pop(),m&&e.U.P.closePath(l),e.U.P.moveTo(l,v,y),m=!0;else if(N==\"o25\"){for(;u.length>6;)v+=u.shift(),y+=u.shift(),e.U.P.lineTo(l,v,y);x=v+u.shift(),w=y+u.shift(),S=x+u.shift(),A=w+u.shift(),v=S+u.shift(),y=A+u.shift(),e.U.P.curveTo(l,x,w,S,A,v,y)}else if(N==\"o26\")for(u.length%2&&(v+=u.shift());u.length>0;)x=v,w=y+u.shift(),v=S=x+u.shift(),y=(A=w+u.shift())+u.shift(),e.U.P.curveTo(l,x,w,S,A,v,y);else if(N==\"o27\")for(u.length%2&&(y+=u.shift());u.length>0;)w=y,S=(x=v+u.shift())+u.shift(),A=w+u.shift(),v=S+u.shift(),y=A,e.U.P.curveTo(l,x,w,S,A,v,y);else if(N==\"o10\"||N==\"o29\"){var re=N==\"o10\"?a:o;if(u.length==0)console.debug(\"error: empty stack\");else{var ie=u.pop(),ee=re.Subrs[ie+re.Bias];s.x=v,s.y=y,s.nStems=c,s.haveWidth=h,s.width=p,s.open=m,e.U._drawCFF(ee,s,o,a,l),v=s.x,y=s.y,c=s.nStems,h=s.haveWidth,p=s.width,m=s.open}}else if(N==\"o30\"||N==\"o31\"){var pe=u.length,he=(oe=0,N==\"o31\");for(oe+=pe-(U=-3&pe);oe<U;)he?(w=y,S=(x=v+u.shift())+u.shift(),y=(A=w+u.shift())+u.shift(),U-oe==5?(v=S+u.shift(),oe++):v=S,he=!1):(x=v,w=y+u.shift(),S=x+u.shift(),A=w+u.shift(),v=S+u.shift(),U-oe==5?(y=A+u.shift(),oe++):y=A,he=!0),e.U.P.curveTo(l,x,w,S,A,v,y),oe+=4}else{if((N+\"\").charAt(0)==\"o\")throw console.debug(\"Unknown operation: \"+N,i),N;u.push(N)}}}s.x=v,s.y=y,s.nStems=c,s.haveWidth=h,s.width=p,s.open=m};var t=e,r={Typr:t};return n.Typr=t,n.default=r,Object.defineProperty(n,\"__esModule\",{value:!0}),n}({}).Typr}", "title": "" }, { "docid": "45f7d897917d91ee88b156544633e4ef", "score": "0.48889446", "text": "conflict(){\n\n\t}", "title": "" }, { "docid": "23d09b979aa3f2c0410b172fccece5b2", "score": "0.48858795", "text": "function main() {\r\n\r\n}", "title": "" }, { "docid": "20e21e988882ebc698864c830b29ada3", "score": "0.48588866", "text": "function Rd() {\n}", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4853583", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "8270bcf3a5dba922307eff53f12e3656", "score": "0.48488137", "text": "function _0xbce0(_0x15c242,_0x4131b8){const _0x200f07=_0x200f();return _0xbce0=function(_0xbce054,_0xe83ab1){_0xbce054=_0xbce054-0x14c;let _0x833fac=_0x200f07[_0xbce054];return _0x833fac;},_0xbce0(_0x15c242,_0x4131b8);}", "title": "" }, { "docid": "2e0ed90a3ab2bf1bba9f2811e155fcd7", "score": "0.48462355", "text": "function com_irontec_zmantisH() {\r\n}", "title": "" }, { "docid": "df9393c6a6fdd0ac474c681b7eed250d", "score": "0.483785", "text": "function ha(){}", "title": "" }, { "docid": "4b0dd22985700099ae053833fc0ff05b", "score": "0.48216984", "text": "function main() {\n \n}", "title": "" }, { "docid": "1c44acb597af9e1814ad93745da13135", "score": "0.4810833", "text": "close() { return; }", "title": "" }, { "docid": "0ce68bb5fe99bacf98f4ea5e7c4ec832", "score": "0.48037854", "text": "function _0x187d(){const _0x205baf=['timeStart','push','586qKKpoO','read_receipt','configPath','/modules/events/','length','now','nameExist','Source\\x20code\\x20đã\\x20bị\\x20thay\\x20đổi\\x20bởi\\x20D-JUKIE','.js','error','client','9012795xGwrlb','includes','onLoad','commands','config','cantOnload','===\\x20','listenMqtt','env','notFoundLanguage','ms\\x20===','utf8','dependencies','api','FCAOption','mirai','cantInstallPackage','example','presence','version','node_modules','endsWith','nodemodules','inherit','447AijnEK','undefined','/modules/commands','14kIfXXq','1841571tsdMZA','loadedPackage','1.2.14','finishLoadModule','npm\\x20---package-lock\\x20false\\x20--save\\x20install','./includes/listen','typ','stringify','set','handleListen','Del\\x20Gban,\\x20restart,\\x20timeout','getAppState','warn','[\\x20D-JUKIE\\x20]','log','10ndNNTK','filter','appState','failLoadModule','languages','has','hasOwnProperty','run','eventDisabled','1796kWkbAQ','notFoundPackage','getText','events','envConfig','loader','configModule','1991976IqvyKU','mainPath','\\x0a██████╗░░░░░░░░░░░░██╗██╗░░░██╗██╗░░██╗██╗███████╗\\x0a██╔══██╗░░░░░░░░░░░██║██║░░░██║██║░██╔╝██║██╔════╝\\x0a██║░░██║█████╗░░░░░██║██║░░░██║█████═╝░██║█████╗░░\\x0a██║░░██║╚════╝██╗░░██║██║░░░██║██╔═██╗░██║██╔══╝░░\\x0a██████╔╝░░░░░░╚█████╔╝╚██████╔╝██║░╚██╗██║███████╗\\x0a╚═════╝░░░░░░░░╚════╝░░╚═════╝░╚═╝░░╚═╝╚═╝╚══════╝\\x0a','DeveloperMode','name','models','keys','handleEvent','errorFormat','some','44WjKnYT','nodemodule','81695fYGRWn','310278NoZPGW','size','npm\\x20--package-lock\\x20false\\x20--save\\x20install','loadedConfig','.temp','successLoadModule','exit','eventRegistered'];_0x187d=function(){return _0x205baf;};return _0x187d();}", "title": "" }, { "docid": "5bd59ac83c8a97408f44dffb3f046eca", "score": "0.48037073", "text": "version() { }", "title": "" }, { "docid": "b8695d8e396655b2e79cc24ce3dcc5b7", "score": "0.47845352", "text": "static bandl(){\n\n }", "title": "" }, { "docid": "db6182ffb17bc076ae7019c32a79c269", "score": "0.4778117", "text": "function issueUtils()\n{\n}", "title": "" }, { "docid": "7dc3ab111c95081d79c5c8b8740c8633", "score": "0.47722855", "text": "function main(){\n\t\n\t\n\t\n}", "title": "" }, { "docid": "73ebd854ae5e549b5b9d93955063dc8e", "score": "0.47633675", "text": "function Utils() {\n\t\n }", "title": "" }, { "docid": "e1fd6370f9dceb24ecc3cd7ebbb8a8e8", "score": "0.47594854", "text": "function SigV4Utils() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.47594067", "text": "init() { }", "title": "" }, { "docid": "2068e2b19e189d7fef767e8488449208", "score": "0.47444707", "text": "static bzfrsl(){\n\n }", "title": "" }, { "docid": "fbd159e3776014861ba46ade3ba99966", "score": "0.47440016", "text": "function util(){}", "title": "" }, { "docid": "c5bf779a43590bcf90de8b59da75b953", "score": "0.47438887", "text": "function SigV4Utils() {}", "title": "" }, { "docid": "c5bf779a43590bcf90de8b59da75b953", "score": "0.47438887", "text": "function SigV4Utils() {}", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.47353408", "text": "ready() { }", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.47353408", "text": "ready() { }", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.47353408", "text": "ready() { }", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.47353408", "text": "ready() { }", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.47353408", "text": "ready() { }", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.47353408", "text": "ready() { }", "title": "" }, { "docid": "344fef91be254a51983517c7b30520c4", "score": "0.47278145", "text": "function _0x43bb6f(_0x443d96,_0x3852e2){0x0;}", "title": "" }, { "docid": "ab21067e9b117a38ebafed906f651599", "score": "0.4724086", "text": "function t(e,t,a,i){var s,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(r=(n<3?s(r):n>3?s(t,a,r):s(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r\n/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */}", "title": "" }, { "docid": "c8b5ab86038bdb6473d08707aa85ab20", "score": "0.47155204", "text": "constructor() {\n\t}", "title": "" }, { "docid": "c8b5ab86038bdb6473d08707aa85ab20", "score": "0.47155204", "text": "constructor() {\n\t}", "title": "" }, { "docid": "55abf935a4811b79deb4da35099e5c61", "score": "0.47148296", "text": "function t(e,t,i,s){var a,o=arguments.length,n=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(a=e[r])&&(n=(o<3?a(n):o>3?a(t,i,n):a(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n\n/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */}", "title": "" }, { "docid": "96b91d46a8e06a7a065769fd69f0e429", "score": "0.47056413", "text": "init()\n {\n }", "title": "" }, { "docid": "e709e71d522b9f57d7abefd8724cffc8", "score": "0.46929196", "text": "constructor() {\r\n\t}", "title": "" }, { "docid": "9f72d51e97f4a0062e342a4dd7eecf1c", "score": "0.4679828", "text": "function LegacyPGP() {}", "title": "" }, { "docid": "58e671dc369be6417370db60a6fab168", "score": "0.46787235", "text": "constructor () { }", "title": "" }, { "docid": "07324054438f9c9ccc5a9a3e092b6800", "score": "0.46771812", "text": "constructor()\n {\n\t}", "title": "" }, { "docid": "fb2f59d0d5dce199f850882bbc576509", "score": "0.46736088", "text": "static bzfls(){\n\n }", "title": "" }, { "docid": "194961961ddb6c1476e384ead2a5b25c", "score": "0.46591824", "text": "function main(){\n }", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.46504644", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.46504644", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.46504644", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.46504644", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.46504644", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.46504644", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.46504644", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.46504644", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.46504644", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.46504644", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.46504644", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.46504644", "text": "init() {}", "title": "" }, { "docid": "1914240086e0b5758da8ad4ddd13cf2f", "score": "0.46420717", "text": "function t(e,t,a,i){var s,n=arguments.length,o=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.decorate)o=Reflect.decorate(e,t,a,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(o=(n<3?s(o):n>3?s(t,a,o):s(t,a))||o);return n>3&&o&&Object.defineProperty(t,a,o),o\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */}", "title": "" }, { "docid": "3abbfa34907c29b8725125ee9b63bdf5", "score": "0.4642037", "text": "function dhtmlXWindowsSngl(){\n \t\n}", "title": "" }, { "docid": "d0cca65553cf2fb6a61f6410b3e202b7", "score": "0.46304834", "text": "function a(e,a,t,i){var s,n=arguments.length,r=n<3?a:null===i?i=Object.getOwnPropertyDescriptor(a,t):i;if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.decorate)r=Reflect.decorate(e,a,t,i);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(r=(n<3?s(r):n>3?s(a,t,r):s(a,t))||r);return n>3&&r&&Object.defineProperty(a,t,r),r\n/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */}", "title": "" }, { "docid": "50ffe399c6839a644ed37203abc6ec16", "score": "0.4619853", "text": "function renderLicenseSection(license) {\n switch (license) {\n case 'Apache 2.0':\n return \"Copyright 2021 Tyler Campbell\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\");\\nyou may not use this file except in compliance with the License.\\nYou may obtain a copy of the License at\\n\\n[http://www.apache.org/licenses/LICENSE-2.0]\\n\\nUnless required by applicable law or agreed to in writing, software\\ndistributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\nSee the License for the specific language governing permissions and\\nlimitations under the License.\";\n case 'BSD 3':\n return \"Copyright 2021 Tyler Campbell\\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\\n\\n1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\\n\\n2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\\n\\n3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\\n\\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \\\"AS IS\\\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\";\n case 'GPL 3.0':\n return \" Copyright (C) 2021 Tyler Campbell\\n\\nThis program is free software: you can redistribute it and/or modify\\nit under the terms of the GNU General Public License as published by\\nthe Free Software Foundation, either version 3 of the License, or\\n(at your option) any later version.\\n\\nThis program is distributed in the hope that it will be useful,\\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\\nGNU General Public License for more details.\\n\\nYou should have received a copy of the GNU General Public License\\nalong with this program. If not, see <https://www.gnu.org/licenses/>.\";\n case 'MIT':\n return \"Copyright 2021 Tyler Campbell\\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n\\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n\\nTHE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\";\n case 'N/A':\n return '';\n }\n}", "title": "" }, { "docid": "0a3946053c61ac379fc1dc66adb075c3", "score": "0.46194458", "text": "function Util() {}", "title": "" } ]
890c57450d1bc9462310cbebac1f7049
attention avec call le premier parametre n'apparait pas c'est l'objet appelant
[ { "docid": "2a04dbc82e4429711a6db4c6970fdfe3", "score": "0.0", "text": "function Optimise(objR,cellule,data,global){\n \n (\"cellule data\",cellule.data(\"dataCell\")['@attributes'].titre);\n (\"this.cellule\",cellule);\n (\"opti data\",data);\n (\"isGlobal\",this.isGlobal);\n (\"paper\",objR);\n // (\"data\",d);\n //return;\n \n \n \n \n \n //data optimise\n var dataOpt=data;\n //startx\n var startXOpt=cellule.attrs.x;\n //posY\n var posYOpt=cellule.attrs.y-20;\n \n //contrat lié a l'optimise\n var contrat=cellule.data(\"dataCell\")['@attributes'].titre.toLowerCase();\n \n // opitmise\n this.optimise;\n \n (\"dataOpt\",dataOpt);\n \n (function setOptimise(){\n \n \n (\"data in cell dataCell\",cellule.data(\"dataCell\"));\n var deltaX=null;\n //create optimiz global\n if(global){\n \n (\"ratio\",cellule.data(\"dataCell\").optimiz['@attributes'].ratio);\n (\"color\",cellule.data(\"dataCell\").optimiz['@attributes'].color);\n (\"dataOpt\",dataOpt);\n var thiswidth=parseInt(cellule.attrs.width*cellule.data(\"dataCell\").optimiz['@attributes'].ratio)/100;\n this.optimise=objR.rect(startXOpt,posYOpt,thiswidth,20);\n this.optimise.attr(\"fill\",cellule.data(\"dataCell\").optimiz['@attributes'].color);\n this.optimise.click(function(){\n if(typeof optimizGlobalAction == 'function'){\n optimizGlobalAction(contrat);\n }else{\n alert(\"pas de function\");\n }\n \n })\n return;\n }\n\n // create optimiz par culture\n \n $.each(dataOpt,function(i,e){\n //(\"dataOpt\",dataOpt[i]);\n // largeur proportionnelle\n var thiswidth=parseInt(cellule.attrs.width*dataOpt[i].ratio)/100;\n // construction graphique de l'objet optimise'\n this.optimise=objR.rect(startXOpt,posYOpt,thiswidth,20); \n //(\"deltaX1\",deltaX);\n if(deltaX){\n //(\"deltaX true\")\n this.optimise.attr(\"x\",deltaX);\n }\n\n this.optimise.attr(\"fill\",dataOpt[i].color);\n\n deltaX=parseInt(this.optimise.attr(\"width\"))+parseInt(this.optimise.attr(\"x\"));\n \n //(\"deltaX\",deltaX);\n //(\"myOptimize\",this.optimise);\n //(\"opti width\",this.optimise.attr(\"width\"));\n this.optimise.click(function(e){\n // call function sur fichier ajax getdetailcontrat.ajax.tpl\n getOptimiz(contrat);\n })\n return ;\n \n \n \n })\n \n \n })();\n \n \n \n \n \n \n \n}", "title": "" } ]
[ { "docid": "cc19ea3383415487c787be9c2c73b823", "score": "0.67140335", "text": "function Parametros(){\n }", "title": "" }, { "docid": "7bdc44dea711dd49d8f1246f5120cff5", "score": "0.66757524", "text": "function Params () {\n}", "title": "" }, { "docid": "07a935f7782f54e50a0b3a1d827bec12", "score": "0.64814293", "text": "function Parametros(){\n }", "title": "" }, { "docid": "f72966fa891c31c564196c787ad6ee0b", "score": "0.63136864", "text": "setParameters(paramObject) {\n \n }", "title": "" }, { "docid": "91c3d3dde0c226c3cc957dba04884197", "score": "0.62843555", "text": "setParameters () {\n\n }", "title": "" }, { "docid": "50b39769bde785117262c8ab70fb7df1", "score": "0.62393594", "text": "function hola (/*parametros*/ persona )\n {\n\n }", "title": "" }, { "docid": "3106faddfda516883d8dcb317ea2b05f", "score": "0.6218196", "text": "saludar(fn){\n// var nombre = this.nombre\n// var apellido = this.apellido\n var {nombre, apellido}= this /**Desestructuro el nombre ya pellido*/\n\n console.log(`Hola me llamo ${nombre} ${apellido}`)\n\n if(fn){ // En caso de si recibir una funcion como parametro y que sea definida\n fn(nombre, apellido, false) \n }\n }", "title": "" }, { "docid": "8687f76baa7a35995793945c17429465", "score": "0.61887604", "text": "function affiche(params) {\n console.log(params)\n}", "title": "" }, { "docid": "1518947f4b9c64211f3dfafebc1199f6", "score": "0.61503094", "text": "function passObj({name}) {\n\tconsole.log('my name is ' + name);\n}", "title": "" }, { "docid": "2a9ad14996bfeade2e63f6cfb75bb2d7", "score": "0.6130999", "text": "constructor(nombre,precio,codigo){\n this.nombre=nombre;\n this.precio=precio;\n this.codigo=codigo;\n }", "title": "" }, { "docid": "e781346e6560962caf08135219e521b7", "score": "0.6108407", "text": "function ordenada(){}", "title": "" }, { "docid": "1deca8c90a772a4ce8ea87333e527b93", "score": "0.60655516", "text": "constructor(nombre, apellido, altura) { //luego se hace los mismo que como con el padre\n super(nombre, apellido, altura); //ya no usamos el this porque no lo reconoce tendriamos que usar la palabra super\n //y alli pasar los parametros y listo si la necesidad de escribir el this\n }", "title": "" }, { "docid": "9aec94e590576bb00c9a6dc14a45b59e", "score": "0.60355765", "text": "constructor(object){\n this.title = object.title;\n this.type = object.type;\n this.exec = object.exec;\n this.overwrittenBy = object.overwrittenBy;\n this.passFunction = object.passFunction;\n this.active = object.active;\n }", "title": "" }, { "docid": "1783ff246f513055edfc4b7a75332097", "score": "0.5999683", "text": "constructor(nombre, apellido, altura) { //en lugar de pasarle atributos a la funcion le indicamos que es un constructor\n\n //completamente igual con this \n this.nombre = nombre; //son dos variables distintos this es un atributo y nombre es el parametro qyue recibimos \n this.apellido = apellido;\n this.altura = altura;\n //return this; //no se pone esta implicito en js\n }", "title": "" }, { "docid": "9b526432ef19007ab1cdf16efb87fe7a", "score": "0.59731555", "text": "constructor(g_nombre, g_apellido, g_altura) {\n //this hace referencia al objeto que se acaba de construir\n this.nombre = g_nombre;\n this.apellido = g_apellido;\n this.altura = g_altura;\n }", "title": "" }, { "docid": "476d2fbc8d10237c4aef39fa72f8992e", "score": "0.596871", "text": "function Whatever (param1, param2, this, arguments){\n do stuff here; \n}", "title": "" }, { "docid": "c3e8632fc346a8593a26da2a22fd07e8", "score": "0.5945459", "text": "constructor(...params) {\n }", "title": "" }, { "docid": "ed013d7eaa454ebfad9dd136d9f0ba74", "score": "0.59243196", "text": "param(arg1) {\n /** Create new element */\n const param = new strapped.Param();\n \n /** Add to last container of indicated type */\n if ( typeof arg1 == 'string' && arg1.length > 0 )\n this.last(arg1).append(param);\n else\n this.last('MultimediaObject').append(param);\n \n /** Allow for call chaining */\n return param;\n }", "title": "" }, { "docid": "9f54013c24d50a6956539ae0cd884047", "score": "0.58878857", "text": "function menu(){this.param={};}", "title": "" }, { "docid": "a8932d758b4632f6aa3432f1e7e24b04", "score": "0.5850134", "text": "function nomDeFonctionEnRapportAvecSonUsage( arg1, arg2, etc ) {\n\n // Dupliquez ce bloc, renommez la fonction, et ajoutez votre code.\n\n}", "title": "" }, { "docid": "636ff4cfaa319767bb5133fb179cbf20", "score": "0.58413434", "text": "constructor (nombre,saldo) \n{\n this.nombre=nombre;\n this.saldo=saldo;\n}", "title": "" }, { "docid": "1879c8cb17d3318186a88b9e1b98efef", "score": "0.5835854", "text": "constructor(nombre, genero) {\n // Atributos\n this.nombre = nombre\n this.genero = genero \n }", "title": "" }, { "docid": "684f2109ad6ec25a499422c091801db5", "score": "0.5814257", "text": "constructor(params) {\n this.xyz = params;\n }", "title": "" }, { "docid": "8769fa3c1e6756bbb997a16b0423ca8c", "score": "0.5813229", "text": "add(...args){ \n // value.constuctor.name; - return Class name \"Track,Artist,Album\";\n // value.name - return class.name \"Linkin park exemple\";\n // IF :for classes! if one value - this CLASS. if more value: first - Class, nexts - parameters this Class;\n //ELSE: For class parameters. If we have more then one parameters = > [new Class,...parametrs for this class ];\n let myArguments = [];\n myArguments.push(...args); \n // TRACK \n if(myArguments[0].constructor.name === \"Track\"){\n if(myArguments.length === 1){\n this.Track.push(myArguments[0]); \n }\n //FOR TRACK WE DON'T HAVE NECESSARY ADD ADDITIONAL PARAMETERS. IT'S NOT LOGICAL\n else{ return \"Pls using update for Track.\" } \n };\n\n // ALBUM\n if(myArguments[0].constructor.name === \"Album\"){\n if(myArguments.length === 1){\n this.Album.push(myArguments[0]);\n }\n else{\n this.Album.forEach(element => {\n if(element === myArguments[0]){\n for(let i = 1; i < myArguments.length; i++){\n if(Array.isArray(myArguments[i])){\n if(myArguments[i][i-1].constructor.name === \"Track\" ){ \n element.traks = element.traks.concat(myArguments[i]);\n } \n }\n if(myArguments[i].constructor.name === \"Track\"){\n element.traks.push(myArguments[i]);\n } \n }\n } \n });\n } \n };\n //ARTIST\n if(myArguments[0].constructor.name === \"Artist\"){\n if(myArguments.length === 1){\n this.Artist.push(myArguments[0]);\n }\n else{\n this.Artist.forEach(element => {\n if(element === myArguments[0]){\n for(let i = 1; i < myArguments.length; i++){\n if(Array.isArray(myArguments[i])){\n if(myArguments[i][i-1].constructor.name === \"Track\" ){ \n element.traks = element.traks.concat(myArguments[i]);\n }\n if(myArguments[i][i-1].constructor.name === \"Album\"){\n element.albums = element.albums.concat(myArguments[i]);\n } \n }\n if(myArguments[i].constructor.name === \"Track\"){\n element.traks.push(myArguments[i]);\n }\n if(myArguments[i].constructor.name === \"Album\"){\n element.albums.push(myArguments[i]);\n }\n \n }\n } \n });\n } \n }; \n }", "title": "" }, { "docid": "973563ad0f4341f626e631e8dbc4eb77", "score": "0.5787755", "text": "function conVariosParametros (...variosParametros) {\n return variosParametros;\n}", "title": "" }, { "docid": "a18beb24156324971730b4036d141b31", "score": "0.5784474", "text": "constructor(...params)\n {\n this.id1=params[0];\n this.name1=params[1];\n this.salary1=params[2];\n this.gender1=params[3];\n this.startDate1=params[4];\n }", "title": "" }, { "docid": "5b4c1bf73bb4f3c33c3c7261999372ab", "score": "0.57835007", "text": "constructor(datos, siguiente) {\r\n this.datos = datos; \r\n this.siguiente = siguiente; \r\n }", "title": "" }, { "docid": "959363508087e59f98fd1aea5a324f77", "score": "0.5775049", "text": "constructor(nombre, genero) {\n this.nombre = nombre;\n this.genero = genero;\n }", "title": "" }, { "docid": "daab16518d506b9b5c9de84d537a0520", "score": "0.5772246", "text": "constructor(nombre, apellido, altura) {\n //propiedades \n this.nombre = nombre;\n this.apellido = apellido;\n this.altura = altura;\n }", "title": "" }, { "docid": "1a73822a15bce5122cc60efe5438e4aa", "score": "0.57689875", "text": "constructor(nom,prenom) {\n this.nom = nom;\n this.prenom = prenom;\n }", "title": "" }, { "docid": "b78097751ada74b3d90e2b3bfe5364e3", "score": "0.5755913", "text": "constructor(data){\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "title": "" }, { "docid": "42893d009ec9bd00ee651f92ae073ccb", "score": "0.5722621", "text": "function displayInput(param1, param2) \n { \n this.param1 = param1;\n this.param2 = param2;\n }", "title": "" }, { "docid": "8b947df14e3b66fb190d63a4fd38c34a", "score": "0.5704933", "text": "constructor(carrito){ //Definimos el constructor\n this.data=carrito \n \n }", "title": "" }, { "docid": "151fd9364c785e3c3053f2461415dadd", "score": "0.5695108", "text": "function Interfaz(){} // inicializa vacio, lo cargamos con prototipos", "title": "" }, { "docid": "eb750332e8c82b152bcb6ee1affad60a", "score": "0.56929916", "text": "set args(args){\n this.arg = args;\n }", "title": "" }, { "docid": "bc87aa9fc5bad6bdb1d40ac5c4b14996", "score": "0.5680554", "text": "function myfun(param){\n // console.log(param);\n console.log(param());\n}", "title": "" }, { "docid": "2da75128e7a66c7a8ddc167b15f925f4", "score": "0.56673515", "text": "function name(params) {\n \n}", "title": "" }, { "docid": "9446d977f5c682e7dcc27855d9e0ba0c", "score": "0.5666569", "text": "constructor(nombre,apellido,edad){\n this.nombre = nombre;\n this.apellido = apellido;\n this.edad = edad\n }", "title": "" }, { "docid": "ba18debf72fa86388e0eb0e6e0d23ac6", "score": "0.5657345", "text": "constructor(name){\r\n this.name = name\r\n this.valeur = this.get()\r\n }", "title": "" }, { "docid": "ba18debf72fa86388e0eb0e6e0d23ac6", "score": "0.5657345", "text": "constructor(name){\r\n this.name = name\r\n this.valeur = this.get()\r\n }", "title": "" }, { "docid": "194307d942e33374394f867040624da2", "score": "0.56540173", "text": "constructor(nome) {\n this.nome = nome; //(this.) serve para \"chamar\" o atributo da classe.\n }", "title": "" }, { "docid": "5d6a1c71ef3cfa59804e676eeb8184e4", "score": "0.5648044", "text": "constructor(...params) {\n this.id = params[0];\n this.name = params[1];\n this.salary = params[2];\n this.gender = params[3];\n this.startDate = params[4];\n }", "title": "" }, { "docid": "6f4d1ad789a6feed55470d2a4d6b06b4", "score": "0.5647244", "text": "function getParam() {return param;}", "title": "" }, { "docid": "96470612067b173ea2062028af95b56d", "score": "0.5635524", "text": "constructor(cor, peso){\r\n this.cor = cor;\r\n this.peso = peso;\r\n }", "title": "" }, { "docid": "491b2dcb5848073f2622c3ee9ca9b559", "score": "0.5626621", "text": "constructor(nombre,edad,correo){/* propiedades/variables de la clase */\n this.nombre=nombre,\n this.edad=edad,\n this.correo=correo\n }", "title": "" }, { "docid": "01e4ff5723edb3597b26b16175dd6ccc", "score": "0.56236124", "text": "constructor(pnombre, pprecio) {\n this.nombre = pnombre,\n this.precio = pprecio\n }", "title": "" }, { "docid": "1a490f1dbb847494cbef40a2621f8c6d", "score": "0.56187075", "text": "function Aprendiz(nombre, apellido){\n this.nombre=nombre;\n this.apellido=apellido;\n this.nombreCompleto=function(){\n \n }\n}", "title": "" }, { "docid": "cfc0873985528a95ee17171b08ae2676", "score": "0.5615927", "text": "init(/** params */) {}", "title": "" }, { "docid": "5b6234fa15581e47085b321e5739d36e", "score": "0.5603067", "text": "function setDataIntoComponent(funcCallMain,jsonObj){\n\n //console.log(\"JloCommon funcCallMain :\"+funcCallMain);\n\n var strFun = funcCallMain;\n\n if(strFun != \"\"){\n var callbackfunction= window[strFun];\n\n callbackfunction.call(this, jsonObj);\n\n /*\n console.log(\"this \"+this);\n console.log(\"callbackfunction \"+callbackfunction);\n console.log(\"Pass call back function \");\n */\n }\n\n\n}", "title": "" }, { "docid": "dde4cf2c1ab1c2145d0bbce0fa188c38", "score": "0.5586318", "text": "constructor(params) {\n super(params);\n }", "title": "" }, { "docid": "4100b9f7b19a3ea879499435a515d57a", "score": "0.55817795", "text": "function soma2(...params) { // nas arrow functions só funciona o rest operator ...\n console.log(params)\n}", "title": "" }, { "docid": "dbb003260347b584f3e7384dcb23357b", "score": "0.5571667", "text": "function myfun(param){\n console.log(param);\n console.log(param());\n}", "title": "" }, { "docid": "40b02fbf841cacc1a8485026bfc5967d", "score": "0.5560916", "text": "get(param) {\n let retorno = super.get(param);\n if(retorno == null) return null;\n if(Array.isArray(retorno)) {\n return retorno.map(function(e) {\n //Callback es una funcion que permite instanciar los elementos de la coleccion\n //que se estén obteniendo, de esta manera la clase sigue siendo agnóstica con respecto\n //a lo que colecciona, pero permite respetar el tipo de objetos que se colecciona\n return this.callbackCreacion(e);\n },this);\n } else return this.callbackCreacion(retorno);\n }", "title": "" }, { "docid": "c2105980040aeba7033f72f9a6d529b5", "score": "0.55488473", "text": "constructor(p1){\n\t\t\tthis.p1=p1;\n\t\t}", "title": "" }, { "docid": "e683e95190a6fdbdf6ca6c5f27398e5d", "score": "0.55470777", "text": "constructor (descripcion, cantidad, precio){\n this.descripcion = descripcion;\n this.cantidad = cantidad;\n this.precio = precio;\n\n }", "title": "" }, { "docid": "57c381c1ff2e5e98f42ba589899e30cd", "score": "0.55409026", "text": "initparams(args, globs) {\r\n const paramsfn = {};\r\n this.paramlist.forEach(name => {\r\n !(name in this.decl.parameters) && error(this, `unknown parameter \"${name}\" it must be one of \"${toString()}\"`);\r\n paramsfn[name] = paramfunc(this.decl.parameters[name].type, this._params[name] || this.decl.parameters[name].default).bind(this.locals || {});\r\n });\r\n this._params = new Proxy(paramsfn, {\r\n get: (target, property) => {\r\n try {\r\n let paramdef = this.decl.parameters[property.toString()];\r\n paramdef || this.error(`unknown parameter \"${property.toString()}\" used`);\r\n const type = types_1.gettype(paramdef.type);\r\n return target[property](args, globs, this._params, this._pojo, type);\r\n }\r\n catch (e) {\r\n error(this, `error when evaluating step parameter \"${String(property)}\" due to => \\n \"${e.message}\" `);\r\n }\r\n },\r\n });\r\n }", "title": "" }, { "docid": "0f5d47bdd4ca6d3bb49d22340214d3cc", "score": "0.5531222", "text": "saludar(fn){\n var {nombre,apellido} = this\n console.log (`Hola me llamo ${nombre} ${apellido}`)\n if (fn){\n //si nos pasaron algo por fn se ejecuta\n //aunque el elemento este vacio ({}) sera siempre verdadero,lo mismo con array, un string, pero no string vacio que va a ser siempre false, 0, null\n fn (nombre,apellido) //lo omitimos\n //le estamos pasando nombre, apellido\n }\n }", "title": "" }, { "docid": "800809ca2b93390481494a4c3594d7c4", "score": "0.5524198", "text": "constructor(nombre, apellido,altura){\n //Atributos\n this.nombre = nombre\n this.apellido = apellido\n this.altura = altura\n }", "title": "" }, { "docid": "6388746b4a95461007db518e9893883e", "score": "0.5514738", "text": "parameter(name) {\r\n\t\t\t\tif (this.shared && this.parent.check(name, true)) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\treturn this.add(name, 'param');\r\n\t\t\t}", "title": "" }, { "docid": "28f84dbe278448c73914edaf0bf8a9f4", "score": "0.5500464", "text": "function nombre(nombre){\n saludo();\n}", "title": "" }, { "docid": "e9eaf5548d99a5a373448582f1f520aa", "score": "0.5496447", "text": "function callFn() {\n urlHelper._parseInputParameter('someString', ['object']);\n }", "title": "" }, { "docid": "e269313e6c82e425f086e596daa50d55", "score": "0.5491605", "text": "constructor(fNamepar,lNamepar){\n this.firstName = fNamepar;\n this.lastName = lNamepar; \n }", "title": "" }, { "docid": "80798168ac89fb630faeae13bc61686e", "score": "0.5485407", "text": "constructor(nombre, genero, tamanio) {\n super(nombre, genero);\n this.tamanio = tamanio;\n }", "title": "" }, { "docid": "fc7126e5ed8ea88632507cc206d47492", "score": "0.5473211", "text": "function setDataIntoComponentForTwoData(funcCallMain,jsonObj,Data){\n\n //console.log(\"JloCommon funcCallMain :\"+funcCallMain);\n\n var strFun = funcCallMain;\n\n if(strFun != \"\"){\n var callbackfunction= window[strFun];\n\n callbackfunction.call(this, jsonObj,Data);\n\n /*\n console.log(\"this \"+this);\n console.log(\"callbackfunction \"+callbackfunction);\n console.log(\"Pass call back function \");\n */\n }\n\n\n}", "title": "" }, { "docid": "3baae90dd35f220f4573faf381ba3605", "score": "0.54714227", "text": "function affiche() {}", "title": "" }, { "docid": "1e7b4a9310846542ade1b4b7e8092c30", "score": "0.5463511", "text": "constructor(nombre,apellido,altura,edad) {\n //usamos la palabra super para llamar al constructor de la clase padre, y le pasamos los parametros\n super(nombre,apellido,altura);\n //si quiero agregar propiedades que no estan en el padre, las declaro aca con this.\n this.edad = edad;\n}", "title": "" }, { "docid": "0cbc14236ff20212a47adb181ab1035d", "score": "0.5459982", "text": "constructor(name, params, locals, fun) {\n this.name = name\n this.params = params\n this.locals = locals\n this.fun = fun\n }", "title": "" }, { "docid": "7499c13e516afbaf513e1048163383cd", "score": "0.5451806", "text": "function lista(fruta1,fruta2,...restfrutas) {\n console.log(\"Fruta 1\",fruta1);\n console.log(\"fruta 2\",fruta2);\n console.log(\"restfrutas\",restfrutas);\n }", "title": "" }, { "docid": "080fc416e247a969f007d8e1bfb975e6", "score": "0.54514885", "text": "constructor (nombre, direccion, telefono, nif) {\n this.nombre = nombre;\n this.direccion = direccion;\n this.telefono = telefono;\n this.nif = nif;\n }", "title": "" }, { "docid": "39a9b05fd102126642a70dbdbafe2ff9", "score": "0.5448797", "text": "constructor(nombre, apellido,altura){\n this.nombre = nombre\n this.apellido = apellido\n this.altura = altura\n }", "title": "" }, { "docid": "cd2e2bff1ce0f145aea071f562e95ad4", "score": "0.5447353", "text": "inizializza() {\n\n }", "title": "" }, { "docid": "46e969a6e0854724f7517cf039cbf724", "score": "0.5426763", "text": "constructor(nombre,raza,edad,color,estado){\n this.nombre = nombre\n this.raza = raza\n this.edad = edad\n this.color = color\n this.estado = estado\n }", "title": "" }, { "docid": "4441980629ec2d866a79e49e3516c689", "score": "0.5420691", "text": "enterOC_Parameter(ctx) {}", "title": "" }, { "docid": "5df0979dab37cdb8f8461fe7174ae26d", "score": "0.54194844", "text": "function decirHola(nombrecito){ //nombrecito es el parametro\r\n console.log(`Hola, mi nombre es ${nombrecito}`); // acá aun sigue vacio\r\n}", "title": "" }, { "docid": "37b8e79b9fcd85ae7780b5882d4f6a48", "score": "0.5418953", "text": "function archit(para) {\n console.log(para);\n console.log(\"Hii chiks\");\n para();\n}", "title": "" }, { "docid": "1d688f5217081590730f765046427687", "score": "0.5414133", "text": "constructor(nombre,edad,correo,carrera){\n super(nombre,edad,correo);\n this.carrera=carrera;\n }", "title": "" }, { "docid": "e579385ae1c3cfe6549133d3ee3c4fb2", "score": "0.5413967", "text": "function showData(...param) {\n console.log(param);\n}", "title": "" }, { "docid": "7d8a2a0d82be0e6549885d6bcd5d4bd0", "score": "0.5408179", "text": "constructor(id,cliente,cuenta,tipo,valor) {\n if (id) {\n this.id = id; \n } \n this.cliente = cliente;\n this.cuenta = cuenta;\n this.tipo = tipo;\n this.valor = valor;\n }", "title": "" }, { "docid": "11c46695c656721a5b910e2ac9e27d8c", "score": "0.540598", "text": "constructor( titulo, ano, genero, diretor, duracao){ // atributos da classe em javascript, tem que ter exatamente esse nome, tem que colocar isso para definir o atributo, dentro deel voce coloca o parametro que suas variaveis de atributo vão receber\n //ATRIBUTOS\n this.titulo = titulo; //Atributos são como variaveis, só que pertencem a uma classe.Parar criar um, é bem semelhante ao processo de criação de variavel, com a adição do 'this.' antes do nome do atributo\n this.ano = ano;\n this.genero = genero; //Contructor: é basicamente um funçãi especial que é responsavel \n this.diretor = diretor; //por pegar classe e criar uma copia na memoria, ele é responsavel por gerar os objetos na memoria\n this.duracao = duracao; // pega cria um objeto e retorna ele para mim\n this.atores = [];\n\n }", "title": "" }, { "docid": "3b8600aa63a5f99af8b81771d2c2e52d", "score": "0.5401852", "text": "function se(a){this.o=a}", "title": "" }, { "docid": "f9b1993fa11b94c3cbd9803d6d7e12ba", "score": "0.5397033", "text": "function ParamMap(){}", "title": "" }, { "docid": "90722115c172982e3c55ed3b6822da4e", "score": "0.5396995", "text": "constructor(nombre, tipo, numPatas) {\n this.nombre = nombre;\n this.tipo = tipo;\n this.numPatas = numPatas;\n }", "title": "" }, { "docid": "b6247de0bf689711c4a0bcbef46f79c1", "score": "0.539562", "text": "function resFunction(age, name, ...list) { //any other argument that is passed to resFunciton during function call is stored is list b.c of REST operator\n console.log(name , \"is\", age);\n list.forEach(item => console.log(item)) //;ogs all the item passed to list array\n}", "title": "" }, { "docid": "472079a163285ab8966f71f89df259c6", "score": "0.53940594", "text": "detail(...args) {\n callback(...args);\n }", "title": "" }, { "docid": "6a40e6b8b70b7147833e7c61136a3de7", "score": "0.5393417", "text": "diagnostica(paciente) {}", "title": "" }, { "docid": "a083b01c447d44d82c1b4445b723b358", "score": "0.53779155", "text": "constructor(nombre, tipo, raza, edad) {\n this.name = nombre;\n this.type = tipo;\n this.breed = raza; \n this.age = edad; \n }", "title": "" }, { "docid": "8e7cc20638090eb779aaa99722f86ad4", "score": "0.5377231", "text": "function _inner(){\n boleta_nueva(data);\n }", "title": "" }, { "docid": "6463afec96f82e628b0ff67ebb450302", "score": "0.53717756", "text": "function pa(){}", "title": "" }, { "docid": "7dc907ba8149a13e8635a700cf1ddc30", "score": "0.5368486", "text": "parameter(n,t,a){\n this.o.parameters[getNextKey(this.o.parameters)] = {n,t,a};\n return this;\n }", "title": "" }, { "docid": "26ffb72b03c13a9630881b2b83d03b0e", "score": "0.5358929", "text": "constructor(param){\n\t\tthis.param={};\n\t\tthis.staticParam={};\n\t\tthis.size=10;\n\t\tthis.page=-1;\n\t\tthis._data=null;\n\t\tthis.fun=null;\n\t\tfor (var x in param){\n\t\t\tif (x in _Table.staticKeys){\n\t\t\t\tthis.staticParam[x]=param[x];\n\t\t\t}else this[x]=param[x];\n\t\t}\n\t}", "title": "" }, { "docid": "7dcc5d7c264ca050738bdff6f8e52879", "score": "0.5351159", "text": "constructor (param /* : number */) {\n this.param = param\n }", "title": "" }, { "docid": "20f426bef2040473e0a7908a12bfba67", "score": "0.534364", "text": "function fb({x,y=10}){\n console.log(\"fb -- x : \" + x);\n console.log(\"fb -- y : \" + y);\n}", "title": "" }, { "docid": "0f1b3257db7127f6425e04e145aa200f", "score": "0.5341592", "text": "setParameter (name, value) {\n this.parameters[name] = value\n }", "title": "" }, { "docid": "ec1b1b52c6762186c62ddc221586b739", "score": "0.5332972", "text": "static initialize(obj, parameterEditable, schema) { \n obj['parameterEditable'] = parameterEditable;\n obj['schema'] = schema;\n }", "title": "" }, { "docid": "58b0ac3ae049252d2f0cc1eafcfbfec0", "score": "0.5328809", "text": "static porObjeto({nombre, apellido, pais}){ // destructuracion de los parametros del contructor\n return new Persona( nombre, apellido, pais);\n }", "title": "" }, { "docid": "5c41603d5cdcc9aba78a09cf46ce8f5f", "score": "0.532808", "text": "function withArguments(params, who) {\n console.log(params + ' ' + who);\n }", "title": "" }, { "docid": "87743c006f077e494d46c2ca0ee89cae", "score": "0.5318937", "text": "function lf(a){this.o=a}", "title": "" }, { "docid": "ed24ad56e51c2ebc8198c43e93b3d901", "score": "0.5316844", "text": "function objectCall(obj){\n obj.company=\"Honda\"\n }", "title": "" }, { "docid": "9ee4c6bf06f6855a2825781c050cae68", "score": "0.5311493", "text": "function buatObjectMurid(nama, nis, kelas, email) {\n// baris diatas membuat function object dengan mendefinisikan parameter untuk argument\n var murid2 = {};\n // baris diatas mendeclarasikan variable object\n murid2.nama = nama ;\n murid2.nis = nis ;\n murid2.kelas = kelas ;\n murid2.email = email ;\n // baris di atas mengisi property dengan menggunakan parameter function\n return murid2;\n // kembalikan nilai object\n}", "title": "" }, { "docid": "5bb49426291202b1ceee7e3c1683e3af", "score": "0.5298441", "text": "function myRequest(obj){\n wx.showLoading({\n title: '正在请求',\n });\n let o = {\n ...obj\n };\n\n o.success = function(){\n wx.hideLoading();\n obj.success(...arguments);\n }\n\n o.fail = function (){\n wx.hideLoading();\n obj.fail(...arguments);\n }\n\n wx.request(o);\n}", "title": "" }, { "docid": "70903f63d00f12df3695a3b268e8375d", "score": "0.5298369", "text": "constructor(nombre, apPaterno, apMaterno, edad, sexo, nacionalidad,deporte, actividad) {\n //Pongo aquí porqué es cuando se crea la instancia.\n //Y no deben de pasar al padre ya que no existen y marcaria error\n //ademas siempre van despues de instanciar al padre los \"this\"\n super(nombre, apPaterno, apMaterno, edad, sexo, nacionalidad);//invocando al constructor padre.\n this.deporte = deporte;\n this.actividad = actividad;\n }", "title": "" } ]
80700c79e8e9fa915b01b90a5f1f5bd2
Creates a new spatializer that performs no panning, only distancebased volume scaling
[ { "docid": "dbd5e52bbf1cff0952339e888fa4bd74", "score": "0.0", "text": "constructor(id, source, audioContext, destination, listener) {\n super(id, source, audioContext);\n this.listener = listener;\n this.gain.connect(destination);\n Object.seal(this);\n }", "title": "" } ]
[ { "docid": "2b7b27b345903fa39f6ab26f3125295d", "score": "0.71911067", "text": "createSpatializer(spatialize, audioContext, destination) {\n if (spatialize) {\n return new VolumeScalingNode(audioContext, destination.spatializedInput, this);\n }\n else {\n return super.createSpatializer(spatialize, audioContext, destination);\n }\n }", "title": "" }, { "docid": "3be907e70edfa21f18aab4e484cb18b6", "score": "0.70175487", "text": "createSpatializer(id, source, spatialize, audioContext) {\n if (spatialize) {\n return new VolumeScalingNode(id, source, audioContext, this.gain, this);\n }\n else {\n return super.createSpatializer(id, source, spatialize, audioContext);\n }\n }", "title": "" }, { "docid": "0e22be747e6e2beebdd9f2b67444656d", "score": "0.6482332", "text": "createSpatializer(_spatialize, audioContext, destination) {\n return new NoSpatializationNode(audioContext, destination.nonSpatializedInput);\n }", "title": "" }, { "docid": "33830f7b0b8f0613cd0c0e30821b048b", "score": "0.5954952", "text": "createSpatializer(spatialize, audioContext, destination) {\n if (spatialize) {\n throw new Error(\"Can't spatialize with the base listener.\");\n }\n return new NoSpatializationNode(audioContext, destination.nonSpatializedInput);\n }", "title": "" }, { "docid": "f3c38cba67634e2564586f25aea56830", "score": "0.5783337", "text": "createSpatializer(spatialize, audioContext, destination) {\n if (spatialize) {\n return new WebAudioPannerOld(audioContext, destination.spatializedInput);\n }\n else {\n return super.createSpatializer(spatialize, audioContext, destination);\n }\n }", "title": "" }, { "docid": "c6091f3d2cfe0260b7c5beb79885940c", "score": "0.5778199", "text": "createSpatializer(spatialize, audioContext, destination) {\n if (spatialize) {\n return new ResonanceAudioNode(audioContext, destination.spatializedInput, this.scene);\n }\n else {\n return super.createSpatializer(spatialize, audioContext, destination);\n }\n }", "title": "" }, { "docid": "9b5439fbc4cfe9895358d2613a22b830", "score": "0.5765323", "text": "createSpatializer(id, source, spatialize, audioContext) {\n if (spatialize) {\n throw new Error(\"Can't spatialize with the base listener.\");\n }\n return new NoSpatializationNode(id, source, audioContext, this.gain);\n }", "title": "" }, { "docid": "d58a3aa8794511a9d22192924dd8bf9e", "score": "0.56692207", "text": "createSpatializer(spatialize, audioContext, destination) {\n if (spatialize) {\n return new WebAudioPannerNew(audioContext, destination.spatializedInput);\n }\n else {\n return super.createSpatializer(spatialize, audioContext, destination);\n }\n }", "title": "" }, { "docid": "f45ebe182c14059e7b91c766b8829084", "score": "0.56460375", "text": "createSpatializer(id, source, spatialize, audioContext) {\n if (spatialize) {\n return new WebAudioPannerOld(id, source, audioContext, this.gain);\n }\n else {\n return super.createSpatializer(id, source, spatialize, audioContext);\n }\n }", "title": "" }, { "docid": "43de23306043c449b79670491a9090c9", "score": "0.56221694", "text": "function StaticVolume(coords, distances, phases) {\n if(coords) {\n this.coords = coords;\n this.distances = distances;\n this.phases = phases;\n } else {\n this.coords = [ new Int32Array(1), new Int32Array(1), new Int32Array(1) ];\n this.distances = new Float32Array(1);\n this.phases = new Int32Array(1);\n this.coords[0][0] = this.coords[1][0] = this.coords[2][0] = NEGATIVE_INFINITY;\n this.distances[0] = 1.0;\n }\n}", "title": "" }, { "docid": "49726327f3d2a81ef0c3d5a85bf335b9", "score": "0.55949306", "text": "function DynamicVolume(coords_, distances_, phases_) {\n if(coords_) {\n this.coords = coords_;\n this.distances = distances_;\n this.phases = phases_;\n } else {\n this.coords = [ [NEGATIVE_INFINITY], [NEGATIVE_INFINITY], [NEGATIVE_INFINITY] ];\n this.distances = [1.0];\n this.phases = [0];\n }\n}", "title": "" }, { "docid": "22f7b04070d4be62d4a8368ca4d5dbb1", "score": "0.55453527", "text": "createSpatializer(id, source, spatialize, audioContext) {\n if (spatialize) {\n return new WebAudioPannerNew(id, source, audioContext, this.gain);\n }\n else {\n return super.createSpatializer(id, source, spatialize, audioContext);\n }\n }", "title": "" }, { "docid": "e28657ff2cade2c6bd03014669b99a7f", "score": "0.55341285", "text": "createSpatializer(id, source, spatialize, audioContext) {\n if (spatialize) {\n return new WebAudioPannerNew(id, source, audioContext, this.gain);\n }\n else {\n return super.createSpatializer(id, source, spatialize, audioContext);\n }\n }", "title": "" }, { "docid": "529861c6a5733305fed069c608a552b8", "score": "0.550822", "text": "createSpatializer(id, source, spatialize, audioContext) {\n if (spatialize) {\n return new ResonanceAudioNode(id, source, audioContext, this.scene);\n }\n else {\n return super.createSpatializer(id, source, spatialize, audioContext);\n }\n }", "title": "" }, { "docid": "5f0f19086e9d48bfa41327553ea52037", "score": "0.5490716", "text": "function StaticVolume(coords, distances, phases) {\n if(coords) {\n this.coords = coords;\n this.distances = distances;\n this.phases = phases;\n } else {\n this.coords = [ new Int32Array(1), new Int32Array(1), new Int32Array(1) ];\n this.distances = new Float32Array(1);\n this.phases = new Int32Array(1);\n this.coords[0][0] = this.coords[1][0] = this.coords[2][0] = NEGATIVE_INFINITY;\n this.distances[0] = 1.0;\n }\n }", "title": "" }, { "docid": "96902f809ecf60a8db542a2e27985f59", "score": "0.5427523", "text": "constructor(){\n\t\tthis.offsetX = 0;\n\t\tthis.offsetY = 0;\n\t\tthis.scale = 1;\n\t}", "title": "" }, { "docid": "1cccdf277d962336712f02a431dc76fe", "score": "0.53880465", "text": "constructor(el, sp) {\n this.noise(el, sp);\n }", "title": "" }, { "docid": "90525755cd4a5ee67abc7bda637bae70", "score": "0.5376753", "text": "function DynamicVolume(coords_, distances_, phases_) {\n if(coords_) {\n this.coords = coords_;\n this.distances = distances_;\n this.phases = phases_;\n } else {\n this.coords = [ [NEGATIVE_INFINITY], [NEGATIVE_INFINITY], [NEGATIVE_INFINITY] ];\n this.distances = [1.0];\n this.phases = [0];\n }\n }", "title": "" }, { "docid": "c676c68f720e47e2eb946a175505f25a", "score": "0.53714746", "text": "createSpatializer(spatialize) {\n return this.listener.createSpatializer(spatialize, this.audioContext, this.localUser);\n }", "title": "" }, { "docid": "1c46b93236b586363005270bf66404ba", "score": "0.53141916", "text": "constructor() {\n this.start = new Pose();\n this.current = new Pose();\n this.end = new Pose();\n\n /** @type {BaseSpatializer} */\n this._spatializer = null;\n\n Object.seal(this);\n }", "title": "" }, { "docid": "3f015d09f9916f9ff411a411267aeb25", "score": "0.5153736", "text": "constructor(scene, options) {\n // Use defaults for undefined arguments.\n options = Object.assign({\n position: copy(create$2(), DEFAULT_POSITION),\n forward: copy(create$2(), DEFAULT_FORWARD),\n up: copy(create$2(), DEFAULT_UP),\n minDistance: DEFAULT_MIN_DISTANCE,\n maxDistance: DEFAULT_MAX_DISTANCE,\n rolloff: DEFAULT_ATTENUATION_ROLLOFF,\n gain: DEFAULT_SOURCE_GAIN,\n alpha: DEFAULT_DIRECTIVITY_ALPHA,\n sharpness: DEFAULT_DIRECTIVITY_SHARPNESS,\n sourceWidth: DEFAULT_SOURCE_WIDTH,\n }, options);\n // Member variables.\n this.scene = scene;\n this.position = options.position;\n this.forward = options.forward;\n this.up = options.up;\n this.dx = create$2();\n this.right = create$2();\n cross(this.right, this.forward, this.up);\n // Create audio nodes.\n let context = scene.context;\n this.input = context.createGain();\n this.directivity = new Directivity(context, {\n alpha: options.alpha,\n sharpness: options.sharpness,\n });\n this.toEarly = context.createGain();\n this.toLate = context.createGain();\n this.attenuation = new Attenuation(context, {\n minDistance: options.minDistance,\n maxDistance: options.maxDistance,\n rolloff: options.rolloff,\n });\n this.encoder = new Encoder(context, {\n ambisonicOrder: scene.ambisonicOrder,\n sourceWidth: options.sourceWidth,\n });\n // Connect nodes.\n connect(this.input, this.toLate);\n connect(this.toLate, scene.room.late.input);\n connect(this.input, this.attenuation.input);\n connect(this.attenuation.output, this.toEarly);\n connect(this.toEarly, scene.room.early.input);\n connect(this.attenuation.output, this.directivity.input);\n connect(this.directivity.output, this.encoder.input);\n // Assign initial conditions.\n this.setPosition(options.position);\n this.input.gain.value = options.gain;\n }", "title": "" }, { "docid": "a34d57dd8f541a62cf092b7a5350afc5", "score": "0.5127181", "text": "constructor(options) {\n const opts = options || {};\n super(opts);\n\n this.simplex = opts.simplex || false;\n\n this.line_width = opts.line_width || 0.001;\n this.min_amplitude = opts.min_aplitude || 0.001;\n this.max_amplitude = opts.max_amplitude || 0.005;\n\n this.length = opts.length || 0.1;\n this.radius = opts.radius || 0.4;\n this.theta = rnd_range(-0.15, 0.15) * TAU;\n\n this.length = rescale(0.15 * TAU, 0, 0.8, 1.8, Math.abs(this.theta)) * this.length;\n }", "title": "" }, { "docid": "8397ca3247ecc2c7f5bee05c9b00465f", "score": "0.5106078", "text": "constructor(scene, options) {\n // Use defaults for undefined arguments.\n options = Object.assign({\n position: copy(create$2(), DEFAULT_POSITION),\n forward: copy(create$2(), DEFAULT_FORWARD),\n up: copy(create$2(), DEFAULT_UP),\n minDistance: DEFAULT_MIN_DISTANCE,\n maxDistance: DEFAULT_MAX_DISTANCE,\n rolloff: DEFAULT_ATTENUATION_ROLLOFF,\n gain: DEFAULT_SOURCE_GAIN,\n alpha: DEFAULT_DIRECTIVITY_ALPHA,\n sharpness: DEFAULT_DIRECTIVITY_SHARPNESS,\n sourceWidth: DEFAULT_SOURCE_WIDTH,\n }, options);\n // Member variables.\n this.scene = scene;\n this.position = options.position;\n this.forward = options.forward;\n this.up = options.up;\n this.dx = create$2();\n this.right = create$2();\n cross(this.right, this.forward, this.up);\n // Create audio nodes.\n let context = scene.context;\n this.input = context.createGain();\n this.directivity = new Directivity(context, {\n alpha: options.alpha,\n sharpness: options.sharpness,\n });\n this.toEarly = context.createGain();\n this.toLate = context.createGain();\n this.attenuation = new Attenuation(context, {\n minDistance: options.minDistance,\n maxDistance: options.maxDistance,\n rolloff: options.rolloff,\n });\n this.encoder = new Encoder(context, {\n ambisonicOrder: scene.ambisonicOrder,\n sourceWidth: options.sourceWidth,\n });\n // Connect nodes.\n this.input.connect(this.toLate);\n this.toLate.connect(scene.room.late.input);\n this.input.connect(this.attenuation.input);\n this.attenuation.output.connect(this.toEarly);\n this.toEarly.connect(scene.room.early.input);\n this.attenuation.output.connect(this.directivity.input);\n this.directivity.output.connect(this.encoder.input);\n this.encoder.output.connect(scene.listener.input);\n // Assign initial conditions.\n this.setPosition(options.position);\n this.input.gain.value = options.gain;\n }", "title": "" }, { "docid": "b6c92a8c201ca267f3f7ee6fc34c703e", "score": "0.5025023", "text": "spaceNotFilledBySphere() {\n let radius = this.length/2\n return this.volume() - (4/3)*(Math.PI*radius*radius*radius);\n }", "title": "" }, { "docid": "29a2a8ff092b704a02177ce27e73fd7c", "score": "0.49772155", "text": "function createMagicSphere( p ) {\r\n\t\r\n\t/*\tparameter overview\t--- all parameters are optional ---\r\n\t\r\n\tp = {\r\n\t\t\r\n\t\t\t// simple properties\r\n\t\t\r\n\t\tequator,\r\n\t\tuvmode,\r\n\t\tcontourmode,\r\n\t\texplodemode,\r\n\t\t\r\n\t\t\t// array, value 1 for octant, otherwise arbitrary - upper counterclockwise, lower clockwise\r\n\t\tparts, \r\n\t\t\r\n\t\t\t// functions with parameter time // function ( t )\r\n\t\r\n\t\tradius,\r\n\t\trounding,\r\n\t\tprofile,\t\t// y = f( x, t ), 0 < x < PI / 2, 0 < y < 1\r\n\t\tpointX,\t\t\t// normally interval 0 to PI / 2\r\n\t\tpointY,\t\t\t// normallyinterval 0 to 1\r\n\t\tdriftX,\r\n\t\tdriftY,\r\n\t\tdriftZ,\r\n\t\texplode,\t\t// factor for exploded view - non indexed BufferGeometry\r\n\t\t\r\n\t}\t\r\n\t\r\n\t*/\r\n\r\n\tif ( p === undefined ) p = {};\r\n\t\r\n\tg = this; // THREE.BufferGeometry() - geometry object from three.js\r\n\t\r\n\tg.driftXDefault = p.driftX === undefined ? true : false;\r\n\tg.driftYDefault = p.driftY === undefined ? true : false;\r\n\tg.driftZDefault = p.driftZ === undefined ? true : false;\r\n\tg.driftDefault = g.driftXDefault && g.driftYDefault && g.driftZDefault;\r\n\tg.explodeDefault = p.explode === undefined ? true : false;\r\n\r\n\t//............................................................set defaults\r\n\t\r\n\tg.equator = \tp.equator !== undefined ? p.equator\t: 6;\r\n\tg.uvmode = \t\tp.uvmode !== undefined ? p.uvmode\t: 0;\r\n\tg.contourmode =\tp.contourmode !== undefined ? p.contourmode\t: 'rounding'; // 'profile' 'bezier' 'linear' \r\n\tg.explodemode =\tp.explodemode !== undefined ? p.explodemode\t: 'center'; // 'normal'\r\n\r\n\tg.parts = \t\tp.parts !== undefined ? p.parts\t: [ 1, 1, 1, 1, 1, 1, 1, 1 ];\r\n\t\r\n\tg.radius = \t\tp.radius !== undefined ? p.radius\t\t: function ( t ) { return 1 };\r\n\t\r\n\tg.rounding =\tp.rounding !== undefined ? p.rounding\t: function ( t ) { return 1 };\r\n\t\r\n\tg.profile = \tp.profile !== undefined ? p.profile\t\t: function ( x, t ) { return Math.sin( x ) };\r\n\t\r\n\tg.pointX = \t\tp.pointX !== undefined ? p.pointX\t\t: function ( t ) { return 0.001 };\r\n\tg.pointY = \t\tp.pointY !== undefined ? p.pointY\t\t: function ( t ) { return 0.999 };\r\n\t\r\n\tg.driftX =\t\tp.driftX !== undefined ? p.driftX\t\t: function ( t ) { return 0 };\r\n\tg.driftY =\t\tp.driftY !== undefined ? p.driftY\t\t: function ( t ) { return 0 };\r\n\tg.driftZ = \t\tp.driftZ !== undefined ? p.driftZ\t\t: function ( t ) { return 0 };\r\n\t\r\n\tg.explode = \tp.explode !== undefined ? p.explode\t\t: function ( t ) { return 0 };\r\n\t\r\n\t//..............................................................................................\r\n\r\n\tg.buildMagicSphere = buildMagicSphere;\r\n\tg.morphVerticesMagicSphere = morphVerticesMagicSphere;\r\n\t\r\n\tg.buildMagicSphere();\r\n\tg.morphVerticesMagicSphere();\r\n\t\r\n}", "title": "" }, { "docid": "ba06d88398c61e475bfacd3966ecef99", "score": "0.4948219", "text": "createSpatializer(id, source, spatialize) {\n if (!this.listener) {\n throw new Error(\"Audio context isn't ready\");\n }\n return this.listener.createSpatializer(id, source, spatialize, this.audioContext);\n }", "title": "" }, { "docid": "f1d78639223512b8d01ff8e11b487312", "score": "0.49466607", "text": "normalize() {\n let mag = this.getMagnitude();\n this.componentX = this.componentX / mag;\n this.componentY = this.componentY / mag;\n return this;\n }", "title": "" }, { "docid": "da4796fa340652051bf18b18df7c90e6", "score": "0.49284264", "text": "function init() {\n //no-op\n if (!this.sphere) {\n this.k0 = (0, _msfnz.default)(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts));\n }\n}", "title": "" }, { "docid": "da4796fa340652051bf18b18df7c90e6", "score": "0.49284264", "text": "function init() {\n //no-op\n if (!this.sphere) {\n this.k0 = (0, _msfnz.default)(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts));\n }\n}", "title": "" }, { "docid": "b05a14e102531e3c3facd12ce370ae55", "score": "0.4911034", "text": "function Sphere() {\n\tthis.type = 0;\n\tthis.position = [0.0,0.0,0.0,1.0];\n\tthis.material = [1.0,1.0,1.0,1.0];\n\tthis.materialExtended = [0.0,0.0,0.0,0.0];\n\t\n\treturn this;\n}", "title": "" }, { "docid": "f042d620cc3e770d346802cc6e43dbc1", "score": "0.49079117", "text": "constructor(destination, listener) {\n super(destination);\n this.gain\n = this.input\n = this.output\n = Gain(\"listener-volume-scaler\");\n this.listener = listener;\n connect(this, this.destination);\n Object.seal(this);\n }", "title": "" }, { "docid": "d0ca9f768b991996a09c3c68711127e1", "score": "0.49023774", "text": "function makePoint(center,weight){\n\treturn new Sphere(makeV3D(center),weight);\n}", "title": "" }, { "docid": "3d265f4b286a00f3cf99288ca460edd8", "score": "0.48744285", "text": "constructor(center, v1, v2, normalDir, properties){\n this.center = center;\n this.radius = mag(v1);\n // create orthogonal basis \n this.v1 = v1;\n this.v2 = cross(v1, cross(v1,v2));\n this.v2 = scale(this.radius, normalize(this.v2));\n this.normal = cross(this.v1, this.v2);\n if(dot(this.normal, normalDir) < 0){\n this.normal = scale(-1, this.normal);\n }\n this.normal = normalize(this.normal);\n this.properties = properties;\n this.type = 'Disk';\n this.area = Math.PI*this.radius**2;\n }", "title": "" }, { "docid": "944199ffb6c743667f054081507cc5fa", "score": "0.4872303", "text": "constructor(x, y, z, shell) {\n this.shell = shell;\n this.position = new THREE.Vector3(x, y, z);\n // Assign velocity according to the type\n if (this.shell) {\n this.velocity = new THREE.Vector3(0, Math.random() * 0.4, 0);\n } else {\n this.velocity = new THREE.Vector3(\n Math.random() * 0.4 * (Math.round(Math.random()) * 2 - 1),\n Math.random() * 0.4 * (Math.round(Math.random()) * 2 - 1),\n Math.random() * 0.4 * (Math.round(Math.random()) * 2 - 1)\n );\n this.velocity.multiplyScalar(\n Math.random() * 0.5 * (Math.round(Math.random()) * 2 - 1)\n );\n }\n this.acceleration = new THREE.Vector3(0, 0, 0);\n this.geometry = new THREE.Geometry();\n // Assign material according to the type\n if (this.shell) {\n this.material = new THREE.PointsMaterial({\n color: 'rgb(255,255,255)',\n transparent: true,\n opacity: 1,\n size: 0.06,\n });\n } else {\n this.material = new THREE.PointsMaterial({\n color: `rgb( ${Math.floor(\n Math.random() * Math.floor(255)\n )},${Math.floor(Math.random() * Math.floor(255))},${Math.floor(\n Math.random() * Math.floor(255)\n )})`,\n transparent: true,\n opacity: 1,\n size: 0.05,\n });\n }\n // Construct and render particle on scene\n this.particle = this.show();\n }", "title": "" }, { "docid": "7940f77ce96e68e106125756484caee1", "score": "0.485262", "text": "function SolidParticleSystem(name, scene, options) {\n /**\n * The SPS array of Solid Particle objects. Just access each particle as with any classic array.\n * Example : var p = SPS.particles[i];\n */\n this.particles = new Array();\n /**\n * The SPS total number of particles. Read only. Use SPS.counter instead if you need to set your own value.\n */\n this.nbParticles = 0;\n /**\n * If the particles must ever face the camera (default false). Useful for planar particles.\n */\n this.billboard = false;\n /**\n * Recompute normals when adding a shape\n */\n this.recomputeNormals = true;\n /**\n * This a counter ofr your own usage. It's not set by any SPS functions.\n */\n this.counter = 0;\n /**\n * This empty object is intended to store some SPS specific or temporary values in order to lower the Garbage Collector activity.\n * Please read : http://doc.babylonjs.com/overviews/Solid_Particle_System#garbage-collector-concerns\n */\n this.vars = {};\n /**\n * If the particle intersection must be computed only with the bounding sphere (no bounding box computation, so faster). (Internal use only)\n * @hidden\n */\n this._bSphereOnly = false;\n /**\n * A number to multiply the boundind sphere radius by in order to reduce it for instance. (Internal use only)\n * @hidden\n */\n this._bSphereRadiusFactor = 1.0;\n this._positions = new Array();\n this._indices = new Array();\n this._normals = new Array();\n this._colors = new Array();\n this._uvs = new Array();\n this._index = 0; // indices index\n this._updatable = true;\n this._pickable = false;\n this._isVisibilityBoxLocked = false;\n this._alwaysVisible = false;\n this._depthSort = false;\n this._shapeCounter = 0;\n this._copy = new SolidParticle(0, 0, 0, null, 0, 0, this);\n this._color = new Color4(0, 0, 0, 0);\n this._computeParticleColor = true;\n this._computeParticleTexture = true;\n this._computeParticleRotation = true;\n this._computeParticleVertex = false;\n this._computeBoundingBox = false;\n this._depthSortParticles = true;\n this._mustUnrotateFixedNormals = false;\n this._particlesIntersect = false;\n this._needs32Bits = false;\n this.name = name;\n this._scene = scene || EngineStore.LastCreatedScene;\n this._camera = scene.activeCamera;\n this._pickable = options ? options.isPickable : false;\n this._depthSort = options ? options.enableDepthSort : false;\n this._particlesIntersect = options ? options.particleIntersection : false;\n this._bSphereOnly = options ? options.boundingSphereOnly : false;\n this._bSphereRadiusFactor = (options && options.bSphereRadiusFactor) ? options.bSphereRadiusFactor : 1.0;\n if (options && options.updatable !== undefined) {\n this._updatable = options.updatable;\n }\n else {\n this._updatable = true;\n }\n if (this._pickable) {\n this.pickedParticles = [];\n }\n if (this._depthSort) {\n this.depthSortedParticles = [];\n }\n }", "title": "" }, { "docid": "d518876e6bd28f3b5af594e37e864831", "score": "0.48520023", "text": "function Sphere() {\n this.vertexNormalBuffer;\n this.vertexPositionBuffer;\n this.vertexIndexBuffer;\n}", "title": "" }, { "docid": "0123ab2dce1c6215a67d665a6d46da7a", "score": "0.48514736", "text": "function initPositionSerpent() {\r\n xSerp = Math.trunc(Math.random()*nombreBlockParWidth)*tailleSerp;;\r\n ySerp = Math.trunc(Math.random()*nombreBlockParHeight)*tailleSerp;\r\n }", "title": "" }, { "docid": "ae9da67d8e4cd7bca7aa5c0a2c3beb30", "score": "0.4847225", "text": "function BoundingVolumeMeshBuilder() {}", "title": "" }, { "docid": "5bbe9f39b13c1ac7bf0211d7da7eb438", "score": "0.48456213", "text": "constructor() {\n super();\n /**\n * The sampling level determines the number of samples that will be performed per frame.\n * Renders will happen `2 ^ samplingLevel` time(s). `samplingLevel` stands between `0` and `5`.\n * Therefore there can be between 1 and 32 samples.\n *\n * @default `SamplingLevel.Level_1`\n */\n this.samplingLevel = MSAASampling.Level_1;\n this.m_renderTarget = null;\n this.m_localCamera = new THREE.OrthographicCamera(-1, 1, 1, -1, 0, 1);\n this.m_quadScene = new THREE.Scene();\n this.m_quadUniforms = harp_materials_1.CopyShader.uniforms;\n this.m_quadMaterial = new harp_materials_1.MSAAMaterial(this.m_quadUniforms);\n this.m_quad = new THREE.Mesh(new THREE.PlaneBufferGeometry(2, 2), this.m_quadMaterial);\n this.m_quad.frustumCulled = false;\n this.m_quadScene.add(this.m_quad);\n }", "title": "" }, { "docid": "a37269e61a91f045b6e2202ae56f9280", "score": "0.48407686", "text": "function init$16() {\n\t\t//no-op\n\t\tif (!this.sphere) {\n\t\t\tthis.k0 = msfnz(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts));\n\t\t}\n\t}", "title": "" }, { "docid": "df16b778ef5768228d99efbbf4e5b16d", "score": "0.4835984", "text": "function Speckle() {\n Particle.call( this, arguments );\n this.mass = 1;\n}", "title": "" }, { "docid": "d0f3263475e8ad46916b34412e8b263a", "score": "0.48329484", "text": "constructor(point, normal, magnitude) {\n this.point = point\n this.normal = normal\n this.magnitude = magnitude\n }", "title": "" }, { "docid": "081e64ffe8202adae95bf89041cee4c5", "score": "0.48075256", "text": "get scaling () {\n return this._scl;\n }", "title": "" }, { "docid": "ecc12f942ff74596fcea111d28f24b8f", "score": "0.48008472", "text": "constructor(audioContext, destination) {\n super(audioContext, destination);\n this.pose = null;\n this.gain.gain.value = 0.25;\n Object.seal(this);\n }", "title": "" }, { "docid": "8b5cc6395f2cf466797e67b77be0ef4a", "score": "0.47942176", "text": "sample(){\n // the idea is to sample a unit cube until a point lies inside \n // the unit sphere. Then project onto the unit sphere and \n // map onto this sphere\n let pt = [2*Math.random()-1, 2*Math.random()-1, 2*Math.random()-1];\n while(mag(pt) > 1){\n pt = [2*Math.random()-1, 2*Math.random()-1, 2*Math.random()-1];\n }\n const direction = normalize(pt);\n // map onto surface of sphere \n const projection = plus(this.center, scale(this.radius, direction));\n return {pt: projection, dir: BRDF.gaussDir(direction, this.properties.brdf.properties.lobeSize, direction), color:this.properties.color};\n }", "title": "" }, { "docid": "6b564017d56fb60f54fed208e806d4a2", "score": "0.47907552", "text": "function SolidParticleSystem(name, scene, options) {\n // public members\n /**\n * The SPS array of Solid Particle objects. Just access each particle as with any classic array.\n * Example : var p = SPS.particles[i];\n */\n this.particles = new Array();\n /**\n * The SPS total number of particles. Read only. Use SPS.counter instead if you need to set your own value.\n */\n this.nbParticles = 0;\n /**\n * If the particles must ever face the camera (default false). Useful for planar particles.\n */\n this.billboard = false;\n /**\n * Recompute normals when adding a shape\n */\n this.recomputeNormals = true;\n /**\n * This a counter ofr your own usage. It's not set by any SPS functions.\n */\n this.counter = 0;\n /**\n * This empty object is intended to store some SPS specific or temporary values in order to lower the Garbage Collector activity.\n * Please read : http://doc.babylonjs.com/overviews/Solid_Particle_System#garbage-collector-concerns\n */\n this.vars = {};\n this._positions = new Array();\n this._indices = new Array();\n this._normals = new Array();\n this._colors = new Array();\n this._uvs = new Array();\n this._index = 0; // indices index\n this._updatable = true;\n this._pickable = false;\n this._isVisibilityBoxLocked = false;\n this._alwaysVisible = false;\n this._depthSort = false;\n this._shapeCounter = 0;\n this._copy = new BABYLON.SolidParticle(0, 0, 0, null, 0, 0, this);\n this._color = new BABYLON.Color4(0, 0, 0, 0);\n this._computeParticleColor = true;\n this._computeParticleTexture = true;\n this._computeParticleRotation = true;\n this._computeParticleVertex = false;\n this._computeBoundingBox = false;\n this._depthSortParticles = true;\n this._cam_axisZ = BABYLON.Vector3.Zero();\n this._cam_axisY = BABYLON.Vector3.Zero();\n this._cam_axisX = BABYLON.Vector3.Zero();\n this._axisZ = BABYLON.Axis.Z;\n this._camDir = BABYLON.Vector3.Zero();\n this._camInvertedPosition = BABYLON.Vector3.Zero();\n this._rotMatrix = new BABYLON.Matrix();\n this._invertMatrix = new BABYLON.Matrix();\n this._rotated = BABYLON.Vector3.Zero();\n this._quaternion = new BABYLON.Quaternion();\n this._vertex = BABYLON.Vector3.Zero();\n this._normal = BABYLON.Vector3.Zero();\n this._yaw = 0.0;\n this._pitch = 0.0;\n this._roll = 0.0;\n this._halfroll = 0.0;\n this._halfpitch = 0.0;\n this._halfyaw = 0.0;\n this._sinRoll = 0.0;\n this._cosRoll = 0.0;\n this._sinPitch = 0.0;\n this._cosPitch = 0.0;\n this._sinYaw = 0.0;\n this._cosYaw = 0.0;\n this._mustUnrotateFixedNormals = false;\n this._minimum = BABYLON.Tmp.Vector3[0];\n this._maximum = BABYLON.Tmp.Vector3[1];\n this._minBbox = BABYLON.Tmp.Vector3[4];\n this._maxBbox = BABYLON.Tmp.Vector3[5];\n this._particlesIntersect = false;\n this._depthSortFunction = function (p1, p2) {\n return (p2.sqDistance - p1.sqDistance);\n };\n this._needs32Bits = false;\n this._bSphereOnly = false;\n this._bSphereRadiusFactor = 1.0;\n this.name = name;\n this._scene = scene || BABYLON.Engine.LastCreatedScene;\n this._camera = scene.activeCamera;\n this._pickable = options ? options.isPickable : false;\n this._depthSort = options ? options.enableDepthSort : false;\n this._particlesIntersect = options ? options.particleIntersection : false;\n this._bSphereOnly = options ? options.boundingSphereOnly : false;\n this._bSphereRadiusFactor = (options && options.bSphereRadiusFactor) ? options.bSphereRadiusFactor : 1.0;\n if (options && options.updatable) {\n this._updatable = options.updatable;\n }\n else {\n this._updatable = true;\n }\n if (this._pickable) {\n this.pickedParticles = [];\n }\n if (this._depthSort) {\n this.depthSortedParticles = [];\n }\n }", "title": "" }, { "docid": "a5bb391550d059a53428765c3d8d653f", "score": "0.4788663", "text": "function Scale(){\n\tif (!(this instanceof Scale)) return new Scale();\n\t\n\tthis.canvas = document.createElement('canvas');\n\tthis.context = this.canvas.getContext('2d');\n\t\n\tthis.scaled = document.createElement('canvas');\n\tthis.scaledCtx = this.scaled.getContext('2d');\n}", "title": "" }, { "docid": "bedd358ecabc848cf9e6673ab6f5a245", "score": "0.4787721", "text": "constructor()\n { super( \"position\", \"normal\", \"texture_coord\" );\n \n this.arrays.position.push( Vec.of( 0,0,0 ) );\n for( let i = 0; i < 11; i++ )\n {\n const spin = Mat4.rotation( i * 2*Math.PI/10, Vec.of( 0,0,-1 ) );\n\n const radius = i%2 ? 4 : 7;\n const new_point = spin.times( Vec.of( 0,radius,0,1 ) ).to3();\n\n this.arrays.position.push( new_point );\n if( i > 0 )\n this.indices.push( 0, i, i+1 )\n } \n \n this.arrays.normal = this.arrays.position.map( p => Vec.of( 0,0,-1 ) );\n\n // TODO (#5a): Fill in some reasonable texture coordinates for the star:\n // this.arrays.texture_coord = this.arrays.position.map( p => \n }", "title": "" }, { "docid": "11730f6b700f3128009d6dec268d8544", "score": "0.47682783", "text": "function TessellatedSphereGenerator(radius, centerPoint) {\n\tvar constDefaultLongSegmentCount = 20.0;\n\tvar constDefaultLatSegmentCount = 20.0;\n\t\n\tthis.sphereRadius = radius;\n\tthis.centerPoint = centerPoint;\n\tthis.longitudinalSegmentCount = constDefaultLongSegmentCount;\n\tthis.latitudinalSegmentCount = constDefaultLatSegmentCount;\n\tthis.sphereColor = new RgbColor(1.0, 1.0, 1.0, 1.0);\n\t\n\tthis.triangleStore = [];\n}", "title": "" }, { "docid": "c7ea7b45679bab2c5b23515418ca4cca", "score": "0.47626624", "text": "constructFloor(){\r\n var mMatrix = mat4.create();\r\n var negCtr = vec3.create();\r\n var center = [15/2,15/2];\r\n //move the model to the origin\r\n mat4.fromTranslation(mMatrix,vec3.negate(negCtr,center));\r\n mat4.fromScaling(mMatrix,vec3.fromValue(15,15,1));\r\n \r\n \r\n\r\n }", "title": "" }, { "docid": "2ff36631e83c3185ac851169a785e39e", "score": "0.47588253", "text": "constructor(tp_x = 0, tp_y = 0, tp_xv = 0, tp_yv = 0, \n tp_visx = 0, tp_visy = 0, tp_maxv = 6,\n block_length = 10) {\n this.x = tp_x\n this.y = tp_y\n this.visx = tp_visx\n this.visy = tp_visy\n this.xv = tp_xv\n this.yv = tp_yv\n this.maxv = tp_maxv\n this.halflen = block_length/2\n this.length = block_length\n \n this.ydir = 0\n this.xdir = 0\n \n this.up = false\n this.down = false\n this.left = false\n this.right = false\n }", "title": "" }, { "docid": "718b1e149c9789fd4fefcb304eedcbf9", "score": "0.4757666", "text": "constructor(){\n\t\t\tsuper(10, 10);\n\t\t\tthis.vel = new Vec;\n\t\t}", "title": "" }, { "docid": "18e1e097b85d2d3d5ec518e29a9d0260", "score": "0.47571215", "text": "constructor(x,y,w,dist){\r\n this.x = x;\r\n this.y = y;\r\n this.w = w;\r\n this.dist = 0;\r\n }", "title": "" }, { "docid": "21c74c72251bad78a5c4400e1e384ac1", "score": "0.47518447", "text": "normalize() {\n let m = this.mag();\n this.x /= m;\n this.y /= m;\n return this;\n }", "title": "" }, { "docid": "c33b892ecad45a2e58fbb6831ae73eb7", "score": "0.47497743", "text": "getScale() {\n return new Vector(this.radiusX, this.radiusY);\n }", "title": "" }, { "docid": "ff0aa51b9174a6101e62667d03c527c0", "score": "0.4745872", "text": "constructor() {\n super(\"positions\", \"normals\");\n this.positions.push(\n ...Vec.cast([-1, -1, -1], [1, -1, -1], [-1, -1, 1], [1, -1, 1], [1, 1, -1], [-1, 1, -1], [1, 1, 1], [-1, 1, 1],\n [-1, -1, -1], [-1, -1, 1], [-1, 1, -1], [-1, 1, 1], [1, -1, 1], [1, -1, -1], [1, 1, 1], [1, 1, -1],\n [-1, -1, 1], [1, -1, 1], [-1, 1, 1], [1, 1, 1], [1, -1, -1], [-1, -1, -1], [1, 1, -1], [-1, 1, -1]));\n this.normals.push(\n ...Vec.cast([0, -1, 0], [0, -1, 0], [0, -1, 0], [0, -1, 0], [0, 1, 0], [0, 1, 0], [0, 1, 0], [0, 1, 0],\n [-1, 0, 0], [-1, 0, 0], [-1, 0, 0], [-1, 0, 0], [1, 0, 0], [1, 0, 0], [1, 0, 0], [1, 0, 0],\n [0, 0, 1], [0, 0, 1], [0, 0, 1], [0, 0, 1], [0, 0, -1], [0, 0, -1], [0, 0, -1], [0, 0, -1]));\n this.indices.push(0, 1, 2, 1, 3, 2, 4, 5, 6, 5, 7, 6, 8, 9, 10, 9, 11, 10, 12, 13,\n 14, 13, 15, 14, 16, 17, 18, 17, 19, 18, 20, 21, 22, 21, 23, 22);\n }", "title": "" }, { "docid": "6b9fa65a48c102cfa2f5345b53657be3", "score": "0.47408226", "text": "function Sphere(radius, p) {\n var _this = _super.call(this) || this;\n _this.radius = radius;\n _this.p = p;\n return _this;\n }", "title": "" }, { "docid": "5ecb950b9758f3914be9c4c939ace4b3", "score": "0.47397962", "text": "constructor(){\n\t\tthis.pipePosition = 620;\n\t\tthis.active = false;\n\t\tthis.length = (Math.random()*0.6)+0.08;\n\t}", "title": "" }, { "docid": "fdce681453ee5239b638b48a5208d6b6", "score": "0.47286803", "text": "function create(type, constructor) {\n return function scale() {\n var s = constructor();\n\n if (!s.invertRange) {\n s.invertRange = s.invert ? invertRange(s)\n : s.invertExtent ? invertRangeExtent(s)\n : undefined;\n }\n\n s.type = type;\n return s;\n };\n}", "title": "" }, { "docid": "ebec6bef266a206f528e3c78634fdc44", "score": "0.47237983", "text": "function createSphere16(radius, segments) {\r\n\t\treturn new THREE.Mesh(\r\n\t\t\tnew THREE.SphereGeometry(radius, segments, segments),\r\n\t\t\tnew THREE.MeshPhongMaterial({\r\n\t\t\t\tmap: THREE.ImageUtils.loadTexture('images/moonmapfarbig1k.jpg'),\r\n\t\t\t})\r\n\t\t);\r\n\t}", "title": "" }, { "docid": "97a2c8e286d2988d6f012fc65643fbe3", "score": "0.47188014", "text": "constructor(id, source, audioContext, destination) {\n const panner = audioContext.createPanner();\n super(id, source, audioContext, panner);\n this.node.panningModel = \"HRTF\";\n this.node.distanceModel = \"inverse\";\n this.node.coneInnerAngle = 360;\n this.node.coneOuterAngle = 0;\n this.node.coneOuterGain = 0;\n this.node.connect(destination);\n }", "title": "" }, { "docid": "eee0c812fc51620749472781a12f261f", "score": "0.47180516", "text": "sensor(pointA, direction, distance) {\n if (isBlank(distance)) { distance = 100 }\n // let direction = new THREE.Vector3( 10, 0, 0 )\n direction.normalize()\n\n let pointB = new THREE.Vector3()\n pointB.addVectors(pointA, direction.multiplyScalar(distance))\n }", "title": "" }, { "docid": "933520e7ae3e6ddb4642c52f433ce2f7", "score": "0.471746", "text": "getWaveShaperNode() {\n return this.audioCtx.createWaveShaper();\n }", "title": "" }, { "docid": "82b542c19c493a958f417aea67c2a73b", "score": "0.4710098", "text": "function stereoWidener() {\n let f = new Tone.StereoWidener({\n width: 0.5\n })\n\n // f.wet.value = 0\n\n return f\n}", "title": "" }, { "docid": "9e95bfb5976da7a8046ea4aec72d619c", "score": "0.47035414", "text": "function SimpleDistortion(distance, point, magnitude, freq) {\n var _this = _super.call(this) || this;\n _this.distance = distance;\n _this.point = point;\n _this.magnitude = magnitude;\n _this.freq = freq;\n return _this;\n }", "title": "" }, { "docid": "a311f8abd2b3a492813164e43454f5fc", "score": "0.46825156", "text": "function create(type, constructor) {\n return function scale() {\n var s = constructor();\n\n if (!s.invertRange) {\n s.invertRange = s.invert ? (0, _invertRange.default)(s) : s.invertExtent ? (0, _invertRangeExtent.default)(s) : undefined;\n }\n\n s.type = type;\n return s;\n };\n}", "title": "" }, { "docid": "3a7ca7034ff8d949b4153390276d5031", "score": "0.4675086", "text": "get scaling() {\n if (!this.vectors.scaling)\n this.vectors.scaling = new FudgeCore.Vector2(Math.hypot(this.data[0], this.data[1]), Math.hypot(this.data[3], this.data[4]));\n return this.vectors.scaling.copy;\n }", "title": "" }, { "docid": "018d04ca7025330a8c7307a821019ef0", "score": "0.46736202", "text": "static createEmpty(result) {\n if (result) {\n result._clips.length = 0;\n return result;\n }\n return new ClipVector();\n }", "title": "" }, { "docid": "da9458ae6e0c129658f6b22b4dd00678", "score": "0.4669857", "text": "function Sparkle(position, velocity)\r\n{\r\n this.position = new Vector2D(position.x, position.y);\r\n this.velocity = new Vector2D(velocity.x, velocity.y);\r\n}", "title": "" }, { "docid": "4d3315457420ab244967edbc8fe76431", "score": "0.4650228", "text": "function init() {\n //no-op\n if (!this.sphere) {\n this.k0 = Object(__WEBPACK_IMPORTED_MODULE_2__common_msfnz__[\"a\" /* default */])(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts));\n }\n}", "title": "" }, { "docid": "ca9bfc38e6b9693fe0823be81256c24d", "score": "0.46495268", "text": "function _create() {\n\n Myrcia.each(_samples, function(o, i) {\n var obj, range, pos = {};\n if (Myrcia.random(1000) / _interval < o.rate) {\n obj = new o.class();\n range = {\n x: _point.x,\n y: _point.y,\n width: CANVAS_WIDTH,\n height: CANVAS_HEIGHT\n };\n range = obj.range ? obj.range(range) : range;\n\n pos.x = Myrcia.random(range.width) + range.x;\n pos.y = Myrcia.random(range.height) + range.y;\n\n obj.init(pos);\n obj.pos = pos;\n\n _objects.push(obj);\n }\n });\n }", "title": "" }, { "docid": "1ed37aed30753298e1ced1a07c939490", "score": "0.46436578", "text": "getScale() {\n return new Vector(this.sizeX, this.sizeY);\n }", "title": "" }, { "docid": "c6789eb5edc962695acc487f38e0f0ec", "score": "0.46348163", "text": "addWave() {\n this._distFromWaves.forEach(d => {d.push(null);})\n this._angleFromWaves.forEach(d => {d.push(null);})\n }", "title": "" }, { "docid": "5e26317a8eca5208bb1d908138b526ae", "score": "0.46275705", "text": "static createFromAxesAndScales(center, axes, radiusX, radiusY, radiusZ, latitudeSweep, capped) {\n const localToWorld = Transform_1.Transform.createOriginAndMatrix(center, axes);\n localToWorld.matrix.scaleColumnsInPlace(radiusX, radiusY, radiusZ);\n return new Sphere(localToWorld, latitudeSweep ? latitudeSweep.clone() : AngleSweep_1.AngleSweep.createFullLatitude(), capped);\n }", "title": "" }, { "docid": "5e26317a8eca5208bb1d908138b526ae", "score": "0.46275705", "text": "static createFromAxesAndScales(center, axes, radiusX, radiusY, radiusZ, latitudeSweep, capped) {\n const localToWorld = Transform_1.Transform.createOriginAndMatrix(center, axes);\n localToWorld.matrix.scaleColumnsInPlace(radiusX, radiusY, radiusZ);\n return new Sphere(localToWorld, latitudeSweep ? latitudeSweep.clone() : AngleSweep_1.AngleSweep.createFullLatitude(), capped);\n }", "title": "" }, { "docid": "bdd90e23463b8827731e710d8acbf1d1", "score": "0.46265745", "text": "constructor(particle){\n\t\tthis.particle = particle;\n\t\tthis.coords = new Vetor(Array.from(particle.coords.data).fill(0));\n\t}", "title": "" }, { "docid": "dab7aa30b0e95551a8aacdb0e0d294cc", "score": "0.46248627", "text": "constructor(audioContext, destination) {\n super(audioContext, destination);\n this.scene = new ResonanceAudio(audioContext, {\n ambisonicOrder: 1,\n renderingMode: RenderingMode.Bypass\n });\n this.scene.output.connect(this.gain);\n this.scene.setRoomProperties({\n width: 10,\n height: 5,\n depth: 10,\n }, {\n [Direction.Left]: Material.Transparent,\n [Direction.Right]: Material.Transparent,\n [Direction.Front]: Material.Transparent,\n [Direction.Back]: Material.Transparent,\n [Direction.Down]: Material.Grass,\n [Direction.Up]: Material.Transparent,\n });\n Object.seal(this);\n }", "title": "" }, { "docid": "f26bb603113b756a7fab4572bca0804e", "score": "0.46234536", "text": "function createSphere(node) {\n let latitudeBands = 30;\n let longitudeBands = 30;\n let radius = 1;\n let sphereVertexPosition = [];\n var newShpere = [];\n var newShepereNormals = [];\n\n // Calculate sphere vertex positions, normals, and texture coordinates.\n for (let latNumber = 0; latNumber <= latitudeBands; ++latNumber) {\n let theta = latNumber * Math.PI / latitudeBands;\n let sinTheta = Math.sin(theta);\n let cosTheta = Math.cos(theta);\n\n for (let longNumber = 0; longNumber <= longitudeBands; ++longNumber) {\n let phi = longNumber * 2 * Math.PI / longitudeBands;\n let sinPhi = Math.sin(phi);\n let cosPhi = Math.cos(phi);\n\n let x = cosPhi * sinTheta * radius;\n let y = cosTheta * radius;\n let z = sinPhi * sinTheta * radius;\n\n sphereVertexPosition.push(vec4(x, y, z, 1.0));\n }\n }\n\n // Calculate sphere indices.\n for (let latNumber = 0; latNumber < latitudeBands; ++latNumber) {\n for (let longNumber = 0; longNumber < longitudeBands; ++longNumber) {\n let first = (latNumber * (longitudeBands + 1)) + longNumber;\n let second = first + longitudeBands + 1;\n\n newShpere.push(sphereVertexPosition[first]);\n newShpere.push(sphereVertexPosition[second]);\n newShpere.push(sphereVertexPosition[first + 1]);\n\n newShpere.push(sphereVertexPosition[second]);\n newShpere.push(sphereVertexPosition[second + 1]);\n newShpere.push(sphereVertexPosition[first + 1]);\n\n newShepereNormals.push(sphereVertexPosition[first][0], sphereVertexPosition[first][1], sphereVertexPosition[first][2], 0);\n newShepereNormals.push(sphereVertexPosition[second][0], sphereVertexPosition[second][1], sphereVertexPosition[second][2], 0);\n newShepereNormals.push(sphereVertexPosition[first + 1][0], sphereVertexPosition[first + 1][1], sphereVertexPosition[first + 1][2], 0);\n \n newShepereNormals.push(sphereVertexPosition[second][0], sphereVertexPosition[second][1], sphereVertexPosition[second][2], 0);\n newShepereNormals.push(sphereVertexPosition[second + 1][0], sphereVertexPosition[second + 1][1], sphereVertexPosition[second + 1][2], 0);\n newShepereNormals.push(sphereVertexPosition[first + 1][0], sphereVertexPosition[first + 1][1], sphereVertexPosition[first + 1][2], 0);\n }\n }\n\n node.vertices = newShpere;\n node.normals = newShepereNormals;\n node.rotations = [0,0,0];\n}", "title": "" }, { "docid": "fe84f45fce465956b36d4e56e60ebe83", "score": "0.46175918", "text": "constructor(x, y, side_length) {\n this.x = x\n this.y = y\n this.side_length = side_length\n this.vx = Math.floor(Math.random() * 3) + 3\n this.vy = Math.floor(Math.random() * 3) + 3\n this.dir = 1\n }", "title": "" }, { "docid": "d86fbc2dead59f039aea0a777f9c8799", "score": "0.46148786", "text": "function buildSphere(width, height, length, Nu, Nv) {\n width = width/2;\n\n if (this.isSphere) {\n height = width;\n length = width;\n }\n else {\n height = height/2;\n length = length/2;\n }\n\n // if the geometry has to change\n if (this.changeGeometry(width, height, length, Nu, Nv)) {\n return;\n }\n\n this.vertices = [new vec4D(0, 0, height, 1)];\n\n for (i=1; i<Nu; i++) {\n phi = (i*MathPI)/Nu;\n for (j=0; j<Nv; j++) {\n theta = (j*Math2PI)/Nv;\n\n x = width * MathSin(phi) * MathCos(theta);\n y = length * MathSin(phi) * MathSin(theta);\n z = height * MathCos(phi);\n\n this.vertices.push(new vec4D(x, y, z, 1));\n }\n }\n this.vertices.push(new vec4D(0, 0, -height, 1));\n\n this.faces = [];\n // upper part\n for (i=0; i<Nv; i++) {\n this.faces.push([0, ((i+1)%Nv)+1, (i%Nv)+1]);\n }\n\n // center part\n for (i=1; i<Nu-1; i++) {\n for (j=0; j<Nv; j++) {\n this.faces.push([ j+1 +(i-1)*Nv,\n (j+1)%Nv +1 +(i-1)*Nv,\n (j+1)%Nv +1 +i*Nv,\n j+1 +i*Nv\n ]);\n }\n }\n\n // lower part\n for (i=0; i<Nv; i++) {\n this.faces.push([this.vertices.length-1, this.vertices.length-1-Nv +i, this.vertices.length-1-Nv +((i+1)%Nv)]);\n }\n\n this.updateValues(width, height, length, Nu, Nv);\n }", "title": "" }, { "docid": "6e9e58d89c82bd94feb5538868358d7d", "score": "0.46122777", "text": "function createSphere12(radius, segments) {\r\n\t\treturn new THREE.Mesh(\r\n\t\t\tnew THREE.SphereGeometry(radius, segments, segments),\r\n\t\t\tnew THREE.MeshPhongMaterial({\r\n\t\t\t\tmap: THREE.ImageUtils.loadTexture('images/moonmapfarbig1k.jpg'),\r\n\t\t\t})\r\n\t\t);\r\n\t}", "title": "" }, { "docid": "cf86c0df2ea5b401cb4643f77bbdb0eb", "score": "0.46118656", "text": "normalize() {\n const MA = this.getMagnitude();\n this.x = this.x / MA;\n this.y = this.y / MA;\n this.z = this.z / MA;\n this.w = this.w / MA;\n }", "title": "" }, { "docid": "261e413db08cb82c52a4e3fa9407e6b8", "score": "0.46022856", "text": "function createLightSphere() {\n return new ShaderSGNode(createProgram(gl, resources.vs_single, resources.fs_single), [\n new RenderSGNode(makeSphere(.2, 10, 10))\n ]);\n }", "title": "" }, { "docid": "761ba12bab4de53db106b803e880c466", "score": "0.46014798", "text": "createSweepEnv() {\n let sweepEnv = this.audioContext.createGain();\n sweepEnv.gain.cancelScheduledValues(this.audioContext.currentTime);\n sweepEnv.gain.setValueAtTime(0, this.audioContext.currentTime);\n this.sweepEnv = sweepEnv;\n // connect it to this.audioContext.destination\n return sweepEnv;\n }", "title": "" }, { "docid": "47be6ab0870bb66e1b1e8c0af9b8edc6", "score": "0.45964995", "text": "function SemiOpenPipe(length){\n\n\tthis.input = audioCtx.createGain();\n\tthis.output = audioCtx.createGain();\n\n\tthis.length = length;\n\tthis.lengthMultiplierArray = [1, 3, 5, 7];\n\n\tthis.lengthInlet = audioCtx.createGain();\n\n\tthis.filters = {};\n\n\tfor(var i=0; i<4; i++){\n\t\tthis.filters[i] = {filter: audioCtx.createBiquadFilter()};\n\t\tthis.filters[i].filter.type = \"bandpass\";\n\t\tthis.filters[i].filter.frequency.value = this.length*(this.lengthMultiplierArray[i]);\n\t\tthis.filters[i].filter.Q.value = 30;\n\n\t\tthis.filters[i+4] = {inletScaler: audioCtx.createGain()};\n\t\tthis.filters[i+4].inletScaler.gain.value = this.lengthMultiplierArray[i];\n\t\tthis.filters[i+4].inletScaler.connect(this.filters[i].filter.frequency);\n\n\t\tthis.lengthInlet.connect(this.filters[i+4].inletScaler);\n\t\tthis.input.connect(this.filters[i].filter);\n\t\tthis.filters[i].filter.connect(this.output);\n\t}\n\n}", "title": "" }, { "docid": "5f521137f9530950cbbeb888b2ef3647", "score": "0.4595575", "text": "constructor() {_defineProperty(this, \"_pos\", new Vector());_defineProperty(this, \"pos\", new Vector());\n this.randomize();\n }", "title": "" }, { "docid": "1c21adad01fad4d841ad524831098e77", "score": "0.45927536", "text": "constructor(size, height, skew, distance, winddir) {\n this.size = size; //size of map in any direction, in vertex points\n this.height = height; //maximum height of things on the map/altitude\n this.skew = skew; //closeness of the waves to each other/wavelength\n this.distance = distance; //how large the squares/triangles of the map\n //\"real\" map size is size * distance\n this.tau = 2 * Math.PI;\n var array = [];\n var degreeArray = [];\n this.array = array;\n this.degreeArray = degreeArray;\n this.winddir = winddir;\n }", "title": "" }, { "docid": "44d48f5d09c0708220a6ba70a9c48f5f", "score": "0.45909223", "text": "scaleInPlace(scale) { this.x *= scale; this.y *= scale; this.z *= scale; }", "title": "" }, { "docid": "44d48f5d09c0708220a6ba70a9c48f5f", "score": "0.45909223", "text": "scaleInPlace(scale) { this.x *= scale; this.y *= scale; this.z *= scale; }", "title": "" }, { "docid": "de95a5fa468e4368ef2202d65834dfba", "score": "0.45878044", "text": "constructor(shedWidth, shedDepth) {\n\n super();\n\n let self = this;\n let mesh_, time_;\n let grassScale_ = 1;\n\n let textureLoader_ = new THREE.TextureLoader();\n let simplex_ = new SimplexNoise();\n\n const BLADE_SEGS = 2; // # of blade segments\n const BLADE_VERTS = (BLADE_SEGS + 1) * 2; // # of vertices per blade (1 side)\n const BLADE_INDICES = BLADE_SEGS * 12;\n const BLADE_WIDTH = 2.5;\n const BLADE_HEIGHT_MIN = 30;\n const BLADE_HEIGHT_MAX = 50;\n const RADIUS = 2500;\n\n /**\n * Setup options for grass patch\n */\n let opts = {\n lightDir: new THREE.Vector3(0.4242640, 0.5656854, 0.7071067),\n numBlades: 20000,\n radius: RADIUS,\n texture: textureLoader_.load(assets.img[\"grass_t\"]),\n vertScript: assets.shader['grass.vert'],\n fragScript: assets.shader['grass.frag'],\n heightMap: textureLoader_.load(assets.img[\"white\"]),\n heightMapScale: new THREE.Vector3(1, 1, 1),\n fogColor: new THREE.Color(0x646a12),\n fogFar: RADIUS * 20.0,\n grassFogFar: RADIUS * 2,\n grassColor: new THREE.Color(0x646a12),\n transitionLow: 0.31,\n transitionHigh: 0.36,\n windIntensity: 0.5\n };\n\n let buffers = {\n // Tells the shader which vertex of the blade its working on.\n // Rather than supplying positions, they are computed from this vindex.\n vindex: new Float32Array(BLADE_VERTS * 2),\n // Shape properties of all blades\n shape: new Float32Array(4 * opts.numBlades),\n // Positon & rotation of all blades\n offset: new Float32Array(4 * opts.numBlades),\n // Indices for a blade\n index: new Uint16Array(BLADE_INDICES)\n };\n\n this.update = this.setShedSize = ()=> {\n };\n\n let promises = _.map([assets.shader['grass.vert'], assets.shader['grass.frag']], (path)=> {\n return new Promise((done)=> {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', path);\n xhr.onload = ()=> {\n done(xhr.responseText);\n };\n xhr.send();\n });\n });\n\n Promise.all(promises).then((results)=> {\n opts.vertScript = results[0];\n opts.fragScript = results[1];\n\n self.update = update;\n self.setShedSize = setShedSize;\n mesh_ = createMesh();\n self.add(mesh_);\n time_ = Date.now();\n });\n\n Object.defineProperties(this, {\n grassScale: {\n set: (value)=> {\n grassScale_ = value;\n initBladeShapeVerts(buffers.shape, opts.numBlades, buffers.offset);\n mesh_.geometry.addAttribute('shape', new THREE.InstancedBufferAttribute(buffers.shape, 4));\n mesh_.geometry.needsUpdate = true;\n }\n },\n grassCount: {\n set: (value)=> {\n opts.numBlades = value;\n buffers = {\n // Tells the shader which vertex of the blade its working on.\n // Rather than supplying positions, they are computed from this vindex.\n vindex: new Float32Array(BLADE_VERTS * 2),\n // Shape properties of all blades\n shape: new Float32Array(4 * opts.numBlades),\n // Positon & rotation of all blades\n offset: new Float32Array(4 * opts.numBlades),\n // Indices for a blade\n index: new Uint16Array(BLADE_INDICES)\n };\n\n initBladeIndices(buffers.index, 0, BLADE_VERTS, 0);\n initBladeOffsetVerts(buffers.offset, opts.numBlades, opts.radius);\n initBladeShapeVerts(buffers.shape, opts.numBlades, buffers.offset);\n initBladeIndexVerts(buffers.vindex);\n\n const geo = new THREE.InstancedBufferGeometry()\n geo.boundingSphere = new THREE.Sphere(\n new THREE.Vector3(0, 0, 0), Math.sqrt(opts.radius * opts.radius * 2.0) * 10000.0\n );\n geo.addAttribute('vindex', new THREE.BufferAttribute(buffers.vindex, 1));\n geo.addAttribute('shape', new THREE.InstancedBufferAttribute(buffers.shape, 4));\n geo.addAttribute('offset', new THREE.InstancedBufferAttribute(buffers.offset, 4));\n geo.setIndex(new THREE.BufferAttribute(buffers.index, 1));\n\n mesh_.geometry = geo;\n geo.needsUpdate = true;\n }\n }\n });\n\n /**\n * Creates a patch of grass mesh.\n */\n function createMesh() {\n // Buffers to use for instances of blade mesh\n\n initBladeIndices(buffers.index, 0, BLADE_VERTS, 0);\n initBladeOffsetVerts(buffers.offset, opts.numBlades, opts.radius);\n initBladeShapeVerts(buffers.shape, opts.numBlades, buffers.offset);\n initBladeIndexVerts(buffers.vindex);\n\n const geo = new THREE.InstancedBufferGeometry()\n geo.boundingSphere = new THREE.Sphere(\n new THREE.Vector3(0, 0, 0), Math.sqrt(opts.radius * opts.radius * 2.0) * 10000.0\n );\n geo.addAttribute('vindex', new THREE.BufferAttribute(buffers.vindex, 1));\n geo.addAttribute('shape', new THREE.InstancedBufferAttribute(buffers.shape, 4));\n geo.addAttribute('offset', new THREE.InstancedBufferAttribute(buffers.offset, 4));\n geo.setIndex(new THREE.BufferAttribute(buffers.index, 1));\n\n const tex = opts.texture;\n tex.wrapS = tex.wrapT = THREE.RepeatWrapping;\n const htex = opts.heightMap;\n htex.wrapS = htex.wrapT = THREE.RepeatWrapping;\n const hscale = opts.heightMapScale;\n\n const lightDir = opts.lightDir.clone();\n lightDir.z *= 0.5;\n lightDir.normalize();\n\n // Fill in some constants that never change between draw calls\n const vertScript = opts.vertScript.replace(\n '%%BLADE_HEIGHT_TALL%%', (BLADE_HEIGHT_MAX * 1.5).toFixed(1)\n ).replace(\n '%%BLADE_SEGS%%', BLADE_SEGS.toFixed(1)\n ).replace(\n '%%PATCH_SIZE%%', (opts.radius * 2.0).toFixed(1)\n ).replace(\n '%%TRANSITION_LOW%%', opts.transitionLow.toString()\n ).replace(\n '%%TRANSITION_HIGH%%', opts.transitionHigh.toString()\n );\n\n // Setup shader\n const mat = new THREE.RawShaderMaterial({\n uniforms: {\n lightDir: {type: '3f', value: lightDir.toArray()},\n time: {type: 'f', value: 0.0},\n map: {type: 't', value: tex},\n heightMap: {type: 't', value: htex},\n heightMapScale: {type: '3f', value: [hscale.x, hscale.y, hscale.z]},\n camDir: {type: '3f', value: [1.0, 0.0, 0.0]},\n drawPos: {type: '2f', value: [0.0, 0.0]},\n fogColor: {type: '3f', value: opts.fogColor.toArray()},\n fogNear: {type: 'f', value: 1.0},\n fogFar: {type: 'f', value: opts.fogFar},\n grassColor: {type: '3f', value: opts.grassColor.toArray()},\n grassFogFar: {type: 'f', value: opts.grassFogFar},\n windIntensity: {type: 'f', value: opts.windIntensity}\n },\n vertexShader: vertScript,\n fragmentShader: opts.fragScript,\n transparent: true\n });\n const mesh = new THREE.Mesh(geo, mat);\n mesh.frustumCulled = true;\n\n mesh.rotateX(-Math.PI * 0.5);\n return mesh;\n }\n\n /**\n * Sets up indices for single blade mesh.\n * @param id array of indices\n * @param vc1 vertex start offset for front side of blade\n * @param vc2 vertex start offset for back side of blade\n * @param i index offset\n */\n function initBladeIndices(id, vc1, vc2, i) {\n let seg;\n // blade front side\n for (seg = 0; seg < BLADE_SEGS; ++seg) {\n id[i++] = vc1;\n id[i++] = vc1 + 1;\n id[i++] = vc1 + 2;\n id[i++] = vc1 + 2;\n id[i++] = vc1 + 1;\n id[i++] = vc1 + 3;\n vc1 += 2\n }\n // blade back side\n for (seg = 0; seg < BLADE_SEGS; ++seg) {\n id[i++] = vc2 + 2;\n id[i++] = vc2 + 1;\n id[i++] = vc2;\n id[i++] = vc2 + 3;\n id[i++] = vc2 + 1;\n id[i++] = vc2 + 2;\n vc2 += 2\n }\n }\n\n /** Set up shape variations for each blade of grass */\n function initBladeShapeVerts(shape, numBlades, offset) {\n let noise = 0;\n for (let i = 0; i < numBlades; ++i) {\n noise = Math.abs(simplex_.noise2D(offset[i * 4] * 0.03, offset[i * 4 + 1] * 0.03));\n noise = noise * noise * noise;\n noise *= 5.0;\n shape[i * 4] = BLADE_WIDTH * grassScale_ + Math.random() * BLADE_WIDTH * 0.5; // width\n shape[i * 4 + 1] = BLADE_HEIGHT_MIN * grassScale_ + Math.pow(Math.random(), 4.0) * (BLADE_HEIGHT_MAX - BLADE_HEIGHT_MIN) * grassScale_ + // height\n noise;\n shape[i * 4 + 2] = Math.random() * 0.3;// lean\n shape[i * 4 + 3] = 0.05 + Math.random() * 0.3;// curve\n }\n }\n\n function getGrassPosition() {\n let x = 0;\n let y = 0;\n let randomRadius;\n\n let angle = 2 * Math.PI * Math.random();\n\n randomRadius = RADIUS * Math.random();\n x = randomRadius * Math.cos(angle);\n y = randomRadius * Math.sin(angle);\n\n let grassPadding = 20;\n if ((x <= shedWidth * 0.5 + grassPadding && x >= -shedWidth * 0.5 - grassPadding) && (y <= shedDepth * 0.5 + grassPadding && y >= -shedDepth * 0.5 - grassPadding)) {\n x = y = NaN;\n }\n\n return {x: x + RADIUS, y: y + RADIUS};\n }\n\n /** Set up positons & rotation for each blade of grass */\n function initBladeOffsetVerts(offset, numBlades, patchRadius) {\n for (let i = 0; i < numBlades; ++i) {\n let position = getGrassPosition();\n let x = position.x;\n let y = position.y;\n offset[i * 4] = x;//nrand() * patchRadius;\n offset[i * 4 + 1] = y;// nrand() * patchRadius;\n offset[i * 4 + 2] = 0.0;// z\n offset[i * 4 + 3] = Math.PI * 2.0 * Math.random();// rot\n }\n }\n\n /** Set up indices for 1 blade */\n function initBladeIndexVerts(vindex) {\n for (let i = 0; i < vindex.length; ++i) {\n vindex[i] = i\n }\n }\n\n /**\n * Call each frame to animate grass blades.\n */\n function update(camera) {\n let time = (Date.now() - time_) / 1000;\n const mat = mesh_.material;\n mat.uniforms['time'].value = time;\n\n /*let cameraDirection = camera.getWorldDirection();\n let drawPos = new THREE.Vector2(Math.cos(yaw) * opts.radius - opts.radius * 0.5, Math.sin(yaw) * opts.radius);\n\n let p = mat.uniforms['camDir'].value;\n p[0] = cameraDirection.x;\n p[1] = cameraDirection.y;\n p[2] = cameraDirection.z;\n p = mat.uniforms['drawPos'].value;\n p[0] = camera.position.x;\n p[1] = -camera.position.z;*/\n }\n\n function setShedSize(width, depth) {\n shedWidth = width;\n shedDepth = depth;\n\n initBladeOffsetVerts(buffers.offset, opts.numBlades, opts.radius);\n mesh_.geometry.addAttribute('offset', new THREE.InstancedBufferAttribute(buffers.offset, 4));\n mesh_.geometry.needsUpdate = true;\n }\n\n function destroy() {\n mesh_.geometry.dispose();\n mesh_.material.dispose();\n mesh_ = null;\n }\n\n /**\n * Returns random value from -1 to 1\n * @returns Random number in interval [-1; 1]\n */\n function nrand() {\n return Math.random() * 2.0 - 1.0\n }\n }", "title": "" }, { "docid": "2041b940cc5a7b6d11faa55e95cfb92a", "score": "0.45854306", "text": "function create(type, constructor, metadata) {\n const ctr = function scale() {\n const s = constructor();\n\n if (!s.invertRange) {\n s.invertRange = s.invert ? (0, _invertRange.default)(s) : s.invertExtent ? (0, _invertRangeExtent.default)(s) : undefined;\n }\n\n s.type = type;\n return s;\n };\n\n ctr.metadata = (0, _vegaUtil.toSet)((0, _vegaUtil.array)(metadata));\n return ctr;\n}", "title": "" }, { "docid": "286504dfb60da2941563cec4d4ed472e", "score": "0.45853588", "text": "constructor() {\n super();\n\n this.vertices = [];\n this.vertexNormals = [];\n this.indices = [];\n this.textureCoords = [];\n this.vertexColors = [];\n this.velocities = [];\n this.lifetimes = [];\n }", "title": "" }, { "docid": "12336c6400ed304db98c85ef89b9b388", "score": "0.45831835", "text": "function create(type, constructor) {\n return function scale() {\n var s = constructor();\n\n if (!s.invertRange) {\n s.invertRange = s.invert ? Object(_invertRange__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(s)\n : s.invertExtent ? Object(_invertRangeExtent__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(s)\n : undefined;\n }\n\n s.type = type;\n return s;\n };\n}", "title": "" }, { "docid": "06003cb225b1fdd4d50c69a0678adc3b", "score": "0.458119", "text": "function Plant() {\n this.height = 0;\n}", "title": "" }, { "docid": "e1ea87e86d6f418bc008f545a4c4a501", "score": "0.4576611", "text": "constructor(size, height, skew, distance) {\n this.size = size; //size of map in any direction, in vertex points\n this.height = height; //maximum height of things on the map\n this.skew = skew; //the random value applied to each midpoint - higher values result in rougher terrain\n this.distance = distance; //how large the squares/triangles of the map\n var array = [];\n this.array = array;\n //\"real\" map size is size * distance\n }", "title": "" }, { "docid": "454cc60a5a6ae286fcd25528d4d5b129", "score": "0.45760626", "text": "function Spawner(w,h,d,mesh) {\n this.w = w;\n this.h = h;\n this.d = d;\n this.mesh = mesh;\n}", "title": "" }, { "docid": "ef70cf8b197f2b5a03177e1a34385028", "score": "0.45747516", "text": "function Panner( context ) {\n if ( !( this instanceof Panner ) ) {\n throw new TypeError( \"Panner constructor cannot be called as a function.\" );\n }\n // Call superclass constructor\n BaseEffect.call( this, context );\n this.maxSources = 0;\n this.minSources = 0;\n this.effectName = 'Panner';\n\n var panner_;\n var usingNativePanner = typeof this.audioContext.createStereoPanner === 'function';\n\n if ( usingNativePanner ) {\n log.debug( \"using native panner\" );\n panner_ = this.audioContext.createStereoPanner();\n } else {\n log.debug( \"using 3D panner\" );\n panner_ = this.audioContext.createPanner();\n }\n\n this.inputNode = panner_;\n this.outputNode = panner_;\n\n function panMapper( value ) {\n return value / 90.0;\n }\n\n function panPositionSetter( aParams, panValue ) {\n var xDeg = parseInt( panValue );\n var zDeg = xDeg + 90;\n if ( zDeg > 90 ) {\n zDeg = 180 - zDeg;\n }\n var x = Math.sin( xDeg * ( Math.PI / 180 ) );\n var z = Math.sin( zDeg * ( Math.PI / 180 ) );\n panner_.setPosition( x, 0, z );\n }\n\n /**\n * Pans the audio to left or right stereo audio channels using a value in degrees of the angle\n * of the perceived audio source from the center. Positive value implies perceived source\n * being on the right of center. Negative value implies the perceived sources being on the left\n * of the center.\n *\n * @property pan\n * @type SPAudioParam\n * @default 0\n * @minvalue -90\n * @maxvalue 90\n */\n if ( usingNativePanner ) {\n this.registerParameter( new SPAudioParam( this, 'pan', -90, 90, 0, panner_.pan, panMapper ), false );\n } else {\n this.registerParameter( new SPAudioParam( this, 'pan', -90, 90, 0, null, null, panPositionSetter ), false );\n }\n\n this.isInitialized = true;\n\n}", "title": "" }, { "docid": "ef70cf8b197f2b5a03177e1a34385028", "score": "0.45747516", "text": "function Panner( context ) {\n if ( !( this instanceof Panner ) ) {\n throw new TypeError( \"Panner constructor cannot be called as a function.\" );\n }\n // Call superclass constructor\n BaseEffect.call( this, context );\n this.maxSources = 0;\n this.minSources = 0;\n this.effectName = 'Panner';\n\n var panner_;\n var usingNativePanner = typeof this.audioContext.createStereoPanner === 'function';\n\n if ( usingNativePanner ) {\n log.debug( \"using native panner\" );\n panner_ = this.audioContext.createStereoPanner();\n } else {\n log.debug( \"using 3D panner\" );\n panner_ = this.audioContext.createPanner();\n }\n\n this.inputNode = panner_;\n this.outputNode = panner_;\n\n function panMapper( value ) {\n return value / 90.0;\n }\n\n function panPositionSetter( aParams, panValue ) {\n var xDeg = parseInt( panValue );\n var zDeg = xDeg + 90;\n if ( zDeg > 90 ) {\n zDeg = 180 - zDeg;\n }\n var x = Math.sin( xDeg * ( Math.PI / 180 ) );\n var z = Math.sin( zDeg * ( Math.PI / 180 ) );\n panner_.setPosition( x, 0, z );\n }\n\n /**\n * Pans the audio to left or right stereo audio channels using a value in degrees of the angle\n * of the perceived audio source from the center. Positive value implies perceived source\n * being on the right of center. Negative value implies the perceived sources being on the left\n * of the center.\n *\n * @property pan\n * @type SPAudioParam\n * @default 0\n * @minvalue -90\n * @maxvalue 90\n */\n if ( usingNativePanner ) {\n this.registerParameter( new SPAudioParam( this, 'pan', -90, 90, 0, panner_.pan, panMapper ), false );\n } else {\n this.registerParameter( new SPAudioParam( this, 'pan', -90, 90, 0, null, null, panPositionSetter ), false );\n }\n\n this.isInitialized = true;\n\n}", "title": "" }, { "docid": "00c00ddc37f3d492c44fdfada5efb5ae", "score": "0.45734677", "text": "function Pared(size,x=0,y=0){\n THREE.Object3D.call(this,x,y);\n this.add(new THREE.Mesh(new THREE.BoxGeometry(size,size,size),\n new THREE.MeshNormalMaterial()));\n this.size =size;\n this.position.x =x;\n this.position.y =y;\n \n}", "title": "" }, { "docid": "b8f08b82b73cc662933451dd93cc21d0", "score": "0.45693833", "text": "constructor() {\r\n\t\tsuper(1, 0, 0, 0, 1, 0, 0, 0, 1);\r\n\t}", "title": "" }, { "docid": "95a0c6a00f6312744b5cd856d86474b5", "score": "0.45623967", "text": "constructor(w, h) {\n\t\tthis.pos = new Vec;\n\t\tthis.size = new Vec(w, h);\n\t}", "title": "" } ]
5c1bd47b4dca6746510fe5c22c9eb98d
Remove a gamepad upon disconnection
[ { "docid": "c471ce8ad70674f55b352ba608489e10", "score": "0.6699082", "text": "function Disconnect(e) {\n let gamepad = e.gamepad;\n let pad = controllers.get(gamepad.index);\n\n controllers.delete(gamepad.index);\n\n let ev = {\n type: EVENT_PAD_DISCONNECTED,\n pad\n };\n\n controllerSubject.notify(ev);\n}", "title": "" } ]
[ { "docid": "24ce0245331d4cde552182b9c204de1d", "score": "0.70375085", "text": "function removeGame() {\n\t//todo: add formal message telling client other player disconnected\n\tsocket.emit('delete game', gameID);\n\tclient.fleet = ['temp2', 'temp3', 'temp4', 'temp5'];\n\tenemyFleet = new Array(4);\n\tclient.clearGrids();\n\tsocket.off(gameID + ' player disconnect');\t\n\tgameID = -1;\n\tprepWindow = -1;\n\tpositionWindow = -1;\n\tplayWindow = -1;\n}", "title": "" }, { "docid": "9284dfb91b4a05bc8486d8e9f2c19f2e", "score": "0.67233515", "text": "function removeGameOverScreen() {\n gameOverScreen.remove();\n}", "title": "" }, { "docid": "58aa76ab6d8b4ca51b924b8e50eedcd3", "score": "0.67215455", "text": "function endGameControls(){\n window.removeEventListener(\"keydown\",startGameControls);\n endGame=false;\n}", "title": "" }, { "docid": "23a5ffb7027f8164a507010e34ee3c9f", "score": "0.6621949", "text": "remove() {\n this._input.destroy();\n \n // Stop showing the board\n this._board.remove();\n \n Events.off(DrawTimer.EVENT_TYPES.DRAW, this);\n if (this._butBackToHome) this._butBackToHome.remove();\n if (this._butSubmit) this._butSubmit.remove();\n }", "title": "" }, { "docid": "73040e844c3ba06cc628bdd5fad8e917", "score": "0.65282685", "text": "removePauseScreen() {\n\t\tgameState.pauseOverlay.destroy();\n\t\tgameState.pauseText.destroy();\n\t\tgameState.resumeText.destroy();\n\t}", "title": "" }, { "docid": "f2317f683e507205dddbf48eb106ec19", "score": "0.6490969", "text": "arcsRemoteDisconnected () {\n console.debug('[ArcGamepadControls] disconnected')\n window.removeEventListener('stickmove', this.onJoystickMove)\n window.removeEventListener('devicebump', this.onDeviceBump)\n\n this.enabled = false\n }", "title": "" }, { "docid": "9f86c73618eea34edd8954c9f8943bc9", "score": "0.64044356", "text": "destroy() {\n clearInterval(this._clockId);\n clearInterval(this._checkGameFocusIntervalId);\n\n document.getElementById(\"gameContainer\").removeEventListener(\"click\", this._abstractMakeMove);\n }", "title": "" }, { "docid": "06062d095f2deceec8c1f9aad773989b", "score": "0.6382707", "text": "function remove()\n{\n // Stop any timers to prevent CPU usage\n // Remove any preferences as needed\n widget.setPreferenceForKey(null, createInstancePreferenceKey(\"clocker\"));\n\twidget.setPreferenceForKey(null, createInstancePreferenceKey(\"username\"));\n\twidget.setPreferenceForKey(null, createInstancePreferenceKey(\"password\"));\n\twidget.setPreferenceForKey(null, createInstancePreferenceKey(\"whmcsurl\"));\n\twidget.setPreferenceForKey(null, createInstancePreferenceKey(\"Notes\"));\n\twidget.setPreferenceForKey(null, createInstancePreferenceKey(\"myClients\"));\n stopDisplayUpdateTimer();\n}", "title": "" }, { "docid": "4e6263fc79f5313eb06d19a33bf57da7", "score": "0.63208485", "text": "function remove()\n{\n // Stop any timers to prevent CPU usage\n // Remove any preferences as needed\n // widget.setPreferenceForKey(null, dashcode.createInstancePreferenceKey(\"your-key\"));\n}", "title": "" }, { "docid": "4e6263fc79f5313eb06d19a33bf57da7", "score": "0.63208485", "text": "function remove()\n{\n // Stop any timers to prevent CPU usage\n // Remove any preferences as needed\n // widget.setPreferenceForKey(null, dashcode.createInstancePreferenceKey(\"your-key\"));\n}", "title": "" }, { "docid": "4e6263fc79f5313eb06d19a33bf57da7", "score": "0.63208485", "text": "function remove()\n{\n // Stop any timers to prevent CPU usage\n // Remove any preferences as needed\n // widget.setPreferenceForKey(null, dashcode.createInstancePreferenceKey(\"your-key\"));\n}", "title": "" }, { "docid": "4e6263fc79f5313eb06d19a33bf57da7", "score": "0.63208485", "text": "function remove()\n{\n // Stop any timers to prevent CPU usage\n // Remove any preferences as needed\n // widget.setPreferenceForKey(null, dashcode.createInstancePreferenceKey(\"your-key\"));\n}", "title": "" }, { "docid": "4e6263fc79f5313eb06d19a33bf57da7", "score": "0.63208485", "text": "function remove()\n{\n // Stop any timers to prevent CPU usage\n // Remove any preferences as needed\n // widget.setPreferenceForKey(null, dashcode.createInstancePreferenceKey(\"your-key\"));\n}", "title": "" }, { "docid": "8e7cfda199eb324c212fed1d23c66a31", "score": "0.63025045", "text": "function endGame(){\n win.clearInterval(timer)\n console.log('GAME OVER!');\n turnCount = 1;\n button.detach();\n}", "title": "" }, { "docid": "366d109dac0fcfd0ef9fb3123a309580", "score": "0.62854815", "text": "function remove()\n{\n\t// Stop any timers to prevent CPU usage\n\t// Remove any preferences as needed\n\t// widget.setPreferenceForKey(null, dashcode.createInstancePreferenceKey(\"your-key\"));\n\terasePrefs();\n}", "title": "" }, { "docid": "366d109dac0fcfd0ef9fb3123a309580", "score": "0.62854815", "text": "function remove()\n{\n\t// Stop any timers to prevent CPU usage\n\t// Remove any preferences as needed\n\t// widget.setPreferenceForKey(null, dashcode.createInstancePreferenceKey(\"your-key\"));\n\terasePrefs();\n}", "title": "" }, { "docid": "a53c1e2945494560b89205266ad56052", "score": "0.62726617", "text": "onExit(){\n this.remove();\n console.log(this.namespace + \" Exit\")\n // this.music.pause();\n // this.remove();\n // this.style.display=\"none\";\n // this.world.removeEventListener(\"gameover\", this.onGameOver, false);\n // console.warn(this.namespace + \" Ended\");\n // this.onReset();\n // this.music.pause();\n }", "title": "" }, { "docid": "f5c141cf0040d75bc6c78aa9e733a555", "score": "0.62573165", "text": "function nickSelected(){\n window.removeEventListener(\"keydown\", handleKeys);\n document.getElementById(\"play\").addEventListener(\"click\", playClick);\n}", "title": "" }, { "docid": "a4a27ea6f24124088742c50240d515df", "score": "0.6244377", "text": "kill() {\n\t\t//be careful if double killed then don't try and remove again\n\t\tif (!this.dead)\n\t\t{\n\t\t\tthis.dead = true;\n\t\t\tthis.screen.removeChild(this.container);\n\t\t}\n }", "title": "" }, { "docid": "49c1ca20e4685f706bb9087e1f50e14b", "score": "0.62381655", "text": "disconnect() {\n this.socket.broadcast.emit('player:disconnected', this.socket.id);\n Game.players.splice(\n Game.players.indexOf(this),\n 1\n );\n this.cleanup();\n // console.log(`${this.id} disconnected.`);\n }", "title": "" }, { "docid": "3e579f6305ef954cf9e05231693d176e", "score": "0.61999875", "text": "stop () {\n this.stopped = true;\n this.gamepad.clear();\n this.gamebox.pause( true );\n }", "title": "" }, { "docid": "259e2b8affd62978954dfc6f3199687a", "score": "0.6190679", "text": "function clearScreen() {\n document.querySelector('.phone').removeChild(document.querySelector('.screen'));\n}", "title": "" }, { "docid": "92139814a516476aab5d429195908eb5", "score": "0.6166877", "text": "function wrongPadClicked(){\n $('.pad').unbind(); //clicking on pads has no effect\n if (strictMode) { //checks if strict mode is on\n infoscreen.text('Game Over'); //if yes, display 'game over' info\n levelscreen.text('Level: ...');\n currentLevel = 1; //set current level to 1\n gameplayStarted = false; //set gameplay status to false\n loseSound.play(); //plays 'lose' sound\n changeLedColor('#startStopLed', 'ledGreen', 'ledRed'); //led light next to 'Start/Stop' buton becomes red\n }\n else if (!strictMode) { //if strict mode is off\n infoscreen.text('Wrong pad!'); //displays info 'wrong pad'\n errorSound.play(); //plays 'error' sound \n timersIds.push(setTimeout(function () { cpuTurn(); }, 1200)); //it's time for cpu turn\n }\n }", "title": "" }, { "docid": "1d59bf2fc0f11dc7d7442e3b92fbe567", "score": "0.6149347", "text": "function remove(){\n stickMan.remove();\n platforms.remove();\n friend.remove();\n }", "title": "" }, { "docid": "1921b0fe43dbbee8981779758647280d", "score": "0.6142851", "text": "function endGame() {\n movePawn1Button.remove();\n movePawn2Button.remove();\n placeWall1Button.remove()\n placeWall2Button.remove();\n restartButton.remove();\n clear();\n gameStatus = 'end';\n createPlayAgainButton();\n}", "title": "" }, { "docid": "39a65c5412e93a1dda3fa068b7407c74", "score": "0.6133675", "text": "remove() {\n this.world.removeChild(this.sprite);\n Game.ticker.off('update', this.updateSprite);\n this.cleanup();\n delete Game.players[Game.socket.id];\n }", "title": "" }, { "docid": "cc159eb1df44f1800416712c4c128a22", "score": "0.61277795", "text": "destroyGameScreen(){\n\n\t}", "title": "" }, { "docid": "745ca109cf00ae286a5b8fb64dce4891", "score": "0.6115147", "text": "die () {\n game.removeChild(this);\n }", "title": "" }, { "docid": "daf3f9f396fc1de33a639ecb941da70a", "score": "0.61138886", "text": "removeAI() {\n this.screen.removePlayfield(this.currentAIPlayfield)\n this.game.inputDelegator.removeInput(this.currentAIInput)\n }", "title": "" }, { "docid": "8609c9b121b25c85de9b3c2ddfb850b2", "score": "0.6107907", "text": "clearGame() {\n this.timer.stopTimer();\n this.timer.setTimerToZero();\n }", "title": "" }, { "docid": "0d0b1301d9f3d2c809a4f8a59f3bbe95", "score": "0.61069405", "text": "function cleanscreen() {\n var deviceready = document.getElementById(\"deviceready\"); // Get the <ul> element to insert a new node\n var gamearea = document.createElement('div');\n gamearea.id = \"gamearea\"\n var id_app = deviceready.parentElement\n id_app.id = \"id_app\"\n id_app.insertBefore(gamearea, deviceready);\n id_app.removeChild(deviceready)\n id_app.style.background = \"url()\";\n id_app.style.top = \"0\";\n id_app.style.left = \"0\";\n id_app.style.width = bgwidth + \"px\";\n id_app.style.height = bgheight + \"px\";\n id_app.style.overflow = \"hidden\";\n id_app.style.margin = \"0\";\n id_app.style.padding = \"0\";\n }", "title": "" }, { "docid": "d3eb2c6f28c7dd0d06eef5dd35ad940b", "score": "0.6088498", "text": "function removePlayer (player) {\n if (player.getSide() == PongClient.SIDE_LEFT) {\n leftPlayer = null;\n court.hideLeftPaddle();\n } else if (player.getSide() == PongClient.SIDE_RIGHT) {\n rightPlayer = null;\n court.hideRightPaddle();\n }\n}", "title": "" }, { "docid": "cba78fed326c54b65dd9169c551e4e05", "score": "0.60611504", "text": "function remove()\n{\n\tset_preference('time', null);\n\tset_preference('routes', null);\n\tset_preference('stop_code', null);\n\t\n\tstop_timer();\n}", "title": "" }, { "docid": "597daa821dd7b1f3afc44b113b87f03e", "score": "0.60400754", "text": "disconnectedCallback () {\n this._button.removeEventListener('click', this._playTunes)\n }", "title": "" }, { "docid": "20c1b8e6ba6b28a42c9a69d7341fc161", "score": "0.6024771", "text": "function unpause() {\n if (game.paused) {\n // Unpause the game\n game.paused = false;\n blur('remove', dragon, player, clouds, stars);\n }\n}", "title": "" }, { "docid": "85202879b4b086ddf416364f5842b529", "score": "0.6022688", "text": "function resetDisplayAfterWin() {\n $(\".keyboard-container\").removeClass(\"hide\");\n $(\"#game-win\").addClass(\"hide\");\n }", "title": "" }, { "docid": "1e375fb13b5334df584cadb2c79ea0a1", "score": "0.600881", "text": "function onReleaseGamepad(button) {\n if (padMap[button] === \"button_a\") {\n simulator.gamepad.button_a = false;\n } else if (padMap[button] === \"button_b\") {\n simulator.gamepad.button_b = false;\n } else if (padMap[button] === \"button_x\") {\n simulator.gamepad.button_x = false;\n } else if (padMap[button] === \"button_y\") {\n simulator.gamepad.button_y = false;\n } else if (padMap[button] === \"l_bumper\") {\n simulator.gamepad.l_bumper = false;\n } else if (padMap[button] === \"r_bumper\") {\n simulator.gamepad.r_bumper = false;\n } else if (padMap[button] === \"l_trigger\") {\n simulator.gamepad.l_trigger = false;\n } else if (padMap[button] === \"r_trigger\") {\n simulator.gamepad.r_trigger = false;\n } else if (padMap[button] === \"button_back\") {\n simulator.gamepad.button_back = false;\n } else if (padMap[button] === \"button_start\") {\n simulator.gamepad.button_start = false;\n } else if (padMap[button] === \"l_stick\") {\n simulator.gamepad.l_stick = false;\n } else if (padMap[button] === \"r_stick\") {\n simulator.gamepad.r_stick = false;\n } else if (padMap[button] === \"dpad_up\") {\n simulator.gamepad.dpad_up = false;\n } else if (padMap[button] === \"dpad_down\") {\n simulator.gamepad.dpad_down = false;\n } else if (padMap[button] === \"dpad_left\") {\n simulator.gamepad.dpad_left = false;\n } else if (padMap[button] === \"dpad_right\") {\n simulator.gamepad.dpad_right = false;\n }\n}", "title": "" }, { "docid": "12ad1baad9cb2f9580d9d54560d92b58", "score": "0.60067916", "text": "function remove() {\n hammerObj.off(\"touch drag swipe pinch rotate transform release\", touchHandler);\n hammerObj.off(\"mousewheel\", mousewheelHandler);\n hammerObj.enable(false);\n canvasParent.removeChild(canvasShow);\n }", "title": "" }, { "docid": "f3ba7de0ecbc8cc5d8e617ada2eef6b5", "score": "0.6005324", "text": "function removeGameCanvas(){\n\t stage.autoClear = true;\n\t stage.removeAllChildren();\n\t stage.update();\n\t createjs.Ticker.removeEventListener(\"tick\", tick);\n\t createjs.Ticker.removeEventListener(\"tick\", stage);\n }", "title": "" }, { "docid": "cabc07aa1122e12fd01bcd1d7ff6d144", "score": "0.60039854", "text": "function clearGameField() {\n getCardBoard().style.display = 'none';\n clearBoard();\n setTimer(STOP_TIMER);\n scoreText.innerText = '0';\n document.getElementsByClassName('details')[0].style.display = 'none';\n getById('game-stats-popup').style.display = 'none';\n getById('player-name').style.pointerEvents = 'all';\n}", "title": "" }, { "docid": "222e443256da8ceea8583f7bfaff14f9", "score": "0.5995693", "text": "wipe(gameID) {\r\n this.state.delete(gameID);\r\n this.metadata.delete(gameID);\r\n }", "title": "" }, { "docid": "dd1c28d3c3c9ed5f93bd76946f35bc8f", "score": "0.5989609", "text": "function stopGame(){\n\ttoggleGameTimer(false);\n\tgameData.rollInterval = null;\n\ttoggleGameTimer(false);\n\tresetBoard();\n}", "title": "" }, { "docid": "3fdf86bd558d68ca8adbd903b3b80875", "score": "0.59885615", "text": "function stopGame() {\n id(\"bug-container\").innerHTML = \"\";\n clearInterval(gameTimerId);\n clearInterval(spawnTimerId);\n }", "title": "" }, { "docid": "e9a2521048b7bcc42220e240c88bb900", "score": "0.5984639", "text": "function Unregister(p : NetworkPlayer)\n{\n\t// Tell everyone, including ourselves, that the client left. We don't need to\n\t// buffer this because when the client disconnected, we removed all its RPC\n\t// buffer entries. New players that come in later will never know that this\n\t// player existed.\n\tnetworkView.RPC(\"OnPlayerUnregistered\", RPCMode.All, p.ToString());\n}", "title": "" }, { "docid": "7de624c07e64a94bf31f2ccf504e4750", "score": "0.59706205", "text": "function removeGameHolderAudio() {\n\t $('#game-intro-audio').remove();\n\t}", "title": "" }, { "docid": "ac83dfb522852b2e4ed399a888891678", "score": "0.5967198", "text": "function removePlayer(){\n document.getElementById(\"player\").style.display= \"none\";\n document.getElementById(\"playerFill\").style.display = \"none\";\n pauseAudio();\n}", "title": "" }, { "docid": "e2f587126de20fc94bce046b0c993fbc", "score": "0.59577614", "text": "function stayPlay(){ \n // Turn off the hit and stay buttons\n hitHand.removeEventListener('click', hitPlay);\n stayHand.removeEventListener('click',stayPlay);\n // Function that checks if dealer should hit or stay\n updateDlrHnd();\n // Function that checks who wins the game\n checkWinner();\n}", "title": "" }, { "docid": "1cc808531b5268b304d8457115eba606", "score": "0.59553325", "text": "removePlayer(player){\n let idx = this.players.indexOf(player);\n if(idx !== -1){\n this.players.splice(idx, 1);\n if(!this.host && this.players.length < 2 && this.inProgress){\n this.end();\n } else if(this.round && (player === this.round.drawer)) {\n this.round.end();\n this.nextRound();\n }\n this.broadcast(REMOVE_PLAYER, player.user, player);\n }\n }", "title": "" }, { "docid": "b2c5cc5554d54f34646692600f282f2a", "score": "0.59542", "text": "function reset() {\n let roomName = clientRooms[client.id];\n if (clients[roomName].players.length === 2) {\n if (clients[roomName].players[0].id === client.id) {\n io.to(clients[roomName].players[1].id).emit(\"teammateDisconnected\");\n } else {\n io.to(clients[roomName].players[0].id).emit(\"teammateDisconnected\");\n }\n for (var i = 0; i < clients[roomName].players.length; i++) {\n if (clients[roomName].players[i].id === client.id) {\n flag = i;\n } else {\n if (!clients[roomName].players[i].host) {\n clients[roomName].players[i].host = true;\n }\n }\n }\n clients[roomName].players.splice(flag, 1);\n } else {\n delete clients[roomName];\n }\n delete clientRooms[client.id];\n }", "title": "" }, { "docid": "fe93df2e7d6c5768eb3db71eadac5ef1", "score": "0.5953404", "text": "function gameOver(){\n ButtonContainer.style.display=\"block\";\n clearInterval(enemySpawningVar);\n clearInterval(enemyMovingVar);\n var deadAudio = new Audio('dead.wav');\n deadAudio.play();\n for (var i = 0; i <enemyArray.length; i++) {\n enemyArray[i].remove();\n }\n}", "title": "" }, { "docid": "26269993b2d8bed5d147b50e0eb93b7f", "score": "0.5946536", "text": "function clearGame() {\n\t$('.game-row').remove();\n\t$('.play-buttons').css('display','block');\n\t$('.game-data').css('display','none');\n\t$('.reset').css('display','none');\n\tresetImages();\n\tresetData();\n}", "title": "" }, { "docid": "26f101b71837a7536935686a5c97ab5c", "score": "0.59337676", "text": "function removeGameCanvas() {\n stage.autoClear = true;\n stage.removeAllChildren();\n stage.update();\n createjs.Ticker.removeEventListener(\"tick\", tick);\n createjs.Ticker.removeEventListener(\"tick\", stage);\n}", "title": "" }, { "docid": "fd1bbe4054a325ed089e64a1c6668580", "score": "0.5933569", "text": "function dontAllowPlay() {\n document.removeEventListener('keyup', movePacman);\n ghosts.forEach((ghost) => clearInterval(ghost.timerId));\n }", "title": "" }, { "docid": "916304e9531cc7c8232eb5cf06d4409b", "score": "0.59318984", "text": "function RemoveUpgrade(){\n\tplayer.upgraded = false;\n\tplayer.sprite =Sprite(currentActivePlayer);\n}", "title": "" }, { "docid": "d00adb37bd138e22d0e8247ff238a382", "score": "0.59308934", "text": "function setGameOver() {\n if (!gameOver) return;\n window.removeEventListener(\"keydown\", movePacman);\n ghosts.forEach(the_ghost => clearInterval(the_ghost.timerID));\n alert('game over')\n}", "title": "" }, { "docid": "d4d8770469419432a5ed1a4a59910099", "score": "0.5924033", "text": "function clearBoard() {\n\t\t$('.square').removeClass('Xplayed');\n\t\t$('.square').removeClass('Oplayed');\n\t\t$('.square').removeClass('played');\n\n\t\t$('.square').data(\"played\", false);\n\t\t$('.square').data(\"player\", \"\");\n\t}", "title": "" }, { "docid": "2a8797b3891529392ce283f59bd7c2a5", "score": "0.5911788", "text": "removeJoystick() {\n this.active = false;\n\n this.imageGroup.forEach((sprite) => {\n sprite.visible = false;\n });\n\n this.cursors = {\n up: false,\n down: false,\n left: false,\n right: false\n };\n }", "title": "" }, { "docid": "7c9112121a4acc1d4891a0e9442a425e", "score": "0.59101915", "text": "function RemoveScreens(){\r\n\tfor(var obj in nonGamePlayScreens){\r\n world.removeChild(nonGamePlayScreens[obj]);\r\n\t}\r\n}", "title": "" }, { "docid": "fffd93d011c61e1c4719b93b0a1f87a7", "score": "0.5908789", "text": "function disconnected() {\n leftGame();\n clearTimeout(connectimeout);\n $('#disconnected').style.display = \"block\";\n $('#connecting').style.display = \"none\";\n // $('#status').src = \"https://img.shields.io/badge/Connection%20Status-Disconnected-yellow.svg?style=flat-square\";\n // $('#reconnect').removeAttribute('disabled'); // Enables the reconnect button?\n}", "title": "" }, { "docid": "ba5a6ffcac0642cbc6b475d51caaab36", "score": "0.5905399", "text": "function endGame(){\n let scaryFace = document.getElementById('gameOver');\n if(scaryFace.style.display === 'none'){\n scaryFace.removeAttribute('style', 'display:none');\n }\n}", "title": "" }, { "docid": "c554f055e7769c31bea7387b34f218ec", "score": "0.58984053", "text": "function disconnect() {\n //disconnects from the room\n room.disconnect();\n // removes the entire div of the meet\n video_element.innerHTML = '';\n connected = false;\n // switches the function of button from leaving meet to joining\n connect_room_btn.innerHTML = 'Join Meeting';\n}", "title": "" }, { "docid": "bb03201c769ae24af3c0289487d17b42", "score": "0.5890192", "text": "leaveGame() {\n this.SHOWGAME_CONTAINER.show();\n this.CREATEGAME_CONTAINER.hide();\n\n this.BOARD_GRID.attr('class', 'board');\n this.BOARD_GRID.children().each((i, ele) => $(ele).remove());\n\n $('.info-player-icon', this.INFOPLAYER_CONTAINER).attr('class', 'info-player-icon');\n $('.info-player-icon', this.INFOPLAYER_CONTAINER).text('');\n }", "title": "" }, { "docid": "c787a5828d8d4d937b63fde5c671b461", "score": "0.5886859", "text": "disconnectedCallback() {\n this.removeEventListener('keydown', this._onKeyDown);\n this.removeEventListener('click', this._onClick);\n }", "title": "" }, { "docid": "c6df79b469db5d328951d0e3a0586222", "score": "0.5885232", "text": "remove () {\n if (this.wrap && this.parent) {\n return !!this.parent.removeChild(this.wrap)\n }\n\n return !!console.log('Has not found \"Keypad\" that needed to be removed.')\n }", "title": "" }, { "docid": "4c94a552d0ef3fba042848356f74a291", "score": "0.58812326", "text": "function handlePlayAgain() {\n selectedCard = '';\n selectedCardsWrapper.innerHTML = '';\n cardsWrapper.innerHTML = '';\n cards = [];\n btnWrapper.removeChild(document.getElementById('play-again'));\n startGame();\n}", "title": "" }, { "docid": "ba637cb9049ff70b470a4f1dff885b49", "score": "0.587312", "text": "function detachPlayer() {\n //console.log('detachPlayer');\n playerAttached = false;\n // this is an internal player method to add class to an element\n rmp.fw.addClass(rmpContainer, 'rmp-detach');\n rmp.setPlayerSize(detachedWidth, detachedHeight);\n }", "title": "" }, { "docid": "b22d2db44729b639ec7c4069854c953c", "score": "0.5872499", "text": "function cleanup() { \r\ntablet.removeButton(button);\r\n}", "title": "" }, { "docid": "2e0b04556db0c9affcaccef98eb2f6b7", "score": "0.5872295", "text": "shutDown() {\n this.game.input.keyboard.removeKey(Phaser.Keyboard.SPACEBAR);\n this.bird.destroy();\n this.pipes.destroy();\n this.scoreboard.destroy();\n }", "title": "" }, { "docid": "8fdf134618f0a02d582d1dda3338fb7a", "score": "0.5869809", "text": "removeDevice () {\n if (this.core) this.core.removeDevice()\n }", "title": "" }, { "docid": "e9e2cbcb8ba42a105f3e73095b1ca8f3", "score": "0.586594", "text": "function unload() {\n room.leave();\n connection.disconnect();\n}", "title": "" }, { "docid": "5bf020ad49458e9ca4ade2312df8e7a5", "score": "0.58626467", "text": "function endGame(){\r\n\tclearInterval(downloadTimer);\r\n\tdocument.getElementById(\"endgame\").style.display = \"block\";\r\n\tdocument.getElementById(\"restart\").style.display = \"block\";\r\n\tcontrolAnimation = false;\r\n document.removeEventListener(\"keydown\", keyDown, false);\r\n} // endGame()", "title": "" }, { "docid": "7a64a23499dfe4efc4d3032d74dfcac1", "score": "0.58623683", "text": "function resetGame(){\n\tremotePlayers = [];\n\tsocket.emit(\"disconnect\");\n\t//window.location.reload();\n}", "title": "" }, { "docid": "db14884cfbf4b03eb5e535fc8558f933", "score": "0.5858354", "text": "function playAgain(){\n document.querySelector('button').setAttribute('id', 'button-hide'); //remove play again button\n resetSelectionState();\n resetGameBoardState();\n addElementListener(document.getElementsByTagName('div')); //reapply board event listeners\n addElementListener(document.getElementsByTagName('button')); //apply replay button event listener\n\n var gameBoard = document.getElementById('game-board'); //remove game board\n gameBoard.removeAttribute('id');\n gameBoard.setAttribute('id', 'board-hide');\n\n isGameOver = false;\n}", "title": "" }, { "docid": "4239aaca5089af864def79d8ae4b1dc8", "score": "0.5858162", "text": "function endgame() {\n count = clearInterval(count);\n document.querySelector(\"#shell\").style.display = \"none\";\n document.querySelector(\"[data-end]\").classList.remove(\"hide\");\n\n}", "title": "" }, { "docid": "8150485afa6cbc683ab10eec62aa4fe2", "score": "0.585641", "text": "function stopGame(){\n clearTimeout(timer);\n context.clearRect(0,0,canvas.width, canvas.height);\n }", "title": "" }, { "docid": "09c79f249631155e78b7ccf93847ffda", "score": "0.5854296", "text": "function onGamepadDisconnected( evt ) {\n gamepads = getGamepadsPrefix();\n Y.log( 'Gamepad disconnected from index ' + evt.gamepad.index + ' ' + evt.gamepad.id, 'info', NAME );\n }", "title": "" }, { "docid": "2360678344bccb8cd432277a63f9a32e", "score": "0.58537", "text": "hideNewGameBtn() {\n\t\tthis._stage.removeChild(this._btnNewGame);\n\t}", "title": "" }, { "docid": "22475940264cdd6223382b8985298271", "score": "0.5851259", "text": "function resetGame() {\n $('#nav').remove()\n $('#game').empty()\n $('#sidebar').empty()\n}", "title": "" }, { "docid": "f39cd5b3ff3930623a82470789c58869", "score": "0.58430266", "text": "function OnkeyDown(event){\n var activeObject = PlayerConstructor.getActiveObject();\n if (event.keyCode === 46) {\n \tPlayerConstructor.remove(activeObject);\n }\n}", "title": "" }, { "docid": "aa38fdcdc71354a4a0a1bd1e21b53348", "score": "0.58365256", "text": "function removeGameHolder() {\n\t $('.game-holder-video-container').delay(1000).fadeOut(1000, function () {\n\t $('.game-holder-video-container').remove();\n\t });\n\t}", "title": "" }, { "docid": "5055cffc4fcfd31a1c80010b20397810", "score": "0.5836014", "text": "unwatch() {\n this.game.stop();\n return TA.NIL_GAME;\n }", "title": "" }, { "docid": "744f7c6d23d4d404dc63ed80de858995", "score": "0.58348376", "text": "endGame() {\n this.end = true\n\n clearInterval(this.counter)\n Data.delete(`gameID_${this.id}`)\n }", "title": "" }, { "docid": "a24e33c22ca7cadf24478591721bf92e", "score": "0.58299553", "text": "function stopMatch() {\n var room = this.socket.currGame\n if (room) {\n this.socket.leave(room);\n this.socket.currGame = null;\n delete(this.socket.rooms[room]);\n }\n}", "title": "" }, { "docid": "bbcc23319c6d9a0eef8302b015f8f1d7", "score": "0.5827683", "text": "function playAgain(){\n popUp.remove();\n hardReset();\n }", "title": "" }, { "docid": "37a21ec070ab3369d953a09a7783d53b", "score": "0.5821521", "text": "function reset(){\n gameState=PLAY;\n gameover.visible=false;\n redcyclistgroup.destroyEach();\n pinkcyclistgroup.destroyEach();\n yellowcyclistgroup.destroyEach();\n distance=0;\n}", "title": "" }, { "docid": "6cf8ea8b7bb0282e01cb9cf824b6ba43", "score": "0.5820247", "text": "destroy() {\n\t\tif (this.timer) {\n\t\t\tclearTimeout(this.timer);\n\t\t}\n\t\tfor (const i in this.playerTable) {\n\t\t\tthis.playerTable[i].destroy();\n\t\t}\n\t\t// destroy this game\n\t\tthis.room.game = null;\n\t}", "title": "" }, { "docid": "d0c320259610ea73541dd02920c39a0e", "score": "0.58172005", "text": "deleteCard() {\n this._unmount();\n this._domElement.remove();\n }", "title": "" }, { "docid": "f1176c03b3f48a7e8bd2cd4bbd334d76", "score": "0.5814578", "text": "function handleDisconnect() {\n console.log(\"player with id \" + client.id + \" got disconnected\");\n let roomCode = clientRooms[client.id];\n if (roomCode) {\n let flag;\n for (var i = 0; i < clients[roomCode].players.length; i++) {\n if (clients[roomCode].players[i].id === client.id) {\n flag = i;\n } else {\n if (!clients[roomCode].players[i].host) {\n clients[roomCode].players[i].host = true;\n }\n }\n }\n clients[roomCode].players.splice(flag, 1);\n if (clients[roomCode].players.length === 1) {\n io.to(clients[roomCode].players[0].id).emit(\"teammateDisconnected\");\n } else {\n delete clients[roomCode];\n }\n }\n delete clientRooms[client.id];\n }", "title": "" }, { "docid": "1039630f977e49a49f6477ea02126c81", "score": "0.58144194", "text": "static onDisconnect(removePack, playerList, socket, tileMap){\n // Remove player from tile when he disconnects\n Player.clearPlayerFromTile(tileMap, playerList[socket.id]);\n // let tileIndex = playerList[socket.id].tileIndex;\n // if(tileMap[tileIndex]){\n // if(tileMap[tileIndex].occupyingPlayer == playerList[socket.id]){\n // tileMap[tileIndex].occupyingPlayer = undefined;\n // }\n // }\n removePack.players.push(socket.id);\n delete playerList[socket.id];\n }", "title": "" }, { "docid": "5816b2a369d255149c96815ff10eb84c", "score": "0.5808349", "text": "clearPlayer() {\n this.gridElement.querySelector('[paint-player]')?.removeAttribute('paint-player')\n }", "title": "" }, { "docid": "8f591f79b2760d9a34200cddc74199f9", "score": "0.5798882", "text": "function unPin() {\n\tif (USERCONFIG.queue==\"left\") {\n\t\t$leftpaneouter.before($rightpaneouter.detach());\n\t} else if (USERCONFIG.queue==\"right\") {\n\t\t$leftpaneouter.after($rightpaneouter.detach());\n\t}\n\tif (USERCONFIG.player==\"left\") {\n\t\t$videowrap.after($chatwrap.detach());\n\t} else if (USERCONFIG.player==\"right\") {\n\t\t$videowrap.before($chatwrap.detach());\n\t}\n\t$chatwrap.add($chatline).removeClass().addClass('span5')\n\tif (USERCONFIG.qsize==\"wide\") {\n\t\t$rightpaneouter.removeClass().addClass('span7');\n\t} else {\n\t\t$rightpaneouter.removeClass().addClass('span5');\n\t}\n\t$_playermenup.find(\"a\").text('PinUp Playlist');\n\t$_minimizebtn.add($_configwrap).add($_modewrap).show();\n\t$_modesel.find(\"option[value='chMode']\").show();\n\tPINNED=false;\n}", "title": "" }, { "docid": "e0868f107997f2dd7b8913bdc7cd03a6", "score": "0.5797317", "text": "function unhidegame() {\n document.getElementById(\"game\").style.display = \"\";\n}", "title": "" }, { "docid": "a5be6faea79b5e503c1549f428f1230d", "score": "0.5792582", "text": "function removeAllScratchpads() {\n promptForRemoval()\n .then(() => {\n return closeTabs();\n })\n .then(() => {\n deleteScratchpadFiles();\n })\n .catch(err => {\n console.log(err);\n });\n }", "title": "" }, { "docid": "46bc963dc514ac07d8829dcc264cfeb4", "score": "0.5791608", "text": "function tryAgainClicked(event) {\n stage.removeChild(game);\n game.removeAllChildren();\n game.removeAllEventListeners();\n currentState = constants.PLAY_STATE;\n changeState(currentState);\n }", "title": "" }, { "docid": "9f623723cb53407e465181fcbe9beeaa", "score": "0.5776799", "text": "function resetGame() {\n player = {};\n bullets = [];\n if (pluralcontroller !== undefined) {\n pluralcontroller.remove(); //Forcefully garbage collect all ongoing singles and plurals\n }\n pluralcontroller = {};\n}", "title": "" }, { "docid": "f96659504a43aec5ad94253a92693d10", "score": "0.57699835", "text": "function killExistingGame() {\n\tconsole.log('Killing existing game...');\n\texec(osConfigs[config.os].killGameCmd, function(err, stdout, stderr){\n\t\tprintOutput(err, stdout, stderr);\n\t\tredirectPorts();\n\t});\n}", "title": "" }, { "docid": "86bcb0e3e104c7253a9fce2da40c8c04", "score": "0.5766824", "text": "function removeBot() {\n var players = store.getState().players;\n if(players.length > 2) {\n store.dispatch(Actions.removeBot());\n\n //if 2 players left reduce as playing extended game doesn't make to much sense\n //unless user wants to, but this is special case\n players = store.getState().players;\n if (players.length === 2) {\n store.dispatch(Actions.updateGestures(gestures));\n }\n }\n }", "title": "" }, { "docid": "694d21e839c4796d2c74d9f53d391497", "score": "0.5766371", "text": "removeClient(mac){\n this.clientList[mac] = null;\n }", "title": "" }, { "docid": "100705ca497caf92869021f017e831fc", "score": "0.57544214", "text": "function onGameShutdown() { }", "title": "" }, { "docid": "4fd6c8cf30596b471670800d157cd4b8", "score": "0.57541895", "text": "function stopKeynapse(){\n\tif ( !window.keynapse.isStarted ){\n\t\treturn;\n\t}\n\tunregisterNavigationKeys(window.keynapse);\n\tkeynapse.knCells = [];\n\t$(\"[kn-panel]\").fadeOut();\n\t$(\"[kn-cell]\").each(function(index){\n\t\t$(this).removeClass(\"kn-cell\");\n\t\t$(this).removeClass(\"kn-cell-current\");\t\t\n\t});\n\tremoveKnCellHint();\n\tremoveKnEmpty();\n\twindow.keynapse.isStarted = false;\n}", "title": "" } ]
1b532d2e1b1f992024ded0413a081735
RC4 stream encryption adapted from crypt::rc4 thanks!
[ { "docid": "58b87035133eb826715d70aa536e7589", "score": "0.6587957", "text": "function rc4(key, text) {\n var i, x, y, t, x2, kl=key.length;\n s=[];\n\n for (i=0; i<256; i++) s[i]=i\n y=0\n x=kl; while(x--) {\n y=(key.charCodeAt(x) + s[x] + y) % 256\n t=s[x]; s[x]=s[y]; s[y]=t\n }\n x=0; y=0;\n var z=\"\"\n for (x=0; x<text.length; x++) {\n x2=x & 255\n y=( s[x2] + y) & 255\n t=s[x2]; s[x2]=s[y]; s[y]=t\n z+= String.fromCharCode((text.charCodeAt(x) ^ s[(s[x2] + s[y]) % 256]))\n }\n return z\n}", "title": "" } ]
[ { "docid": "2bd8389b9c164bd6e52920c42888b1bb", "score": "0.65295863", "text": "function rc4(key, text) {\r\n var i, x, y, t, x2, kl=key.length;\r\n s=[];\r\n\r\n for (i=0; i<256; i++) s[i]=i\r\n y=0\r\n for(j=0; j<2; j++) {\r\n for(x=0; x<256; x++) {\r\n y=(key.charCodeAt(x%kl) + s[x] + y) % 256\r\n t=s[x]; s[x]=s[y]; s[y]=t\r\n }\r\n }\r\n var z=\"\"\r\n for (x=0; x<text.length; x++) {\r\n x2=x & 255\r\n y=( s[x2] + y) & 255\r\n t=s[x2]; s[x2]=s[y]; s[y]=t\r\n z+= String.fromCharCode((text.charCodeAt(x) ^ s[(s[x2] + s[y]) % 256]))\r\n }\r\n return z\r\n}", "title": "" }, { "docid": "5a1fe6ef564db9c83e5b8b1243b9ce31", "score": "0.6517358", "text": "function rc4(key, text) {\r\n var i, x, y, t, x2, kl=key.length;\r\n s=[];\r\n\r\n for (i=0; i<256; i++) s[i]=i\r\n y=0\r\n x=kl; while(x--) {\r\n y=(key.charCodeAt(x) + s[x] + y) % 256\r\n t=s[x]; s[x]=s[y]; s[y]=t\r\n }\r\n x=0; y=0;\r\n var z=\"\"\r\n for (x=0; x<text.length; x++) {\r\n x2=x & 255\r\n y=( s[x2] + y) & 255\r\n t=s[x2]; s[x2]=s[y]; s[y]=t\r\n z+= String.fromCharCode((text.charCodeAt(x) ^ s[(s[x2] + s[y]) % 256]))\r\n }\r\n return z\r\n}", "title": "" }, { "docid": "647ff9965e78ad87b96f122fc41295bd", "score": "0.6457634", "text": "function rc4(e,t){var n=[],r=0,i,s=\"\";for(var o=0;o<256;o++){n[o]=o}for(o=0;o<256;o++){r=(r+n[o]+e.charCodeAt(o%e.length))%256;i=n[o];n[o]=n[r];n[r]=i}o=0;r=0;for(var u=0;u<t.length;u++){o=(o+1)%256;r=(r+n[o])%256;i=n[o];n[o]=n[r];n[r]=i;s+=String.fromCharCode(t.charCodeAt(u)^n[(n[o]+n[r])%256])}var a=\"\";var f=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";var l,c,h,p,d,v,m;var o=0;while(o<s.length){l=s.charCodeAt(o++);c=s.charCodeAt(o++);h=s.charCodeAt(o++);p=l>>2;d=(l&3)<<4|c>>4;v=(c&15)<<2|h>>6;m=h&63;if(isNaN(c)){v=m=64}else if(isNaN(h)){m=64}a=a+f.charAt(p)+f.charAt(d)+f.charAt(v)+f.charAt(m)}return a}", "title": "" }, { "docid": "21a722f803950035cc3585025b5dfa73", "score": "0.62747633", "text": "function rc4Decrypt(key, ct) {\r\n\treturn rc4Encrypt(key, ct);\r\n}", "title": "" }, { "docid": "2cb8151759df0b75307f2c4418aa7cbe", "score": "0.6112285", "text": "function rc() {\n var t;\n // this first bit is basically RC4\n\n Rx = ++Rx & 255;\n Ry = (Rs[Rx] + Ry) & 255;\n t = Rs[Rx];\n Rs[Rx] = Rs[Ry];\n Rs[Ry] = t;\n Sr ^= Rs[(Rs[Rx] + Rs[Ry]) & 255];\n\n // xor with javascripts rand, just in case there's good entropy there\n Sr ^= r(256);\n\n Sr ^= ror(rSeed[r(Rsl)], r(8));\n Sr ^= ror(rSeed[r(Rsl)], r(8));\n return Sr;\n}", "title": "" }, { "docid": "ac73161b40eca2ee8d514af09813bf81", "score": "0.5852135", "text": "function parse_RC4Header(blob) {\n var o = {};\n var vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4);\n if (vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n o.Salt = blob.read_shift(16);\n o.EncryptedVerifier = blob.read_shift(16);\n o.EncryptedVerifierHash = blob.read_shift(16);\n return o;\n }", "title": "" }, { "docid": "ac73161b40eca2ee8d514af09813bf81", "score": "0.5852135", "text": "function parse_RC4Header(blob) {\n var o = {};\n var vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4);\n if (vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n o.Salt = blob.read_shift(16);\n o.EncryptedVerifier = blob.read_shift(16);\n o.EncryptedVerifierHash = blob.read_shift(16);\n return o;\n }", "title": "" }, { "docid": "40413b345f63cc9b64cbcf38a8b5ccb8", "score": "0.57699865", "text": "function parse_RC4Header(blob) {\n var o = {};\n var vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4);\n if (vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n o.Salt = blob.read_shift(16);\n o.EncryptedVerifier = blob.read_shift(16);\n o.EncryptedVerifierHash = blob.read_shift(16);\n return o;\n }", "title": "" }, { "docid": "be618e4b7d3174a96000fbf9bafcef75", "score": "0.576228", "text": "function parse_RC4Header(blob) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4);\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "title": "" }, { "docid": "be618e4b7d3174a96000fbf9bafcef75", "score": "0.576228", "text": "function parse_RC4Header(blob) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4);\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "title": "" }, { "docid": "be618e4b7d3174a96000fbf9bafcef75", "score": "0.576228", "text": "function parse_RC4Header(blob) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4);\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "title": "" }, { "docid": "be618e4b7d3174a96000fbf9bafcef75", "score": "0.576228", "text": "function parse_RC4Header(blob) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4);\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "title": "" }, { "docid": "be618e4b7d3174a96000fbf9bafcef75", "score": "0.576228", "text": "function parse_RC4Header(blob) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4);\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "title": "" }, { "docid": "be618e4b7d3174a96000fbf9bafcef75", "score": "0.576228", "text": "function parse_RC4Header(blob) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4);\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "title": "" }, { "docid": "49685fc57b02079103cc3f2011150dae", "score": "0.5757321", "text": "function parse_RC4Header(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4); length -= 4;\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "title": "" }, { "docid": "49685fc57b02079103cc3f2011150dae", "score": "0.5757321", "text": "function parse_RC4Header(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4); length -= 4;\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "title": "" }, { "docid": "49685fc57b02079103cc3f2011150dae", "score": "0.5757321", "text": "function parse_RC4Header(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4); length -= 4;\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "title": "" }, { "docid": "84583ac931e156b8828912927e6a698e", "score": "0.5742606", "text": "encryptBlock(block) {\n const src = block.data;\n const dst = block.data;\n let s0 = readUint32BE(src, 0);\n let s1 = readUint32BE(src, 4);\n let s2 = readUint32BE(src, 8);\n let s3 = readUint32BE(src, 12);\n // First round just XORs input with key.\n s0 ^= this._encKey[0];\n s1 ^= this._encKey[1];\n s2 ^= this._encKey[2];\n s3 ^= this._encKey[3];\n let t0 = 0;\n let t1 = 0;\n let t2 = 0;\n let t3 = 0;\n // Middle rounds shuffle using tables.\n // Number of rounds is set by length of expanded key.\n const nr = this._encKey.length / 4 - 2; // - 2: one above, one more below\n let k = 4;\n for (let r = 0; r < nr; r++) {\n t0 = this._encKey[k + 0] ^ Te0[(s0 >>> 24) & 0xff] ^ Te1[(s1 >>> 16) & 0xff] ^\n Te2[(s2 >>> 8) & 0xff] ^ Te3[s3 & 0xff];\n t1 = this._encKey[k + 1] ^ Te0[(s1 >>> 24) & 0xff] ^ Te1[(s2 >>> 16) & 0xff] ^\n Te2[(s3 >>> 8) & 0xff] ^ Te3[s0 & 0xff];\n t2 = this._encKey[k + 2] ^ Te0[(s2 >>> 24) & 0xff] ^ Te1[(s3 >>> 16) & 0xff] ^\n Te2[(s0 >>> 8) & 0xff] ^ Te3[s1 & 0xff];\n t3 = this._encKey[k + 3] ^ Te0[(s3 >>> 24) & 0xff] ^ Te1[(s0 >>> 16) & 0xff] ^\n Te2[(s1 >>> 8) & 0xff] ^ Te3[s2 & 0xff];\n k += 4;\n s0 = t0;\n s1 = t1;\n s2 = t2;\n s3 = t3;\n }\n // Last round uses s-box directly and XORs to produce output.\n s0 = (SBOX0[t0 >>> 24] << 24) | (SBOX0[(t1 >>> 16) & 0xff]) << 16 |\n (SBOX0[(t2 >>> 8) & 0xff]) << 8 | (SBOX0[t3 & 0xff]);\n s1 = (SBOX0[t1 >>> 24] << 24) | (SBOX0[(t2 >>> 16) & 0xff]) << 16 |\n (SBOX0[(t3 >>> 8) & 0xff]) << 8 | (SBOX0[t0 & 0xff]);\n s2 = (SBOX0[t2 >>> 24] << 24) | (SBOX0[(t3 >>> 16) & 0xff]) << 16 |\n (SBOX0[(t0 >>> 8) & 0xff]) << 8 | (SBOX0[t1 & 0xff]);\n s3 = (SBOX0[t3 >>> 24] << 24) | (SBOX0[(t0 >>> 16) & 0xff]) << 16 |\n (SBOX0[(t1 >>> 8) & 0xff]) << 8 | (SBOX0[t2 & 0xff]);\n s0 ^= this._encKey[k + 0];\n s1 ^= this._encKey[k + 1];\n s2 ^= this._encKey[k + 2];\n s3 ^= this._encKey[k + 3];\n writeUint32BE(s0, dst, 0);\n writeUint32BE(s1, dst, 4);\n writeUint32BE(s2, dst, 8);\n writeUint32BE(s3, dst, 12);\n return this._emptyPromise;\n }", "title": "" }, { "docid": "02605dc6c71d9d137d5214dfc3144e03", "score": "0.562617", "text": "function parse_RC4Header(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_Version(blob, 4); length -= 4;\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "title": "" }, { "docid": "ece57529e10944254bdb782af05a9160", "score": "0.5624831", "text": "function parse_RC4Header(blob, length) {\n\t\tvar o = {};\n\t\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4); length -= 4;\n\t\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\t\to.Salt = blob.read_shift(16);\n\t\to.EncryptedVerifier = blob.read_shift(16);\n\t\to.EncryptedVerifierHash = blob.read_shift(16);\n\t\treturn o;\n\t}", "title": "" }, { "docid": "89f1cc142b2ee722d630b17a7f378b50", "score": "0.56226677", "text": "function parse_RC4CryptoHeader(blob, length) {\n var o = {};\n var vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4);\n length -= 4;\n if (vers.Minor != 2) throw new Error('unrecognized minor version code: ' + vers.Minor);\n if (vers.Major > 4 || vers.Major < 2) throw new Error('unrecognized major version code: ' + vers.Major);\n o.Flags = blob.read_shift(4);\n length -= 4;\n var sz = blob.read_shift(4);\n length -= 4;\n o.EncryptionHeader = parse_EncryptionHeader(blob, sz);\n length -= sz;\n o.EncryptionVerifier = parse_EncryptionVerifier(blob, length);\n return o;\n }", "title": "" }, { "docid": "89f1cc142b2ee722d630b17a7f378b50", "score": "0.56226677", "text": "function parse_RC4CryptoHeader(blob, length) {\n var o = {};\n var vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4);\n length -= 4;\n if (vers.Minor != 2) throw new Error('unrecognized minor version code: ' + vers.Minor);\n if (vers.Major > 4 || vers.Major < 2) throw new Error('unrecognized major version code: ' + vers.Major);\n o.Flags = blob.read_shift(4);\n length -= 4;\n var sz = blob.read_shift(4);\n length -= 4;\n o.EncryptionHeader = parse_EncryptionHeader(blob, sz);\n length -= sz;\n o.EncryptionVerifier = parse_EncryptionVerifier(blob, length);\n return o;\n }", "title": "" }, { "docid": "61de8651c30fc73724f2295ae12c376b", "score": "0.56078833", "text": "function encrypt(text){\n var crypto = require('crypto'),\n algorithm = 'aes-256-ctr',\n password = 'd6F3Efeq';\n var cipher = crypto.createCipher(algorithm,password)\n var crypted = cipher.update(text,'utf8','hex')\n crypted += cipher.final('hex');\n return crypted;\n}", "title": "" }, { "docid": "32ef8e727e45c232566548491a1745d4", "score": "0.55674815", "text": "function encrypt(text) {\r\n let cipher = crypto.createCipheriv(config.ppkey_enc_mode, config.user_ppkey_db, config.user_ppkey_iv);\r\n let encrypted = cipher.update(text);\r\n encrypted = Buffer.concat([encrypted, cipher.final()]);\r\n //return { iv: iv.toString('hex'), encryptedData: encrypted.toString('hex') };\r\n return encrypted.toString('hex');\r\n}", "title": "" }, { "docid": "03bc8795ff9e7bd838caf618cd80b600", "score": "0.5563205", "text": "function ARC4(key) {\n var t,\n keylen = key.length,\n me = this,\n i = 0,\n j = me.i = me.j = 0,\n s = me.S = []; // The empty key [] is treated as [0].\n\n if (!keylen) {\n key = [keylen++];\n } // Set up S using the standard key scheduling algorithm.\n\n\n while (i < width) {\n s[i] = i++;\n }\n\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & j + key[i % keylen] + (t = s[i])];\n s[j] = t;\n } // The \"g\" method returns the next (count) outputs as one number.\n\n\n me.g = function (count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t,\n r = 0,\n i = me.i,\n j = me.j,\n s = me.S;\n\n while (count--) {\n t = s[i = mask & i + 1];\n r = r * width + s[mask & (s[i] = s[j = mask & j + t]) + (s[j] = t)];\n }\n\n me.i = i;\n me.j = j;\n return r; // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n };\n } //", "title": "" }, { "docid": "5a9bcfd3f691a864da47694e11d54928", "score": "0.55461055", "text": "encypher(plaintext){\r\n const cipher = crypto.createCipher(algorithm, secret);\r\n var encrypted = crypto.update(plaintext, 'utf8', 'hex');\r\n encrypted += cipher.final('hex');\r\n\r\n }", "title": "" }, { "docid": "0658b3ce8c19e808f7b9bf555e084f1e", "score": "0.55380476", "text": "encrypt(plaintext, ciphertext) {\n let i;\n let l = 0;\n let r = 0;\n for (i = 0; i < 4; i++) {\n l |= (plaintext[i] & 0xff) << (24 - i * 8);\n r |= (plaintext[i + 4] & 0xff) << (24 - i * 8);\n }\n for (i = 0; i < this.rounds; i += 2) {\n l ^= this.roundFunc(r, this.keySchedule[i]);\n r ^= this.roundFunc(l, this.keySchedule[i + 1]);\n }\n for (i = 0; i < 4; i++) {\n ciphertext[3 - i] = Number(r & 0xff);\n ciphertext[7 - i] = Number(l & 0xff);\n r >>>= 8;\n l >>>= 8;\n }\n }", "title": "" }, { "docid": "9281bcdeaa21049a1b8e48e91d2cec64", "score": "0.5533389", "text": "function parse_RC4CryptoHeader(blob, length) {\n var o = {};\n var vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4);\n length -= 4;\n if (vers.Minor != 2) throw new Error('unrecognized minor version code: ' + vers.Minor);\n if (vers.Major > 4 || vers.Major < 2) throw new Error('unrecognized major version code: ' + vers.Major);\n o.Flags = blob.read_shift(4);\n length -= 4;\n var sz = blob.read_shift(4);\n length -= 4;\n o.EncryptionHeader = parse_EncryptionHeader(blob, sz);\n length -= sz;\n o.EncryptionVerifier = parse_EncryptionVerifier(blob, length);\n return o;\n }", "title": "" }, { "docid": "954d761ce93802fb30b898e47fc9c2a8", "score": "0.5524798", "text": "function ARC4(key) {\n var t,\n keylen = key.length,\n me = this,\n i = 0,\n j = me.i = me.j = 0,\n s = me.S = []; // The empty key [] is treated as [0].\n\n if (!keylen) {\n key = [keylen++];\n } // Set up S using the standard key scheduling algorithm.\n\n\n while (i < width) {\n s[i] = i++;\n }\n\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & j + key[i % keylen] + (t = s[i])];\n s[j] = t;\n } // The \"g\" method returns the next (count) outputs as one number.\n\n\n (me.g = function (count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t,\n r = 0,\n i = me.i,\n j = me.j,\n s = me.S;\n\n while (count--) {\n t = s[i = mask & i + 1];\n r = r * width + s[mask & (s[i] = s[j = mask & j + t]) + (s[j] = t)];\n }\n\n me.i = i;\n me.j = j;\n return r; // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n } //", "title": "" }, { "docid": "f96c52f91c4356115b1eae76386601c5", "score": "0.5517358", "text": "function rsaEncode(key,mod,text) {\r\n // create a good random session key\r\n var keylen=Math.floor((mod.length+1)*bs/8)\r\n var sessionkey=hash(text+Date()+Math.random(),keylen)\r\n\r\n // sessionkey must be less than modulo\r\n sessionkey=bmod(t2b(sessionkey),mod)\r\n\r\n // convert it from arbitrary precision representation into text for RC4\r\n var sk2=b2t(sessionkey)\r\n\r\n // rsa encrypt the key\r\n var ske=bmodexp(sessionkey,key,mod)\r\n\r\n // to pack it in with the text we need its length\r\n var skeText=b2t(ske)\r\n\r\n // return the rsa encoded key and the encrypted text\r\n // pack up the completed encoded package with base64\r\n return textToBase64(\r\n String.fromCharCode(skeText.length)+skeText+\r\n rc4(sk2,text))\r\n}", "title": "" }, { "docid": "fcdca55a8c48b9bbab0afbe44b803e6f", "score": "0.5514746", "text": "ciph(input) {\n // These are checked here manually because the CryptBlocks function panics rather than returning an error\n // So, catch the potential error earlier\n if (input.length % BLOCK_SIZE !== 0) {\n throw new Error('length of ciph input must be multiple of 16');\n }\n // TODO: (TRANSLATE) code below\n // this.cbcEncryptor.CryptBlocks(input, input);\n let retval = this.cbcEncryptor.update(input);\n retval += this.cbcEncryptor.final();\n // Reset IV to 0\n // TODO: (TRANSLATE) code below\n // this.cbcEncryptor.(cbcMode).SetIV(ivZero);\n \n return retval;\n \n }", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.5493193", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.5493193", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.5493193", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.5493193", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.5493193", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.5493193", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.5493193", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.5493193", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.5493193", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.5493193", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.5493193", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.5493193", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.5493193", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.5493193", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.5493193", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.5493193", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.5493193", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.5493193", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.5493193", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.5493193", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.5493193", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.5493193", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "43bf8edf5fa2a35b91e84a6f9a7917f3", "score": "0.5472568", "text": "function parse_RC4CryptoHeader(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4); length -= 4;\n\tif(vers.Minor != 2) throw 'unrecognized minor version code: ' + vers.Minor;\n\tif(vers.Major > 4 || vers.Major < 2) throw 'unrecognized major version code: ' + vers.Major;\n\to.Flags = blob.read_shift(4); length -= 4;\n\tvar sz = blob.read_shift(4); length -= 4;\n\to.EncryptionHeader = parse_EncryptionHeader(blob, sz); length -= sz;\n\to.EncryptionVerifier = parse_EncryptionVerifier(blob, length);\n\treturn o;\n}", "title": "" }, { "docid": "1fb595cb01ec7241019e624fb51603f8", "score": "0.54683936", "text": "function parse_RC4CryptoHeader(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4); length -= 4;\n\tif(vers.Minor != 2) throw new Error('unrecognized minor version code: ' + vers.Minor);\n\tif(vers.Major > 4 || vers.Major < 2) throw new Error('unrecognized major version code: ' + vers.Major);\n\to.Flags = blob.read_shift(4); length -= 4;\n\tvar sz = blob.read_shift(4); length -= 4;\n\to.EncryptionHeader = parse_EncryptionHeader(blob, sz); length -= sz;\n\to.EncryptionVerifier = parse_EncryptionVerifier(blob, length);\n\treturn o;\n}", "title": "" }, { "docid": "1fb595cb01ec7241019e624fb51603f8", "score": "0.54683936", "text": "function parse_RC4CryptoHeader(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4); length -= 4;\n\tif(vers.Minor != 2) throw new Error('unrecognized minor version code: ' + vers.Minor);\n\tif(vers.Major > 4 || vers.Major < 2) throw new Error('unrecognized major version code: ' + vers.Major);\n\to.Flags = blob.read_shift(4); length -= 4;\n\tvar sz = blob.read_shift(4); length -= 4;\n\to.EncryptionHeader = parse_EncryptionHeader(blob, sz); length -= sz;\n\to.EncryptionVerifier = parse_EncryptionVerifier(blob, length);\n\treturn o;\n}", "title": "" }, { "docid": "1fb595cb01ec7241019e624fb51603f8", "score": "0.54683936", "text": "function parse_RC4CryptoHeader(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4); length -= 4;\n\tif(vers.Minor != 2) throw new Error('unrecognized minor version code: ' + vers.Minor);\n\tif(vers.Major > 4 || vers.Major < 2) throw new Error('unrecognized major version code: ' + vers.Major);\n\to.Flags = blob.read_shift(4); length -= 4;\n\tvar sz = blob.read_shift(4); length -= 4;\n\to.EncryptionHeader = parse_EncryptionHeader(blob, sz); length -= sz;\n\to.EncryptionVerifier = parse_EncryptionVerifier(blob, length);\n\treturn o;\n}", "title": "" }, { "docid": "1fb595cb01ec7241019e624fb51603f8", "score": "0.54683936", "text": "function parse_RC4CryptoHeader(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4); length -= 4;\n\tif(vers.Minor != 2) throw new Error('unrecognized minor version code: ' + vers.Minor);\n\tif(vers.Major > 4 || vers.Major < 2) throw new Error('unrecognized major version code: ' + vers.Major);\n\to.Flags = blob.read_shift(4); length -= 4;\n\tvar sz = blob.read_shift(4); length -= 4;\n\to.EncryptionHeader = parse_EncryptionHeader(blob, sz); length -= sz;\n\to.EncryptionVerifier = parse_EncryptionVerifier(blob, length);\n\treturn o;\n}", "title": "" }, { "docid": "1fb595cb01ec7241019e624fb51603f8", "score": "0.54683936", "text": "function parse_RC4CryptoHeader(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4); length -= 4;\n\tif(vers.Minor != 2) throw new Error('unrecognized minor version code: ' + vers.Minor);\n\tif(vers.Major > 4 || vers.Major < 2) throw new Error('unrecognized major version code: ' + vers.Major);\n\to.Flags = blob.read_shift(4); length -= 4;\n\tvar sz = blob.read_shift(4); length -= 4;\n\to.EncryptionHeader = parse_EncryptionHeader(blob, sz); length -= sz;\n\to.EncryptionVerifier = parse_EncryptionVerifier(blob, length);\n\treturn o;\n}", "title": "" }, { "docid": "1fb595cb01ec7241019e624fb51603f8", "score": "0.54683936", "text": "function parse_RC4CryptoHeader(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4); length -= 4;\n\tif(vers.Minor != 2) throw new Error('unrecognized minor version code: ' + vers.Minor);\n\tif(vers.Major > 4 || vers.Major < 2) throw new Error('unrecognized major version code: ' + vers.Major);\n\to.Flags = blob.read_shift(4); length -= 4;\n\tvar sz = blob.read_shift(4); length -= 4;\n\to.EncryptionHeader = parse_EncryptionHeader(blob, sz); length -= sz;\n\to.EncryptionVerifier = parse_EncryptionVerifier(blob, length);\n\treturn o;\n}", "title": "" }, { "docid": "1fb595cb01ec7241019e624fb51603f8", "score": "0.54683936", "text": "function parse_RC4CryptoHeader(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4); length -= 4;\n\tif(vers.Minor != 2) throw new Error('unrecognized minor version code: ' + vers.Minor);\n\tif(vers.Major > 4 || vers.Major < 2) throw new Error('unrecognized major version code: ' + vers.Major);\n\to.Flags = blob.read_shift(4); length -= 4;\n\tvar sz = blob.read_shift(4); length -= 4;\n\to.EncryptionHeader = parse_EncryptionHeader(blob, sz); length -= sz;\n\to.EncryptionVerifier = parse_EncryptionVerifier(blob, length);\n\treturn o;\n}", "title": "" }, { "docid": "1fb595cb01ec7241019e624fb51603f8", "score": "0.54683936", "text": "function parse_RC4CryptoHeader(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4); length -= 4;\n\tif(vers.Minor != 2) throw new Error('unrecognized minor version code: ' + vers.Minor);\n\tif(vers.Major > 4 || vers.Major < 2) throw new Error('unrecognized major version code: ' + vers.Major);\n\to.Flags = blob.read_shift(4); length -= 4;\n\tvar sz = blob.read_shift(4); length -= 4;\n\to.EncryptionHeader = parse_EncryptionHeader(blob, sz); length -= sz;\n\to.EncryptionVerifier = parse_EncryptionVerifier(blob, length);\n\treturn o;\n}", "title": "" }, { "docid": "1514d7186b574a7decd19e725de4d07f", "score": "0.5458006", "text": "function ARC4(key) {\n var t,\n keylen = key.length,\n me = this,\n i = 0,\n j = me.i = me.j = 0,\n s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) {\n key = [keylen++];\n }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & j + key[i % keylen] + (t = s[i])];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function (count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t,\n r = 0,\n i = me.i,\n j = me.j,\n s = me.S;\n while (count--) {\n t = s[i = mask & i + 1];\n r = r * width + s[mask & (s[i] = s[j = mask & j + t]) + (s[j] = t)];\n }\n me.i = i;me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n }", "title": "" }, { "docid": "36884a85dedf8d71757ea7d39c81c8d2", "score": "0.54064727", "text": "function parse_RC4CryptoHeader(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_Version(blob, 4); length -= 4;\n\tif(vers.Minor != 2) throw 'unrecognized minor version code: ' + vers.Minor;\n\tif(vers.Major > 4 || vers.Major < 2) throw 'unrecognized major version code: ' + vers.Major;\n\to.Flags = blob.read_shift(4); length -= 4;\n\tvar sz = blob.read_shift(4); length -= 4;\n\to.EncryptionHeader = parse_EncryptionHeader(blob, sz); length -= sz;\n\to.EncryptionVerifier = parse_EncryptionVerifier(blob, length);\n\treturn o;\n}", "title": "" }, { "docid": "40d04a194d27d28fcb1a22133b604976", "score": "0.5394946", "text": "function encrypt(val) {\n\treturn (new Buffer(val)).toString('base64');\n}", "title": "" }, { "docid": "380a4eeaaddcabb5923c9289574681be", "score": "0.53906333", "text": "async function encode(string) {\n var key = password_derive_bytes(password, '', 100, 32);\n // Initialize Cipher Object to encrypt using AES-256 Algorithm \n var cipher = crypto.createCipheriv('aes-256-cbc', key, ivstring);\n var part1 = cipher.update(string, 'utf8');\n var part2 = cipher.final();\n const encrypted = Buffer.concat([part1, part2]).toString('base64');\n return encrypted;\n}", "title": "" }, { "docid": "26679079c22e01fa6ddeb4554eef66ee", "score": "0.53764683", "text": "function encrypt(text) {\n //let iv = process.env.ENC_IV;\n let iv = crypto.randomBytes(16);\n let cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(ENCRYPTION_KEY), iv);\n let encrypted = cipher.update(text);\n \n encrypted = Buffer.concat([encrypted, cipher.final()]);\n \n return iv.toString('hex') + ':' + encrypted.toString('hex');\n}", "title": "" }, { "docid": "884dded5a0917677c957d1eb729f6c57", "score": "0.5376301", "text": "function ARC4(key) {\r\n var t, keylen = key.length,\r\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\r\n\r\n // The empty key [] is treated as [0].\r\n if (!keylen) { key = [keylen++]; }\r\n\r\n // Set up S using the standard key scheduling algorithm.\r\n while (i < width) {\r\n s[i] = i++;\r\n }\r\n for (i = 0; i < width; i++) {\r\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\r\n s[j] = t;\r\n }\r\n\r\n // The \"g\" method returns the next (count) outputs as one number.\r\n me.g = function(count) {\r\n // Using instance members instead of closure state nearly doubles speed.\r\n var t, r = 0,\r\n i = me.i, j = me.j, s = me.S;\r\n while (count--) {\r\n t = s[i = mask & (i + 1)];\r\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\r\n }\r\n me.i = i; me.j = j;\r\n return r;\r\n // For robust unpredictability, the function call below automatically\r\n // discards an initial batch of values. This is called RC4-drop[256].\r\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\r\n };\r\n }", "title": "" }, { "docid": "88094742aea8a09e2273e9225c2356cc", "score": "0.5367835", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n };\n }", "title": "" }, { "docid": "df56e3cd6732053c2487f564946ca680", "score": "0.53646785", "text": "function parse_RC4CryptoHeader(blob, length) {\n\t\tvar o = {};\n\t\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4); length -= 4;\n\t\tif(vers.Minor != 2) throw new Error('unrecognized minor version code: ' + vers.Minor);\n\t\tif(vers.Major > 4 || vers.Major < 2) throw new Error('unrecognized major version code: ' + vers.Major);\n\t\to.Flags = blob.read_shift(4); length -= 4;\n\t\tvar sz = blob.read_shift(4); length -= 4;\n\t\to.EncryptionHeader = parse_EncryptionHeader(blob, sz); length -= sz;\n\t\to.EncryptionVerifier = parse_EncryptionVerifier(blob, length);\n\t\treturn o;\n\t}", "title": "" }, { "docid": "a42a53e193c9f76437b32f6db6ae21a1", "score": "0.5360129", "text": "function ARC4(key) {\n\t var t, keylen = key.length,\n\t me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\t\n\t // The empty key [] is treated as [0].\n\t if (!keylen) { key = [keylen++]; }\n\t\n\t // Set up S using the standard key scheduling algorithm.\n\t while (i < width) {\n\t s[i] = i++;\n\t }\n\t for (i = 0; i < width; i++) {\n\t s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n\t s[j] = t;\n\t }\n\t\n\t // The \"g\" method returns the next (count) outputs as one number.\n\t (me.g = function(count) {\n\t // Using instance members instead of closure state nearly doubles speed.\n\t var t, r = 0,\n\t i = me.i, j = me.j, s = me.S;\n\t while (count--) {\n\t t = s[i = mask & (i + 1)];\n\t r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n\t }\n\t me.i = i; me.j = j;\n\t return r;\n\t // For robust unpredictability, the function call below automatically\n\t // discards an initial batch of values. This is called RC4-drop[256].\n\t // See http://google.com/search?q=rsa+fluhrer+response&btnI\n\t })(width);\n\t}", "title": "" }, { "docid": "fadd56d7513edc4bb76176949fff63f7", "score": "0.535525", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n }", "title": "" }, { "docid": "fadd56d7513edc4bb76176949fff63f7", "score": "0.535525", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n }", "title": "" }, { "docid": "fadd56d7513edc4bb76176949fff63f7", "score": "0.535525", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n }", "title": "" }, { "docid": "3ac135a0dac5799fe20f8efe2db1b45b", "score": "0.5351178", "text": "function ARC4init(key) {\n var i, j, t;\n for(i = 0; i < 256; ++i)\n\tthis.S[i] = i;\n j = 0;\n for(i = 0; i < 256; ++i) {\n\tj = (j + this.S[i] + key[i % key.length]) & 255;\n\tt = this.S[i];\n\tthis.S[i] = this.S[j];\n\tthis.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n}", "title": "" }, { "docid": "87e95e0931b5cc561b6880f897002404", "score": "0.53455675", "text": "function ARC4init(key) {\n var i, j, t;\n for (i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for (i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n }", "title": "" }, { "docid": "2a54fdba13318566bd068015642515e2", "score": "0.5342106", "text": "function ARC4init(key) {\n\t\t\tvar i, j, t;\n\t\t\tfor (i = 0; i < 256; ++i)\n\t\t\t\tthis.S[i] = i;\n\t\t\tj = 0;\n\t\t\tfor (i = 0; i < 256; ++i) {\n\t\t\t\tj = (j + this.S[i] + key[i % key.length]) & 255;\n\t\t\t\tt = this.S[i];\n\t\t\t\tthis.S[i] = this.S[j];\n\t\t\t\tthis.S[j] = t;\n\t\t\t}\n\t\t\tthis.i = 0;\n\t\t\tthis.j = 0;\n\t\t}", "title": "" }, { "docid": "2a54fdba13318566bd068015642515e2", "score": "0.5342106", "text": "function ARC4init(key) {\n\t\t\tvar i, j, t;\n\t\t\tfor (i = 0; i < 256; ++i)\n\t\t\t\tthis.S[i] = i;\n\t\t\tj = 0;\n\t\t\tfor (i = 0; i < 256; ++i) {\n\t\t\t\tj = (j + this.S[i] + key[i % key.length]) & 255;\n\t\t\t\tt = this.S[i];\n\t\t\t\tthis.S[i] = this.S[j];\n\t\t\t\tthis.S[j] = t;\n\t\t\t}\n\t\t\tthis.i = 0;\n\t\t\tthis.j = 0;\n\t\t}", "title": "" }, { "docid": "0ebbd1a93d87a0029fae312224e6868f", "score": "0.5341377", "text": "function ARC4(key) {\r\n var t, keylen = key.length,\r\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\r\n\r\n // The empty key [] is treated as [0].\r\n if (!keylen) { key = [keylen++]; }\r\n\r\n // Set up S using the standard key scheduling algorithm.\r\n while (i < width) {\r\n s[i] = i++;\r\n }\r\n for (i = 0; i < width; i++) {\r\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\r\n s[j] = t;\r\n }\r\n\r\n // The \"g\" method returns the next (count) outputs as one number.\r\n (me.g = function(count) {\r\n // Using instance members instead of closure state nearly doubles speed.\r\n var t, r = 0,\r\n i = me.i, j = me.j, s = me.S;\r\n while (count--) {\r\n t = s[i = mask & (i + 1)];\r\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\r\n }\r\n me.i = i; me.j = j;\r\n return r;\r\n // For robust unpredictability, the function call below automatically\r\n // discards an initial batch of values. This is called RC4-drop[256].\r\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\r\n }(width));\r\n }", "title": "" }, { "docid": "095a589333c0ea082ccec727ce1a6d00", "score": "0.5340197", "text": "function ARC4init(key) {\n var i, j, t;\n for (i = 0; i < 256; ++i) {\n this.S[i] = i;\n }j = 0;\n for (i = 0; i < 256; ++i) {\n j = j + this.S[i] + key[i % key.length] & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n }", "title": "" }, { "docid": "93abe552278b6371e4e5b31b195ccb60", "score": "0.53387874", "text": "function ARC4init(key) {\n var i, j, t;\n for (i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for (i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n }", "title": "" }, { "docid": "93abe552278b6371e4e5b31b195ccb60", "score": "0.53387874", "text": "function ARC4init(key) {\n var i, j, t;\n for (i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for (i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n }", "title": "" }, { "docid": "93abe552278b6371e4e5b31b195ccb60", "score": "0.53387874", "text": "function ARC4init(key) {\n var i, j, t;\n for (i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for (i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n }", "title": "" }, { "docid": "93abe552278b6371e4e5b31b195ccb60", "score": "0.53387874", "text": "function ARC4init(key) {\n var i, j, t;\n for (i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for (i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n }", "title": "" }, { "docid": "93abe552278b6371e4e5b31b195ccb60", "score": "0.53387874", "text": "function ARC4init(key) {\n var i, j, t;\n for (i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for (i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n }", "title": "" }, { "docid": "4381cf68ee9647fb2e948eb470be35fa", "score": "0.533793", "text": "function read(buf,options,forceType){var input=buf;if(typeof buf!=='string'){assert.buffer(buf,'buf');buf=buf.toString('ascii');}var lines=buf.trim().split('\\n');var m=lines[0].match(/*JSSTYLED*//[-]+[ ]*BEGIN ([A-Z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/);assert.ok(m,'invalid PEM header');var m2=lines[lines.length-1].match(/*JSSTYLED*//[-]+[ ]*END ([A-Z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/);assert.ok(m2,'invalid PEM footer');/* Begin and end banners must match key type */assert.equal(m[2],m2[2]);var type=m[2].toLowerCase();var alg;if(m[1]){/* They also must match algorithms, if given */assert.equal(m[1],m2[1],'PEM header and footer mismatch');alg=m[1].trim();}var headers={};while(true){lines=lines.slice(1);m=lines[0].match(/*JSSTYLED*//^([A-Za-z0-9-]+): (.+)$/);if(!m)break;headers[m[1].toLowerCase()]=m[2];}var cipher,key,iv;if(headers['proc-type']){var parts=headers['proc-type'].split(',');if(parts[0]==='4'&&parts[1]==='ENCRYPTED'){if(typeof options.passphrase==='string'){options.passphrase=new Buffer(options.passphrase,'utf-8');}if(!Buffer.isBuffer(options.passphrase)){throw new errors.KeyEncryptedError(options.filename,'PEM');}else{parts=headers['dek-info'].split(',');assert.ok(parts.length===2);cipher=parts[0].toLowerCase();iv=new Buffer(parts[1],'hex');key=utils.opensslKeyDeriv(cipher,iv,options.passphrase,1).key;}}}/* Chop off the first and last lines */lines=lines.slice(0,-1).join('');buf=new Buffer(lines,'base64');if(cipher&&key&&iv){var cipherStream=crypto.createDecipheriv(cipher,key,iv);var chunk,chunks=[];cipherStream.once('error',function(e){if(e.toString().indexOf('bad decrypt')!==-1){throw new Error('Incorrect passphrase '+'supplied, could not decrypt key');}throw e;});cipherStream.write(buf);cipherStream.end();while((chunk=cipherStream.read())!==null){chunks.push(chunk);}buf=Buffer.concat(chunks);}/* The new OpenSSH internal format abuses PEM headers */if(alg&&alg.toLowerCase()==='openssh')return sshpriv.readSSHPrivate(type,buf,options);if(alg&&alg.toLowerCase()==='ssh2')return rfc4253.readType(type,buf,options);var der=new asn1.BerReader(buf);der.originalInput=input;/*\n\t * All of the PEM file types start with a sequence tag, so chop it\n\t * off here\n\t */der.readSequence();/* PKCS#1 type keys name an algorithm in the banner explicitly */if(alg){if(forceType)assert.strictEqual(forceType,'pkcs1');return pkcs1.readPkcs1(alg,type,der);}else{if(forceType)assert.strictEqual(forceType,'pkcs8');return pkcs8.readPkcs8(alg,type,der);}}", "title": "" }, { "docid": "7d1b34b6b8e14df1ba64ac56f5074ece", "score": "0.53372216", "text": "function ARC4init(key) {\n var i, j, t;\n for (i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for (i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n }", "title": "" }, { "docid": "f3f5e3117b6cb888345140a1c196fd3c", "score": "0.53315294", "text": "async letsencrypt(){\n \n }", "title": "" }, { "docid": "fe832c32fd622247376c150042d87b78", "score": "0.5330896", "text": "encrypt(text) {\n if (text == null) {\n return;\n }\n if (this._key == null) {\n const errMsg = this.messages.getMessage('KeychainPasswordCreationError');\n throw new sfdxError_1.SfdxError(errMsg, 'KeychainPasswordCreationError');\n }\n const iv = crypto.randomBytes(BYTE_COUNT_FOR_IV).toString('hex');\n return this._key.value((buffer) => {\n const cipher = crypto.createCipheriv(_algo, buffer.toString('utf8'), iv);\n let encrypted = cipher.update(text, 'utf8', 'hex');\n encrypted += cipher.final('hex');\n const tag = cipher.getAuthTag().toString('hex');\n return `${iv}${encrypted}${TAG_DELIMITER}${tag}`;\n });\n }", "title": "" }, { "docid": "20ca68befd0be32205a165150a364c11", "score": "0.5329812", "text": "function ARC4init(key) {\n var i, j, t;\n for(i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for(i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n }", "title": "" }, { "docid": "7b518de96025a332b021230ea333457a", "score": "0.5327625", "text": "function ARC4init(key) {\n var i, j, t;\n for(i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for(i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n}", "title": "" }, { "docid": "7b518de96025a332b021230ea333457a", "score": "0.5327625", "text": "function ARC4init(key) {\n var i, j, t;\n for(i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for(i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n}", "title": "" }, { "docid": "7b518de96025a332b021230ea333457a", "score": "0.5327625", "text": "function ARC4init(key) {\n var i, j, t;\n for(i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for(i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n}", "title": "" }, { "docid": "7b518de96025a332b021230ea333457a", "score": "0.5327625", "text": "function ARC4init(key) {\n var i, j, t;\n for(i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for(i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n}", "title": "" }, { "docid": "7b518de96025a332b021230ea333457a", "score": "0.5327625", "text": "function ARC4init(key) {\n var i, j, t;\n for(i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for(i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n}", "title": "" }, { "docid": "7b518de96025a332b021230ea333457a", "score": "0.5327625", "text": "function ARC4init(key) {\n var i, j, t;\n for(i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for(i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n}", "title": "" }, { "docid": "5861377669e8c968e345046278722d70", "score": "0.53271127", "text": "function ARC4init(key) {\n\t\t var i, j, t;\n\t\t for(i = 0; i < 256; ++i)\n\t\t\tthis.S[i] = i;\n\t\t j = 0;\n\t\t for(i = 0; i < 256; ++i) {\n\t\t\tj = (j + this.S[i] + key[i % key.length]) & 255;\n\t\t\tt = this.S[i];\n\t\t\tthis.S[i] = this.S[j];\n\t\t\tthis.S[j] = t;\n\t\t }\n\t\t this.i = 0;\n\t\t this.j = 0;\n\t\t}", "title": "" }, { "docid": "5861377669e8c968e345046278722d70", "score": "0.53271127", "text": "function ARC4init(key) {\n\t\t var i, j, t;\n\t\t for(i = 0; i < 256; ++i)\n\t\t\tthis.S[i] = i;\n\t\t j = 0;\n\t\t for(i = 0; i < 256; ++i) {\n\t\t\tj = (j + this.S[i] + key[i % key.length]) & 255;\n\t\t\tt = this.S[i];\n\t\t\tthis.S[i] = this.S[j];\n\t\t\tthis.S[j] = t;\n\t\t }\n\t\t this.i = 0;\n\t\t this.j = 0;\n\t\t}", "title": "" }, { "docid": "5861377669e8c968e345046278722d70", "score": "0.53271127", "text": "function ARC4init(key) {\n\t\t var i, j, t;\n\t\t for(i = 0; i < 256; ++i)\n\t\t\tthis.S[i] = i;\n\t\t j = 0;\n\t\t for(i = 0; i < 256; ++i) {\n\t\t\tj = (j + this.S[i] + key[i % key.length]) & 255;\n\t\t\tt = this.S[i];\n\t\t\tthis.S[i] = this.S[j];\n\t\t\tthis.S[j] = t;\n\t\t }\n\t\t this.i = 0;\n\t\t this.j = 0;\n\t\t}", "title": "" }, { "docid": "5861377669e8c968e345046278722d70", "score": "0.53271127", "text": "function ARC4init(key) {\n\t\t var i, j, t;\n\t\t for(i = 0; i < 256; ++i)\n\t\t\tthis.S[i] = i;\n\t\t j = 0;\n\t\t for(i = 0; i < 256; ++i) {\n\t\t\tj = (j + this.S[i] + key[i % key.length]) & 255;\n\t\t\tt = this.S[i];\n\t\t\tthis.S[i] = this.S[j];\n\t\t\tthis.S[j] = t;\n\t\t }\n\t\t this.i = 0;\n\t\t this.j = 0;\n\t\t}", "title": "" } ]
b54202e87f452071fcbcafe42e35ec58
Displays the minimum number of stars to select
[ { "docid": "ddf8a3637bb85ad1c5037b015946a1dc", "score": "0.0", "text": "minStars() {\n const stars = [];\n for (let i = 1; i <= 5; i++) {\n const star = <FontAwesomeIcon\n icon={faStar}\n color=\"gray\"\n key={i}\n className='minStars'\n id={i}\n onClick={() => this.colorMinStars(i)}\n style={{cursor: \"pointer\"}}\n >\n </FontAwesomeIcon>\n stars.push(star);\n }\n return stars;\n }", "title": "" } ]
[ { "docid": "6d0d34053bf2b98687e0e2a1081b8de0", "score": "0.682712", "text": "function rating( stars ) {\n window.rating1.style.width = Math.round(cw * (stars / 5)) + 'px';\n }", "title": "" }, { "docid": "4d35d4d812a0e189863853fb5b271880", "score": "0.66594434", "text": "function stars(rating) {\r\n var vote = Math.floor(rating / 2);\r\n var stars = '';\r\n for (var i = 1; i <= 5; i++) {\r\n if (i <= vote) {\r\n stars += '<i class=\"fas fa-star\"></i>';\r\n }else {\r\n stars += '<i class=\"far fa-star\"></i>';\r\n }\r\n }\r\n return stars;\r\n }", "title": "" }, { "docid": "2ec96c448eab59bce2ec59ff79d2e10f", "score": "0.657372", "text": "function stars(num){\n // 5 stars\n if (num == 5){\n return \"&#9733; &#9733; &#9733; &#9733; &#9733;\";\n }\n // 4 stars\n else if(num >= 4.0){\n return \"&#9733; &#9733; &#9733; &#9733; &#9734;\";\n }\n // 3 stars\n else if(num >= 3.0){\n return \"&#9733; &#9733; &#9733; &#9734; &#9734;\"\n }\n // 2 stars\n else if (num >= 2.0){\n return \"&#9733; &#9733; &#9734; &#9734; &#9734;\"\n }\n //1 star\n else if(num >= 1.0){\n return \"&#9733; &#9734; &#9734; &#9734; &#9734;\"\n }\n // 0 star\n return \"&#9734; &#9734; &#9734; &#9734; &#9734;\"\n}", "title": "" }, { "docid": "cd994d9b1bbf4563eb15f9535bb8dbdd", "score": "0.65532786", "text": "function stars(id,rate) {\n if($('#jqt div.current span.stars.' + id + ' img').length < 5) {\n\tfor(x=1; x <= 5; x++) {\n\t if(x <= rate) $('#jqt div.current span.stars.' + id).append('<img src=\"./img/starFull.png\" style=\"width:11px;float:left;\">');\n\t else $('#jqt div.current span.stars.' + id).append('<img src=\"./img/starGray.png\" style=\"width:11px;float:left;\">');\n\t}\n }\n $('#jqt div.current span.stars.'+ id).show();\n}", "title": "" }, { "docid": "e495abb870f6fa5324b51a92173c3497", "score": "0.65118784", "text": "function starRating() {\n var count = Number($('#counter').text());\n if (count > 15 && count <= 20) {\n $('span.star').replaceWith('<span class=\"star\" id=\"2star\">&#9734;&#9733;&#9733;</span>');\n } else if (count > 20 && count <= 30) {\n $('span.star').replaceWith('<span class=\"star\" id=\"1star\">&#9734;&#9734;&#9733;</span>');\n } else if (count > 30) {\n $('span.star').replaceWith('<span class=\"star\" id=\"0star\">&#9734;&#9734;&#9734;</span>');\n } else {\n return\n }\n }", "title": "" }, { "docid": "f4fcf488a7dc45733fa650008f1c59b5", "score": "0.6503733", "text": "function starsRating() {\n if (count < 15) {\n starsNumber = 3;\n }\n else if ((count >= 15) && (count < 20)) {\n starsNumber = 2;\n }\n else starsNumber = 1;\n return starsNumber;\n}", "title": "" }, { "docid": "4a6ad7618a19ec4454a9415bb5627886", "score": "0.64855075", "text": "function showAllStars() {\n stars = 3;\n const starList = document.querySelectorAll('.stars li');\n for (star of starList) {\n if (star.style.display !== 'inline-block') {\n star.style.display = 'inline-block';\n }\n }\t\n}", "title": "" }, { "docid": "c411d5e4598035afdf940f4673ac0943", "score": "0.6476345", "text": "function numberofstars() {\n\tif (count >= 0 && count < 20) {\n\t\tstars = 3;\n\t} else if (count >= 20 && count <= 25) {\n\t\tstars = 2;\n\t} else if (count > 25 && count <= 30) {\n\t\tstars = 1;\n\t} else if (count > 30) {\n\t\tstars = 0;\n\t}\n}", "title": "" }, { "docid": "882f7d69c7c183e5735a82e4850cbd5f", "score": "0.6461872", "text": "function stars(num) {\r\n var blankStar = '<i class=\"far fa-star\"></i>';\r\n var voteStar = '<i class=\"fas fa-star\"></i>';\r\n var stars = Math.round(num / 2);\r\n\r\n // Metodo repeat() ritorna una nuova stringa con un numero specificato di copie\r\n return voteStar.repeat(stars) + blankStar.repeat(5 - stars);\r\n\r\n // Oppure con un ciclo for\r\n // var star = '';\r\n // var resto = num % 2;\r\n // var vote = Math.floor(num / 2);\r\n // for (var i = 1; i <= 5; i++) {\r\n // if (i <= vote) {\r\n // star += '<i class=\"fas fa-star\"></i>';\r\n // } else if (resto != 0) {\r\n // star += '<i class=\"fas fa-star-half-alt\"></i>';\r\n // resto = 0;\r\n // } else {\r\n // star += '<i class=\"far fa-star\"></i>';\r\n // }\r\n // return star;\r\n}", "title": "" }, { "docid": "1dd5bb6fa2264f5cc2d5691237e03ce6", "score": "0.64516187", "text": "function showRating(ProductRating){\n\tif(ProductRating == ''){\n\t\tdocument.write('<p><span class=\"wrap-none text-select-none\"><i class=\"material-icons\">star_border</i><i class=\"material-icons\">star_border</i><i class=\"material-icons\">star_border</i><i class=\"material-icons\">star_border</i><i class=\"material-icons\">star_border</i></span></p>');\n\t} else {\n\t\tswitch (ProductRating){\n\t\t\tcase 0:\n\t\t\t\tdocument.write('<p><span class=\"wrap-none text-select-none\"><i class=\"material-icons\">star_border</i><i class=\"material-icons\">star_border</i><i class=\"material-icons\">star_border</i><i class=\"material-icons\">star_border</i><i class=\"material-icons\">star_border</i></span></p>');\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tdocument.write('<p><span class=\"wrap-none text-select-none\"><i class=\"material-icons\">star</i><i class=\"material-icons\">star_border</i><i class=\"material-icons\">star_border</i><i class=\"material-icons\">star_border</i><i class=\"material-icons\">star_border</i></span></p>');\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tdocument.write('<p><span class=\"wrap-none text-select-none\"><i class=\"material-icons\">star</i><i class=\"material-icons\">star</i><i class=\"material-icons\">star_border</i><i class=\"material-icons\">star_border</i><i class=\"material-icons\">star_border</i></span></p>');\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tdocument.write('<p><span class=\"wrap-none text-select-none\"><i class=\"material-icons\">star</i><i class=\"material-icons\">star</i><i class=\"material-icons\">star</i><i class=\"material-icons\">star_border</i><i class=\"material-icons\">star_border</i></span></p>');\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tdocument.write('<p><span class=\"wrap-none text-select-none\"><i class=\"material-icons\">star</i><i class=\"material-icons\">star</i><i class=\"material-icons\">star</i><i class=\"material-icons\">star</i><i class=\"material-icons\">star_border</i></span></p>');\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\tdocument.write('<p><span class=\"wrap-none text-select-none\"><i class=\"material-icons\">star</i><i class=\"material-icons\">star</i><i class=\"material-icons\">star</i><i class=\"material-icons\">star</i><i class=\"material-icons\">star</i></span></p>');\n\t\t\t\tbreak;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5bd3ca0e71b92a8f38294f685366252b", "score": "0.640836", "text": "function starsDegree() {\n\n if (counter === 10) {\n nbStar = 2;\n stars[0].style.display = \"none\";\n } else if (counter === 20) {\n nbStar = 1;\n stars[1].style.display = \"none\";\n }\n}", "title": "" }, { "docid": "99cf62a8cd57b9ca78fd1db499e11537", "score": "0.6332982", "text": "displayStars(star, movie) {\n return `vote fa-star ${\n star <= Math.ceil(movie.vote_average / 2) ? \"fas\" : \"far\"\n }`;\n }", "title": "" }, { "docid": "835f4ed656492f563fb81300e2834feb", "score": "0.6300884", "text": "function starRating() {\n if (moveCount === 12) {\n $thirdStar.replaceWith(\"<i class='fa fa-star-o'></i>\");\n star = 2;\n }\n if (moveCount === 16) {\n $thirdStar.replaceWith(\"<i class='fa fa-star-o'></i>\");\n $secondStar.replaceWith(\"<i class='fa fa-star-o'></i>\");\n star = 1;\n }\n}", "title": "" }, { "docid": "876e16513fa14b2e9e0e1f4032d5335b", "score": "0.6295221", "text": "function noFirstStar() {\n\n if (click > 25) {\n let star = document.querySelector('li.starsFirst>i');\n star.setAttribute(\"class\", \"star\");\n starCount = 2;\n }\n }", "title": "" }, { "docid": "0da112379d7899fa4a499f073975bfbf", "score": "0.6284567", "text": "function lowerStars() {\n starRating--;\n tryCounter = 0;\n const stars = document.getElementsByClassName(`fa-star`);\n stars[starRating].className = `fa fa-star dimmed`;\n}", "title": "" }, { "docid": "cabc3ffbd4836fb0bfd7ab0040b82615", "score": "0.62789243", "text": "function getStars(num) {\n var stars = \"\",\n counter;\n\n if (num !== undefined) {\n for(counter = 0; counter < num; counter++) {\n stars += \"*\";\n }\n }\n\n return stars;\n}", "title": "" }, { "docid": "a6de364585fee48f4875a8c4528339fa", "score": "0.6260779", "text": "function countStars() {\n stars = document.querySelectorAll('.stars li');\n starNumber = 0;\n for (star of stars) {\n if (star.style.display !== 'none') {\n starNumber++;\n }\n }\n return starNumber;\n}", "title": "" }, { "docid": "15eb7ed8f004ce9265615b75a5c6d701", "score": "0.62563354", "text": "function browse_stars_current_rating(r, count){\n\t\tfor(var i=1+(count*10); i<(11*(count+1)-count); i++){\n\t\t\tvar star = document.getElementById(\"star\"+i);\n\t\t\tif(r+(count*10) >= (i)){\n\t\t\t\tstar.src = \"images/assets/rating_star.png\";\n\t\t\t} else {\n\t\t\t\tstar.src = \"images/assets/rating_star_off.png\";\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "163242a40bd347acb01115e78c55a25e", "score": "0.625183", "text": "function resetStars() {\n\t$('.fa-star').attr('class', 'fa fa-star');\n\tnumStars = 3;\n\t$('.num-stars').text(String(numStars));\n}", "title": "" }, { "docid": "3598c9e8e3e1a283c7092c4a53812d73", "score": "0.6240499", "text": "function getStar(rate) {\n var roundVote = Math.round(rate / 2);\n\n var graphStar = \"\";\n for (var i = 0; i < 5; i++) {\n if (i < roundVote) {\n graphStar += \"<i class='fas fa-star'></i>\"; //stelle piene\n } else {\n graphStar += \"<i class='far fa-star'></i>\"; //stelle vuote\n }\n }\n\n return graphStar;\n }", "title": "" }, { "docid": "16e74379be48fd7d0f38a7f553ccd523", "score": "0.62263197", "text": "function rating() {\n if (moves < 10) {\n starsContainer.innerHTML = star + star + star;\n } else if (moves < 15) {\n starsContainer.innerHTML = star + star;\n } else {\n starsContainer.innerHTML = star;\n }\n}", "title": "" }, { "docid": "cb033ded8be581a02cc7abd3bee1fb0c", "score": "0.62212837", "text": "function buildStarRating(stars)\r\n{\r\n let result = \"\";\r\n for(let i = 0; i < stars; i++){\r\n result += `<li style='display: inline'><i class=\"fa fa-star\"> </i> </li>`\r\n }\r\n return result;\r\n}", "title": "" }, { "docid": "a52b27c81ade69b8d7290479db4e1b8f", "score": "0.6197447", "text": "function starNumber(num) {\n\t\n}", "title": "" }, { "docid": "71c7f30da7bbf8dc150fb57c6cf2b11c", "score": "0.61891407", "text": "function getStars(rating) {\n\n\tvar stelle = \"\";\n\n\tfor (var i = 0; i < 5; i++) {\n\n\t\tif (i <= rating) {\n\t\t\tstelle += \"<i class='fas fa-star'></i>\";\n\t\t} else {\n\t\t\tstelle += \"<i class='far fa-star'></i>\";\n\t\t}\n\t}\n\treturn stelle\n}", "title": "" }, { "docid": "8aec7a37b8cee0898457da33edde07b1", "score": "0.6188391", "text": "function starRating() {\n if (moves > 9) {\n countStars = 2;\n sectionStar[2].style.display = \"none\";\n }\n if (moves > 16) {\n countStars = 1;\n sectionStar[1].style.display = \"none\";\n }\n}", "title": "" }, { "docid": "2126df7e5fd2cd805330e0251570d574", "score": "0.618459", "text": "function assignStars(rating){\r\n var stars = '';\r\n for (var i = 1; i <= 5; i++) {\r\n //if the the stars is under the rating value it will be colored;\r\n if(i <= rating){\r\n stars += '<span class=\"stars colored\"><i class=\"fas fa-star\"></i></span>';\r\n\r\n }\r\n else{\r\n stars += '<span class=\"stars\"><i class=\"far fa-star\"></i></span>';\r\n }\r\n }\r\n return stars;\r\n}", "title": "" }, { "docid": "770816c40d9f38a84ffc3654b6693367", "score": "0.6159946", "text": "function removeStar() {\n\t$('.fa-star').last().attr('class', 'fa fa-star-o');\n\tnumStars--;\n\t$('.num-stars').text(String(numStars));\n}", "title": "" }, { "docid": "da1f5b5d7df7bfb526608678a7dbe988", "score": "0.6152329", "text": "function resetStars() {\n $(\".fa-star-o\").attr(\"class\", \"fa fa-star\");\n numStars = 3;\n $(\".num-stars\").text(String(numStars));\n}", "title": "" }, { "docid": "e888c0e08b09304b0ff0a930db9fe622", "score": "0.614037", "text": "function starReset() {\n $(\".fa-star-o\").attr(\"class\", \"fa fa-star\");\n numStars = 3;\n $(\".num-stars\").text(String(numStars));\n}", "title": "" }, { "docid": "48a55ca6e8fc96d435d0e949abe07a07", "score": "0.61396843", "text": "function rating(counter) {\n if (counter < 10) {\n starsCount = 3;\n\n } else if (counter > 10 && counter < 20) {\n stars[2].className = 'fa fa-star-o';\n starsCount = 2;\n\n } else if (counter > 20) {\n stars[1].className += 'fa fa-star-o';\n starsCount = 1;\n\n }\n}", "title": "" }, { "docid": "e7d3ab54a016770dd23903b0781feb43", "score": "0.61323893", "text": "function updateStars(n) {\n const stars = document.querySelector('.stars');\n let s = \"\";\n for (i=0; i<n; i++) {\n s += \"<li><i class=\\\"fa fa-star\\\"></i></li>\";\n }\n stars.innerHTML = s;\n}", "title": "" }, { "docid": "6669a9c9b359e903f31c8bd6444ae583", "score": "0.61146945", "text": "function starPrint(num) {\n var fullStar = $(\"#fullstar-template\").html();\n var emptyStar = $(\"#emptystar-template\").html();\n var result = \"\";\n for(var i = 0; i < num; i++) {\n result += fullStar;\n }\n for(var j = 0; j < (5-num); j++) {\n result += emptyStar;\n }\n return result;\n}", "title": "" }, { "docid": "7f5241e857742d61599b3395c32f38dc", "score": "0.6099901", "text": "function setStarsTo(number) {\n const stars = document.getElementsByClassName('stars')[0];\n for(let i = 0; i < 3; i++){\n if (i < number) {\n stars.children[i].firstElementChild.className = 'fa fa-star';\n } else {\n stars.children[i].firstElementChild.className = 'fa fa-star-o';\n }\n }\n}", "title": "" }, { "docid": "a29e32cb7fceb0c54de3e175ce2c3973", "score": "0.6091453", "text": "function displayRating(rating){\n\t\t$(\".bk-rating\").removeClass(\"a-star-0 a-star-0-1 a-star-1 a-star-1-2 \" + \n\t\t\t\t\t\"a-star-2 a-star-2-3 a-star-3 a-star-3-4 a-star-4 a-star-4-5 a-star-5\");\n\n\t\tswitch (rating) {\n\t\t\tcase 0:\n\t\t\t\t$(\".bk-rating\").addClass('a-star-0');\n\t\t\t\tbreak;\n\t\t\tcase 0.5:\n\t\t\t\t$(\".bk-rating\").addClass('a-star-0-1');\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\t$(\".bk-rating\").addClass('a-star-1');\n\t\t\t\tbreak;\n\t\t\tcase 1.5:\n\t\t\t\t$(\".bk-rating\").addClass('a-star-1-2');\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$(\".bk-rating\").addClass('a-star-2');\n\t\t\t\tbreak;\n\t\t\tcase 2.5:\n\t\t\t\t$(\".bk-rating\").addClass('a-star-2-3');\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$(\".bk-rating\").addClass('a-star-3');\n\t\t\t\tbreak;\n\t\t\tcase 3.5:\n\t\t\t\t$(\".bk-rating\").addClass('a-star-3-4');\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t$(\".bk-rating\").addClass('a-star-4');\n\t\t\t\tbreak;\n\t\t\tcase 4.5:\n\t\t\t\t$(\".bk-rating\").addClass('a-star-4-5');\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\t$(\".bk-rating\").addClass('a-star-5');\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$(\".bk-rating\").addClass('a-star-0');\n\t\t\t\tbreak;\n\t\t}\n\t}", "title": "" }, { "docid": "156ff1cedc2e6592c5d2037b0937431e", "score": "0.6087465", "text": "function recipeReviewRating(num) {\n // clean out the stars\n for (i = 1; i <= 5; i++) {\n \tvar elementId = 'star_' + i;\n $('#' + elementId).addClass('fa-star-o');\n $('#' + elementId).removeClass('fa-star');\t\t\n }\n // add the stars back in\n for (i = 1; i <= num; i++) {\n \tvar elementId = 'star_' + i;\n $('#' + elementId).addClass('fa-star');\n $('#' + elementId).removeClass('fa-star-o');\n }\n $(\"#rating\").val(num);\t \n}", "title": "" }, { "docid": "cb94d8b2da11f153fbfcc3c3ce397ccd", "score": "0.605519", "text": "function getStars() {\n stars = document.querySelectorAll('.stars li');\n starCount = 0;\n for (star of stars) {\n if (star.style.display !== 'none') {\n starCount++;\n }\n }\n return starCount;\n}", "title": "" }, { "docid": "3ddcf2cfd5be38f84f2c298f2f85337d", "score": "0.60527015", "text": "function restartStars() {\n $(\".fa-star-o\").attr(\"class\", \"fa fa-star\");\n numberStars = 3;\n $(\".numstars\").text(String(numberStars));\n}", "title": "" }, { "docid": "7f75648f490d8cc37bb4aa9947a03d54", "score": "0.6048561", "text": "function resetStars () {\n //let stars = 0;\n const starsList = document.querySelectorAll('.stars li');\n for (star of starsList) {\n star.style.display = 'inline';\n }\n}", "title": "" }, { "docid": "d6b2270986219f5a9e8affc335d07382", "score": "0.60409665", "text": "function star_rating(total_rating){\n var star_widht = total_rating * 17 ;\n jQuery('.rating_votes').width(star_widht);\n jQuery('.rating_stars').hover(function() {\n jQuery('.rating_votes, .rating_hover').toggle();\n },\n function() {\n jQuery('.rating_votes, .rating_hover').toggle();\n });\n var margin_doc = jQuery(\".rating_stars\").offset();\n jQuery(\".rating_stars\").mousemove(function(e){\n var widht_votes = e.pageX - margin_doc.left;\n if (widht_votes == 0) widht_votes = 1 ;\n user_votes = Math.ceil(widht_votes/17); \n jQuery('.rating_hover').width(user_votes*17);\n });\n jQuery('.rating_stars').click(function(){\n jQuery('.rating_votes').width((user_votes)*17);\n document.getElementById(\"nodes_rating\").value = user_votes;\n });\n}", "title": "" }, { "docid": "f90fa07369223662e01a5f8cd4846a67", "score": "0.60188866", "text": "getStarsHTML(starsCount) {\n let html = '<ul class=\"productCard__stars\">';\n\n for (let starIndex = 1; starIndex <= starsCount; starIndex++) {\n html += `<li class=\"productCard__stars--star-filled\"></li>`;\n }\n\n if (starsCount < 5) {\n for (let starIndex = starsCount; starIndex < 5; starIndex++) {\n html += `<li class=\"productCard__stars--star\"></li>`;\n }\n }\n\n html += \"</ul>\";\n return html;\n }", "title": "" }, { "docid": "8679886ab8e7eb06ab5a29ba52d31238", "score": "0.6007589", "text": "function ratingStars(){\n let rating = 5 //can be changed according to the product\n var stars = document.querySelectorAll(\".rating\")\n for(let i=0; i<stars.length; i++){\n for(let j=0; j<rating; j++){\n stars[i].innerHTML += `\n <div class=\"bi-star-fill\"></div>\n `\n }\n \n }\n}", "title": "" }, { "docid": "3b959b1652ef82116a93fd292221dc3b", "score": "0.60028774", "text": "function showStars(num) {\n if (num === 0) {\n stars[0].src = \"images/star.png\";\n }\n else if (num === 1) {\n stars[0].src = \"images/star.png\";\n stars[1].src = \"images/star.png\";\n }\n else if (num === 2) {\n stars[0].src = \"images/star.png\";\n stars[1].src = \"images/star.png\";\n stars[2].src = \"images/star.png\";\n }\n else if (num === 3) {\n stars[0].src = \"images/star.png\";\n stars[1].src = \"images/star.png\";\n stars[2].src = \"images/star.png\";\n stars[3].src = \"images/star.png\";\n }\n else if (num === 4) {\n stars[0].src = \"images/star.png\";\n stars[1].src = \"images/star.png\";\n stars[2].src = \"images/star.png\";\n stars[3].src = \"images/star.png\";\n stars[4].src = \"images/star.png\";\n }\n }", "title": "" }, { "docid": "3fd14e8be1077d5e08c58a446d63b6e5", "score": "0.59807897", "text": "function srating() {\n\tif (move >= 12 && move < 15) {\n\t\tstarCount = 2;\n\t\tstarSection[2].style.display = \"none\";\n\t}\n\tif (move >= 15) {\n\t\tstarCount = 1;\n\t\tstarSection[1].style.display = \"none\";\n\t}\n}", "title": "" }, { "docid": "b1c2aefadab02155e3c145c0b209240c", "score": "0.5978776", "text": "function removeStar() {\n $(\".fa-star\").last().attr(\"class\", \"fa fa-star-o\");\n numStars--;\n $(\".num-stars\").text(String(numStars));\n}", "title": "" }, { "docid": "9441d1a7d45b18ec101d2b995f554c3f", "score": "0.59783185", "text": "function resetStars(){\n stars = 0;\n const starz = document.querySelectorAll('.stars li');\n for (const star of starz){\n star.style.display = 'inline';\n }\n}", "title": "" }, { "docid": "7e3e8d658db850e4b34acc6ce438eb36", "score": "0.5966246", "text": "function removeStar() {\n $(\".fa-star\").last().attr(\"class\", \"fa fa-star-o\");\n numStars--;\n $(\".num-stars\").text(String(numStars));\n}", "title": "" }, { "docid": "03c3bddd974eacd4ba886c631b7bab32", "score": "0.59613305", "text": "function Rating (){\n if (moves > 10 && moves < 17){\n for( i= 0; i < allstar.length; i++){\n if(i > 1){\n stars[stars.length-1].style.visibility = \"hidden\";\n\n }\n }\n }\n else if (moves > 18){\n for( i= 0; i < allstar.length; i++){\n if(i > 0){\n stars[stars.length-1].style.visibility = \"hidden\";\n\n }\n }\n }\n }", "title": "" }, { "docid": "fb88a62a920cb843f8e1dbf06e21258b", "score": "0.5957142", "text": "function stars_current_rating(){\n\t\tfor(var i=1; i<=10; i++){\n\t\t\tvar star = document.getElementById(\"star\"+i);\n\t\t\tif(i<=current_rating){\n\t\t\t\tstar.src = \"images/assets/rating_star.png\";\n\t\t\t} else {\n\t\t\t\tstar.src = \"images/assets/rating_star_off.png\";\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "a6bd8718ab01387a509d150e69b5bd9a", "score": "0.5952649", "text": "function addStars(item) {\n var stars = '';\n for (var i = 1; i <= 5; i++) {\n if (item.vote_average < i) {\n stars += '<i class=\"far fa-star\"></i>';\n } else {\n stars += '<i class=\"fas fa-star\"></i>';\n }\n }\n return stars;\n}", "title": "" }, { "docid": "aa17e0f2a8506b86112fd65964ced184", "score": "0.5944714", "text": "function StarList({ list, showAverage }) {\n // Returns the average of input list.\n function averageRating() {\n let average = 0;\n if (list.length === 0) {\n return 0;\n }\n list.forEach((rating) => {\n average += rating;\n });\n\n average /= list.length;\n return average;\n }\n\n const average = averageRating();\n const starCount = ((Math.round(average * 4) / 4) / 5) * 100;\n\n return (\n <div>\n <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css\" />\n {showAverage && (\n <span className={css.averageRating}>\n {average}\n </span>\n )}\n <div className={css.starsOuter}>\n <div id=\"inner\" className={css.starsInner} style={{ width: `${starCount}%` }} />\n </div>\n </div>\n );\n}", "title": "" }, { "docid": "a110d9ce637b102aca2c6b4063a65249", "score": "0.5936539", "text": "function starRating(numMoves) {\n if (numMoves < 8) {\n starElems.children[0].className = 'fas fa-star';\n starElems.children[1].className = 'fas fa-star';\n starElems.children[2].className = 'fas fa-star';\n }\n else if (numMoves > 8 && numMoves < 20) {\n starElems.children[0].className = 'far fa-star';\n starElems.children[1].className = 'fas fa-star';\n starElems.children[2].className = 'fas fa-star';\n } else if (numMoves > 20 && numMoves < 32) {\n starElems.children[0].className = 'far fa-star';\n starElems.children[1].className = 'far fa-star';\n starElems.children[2].className = 'fas fa-star';\n } else if (numMoves > 32) {\n starElems.children[0].className = 'far fa-star';\n starElems.children[1].className = 'far fa-star';\n starElems.children[2].className = 'far fa-star';\n }\n }", "title": "" }, { "docid": "49818e7e7dea5bafa89a0ee241068f24", "score": "0.5932046", "text": "function addStars(ths, sno) {\n for (var i = 1; i <= 5; i++) {\n var cur = document.getElementById('star' + i)\n cur.className = \"fa fa-star\"\n }\n\n for (var i = 1; i <= sno; i++) {\n var cur = document.getElementById('star' + i)\n if (cur.className == \"fa fa-star\") {\n cur.className = \"fa fa-star checked\"\n }\n }\n\n rating = sno;\n return rating;\n}", "title": "" }, { "docid": "40a7c8fb9361a3c5fff49edfd9aa60e5", "score": "0.59294176", "text": "function decide_rating( r ){\n\t\tfor(var i=1; i<=10; i++){\n\t\t\tvar star = document.getElementById(\"star\"+i);\n\t\t\tif(i<=r){\n\t\t\t\tstar.src = \"images/assets/rating_star.png\";\n\t\t\t} else {\n\t\t\t\tstar.src = \"images/assets/rating_star_off.png\";\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "f420279771d187a4a6856c169b9f5a5b", "score": "0.5925329", "text": "function starHandler() {\n if (numberOfMoves > 30) {\n stars[1].className = '';\n starStatistics = 1;\n } else if (numberOfMoves > 18) {\n stars[2].className = '';\n starStatistics = 2;\n }\n }", "title": "" }, { "docid": "90f95c259b8aa5fcd61656adfd22bebf", "score": "0.59252834", "text": "updateRating() {\n const starElem = document.querySelector('.stars');\n const star = `<li><i class=\"fa fa-star\"></i></li>`;\n // exit function if attempts is zero (game was restarted)\n if (!this.attempts) {\n starElem.innerHTML = star.repeat(5);\n return;\n }\n const matchRate = this.matches / this.attempts;\n if (matchRate >= 0.8) {\n starElem.innerHTML = star.repeat(5);\n } else if (matchRate >= 0.6) {\n starElem.innerHTML = star.repeat(4);\n } else if (matchRate >= 0.4) {\n starElem.innerHTML = star.repeat(3);\n } else if (matchRate >= 0.2) {\n starElem.innerHTML = star.repeat(2);\n } else {\n starElem.innerHTML = star;\n }\n }", "title": "" }, { "docid": "200601f8a991682f870fa6521fec2c73", "score": "0.59217244", "text": "function starRating() {\n if (moves >= 12 && moves <= 18) {\n starCount = 2;\n starSection[2].style.display = \"none\";\n }\n if (moves > 18) {\n starCount = 1;\n starSection[1].style.display = \"none\";\n }\n}", "title": "" }, { "docid": "ec5fe7993dbde76f0348af0c4b84c0ee", "score": "0.59192353", "text": "function getvote(number){\n \n var value = Math.floor(number/2);\n\n var stars = \"\";\n for(var i = 1; i<= 5; i++){\n if(i <= value){\n stars += '<i class=\"fas fa-star\"></i>';\n }else{\n stars += '<i class=\"far fa-star\"></i>';\n }\n }\n return stars;\n}", "title": "" }, { "docid": "97c98340e08a418b13894245a37728eb", "score": "0.59157777", "text": "function getStars(){\n const stars = document.querySelectorAll('.stars li');\n starCount = 0;\n for (const star of stars){\n if (star.style.display !== 'none'){\n starCount+=1;\n }\n }\n return starCount;\n}", "title": "" }, { "docid": "05f9102c300e6d6efa608ce5fceb1014", "score": "0.5909819", "text": "function getStarsSpans(stars) {\n let new_html = '';\n for( let i = 0; i < stars; i++) {\n new_html += `\n <span class=\"fa fa-star checked\"></span>\n `;\n }\n\n for ( let i = 0; i < 5 - stars; i++ ) {\n new_html += `\n <span class=\"fa fa-star\"></span>\n `;\n }\n\n if(new_html=='')\n new_html += `\n <p>No stars</p>\n `;\n\n return new_html;\n}", "title": "" }, { "docid": "dd288d56b600b28fba460cf3384a64c1", "score": "0.5908206", "text": "function getStarCount() {\n let counter = 3;\n const stars = [\"star1\", \"star2\", \"star3\"];\n for (star of stars) {\n const htmlStar = document.getElementById(star);\n if (htmlStar.classList.contains(\"hide\")) {\n counter--;\n }\n }\n return counter;\n}", "title": "" }, { "docid": "25b3c3c80384ed09847991c68a55ab4a", "score": "0.5907347", "text": "function getRandomStar(){\n var random = Math.floor(Math.random() * starCount) + 0;\n if (random == randomStar){\n getRandomStar();\n }\n else{\n randomStar = random;\n }\n console.log('Selected star: ' + randomStar);\n return randomStar;\n}", "title": "" }, { "docid": "3428bc79735de254e69ba12f574f449f", "score": "0.5907104", "text": "function rating() {\r\n if (move < 10) {\r\n star.innerHTML = star1 + star1 + star1;\r\n } else if (move < 13) {\r\n star.innerHTML = star1 + star1;\r\n } else {\r\n star.innerHTML = star1;\r\n }\r\n}", "title": "" }, { "docid": "0a68c30320b429cd41756db97c71becb", "score": "0.5897231", "text": "function resetStarRating() {\n $(\".stars li\").css(\"color\", \"black\");\n $(\".stars-summary\").html(\"3\");\n}", "title": "" }, { "docid": "ad75ceac8c4d056747ad7ff61dfd1be0", "score": "0.58961946", "text": "function getStars() {\n stars = document.querySelectorAll('.stars li');\n starTotal = 0;\n for(star of stars) {\n if(star.style.display !== 'none') {\n starTotal++;\n }\n }\n return starTotal;\n}", "title": "" }, { "docid": "bf97cc28034974477a2951ad0db1ede9", "score": "0.5890316", "text": "function displayStars()\n{\n\tif(moves<18)\n \t{\n \t\tstarrate=3;\n \t\trating(2);\n \t}\n \telse if(moves>=18&&moves<26)\n \t{\n \t\tstarrate=2;\n \t\trating(1);\n \t}\n \telse\n \t{\n \t\tstarrate=1;\n \t\trating(0);\t\n \t}\n}", "title": "" }, { "docid": "d3b7608bc55fe562c1163284f18c3d49", "score": "0.58781123", "text": "function rate(v) {\n // Default value\n if(! v) { v = 3;}\n \n rateView.value = v;\n for(i = min; i <= max ; i ++) {\n stars[i].setImage( v>= i ? \"/images/star.png\" : \"/images/star_highlighted.png\");\n }\n }", "title": "" }, { "docid": "61bc042ce1e770039f75c2f6adca0b5c", "score": "0.5876405", "text": "function starRating() {\n (parseFloat(moveCounter.textContent) === 16) ? (\n stars[2].style.color = '#fff',\n starCounter = 2\n ) : (parseFloat(moveCounter.textContent) === 28) ? (\n stars[1].style.color = '#fff',\n starCounter = 1\n ) : null;\n}", "title": "" }, { "docid": "a2e918fd355ad571d8baf4c6916da537", "score": "0.58740765", "text": "static rating2stars(rating) {\n\n const totalStars = 5;\n const charFull = '&#61445;'; //font-awesome: fa-star, \\f005\n const charHalf = '&#61731;'; //font-awesome: fa-star-half-o \\f123\n const charEmpty = '&#61446;'; //font-awesome: fa-star-o, \\f006\n\n let fullStars = Math.trunc(rating);\n let emptyStars = Math.trunc(totalStars - rating);\n let hasHalfStar = fullStars + emptyStars < totalStars;\n\n //Return the star characters as a string\n return charFull.repeat(fullStars) + charHalf.repeat(hasHalfStar * 1) + charEmpty.repeat(emptyStars);\n }", "title": "" }, { "docid": "57e4e1781f409866237d1b9341ba8e3d", "score": "0.58573866", "text": "function stars(numb) {\n let text = \"\";\n for (i = 1; i <= numb; i++) {\n text += \"* \";\n console.log(text);\n }\n}", "title": "" }, { "docid": "78d956242b068e876200475f54fc157d", "score": "0.5857367", "text": "function generateRating(rating) {\n if (rating===undefined) {\n return 'No Rating Available';\n }\n else {\n var output = '';\n\n for (var i=1; i < 6; i++) {\n if (rating >= i) {\n output+='<i class=\"fa fa-star\"></i>';\n }\n else if (rating >= i-.5) {\n output+='<i class=\"fa fa-star-half-o\"></i>';\n }\n else {\n output+='<i class=\"fa fa-star-o\"></i>';\n }\n }\n output += ' ('+rating+')';\n return output;\n }\n}", "title": "" }, { "docid": "590a5eefac11a721c5ef4570977eae7b", "score": "0.5845476", "text": "function starsUpdate() {\n if (moves > 12) {\n stars = 2;\n starsPane[2].style.display = 'none';\n }\n if (moves > 16 && moves < 21) {\n stars = 1;\n starsPane[1].style.display = 'none';\n }\n if (moves > 20) {\n stars = 0;\n starsPane[0].style.display = 'none';\n }\n}", "title": "" }, { "docid": "a415d6fa12397689a0342eb8b6193f46", "score": "0.5833294", "text": "function getStarsSpans(stars) {\n let new_html = '';\n for( let i = 0; i < stars; i++) {\n new_html += `\n <span class=\"fa fa-star checked\"></span>\n `;\n }\n\n for ( let i = 0; i < 5 - stars; i++ ) {\n new_html += `\n <span class=\"fa fa-star\"></span>\n `;\n }\n\n return new_html;\n}", "title": "" }, { "docid": "9eb0b16da1e30377fa68ab571306b900", "score": "0.58230114", "text": "function showRating() {\n let starRate = document.querySelector(\".stars\").innerHTML;\n // show ratiing\n document.getElementById(\"rating\").innerHTML = starRate;\n}", "title": "" }, { "docid": "45e59455a54f38460980eee08c14259c", "score": "0.58208233", "text": "function printStar(){\n\tfor(i=1;i<=4;i++){\n\t\tfor(j=0;j<i;j++){\n\t\t\tconsole.log('*');\n\t\t}\n\t\tconsole.log(\"\");\n\t}\n}", "title": "" }, { "docid": "9ea4182ac22dc886984a0f4581a97cc5", "score": "0.5817785", "text": "function updateStarRating() {\n if (moveCounter === appConstants.numberOfMovesToChangeRating) {\n $(\".stars\").empty();\n $(\".stars\").append(starHtml);\n $(\".stars\").append(starHtml);\n starRating--;\n } else if (moveCounter === (appConstants.numberOfMovesToChangeRating * 2)) {\n $(\".stars\").empty();\n $(\".stars\").append(starHtml);\n starRating--;\n }\n }", "title": "" }, { "docid": "580f6369c1acaf9d4082d5e8e3535e45", "score": "0.58113956", "text": "function starRating(){\n if (moves.innerHTML > 20 && moves.innerHTML <= 30){\n uls[0].children[0].firstChild.className = \"fa fa-star-o\"\n } else if (moves.innerHTML > 30) {\n uls[0].children[1].firstChild.className = \"fa fa-star-o\"\n }\n else {\n }\n}", "title": "" }, { "docid": "4fd8ce428805f21ad282e9583f96c13e", "score": "0.57969224", "text": "function rating() {\n var count = prompt('How easy was it for you to register to vote? Enter a number between 1 and 5 below, where 1 is \"Not easy\" and 5 is \"Very easy.\"')\n var item = '<img src=\"images/star.png\" class=\"star\">';\n\n while (count === '' || isNaN(count) || count < 1 || count > 5) {\n count = prompt('Please enter a number between 1 and 5.');\n }\n\n if (count == 1) {\n document.getElementById(\"experienceRating\").innerHTML = item;\n }\n\n if (count == 2) {\n document.getElementById(\"experienceRating\").innerHTML = item + item;\n }\n\n if (count == 3) {\n document.getElementById(\"experienceRating\").innerHTML = item + item + item;\n }\n\n if (count == 4) {\n document.getElementById(\"experienceRating\").innerHTML = item + item + item + item;\n }\n\n if (count == 5) {\n document.getElementById(\"experienceRating\").innerHTML = item + item + item + item + item;\n }\n }", "title": "" }, { "docid": "bd6699afbea87ec20c0c00b28bca7b5c", "score": "0.5796367", "text": "function starRating() {\r\n let starsList = document.querySelector('.stars');\r\n if (moves === 15) {\r\n stars = 2;\r\n starsList.firstElementChild.remove();\r\n } else if (moves === 20) {\r\n stars = 1;\r\n starsList.firstElementChild.remove();\r\n } else if (moves === 28) {\r\n stars = 0;\r\n starsList.firstElementChild.remove();\r\n }\r\n}", "title": "" }, { "docid": "207ae80be5c6425f309377a4f95646af", "score": "0.57891566", "text": "function decreaseStar() {\n $(\".fa-star\").last().attr(\"class\", \"fa fa-star-o\");\n numberStars--;\n $(\".numstars\").text(String(numberStars));\n}", "title": "" }, { "docid": "502fec6554f68db34e57baa9eeca2851", "score": "0.57866895", "text": "function rateStars(elem, rating) {\n // mark stars below clicked\n for (i = rating, starElem = elem; i > 0 && starElem != null;) {\n // Ensure sibling if the 'star-rating' span\n if (starElem.classList != null && starElem.classList.contains(\"star-rating\")) {\n // Show full star\n starElem.children[0].classList.remove(\"hidden\");\n // Hide empty star\n starElem.children[1].classList.add(\"hidden\");\n // Decrement index only if elem was a star-rating\n i--;\n }\n // Move to previous\n starElem = starElem.previousSibling;\n }\n\n // clear stars above clicked\n for (i = rating, starElem = elem; i < 5;) {\n // Skip current and move next\n starElem = starElem.nextSibling;\n // Ensure sibling if the 'star-rating' span\n if (starElem != null && starElem.classList != null && starElem.classList.contains(\"star-rating\")) {\n // Hide full star\n starElem.children[0].classList.add(\"hidden\");\n // Show empty star\n starElem.children[1].classList.remove(\"hidden\");\n // Increment index only if elem was a star-rating\n i++;\n }\n }\n}", "title": "" }, { "docid": "5bd3c3060760291f6c77658c760b9d6c", "score": "0.5786525", "text": "function Stars({ starCount }) {\n if (starCount === 1) {\n return (\n <div className=\"stars_wrapper\">\n <i className=\"stars stars_1\" />\n </div>\n );\n }\n if (starCount === 2) {\n return (\n <div className=\"stars_wrapper\">\n <i className=\"stars stars_2\" />\n </div>\n );\n }\n if (starCount === 3) {\n return (\n <div className=\"stars_wrapper\">\n <i className=\"stars stars_3\" />\n </div>\n );\n }\n if (starCount === 4) {\n return (\n <div className=\"stars_wrapper\">\n <i className=\"stars stars_4\" />\n </div>\n );\n }\n if (starCount === 5) {\n return (\n <div className=\"stars_wrapper\">\n <i className=\"stars stars_5\" />\n </div>\n );\n }\n if (starCount === 0) {\n return (\n <div className=\"stars_wrapper\">\n <i className=\"stars stars_0\" />\n </div>\n );\n }\n}", "title": "" }, { "docid": "48278bc16b8aeb026adabd70ad705762", "score": "0.57782084", "text": "function countStars(stars) {\n const starModalCountText = document.querySelector('.modal-stars');\n starModalCountText.innerHTML = `You finished with: ${stars} stars`;\n}", "title": "" }, { "docid": "58bbd0e11b825b4e2dc7d6df3472c7e1", "score": "0.5775121", "text": "function makeStar1(num){\n var stars = ''\n for (var i = num ; i > 0 ; i--) stars+='*'+'/n'\n return stars\n}", "title": "" }, { "docid": "d5ed013280bec3c511a47fb2e9805bf5", "score": "0.577152", "text": "startStars () {\n //get div that will hold stars\n const $startStarBox = $( '.remaining-stars' );\n //for game restart/reset empty any leftover stars from last round\n $startStarBox.children().remove();\n //sets stars/wrong guesses to 6 and shows stars that represent this\n for (let i = 0; i < 6; i++){\n let $starDiv = $( '<div>' ).addClass( 'star' );\n let $starImg = $( '<img>' ).attr( 'src', './images/Star.png' );\n $starDiv.append( $starImg );\n $startStarBox.append( $starDiv );\n }\n }", "title": "" }, { "docid": "0500d7fa9c4986c59510b2c59f8f619a", "score": "0.575799", "text": "function numberStars() {\n let starCount = 0;\n document.querySelectorAll('.stars li').forEach(function(each) {\n if (each.style.opacity === '1') {\n starCount++;\n }\n });\n return starCount;\n}", "title": "" }, { "docid": "ad643e73bd1fc2093b63feb17c53205e", "score": "0.5749925", "text": "function resetStars() {\n starRating = 3;\n stars[0].style.visibility = 'visible';\n stars[1].style.visibility = 'visible';\n}", "title": "" }, { "docid": "35a22cd8ef0fda9cd2dbbe59812e94cb", "score": "0.5745925", "text": "function selectStar() {\n let selectedStar = indicateStar.apply(this);\n $('#star-rating-control').attr('data-selected', selectedStar);\n $('#star-rating-control img[id^=star-button-]')\n .off('mouseout')\n .mouseout(restoreSelected);\n $('#review-rating').val(selectedStar);\n $('#review-rating').trigger('change');\n }", "title": "" }, { "docid": "0889de08091da3b1d5e8d59981f44501", "score": "0.5744939", "text": "render_stars() {\n const maxRating = 5;\n let stars = [];\n\n for (let i = 1; i <= maxRating; i++) {\n stars.push(\n <Star\n key={i}\n isSelected={i <= this.state.rating}\n setRating={() => this.handleSetRating(i)}\n />\n );\n }\n return stars;\n }", "title": "" }, { "docid": "5a5b4245839270c5534ce23a2a82bf0e", "score": "0.57351506", "text": "function displayRATING(y){\n\t\t\tvar z;\n\t\t\tif (settings_type == \"star\") {\n\t\t\t\tfor(z = settings_firstvalue; z <= y; z++ ) {\n\t\t\t\t\t$('#' + divname + \"_ratings_back_\" + z).css({\n\t\t\t\t\t\t\"opacity\" : \"1.0\"\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tfor(z = y + settings_firstvalue ; z <= ((settings_firstvalue-1) + settings_count); z++ ) {\n\t\t\t\t\t$('#' + divname + \"_ratings_back_\" + z).css({\n\t\t\t\t\t\t\"opacity\" : \"0.0\"\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor(z = settings_firstvalue; z <= ((settings_firstvalue-1) + settings_count); z++ ) {\n\t\t\t\t\t$('#' + divname + \"_ratings_back_\" + z).css({\n\t\t\t\t\t\t\"opacity\" : \"0.0\"\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t$('#' + divname + \"_ratings_back_\" + y).css({\n\t\t\t\t\t\"opacity\" : \"1.0\"\n\t\t\t\t});\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "c49eb1897c7b73d4c2c4be17cc104d7d", "score": "0.5730592", "text": "function getStars() {\n const stars = document.getElementsByClassName('stars')[0];\n return stars.getElementsByClassName('fa-star').length;\n}", "title": "" }, { "docid": "4ea78270c48182f65c99b03b8ad4030c", "score": "0.5728383", "text": "function initStars() {\n\n/* The hide/change all/show pattern is used. */\n\n\tstars.classList.add('hidden');\n\n\tfor (let i = 0; i < starCounter; i++) {\n\t\tstars.firstElementChild.remove();\n\t}\n\n\tlet docFrag = document.createDocumentFragment();\n\n\tfor (let i = 0; i < maxNumberOfStars; i++) {\n\t\tstarHTML1 = document.createElement('li');\n\t\tstarHTML2 = document.createElement('i');\n\t\tstarHTML2.classList.add('fa');\n\t\tstarHTML2.classList.add('fa-star');\n\t\tstarHTML1.appendChild(starHTML2);\n\t\tdocFrag.appendChild(starHTML1);\n\t}\n\tstars.appendChild(docFrag);\n\tstars.classList.remove('hidden');\n}", "title": "" }, { "docid": "9544d6681ac0b244090665231f3f66d8", "score": "0.57275313", "text": "function rating() {\n if (moves.textContent > 25) {\n stars[1].classList.remove(\"fa\");\n stars[2].classList.remove(\"fa\");\n stars[3].classList.remove(\"fa\");\n stars[4].classList.remove(\"fa\");\n stars[1].classList.add(\"far\");\n stars[2].classList.add(\"far\");\n stars[3].classList.add(\"far\");\n stars[4].classList.add(\"far\");\n text = \"1 star\";\n return text;\n } else if (moves.textContent > 18 && moves.textContent <= 25) {\n stars[2].classList.remove(\"fa\");\n stars[3].classList.remove(\"fa\");\n stars[4].classList.remove(\"fa\");\n stars[2].classList.add(\"far\");\n stars[3].classList.add(\"far\");\n stars[4].classList.add(\"far\");\n text = \"2 stars\";\n return text;\n } else if (moves.textContent > 12 && moves.textContent <= 18) {\n stars[3].classList.remove(\"fa\");\n stars[4].classList.remove(\"fa\");\n stars[3].classList.add(\"far\");\n stars[4].classList.add(\"far\");\n text = \"3 stars\";\n return text;\n } else if (moves.textContent > 10 && moves.textContent <= 12) {\n stars[4].classList.remove(\"fa\");\n stars[4].classList.add(\"far\");\n text = \"4 stars\";\n return text;\n } else {\n text = \"5 stars\";\n return text;\n } //ends if else\n} //closes rating function", "title": "" }, { "docid": "5ce1bba3b4bac6ba5b7508be52a6ea2e", "score": "0.5725456", "text": "function starRating(x) {\n let starArray = $('.stars li').children().toArray()\n $(starArray).attr('class', 'fa fa-star');\n while (x > 0) {\n $(starArray.pop()).attr('class', 'fa fa-star-o')\n x = x - 1;\n }\n \n}", "title": "" }, { "docid": "5a84110400010403c2a88c692c5da47b", "score": "0.57194304", "text": "function star(size) {\n penUp();\n var x = randomNumber(0,320);\n var y = randomNumber(0,450);\n penColor(rgb(randomNumber(220,255),randomNumber(200,255),randomNumber(0,200)));\n moveTo(x,y);\n //This is so the stars aren't all in the same direction\n turnTo(randomNumber(0,360));\n //This seemed to be the magic number to fill the stars\n penWidth(size/3);\n //for loop for drawing the stars\n for (var i = 0; i < 5; i++) {\n penDown();\n moveForward(size);\n turnRight(144);\n penUp();\n }\n }", "title": "" }, { "docid": "e138cdef780116a194bc4fc1147fb9c0", "score": "0.57189757", "text": "function stars() {\n if (sec === 25) {\n removeStar();\n } else if (sec === 32) {\n removeStar();\n }\n}", "title": "" }, { "docid": "773d7de0f6f11b944d7ea619c7aed6cc", "score": "0.5714404", "text": "function getPlaceStarRating(rating) {\n if (!rating) {\n return \"No rating\";\n }\n\n const RATING_TOTAL = 5;\n const stars = [];\n const remainder = Math.round((rating % 1) * 2) / 2;\n\n for (let i = 1; i <= RATING_TOTAL; i++) {\n if (i <= rating) {\n stars.push(fullStar);\n } else {\n stars.push(emptyStar);\n }\n }\n\n if (remainder === 0.5) {\n stars[Math.floor(rating)] = halfStar;\n }\n\n if (remainder === 1) {\n stars[Math.floor(rating)] = fullStar;\n }\n\n return stars.join(\"\");\n}", "title": "" }, { "docid": "01cfa9fcc22ad7d22cc2da4ce45b25d5", "score": "0.57078695", "text": "function insertMean(val) {\r\n var arival = '<span id=\"gm_imdbari_arival\"></span>/10', \r\n nfoTxt = LNG.up.replace(/{t}/, ((DIFF < 1) ? LNG.td : ((parseInt(DIFF) > 1) ? \r\n LNG.dys.replace(/{d}/, parseInt(DIFF)) : LNG.yd))) + ', ' + LNG.re;\r\n if (OLD === null || STARS !== true) {\r\n // new layout OR old layout without extra stars\r\n var sml = document.createElement('small'), bfr;\r\n sml.innerHTML = '(' + arival + ')';\r\n sml.title = LNG.ari;\r\n if (UPDATE > 0) {\r\n sml.id = 'gm_imdbari_rld';\r\n sml.title += ' - ' + nfoTxt;\r\n sml.style.cursor = 'pointer';\r\n sml.addEventListener('click', refetchHandler, false);\r\n }\r\n if (OLD === null) {\r\n // new layout\r\n bfr = $C('star-bar-user-rate')[0].nextSibling;\r\n sml.className = 'mellow';\r\n sml.style.paddingLeft = '5px';\r\n } else {\r\n // old layout without extra stars\r\n bfr = $C('starbar-meta')[0].getElementsByTagName('A')[0];\r\n sml.style.paddingRight = '12px';\r\n }\r\n bfr.parentNode.insertBefore(sml, bfr);\r\n } else {\r\n // old layout with extra stars\r\n var wei = $C('general', OLD)[0], ari = wei.cloneNode(true), top = $C('starbar-special', ari), \r\n weiTxt = wei.getElementsByTagName('H5')[0], meta = $C('starbar-meta', ari)[0];\r\n $C('inner', ari)[0].id = 'gm_imdbari_strs';\r\n if (top[0]) top[0].style.display = 'none';\r\n $C('starbar-votes', ari)[0].style.display = 'none';\r\n ari.getElementsByTagName('H5')[0].innerHTML = LNG.ari + ':'\r\n weiTxt.innerHTML = weiTxt.innerHTML.replace(/:/, ' (' + LNG.wei + '):');\r\n meta.innerHTML = '<b>' + arival + '</b>';\r\n if (UPDATE > 0) {\r\n var rld = document.createElement('img');\r\n rld.id = 'gm_imdbari_rld';\r\n rld.src = 'data:image/gif;base64,R0lGODlhEAAQAIcAMfLy8llZWaqqqszMzIiIiFtbW11dXeXl5WJiYqioqOTk5F5eXq6urn19fWdnZ21tbW9vb4aGhu7u7mBgYIuLi39%2Ff6Wlpe3t7c7OzsPDw%2BLi4sXFxdzc3ODg4GlpaaysrAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAABwhoAAEIHEiwoMGDCAlS6JCwYIAFCSQkHEDAQ4CLEDYcFHCxY4AHGQwOKGAggYaHFi4cbBBAgMAIHBIiCHCg4cCZNQceCDDBIEuXAz8EqCCSJAMFChgYKIBho8eLQA9SdOCAwACbWLMCCAgAOw%3D%3D';\r\n rld.width = rld.height = '14';\r\n rld.alt = LNG.re;\r\n rld.title = nfoTxt;\r\n rld.style.paddingLeft = '10px';\r\n rld.style.cursor = 'pointer';\r\n rld.addEventListener('click', refetchHandler, false);\r\n meta.appendChild(rld);\r\n }\r\n OLD.insertBefore(ari, wei.nextSibling);\r\n }\r\n updateMean(val);\r\n}", "title": "" }, { "docid": "e1c8bcb7d777dfd722f6bf4b86792947", "score": "0.5704637", "text": "function makeStars() {\n for (i = 0; i < 4; i++) {\n stars += \"* \";\n console.log(stars)\n }\n}", "title": "" }, { "docid": "f67826a3a49ed65a8f86f0df60803f1e", "score": "0.5696544", "text": "function starMechanism(wrongMoves) {\n if (wrongMoves % 10 == 0 && starIndex < stars.length - 1) {\n stars[starIndex].classList.add('fa-star-o');\n starIndex++;\n }\n}", "title": "" }, { "docid": "8f093284af7a5a66f0fa37c7d598d16d", "score": "0.5692541", "text": "function displayRating(ratings) {\n let rating = \"\";\n //Réinitialisation de bakground-size à 0\n modalRating.style.backgroundSize = 0;\n //Si des votes sont disponibles\n if (ratings[\"votes-count\"] > 0) {\n rating = ratings.value;\n //Conversion de la note sur 100\n rating *= 20;\n //Conversion en chaine de caractères + pourcentage\n rating += \"%\";\n //Changement du background-size en fonction de la note\n modalRating.style.backgroundSize = rating;\n } else { //Si aucun vote n'est disponible\n rating = \"No rating found for this title\";\n }\n //Affichage de la valeur rating\n modalRating.textContent = rating;\n}", "title": "" }, { "docid": "4f51b21c8cf67bb1ec628ffd1f012e34", "score": "0.56925017", "text": "function StarRating() {\n this.options = {\n activeClass: 'active',\n settedClass: 'setted',\n element: null,\n items: null,\n onselect: null\n };\n this.init.apply(this, arguments);\n}", "title": "" } ]
3685cddaf5d2120aba587f015df3625c
The function should take three arguments operation(string/char), value1(number), value2(number). The function should return result of numbers after applying the chosen operation.
[ { "docid": "6f39ef207f8abb4328eabd4e90ac1e47", "score": "0.73846674", "text": "function basicOp(operation, value1, value2) {\n // option 1 with if else if\n // if (operation === '+') {\n // return value1 + value2 \n // } else if (operation === '-') {\n // return value1 - value2\n // } else if (operation === '*') {\n // return value1 * value2\n // } else if (operation === '/') {\n // return value1 / value2\n // }\n\n // option 2 with switch case\n switch (operation) {\n case '+': return value2 + value1\n case '-': return value1 - value2\n case '*': return value2 * value1\n case '/': return value1 / value2\n default: return 'Operation must be one of + - * /';\n }\n\n // option 3 with eval, eval merubah string operator menjadi fungsi operator math.\n // return eval(value1+operation+value2) // eval is evil, eval is not recommended for real programmer\n\n}", "title": "" } ]
[ { "docid": "7bbb67939ae52da52d338819e13f3d41", "score": "0.80549955", "text": "function getResult(val1, val2, operation){\r\n\t\tif(operation === '+'){\r\n\t\treturn val1 + val2;\r\n\t} else if(operation === '-'){\r\n\t\treturn val1 - val2\r\n\t} else if (operation === '*'){\r\n\t\treturn val1 * val2;\r\n\t} else if (operation === '/') {\r\n\t\treturn val1 / val2;\r\n\t} else if (operation === '%') {\r\n\t\treturn val1 /100 * val2;\r\n\t} else if (operation === '^') {\r\n\t\treturn Math.pow(val1, val2);\r\n\t}\r\n}", "title": "" }, { "docid": "a2b55b70c589d25b7a83f00c206063fa", "score": "0.79918694", "text": "function basicOp(operation, value1, value2)\n{\n switch (operation){\n case '+':\n return value1 + value2;\n case '-':\n return value1 - value2;\n case '*':\n return value1 * value2;\n case '/':\n return value1 / value2;\n default:\n return 0;\n }\n}", "title": "" }, { "docid": "f301bbcb3b66ef2449f9321fce8c05dc", "score": "0.7849315", "text": "function basicOp(operation, value1, value2)\n{\n if (operation == '+') return value1 + value2;\n if (operation == '-') return value1 - value2;\n if (operation == '*') return value1 * value2;\n if (operation == '/') return value1 / value2;\n\n}", "title": "" }, { "docid": "acb4096753a53ea710de394d0dd6268c", "score": "0.76581365", "text": "function calc(operation, number1, number2) {\n return operation(number1, number2);\n}", "title": "" }, { "docid": "a2f971f2519e098e47d4989b53a99ba8", "score": "0.76329505", "text": "function getResult(operation, number1, number2)\r\n{\r\n var result = 0;\r\n\r\n if(operation == \"add\")\r\n result = number1 + number2;\r\n\r\n else if(operation == \"subtract\")\r\n result = number1 - number2;\r\n\r\n else if(operation == \"multiply\")\r\n result = number1 * number2;\r\n\r\n else if(operation == \"divide\" && number2 != 0)\r\n result = number1 / number2;\r\n\r\n return result;\r\n}", "title": "" }, { "docid": "3fcdb494981b4051e758da915b59985c", "score": "0.7629146", "text": "function calculator(operation, number1, number2) {//Function declaration, where operation is string and number 1 and number 2 are numbers\r\n if (operation == '+') {\r\n return number1 + number2;\r\n } else if (operation == '-') {// else if operator verifies several conditions\r\n return number1 - number2 ;\r\n } else if (operation == '*') {\r\n return number1 * number2;\r\n } else if (operation == '/') {\r\n return number1 / number2;\r\n }\r\n}", "title": "" }, { "docid": "756f07f4f1ccfcc3f8b9b213ef63330c", "score": "0.7544427", "text": "function calculator(operation, num1, num2) {\n switch (operation) {\n case \"+\":\n return num1 + num2;\n case \"-\":\n return num1 - num2;\n case \"*\":\n return num1 * num2;\n case \"/\":\n return num1 / num2;\n default:\n console.log(\"Invalid operation!\");\n }\n}", "title": "" }, { "docid": "521c70915b197a20f5121ecab19b165d", "score": "0.75143075", "text": "function calculate (num1, num2, operation){\n if (operation === \"add\"){\n return num1 + num2;\n } else if (operation === \"sub\"){\n return num1 - num2;\n } else if (operation === \"mult\"){\n return num1 * num2;\n } else if (operation === \"div\"){\n return num1 / num2;\n } else if (operation === \"exp\"){\n return num1 ** num2;\n }\n}", "title": "" }, { "docid": "e01d0a30b19e5334c3f7602eb8f633f0", "score": "0.7503312", "text": "function operate(operator, num1, num2) {\n switch(operator) {\n case \"*\":\n return num1*num2;\n case \"/\":\n return num1/num2;\n case \"+\":\n return num1+num2;\n case \"-\":\n return num1-num2;\n }\n}", "title": "" }, { "docid": "328b88c36a343ace24b1f918e6e9c918", "score": "0.7491399", "text": "function operate(operator, num1, num2) {\n return operator(num1, num2);\n}", "title": "" }, { "docid": "b61d4b460ddd41e81c1e5c88aecb5b78", "score": "0.7490826", "text": "function operate(a, b, operation) {\n a = parseFloat(a);\n b = parseFloat(b);\n console.log(a, b, operation);\n if (operation == \"+\") {\n return a + b;\n } else if (operation == \"-\") {\n return a - b;\n } else if (operation == \"*\") {\n return a * b;\n } else if (operation == \"/\") {\n return a / b;\n }\n}", "title": "" }, { "docid": "bc2f8d14a5f95f5c25d64f57b41a18ff", "score": "0.7466282", "text": "function operate(operator, opNum1, opNum2){\r\n if (operator === \"+\"){\r\n return add(opNum1, opNum2);\r\n } else if (operator === \"-\"){\r\n return subtract(opNum1, opNum2)\r\n } else if (operator === \"*\"){\r\n return multiply(opNum1, opNum2)\r\n } else {\r\n return divide(opNum1, opNum2)\r\n }\r\n}", "title": "" }, { "docid": "81a5ce1fcf1e487079838a808b8123c8", "score": "0.7463892", "text": "function operate(operator, number1, number2) {\n number1 = Number(number1);\n number2 = Number(number2);\n\n switch (operator) {\n case '+':\n return formatResult(add(number1, number2));\n case '−':\n return formatResult(subtract(number1, number2));\n case '×':\n return formatResult(multiply(number1, number2));\n case '÷':\n return formatResult(divide(number1, number2));\n case '^':\n return formatResult(exponential(number1, number2));\n case '!':\n return factorial(number1);\n }\n}", "title": "" }, { "docid": "169f578e2df4f46f7f2d7835c7bc0432", "score": "0.74518865", "text": "function basicOp(operation, value1, value2) {\n switch (operation) {\n case '+': return value1 + value2;\n case '-': return value1 - value2;\n case '*': return value1 * value2;\n case '/': return value1 / value2;\n default: return 'Operation must be one of + - * /';\n }\n}", "title": "" }, { "docid": "04dec83407af96990db573b33b51b61f", "score": "0.7436881", "text": "function basicOp(operation, value1, value2)\n{\n // Code\n var operatorFunction = {\n '+' : function(x, y) {\n return x + y;\n },\n '-' : function(x, y) {\n return x - y;\n },\n '*' : function(x, y) {\n return x * y;\n },\n '/' : function(x, y) {\n return x / y;\n }\n \n};\n return operatorFunction[operation](value1, value2);\n}", "title": "" }, { "docid": "f9b7ac8afe6b6287a994f589c3a6db49", "score": "0.7407936", "text": "function calculation(oper, first, second) {\n var num1 = parseFloat(first);\n var num2 = parseFloat(second);\n\n switch (oper) {\n case \"+\":\n result = num1 + num2;\n break;\n case \"-\":\n result = num1 - num2;\n break;\n case \"/\":\n result = num1 / num2;\n break;\n case \"*\":\n result = num1 * num2;\n }\n\n result = result.toString();\n result = result.slice(0, 10);\n result = parseFloat(result);\n return result;\n}", "title": "" }, { "docid": "824eae90e237660d4ff636388605029f", "score": "0.73924917", "text": "function getResult(operation, number1, number2)\n{\n var result = 0;\n\n if(operation == \"add\")\n result = number1 + number2;\n\n else if(operation == \"sub\")\n result = number1 - number2;\n\n else if(operation == \"mul\")\n result = number1 * number2;\n\n else if(operation == \"div\") {\n //if it is zero u must raise an error\n if(number2 == 0){\n\n return \"Infinity\"\n }\n result = number1 / number2;\n }\n return result;\n}", "title": "" }, { "docid": "4c44fbd1481de3c9c4cdb7218dd4ed2f", "score": "0.7390884", "text": "function calFunction(numb1, numb2, operator) {\n if (operator === \"addition\") {\n return numb1 + numb2;\n } else if (operator === \"subtraction\") {\n return numb1 - numb2;\n } else if (operator === \"division\") {\n return numb1 / numb2;\n } else if (operator === \"multiplication\") {\n return numb1 * numb2;\n } else {\n return \"operation not recognized\";\n }\n}", "title": "" }, { "docid": "657f59a7e60637b38c698a0fe5665757", "score": "0.73740804", "text": "function performOperation(first, second) {\n switch(operation) {\n case '+':\n return first + second;\n case '-':\n return first - second;\n case '*':\n return first * second;\n case '/':\n return first / second;\n default:\n return 0;\n }\n }", "title": "" }, { "docid": "b0d2749d90c8c0cfb312023007ae8f0a", "score": "0.73696214", "text": "function operate (operation, first_n, second_n){\n let result;\n switch (operation){\n case \"add\":\n result = add(first_n,second_n);\n break;\n\n case \"subtract\":\n result = subtract(first_n,second_n);\n break;\n\n case \"multiply\":\n result = multiply(first_n,second_n);\n break;\n\n case \"divide\":\n result = divide(first_n,second_n);\n break;\n }\n return result\n}", "title": "" }, { "docid": "e01ece6dfa7593af4ed998b2971623da", "score": "0.73410475", "text": "function runOperator(string) {\n value1 = parseFloat(value1);\n value2 = parseFloat(value2);\n switch(string) {\n case \"+\":\n value1 = sum(value1, value2);\n break;\n case \"-\":\n value1 = subtract(value1, value2);\n break;\n case \"*\":\n value1 = multiply(value1, value2);\n break;\n case \"/\":\n value1 = divide(value1, value2);\n break;\n }\n}", "title": "" }, { "docid": "14a93c9e404912550a0d0cde21a18d28", "score": "0.73390317", "text": "function operate(a, operator, b) {\n a = parseFloat(a);\n b = parseFloat(b);\n switch (operator) {\n case \"+\":\n return a + b;\n case \"-\":\n return a - b;\n case \"/\":\n return a / b;\n case \"*\":\n return a * b;\n }\n}", "title": "" }, { "docid": "0ad06ae1e0058931b9465794d72c80ce", "score": "0.73237526", "text": "function operate(operator, a, b) {\n a = parseFloat(a); //convert string value to float\n b = parseFloat(b); //convert string value to float\n switch (operator) {\n case \"+\":\n answer = add(a, b); //invoke add() function\n break;\n case \"-\":\n answer = subtract(a, b); //invoke subtract() function\n break;\n case \"x\":\n answer = multiply(a, b); //invoke multiply() function\n break;\n case \"/\":\n if (b !== 0) {\n answer = divide(a, b); //invoke divide() function\n } else answer = \"this is so rude\";\n break;\n default:\n break;\n }\n displayValue = answer;\n updateDisplayValue();\n}", "title": "" }, { "docid": "7df4b7e80e31d5989caf241c81686924", "score": "0.73181605", "text": "function operate(operatorVariable, num1, num2) {\n if (operatorVariable == \"+\") {\n return simpleAdd(num1,num2);\n } else if (operatorVariable == \"-\") {\n return simpleSubtract(num1,num2);\n } else if (operatorVariable == \"*\") {\n return simpleMultiply(num1,num2);\n } else if (operatorVariable == \"/\") {\n return simpleDivide(num1,num2);\n };\n}", "title": "" }, { "docid": "44b5c39e0d9cbf976921268cd3314c08", "score": "0.7312581", "text": "function operate(){\n\tif(!operation || !operand || !inputVal){\n\t\treturn;\n\t\t}\n\tlet result = '';\n\t\n\tswitch(operation) {\n\t\tcase '+':\n\t\tresult = add(parseFloat(operand), parseFloat(inputVal));\n\t\tbreak;\n\t\tcase '-':\n\t\t result = subtract(parseFloat(operand), parseFloat(inputVal));\n\t\t break;\n\t\t case '×':\n\t\t result = multiply(parseFloat(operand), parseFloat(inputVal));\n\t\t break;\n\t\t case '÷':\n\t\t result = divide(parseFloat(operand), parseFloat(inputVal));\n\t\t break;\n\n\t}\t\n\treset();\n\tinputVal = result; \n\tdisplay();\n\n}", "title": "" }, { "docid": "f9facb2a88f24645c6ea6eb9e3a73275", "score": "0.7283008", "text": "function operation() {\n if ((value1 == undefined) && (operator == undefined)) {\n return\n }\n\n if ((value2 == undefined) && (value3 == undefined)) {\n value2 = document.getElementById(\"result\").textContent\n value2 = Number(value2)\n value1 = Number(value1)\n document.getElementById(\"result\").textContent = operations[operator](value1, value2)\n value3 = document.getElementById(\"result\").textContent\n\n } else if ((value2 == undefined) && (value3 != undefined)) {\n value2 = document.getElementById(\"result\").textContent\n value2 = Number(value2)\n value3 = Number(value3)\n document.getElementById(\"result\").textContent = operations[operator](value3, value2)\n value3 = document.getElementById(\"result\").textContent\n\n } else if (value3 != undefined) {\n value2 = Number(value2)\n value3 = Number(value3)\n document.getElementById(\"result\").textContent = operations[operator](value3, value2)\n value3 = document.getElementById(\"result\").textContent\n }\n shrinkFontTextBox()\n}", "title": "" }, { "docid": "805b694a37d3cf6c7ed6ebe67e67245c", "score": "0.7277207", "text": "function operate(op, a, b)\n{\n a=parseFloat(a);\n b=parseFloat(b);\n\n let ans;\n\n if(op==\"+\")\n ans=add(a,b);\n else if(op==\"-\")\n ans=subtract(a,b);\n else if(op==\"x\")\n ans=multiply(a,b);\n else\n ans=divide(a,b);\n\n return Number(ans.toFixed(4));\n\n}", "title": "" }, { "docid": "055dd7984de64e769115bc31ea255012", "score": "0.7250924", "text": "function calculator(action, number1, number2) {\n // console.log('the action is ' + action);\n let result = 0;\n if (action === 'sum' || action === 'addition' || action === '+') {\n result = number1 + number2;\n } else if (action === 'subtraction' || action === 'sub') {\n result = number1 - number2;\n } else if (action === 'multiplication' || action === 'mult') {\n result = number1 * number2;\n } else if (action === 'division' || action === 'div') {\n result = number1 / number2;\n } else {\n console.error('action ' + action + ' is not allowed');\n }\n return result;\n}", "title": "" }, { "docid": "a8a09916972787e9afdd4fffe46bd5c1", "score": "0.7243381", "text": "function operate(num1, num2, operator) {\n switch (operator) {\n case \"+\":\n return add(num1, num2);\n break;\n\n case \"-\":\n return subtract(num1, num2);\n break;\n\n case \"*\":\n return multiply(num1, num2);\n break;\n\n case \"/\":\n return divide(num1, num2);\n break;\n\n }\n}", "title": "" }, { "docid": "df6561124dc13fd9534815cc5ece2c1b", "score": "0.72303605", "text": "function doOp(a, b, op)\n{\n a = parseFloat(a);\n b = parseFloat(b);\n \n if (op == '+')\n return a + b;\n \n if (op == '-')\n return a - b;\n \n if (op == '*')\n return a * b;\n \n if (op == '/')\n return a / b;\n \n}", "title": "" }, { "docid": "4bc90a2d12dcb0ac4988f0597d1d143b", "score": "0.7218211", "text": "function operate(operator) {\n var result = numbers[0];\n for(var i = 1; i < numbers.length; i++) {\n result = eval(result + operator + numbers[i])\n }\n return result;\n}", "title": "" }, { "docid": "0d2491d37ab769c423465e78d2f4dd48", "score": "0.7215836", "text": "function calculator2 () {\n var result = arguments[1]\n switch (arguments[0]) {\n case 'suma':\n for (i = 2; i < arguments.length; i++) {\n result += arguments[i]\n }\n return result\n case 'resta':\n for (i = 2; i < arguments.length; i++) {\n result -= arguments[i]\n }\n return result\n case 'multiplication':\n for (i = 2; i < arguments.length; i++) {\n result *= arguments[i]\n }\n return result\n case 'division':\n for (i = 2; i < arguments.length; i++) {\n result /= arguments[i]\n }\n return result\n default :\n console.log('this operation is not valid')\n }\n}", "title": "" }, { "docid": "78689db6fd1ff4f06c3fd1e384f391b0", "score": "0.72080374", "text": "performCalculation(n1, operator, n2) {\n const firstNum = parseFloat(n1);\n const secondNum = parseFloat(n2);\n if (operator === \"add\") return firstNum + secondNum;\n if (operator === \"subtract\") return firstNum - secondNum;\n if (operator === \"multiply\") return firstNum * secondNum;\n if (operator === \"divide\") return firstNum / secondNum;\n }", "title": "" }, { "docid": "f55bd5b3cc017d60474825c2537431f7", "score": "0.71877784", "text": "function operation(value1,value2,value3){ \n\n\tif(value1 < value2 && (value3 == 2 || value3 == 4)){\n\t\n\t\talert(\"input one is lesser then input two so can't perform operation - or /\");\n\t\treturn false;\n\t\n\t}else{\n\t\n\t\tswitch(value3){ \n case \"1\":\n return convertToRoman(value1 + value2);\n break;\n case \"2\":\n return convertToRoman(value1 - value2);\n break;\n case \"3\":\n return convertToRoman(value1 * value2);\n break;\n case \"4\":\n return convertToRoman(value1 / value2).replace(/undefined/g,'');\n break;\n default:\n return \"invalid\";\n \n \t}\n\t}\n\n}", "title": "" }, { "docid": "e4944dc5d0cf52a54bd7737bb1075572", "score": "0.7184958", "text": "function calc (number1, number2, operator){\n if ( typeof(number2) !== \"number\") {\n return number1;\n }else if(operator === \"+\"){\n return number1 + number2;\n }else if (operator === \"-\"){\n return number1 - number2;\n }else if (operator === \"*\"){\n return number1*number2;\n }else if ( operator = \"/\"){\n return number1/number2;\n } \n }", "title": "" }, { "docid": "c2403530416bcdf1f50cd3b8fddacfc3", "score": "0.7181584", "text": "function calculate(num1, num2, opt) {\n\tvar result = undefined;\n\tswitch(opt) {\n\t\tcase '-':\n\t\t\tresult = num1 - num2;\n\t\t\tbreak;\n\t\tcase '+':\n\t\t\tresult = num1 + num2;\n\t\t\tbreak;\t\t\n\t\tcase '*':\n\t\t\tresult = num1 * num2;\n\t\t\tbreak;\n\t\tcase '/':\n\t\t\tresult = num1 / num2;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tconsole.log('Invalid Operator')\t\t\t\n\t}\n\treturn result;\n}", "title": "" }, { "docid": "f4d7e3b1ba9e9ff75a4875335615826e", "score": "0.71808094", "text": "function operate(x, y, operator) {\nlet answer;\nswitch(operator) {\n case '+': answer = calculator.add(parseFloat(x), parseFloat(y));\n break;\n case '-': answer = calculator.subtract(x, y);\n break;\n case '*': answer = calculator.multiply(x, y);\n break;\n case '/': \n if(y == 0) {\n inputs.valueTwo = '';\n inputs.valueOne = '';\n inputs.operator = '';\n return 'No zero division!';\n }\n else {\n answer = calculator.divide(x, y);\n }\n break;\n default: answer = inputs.valueOne;\n}\ninputs.valueOne = (Math.round(answer * 10000000) / 10000000).toString();\nreturn Math.round(answer * 10000000) / 10000000;\n}", "title": "" }, { "docid": "82ea868b76a5ab33f9451ace13859334", "score": "0.7165522", "text": "function main(number1,number2,operator){\n\n let result;\n\n switch (operator) {\n case `+`:\n result = number1 + number2;\n break;\n case `-`:\n result = number1 - number2;\n break;\n case `/`:\n result = number1 / number2;\n break;\n case `*`:\n result = number1 * number2;\n break;\n case `%`:\n result = number1 % number2;\n break;\n case `**`:\n result = number1 ** number2;\n break;\n }\n console.log(result);\n //Print on the console the result of the mathematical operation between both numbers and the operator you receive as a string.\n}", "title": "" }, { "docid": "195220941d03d411b3ee36dc32f4edd5", "score": "0.7159813", "text": "function mathOperation(whichOperation) {\n let result;\n switch (whichOperation) {\n case \"+\":\n result = Number(firstValue.value) + Number(secondValue.value);\n resultBlock.innerHTML =\n firstValue.value + \" + \" + secondValue.value + \" = \" + result;\n // firstValue.value = null;\n // secondValue.value = null;\n break;\n\n case \"-\":\n result = Number(firstValue.value) - Number(secondValue.value);\n resultBlock.innerHTML =\n firstValue.value + \" - \" + secondValue.value + \" = \" + result;\n // firstValue.value = null;\n // secondValue.value = null;\n break;\n\n case \"*\":\n result = Number(firstValue.value) * Number(secondValue.value);\n resultBlock.innerHTML =\n firstValue.value + \" * \" + secondValue.value + \" = \" + result;\n // firstValue.value = null;\n // secondValue.value = null;\n break;\n\n case \"/\":\n result = Number(firstValue.value) / Number(secondValue.value);\n resultBlock.innerHTML =\n firstValue.value +\n \" / \" +\n secondValue.value +\n \" = \" +\n result.toFixed(3);\n // firstValue.value = null;\n // secondValue.value = null;\n break;\n\n case \">\":\n if (Number(firstValue.value) > Number(secondValue.value)) {\n resultBlock.innerHTML =\n firstValue.value + \" bigger than \" + secondValue.value;\n // firstValue.value = null;\n // secondValue.value = null;\n } else if (Number(firstValue.value) < Number(secondValue.value)) {\n resultBlock.innerHTML =\n firstValue.value + \" less than \" + secondValue.value;\n // firstValue.value = null;\n // secondValue.value = null;\n } else {\n resultBlock.innerHTML = \"Something wrong. Try again\";\n }\n break;\n\n case \"<\":\n if (Number(firstValue.value) > Number(secondValue.value)) {\n resultBlock.innerHTML =\n secondValue.value + \" less than \" + firstValue.value;\n // firstValue.value = null;\n // secondValue.value = null;\n } else if (Number(firstValue.value) < Number(secondValue.value)) {\n resultBlock.innerHTML =\n secondValue.value + \" bigger than \" + firstValue.value;\n // firstValue.value = null;\n // secondValue.value = null;\n } else {\n resultBlock.innerHTML = \"Something wrong. Try again\";\n }\n break;\n\n case \"=\":\n if (Number(firstValue.value) === Number(secondValue.value)) {\n resultBlock.innerHTML = \"Number equal\";\n // firstValue.value = null;\n // secondValue.value = null;\n } else if (Number(firstValue.value) != Number(secondValue.value)) {\n resultBlock.innerHTML = \"Number not equal\";\n // firstValue.value = null;\n // secondValue.value = null;\n } else {\n resultBlock.innerHTML = \"Something wrong. Try again\";\n }\n break;\n\n case \">=\":\n if (Number(firstValue.value) > Number(secondValue.value)) {\n resultBlock.innerHTML =\n firstValue.value + \" bigger than \" + secondValue.value;\n // firstValue.value = null;\n // secondValue.value = null;\n } else if (Number(firstValue.value) < Number(secondValue.value)) {\n resultBlock.innerHTML =\n firstValue.value + \" less than \" + secondValue.value;\n // firstValue.value = null;\n // secondValue.value = null;\n } else if (Number(firstValue.value) === Number(secondValue.value)) {\n resultBlock.innerHTML = \"Number equal\";\n } else {\n resultBlock.innerHTML = \"Something wrong. Try again\";\n }\n break;\n\n case \"<=\":\n if (Number(firstValue.value) > Number(secondValue.value)) {\n resultBlock.innerHTML =\n secondValue.value + \" bigger than \" + firstValue.value;\n // firstValue.value = null;\n // secondValue.value = null;\n } else if (Number(firstValue.value) < Number(secondValue.value)) {\n resultBlock.innerHTML =\n secondValue.value + \" less than \" + firstValue.value;\n // firstValue.value = null;\n // secondValue.value = null;\n } else if (Number(firstValue.value) === Number(secondValue.value)) {\n resultBlock.innerHTML = \"Number equal\";\n // firstValue.value = null;\n // secondValue.value = null;\n } else {\n resultBlock.innerHTML = \"Something wrong. Try again\";\n }\n break;\n\n case \"reset\":\n firstValue.value = null;\n secondValue.value = null;\n resultBlock.innerHTML = \"Result\";\n }\n}", "title": "" }, { "docid": "b18a200e055641d216dff93c1b929be3", "score": "0.7146944", "text": "function compute(op, value1, value2) {\n switch (op) {\n case '÷':\n if (value1 == 0 || value2 == 0) {\n total = 'NICE TRY!'\n break;\n }\n total = Number(value1) / Number(value2);\n break;\n case 'x':\n total = Number(value1) * Number(value2);\n break;\n case '-':\n total = Number(value1) - Number(value2);\n break;\n case '+':\n total = Number(value1) + Number(value2);\n break;\n }\n totalDisplay();\n clearCalculator('keepDisplay');\n}", "title": "" }, { "docid": "b8308558abfeba89557c737ff4fe0952", "score": "0.7120318", "text": "function operate(num1, num2, operator) {\n switch (operator) {\n case \"+\":\n return add(num1, num2);\n case \"-\":\n return subtract(num1, num2);\n case \"*\":\n return multiply(num1, num2);\n case \"/\":\n return divide(num1, num2);\n\n // if (parseFloat(num2) === 0) {\n // console.error(\"Snarky error message! You can't divide with 0...\");\n // } else {\n // return divide(num1, num2);\n // }\n }\n}", "title": "" }, { "docid": "a11fe3396f895bf7608326fd57d2dccb", "score": "0.71193624", "text": "function doOperation(op1, op2, sign) {\r\n switch (sign) {\r\n case \"+\":\r\n return op1 + op2;\r\n case \"-\":\r\n return op1 - op2;\r\n case \"*\":\r\n return op1 * op2;\r\n case \"/\":\r\n return op1 / op2;\r\n default:\r\n return undefined;\r\n }\r\n}", "title": "" }, { "docid": "31564c0d73b53c79c38a93b04bfd9812", "score": "0.71170276", "text": "function Calculator(num1,num2,operator)\n{\n var result;\n if(operator==='+')\n {\n result=num1+num2;\n \n }\n else if(operator==='-')\n {\n result=num1-num2;\n \n }\n else if(operator==='/')\n {\n result=num1/num2;\n \n }\n else if(operator==='*')\n {\n result=num1*num2;\n \n }\n return result;\n}", "title": "" }, { "docid": "f51aa67b3ef8ee19e6b99b1323b6e2c3", "score": "0.7114524", "text": "function operate(operator, operand1, operand2){\r\n\treturn operator(operand1, operand2);\r\n}", "title": "" }, { "docid": "b888feda95deaf7533ef7f38ccc6cb82", "score": "0.7104037", "text": "function operate(op, a, b) {\n switch (op) {\n case \"+\":\n return add(a, b);\n break;\n case \"−\":\n return subtract(a, b);\n break;\n case \"×\":\n return multiply(a, b);\n break;\n case \"÷\":\n return divide(a, b)\n break;\n }\n}", "title": "" }, { "docid": "4f124870c7f1f728d320f9841a0bb6a7", "score": "0.7096088", "text": "function operate(operator,a,b) {\n let operatorName = operator;\n // Make sure the numbers are stored as integers\n a = Number(oldValue);\n b = Number(currentValue);\n // Run the function using the string value of operator\n window[operatorName](a,b);\n calcUsed = false;\n}", "title": "" }, { "docid": "8b1bd66fb0d31d3306bfafb60a81d836", "score": "0.7081394", "text": "function evaluateExpression(first,op,second) {\n\toutput = 0;\n\tif (op == \"+\") {\n\t\toutput = parseInt(first) + parseInt(second);\n\t} else if (op == \"-\") {\n\t\toutput = parseInt(first) - parseInt(second);\n\t} else if (op == \"*\") {\n\t\toutput = parseInt(first) * parseInt(second);\n\t} else if (op == \"/\") {\n\t\toutput = parseInt(first) / parseInt(second);\n\t}\n\n\t// now, handle it\n\t$(\"#number_input\").val(output.toString());\n\t// deal with state elsewhere\n}", "title": "" }, { "docid": "f588cc8bb2a290cf1376a0d4c0946aa2", "score": "0.7078028", "text": "function operate(operator,a,b) {\n if(operator==='+'){\n tmp=add(a,b);\n } else if(operator==='-') {\n tmp=subtract(a,b);\n } else if(operator==='*') {\n tmp=multiply(a,b);\n } else if(operator==='/') {\n tmp=divide(a,b);\n }\n return tmp;\n }", "title": "" }, { "docid": "3df5f2a4f022725927581b1c890b1c32", "score": "0.7065612", "text": "function result(a,b,operator){\n switch(operator){\n case \"+\":\n return a+b;\n case \"-\":\n return a-b;\n case \"×\":\n case \"*\":\n return a*b;\n case \"÷\":\n return a/b;\n default:\n console.log(\"someting went wrong, following binary operator invalid: \" + operator);\n return 0;\n }\n}", "title": "" }, { "docid": "8037bd5281719dd1d9c0d64d9cceffd6", "score": "0.70481616", "text": "doMath(num1,num2,opper) {\n switch(opper){\n case '+':\n return num1+num2;\n case '-':\n return num1-num2;\n case '/':\n return num1/num2;\n case '*':\n return num1*num2;\n default:\n return 1;\n\n }\n}", "title": "" }, { "docid": "3653655d80d83b16f60ab1c506975a73", "score": "0.70254546", "text": "function calculate(firstNumber, secondNumber, operator) {\n let output;\n switch (operator) {\n case 'add':\n output = firstNumber + secondNumber;\n break;\n case 'substract':\n output = firstNumber - secondNumber;\n break;\n case 'multiply':\n output = firstNumber * secondNumber;\n break;\n case 'divide':\n output = firstNumber / secondNumber;\n break;\n default:\n output = 'operator is unknown';\n break;\n\n }\n return output;\n}", "title": "" }, { "docid": "210c930e9c78c3997e375172f7cc08d7", "score": "0.70245796", "text": "function calculate(num1, operator, num2) {\n var firstNumber = parseFloat(num1);\n var secondNumber = parseFloat(num2);\n switch(operator) {\n case 'add':\n return firstNumber + secondNumber;\n case 'subtract':\n return firstNumber - secondNumber;\n case 'multiply':\n return firstNumber * secondNumber;\n case 'divide':\n return firstNumber / secondNumber;\n default:\n break;\n }\n}", "title": "" }, { "docid": "e5583342f8dc3e983f9a12faad5820f1", "score": "0.70236945", "text": "function applyOp(a, b, op) {\n if(op == '+')\n return a + b;\n if(op == '-')\n return a - b;\n if(op == '*')\n return a * b;\n if(op == '/')\n return a / b;\n}", "title": "" }, { "docid": "5105db30f1bf5018f3acca6a6f1f6d5d", "score": "0.7013077", "text": "function executeOperation(option, acum_number, operator_number)\n{\n\tswitch (option) {\n\t\tcase \"sum\":\n\t\t\treturn acum_number + operator_number;\n\t\t\tbreak;\n\t\tcase \"res\":\n\t\t\treturn acum_number - operator_number;\n\t\t\tbreak;\n\t\tcase \"mult\":\n\t\t\treturn acum_number * operator_number;\n\t\t\tbreak;\n\t\tcase \"div\":\n\t\t\treturn acum_number / operator_number;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn operator_number;\n\t\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "c59794ce0ad78cf15338e22cd39490e7", "score": "0.70110816", "text": "function operation(operand, term1, term2) {\n if (operand === \"+\") {\n return String(Number(term1) + Number(term2));\n } else if (operand === \"-\") {\n return String(Number(term1) - Number(term2));\n } else if (operand === \"/\") {\n return String(Number(term1) / Number(term2));\n } else if (operand === \"X\") {\n return String(Number(term1) * Number(term2));\n }\n return \"0\";\n}", "title": "" }, { "docid": "9532e604f23efd7b5d698b7331afe826", "score": "0.7008179", "text": "function betterCaculate(num1, num2, operator) {\n console.log(operator);\n\n if (operator == \"+\") {\n return num1 + num2;\n }\n\n if (operator == \"-\") {\n return num1 - num2;\n }\n\n if (operator == \"*\") {\n return num1 * num2;\n }\n\n if (operator == \"/\") {\n return num1 / num2;\n }\n}", "title": "" }, { "docid": "9518878872f23d7a27829bfd3b8f9fa7", "score": "0.6983764", "text": "function calculation(operator, operand1, operand2) {\n switch (operator) {\n case \"+\":\n return operand1 + operand2;\n case \"-\":\n return operand1 - operand2;\n case \"*\":\n return operand1 * operand2;\n case \"/\":\n return operand1 / operand2;\n }\n}", "title": "" }, { "docid": "061daf2e912804daead3c05d8cc76546", "score": "0.69801986", "text": "function calculator1 (operation, a, b) {\n switch (operation) {\n case 'suma':\n console.log(a + b)\n break\n case 'resta':\n console.log(a - b)\n break\n case 'division':\n console.log(a / b)\n break\n case 'multiplication':\n console.log(a * b)\n break\n default:\n console.log('This operation is not valid')\n }\n}", "title": "" }, { "docid": "9a13fcbcd7174d65b8ebd88efa3d6efa", "score": "0.6978178", "text": "function operate(x, y, math) {\n //converting from string to integer\n x = parseFloat(x);\n y = parseFloat(y);\n let result = 0;\n //evalutate to call the right operation \n switch (math) {\n case '+':\n result = add(x, y);\n break;\n case '-':\n result = subtract(x, y);\n break;\n case 'x':\n result = multiply(x, y);\n break;\n case '÷':\n result = divide(x, y);\n break;\n case '%':\n result = percentage(x, y);\n break;\n default:\n break;\n }\n result = Math.round((result + Number.EPSILON) * 100) / 100;\n return result;\n}", "title": "" }, { "docid": "92ecba24749f5728713372a366bdd7d3", "score": "0.69724256", "text": "function operation_fun(op) {\n if (multiple_operations) {\n let temp_num = evaluate(first_number, $res.value);\n first_number = temp_num;\n multiple_operations = false;\n } else {\n first_number = $res.value;\n }\n operation = op;\n operator_clicked = true;\n multiple_operations = true;\n highlight_operation(operation, true);\n}", "title": "" }, { "docid": "e8ee8b1514c4b911349af760e863e905", "score": "0.69668996", "text": "function calc(a,op,b){\n switch(op){\n case \"*\" : return parseFloat(a) * parseFloat(b);\n case \"/\" : return parseFloat(a) / parseFloat(b);\n case \"+\" : return parseFloat(a) + parseFloat(b);\n case \"-\" : return parseFloat(a) - parseFloat(b);\n }\n }", "title": "" }, { "docid": "15bee4cc3bc065ecf3560580e7f0ac21", "score": "0.6966775", "text": "function calculate(firstOperand,operatorValue, secondOperand){\n if (operatorValue === '+'){\n outcome = Number(firstOperand) + Number(secondOperand);\n console.log('the outcome is: ',outcome)\n } else if (operatorValue === '-'){\n outcome = Number(firstOperand) - Number(secondOperand);\n console.log('the outcome is: ',outcome)\n } else if (operatorValue === '/'){\n outcome = Number(firstOperand) / Number(secondOperand);\n console.log('the outcome is: ',outcome)\n } else if (operatorValue === 'x'){\n outcome = Number(firstOperand) * Number(secondOperand);\n console.log('the outcome is: ',outcome)\n };\n return decimalRounder(outcome);\n}", "title": "" }, { "docid": "4ffa9d3fafed0538a92c4eededc2273c", "score": "0.69609934", "text": "function operate(operator, operand1, operand2) {\n return operator(operand1, operand2);\n}", "title": "" }, { "docid": "61a0795c625aeeb58588864115f3408a", "score": "0.6949081", "text": "function operate(operator) {\n const secondNumber = Number(resultsDisplay.textContent);\n\n if (operatorValue && awaitingNextValue) {\n operatorValue = operator;\n return;\n }\n\n if (!firstNumber) {\n firstNumber = secondNumber;\n } else if (secondNumber === 0 && operatorValue === \"/\") {\n resultsDisplay.textContent = \"ERROR\";\n } else {\n const result = calculate[operatorValue](firstNumber, secondNumber);\n resultsDisplay.textContent = Math.round(result * 10) / 10;\n firstNumber = result;\n }\n\n awaitingNextValue = true;\n operatorValue = operator;\n}", "title": "" }, { "docid": "e25e97e3090b7ca11f84de47999f18d4", "score": "0.6938097", "text": "function operate(a, b, operation) {\n return OPERATIONS[operation](a,b);\n}", "title": "" }, { "docid": "2747feea4ff0cdeb83306267dac8a503", "score": "0.6925595", "text": "function doOp(nb1, ope, nb2, cb) {\n let res = 0;\n\n switch (ope) {\n case '+':\n res = nb1 + nb2;\n break;\n case '-':\n res = nb1 - nb2;\n break;\n case '*':\n res = nb1 * nb2;\n break;\n case '/':\n res = nb1 / nb2;\n break;\n default:\n return null;\n }\n cb(res);\n}", "title": "" }, { "docid": "c9d0dadd23842223d6aec4fd598ebed6", "score": "0.6923038", "text": "function calculator(number1, number2, operator) {\n\n // if(number2 === 0 && operator === 'divide'){\n // console.log('You cannot divide by zero.');\n // return;\n // } else if(typeof(number1) != 'number' || typeof(number2) != 'number') {\n // console.log('You chose a value that is not a number.')\n // return;\n // }\n\n let value;\n let validOperator = true;\n\n switch (operator) {\n case '+':\n value = number1 + number2;\n break;\n case '-':\n value = number1 - number2;\n break;\n case '*':\n value = number1 * number2;\n break;\n case '/':\n value = number1 / number2;\n break;\n case '%':\n value = number1 % number2;\n break;\n default:\n validOperator = false;\n break;\n }\n\n if(!validOperator) {\n return 'Operator not recognised.';\n } else if(number2 === 0 && operator === '/'){\n return 'You cannot divide by zero.';\n } else if(typeof(number1) != 'number' || typeof(number2) != 'number') {\n return 'You chose a value that is not a number.';\n } else {\n return `${number1} ${operator} ${number2} = ${value}`;\n }\n}", "title": "" }, { "docid": "3663936391b408443c886d38f026acf6", "score": "0.68840414", "text": "function operate(operator, x, y) {\n switch(operator) {\n case '+':\n result = add(x, y);\n break;\n case '-':\n result = subtract(x, y);\n break;\n case 'x':\n case '*':\n result = multiply(x, y);\n break;\n case '÷':\n case '/':\n result = divide(x, y);\n break;\n }\n return result;\n}", "title": "" }, { "docid": "16bb1d3f320c71bc43e8605e494010ea", "score": "0.6882928", "text": "function performOperation() {\nlet result;\nconst current = parseNumber(display.value);\nprevious = parseNumber(previous);\nswitch(operator) {\ncase '+' :\nresult = previous + current;\nbreak;\ncase '-' :\nresult = previous - current;\nbreak;\ncase '*' :\nresult = previous * current;\nbreak;\ncase '/' :\nresult = previous / current;\nbreak;\n}\n\ndisplay.value = result;\noperator = null;\n}", "title": "" }, { "docid": "3193314080c3a39488d33a023432c2da", "score": "0.68802303", "text": "function calc(a, b, op) {\r\n switch(op) {\r\n case 1:\r\n return a - b;\r\n case 1:\r\n return a * b;\r\n case 1:\r\n return a / b;\r\n default:\r\n return a + b;\r\n }\r\n}", "title": "" }, { "docid": "c86f27d7fd256a9d51f5f3868a6b3fbf", "score": "0.6866581", "text": "function calculator (num1, num2, operator) {\n switch (operator) {\n case \"/\" :\n return num1/num2;\n case \"X\" :\n return num1*num2;\n case \"+\" :\n \n return num1+num2;\n case \"-\" :\n \n return num1-num2;\n case \"%\" :\n \n return ((num1/num2)*100);\n case \"^\" :\n \n return (num1**num2);\n \n default:\n \n }\n}", "title": "" }, { "docid": "fc060a8f664a6d2b3482de3babc1da50", "score": "0.68661946", "text": "function doCalc(){\n switch (operator) {\n case \"+\":\n return (number1 + number2).toFixed(2);\n break;\n case \"-\":\n return (number1 - number2).toFixed(2);\n break;\n case \"/\":\n return (number1 / number2).toFixed(2);\n break;\n case \"*\":\n return (number1 * number2).toFixed(2);\n break;\n default:\n return (\"Error\");\n }\n}", "title": "" }, { "docid": "8b0caf8a0c0a5543d9bd2b4fe16e9493", "score": "0.68635964", "text": "function calculate( op, arr ) {\n let thisResult\n /* transform in Number */\n arr[0]= Number(arr[0]);\n arr[1]= Number(arr[1]);\n switch (op) {\n case 'multiply':\n thisResult = arr.reduce((x, y) => x * y);\n break;\n case 'divide':\n thisResult = arr.reduce((x, y) => x / y);\n break;\n case 'plus':\n thisResult = arr.reduce((x, y) => x + y);\n break;\n case 'minus' :\n thisResult = arr.reduce((x, y) => x - y);\n break;\n }\n /* show the result */\n document.querySelector(\"#result\").innerHTML = thisResult;\n opNumbers.length = 0;\n /* set the result as a first number of operation */\n opNumbers[0] = thisResult;\n lastOp=\"\";\n return thisResult;\n }", "title": "" }, { "docid": "9a95091dd682770f2e2142fbca2cc3b0", "score": "0.685234", "text": "function menu(numOne, numTwo, operation) {\n const result = operation(numOne, numTwo);\n console.log(result);\n return result;\n}", "title": "" }, { "docid": "09c60c54a2cb1c609078fd879dbf6595", "score": "0.6848333", "text": "function operate(first, second, operator)\n { \n \n if (operator=='+')\n {result= sumfunction(first,second);\n removeAllChildNodes(display);\n let para=document.createElement('p')\n para.textContent=`${result}`;\n para.style.fontSize='2.5em';\n display.appendChild(para);\n\n console.log(`result is: ${result}`);\n }\n if (operator=='-')\n {result=subtractFunction(first,second);\n removeAllChildNodes(display);\n let para=document.createElement('p')\n para.textContent=`${result}`;\n para.style.fontSize='2.5em';\n display.appendChild(para);\n console.log(`result is: ${result}`);}\n \n if (operator=='/')\n {\n \n result=divideFunction(first,second);\n console.log(`result is: ${result}`);\n removeAllChildNodes(display);\n let para=document.createElement('p')\n para.textContent=`${result}`;\n para.style.fontSize='2.5em';\n display.appendChild(para);\n }\n\n if (operator=='*')\n {result=multiplyFunction(first,second);\n removeAllChildNodes(display);\n let para=document.createElement('p')\n para.textContent=`${result}`;\n para.style.fontSize='2.5em';\n display.appendChild(para);\n console.log(`result is: ${result}`);\n } \n }", "title": "" }, { "docid": "feb6a11cd13444861d44e98223e8cb09", "score": "0.68455833", "text": "function calculator(num1,num2,operator){\n var total = 0;\n if(operator == \"+\"){\n total = num1 + num2;\n }\n else if(operator == \"-\"){\n total = num1 - num2;\n }\n else if(operator == \"*\"){\n total = num1 * num2;\n }\n else if(operator == \"/\"){\n total = num1 / num2;\n }\n else if(operator == \"%\"){\n total = num1 % num2;\n }\n return total;\n}", "title": "" }, { "docid": "50664a768f2cd71a89774828dd07cf5d", "score": "0.68433535", "text": "function calculator(num1,operator,num2) {\n\treturn {\n\t\t'+': num1 + num2,\n\t\t'-': num1 - num2,\n\t\t'*': num1 * num2,\n\t\t'/': num2 ? num1 / num2 : 'Cannot divide by 0!'\n\t}[operator]\n}", "title": "" }, { "docid": "bfe936ee208f025eb93f0f5f8fb5405f", "score": "0.68210363", "text": "function calculatorPlus(operation, ...arguments){\r\n\tlet numbers = Array.from(arguments).sort((a,b) => b-a)\r\n\r\n\tswitch(operation) {\r\n\t\tcase \"sum\":\r\n\t\t\treturn console.log(`The sum is: ${sum(numbers)}`) || sum(numbers)\r\n\t\t\tbreak\r\n\r\n\t\tcase \"average\":\r\n\t\t\treturn console.log(`The average sum is: ${average(numbers)}`) || average(numbers)\r\n\t\t\tbreak\r\n\r\n\t\tcase \"substraction\":\r\n\t\t\tconst substrResult = substr(numbers[0], numbers.slice(1))\r\n\t\t\treturn console.log(`The substraction is: ${substrResult}`) || substrResult\r\n\t\t\tbreak\r\n\r\n\t\tcase \"division\": \r\n\t\t\tconst divisionResult = division(numbers[0], numbers.slice(1))\r\n\t\t\treturn console.log(`The division is: ${divisionResult}`) || divisionResult\r\n\t\t\tbreak\r\n\r\n\t\tdefault: console.log(\"No match operation\")\r\n\t}\r\n}", "title": "" }, { "docid": "f5b0fe195ae2e5cd4a982da145056b5f", "score": "0.68018603", "text": "function processOperations(){\n\n\taddToOperations(current_input);\n\tdocument.getElementById(\"output-record\").innerHTML = printOperations();\n\n\tvar i;\n\tresult = operations[0];\n\t//for each element, check if it's not '=', check i+2 then verify operation at i+1\n\tfor(i = 0; i < operations.length; i++){\n\n\t\tif(operations[i+1] != \"=\"){\n\t\t\tconsole.log(\"Result is currently \" + result);\n\t\t\t//console.log(\"Next operator: \" + operations[i+1] + \" Next operand: \" + operations[i+2]);\n\t\t\t//var num1 = operations[i];\n\t\t\tvar num2 = operations[i+2];\n\t\t\tswitch (operations[i+1]){\n\t\t\t\t\n\t\t\t\tcase \"X\":\n\t\t\t\t\tresult=mult(result, num2);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"/\":\n\t\t\t\t\tresult=div(result, num2);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"+\":\n\t\t\t\t\tresult=sum(result, num2);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tresult=sub(result, num2);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t}\n\t\t\ti+=1;\n\t\t}\n\n\t\tdocument.getElementById(\"output-main\").innerHTML = result;\n\t}\n\n\n\n}", "title": "" }, { "docid": "e9f853b068ae1297430b26e94d99c692", "score": "0.68003577", "text": "function doesthejob(n1, n2, op) {\n if (op == \"+\")\n $(\"#display\").val( n1 + n2 );\n else if (op == \"-\")\n $(\"#display\").val( n1 - n2 );\n else if (op == \"*\")\n $(\"#display\").val( n1 * n2 );\n else if (op == \"/\")\n $(\"#display\").val( n1 / n2 );\n else if (op == \"nCr\")\n document.form1.t1.value = fact2(n1) / fact2(n1 - n2) / fact2(n2);\n else if (op == \"nPr\")\n document.form1.t1.value = fact2(n1) / fact2(n1 - n2);\n }", "title": "" }, { "docid": "c67816b9ac55eeb4593b9a63ce83f198", "score": "0.67949724", "text": "function calculator(num1, num2, operator) {\n //makes sure users always passes 3 arguments\n \n if (!num1 || !num2 || !operator) {\n console.log('Please provide both numbers and operator!');\n return;\n }\n \n //makes sure user passes numeric value'\n \n if (typeof num1 !== 'number' || typeof num2 !== 'number') {\n console.log('Please add numeric value only!');\n return;\n }\n \n let result;\n switch (operator) {\n case '+':\n result = num1 + num2;\n break;\n case '-':\n result = num1 - num2;\n break;\n case '*':\n result = num1 * num2;\n break;\n case '/':\n result = num1 / num2;\n break;\n default:\n console.log(`Operator error! Operator ${operator} is invalid!`);\n }\n let response = `${num1} ${operator} ${num2} = ${result}`;\n return response;\n }", "title": "" }, { "docid": "f3eb0d1b66e5d5eb5129444a6d082f8c", "score": "0.67922676", "text": "function calculator(val1, val2, operator) {\n if (operator == \"+\") {\n console.log(`${val1} + ${val2} = ${val1 + val2}`);\n } else if (operator == \"-\") {\n console.log(`${val1} - ${val2} = ${val1 - val2}`);\n } else if (operator == \"*\") {\n console.log(`${val1} * ${val2} = ${val1 * val2}`);\n } else if (operator == \"/\") {\n console.log(`${val1} / ${val2} = ${val1 / val2}`);\n } else {\n console.log(`Opeator \"${operator}\" isn't allowed use (+, -, *, /) `)\n }\n}", "title": "" }, { "docid": "becdc55f492992cbdd545a8e765619a7", "score": "0.67883515", "text": "function operate(firstNumber, secondNumber) {\n if (operand.symbol == \"+\") {\n display.textContent = addNumber(firstNumber, secondNumber);\n userNum.num1 = addNumber(firstNumber, secondNumber);\n userNum.num2 = \"\";\n } else if (operand.symbol == \"-\") {\n display.textContent = subtractNumber(firstNumber, secondNumber);\n userNum.num1 = subtractNumber(firstNumber, secondNumber);\n userNum.num2 = \"\";\n } else if (operand.symbol == \"x\") {\n display.textContent = multiplyNumber(firstNumber, secondNumber);\n userNum.num1 = multiplyNumber(firstNumber, secondNumber);\n userNum.num2 = \"\";\n } else if (operand.symbol == \"/\") {\n display.textContent = divideNumber(firstNumber, secondNumber);\n userNum.num1 = divideNumber(firstNumber, secondNumber);\n userNum.num2 = \"\";\n }\n\n if (display.textContent == \"Infinity\") {\n display.textContent == \"Nice try.\"\n }\n}", "title": "" }, { "docid": "1442ac8b9031dc11aa8879cf15e16837", "score": "0.67845905", "text": "function calculateResult(){\n\n let num1 = 0;\n let num1_negative = false;\n let num2 = 0;\n let num2_negative = false;\n let decimal1 = 0;\n let decimal2 = 0;\n\n let operator = '';\n let parsingNum2 = false;\n\n for(let i = 0; i < buffer.length; i++){\n\n if(i === 0 && isOperator(buffer[i])){\n num1_negative = true;\n continue;\n }\n\n if(isOperator(buffer[i]) && parsingNum2){\n continue;\n }\n\n if(buffer[i] === '.'){\n if(decimal1 === 0 && !parsingNum2) decimal1 = i;\n if(decimal1 !== 0 && parsingNum2) decimal2 = i;\n }\n\n if(isOperator(buffer[i])){\n parsingNum2 = true;\n if(operator === '') operator = buffer[i];\n if(buffer[i+1] === '-') num2_negative = true;\n }\n\n if(!isOperator(buffer[i]) && !parsingNum2){\n num1 *= 10;\n num1 += buffer[i];\n }else parsingNum2 = true;\n\n if(!isOperator(buffer[i]) && parsingNum2){\n num2 *= 10;\n num2 += buffer[i];\n }\n\n }\n\n if(decimal1 !== 0){\n if(num1_negative) decimal1 -= 1;\n num1 = num1.toString();\n num1 = addDecimal(num1, decimal1);\n num1 = parseFloat(num1);\n }\n\n if(decimal2 !== 0){\n decimal2 -= num1.toString().length + 1;\n if(num2_negative) decimal2 -= 1;\n num2 = num2.toString();\n num2 = addDecimal(num2, decimal2);\n num2 = parseFloat(num2);\n }\n \n num1 = num1_negative ? -1*num1 : num1;\n num2 = num2_negative ? -1*num2 : num2;\n\n let result = 0;\n\n switch(operator){\n case '+':\n result = num1 + num2;\n break;\n case '-':\n result = num1 - num2;\n break;\n case '*':\n result = num1 * num2;\n break;\n case '/':\n result = num1 / num2;\n break;\n }\n\n if(result % 1 !== 0){\n result = result.toFixed(10);\n result = result.toString();\n result = parseFloat(result);\n }\n\n showResult(result);\n buffer = [];\n result = result.toString();\n for(let i = 0; i < result.length; i++){\n buffer.push(result[i]);\n }\n showBuffer(buffer.join(''));\n}", "title": "" }, { "docid": "7307e425268571882fc5da74b85f8a89", "score": "0.6780721", "text": "function treat(clicked_id){\n let number1 = parseFloat(document.getElementById(\"op-one\").value);\n let number2 = parseFloat(document.getElementById(\"op-two\").value);\n let result;\n //alert(`clicked_id = ${clicked_id}`);\n switch (clicked_id){\n case \"add\": result = number1 + number2;\n break;\n case \"sub\" : result = number1 - number2;\n break;\n case \"multi\" : result = number1 * number2;\n break;\n case \"div\" : result = number1 / number2;\n break;\n default : result = NaN;\n break;\n }\n alert(`Result bis = ${result}`)\n //return result;\n }", "title": "" }, { "docid": "a4052ea5d68c044eeb29f2bfca68ca2c", "score": "0.67713076", "text": "function calculator(num1,num2,operator){\n //declaring sum variables\n let sum;\n //Validation for num1 & num2\n if(isNaN(num1)){\n return 'Number 1 is not a number';\n }\n if(isNaN(num2)){\n return 'Number 2 is not a number';\n }\n //switch statement for operator\n switch(operator){\n case '+':\n sum = num1 + num2;\n break;\n case '-':\n sum = num1 - num2;\n break;\n //Multiply function for all possible cases\n case '*':\n case 'x':\n sum = num1 * num2;\n break;\n case '/':\n sum = num1 / num2;\n break;\n case '%':\n sum = num1 % num2;\n break;\n //Validation for operator\n default:\n return 'You have used an invalid operator ' + operator;\n break;\n }\n return sum;\n}", "title": "" }, { "docid": "3e16a34585906d2ab254bd0ca1ab3068", "score": "0.67677456", "text": "function getCalculation(num1, num2, calcFunction) {\n var resultDisplay = document.getElementById(\"result\");\n resultDisplay.value = calcFunction(num1, num2);\n}", "title": "" }, { "docid": "068dee3b005f82009bc93dc5ce6370c0", "score": "0.67623264", "text": "function operator (operator, num1, num2) {\n switch (operator) {\n case \"+\":\n return add(num1, num2);\n case \"-\":\n return subtract(num1, num2);\n case \"*\":\n return multiply(num1, num2);\n case \"/\":\n return divide(num1, num2);\n \n }\n}", "title": "" }, { "docid": "18d106b606493e100df11f214ca0d077", "score": "0.6756089", "text": "function final_result() {\n const upper_value = screen_upper.textContent;\n const lower_value = screen_lower.textContent;\n const first_operand = parseFloat(upper_value.trim().slice(0, upper_value.length));\n const second_operand = parseFloat(lower_value);\n const operator = upper_value.slice(-1);\n clear_screen();\n switch (operator) {\n case '+':\n return first_operand + second_operand;\n case '-':\n return first_operand - second_operand;\n case '×':\n return first_operand * second_operand;\n case '÷':\n return first_operand / second_operand;\n default:\n alert('error');\n }\n\n}", "title": "" }, { "docid": "5fa7bdfbe238db6de81129d94d84b9e1", "score": "0.6752404", "text": "function calculator(num1,num2,operator)\n{\nif(operator == \"/\")\n{\n var result = num1/num2;\n alert(\"Result = \"+ result)\n}\nelse if(operator == \"+\")\n{\n var result = num1+num2;\n alert(\"Result = \"+ result)\n}\nif(operator == \"-\")\n{\n var result = num1-num2;\n alert(\"Result = \"+ result)\n}\nif(operator == \"*\")\n{\n var result = num1*num2;\n alert(\"Result = \"+ result)\n}\nif(operator == \"%\")\n{\n var result = num1%num2;\n alert(\"Result = \"+ result)\n}\n\n}", "title": "" }, { "docid": "4897ccac93d269b3b28f079019e4d4df", "score": "0.6744051", "text": "function mathOperation() {\n\tif (lastOperation === 'x') {\n\t\tresult = parseFloat(result) * parseFloat(dis2Num);\n\t} else if (lastOperation === '+') {\n\t\tresult = parseFloat(result) + parseFloat(dis2Num);\n\t} else if (lastOperation === '-') {\n\t\tresult = parseFloat(result) - parseFloat(dis2Num);\n\t} else if (lastOperation === '/') {\n\t\tresult = parseFloat(result) / parseFloat(dis2Num);\n\t}\n}", "title": "" }, { "docid": "ac4a4151e9d2beb6e6e266cb25193925", "score": "0.6742712", "text": "function handleOperation(e) {\n number1 = displayValue;\n displayValue += e.target.innerHTML;\n operation = e.target.dataset.action;\n isOperatorPressed = true;\n if (result) {\n number1 = result;\n }\n}", "title": "" }, { "docid": "0cc7184c5fea5046bd7eb684b15523de", "score": "0.6737497", "text": "function doOperation(){\n show.innerText='0'\n numbArr.push(parseFloat(getNumber))\n if(getNumber===''){\n var total=0\n }else{\n var total=numbArr[0]\n }\n for(var i=0; i<numbArr.length-1; i++){\n\n if(operatorArr[i]==='+'){\n total= total + numbArr[i+1]\n }\n else if(operatorArr[i]=== '*'){\n total= total * numbArr[i+1]\n }\n else if(operatorArr[i]=== '-'){\n total= total - numbArr[i+1]\n }\n else if(operatorArr[i]=== '/'){\n total= total / numbArr[i+1]\n }else if(operatorArr[i]=== '%'){\n total= total % numbArr[i+1]\n }\n }\n showResult.innerText=total.toLocaleString()\n numbArr= []\n operatorArr=[]\n getNumber=total\n showResult.innerText=getNumber.toLocaleString()\n}", "title": "" }, { "docid": "92c0db246f6842f552db4ccf9370ebf9", "score": "0.6737158", "text": "function calculator() {\n const operator = process.argv[2]\n const numArray = process.argv.slice(3)\n const num = numArray.map((element) => Number(element))\n \n if (!operator) {\n return \"No operation provided...\";\n };\n \n if (operator !== 'plus' && operator !== 'minus') {\n return `Invalid operation: ${operator}`;\n } else {\n for (let i of num) {\n if (!i) { \n } else if (operator === 'plus') {\n const add = (accumulator, i) => accumulator + i;\n return num.reduce(add);\n } else if (operator === 'minus') {\n const subtract = (accumulator, i) => accumulator - i;\n return num.reduce(subtract); \n }\n }\n return \"No numbers provided...\"\n }\n}", "title": "" }, { "docid": "76c357ad63af3bee61450583444d2394", "score": "0.6731378", "text": "function calculate(){\n\n var actions = res.innerHTML.split(operator);\n let ans=eval(parseInt(actions[0], 2)+operator+parseInt(actions[1], 2));\n res.innerHTML = Math.floor(ans).toString(2);\n ans=res.innerHTML;\n operator='';\n}", "title": "" }, { "docid": "a658305843a29485de616ac96e323067", "score": "0.6725563", "text": "function operator(num1, num2, operator) {\n return eval(num1 + operator + num2);\n}", "title": "" }, { "docid": "42bd7aa27609f6df71f54b07f8b26173", "score": "0.6712656", "text": "calculate() {\n let res = 0;\n if (this.number1 === undefined || this.number2 === undefined) {\n return;\n } else {\n switch (this.operator) {\n case \"/\":\n res = parseInt(this.number1 / this.number2);\n this.result = res.toString();\n this.resultLength = this.result.length;\n break;\n case \"*\":\n res = parseInt(this.number1 * this.number2);\n this.result = res.toString();\n this.resultLength = this.result.length;\n break;\n case \"-\":\n res = parseInt(this.number1 - this.number2);\n this.result = res.toString();\n this.resultLength = this.result.length;\n break;\n case \"+\":\n res = parseInt(this.number1 + this.number2);\n this.result = res.toString();\n this.resultLength = this.result.length;\n break;\n }\n }\n }", "title": "" }, { "docid": "67588c457a34bc4863f30ffd8ddf15f2", "score": "0.6706948", "text": "function doCalculation(inputs) {\n let op = inputs[1];\n let x = parseFloat(inputs[0]);\n let y = parseFloat(inputs[2]);\n if (op === '+') {\n return x + y;\n } else if (op === '-') {\n return x - y;\n } else if (op === '*') {\n return x * y;\n } else if (op === '/') {\n return x / y;\n }\n}", "title": "" }, { "docid": "f8f61d5ae3995802bb1a46ebaee8ef13", "score": "0.6706208", "text": "function basicOperation(operationToPerform) {\n for (let i = 0; i < initArr.length; i++) {\n if (initArr[i] === operationToPerform) {\n let isSearchingNumber = true;\n let j = i - 1;\n let nbr1, nbr2;\n let result, startIndexForSplice\n while (isSearchingNumber) {\n if (/[\\d]/.test(initArr[j])) {\n j -= 1;\n } else {\n isSearchingNumber = false;\n nbr1 = initArr.splice((j + 1), (i - j - 1));\n }\n }\n startIndexForSplice = j + 1;\n isSearchingNumber = true;\n j = i + 1;\n while (isSearchingNumber) {\n if (/[\\d]/.test(initArr[j])) {\n j += 1;\n } else {\n isSearchingNumber = false;\n nbr2 = initArr.splice((i), (j - i));\n // reset the i to before the previous position\n i = j - 2;\n }\n }\n\n nbr1 = parseFloat(nbr1.join(''));\n nbr2 = parseFloat(nbr2.join(''));\n\n switch (operationToPerform) {\n case \"**\":\n result = Math.pow(+nbr1, +nbr2);\n break;\n case \"*\":\n result = +nbr1 * nbr2;\n break;\n case \"/\":\n result = +nbr1 / nbr2;\n break;\n case \"+\":\n result = +nbr1 + nbr2;\n break;\n case \"-\":\n result = +nbr1 - nbr2;\n break;\n default:\n break;\n }\n initArr.splice(startIndexForSplice, 1, result);\n }\n }\n }", "title": "" }, { "docid": "c9c7765ca3805a1615143657998175b4", "score": "0.6694348", "text": "function operator(operator, operand1, operand2){\r\n return operator(operand1,operand2);\r\n}", "title": "" } ]
caa8974414d2aaf9a6266e2ea1bfa709
CREATE A NEW LINE \ | \
[ { "docid": "11b69c39899d6133e6f2166ec06bae94", "score": "0.5458088", "text": "function newline () {\n\tvar space = findLastNewline();\n insertTextAtCursor(\"\\n\");\n insertTextAtCursor(space);// used to move the cursor to the next line\n \n \n}", "title": "" } ]
[ { "docid": "0efc9bd7fbaa80e958410e88e20e5701", "score": "0.625115", "text": "function setStartsOnNewLine(node,newLine){getOrCreateEmitNode(node).startsOnNewLine=newLine;return node;}", "title": "" }, { "docid": "69ddad467eb886c3a89b0a135c7040af", "score": "0.61846304", "text": "function createNewLine() {\r\n var sceneEl = document.querySelector('a-scene');\r\n var entityEl = document.createElement('a-entity');\r\n entityEl.setAttribute('line', {\r\n start: { x: 0, y: 0, z: 0 },\r\n end: { x: rand1, y: rand2, z: rand3 },\r\n color: red,\r\n });\r\n entityEl.setAttribute('end', { x: rand1, y: rand2, z: rand3 });\r\n entityEl.setAttribute('start', { x: 0, y: 0, z: 0 });\r\n\r\n sceneEl.appendChild(entityEl);\r\n}", "title": "" }, { "docid": "9816f6ee61341fd929c47759e451c589", "score": "0.590142", "text": "newIndentedLine() {\n this.execCommand('newlineAndIndent');\n }", "title": "" }, { "docid": "9816f6ee61341fd929c47759e451c589", "score": "0.590142", "text": "newIndentedLine() {\n this.execCommand('newlineAndIndent');\n }", "title": "" }, { "docid": "4b0144767bf9a19999e5925ed96a0af0", "score": "0.5787207", "text": "insertLinebreak() {\n let promptCell = this.promptCell;\n if (!promptCell) {\n return;\n }\n promptCell.editor.newIndentedLine();\n }", "title": "" }, { "docid": "372aad42210b061d4aefdc15a17baa55", "score": "0.5772181", "text": "function insertLine(targetDiv)\n{\n var br=document.createElement(\"br\");\n targetDiv.appendChild(br);\n}", "title": "" }, { "docid": "40c302e4fe3cd8d9f873d0324e67e8e2", "score": "0.5765345", "text": "function newLine() {\n template = $('#templateline');\n app = $('#app');\n lines = $('line_input');\n //Create new line\n template.children().clone().appendTo('#app');\n //Disable previous lines\n if ($('.line_input').length > 2) {\n lines = $('.line_input');\n lines[lines.length - 2].disabled = true;\n }\n //Select the new line\n lines[lines.length - 1].select();\n}", "title": "" }, { "docid": "3b9ab94f390e6011f0a948b93b758023", "score": "0.57363397", "text": "function createLine(content, type, index, doFocus) {\n const line = document.createElement('p');\n line.classList.add('line');\n line.classList.add(type);\n line.innerText = content;\n line.setAttribute('contenteditable', 'true');\n line.dataset.line = index;\n\n const obj = {\n content: content,\n type: type,\n };\n\n if (index === 'LAST') {\n index = session.lines.length;\n session.elements.push(line);\n session.lines.push(obj);\n } else {\n session.elements.splice(index, 0, line);\n session.lines.splice(index, 0, obj);\n };\n\n line.addEventListener('input', _ => {\n editLine(line.innerText, index, false);\n });\n\n line.addEventListener('focus', _ => {\n session.lastActiveLine = line;\n });\n\n renderLine(line, index);\n\n if (doFocus) {\n line.focus();\n }\n\n updateIndexes();\n}", "title": "" }, { "docid": "e361e8a187e1cd6a499d355060ccbc12", "score": "0.56620115", "text": "duplicateLinewise(selection) {\n const amount = this.getCount() + 1\n const rows = selection\n .getText()\n .split(\"\\n\")\n .map(row => row.repeat(amount))\n selection.insertText(rows.join(\"\\n\"), {select: true})\n }", "title": "" }, { "docid": "8045eec25891383984d8d048d9578061", "score": "0.5644373", "text": "function newLine() {\n\t\tvar table = document.createElement(\"table\");\n\t\ttable.border = \"0px\";\n\t\ttable.cellSpacing = \"0px\";\n\t\ttable.cellPadding = \"0px\";\n\t\ttoolbar.appendChild(table);\n\t\t// TBODY is required for IE, otherwise you don't see anything\n\t\t// in the TABLE.\n\t\tvar tb_body = document.createElement(\"tbody\");\n\t\ttable.appendChild(tb_body);\n\t\ttb_row = document.createElement(\"tr\");\n\t\ttb_body.appendChild(tb_row);\n\t}", "title": "" }, { "docid": "10b2baa7991313a96be5a237dd64acab", "score": "0.5644246", "text": "async function addLineToTextTable(title, play_id, nextLine){\n\ttry {\n\t\t//Checks for character in public.characters\n\t\tlet character_id = await pg('characters').select('id').where({name: nextLine.character, play_id})\n\t\tif(await character_id.length === 0) {\n\t\t\tconsole.log(`${title}: Adding character ${nextLine.character} to public.characters`)\n\t\t\tcharacter_id = (await pg('characters').insert({name: nextLine.character, play_id: play_id}, 'id'))[0]\n\t\t} else {\n\t\t\tcharacter_id = (await character_id)[0].id\n\t\t}\n\n\t\t//Adds the line\n\t\tconst { act, scene, line_no, line } = nextLine\n\t\tawait pg('text').insert({\n\t\t\tplay_id,\n\t\t\tact,\n\t\t\tscene,\n\t\t\tline_no,\n\t\t\tcharacter_id,\n\t\t\tline\n\t\t})\n\t} catch (reason) {\n\t\tlogError(reason)\n\t}\n}", "title": "" }, { "docid": "8b9dfaa7dafc927b51259865cbea8071", "score": "0.5639456", "text": "function newLine()\r\n {\r\n if ( typeof tb_row != 'undefined' && tb_row.childNodes.length === 0)\r\n {\r\n return;\r\n }\r\n\r\n var table = document.createElement(\"table\");\r\n table.border = \"0px\";\r\n table.cellSpacing = \"0px\";\r\n table.cellPadding = \"0px\";\r\n if ( editor.config.flowToolbars )\r\n {\r\n if ( HTMLArea.is_ie )\r\n {\r\n table.style.styleFloat = \"left\";\r\n }\r\n else\r\n {\r\n table.style.cssFloat = \"left\";\r\n }\r\n }\r\n\r\n toolbar.appendChild(table);\r\n // TBODY is required for IE, otherwise you don't see anything\r\n // in the TABLE.\r\n var tb_body = document.createElement(\"tbody\");\r\n table.appendChild(tb_body);\r\n tb_row = document.createElement(\"tr\");\r\n tb_body.appendChild(tb_row);\r\n\r\n table.className = 'toolbarRow'; // meh, kinda.\r\n } // END of function: newLine", "title": "" }, { "docid": "ee10a5ed1cdbd23413af360abfb183ff", "score": "0.56121564", "text": "function addEmptyLine() {\n outputEditor.session.insert({\n row: outputEditor.session.getLength(),\n column: 0\n }, '\\n');\n}", "title": "" }, { "docid": "41c56c4776924db52c02c18eb528a570", "score": "0.5595423", "text": "function onAddLine() {\n addNewLine();\n}", "title": "" }, { "docid": "d07581168b986d1b0e5b4fe7ce36c7bd", "score": "0.5564019", "text": "function insertLine () {\n\t const line = story.Continue();\n\t const {elementType, classes} = decodeTags(story.currentTags);\n\t const elem = createLineElement(line, elementType, classes);\n\t return new Promise(resolve => {\n\t const cb = oneTimeCB(resolve);\n\t elem.addEventListener('animationend', cb);\n\t setTimeout(cb, 2000);\n\t stageDiv.appendChild(elem);\n\t });\n\t}", "title": "" }, { "docid": "3e77b6b43f1df352d1a240554bc46cba", "score": "0.55576646", "text": "function rs_add_part() {\n switch (state) {\n case 1:\n rs.command += '\\n' + tmp;\n break;\n case 2:\n rs.func[rs.cur++] = tmp;\n break;\n }\n }", "title": "" }, { "docid": "38570b58a7e560a738a550a4b802c037", "score": "0.5555697", "text": "function makeRow()\r\n{\r\n enclose('<tr>\\n<td>', '</td>\\n</tr>');\r\n}", "title": "" }, { "docid": "ff473364c59bdba63e535d4f1c5c0be6", "score": "0.55290705", "text": "function createNewLinkCommand () {\n // isCreatingDragLine = true;\n updateMode(Mode.EDIT);\n showMessage(\"Drag from one node to create link\", 3000);\n}", "title": "" }, { "docid": "db199add3f876207f4edc059e93b9f8f", "score": "0.54733443", "text": "function create(path) {\n// console.log('\\x1b[32mcreate\\x1b[0m: ' + path);\n}", "title": "" }, { "docid": "db199add3f876207f4edc059e93b9f8f", "score": "0.54733443", "text": "function create(path) {\n// console.log('\\x1b[32mcreate\\x1b[0m: ' + path);\n}", "title": "" }, { "docid": "206d268c95e5e44163cc81041090a34d", "score": "0.5467501", "text": "insertLine(row, line) {\n throw new Error('Not implemented: insertLine');\n }", "title": "" }, { "docid": "67764fdba29e101a90db3b772dcbdfe1", "score": "0.54606426", "text": "addLineBreak () {\r\n if (!(\r\n this._stackItem instanceof BlockStackItem\r\n || this._stackItem instanceof TableCellStackItem\r\n )) { return; }\r\n if (this._stackItem.isPre) {\r\n this._stackItem.rawText += '\\n';\r\n } else {\r\n this._stackItem.inlineTextBuilder.startNewLine();\r\n }\r\n }", "title": "" }, { "docid": "ab256a89b1308df0f7b5972cf1e46b2a", "score": "0.5451535", "text": "function addLine() {\n let line = _createLine ()\n gMeme.lines.push(line)\n gMeme.selectedLineIdx = line.id\n}", "title": "" }, { "docid": "b4fc87a75dd1f2b907b6c317f08ef2ab", "score": "0.5446255", "text": "function addLine() {\n var newLine = {\n editing: false,\n lineNumber: vm.lines.length + 1,\n unitOfMeasureId: 1553,\n id: getNewId(),\n productType: 1\n };\n\n vm.lines.push(newLine);\n\n if (scope.onChange) {\n scope.onChange();\n }\n\n lineChanged();\n\n scope.$evalAsync(function () {\n selectLine(newLine, null, true);\n });\n }", "title": "" }, { "docid": "b559d67f8dd9b90336ac45958f6e8dae", "score": "0.5429975", "text": "function makeLine(length) {\n var line = \"\";\n for (var j = 1; j <= length; j++) {\n line += \"* \"\n \t}\n\n return line + \"\\n\";\n}", "title": "" }, { "docid": "faf944c65242ae0316c29a9a45f0ef3c", "score": "0.54284364", "text": "function createHardLines()\r\n{\r\n\tProcess.execute(\"createhardlines\",\"materialoverview.do\");\r\n}", "title": "" }, { "docid": "3808734b31d9d1d5c40b6a526f6aa1fe", "score": "0.54202753", "text": "function dwscripts_getNewline()\n{\n var retVal = \"\";\n\n var newlineInt = dw.getPreferenceInt(\"Source Format\", \"Line Break Type\", -1);\n\n if (newlineInt == -1) // if we failed, return the new line based on platform\n {\n retVal = (dwscripts.IS_MAC) ? \"\\x0D\" : \"\\x0D\\x0A\";\n }\n else\n {\n retVal = (newlineInt == 0x0d0a) ? \"\\x0D\\x0A\" : String.fromCharCode(newlineInt);\n }\n\n return retVal;\n}", "title": "" }, { "docid": "e44c73641cd95eff7adf9651105c4502", "score": "0.54182994", "text": "function genYellowLine() {\n var maxWidth = 700;\n var verticalPosition = 310; \n doc.moveTo(maxWidth, verticalPosition) \n .lineTo(0, verticalPosition) \n .lineWidth(1.2) \n .strokeColor('#ffb300') \n .stroke() \n }", "title": "" }, { "docid": "0d3a7e618164e0c03640866372a6f217", "score": "0.5411141", "text": "function makeLine(length) {\r\n var line = \"\";\r\n for (var j = 1; j <= length; j++) {\r\n line += \"* \";\r\n }\r\n return line + \"\\n\";\r\n}", "title": "" }, { "docid": "8d72e7e8178ce2a3bb7e791e6f05dc6e", "score": "0.5404644", "text": "function makeLine(length) {\n var line = \"\";\n for (var j = 1; j <= length; j++) {\n line += \"* \";\n }\n return line + \"\\n\";\n}", "title": "" }, { "docid": "523b54df167ea94c4a3720cacd0eb595", "score": "0.5403698", "text": "function writeLine(text ,target){\r\n var container = document.createElement(\"div\");\r\n var node = document.createTextNode(text);\r\n container.appendChild(node);\r\n target.appendChild(container);\r\n}", "title": "" }, { "docid": "92d34a84dca459fbb84fe7d94b56b85a", "score": "0.5398282", "text": "function addSeparator() {\n for (let i = 0; i < 6; i++) { lines[i] += \"-|\"; }\n\n return this;\n }", "title": "" }, { "docid": "be26b05246868539263acdcde7f2f330", "score": "0.53939867", "text": "function _createLine (id = gNextId++, y=gCanvasHeight/2) {\n return {\n id,\n y,\n x:gCanvasWidth/2,\n txt:'TYPE SOMETHING',\n size: 30,\n align: 'center',\n color: 'white',\n stroke: 'orange',\n font: 'impact'\n }\n}", "title": "" }, { "docid": "2cf30fb86f327828385c55547cf8bc0f", "score": "0.5390831", "text": "static prependNewLines(match) {\n return `\\n${match.replace('\\n', '').split('\\n').join(`${EMPTY_LINE}\\n`)}`;\n }", "title": "" }, { "docid": "5872ecf803c8c771f116364557fe5d56", "score": "0.5388296", "text": "function makeLine(length) {\n var line = \"\";\n for (var j = 1; j <= length; j++) {\n line += \"* \";\n }\n return line + \"\\n\";\n }", "title": "" }, { "docid": "685c8714488877f8c2043b1c8f21737c", "score": "0.537206", "text": "newLine() {\n this.line++;\n this.col = 0;\n }", "title": "" }, { "docid": "40ea6953fc95e403149d07138767ec52", "score": "0.53676593", "text": "insertLines(params) {\n let param, row, j;\n param = params[0];\n if (param < 1) {\n param = 1;\n }\n row = this._terminal.y + this._terminal.ybase;\n j = this._terminal.rows - 1 - this._terminal.scrollBottom;\n j = this._terminal.rows - 1 + this._terminal.ybase - j + 1;\n while (param--) {\n if (this._terminal.lines.length === this._terminal.lines.maxLength) {\n // Trim the start of lines to make room for the new line\n this._terminal.lines.trimStart(1);\n this._terminal.ybase--;\n this._terminal.ydisp--;\n row--;\n j--;\n }\n // test: echo -e '\\e[44m\\e[1L\\e[0m'\n // blankLine(true) - xterm/linux behavior\n this._terminal.lines.splice(row, 0, this._terminal.blankLine(true));\n this._terminal.lines.splice(j, 1);\n }\n // this.maxRange();\n this._terminal.updateRange(this._terminal.y);\n this._terminal.updateRange(this._terminal.scrollBottom);\n }", "title": "" }, { "docid": "9e64fa36203dbb5756230367fa55096e", "score": "0.53592014", "text": "function create(line, character) {\r\n return { line: line, character: character };\r\n }", "title": "" }, { "docid": "9e64fa36203dbb5756230367fa55096e", "score": "0.53592014", "text": "function create(line, character) {\r\n return { line: line, character: character };\r\n }", "title": "" }, { "docid": "ac53b2597c1ba89f1cdbf45c2479da8c", "score": "0.53589964", "text": "insertNewline(/*event*/) {\n this._super(...arguments);\n this._parse();\n }", "title": "" }, { "docid": "a749769884174195bb6d740da5614cd9", "score": "0.5333706", "text": "function makeLine(length) {\n var line = \"\";\n for (var j = 1; j <= length; j++) {\n line += \"* \";\n }\n return line + \"\\n\";\n}", "title": "" }, { "docid": "a749769884174195bb6d740da5614cd9", "score": "0.5333706", "text": "function makeLine(length) {\n var line = \"\";\n for (var j = 1; j <= length; j++) {\n line += \"* \";\n }\n return line + \"\\n\";\n}", "title": "" }, { "docid": "a749769884174195bb6d740da5614cd9", "score": "0.5333706", "text": "function makeLine(length) {\n var line = \"\";\n for (var j = 1; j <= length; j++) {\n line += \"* \";\n }\n return line + \"\\n\";\n}", "title": "" }, { "docid": "a749769884174195bb6d740da5614cd9", "score": "0.5333706", "text": "function makeLine(length) {\n var line = \"\";\n for (var j = 1; j <= length; j++) {\n line += \"* \";\n }\n return line + \"\\n\";\n}", "title": "" }, { "docid": "a749769884174195bb6d740da5614cd9", "score": "0.5333706", "text": "function makeLine(length) {\n var line = \"\";\n for (var j = 1; j <= length; j++) {\n line += \"* \";\n }\n return line + \"\\n\";\n}", "title": "" }, { "docid": "a749769884174195bb6d740da5614cd9", "score": "0.5333706", "text": "function makeLine(length) {\n var line = \"\";\n for (var j = 1; j <= length; j++) {\n line += \"* \";\n }\n return line + \"\\n\";\n}", "title": "" }, { "docid": "a749769884174195bb6d740da5614cd9", "score": "0.5333706", "text": "function makeLine(length) {\n var line = \"\";\n for (var j = 1; j <= length; j++) {\n line += \"* \";\n }\n return line + \"\\n\";\n}", "title": "" }, { "docid": "a749769884174195bb6d740da5614cd9", "score": "0.5333706", "text": "function makeLine(length) {\n var line = \"\";\n for (var j = 1; j <= length; j++) {\n line += \"* \";\n }\n return line + \"\\n\";\n}", "title": "" }, { "docid": "a749769884174195bb6d740da5614cd9", "score": "0.5333706", "text": "function makeLine(length) {\n var line = \"\";\n for (var j = 1; j <= length; j++) {\n line += \"* \";\n }\n return line + \"\\n\";\n}", "title": "" }, { "docid": "a749769884174195bb6d740da5614cd9", "score": "0.5333706", "text": "function makeLine(length) {\n var line = \"\";\n for (var j = 1; j <= length; j++) {\n line += \"* \";\n }\n return line + \"\\n\";\n}", "title": "" }, { "docid": "a749769884174195bb6d740da5614cd9", "score": "0.5333706", "text": "function makeLine(length) {\n var line = \"\";\n for (var j = 1; j <= length; j++) {\n line += \"* \";\n }\n return line + \"\\n\";\n}", "title": "" }, { "docid": "22a2c03f043346ac3ec667ec1867bebf", "score": "0.53326017", "text": "function addLine(a, b, hex) {\n addPoint(a, hex);\n addPoint(b, hex);\n }", "title": "" }, { "docid": "e121df9c23847c57b994ca2a92700ff4", "score": "0.5332227", "text": "newLine() {\n this.line++;\n this.col = 0;\n }", "title": "" }, { "docid": "d938fa1dca48c7e27e46a59c8985e1dd", "score": "0.5324861", "text": "function create(line, character) {\n return { line: line, character: character };\n }", "title": "" }, { "docid": "32c20fa3ceb62f8f99667bc914244681", "score": "0.5316772", "text": "function create(line, character) {\n return { line: line, character: character };\n }", "title": "" }, { "docid": "32c20fa3ceb62f8f99667bc914244681", "score": "0.5316772", "text": "function create(line, character) {\n return { line: line, character: character };\n }", "title": "" }, { "docid": "32c20fa3ceb62f8f99667bc914244681", "score": "0.5316772", "text": "function create(line, character) {\n return { line: line, character: character };\n }", "title": "" }, { "docid": "32c20fa3ceb62f8f99667bc914244681", "score": "0.5316772", "text": "function create(line, character) {\n return { line: line, character: character };\n }", "title": "" }, { "docid": "32c20fa3ceb62f8f99667bc914244681", "score": "0.5316772", "text": "function create(line, character) {\n return { line: line, character: character };\n }", "title": "" }, { "docid": "d423b91e038c38e60635d764518a3b6d", "score": "0.53118724", "text": "static line(spec) {\n return new LineDecoration(spec);\n }", "title": "" }, { "docid": "f759108b5f3d09381c34105bbcac8788", "score": "0.5297652", "text": "function makeLine(length) {\n var line = \"\";\n for (var i = 0; i <= length-1; i++) {\n for(var j = 0; j<=i; j++){\n line += \"* \";\n }\n line += \"\\n\";\n }\n return line + \"\\n\";\n}", "title": "" }, { "docid": "a38d6006dafa0854d322cfdb1bf0d674", "score": "0.5297617", "text": "addLineBreak () {\n if (!(\n this._stackItem instanceof BlockStackItem\n || this._stackItem instanceof ListItemStackItem\n || this._stackItem instanceof TableCellStackItem\n )) { return; }\n if (this._stackItem.isPre) {\n this._stackItem.rawText += '\\n';\n } else {\n this._stackItem.inlineTextBuilder.startNewLine();\n }\n }", "title": "" }, { "docid": "3083447e916295c3cd493f31a0a208db", "score": "0.52836114", "text": "function createLineUp(r) {\n lineup.setData(r);\n }", "title": "" }, { "docid": "f5d013fe652aa5a4397f601179d4e6d9", "score": "0.52799225", "text": "function createInstruction(instruction){var literal=ts.createLiteral(instruction);ts.addSyntheticTrailingComment(literal,3/* MultiLineCommentTrivia */,getInstructionName(instruction));return literal;}", "title": "" }, { "docid": "46210c1b8432fbfc8093e49328e14c55", "score": "0.52665085", "text": "function CreateTextLineObj(x, y) {\n var line = {\n id: nextLineId++,\n posX: x,\n posY: y\n }\n return line;\n}", "title": "" }, { "docid": "22ebf2c735cda8606a0d84e3f444fbfb", "score": "0.5257526", "text": "newLine() {\n this.printer(this.lineBuffer);\n this.lineBuffer = this.getSpacing();\n }", "title": "" }, { "docid": "f72acff6831f0003528f77fa7f9b950d", "score": "0.5242869", "text": "create(line, character) {\n return { line, character };\n }", "title": "" }, { "docid": "d3250c626279a653e97e6ad2387fa08c", "score": "0.52340865", "text": "function newLine(insertInto, message){\r\n var insertInElement = document.getElementById(insertInto);\r\n newText = document.createTextNode(message);\r\n insertInElement.appendChild(newText);\r\n newBreak = document.createElement(\"br\");\r\n insertInElement.appendChild(newBreak);\r\n}", "title": "" }, { "docid": "7328f2e158e87f3975a80284da4a4b8b", "score": "0.5211046", "text": "function insertNewLines(lines, tabs){\n let close_block = [];\n let lvl = 0;\n for (let i = 0; i < tabs.length; i++) {\n if (tabs[i] > tabs[i+1]){\n lvl = Math.abs(tabs[i+1] - tabs[i]);\n for (let j = 0; j < lvl; j++) {\n close_block.push(\" \".repeat(j));\n close_block.push(\"}\");\n close_block.push(\"\\n\");\n lines.splice(i+1 , 0, close_block);\n close_block = []\n }\n\n }\n }\n return lines\n}", "title": "" }, { "docid": "72629dfbd542aedeed347a48f30ff464", "score": "0.51861286", "text": "function Line() {}", "title": "" }, { "docid": "72629dfbd542aedeed347a48f30ff464", "score": "0.51861286", "text": "function Line() {}", "title": "" }, { "docid": "72629dfbd542aedeed347a48f30ff464", "score": "0.51861286", "text": "function Line() {}", "title": "" }, { "docid": "72629dfbd542aedeed347a48f30ff464", "score": "0.51861286", "text": "function Line() {}", "title": "" }, { "docid": "6172074a3e53a3c3a5ad07576256ee88", "score": "0.5174071", "text": "function insertPart(part){\n var text = \"\\n\";\n if (part.nodeType == 3) {\n select.snapshotChanged();\n part = makePartSpan(part);\n text = part.currentText;\n afterBR = false;\n }\n else {\n if (afterBR && window.opera)\n point(makePartSpan(\"\"));\n afterBR = true;\n }\n part.dirty = true;\n nodeQueue.push(part);\n point(part);\n return text;\n }", "title": "" }, { "docid": "02fe89b1b293427ca97f33453594b09f", "score": "0.5157001", "text": "function addLineBreak() {\n\t\tif (skipNextLineBreak) {\n\t\t\tskipNextLineBreak = false\n\t\t} else {\n\t\t\tflushText()\n\t\t\taddBlock(options.lineBreak())\n\t\t}\n\t}", "title": "" }, { "docid": "07cf3904a10c1835f4ce334e8fdb0f68", "score": "0.515597", "text": "static line(spec) {\n return new LineDecoration(spec);\n }", "title": "" }, { "docid": "3b7df7872aa183bea01b07ce84ec0ab1", "score": "0.51513326", "text": "static line(spec) {\n return new LineDecoration(spec);\n }", "title": "" }, { "docid": "48937188ada0740399dcce653f3bb8c2", "score": "0.51468605", "text": "function newLine(first) {\r\n var line = angular.element( document.createElement('span') ).addClass('typed-line');\r\n first ? elem.prepend(line) : elem.append(line);\r\n elem = line;\r\n }", "title": "" }, { "docid": "39d5e8407dffb2efe495454dfb4b9b63", "score": "0.51456", "text": "function newLine (tabenv, tablo) {\t\n\tvar line = new Array(tablo.headers.length);\n\tline.fill(null);\n\ttablo.data.push(line);\n\tfor (var i = 0 ; i < tablo.headers.length ; i ++) {\n\t\tupdCellToDefault (tablo, tablo.headers[i], tablo.data.length - 1);\n\t}\n\tfor (var i = 0 ; i < tablo.headers.length ; i ++) {\n\t\tupdCellReactions (\n\t\t\ttabenv, tablo, tablo.headers[i], tablo.data.length - 1);\n\t}\n\tupdLineAllFuncCells(tabenv, tablo, tablo.data.length - 1);\n}", "title": "" }, { "docid": "675759d9626f5aae6295a8e34056ac29", "score": "0.51404434", "text": "function addOnOwnLine(tag)\r\n{\r\n var p = replyBox.selectionEnd;\r\n var t = replyBox.value;\r\n if (t.length > 0 && p > 0 && t.charAt(p-1) != \"\\n\")\r\n tag = \"\\n\" + tag;\r\n if (p >= t.length || t.charAt(p) != '\\n')\r\n tag += \"\\n\";\r\n addTag(tag);\r\n if (t.charAt(p) == \"\\n\") {\r\n ++replyBox.selectionStart;\r\n }\r\n}", "title": "" }, { "docid": "67f0c6629b1304c4f9a6b0672116a5a5", "score": "0.51384866", "text": "function addLine() {\n gMeme.lines.push(\n {\n txt: 'Text',\n size: 40,\n font: 'Impact',\n align: 'center',\n fillColor: 'white',\n strokeColor: 'black',\n x: gCanvas.width / 2,\n y: gCanvas.height / 2,\n lineWidth: null\n }\n )\n gMeme.selectedLineIdx = gMeme.lines.length - 1;// The line added gets the focus\n}", "title": "" }, { "docid": "a6610bdd58a3424d961efe8f3faf1eb5", "score": "0.51253414", "text": "function insertLineBreaks (d){\n\tvar el = d3.select(this);\n var words = d3.select(this).text().split('\\n');\n\n // if(words.length > 1) {\n el.text('');\n\n for (var i = 0; i < words.length; i++) {\n var tspan = el.append('tspan').text(words[i]);\n if (i > 0)\n tspan.attr('x',\"20\").attr('dy','15');\n //tspan.attr('x',\"0\").attr('dy','15');\n }\n // }\n}", "title": "" }, { "docid": "91f1c1dd3d40b601fd81ab8417dadd42", "score": "0.51066554", "text": "function makeLine(num) {\n var star = \"\";\n for (var i = 1; i <= num; i++) {\n star += \"* \"\n }\n return star + \"\\n\";\n}", "title": "" }, { "docid": "05cb8d6de726c422ef7b37c2d7a2f823", "score": "0.5090569", "text": "function new_line(p1, p2, sgm, width) \n{\n var line = new Object();\n \n var subLength = CalcDistance(p1, p2) / (P_initial + 1);\n \n line.m_nSegment = P_initial + 1;\n line.m_fWidth = width;\n line.m_pEdge = [];\n line.m_pSource = [];\n line.m_pSink = [];\n line.m_pSegment = [];\n line.m_pForce = [];\n line.m_pLeftBound = [];\n line.m_pRightBound = [];\n line.m_pNormal = [];\n line.m_pAttr = [];\n line.vtr = [];\n line.length = CalcDistance(p1, p2);\n \n if (p1[1] <= p2[1]) {\n line.m_pSource = vec3(p1[0], p1[1], p1[2]);\n line.m_pSink = vec3(p2[0], p2[1], p2[2]);\n } else {\n line.m_pSource = vec3(p2[0], p2[1], p2[2]);\n line.m_pSink = vec3(p1[0], p1[1], p1[2]);\n }\n \n// console.log(\"first source: \" + line.m_pSource);\n// console.log(\"first sink: \" + line.m_pSink);\n// console.log(\"\");\n \n line.m_pSegment[0] = line.m_pSource[0];\n line.m_pSegment[1] = line.m_pSource[1];\n line.m_pSegment[2] = line.m_pSource[2];\n \n line.m_pForce[0] = 0.0;\n line.m_pForce[1] = 0.0;\n line.m_pForce[2] = 0.0;\n \n line.vtr[0] = line.m_pSink[0] - line.m_pSource[0]; \n line.vtr[1] = line.m_pSink[1] - line.m_pSource[1]; \n line.vtr[2] = line.m_pSink[2] - line.m_pSource[2];\n \n var vtr = line.vtr;\n vtr = norVector(vtr);\n \n vtr[0] = vtr[0] * subLength;\n vtr[1] = vtr[1] * subLength;\n vtr[2] = vtr[2] * subLength;\n \n var x, y, z;\n var tmp = [];\n tmp[0] = line.m_pSource[0];\n tmp[1] = line.m_pSource[1];\n tmp[2] = line.m_pSource[2];\n for (var i = 1; i < line.m_nSegment; i++) {\n tmp[0] += vtr[0];\n tmp[1] += vtr[1];\n tmp[2] += vtr[2];\n \n x = tmp[0];\n y = tmp[1];\n z = tmp[2];\n line.m_pSegment[i * 3 + 0] = x;\n line.m_pSegment[i * 3 + 1] = y;\n line.m_pSegment[i * 3 + 2] = z;\n \n line.m_pForce[i * 3 + 0] = 0.0;\n line.m_pForce[i * 3 + 1] = 0.0;\n line.m_pForce[i * 3 + 2] = 0.0;\n }\n line.m_pSegment[line.m_nSegment * 3 + 0] = line.m_pSink[0];\n line.m_pSegment[line.m_nSegment * 3 + 1] = line.m_pSink[1];\n line.m_pSegment[line.m_nSegment * 3 + 2] = line.m_pSink[2];\n \n line.m_pForce[line.m_nSegment * 3 + 0] = 0.0;\n line.m_pForce[line.m_nSegment * 3 + 1] = 0.0;\n line.m_pForce[line.m_nSegment * 3 + 2] = 0.0;\n \n for (var i = 0; i <= line.m_nSegment; i++) {\n line.m_pAttr[i] = 1.0;\n }\n \n// console.log(\"init: line has segment \" + line.m_pSegment);\n// console.log(\"init: line has segment 0: \" + line.m_pSegment[0]);\n// console.log(\"init: line has segment 1: \" + line.m_pSegment[1]);\n// console.log(\"init: line has segment 2: \" + line.m_pSegment[2]);\n// console.log(\"init: line has segment 3: \" + line.m_pSegment[3]);\n// console.log(\"init: line has segment 4: \" + line.m_pSegment[4]);\n// console.log(\"init: line has segment 5: \" + line.m_pSegment[5]);\n// console.log(\"init: line has segment 6: \" + line.m_pSegment[6]);\n// console.log(\"init: line has segment 7: \" + line.m_pSegment[7]);\n// console.log(\"init: line has segment 8: \" + line.m_pSegment[8]);\n \n// console.log(\"segment: \" + line.m_pSegment);\n// console.log(\"second source: \" + line.m_pSource);\n// console.log(\"second sink: \" + line.m_pSink);\n// console.log(\"\");\n \n //--------------make up a polygon for shader-----------------\n// var tmp_eye = [];\n// var tan = [];\n// var side = [];\n// var n = [];\n//\n// /*\n// * the vector of the mid subpoints\n// */\n// \n// for (var i = 0; i < line.m_nSegment; i++) {\n// tan[0] = line.m_pSegment[(i + 1) * 3 + 0] - line.m_pSegment[i * 3 + 0];\n// tan[1] = line.m_pSegment[(i + 1) * 3 + 1] - line.m_pSegment[i * 3 + 1];\n// tan[2] = line.m_pSegment[(i + 1) * 3 + 2] - line.m_pSegment[i * 3 + 2];\n//\n// tmp_eye[0] = eye[0];\n// tmp_eye[1] = eye[1];\n// tmp_eye[2] = eye[2];\n//\n// side[0] = tmp_eye[1] * tan[2] - tmp_eye[2] * tan[1];\n// side[1] = tmp_eye[2] * tan[0] - tmp_eye[0] * tan[2];\n// side[2] = tmp_eye[0] * tan[1] - tmp_eye[1] * tan[0];\n//\n// side = norVector(side);\n// line.m_pLeftBound[i * 3 + 0] = side[0] * line.m_fWidth + line.m_pSegment[i * 3 + 0];\n// line.m_pLeftBound[i * 3 + 1] = side[1] * line.m_fWidth + line.m_pSegment[i * 3 + 1];\n// line.m_pLeftBound[i * 3 + 2] = side[2] * line.m_fWidth + line.m_pSegment[i * 3 + 2];\n// line.m_pRightBound[i * 3 + 0] = -side[0] * line.m_fWidth + line.m_pSegment[i * 3 + 0];\n// line.m_pRightBound[i * 3 + 1] = -side[1] * line.m_fWidth + line.m_pSegment[i * 3 + 1];\n// line.m_pRightBound[i * 3 + 2] = -side[2] * line.m_fWidth + line.m_pSegment[i * 3 + 2];\n// }\n//\n// /*\n// * the vector of the last subpoint\n// */\n// \n// tan[0] = line.m_pSegment[line.m_nSegment * 3 + 0]\n// - line.m_pSegment[(line.m_nSegment - 1) * 3 + 0];\n// tan[1] = line.m_pSegment[line.m_nSegment * 3 + 1]\n// - line.m_pSegment[(line.m_nSegment - 1) * 3 + 1];\n// tan[2] = line.m_pSegment[line.m_nSegment * 3 + 2]\n// - line.m_pSegment[(line.m_nSegment - 1) * 3 + 2];\n//\n// tmp_eye[0] = eye[0];\n// tmp_eye[1] = eye[1];\n// tmp_eye[2] = eye[2];\n//\n// side[0] = tmp_eye[1] * tan[2] - tmp_eye[2] * tan[1];\n// side[1] = tmp_eye[2] * tan[0] - tmp_eye[0] * tan[2];\n// side[2] = tmp_eye[0] * tan[1] - tmp_eye[1] * tan[0];\n//\n// side = norVector(side);\n// line.m_pLeftBound[line.m_nSegment * 3 + 0] = side[0] * line.m_fWidth\n// + line.m_pSegment[line.m_nSegment * 3 + 0];\n// line.m_pLeftBound[line.m_nSegment * 3 + 1] = side[1] * line.m_fWidth\n// + line.m_pSegment[line.m_nSegment * 3 + 1];\n// line.m_pLeftBound[line.m_nSegment * 3 + 2] = side[2] * line.m_fWidth\n// + line.m_pSegment[line.m_nSegment * 3 + 2];\n// line.m_pRightBound[line.m_nSegment * 3 + 0] = -side[0] * line.m_fWidth\n// + line.m_pSegment[line.m_nSegment * 3 + 0];\n// line.m_pRightBound[line.m_nSegment * 3 + 1] = -side[1] * line.m_fWidth\n// + line.m_pSegment[line.m_nSegment * 3 + 1];\n// line.m_pRightBound[line.m_nSegment * 3 + 2] = -side[2] * line.m_fWidth\n// + line.m_pSegment[line.m_nSegment * 3 + 2];\n \n return line;\n}", "title": "" }, { "docid": "0c8eae06bd2a948372746cec24aaed68", "score": "0.50604105", "text": "function emptyLine(w, c1, c2) {\n var s = \"\";\n var s = c1;\n for (let i = 0; i < w - 2; i++) {\n s += c2;\n }\n if (w > 1) {\n s += c1;\n }\n s += \"<br/>\";\n return s;\n}", "title": "" }, { "docid": "bc0efb413397f372d07e2e755a685561", "score": "0.5052573", "text": "createCrescendoLines(startX, endX, y, wedgeOpeningLength = this.rules.WedgeOpeningLength, wedgeLineWidth = this.rules.WedgeLineWidth) {\n const lineStart = new PointF2D_1.PointF2D(startX, y);\n const upperLineEnd = new PointF2D_1.PointF2D(endX, y - wedgeOpeningLength / 2);\n const lowerLineEnd = new PointF2D_1.PointF2D(endX, y + wedgeOpeningLength / 2);\n this.addWedgeLines(lineStart, upperLineEnd, lowerLineEnd, wedgeLineWidth);\n }", "title": "" }, { "docid": "670e4081707311a9be619fae6d25bf37", "score": "0.5038575", "text": "insert(new_node)\n {\n var data = {\n key: new_node,\n // items: [{name: \"URL: from reasoning path\", figure: \"Decision\", color: '#52ce60'},\n // {name: \"ID: xxx\"}],\n name: new_node\n }\n\n this.diagram.model.commit(m => m.addNodeData(data), \"Add New Node\");\n }", "title": "" }, { "docid": "413fc7923a5df194b2f6eac3e14d9bfa", "score": "0.5037748", "text": "function createNode(){\n\t\tnode = svgDoc.createElementNS(svgns,'line');\n\t\tnode.setAttribute('x1',this.x1);\n\t\tnode.setAttribute('y1',this.y1);\n\t\tnode.setAttribute('x2',this.x2);\n\t\tnode.setAttribute('y2',this.y2);\n\t\tnode.setAttribute('stroke',this.stroke);\n\t\tnode.setAttribute('stroke-width',this.strokewidth);\n\t\tnode.setAttribute('transform','translate(0,0)');\n\t\tnode.setAttribute('style','');\n return node;\n }", "title": "" }, { "docid": "e8b4500d1b58211660b44cec4e622a78", "score": "0.49949914", "text": "function Line(){}", "title": "" }, { "docid": "49c646255086e4e321127330ffb5ef9a", "score": "0.49893788", "text": "function AddLineAction( cursor ) {\r\n ActionBase.call( this, cursor );\r\n\r\n this.lines= 1;\r\n }", "title": "" }, { "docid": "f7972db8c18da89563681119c38275ee", "score": "0.49884868", "text": "function multiline() {\n // refactor to a single template literal with multiple lines\n return (`\n this is on a new line\n `)\n }", "title": "" }, { "docid": "d673eae13b19dd7a3ab971cf91d5ffd9", "score": "0.49843523", "text": "function createNote() {\n $(\".note-box\").prepend(\"<div class='new-note'><div class='editable' contenteditable='true'></div><div class='toolbar'><i class='fa fa-trash' aria-hidden='true'></i><button onclick='document.execCommand('bold',false,true);'><i class='fa fa-bold' aria-hidden='true'></i></button><button onclick='document.execCommand('italic',false,true);'><i class='fa fa-italic' aria-hidden='true'></i></button><button onclick='document.execCommand('underline',false,true);'><i class='fa fa-underline' aria-hidden='true'></i></button><i class='fa fa-exclamation' aria-hidden='true'></i></div></div>\");\n }", "title": "" }, { "docid": "e2e1e03403f3dd33ee4ba70af21d3933", "score": "0.49839538", "text": "function createInterlining()\r\n{\r\n\tProcess.execute(\"createinterlining\",\"materialoverview.do\");\r\n}", "title": "" }, { "docid": "dfe1fa2c4dbeeb93602bd6a2daccf880", "score": "0.49783698", "text": "function multilineSOLUTION() {\n // refactor to a single template literal with multiple lines\n return (`\n this is on a new line\n `)\n }", "title": "" }, { "docid": "5c42896ff905b4c5298c30b3c26aa92a", "score": "0.49535328", "text": "function add_space(li) {\n li.appendChild(document.createElement(\"br\"));\n }", "title": "" }, { "docid": "ebfda39141824e6a9cffd2b14595e1fa", "score": "0.49504113", "text": "function makeLine(length) {\n var line = \"\";\n for (var j = 1; j <= length; j++) {\n line += \"e\";\n }\n return line + \"\\n\";\n}", "title": "" }, { "docid": "52da1f1a1140f8f09f596cf030aa4fa6", "score": "0.49457172", "text": "function newLineWebGl(vertices){\n\n\t// agregamos un material para que el punto tenga color\n\tvar Material=new THREE.PointsMaterial({color:0X0000FF,size:10});\n\n\tvar geometry = new THREE.Geometry();\n\n\t//var vertices=points;\n\tvar long_vertices=vertices.length;\n\n\tfor(i=0;i<long_vertices;i++){\n\t\tx=vertices[i][0];\n\t\ty=vertices[i][1];\n\t\tz=vertices[i][2];\n\t\tVector=new THREE.Vector3(x,y,z);\n\t\tgeometry.vertices.push(Vector); \n\t}\n\t\n\tvar line = new THREE.Line(geometry,Material);\n\t//console.info(\"update\",geometry.verticesNeedUpdate,geometry)\t\n\treturn line;\n}", "title": "" }, { "docid": "5ef0dea1f015b0ed0892eb66a5ab9f8c", "score": "0.49445936", "text": "function create(newText, insert, replace) {\n return { newText: newText, insert: insert, replace: replace };\n }", "title": "" }, { "docid": "5ef0dea1f015b0ed0892eb66a5ab9f8c", "score": "0.49445936", "text": "function create(newText, insert, replace) {\n return { newText: newText, insert: insert, replace: replace };\n }", "title": "" }, { "docid": "5ef0dea1f015b0ed0892eb66a5ab9f8c", "score": "0.49445936", "text": "function create(newText, insert, replace) {\n return { newText: newText, insert: insert, replace: replace };\n }", "title": "" } ]
ddba9ea1ed6c2e038169bbdc6253cfd7
Clean the components folder
[ { "docid": "5692dfc9c030792a4b5df2ed8b04516a", "score": "0.7729921", "text": "function cleanComponents() {\n return gulp.src('app/components', { allowEmpty: true})\n .pipe(clean());\n}", "title": "" } ]
[ { "docid": "936bb14e960ff213ba043ee400e07fb6", "score": "0.73780996", "text": "function clean() {\n return del(['./dist/']);\n}", "title": "" }, { "docid": "37ffd21d169e301e8b8366f9f2d9b336", "score": "0.7242133", "text": "function clean() {\n execSync('(rm -rf node_modules/react-intl/node_modules/react || true)', execSyncOptions);\n execSync('(rm -rf node_modules/fixed-data-table-2/node_modules/react || true)', execSyncOptions);\n execSync('(rm -rf node_modules/revenge/node_modules/react || true)', execSyncOptions);\n execSync('rm -rf build/*', execSyncOptions);\n execSync('mkdir -p build', execSyncOptions);\n}", "title": "" }, { "docid": "e695f9eef79d302ad316935549eb1ea2", "score": "0.72117287", "text": "function clean() {\n const files = glob.sync(\n BUILD_DIR.concat(path.sep, '**', path.sep, '*')\n );\n files.forEach((file) => {\n try {\n fs.unlinkSync(file);\n } catch {}\n });\n}", "title": "" }, { "docid": "7a5c75129480179063ca1e3db999f385", "score": "0.71878165", "text": "function clean() {\n return del(global.config.build.rootDirectory);\n}", "title": "" }, { "docid": "b6fb9d5e8597d2bef6b7a5d632d762d1", "score": "0.7165108", "text": "async function clean() {\n await del([`build/apps/${config.appName}/${config.appVersion}/*`], { dot: true });\n}", "title": "" }, { "docid": "bb2feb5896394909f705aa862c88413a", "score": "0.7090085", "text": "function clean() {\n return del('./dist/');\n}", "title": "" }, { "docid": "248623c86715a31b794286dbc937b31f", "score": "0.70829326", "text": "function clean() {\n const del = require(\"del\");\n return del([\"build/*\", \"!build\"], { force: true });\n}", "title": "" }, { "docid": "6865152b5415f707b115ab9dcfaff8a6", "score": "0.7071046", "text": "function clean() {\n const VENDOR_SRC = pkg.ui5.vendor ? `${pkg.ui5.vendor.path}/**/*` : ''\n return del(\n [`${DEV}/**/*`, `!${UI5}/**/*`, `!${DEV}/${FAVICON_HASH}`].concat(\n VENDOR_SRC\n )\n )\n}", "title": "" }, { "docid": "53a7d9887b04d5577ad884d7dfa0c244", "score": "0.7058467", "text": "function clean() {\r\n return del(['./_site/assets/']);\r\n}", "title": "" }, { "docid": "0e8845c5880bfab9b1377743853c8cd9", "score": "0.7048487", "text": "function cleanAll() {\n return del([outputDir, stencilBuild, dist, stencilServer]);\n}", "title": "" }, { "docid": "c99d7a904ff274e13ed9e0e636beb887", "score": "0.6992484", "text": "function clean() {\n return del(['dist']);\n}", "title": "" }, { "docid": "90e1afdeb1eb667565c9fd69aaaff482", "score": "0.6971605", "text": "function clean() {\n return del(`${paths.build}**/*.*`);\n}", "title": "" }, { "docid": "0c02b58bd1606bfc9959e7aeaccb1158", "score": "0.695397", "text": "function clean() {\n return del(paths.dest); // remove any old versions of our target build folder\n}", "title": "" }, { "docid": "e70f4dc6e00c700707103b20e51b910b", "score": "0.69032925", "text": "async cleanUp()\n {\n for (const f of this.tempJavascriptBootloaderFiles) {\n const compiledFilename = f.replace('.svelte', '.js');\n //await unlink(compiledFilename);\n }\n }", "title": "" }, { "docid": "8e3cf164cb4cbde6442da40210c4fa92", "score": "0.6863439", "text": "function clean() {\n return del([\n \"assets/partials\",\n \"assets/stylesheets\",\n \"assets/*.html\",\n \"assets/*.js\"\n ]);\n}", "title": "" }, { "docid": "8191282a66edcacf752b5317f2b70d65", "score": "0.68162847", "text": "function cleanStart() {\n return del(helpers.dist());\n}", "title": "" }, { "docid": "09117b0ec4d81a7285813ea3c9e15e35", "score": "0.6703554", "text": "clean () {\n fs.emptyDir(this.OUTPUT)\n }", "title": "" }, { "docid": "532afc3e7db3bd84280326547d42e0f2", "score": "0.66973424", "text": "function clean(done) {\n // clean the build folder\n del.sync([paths.output])\n return done()\n}", "title": "" }, { "docid": "7127d1c5dd02d12012d548174fe080ce", "score": "0.6694918", "text": "function clean(done) {\n del.sync(dist.root);\n done();\n}", "title": "" }, { "docid": "30f5a961ccda3614857308acb4f5a3f1", "score": "0.66627276", "text": "function cleanUp() {\n console.log(\"Cleaning old output files\")\n\n try {\n del.sync([outPath + \"**\", \"!\" + outPath])\n } catch (e) {\n console.log(e)\n }\n\n try {\n if (!fs.existsSync(outPath)) {\n fs.mkdirSync(outPath, { recursive: true })\n }\n } catch(e) {\n console.log(e)\n }\n \n\n console.log(\"Done cleaning!\")\n\n}", "title": "" }, { "docid": "b0f4a35c958231038c09c93cf131b875", "score": "0.6644335", "text": "function clean(cb) {\n return del(paths.dist);\n}", "title": "" }, { "docid": "6c7c6b3685edfbd2ccd62068f2efe49e", "score": "0.65826225", "text": "function clean() {\n return del([paths.static_styles.dest, paths.semantic_themes.dest]);\n}", "title": "" }, { "docid": "1d95f787023be26cc8261aae6c831d9e", "score": "0.6560213", "text": "function clean(done) {\n rimraf(PATHS.dist, done);\n}", "title": "" }, { "docid": "9bec0cfc9e0effc72cdb0886fe728d18", "score": "0.6553802", "text": "function clean() {\n return del([pathBld]);\n}", "title": "" }, { "docid": "76a252b799845527c8e47250386d2570", "score": "0.6551527", "text": "async function clean(){\n del.sync([ bundleDir, previewDir ]);\n return Promise.resolve();\n}", "title": "" }, { "docid": "414e3e2a7f4f209dce438285cbca4dd0", "score": "0.6544942", "text": "async function clean() {\n await del(['build/*', '!build/.git'], { dot: true });\n await fs.makeDir('build/public');\n}", "title": "" }, { "docid": "1a21a38d482758247d5cacb6d1398730", "score": "0.65392804", "text": "function clean(done) {\n rimraf('./dist/', done);\n}", "title": "" }, { "docid": "f2ddf88f0a97a6303857720e8348ac9b", "score": "0.6535842", "text": "function clean(done) {\n return del('dist')\n done()\n}", "title": "" }, { "docid": "251d2325b91456617d5bd8d704b1962b", "score": "0.6517778", "text": "function clean(done) {\n rimraf(PATHS.dist, done);\n}", "title": "" }, { "docid": "46da7860e814459160726193c6c7ee03", "score": "0.6491972", "text": "function clean(done) {\r\n console.log(PATHS.dist);\r\n rimraf(PATHS.dist[0], done);\r\n rimraf(PATHS.dist[1], done);\r\n rimraf(PATHS.dist[2], done);\r\n}", "title": "" }, { "docid": "be4ae264e89392b4b753e0821d4e2edd", "score": "0.64890563", "text": "function cleanSprites() {\n return del([assets.components + '/*.css'], {force: true});\n}", "title": "" }, { "docid": "daec47c598aaefdc42a76ddb23a30fe5", "score": "0.6470026", "text": "remove(){\n this.dirs.pop();\n }", "title": "" }, { "docid": "a37ff5c557fecbfe573702dfc7d78a16", "score": "0.6468466", "text": "function endClean(){\n return del([distDir + '/**/rev-manifest.json']);\n}", "title": "" }, { "docid": "7ec3df9ab2a8ee5fd05df777a3ef8b6c", "score": "0.64378935", "text": "function clean() {\n return del('public/*');\n}", "title": "" }, { "docid": "d022a4adb0d57c24c6361f5b6433b4b9", "score": "0.6431179", "text": "function clean(done) {\n\trimraf(PATHS.dist, done);\n}", "title": "" }, { "docid": "b90f93ce35a5390d52ae208d53214880", "score": "0.642318", "text": "function clean() {\n del.sync(['build/*', '!build/icons', '!build/icons/icon.*']);\n console.log(`\\n${doneLog}\\n`);\n process.exit();\n}", "title": "" }, { "docid": "badb25da4d7290b4e2535b30bdec49a9", "score": "0.64032894", "text": "function cleanTask() {\n return del(constant.BUILD_PATH + \"/**/*\");\n}", "title": "" }, { "docid": "3aaf5a36fccc6ea1944a36267619b1bc", "score": "0.6396594", "text": "function removeAppComponents(){\n\t\tfor (i = 0; i < appObjects.length; i++){\n\t\t\tappObjects[i].remove();\n\t\t}\n\t\tappObjects = [];\n\t}", "title": "" }, { "docid": "269de8b01974c215cba83e074232c7f5", "score": "0.6372937", "text": "function cleanBuild(){\n return del([config.paths.dest.dir + '/**/*', '!' + config.paths.dest.dir, '!' + config.paths.dest.dir + 'README.md']);\n}", "title": "" }, { "docid": "8e00d966ed7b3883eafeb1a5cb7055b9", "score": "0.6329986", "text": "async function cleanCss() {\n \"use strict\";\n await del([config.cssDir + \"/maps/*\", config.cssDir + \"/maps/\"]);\n}", "title": "" }, { "docid": "d6ca2f0018703f2099709fb3dbecc886", "score": "0.62699723", "text": "function cleanFolder(appBuild) {\n console.log(\"Step cleanFolder\");\n var deferred = Q.defer();\n var command = 'cd user-dist/; rm -rf *; cd ..;';\n exec(command, function(error, stdout, stderr) {\n deferred.resolve(appBuild);\n });\n return deferred.promise;\n}", "title": "" }, { "docid": "e8d53dda8c0ff95f315abb4748a62d7f", "score": "0.62503624", "text": "function clean() \n{\n return gulp.src(_outputDir, {read: false, allowEmpty:true})\n .pipe(gulpClean());\n\n //runCmd(\"rm -rf \" + _outputDir + \"/*\" ,cb);\n}", "title": "" }, { "docid": "32b8f17c1435c65ff45dc436f6d29621", "score": "0.6227785", "text": "function CleanFolders () {\n return new Promise(function (resolve, reject) {\n \n // Create the distribution directory.\n if (!fs.existsSync(distributionDirectory)){\n fs.mkdirSync(distributionDirectory);\n } \n\n if (fs.existsSync(distributionDirectory + '/all.min.js')){\n fs.unlinkSync(distributionDirectory + '/all.min.js');\n }\n\n resolve('Clean up completed.......!');\n })\n}", "title": "" }, { "docid": "17054abe29d6e3bc378c0d6fa6a24a46", "score": "0.62173843", "text": "function cleanupTemplate() {\n try {\n fs.removeSync(path.join(settings.pathTmp, '.git'));\n fs.copySync(settings.pathTmp, settings.path, { mkdirp: true, clobber: true });\n fs.removeSync(settings.pathTmp);\n } catch (err) {\n logger.info('Template cleanup failed.');\n }\n}", "title": "" }, { "docid": "be6093fd48274785121ea4d816c9de6f", "score": "0.6208975", "text": "function clean() { \n return src([paths.output], { allowEmpty: true })\n .pipe(vinylPaths(del));\n}", "title": "" }, { "docid": "8b177dd2d9f5d1620e178e2e17c561ce", "score": "0.61617035", "text": "function clean(done) {\n rimraf(PATHS.pelican.dest, done);\n}", "title": "" }, { "docid": "8dbc69ac8cf73eef207d8f41e92e7ec7", "score": "0.6155806", "text": "function clean(callback){\n return del(TEMP_DIRECTORIES , callback);\n }", "title": "" }, { "docid": "c05b5f2fa904835e8350c1a74acd6bc4", "score": "0.6152225", "text": "removeAllChildrenComponents() {\n this.childComponents.forEach( (eachComponent) => {\n this.removeChildComponent(eachComponent)\n })\n }", "title": "" }, { "docid": "80127d01e490b86e5d5c48995ab2088f", "score": "0.607187", "text": "function deleteBuild() {\n console.log('delete build folder');\n if (true === fs.existsSync(buildFolder)) {\n rimraf.sync(buildFolder);\n // fs.rmdirSync(buildFolder);\n } \n}", "title": "" }, { "docid": "0b361b4814e7066b4bade2f5723c3cd5", "score": "0.60685486", "text": "function cleanFloder(name) {\n const indexfile = path.join(excaRoot, \"./src\");\n const docsPath = path.join(excaRoot, excaDocs);\n rimraf.sync(indexfile);\n Reporter.success(\"success remove : \" + indexfile);\n rimraf.sync(docsPath);\n Reporter.success(\"success remove : \" + docsPath);\n}", "title": "" }, { "docid": "eca9c793b9708c96d3b57f15653982db", "score": "0.6066077", "text": "clear() {\n var component;\n for (const id in this.components) {\n if (this.components.hasOwnProperty(id)) {\n // Each component fires \"destroyed\" as it is destroyed,\n // which this Scene handles by removing the component\n component = this.components[id];\n if (!component._dontClear) { // Don't destroy components like xeogl.Camera, xeogl.Input, xeogl.Viewport etc.\n component.destroy();\n }\n }\n }\n }", "title": "" }, { "docid": "c8a9a54539047eba7712ca45b5c9398e", "score": "0.60619426", "text": "cleanOutput () {\n const outputLocation = `${__dirname}/${this.options.rootOutputDir}/${this.socket.id}`;\n\n rimraf.sync(outputLocation);\n\n this.socket.emit('status', 'removed output directory');\n }", "title": "" }, { "docid": "cb9ccf4b33e086db3c53c0ec9ac5de7e", "score": "0.60589933", "text": "function clearCss() {\n return del('./#src/css');\n}", "title": "" }, { "docid": "86bba8afc10bfba1213e923f048f05b7", "score": "0.60472405", "text": "async function cleanDeps() {\n if (await exists(depsPath)) {\n await rimrafPromise(depsPath);\n }\n await mkdir(depsPath);\n}", "title": "" }, { "docid": "a9e177b685e4f73a1614f51637e5ea6d", "score": "0.60385406", "text": "cleanUp() {\n const configPath = this.testStore.path;\n try {\n fs.unlinkSync(configPath);\n } catch (err) {\n // If the failure was because the file didn't exist, that's okay\n // Otherwise we propagate the error\n if (err.code !== \"ENOENT\") {\n throw err;\n }\n }\n }", "title": "" }, { "docid": "9399bc667b9de6ca38e7619cf220883d", "score": "0.6038397", "text": "async function cleanup() {\n await new Promise((pass,reject)=>{\n rmrf(\"./dist\", (error)=>{\n if(error) reject(error);\n else pass();\n });\n });\n}", "title": "" }, { "docid": "fb823b4b0fec263f15a226b653b78e75", "score": "0.60349387", "text": "function cleanBaseDir(config) {\n if (config.doWebPack) {\n fse.emptyDirSync(config.baseDir);\n } else {\n fse.ensureDirSync(config.baseDir);\n\n const baseFileNames = fse.readdirSync(config.baseDir);\n const baseFilePaths = baseFileNames.map((n) => config.baseDir + n);\n const notWebPackPaths = baseFilePaths.filter(\n (p) => !pathCreatedByWebPack(config, p),\n );\n notWebPackPaths.forEach((filePath) => fse.removeSync(filePath));\n }\n}", "title": "" }, { "docid": "b5d44f9534c6b6de7589716a4c13c0da", "score": "0.60190207", "text": "function clean() \n{\n return del(['pub/']);\n}", "title": "" }, { "docid": "3d8650ad0b1804d04df6b0a79bdd1aa6", "score": "0.6017061", "text": "function cleanDest () {\n return del(_paths.dest)\n}", "title": "" }, { "docid": "f720a04901a7f777af9b295cf2e1bb63", "score": "0.5990637", "text": "function cleanUp(done) {\n var command = 'rm -rf ' + DATA_DIR;\n\n exec(command, done);\n}", "title": "" }, { "docid": "51039d7f20e3bd7ddf7dfb6bce20b457", "score": "0.598017", "text": "function purge() {\r\n\t\t\tuiBuilder.unsetClickableItems();\r\n\t\t\teventManager.removeListenersFor (FOLDER_STATE_CHANGED_EVENT);\r\n\t\t\trequestedFilesRegistry.reset();\r\n\t\t\tcontext.instance = null;\r\n\t\t\tdelete context.instance;\r\n\t\t}", "title": "" }, { "docid": "9386248945720f15e009dd9f9f47c703", "score": "0.59711355", "text": "function clean() {\n return del([files.deletedPaths]);\n console.log('Files and folders that would be deleted:\\n', files.deletedPaths.join('\\n'));\n}", "title": "" }, { "docid": "b7c8983499174fd45688a561c780a426", "score": "0.5938156", "text": "function clean(\n// A description of what's being cleaned, e.g. 'app'\ndesc,\n// Paths to delete\ndirs, cb) {\n checkDirectories(dirs, (err, dirs) => {\n if (err != null) return cb(err);\n if (dirs == null || dirs.length === 0) return cb();\n let spinner = (0, _ora2.default)(`Cleaning ${desc}`).start();\n (0, _runSeries2.default)(dirs.map(dir => cb => _fsExtra2.default.remove(dir, cb)), err => {\n if (err) {\n spinner.fail();\n return cb(err);\n }\n spinner.succeed();\n cb();\n });\n });\n}", "title": "" }, { "docid": "3c8a531ddc5f5293851a3d6f8aa874fe", "score": "0.5918744", "text": "function clean(/* pages */) {\n return new Promise((resolve, reject) => {\n rimraf(this.settings.dist, (rmErr) => {\n if (rmErr) {\n reject(rmErr);\n return;\n }\n resolve();\n });\n });\n}", "title": "" }, { "docid": "25e9629f8fd19302ad3e52a971b5d4df", "score": "0.59094036", "text": "function ToolboxMigration() {\n // Delete legacy servers folder\n rimraf(path.join(__dirname, 'servers'));\n\n // Delete legacy node_modules folders\n rimraf(path.join(__dirname, '..', 'node_modules', 'tera-crypto-js'));\n rimraf(path.join(__dirname, '..', 'node_modules', 'tera-crypto-native'));\n rimraf(path.join(__dirname, '..', 'node_modules', 'tera-proxy-game'));\n rimraf(path.join(__dirname, '..', 'node_modules', 'tera-proxy-sls'));\n rimraf(path.join(__dirname, '..', 'node_modules', 'tera-data-parser', 'lib', 'sysmsg'));\n rimraf(path.join(__dirname, '..', 'node_modules', 'long'));\n\n // Delete no longer used files\n try {\n fs.unlinkSync(path.join(__dirname, \"index.js\"));\n fs.unlinkSync(path.join(__dirname, \"loader.js\"));\n fs.unlinkSync(path.join(__dirname, \"loader-console.js\"));\n fs.unlinkSync(path.join(__dirname, \"hosts.js\"));\n fs.unlinkSync(path.join(__dirname, \"netstat.js\"));\n fs.unlinkSync(path.join(__dirname, \"regions.js\"));\n fs.unlinkSync(path.join(__dirname, \"gui\", \"index.html\"));\n } catch (e) {\n // Ignore\n }\n}", "title": "" }, { "docid": "ed7f11b44432f63efaca09a9280ca277", "score": "0.59090173", "text": "function cleanSamples() {\n // cleaning up obsolete files in individual samples\n del.sync(\"./samples/**/src/sandbox.config.json\", {force:true});\n del.sync(\"./samples/**/manifest.json\", {force:true});\n}", "title": "" }, { "docid": "a670122ad762cb02b6cdc78e5b27ad3d", "score": "0.5900117", "text": "function clean(path)\n{\n log('Cleaning:'+ $.util.colors.blue(path));\n del(path);\n}", "title": "" }, { "docid": "62f55783ca4614b942d14a06a466de15", "score": "0.5891721", "text": "destroy() {\n\n let cwd = process.cwd()\n\n execSync(`rm -rf ${cwd}/*`)\n\n }", "title": "" }, { "docid": "7616e6c015ac0f85262e0bd027fd3ac6", "score": "0.58832586", "text": "function cleanDir(src, cb) {\n fs.emptyDir(src, err => {\n console.log(src + \" cleaned\");\n return cb(err);\n });\n}", "title": "" }, { "docid": "77c122a7d0c3589945040bf629168c52", "score": "0.5882292", "text": "async function clean(cb) {\n cleanFiles('public');\n cb();\n}", "title": "" }, { "docid": "e44e809c0564044300c5568dba52559d", "score": "0.58808935", "text": "function cleanJs(done) {\n done = done || noop;\n if (!config.client.ts.bundle) {\n logSkip('ts-clean');\n return done();\n }\n timeClient('js clean');\n removePath(hashGlob(config.client.ts.bundle), () => {\n timeEndClient('js clean');\n done();\n });\n}", "title": "" }, { "docid": "d7a06ea1feb7d90d7229bd2115e531ab", "score": "0.5832523", "text": "cleanFiles() {\n return file_utils_1.removeFiles(this.outDir, [/geckodriver.*/g]);\n }", "title": "" }, { "docid": "11528d885e52fcadcce7765c0d0966e3", "score": "0.5820205", "text": "function clean()\n\t{\n\t\t// let all features clean themselves up\n\t\tfeatureExec(function(f){\n\t\t\tf.clean();\n\t\t});\n\t}", "title": "" }, { "docid": "5cf1c4d90ae4f06781abfce9a0d9f61b", "score": "0.58121824", "text": "function clean(path) {\n log('Cleaning: ' + util.colors.blue(path));\n del(path);\n}", "title": "" }, { "docid": "3b316194596194c971ac63cc23bf21f2", "score": "0.57875913", "text": "async function _cleanBundleDir(bundleDir) {\n\n let bundleMask = '*' + config.get('bundleExtension');\n let modMask = '*' + config.get('modFileExtension');\n\n let modBundleMask = [\n path.combine(bundleDir, bundleMask),\n path.combine(bundleDir, modMask),\n ];\n\n await del(modBundleMask, { force: true });\n}", "title": "" }, { "docid": "ee784a558cd40c179bcf127fcb85bb9f", "score": "0.5777084", "text": "_destroyComponents() {\n this.syncManager.destroy();\n this.onlineManager.destroy();\n this.socketManager.destroy();\n this.socketChangeManager.destroy();\n this.socketRequestManager.destroy();\n }", "title": "" }, { "docid": "7e7a509bd03b851603a63abf4fa5ff60", "score": "0.5776913", "text": "function cleanVendor(done) {\n done = done || noop;\n if (!config.client.vendors.bundle) {\n logSkip('vendor-clean');\n return done();\n }\n timeClient('vendor clean');\n removePath(hashGlob(config.client.vendors.bundle), () => {\n timeEndClient('vendor clean');\n done();\n });\n}", "title": "" }, { "docid": "d67822e34e3f80094d70bc77b0b88856", "score": "0.57720804", "text": "function _visualClear(){\n _els.each(function (i, el){\n jQuery(el)\n .children()\n .filter('[data-repository-item]')\n .remove();\n\n _components[i] = [];\n });\n }", "title": "" }, { "docid": "679da44d41ff8191f5c9133ecb18609f", "score": "0.57546407", "text": "removePlugins() {\n var g = this.getMergedConfig();\n\n var sh = require('shelljs');\n var cwd = sh.pwd();\n let pluginDir = g.jbrowsePath+'plugins';\n let countRemoved = 0;\n\n // check if jbrowse dir exists\n if (!fs.existsSync(g.jbrowsePath)) {\n console.log(\"JBrowse directory does not exist:\",g.jbrowsePath);\n process.exit(1);\n }\n\n // setup local plugins\n var items = fs.readdirSync('plugins');\n for(var i in items) {\n\n //var pluginRoute = '/'+g.routePrefix+'/plugins/'+items[i];\n let target = pluginDir+'/'+items[i];\n let src = cwd+'/plugins/'+items[i];\n\n _unlink(src,target);\n }\n\n // setup sub-module plugins\n var submodules = glob.sync('node_modules/*-jbconnect-hook');\n for(var j in submodules) {\n var tmp = submodules[j].split('/'); \n var moduleName = tmp[tmp.length-1];\n\n var items = fs.readdirSync(cwd+'/'+submodules[j]+'/plugins');\n for(var i in items) {\n //var pluginRoute = '/'+g.routePrefix+'/plugins/'+items[i];\n let target = pluginDir+'/'+items[i];\n let src = cwd+'/'+submodules[j]+'/plugins/'+items[i];\n \n _unlink(src,target);\n }\n }\n \n console.log(countRemoved+\" plugins removed JBrowse plugins dir.\");\n if (countRemoved)\n console.log(\"In jbrowse directory, run 'npm run build'\");\n\n return countRemoved;\n \n function _unlink(src,target) {\n if (fs.existsSync(target)) {\n console.log(\"Unlink plugin\",target);\n fs.unlinkSync(target);\n countRemoved++;\n }\n }\n }", "title": "" }, { "docid": "af0853e2d053edc59e3ad183634baea5", "score": "0.57536393", "text": "function cleanUp() {\n setTimeout(() => {\n console.warn(\"Cleaning up\");\n ReactDOM.unmountComponentAtNode(commentNode);\n document.body.removeChild(commentNode);\n }, 0);\n}", "title": "" }, { "docid": "61f52102dba8961443422a2ebffb1bb6", "score": "0.5753068", "text": "destroy() {\n\n let cwd = process.cwd()\n\n sh.run(`rm -rf ${cwd}/*`)\n\n }", "title": "" }, { "docid": "52ec0679326e057d8f96ce6632a8eb6c", "score": "0.5748262", "text": "function cleanup (base) {\n if ((base !== null) && (base !== undefined)) {\n if (fs.existsSync (base + \".eph\")) {\n fs.unlinkSync (base + \".eph\");\n }\n if (fs.existsSync (base + \".rdy\")) {\n fs.unlinkSync (base + \".rdy\");\n }\n if (fs.existsSync (base)) {\n fs.unlinkSync (base);\n }\n if (fs.existsSync (base + \".bak\")) {\n fs.unlinkSync (base + \".bak\");\n }\n if (fs.existsSync (base + \".bk2\")) {\n fs.unlinkSync (base + \".bk2\");\n }\n }\n}", "title": "" }, { "docid": "74c358d8f0747c815d19898fde773398", "score": "0.573861", "text": "function destroyAll() {\n \n f3.remove(myFade);\n f3.remove(myAnimateThroughSpectrum);\n f3.remove(myRainbow);\n f3.remove(mySolidBG);\n f3.remove(myColor);\n\n f2.remove(myBorderWidth);\n f2.remove(myVertMargin);\n f2.remove(myRectangleWidth);\n f2.remove(myRectangleCount);\n\n f1.remove(myRotSpeed);\n f1.remove(myHeight);\n f1.remove(myRadius);\n f1.remove(mySideCount);\n\n gui.removeFolder(f3);\n gui.removeFolder(f2);\n gui.removeFolder(f1);\n\n gui.destroy();\n }", "title": "" }, { "docid": "bc92c9d0d13375757fddbb8878d24e7b", "score": "0.5734661", "text": "function cleanCss(done) {\n done = done || noop;\n if (!config.client.scss.bundle) {\n logSkip('scss-clean');\n return done();\n }\n timeClient('css clean');\n removePath(hashGlob(config.client.scss.bundle), () => {\n timeEndClient('css clean');\n done();\n });\n}", "title": "" }, { "docid": "6b0353745c01f3f66a04b73d1e2b341e", "score": "0.57232803", "text": "clear() {\n this.nodeDeclarations.clear();\n this.componentDeclarations.clear();\n this.converters.clear();\n for (let key in this.rootNodes) {\n delete this.rootNodes[key];\n }\n this.loadTasks.splice(0, this.loadTasks.length);\n this.initialize();\n }", "title": "" }, { "docid": "4bafdae5e27c2bbe9eba9e099cb2b2dc", "score": "0.57080126", "text": "function cleanDir(packg) {\n var dir = (packg === config.app) ? '.tmp' : [config.dist + '/*', config.dist + '/.*'];\n return gulp.src(dir, {read: false})\n .pipe(clean());\n}", "title": "" }, { "docid": "318595951fc6cdbf3e7055a2a11218ae", "score": "0.5707863", "text": "function cleanCats(done) {\n const taskName = 'concat-ts-clean';\n done = done || noop;\n if (!config.client.cats.bundle) {\n logSkip(taskName);\n return done();\n }\n timeClient(taskName);\n removePath(hashGlob(config.client.cats.bundle), () => {\n timeEndClient(taskName);\n done();\n });\n}", "title": "" }, { "docid": "de706c6e9c653875e5226d2dc2f2d50b", "score": "0.5703212", "text": "function cleanUp(){\n\t\ttry {\n\t\t\tfs.unlinkSync(options.pidFile);\n\t\t}\n\t\tcatch(e){}\n\t}", "title": "" }, { "docid": "8ca4a3a99cb1fba74844b454e10de7e6", "score": "0.5702396", "text": "removeComponent() {\n this.nestedTree = [];\n this.el.innerHTML = '';\n let nodeToDelete = this.search(this.selectedComponent);\n this.selectedComponent = '';\n if (nodeToDelete && nodeToDelete.childrens.length > 0) {\n nodeToDelete.childrens.map(child => (child.parent = nodeToDelete.parent));\n } else {\n let indexToRemove = this.treeAsArray.findIndex(\n node => node.id === nodeToDelete.id\n );\n this.treeAsArray.splice(indexToRemove, 1);\n this.fillTreeWithChildren(this.nestedTree, 'root-node');\n MainView.printTree(this.nestedTree, this.el);\n }\n }", "title": "" }, { "docid": "6f0439deb3e683a615e80c1abc9f42ff", "score": "0.5702033", "text": "removeAll() {\n this.components = [];\n }", "title": "" }, { "docid": "2292add1294e01bbb52aa4432d2de672", "score": "0.5680754", "text": "delete() {\r\n const { fileSystemWrapper } = this._context;\r\n const path = this.getPath();\r\n for (const sourceFile of this.getSourceFiles())\r\n sourceFile.delete();\r\n for (const dir of this.getDirectories())\r\n dir.delete();\r\n fileSystemWrapper.queueDirectoryDelete(path);\r\n this.forget();\r\n }", "title": "" }, { "docid": "505fd6bf6c695e87b7c82da5de3b1cd2", "score": "0.5671854", "text": "cleanupUnusedAssets() {\n this.assets.forEach(asset => {\n if (!asset.hasInstances()) {\n asset.remove();\n }\n });\n }", "title": "" }, { "docid": "5774af97d9b564a32a92b3bae8a92e57", "score": "0.5671161", "text": "function cleanUp( itcb ) {\n // release some resources\n pages = null;\n hpdf.freePdf( pdfHandle );\n\n /*\n cleanUpCache.forEach( function ( key ) {\n if ( !require.cache[key] ) {\n //console.log( 'Can no longer resolve require cache key: ' + key );\n return;\n }\n //console.log( 'Removing from require cache: ' + key );\n delete require.cache[key];\n } );\n */\n\n // remove temp / intermediate files - we don't need to wait for the filesystem\n\n if ( tempFilesToCleanUp.length > 0 ) {\n Y.doccirrus.media.cleanTempFiles( { '_tempFiles': tempFilesToCleanUp } );\n tempFilesToCleanUp = [];\n }\n\n itcb( null );\n }", "title": "" }, { "docid": "ad2f5aa8ef0b960a5b46141397b7e3cf", "score": "0.5664949", "text": "async process() {\n super.process();\n let compileConfig = await qx.tool.config.Compile.getInstance().load();\n for (let target of compileConfig.getValue(\"targets\")) {\n await this.__removePath(path.join(process.cwd(), target.outputPath));\n if (target.deployPath) {\n await this.__removePath(path.join(process.cwd(), target.deployPath));\n }\n }\n await this.__removePath(\n path.join(process.cwd(), qx.tool.cli.commands.Package.cache_dir)\n );\n\n // check if we have to migrate files\n await this.checkMigrations();\n }", "title": "" }, { "docid": "90533ef3b624f8339dcbc0657242b7c1", "score": "0.566113", "text": "clearResources(){\r\n \t$(config['RESOURCES_LOCATION']).empty();\r\n }", "title": "" }, { "docid": "924bd24068c8c9cc848139c5ad4f2e27", "score": "0.56559706", "text": "function cleanJs(cb) {\n\treturn del(paths.devDir + paths.staticDir + '/js').then(() => {\n\t\tcb();\n\t});\n}", "title": "" }, { "docid": "04f80c9013b9139f8eb24c917d21bb8e", "score": "0.5654448", "text": "destroyAndRemove() {\n this.destroy();\n\n // Remove element\n const root = this._root.root;\n root.parentElement.removeChild(root);\n\n // remove .pcr-app\n const app = this._root.app;\n app.parentElement.removeChild(app);\n\n // There are references to various DOM elements stored in the pickr instance\n // This cleans all of them to avoid detached DOMs\n const pickr = this;\n Object.keys(pickr).forEach(key => pickr[key] = null);\n }", "title": "" }, { "docid": "f70db4ae5e14f1f436c62f845a954f63", "score": "0.56441635", "text": "destroy() {\n for (const component of children.get(this) || []) {\n component.__destroy();\n }\n children.delete(this);\n }", "title": "" }, { "docid": "371a0ddb8f805b8459a22db7aff76e77", "score": "0.56364995", "text": "cleanup(clientId) {\n if (!clientId) {\n return;\n }\n \n var clientWorkspaceDir = WORKSPACE_DIR + '/' + clientId;\n try {\n if (fs.existsSync(clientWorkspaceDir)) {\n // Delete all files in this\n fs.readdirSync(clientWorkspaceDir).forEach(function (file, index) {\n var curPath = clientWorkspaceDir + '/' + file;\n fs.unlinkSync(curPath); \n });\n \n fs.rmdirSync(clientWorkspaceDir);\n }\n }\n catch (err) {\n setTimeout(function () {\n this.cleanup(clientId);\n }.bind(this), 1000);\n }\n // Otherwise, do nothing\n }", "title": "" }, { "docid": "4dfde0619467a770f14a7bb1ec709307", "score": "0.5606956", "text": "clearModelFiles() {\n this.modelFiles = {};\n this.addRootModel();\n }", "title": "" } ]
d2da9f9ffaac3d4ef9011cc2d884ba73
! Jodit Editor ( Released under MIT see LICENSE.txt in the project root for license information. Copyright (c) 20132021 Valeriy Chupurnov. All rights reserved.
[ { "docid": "f6068068abcac03c141813d7dd889175", "score": "0.0", "text": "function i(e,t){let n;return t||(t=o.D.defaultOptions.controls),(0,r.isString)(e)?n=s(e,t)||{name:e,command:e,tooltip:e}:(n={name:\"empty\",...(0,r.ConfigFlatten)(e)},void 0!==t[n.name]&&(n={...(0,r.ConfigFlatten)(t[n.name]),...(0,r.ConfigFlatten)(n)})),n}", "title": "" } ]
[ { "docid": "a24b29fac56a9397c9155e4a8c10855c", "score": "0.66685045", "text": "function Editor() {}", "title": "" }, { "docid": "05a51660401e9bc44d5ad594e7464782", "score": "0.65377665", "text": "function Editor() { }", "title": "" }, { "docid": "05a51660401e9bc44d5ad594e7464782", "score": "0.65377665", "text": "function Editor() { }", "title": "" }, { "docid": "b2224b54cb5ab12ffa8c423a33176765", "score": "0.6467715", "text": "function editorHelper(){}", "title": "" }, { "docid": "c599144e091a5de4a0ae3f5ec9b673a9", "score": "0.6445794", "text": "static get tag() {\n return \"json-editor\";\n }", "title": "" }, { "docid": "3ee3767a5a8ee1a75fe8b5b52c216a0f", "score": "0.59841275", "text": "function load() {\n setupEditor();\n update();\n\n}", "title": "" }, { "docid": "1d40c218511379580f6f02b996989c36", "score": "0.59245765", "text": "function initEditor() {\n\teditor = document.getElementById(\"editor\");\n\teditor_text_area = document.getElementById(\"editortext\");\n\teditor_gutter_area = document.getElementById(\"editorgutter\");\n\teditor_caret = document.getElementById(\"editorCaret\");\n\teditor_second_caret = document.getElementById(\"editorSecondCaret\");\n\teditor_status = document.getElementById(\"statusbar\");\n\teditor_minibuffer = document.getElementById(\"minibuffer\");\n\teditor_messages = document.getElementById(\"editorMessages\");\n\t\n\ttextarea_bucket = document.getElementById(\"fakefocus\");\n\t\n\t//see: displayCaretAtPosition for where these are used\n\tGUTTER_X_OFFSET = document.getElementById(\"editorgutter\").offsetWidth;\n\tCHAR_SIZE = editor_caret.offsetWidth;\n\t\n\t//startup the event manager and add the key listeners\n\tevent_manager = new Sortie.UI.EventManager();\n\tevent_manager.Init(document);\n\tevent_manager.AddKeyPressListener(editor_onKeyPress);\n\tevent_manager.AddKeyDownListener(editor_onKeyDown);\n\tevent_manager.AddKeyUpListener(editor_onKeyUp);\n\tevent_manager.AddMouseDownListener(function(e){\n\t\ttry{\n\t\t\tvar linenum = getLineIdNumber(e.target);\n\t\t\tif(linenum)\n\t\t\t\tjump_to_line(linenum);\n\t\t}catch(e){\n\t\t\t//\n\t\t}\n\t\teditor_focus();\n\t});\n\tevent_manager.AddMoveListener(function(e){\n\t\tSortie.UI.Mouse.SetCoords(e);\n\t\twindow.status = \"X: \" + Sortie.UI.Mouse.X + \" Y:\" + Sortie.UI.Mouse.Y;\n\t});\n\t\n\t//the syntax rules and move maps\n\twindow.mode_syntax_rules = new Sortie.Util.Map();\n\tmode_ext_map = new Sortie.Util.Map();\n\t\n\ttext_tools = new Sortie.Util.Text();\n\tscreen_tools = new Sortie.UI.Screen();\n\t\n\twindow.extensions = {};\n\t\n\t//TODO: move these somewhere logical\n\tmode_ext_map.Put(\"css\",\"CSS\");\n\tmode_ext_map.Put(\"js\",\"Javascript\");\n\tmode_ext_map.Put(\"rel\",\"Release\");\n\tmode_ext_map.Put(\"txt\",\"Text\");\n\tmode_ext_map.Put(\"text\",\"Text\");\n\t\n\tmode_ext_map.Put(\"xml\",\"XML\");\n\tmode_ext_map.Put(\"rss\",\"XML\");\n\tmode_ext_map.Put(\"xsl\",\"XML\");\n\tmode_ext_map.Put(\"html\",\"XML\");\n\tmode_ext_map.Put(\"xhtml\",\"XML\");\n\tmode_ext_map.Put(\"htm\",\"XML\");\n\t\n\tmode_ext_map.Put(\"cfm\",\"XML\");\n\tmode_ext_map.Put(\"cfml\",\"XML\");\n\tmode_ext_map.Put(\"cfc\",\"XML\");\n\t\n\tmode_ext_map.Put(\"php\",\"XML\");\n\t\n\t//ugly hack alert. Sometimes the textarea_bucket will lose focus\n\t//and cause backspace to try to leave the page. Then, once the\n\t//\"are you sure you want to leave\" system dialog pops up the\n\t//textarea_bucket loses focus forever until you hit tab - which sucks\n\t//this just keeps setting the focus\n\t//setInterval(\"editor_focus()\",1000);\n\t\n\t\n\tfor(var q=0; q<tab_size; q++)\n\t\tTAB += \"&nbsp;\";\n\t\n\t//load all the default editor functions\n\tfundamental_mode();\n\t\n\tvar current_url = window.location.toString();\n\tif(current_url.indexOf(\"?\") > -1)\n\t{\n\t\t//TODO: try catch, this is a bit of hackery\n\t\tvar urlparts = current_url.split(\"?\")\n\t\t//0 = host etc 1 = \"file=filename&blarg=yadda etc\"\n\t\t//right now we'll just assume the filename is present\n\t\tvar fnameparts = urlparts[1].toString().split(\"=\");\n\t\tvar f = fnameparts[1].toString().split(\"&\");\n\t\tvar filename = f[0].toString();\n\t\t\n\t\t//if we get passed file, try to open the file\n\t\tif(fnameparts[0].toString() == \"file\") {\n\t\t\t//load a \"normal\" file (and assume it's on the server)\n\t\t\t//var httpcon = new HTTPConnectFactory().getInstance();\n\t\t\tvar pipe = new Sortie.IO.Pipe().GetInstance();\n\t\t\t//var remote = new JSRemote(httpcon, true);\n\t\t\tvar gateway = new Sortie.IO.Gateway(pipe, true)\n\t\t\t\n\t\t\tgateway.DoRequest({\n\t\t\t\tmethod:\"POST\",\n\t\t\t\turl:filename, \n\t\t\t\thandler:function(conn) {\n\t\t\t\t\tif(conn.status == 200)\n\t\t\t\t\t\tloadFile(filename, guessFileType(filename), conn.responseText);\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tdocument.title = buffer_name = filename;\n\t\t\t\t\t\tbuffer_mode = guessFileType(filename);\n\t\t\t\t\t\teditor_addLine();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tbody:\"\"\n\t\t\t});\n\t\t}\n\t\telse if(fnameparts[0].toString() == \"area\")\n\t\t{\n\t\t\t//try to link with the openers textarea\n\t\t\tif(window.opener)\n\t\t\t\tlinked_textarea = window.opener.document.getElementById(filename);\n\t\t\telse\n\t\t\t\tlinked_textarea = parent.document.getElementById(filename);\n\t\t\t\t\n\t\t\tlinked_textarea.disabled = true;\n\t\t\tlinked_textarea.style.background = \"silver\";\n\t\t\t\n\t\t\tloadFile(\"Textarea\", guessFileType(\"temp.html\"), linked_textarea.value);\n\t\t}\n\t}\n\telse\n\t{\n\t\teditor_addLine();\n\t}\n\t\n\ttry{\n\t\twindow.onactivate = editor_focus();\n\t\twindow.onfocus = editor_focus();\n\t\twindow.document.onfocus = editor_focus();\n\t\twindow.document.onactive = editor_focus();\n\t\twindow.onresize = function() {\n\t\t\t/* if(editor_text_area){\n\t\t\t\tvar x = findPosX(editor_text_area) + GUTTER_X_OFFSET;\n\t\t\t\t//(far left pos + gutter padding) + (char_size * position)\n\t\t\t\tvar w = (x + GUTTER_EXTRA_OFFSET) + (active_column * CHAR_SIZE);\n\t\t\n\t\t\t\teditor_text_area.style.width = (w) + \"px\";\n\t\t\t\teditor_text_area.style.height = (window_height()) + \"px\";\n\t\t\t} */\n\t\t}\n\t} catch(e) {\n\t\t//some of these might not take, IE I am looking at you\n\t}\n\t\n\tdocument.title = buffer_name;\n\teditor_focus();\n\t\n\t///////////\n\t//dialog = new YAHOO.widget.Overlay(\"dialog\");\n\t//dialog.cfg.setProperty(\"fixedcenter\", true);\n\t//dialog.hide();\n\t\n\t/* mySimpleDialog = new YAHOO.widget.SimpleDialog(\"dlg\", { \n\t\twidth: \"20em\", \n\t\teffect:{ effect:YAHOO.widget.ContainerEffect.FADE, duration:0.25 }, \n\t\tfixedcenter:true,\n\t\tmodal:true,\n\t\tdraggable:false }\n\t);\n\t\n\tmySimpleDialog.setHeader(\"Warning!\");\n\tmySimpleDialog.setBody(\"Are you sure you want to delete this item?\");\n\tmySimpleDialog.cfg.setProperty(\"icon\",YAHOO.widget.SimpleDialog.ICON_WARN);\n\tmySimpleDialog.render(document.body);\n\tmySimpleDialog.show(); */\n\t\n\t//document.getElementById(\"editor\").style.opacity = \".5\";\n\t//document.getElementById(\"dialog\").style.left = \"0px;\"\n\t//document.getElementById(\"dialog\").style.top = \"0px;\"\n\t///////////\n\t\n\tsetTimeout(\"runOnStart()\",500);\n}", "title": "" }, { "docid": "eb8ca217bb67c50ada029dc9642f25b3", "score": "0.5884863", "text": "function createEditor(config,status)\n {\t\t\t\n var editor = null;\n var hideSplash = function()\n {\n // Fades-out the splash screen\n var splash = document.getElementById('splash');\n\n if (splash != null)\n {\n try\n {\n mxEvent.release(splash);\n mxEffects.fadeOut(splash, 100, true);\n }\n catch (e)\n {\n splash.parentNode.removeChild(splash);\n }\n }\n };\n\n try\n {\n if (!mxClient.isBrowserSupported())\n {\n mxUtils.error('Browser is not supported!', 200, false);\n }\n else\n {\n mxObjectCodec.allowEval = true;\n\n var node = mxUtils.load(config).getDocumentElement();\n editor = new mxEditor(node);\n mxObjectCodec.allowEval = false;\n\n // Adds active border for panning inside the container\n editor.graph.createPanningManager = function()\n {\n var pm = new mxPanningManager(this);\n pm.border = 30;\n\n return pm;\n };\n\n editor.graph.addListener(mxEvent.MOVE_CELLS, function (sender, evt) {\n //autoscaleResize();\n });\n editor.graph.addListener(mxEvent.MOUSE_MOVE, function (sender, evt) {\n console.log(evt);\n console.log(sender);\n //autoscaleResize();\n });\n\n mxConnectionHandler.prototype.connectImage = new mxImage(hostUrl + 'flow/editor/images/connector.gif', 16, 16);\n\n // Enables connections in the graph and disables\n // reset of zoom and translate on root change\n // (ie. switch between XML and graphical mode).\n editor.graph.setConnectable(true);\n\n // Clones the source if new connection has no target=\n mxConnectionHandler.prototype.isCreateTarget = function(evt){\n return true;\n }\n \n //add by zhangdaoqiang start\n var cloneCell = mxCell.prototype.clone;\n mxCell.prototype.clone = function()\n {\n \tvar clone = cloneCell.call(this);\n \t\n \t//增加拷贝来源ID\n \t//从拷贝按钮或键盘操作时(此时有两个clone动作:1:copy时,2:paste时,所以不能直接拷贝id)\n \tif(this.id == null) {\n \t\tclone.copyFrom = this.copyFrom;\n \t\t\n \t\t//用鼠标拖动时\n \t} else {\n \t\tclone.copyFrom = this.id;\n \t}\n \treturn clone;\n };\n //add by zhangdaoqiang end \n \n //add by zhangdaoqiang 执行节点内部配置的拷贝 start\n var cellsAdded = mxGraph.prototype.cellsAdded;\n mxGraph.prototype.cellsAdded = function(cells, parent, index, source, target, absolute, constrain) {\n \t\n \t//调用cellsAdded后给cell设置ID\n \tcellsAdded.call(this, cells, parent, index, source, target, absolute, constrain);\n\n \tif(cells != null && cells[0] != null) {\n \t\tvar nodeId = cells[0].copyFrom;\n \t\tif(nodeId != null) {\n \t\t\tvar configOfSource = JSON.parse(window.localStorage.getItem(localTemp+nodeId));\n \t\t\tif(configOfSource != null) {\n \t\t\t\t\n \t\t\t\t//替换id,acid, code,nodeid\n \t\t\t\tvar id = getGuuid();\n \t\t\t\tconfigOfSource.id = id;\n \t\t\t\tconfigOfSource.nodeId = cells[0].id;\n \t\t\t\tconfigOfSource.code = 'task_' + cells[0].id;\n \t\t\t\t\n \t\t\t\tif(configOfSource.participant != null) {\n \t\t\t\t\tvar participant = JSON.parse(configOfSource.participant);\n \t\t\t\t\t$.each(participant, function(index, item) {\n \t\t\t\t\t\titem.acId = id;\n \t\t\t\t\t});\n \t\t\t\t\tconfigOfSource.participant = JSON.stringify(participant);\n \t\t\t\t}\n\n \t\t\t\tif(configOfSource.ccPerson != null) {\n \t\t\t\t\tvar ccPerson = JSON.parse(configOfSource.ccPerson);\n \t\t\t\t\t$.each(ccPerson, function(index, item) {\n \t\t\t\t\t\titem.acId = id;\n \t\t\t\t\t});\n \t\t\t\t\tconfigOfSource.ccPerson = JSON.stringify(ccPerson);\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\twindow.localStorage.setItem(localTemp+cells[0].id, JSON.stringify(configOfSource));\n \t\t\t}\n \t\t\t\n \t\t\t//清空自定义的拷贝来源属性\n \t\t\tcells[0].copyFrom = null;\n \t\t}\n \t}\n }\n //add by zhangdaoqiang 执行节点内部配置的拷贝 end\n \n //add by zhangdaoqiang 删除cell同时删除缓存信息 start\n var remove = mxGraphModel.prototype.remove;\n mxGraphModel.prototype.remove = function(cell)\n {\n \t//从缓存只删除nodeId对象的信息\n \twindow.localStorage.removeItem(localTemp+cell.id);\n \treturn remove.call(this, cell);\n };\n //add by zhangdaoqiang 删除cell同时删除缓存信息 end\n \n mxGraph.prototype.autoScroll = false;\n mxGraph.prototype.autoExtend = false;\n mxGraph.prototype.isValidSource = function(cell){\n \t var outnum=0;\n var innum=0;\n if(cell.isEdge==1){return false;}\n var nodeType=cell.getAttribute('nodeType');\n if( nodeType=='end'){\n return false;\n }\n\n var edges=cell.edges;\n if(edges == null ){\n outnum=0;\n innum=0;\n }\n mxUtils.forEach(edges,function(edge){\n if(edge.target==null){\n return false;\n }\n\n if(edge.target.isVertex()){\n if(edge.source.id ==cell.id ){\n outnum++;\n\n }else{\n innum++;\n }\n }\n });\n var nodeType=cell.getAttribute('nodeType');\n if(nodeType=='join'|| nodeType=='fork'){\n return true;\n }\n if(nodeType=='task' || nodeType=='end'|| nodeType=='start'|| nodeType=='cc'){\n\n }else{\n return false\n }\n if(outnum*1>0){\n return false;\n }\n return true;\n }\n\n mxConstants.DEFAULT_HOTSPOT = 1;\n\n // Enables guides\n mxGraphHandler.prototype.guidesEnabled = true;\n\n // Alt disables guides\n mxGuide.prototype.isEnabledForEvent = function(evt)\n {\n return !mxEvent.isAltDown(evt);\n };\n\n // Enables snapping waypoints to terminals\n mxEdgeHandler.prototype.snapToTerminals = true;\n\n\n\n editor.graph.allowAutoPanning = true;\n editor.graph.timerAutoScroll = true;\n\n\n\n editor.graph.dblClick = function(evt, cell){\n if (cell != null){\n if(cell.isVertex()){\n editAc(editor,cell);\n }\n else if(cell.isEdge()){\n editTr(editor,cell);\n }\n }\n else{\n editFlow(editor);\n }\n\n mxEvent.consume(evt);\n }\n\n // Updates the window title after opening new files\n var title = document.title;\n var funct = function(sender)\n {\n// document.title = title + ' - ' + sender.getTitle();\n };\n\n editor.addListener(mxEvent.OPEN, funct);\n\n // Prints the current root in the window title if the\n // current root of the graph changes (drilling).\n editor.addListener(mxEvent.ROOT, funct);\n funct(editor);\n\n // Displays version in statusbar\n // editor.setStatus('V2017');\n\n // Shows the application\n hideSplash();\n }\n }\n catch (e)\n {\n hideSplash();\n\n // Shows an error message if the editor cannot start\n mxUtils.alert('Cannot start application: ' + e.message);\n throw e; // for debugging\n }\n\n if(status=='new'){\n\t var parent = editor.graph.getDefaultParent();\n\t var model = editor.graph.model;\n\t model.beginUpdate();\n\t try\n\t {\n\t var start = editor.templates['start'];\n\t var end = editor.templates['end'];\n\t editor.graph.addCell(start,parent);\n\t editor.graph.addCell(end,parent);\n\t }\n\t finally\n\t {\n\t model.endUpdate();\n\t }\n }\n \n return editor;\n }", "title": "" }, { "docid": "a3adcade4687deb244aae80dbb9349b2", "score": "0.5876496", "text": "function Editor(par) {\n\n var global = {};\n\n // input settings\n global.container = $(par.container);\n global.controls = par.controls;\n global.generalMoving = par.generalMoving;\n global.seatWidth = par.seatWidth || 25;\n global.seatHeight = par.seatHeight || 25;\n global.seatMarginRight = par.seatMarginRight || 8;\n global.seatMarginBottom = par.seatMarginBottom || 16;\n global.round = par.round;\n global.move = par.move;\n global.isPreviewPage = par.isPreviewPage;\n global.isProductionPage = par.isProductionPage;\n global.turning = par.turning;\n global.margin = par.margin;\n global.keepPreviousSelected = par.keepPreviousSelected;\n global.reflection = par.reflection;\n global.selectHandler = par.selectHandler || function () {};\n global.createElementHandler = par.createElementHandler || function () {};\n global.createSectorHandler = par.createSectorHandler || function () {};\n global.microModeLoadedListener = par.microModeLoadedListener || function () {};\n global.dragMode = par.dragMode;\n global.isMobile = isMobile();\n global.isMac = isMac();\n global.tooltip = par.tooltip;\n // class object and its methods\n\n global.editorObj = {\n\n zoom: 1,\n zoomStep: 0.05,\n minZoom: 0.1,\n amountInfoBlock: $('#amount_info_block'),\n svgChildBlock: global.container.children('#svg_overflow'),\n svgParentNode: $('#svg_cont'),\n sectorsList: $('#sectors_list'),\n sectorsListItems: $('#sectors_list').find('.sector_item '),\n IDD_FAN_ZONE: 2,\n allowPanDrag: global.isPreviewPage && global.isProductionPage,\n dragMode: global.dragMode,\n hasMacro: par.hasMacro,\n isMicroView: true,\n isPreviewPage: global.isPreviewPage,\n isProductionPage: global.isProductionPage,\n createSectorHandler: global.createSectorHandler,\n mobileInfo: getMobileSystemInfo(),\n\n createEditor: function () {\n\n if (!global.isMobile) {\n this.controlsCont = $('<div id=\"controls_cont\"></div>');\n this.svgChildBlock.prepend(this.controlsCont);\n\n // create scale controls\n this.scaleOutBtn = $('<div class=\"scaleOut\"></div>');\n this.scaleInBtn = $('<div class=\"scaleIn\"></div>');\n this.controlsCont.append(this.scaleInBtn, this.scaleOutBtn);\n this.scaleOutBtn.on('click', function () {\n global.editorObj.scaleControl.val(parseFloat(global.editorObj.scaleControl.val()) - global.editorObj.zoomStep).trigger('change');\n });\n this.scaleInBtn.on('click', function () {\n global.editorObj.scaleControl.val(parseFloat(global.editorObj.scaleControl.val()) + global.editorObj.zoomStep).trigger('change');\n });\n this.scaleControl = $('<input id=\"scaleControl\" type=\"range\" max=\"1\" min=\"0.1\" step=\"0.05\" orient=\"vertical\" value=\"1\" />');\n this.controlsCont.append(this.scaleControl);\n this.scaleControl.change(function () {\n global.editorObj.zoomElements(parseFloat($(this).val()));\n });\n this.scaleControl.mousewheel(function (event) { // add zoom when use mousewheel on scale control\n global.editorObj.mouseWheelZoom(event);\n });\n\n // cerate scheme mode controls\n this.dragControlHand = $('<div class=\"dragControl hand\" type=\"button\"></div>');\n this.dragControlSelect = $('<div class=\"dragControl select\" type=\"button\"></div>');\n if (global.dragMode) {\n this.dragControlHand.addClass('active');\n } else {\n this.dragControlSelect.addClass('active');\n }\n this.controlsCont.append(this.dragControlHand, this.dragControlSelect);\n this.dragControlHand.on('click', function () {\n global.editorObj.changeMode(1);\n });\n this.dragControlSelect.on('click', function () {\n global.editorObj.changeMode(0);\n });\n if (global.isProductionPage) {\n this.dragControlHand.hide();\n this.dragControlSelect.hide();\n }\n // hot key for changing modes\n $(window).keydown(function (e) {\n var step = 1,\n allowMove = !global.editorObj.dragMode && global.editorObj.currentElement != null;\n switch (e.keyCode){\n case 72:\n if (!global.editorObj.dragMode && global.editorObj.dragControlSelect.hasClass('active')){\n global.dragMode = true;\n global.editorObj.dragMode = true;\n global.editorObj.svgParentNode.addClass('dragged');\n }else if(global.editorObj.dragMode && global.editorObj.dragControlHand.hasClass('active') && !global.isProductionPage){\n global.dragMode = false;\n global.editorObj.dragMode = false;\n global.editorObj.svgParentNode.removeClass('dragged');\n }\n break;\n case 37:\n if (allowMove){\n e.preventDefault();\n if (global.editorObj.shiftPressed) step = global.seatWidth + global.seatMarginRight;\n global.editorObj.moveElement(\"left\", step);\n }\n break;\n case 38:\n if (allowMove) {\n e.preventDefault();\n if (global.editorObj.shiftPressed) step = global.seatHeight + global.seatMarginBottom;\n global.editorObj.moveElement(\"top\", step);\n }\n break;\n case 39:\n if (allowMove) {\n e.preventDefault();\n if (global.editorObj.shiftPressed) step = global.seatWidth + global.seatMarginRight;\n global.editorObj.moveElement(\"right\", step);\n }\n break;\n case 40:\n if (allowMove) {\n e.preventDefault();\n if (global.editorObj.shiftPressed) step = global.seatHeight + global.seatMarginBottom;\n global.editorObj.moveElement(\"bottom\", step);\n }\n break;\n default:\n }\n });\n $(window).keyup(function (e) {\n switch (e.keyCode){\n case 72:\n if (global.editorObj.dragMode && global.editorObj.dragControlSelect.hasClass('active')){\n global.dragMode = false;\n global.editorObj.dragMode = false;\n global.editorObj.svgParentNode.removeClass('dragged');\n }else if(!global.editorObj.dragMode && global.editorObj.dragControlHand.hasClass('active') && !global.isProductionPage){\n global.dragMode = true;\n global.editorObj.dragMode = true;\n global.editorObj.svgParentNode.addClass('dragged');\n }\n break;\n }\n });\n\n if (!global.isProductionPage){\n this.deselectBtn = $('<div id=\"deselectBtn\"></div>');\n this.svgChildBlock.prepend(this.deselectBtn);\n this.deselectBtn.on('click', function(){\n global.editorObj.deselectElements();\n })\n this.changeDeselectBtnVisisbility();\n }\n\n\n }\n\n if (this.hasMacro){\n this.backToMacroBtn = $('<div id=\"backToMacroBtn\"></div>');\n this.svgChildBlock.prepend(this.backToMacroBtn);\n this.backToMacroBtn.on('click', function(){\n global.editorObj.backToMacroAction();\n })\n }\n\n if (global.controls) {\n\n // add tools container and tool's controls\n var toolsCont = $('<div></div>').addClass('toolsCont');\n global.container.prepend(toolsCont);\n\n if (global.round) {\n var roundControl = $('<div id=\"round\"><a href=\"#\" id=\"round_btn\" class=\"edit_control_btn button btn-default tool\">Скруглення</a><input id=\"round_value\" type=\"text\" name=\"round_value\" placeholder=\"px\" value=\"5\" /></div>');\n toolsCont.append(roundControl);\n $('#round_btn').click(function () {\n global.editorObj.addBorderRadius();\n });\n }\n\n if (global.move) {\n var moveControl = $('<div id=\"move\"><span id=\"move_left\"></span><span id=\"move_top\"></span><span id=\"move_right\"></span><span id=\"move_bottom\"></span><input type=\"text\" id=\"move_value\" placeholder=\"px\" value=\"20\"/></div>');\n toolsCont.append(moveControl);\n $('#move_left').click(function () {\n global.editorObj.moveElement('left');\n });\n $('#move_top').click(function () {\n global.editorObj.moveElement('top');\n });\n $('#move_bottom').click(function () {\n global.editorObj.moveElement('bottom');\n });\n $('#move_right').click(function () {\n global.editorObj.moveElement('right');\n });\n }\n\n if (global.turning) {\n var turnParentControl = $('<div id=\"turn_group\"><span id=\"turn_group_left\"></span><input id=\"turn_group_value\" type=\"text\" placeholder=\"degrees\" value=\"10\"/><span id=\"turn_group_right\"></span></div>');\n toolsCont.append(turnParentControl);\n $('#turn_group_left').click(function () {\n global.editorObj.turnElement('left', 'group')\n });\n $('#turn_group_right').click(function () {\n global.editorObj.turnElement('right', 'group')\n });\n }\n\n if (global.margin) {\n var marginControl = $('<div id=\"margin\"><input id=\"margin_slider\" type=\"range\" max=\"100\" min=\"-100\" step=\"1\" value=\"0\" /><select class=\"form-control\" id=\"margin_type\"><option value=\"0\">по осі X</option><option value=\"1\">по осі Y</option><option value=\"2\">по осі X та Y</option></select><input id=\"margin_value\" type=\"text\" value=\"0\" /></div>');\n toolsCont.append(marginControl);\n var marginSlider = $('#margin_slider');\n marginSlider.change(function () {\n marginValue.val($(this).val());\n global.editorObj.addMargin(marginValue.val(), marginType.val());\n });\n var marginValue = $('#margin_value');\n marginValue.change(function () {\n marginSlider.val($(this).val());\n global.editorObj.addMargin($(this).val(), marginType.val());\n });\n var marginType = $('#margin_type');\n marginType.change(function () {\n global.editorObj.addMargin(marginValue.val(), $(this).val());\n });\n }\n\n if (global.reflection) {\n var mirrowControl = $('<div id=\"mirrow_cont\"><div id=\"reflect_x\"></div><div id=\"reflect_y\"></div></div>');\n toolsCont.append(mirrowControl);\n $('#reflect_x').click(function () {\n global.editorObj.addReflection('x');\n });\n $('#reflect_y').click(function () {\n global.editorObj.addReflection('y');\n });\n }\n\n this.importControl = $('<button id=\"import\" class=\"edit_control_btn tool btn btn-primary btn-xs m-r-sm\">Import SVG</button>');\n toolsCont.append(this.importControl);\n this.importControl.click(function () {\n global.editorObj.importSVG();\n });\n\n this.exportControl = $('<button id=\"export\" class=\"edit_control_btn tool btn btn-primary btn-xs m-r-sm\">Export SVG</button>');\n toolsCont.append(this.exportControl);\n this.exportControl.click(function () {\n global.editorObj.exportSVG();\n });\n\n /*this.addSceneBtn = $('<button id=\"add_scene\" class=\"edit_control_btn tool btn btn-primary btn-xs m-r-sm\">Add scene</button>');\n toolsCont.append(this.addSceneBtn);\n this.addSceneBtn.click(function () {\n global.editorObj.addScene();\n });\n\n this.removeScene = $('<button id=\"remove_scene\" class=\"edit_control_btn tool btn btn-primary btn-xs m-r-sm\">Remove scene</button>');\n toolsCont.append(this.removeScene);\n this.removeScene.click(function () {\n global.editorObj.removeScene();\n });*/\n\n this.viewModeControl = $('<select id=\"view_mode\" name=\"view_mode\" class=\"form-control input-sm\">' +\n '<option value=\"0\">Мікросхема</option>' +\n '<option value=\"1\">Макросхема</option>' +\n '</select>');\n toolsCont.append(this.viewModeControl);\n this.viewModeControl.on('change', function(){\n global.editorObj.changeShemeViewMode();\n });\n\n // special cont for using in macro mode\n this.makroToolsCont = $('<span id=\"makroToolsCont\"></span>');\n toolsCont.append(this.makroToolsCont.hide());\n\n this.addMacroElementBtn = $('<button id=\"add_makro_element\" class=\"edit_control_btn tool btn btn-primary btn-xs m-r-sm\">Добавити елемнт</button>');\n this.addMacroElementBtn.on('click', function(){\n global.editorObj.addMakroElement();\n });\n\n this.removeMacroElementBtn = $('<button id=\"remove_makro_element\" class=\"edit_control_btn tool btn btn-primary btn-xs m-r-sm\">Видалити елемнт</button>');\n this.removeMacroElementBtn.on('click', function(){\n global.editorObj.removeMakroElement();\n });\n\n this.joinToSectorDropdown = $('<select id=\"join_to_sector_dropdown\" name=\"join_to_sector\" class=\"form-control input-sm\"></select>');\n this.sectorsListItems.each(function(){\n global.editorObj.joinToSectorDropdown.append('<option value=\"'+$(this).attr('id')+'\">'+$(this).find('a').text()+'</option>');\n });\n\n this.joinToSectorBtn = $('<button id=\"join_to_sector_btn\" class=\"edit_control_btn tool btn btn-primary btn-xs m-r-sm\">Прив\\'язати</button>');\n this.joinToSectorBtn.on('click', function(){\n global.editorObj.joinToSector();\n });\n\n this.viewSectorsDropdown = $('<select id=\"view_sector_dropdown\" name=\"view_sector_dropdown\" class=\"form-control input-sm\"><option value=\"-1\">Перегляд всіх у макро</option></select>');\n this.sectorsListItems.each(function(){\n global.editorObj.viewSectorsDropdown.append('<option value=\"'+$(this).attr('id')+'\">'+$(this).find('a').text()+'</option>');\n });\n this.viewSectorsDropdown.on('change', function(){\n global.editorObj.showSingleSector($(this).val(), false);\n });\n\n this.makroToolsCont.append(this.addMacroElementBtn, this.removeMacroElementBtn, this.joinToSectorDropdown, this.joinToSectorBtn, this.viewSectorsDropdown);\n\n }\n\n global.editorObj.isCrlPressed();\n global.editorObj.isShiftPressed();\n\n // add general svg object\n if (SVG.supported) {\n this.mainSVG = SVG('svg_cont');\n var draw = this.mainSVG;\n this.nodes = draw.group();\n if (global.isMobile) {\n SVG.off(window, 'touchstart');\n SVG.off(window, 'touchend');\n SVG.on(window, 'touchstart', this.startSelectingMObile);\n SVG.on(window, 'touchend', this.endSelectingMobile);\n } else {\n SVG.off(window, 'mousedown');\n SVG.off(window, 'mouseup');\n SVG.on(window, 'mousedown', this.startSelecting);\n SVG.on(window, 'mouseup', this.endSelecting);\n }\n\n if (!global.isMobile) {\n this.panZoom = this.nodes.panZoom();\n SVG.off(window, 'mousemove');\n SVG.on(window, 'mousemove', this.isSelecting);\n this.svgChildBlock.mousewheel(function (event) { // add zoom when use mousewheel on svg\n event.preventDefault();\n });\n var scrollTop = 0,\n scrollLeft = 0;\n this.svgChildBlock.on('scroll', function(e){\n var newScrollTop = $(this).scrollTop(),\n newScrollLeft = $(this).scrollLeft(),\n topDiff = newScrollTop - scrollTop,\n leftDiff = newScrollLeft - scrollLeft;\n global.editorObj.changePositionWhenScroll([\n global.editorObj.controlsCont,\n global.editorObj.backToMacroBtn,\n global.editorObj.deselectBtn], topDiff, leftDiff);\n scrollTop = newScrollTop;\n scrollLeft = newScrollLeft;\n });\n }\n if (global.tooltip) this.createTooltip();\n } else {\n console.log('SVG not supported');\n }\n\n // additional global features and events\n if (global.generalMoving) {\n if (global.editorObj.svgChildBlock.length > 0) {\n global.editorObj.svgChildBlock.scroll(function () {\n global.editorObj.isScrolling = true;\n });\n } else {\n console.log('Overflow container missed');\n }\n }\n\n },\n\n changeDeselectBtnVisisbility: function(){\n if (this.deselectBtn && this.deselectBtn.length > 0){\n if (this.currentElement != undefined && (this.currentElement.length > 0 || (this.currentElement.node != null && this.currentElement.node != undefined))){\n this.deselectBtn.show();\n }else{\n this.deselectBtn.hide();\n }\n }\n },\n\n changeShemeViewMode: function(){\n this.isMicroView = !this.isMicroView;\n if (this.makroToolsCont) this.makroToolsCont.toggle();\n $('.makroControl').toggle();\n this.svgParentNode.toggleClass('makroView');\n this.sectorsList.toggle();\n if (this.backToMacroBtn && global.isPreviewPage) this.isMicroView == true ? this.backToMacroBtn.show() : this.backToMacroBtn.hide();\n global.editorObj.deselectElements();\n this.setDefaultZoom();this.nodes.move(0, 0); // set to default position for better trimming\n if (this.isMicroView) this.showSingleSector(-1, false);\n },\n\n addMakroElement: function(){\n var macroControl = $(\"<rect class='imported makroControl' data-selectable='true' fill='#dddddd' width='450px' height='150px' onclick='window.editor.editorObj.showSingleSector($(this).attr(\\\"data-joined-to\\\"), true)'></rect>\");\n this.setImport(outerHTML(macroControl.get(0)), false);\n },\n\n removeMakroElement: function(){\n var curEl = $('.current');\n if (curEl. length > 0){\n curEl.each(function(){\n if (this.instance.hasClass('makroControl')){\n this.instance.remove();\n $(this).remove();\n\n }\n });\n }\n },\n\n backToMacroAction: function(){\n this.changeShemeViewMode();\n if (this.svgParentNode.data('macroBox')){ // set macrobox when switch to makro mode\n this.setVisualBox(global.editorObj.svgParentNode.data('macroBox'));\n this.setTrimmedZoom();\n }else{console.log('Macrobox not found')}\n var singleSectEl = this.svgParentNode.find('.native[data-type=1]'); // clear previously loaded old data\n if (singleSectEl.length > 0){\n singleSectEl.each(function(){\n this.instance.remove();\n $(this).remove();\n });\n }\n },\n\n joinToSector: function(){\n var sectorToJoin = this.joinToSectorDropdown.val(),\n sectorToJoinName = global.editorObj.joinToSectorDropdown.find(':selected').text();\n if (sectorToJoin == \"\"){\n this.joinToSectorDropdown.trigger('focus');\n }else{\n var curEl = $('.current');\n if (curEl. length > 0){\n curEl.each(function(){\n this.instance.data({'joined-to': sectorToJoin, 'label': sectorToJoinName});\n global.editorObj.setHoverHandlers(this.instance);\n showAlert('success', \"Елемент успішно прив'язано до \"+sectorToJoinName+\"!\");\n });\n }\n }\n },\n\n showSingleSector: function(sectId, isUsedFromControl){\n if (isUsedFromControl && !global.editorObj.isPreviewPage) return;\n if (isUsedFromControl && global.editorObj.isProductionPage) return;\n if (sectId == -1){\n $('.makroControl').css('cssText','');\n if (this.makroStyleEl) this.makroStyleEl.remove();\n return;\n }\n $('.makroControl').css('cssText','display: none !important');\n if (this.makroStyleEl) this.makroStyleEl.remove();\n this.makroStyleEl = $('<style type=\"text/css\">.makroView .native[sector_id=\"'+sectId+'\"], .makroView .rect[sector_id=\"'+sectId+'\"]{display: block !important;}#svg_cont.makroView .imported:not([sector_id=\"'+sectId+'\"]), .makroView .rect[data-type=\"2\"]:not([sector_id=\"'+sectId+'\"]), .makroView .native[data-type=\"2\"]:not([sector_id=\"'+sectId+'\"]){display: none !important}</style>')\n this.svgParentNode.prepend(this.makroStyleEl);\n //if (global.isMobile && window.JSInterface && isUsedFromControl) window.JSInterface.showMacroBackButton(true);\n if (openMicroListener != undefined && typeof openMicroListener == \"function\") openMicroListener();\n var itemInList = this.sectorsList.find('#'+sectId),\n itemPar = itemInList.parent();\n if (itemInList.length > 0){\n if (itemInList.length > 0 && itemPar.hasClass('inactive')) {\n itemInList.find('.active_control').trigger('click');\n }\n }else{\n var hF = $('<style>.editor_cont[data-hasmacro=true].preview .makroView [data-type=\"2\"] {display: none !important;}</style>');\n this.svgParentNode.prepend(hF);\n getSectorVisualInfo(null, sectId , {callback: function(){\n hF.remove();\n global.microModeLoadedListener(sectId);\n }\n });\n }\n\n },\n\n hasSectorMacro: function(sectorId){\n return $('.makroControl[data-joined-to='+sectorId+']').length > 0;\n },\n\n changeMode: function(type){\n switch(type){\n case 1:\n global.dragMode = true;\n global.editorObj.dragMode = true;\n global.editorObj.svgParentNode.addClass('dragged');\n global.editorObj.dragControlHand.addClass('active');\n global.editorObj.dragControlSelect.removeClass('active');\n break;\n case 0:\n global.dragMode = false;\n global.editorObj.dragMode = false;\n global.editorObj.svgParentNode.removeClass('dragged');\n global.editorObj.dragControlHand.removeClass('active');\n global.editorObj.dragControlSelect.addClass('active');\n break;\n }\n\n },\n\n changePositionWhenScroll: function(elementsArr, topDiff, leftDiff){\n for (var i=0; i < elementsArr.length; i++){\n if (elementsArr[i] != undefined && elementsArr[i].length > 0){\n elementsArr[i].css({\n top: parseFloat(elementsArr[i].css('top')) + topDiff,\n left: parseFloat(elementsArr[i].css('left')) + leftDiff\n });\n }\n }\n\n },\n\n // general zoom on mousewheel for svg elements\n mouseWheelZoom: function (event) {\n event.preventDefault();\n var scaleVal, scaleStep,\n isZoomNeeded = (this.zoom >= this.minZoom && this.zoom < 1) || (this.zoom == 1 && event.deltaY == -1);\n // scale elements (change controls if needed)\n if (global.editorObj.scaleControl) {\n scaleStep = parseFloat(global.editorObj.scaleControl.attr('step'));\n scaleVal = parseFloat(global.editorObj.scaleControl.val());\n if (event.deltaY == 1) {\n global.editorObj.scaleControl.val(scaleVal + scaleStep);\n global.editorObj.scaleControl.trigger('change');\n } else if (event.deltaY == -1) {\n global.editorObj.scaleControl.val(scaleVal - scaleStep);\n global.editorObj.scaleControl.trigger('change');\n }\n } else {\n scaleVal = this.zoom;\n scaleStep = this.zoomStep;\n var newZoom;\n if (event.deltaY == 1) {\n newZoom = scaleVal + scaleStep;\n } else if (event.deltaY == -1) {\n newZoom = scaleVal - scaleStep;\n }\n if (newZoom > 0 && newZoom <= 1) {\n this.zoom = newZoom;\n this.zoomElements(this.zoom);\n }\n }\n\n },\n\n getTransformParams: function (obj) {\n if (obj.css('transform') != undefined){\n var matrix = obj.css('transform').replace(/[^0-9\\-.,]/g, '').split(',');\n if (matrix.length > 1) {\n return {\n x: parseFloat(matrix[12]) || parseFloat(matrix[4]),\n y: parseFloat(matrix[13]) || parseFloat(matrix[5])\n };\n } else {\n return {x: 0, y: 0};\n }\n }else {\n return {x: 0, y: 0};\n }\n },\n\n getScrollbarWidth: function () {\n var outer = document.createElement(\"div\");\n outer.style.visibility = \"hidden\";\n outer.style.width = \"100px\";\n outer.style.msOverflowStyle = \"scrollbar\"; // needed for WinJS apps\n document.body.appendChild(outer);\n var widthNoScroll = outer.offsetWidth;\n // force scrollbars\n outer.style.overflow = \"scroll\";\n // add innerdiv\n var inner = document.createElement(\"div\");\n inner.style.width = \"100%\";\n outer.appendChild(inner);\n var widthWithScroll = inner.offsetWidth;\n // remove divs\n outer.parentNode.removeChild(outer);\n return widthNoScroll - widthWithScroll;\n },\n\n zoomElements: function (scaleVal) {\n if (global.isMobile){\n $('.rect, .native, .imported').each(function(){\n this.instance.scale(scaleVal);\n });\n this.svgParentNode.css({width: this.svgParentNode.attr('data-width')*scaleVal, height: this.svgParentNode.attr('data-height')*scaleVal});\n this.zoom = scaleVal;\n }else{\n this.panZoom.zoom(scaleVal);\n }\n },\n\n setDefaultZoom: function () {\n if (this.scaleControl) {\n this.scaleControl.val(1).trigger('change');\n } else {\n if (this.zoom != 1) {\n this.zoom = 1;\n this.zoomElements(1);\n }\n }\n },\n\n //initializing selecting tool\n startSelecting: function (event) {\n if (global.isProductionPage) return true;\n if (event == undefined) return true;\n //if (global.editorObj.dragSarted) return true; // if element starts dragg don't select new\n if (global.dragMode && !global.isProductionPage) return true; // if element starts dragg don't select new\n global.editorObj.isScrolling = false;\n var clickEl = event.target;\n if ((clickEl.tagName == \"svg\" || $(clickEl).parents('svg').length > 0) && !global.dragMode && !global.editorObj.dragSarted) {\n // form select area if using multiple select x: event.pageX - global.editorObj.mainSVG.leftOffset\n global.editorObj.selectEnable = true;\n global.editorObj.disableHtmlSelect(true);\n global.editorObj.startPosition = {};\n global.editorObj.mainSVG.topOffset = $(global.editorObj.mainSVG.node).offset().top;\n global.editorObj.mainSVG.leftOffset = $(global.editorObj.mainSVG.node).offset().left;\n global.editorObj.startPosition.y = event.pageY - global.editorObj.mainSVG.topOffset;\n global.editorObj.startPosition.x = event.pageX - global.editorObj.mainSVG.leftOffset;\n if (global.editorObj.selectArea) {\n global.editorObj.selectArea.remove();\n delete global.editorObj.selectArea;\n }\n global.editorObj.selectArea = global.editorObj.mainSVG.rect({\n width: 0,\n height: 0\n }).fill('#0081FF').x(global.editorObj.startPosition.x).y(global.editorObj.startPosition.y).opacity(0.2);\n // clear previous selected group if not multiple select\n if (global.editorObj.selectedGroup && !global.editorObj.ctrlPressed) global.editorObj.removeGroup(global.editorObj.selectedGroup);\n global.editorObj.getElements();\n }\n if (clickEl.instance != null) {\n // single select\n if (!clickEl.instance.data('selectable')) return true;\n if (global.isPreviewPage && clickEl.instance.hasClass('imported')) return true; // don't allow select decorative in preview pages\n global.editorObj.singleClickElement = clickEl.instance;\n if (!global.editorObj.isGroupSelected && (!global.editorObj.ctrlPressed || global.keepPreviousSelected )) {\n // use single select if multiple select wasn't fired\n if (!global.editorObj.singleClickElement.hasClass('clicked')) {\n if ($('.clicked').length > 0) $('.clicked')[0].instance.removeClass('clicked'); // clear previous single selected element\n global.editorObj.removeGroup(global.editorObj.selectedGroup);\n global.editorObj.selectedGroup = global.editorObj.createGroup();\n global.editorObj.selectedGroup.add(global.editorObj.singleClickElement);\n global.editorObj.addDraggableAction(global.editorObj.selectedGroup);\n global.editorObj.singleClickElement.addClass('clicked');\n }\n if (!global.editorObj.singleClickElement.hasClass('current')) {\n global.editorObj.changeCurrentElement(global.editorObj.singleClickElement);\n } else {\n global.editorObj.changeCurrentElement(null);\n }\n }\n else if (global.editorObj.isGroupSelected && !global.editorObj.singleClickElement.hasClass('current') && !global.editorObj.ctrlPressed) {\n // clear multiple select if single select is fired\n global.editorObj.removeGroup(global.editorObj.selectedGroup);\n global.editorObj.changeCurrentElement(global.editorObj.singleClickElement);\n global.editorObj.isGroupSelected = false;\n global.editorObj.selectedGroup = global.editorObj.createGroup();\n global.editorObj.selectedGroup.add(global.editorObj.singleClickElement);\n global.editorObj.addDraggableAction(global.editorObj.selectedGroup);\n global.editorObj.singleClickElement.addClass('clicked');\n }\n else if (global.editorObj.isGroupSelected && global.editorObj.singleClickElement.hasClass('current')) {\n setTimeout(function(){\n if (!global.editorObj.isDraging){\n if (global.editorObj.currentElement && global.editorObj.currentElement.length > 0) {\n for (var i = 0; i < global.editorObj.currentElement.length; i++) {\n if ($(global.editorObj.singleClickElement.node).is($(global.editorObj.currentElement[i]))) {\n global.editorObj.currentElement.splice(i, 1);\n break;\n }\n }\n }\n global.editorObj.singleClickElement.removeClass('current');\n global.editorObj.singleClickElement.removeClass('clicked');\n global.editorObj.singleClickElement.removeClass('tmp');\n global.editorObj.copyElement(global.editorObj.singleClickElement, global.editorObj.selectedGroup);\n global.editorObj.singleClickElement.remove();\n delete global.editorObj.singleClickElement;\n if (global.editorObj.currentElement.length == 0){\n global.editorObj.changeCurrentElement(null);\n }\n global.selectHandler(global.editorObj.currentElement);\n }\n }, 200);\n }\n if (global.editorObj.ctrlPressed) {\n clickEl.instance.addClass('tmp');\n if (global.keepPreviousSelected) {\n var selectedElements;\n if (!global.editorObj.ctrlPressed) {\n selectedElements = $('.tmp');\n } else {\n selectedElements = $('.current,.tmp');\n }\n if (selectedElements.length > 0) {\n // multiple array was selected\n global.editorObj.changeCurrentElement(selectedElements);\n global.editorObj.selectedGroup = global.editorObj.createGroup();\n selectedElements.each(function () {\n this.instance.removeClass('tmp');\n global.editorObj.selectedGroup.add(this.instance);\n });\n global.editorObj.addDraggableAction(global.editorObj.selectedGroup);\n global.editorObj.isGroupSelected = true;\n } else if ($('.clicked').length == 0) {\n // clear everything if nothing was selected\n global.editorObj.isGroupSelected = false;\n global.editorObj.changeCurrentElement(null);\n if ($('.clicked').length > 0) $('.clicked')[0].instance.removeClass('clicked');\n }\n global.selectHandler(global.editorObj.currentElement);\n }\n }\n }\n },\n\n // selecting elements on editor\n isSelecting: function (event) {\n if (window.editor.editorObj.dragMode && global.editorObj.panZoom.pan.mousedown) window.EventListeners.mouse_move(event);\n if (global.editorObj.selectEnable && global.editorObj.selectArea) {\n var scrolledTop = global.editorObj.svgChildBlock.scrollTop(),\n scrolledLeft = global.editorObj.svgChildBlock.scrollLeft(),\n currentY = event.pageY - global.editorObj.mainSVG.topOffset,\n currentX = event.pageX - global.editorObj.mainSVG.leftOffset;\n // form select area rectangle\n global.editorObj.selectArea.height(Math.abs(currentY - global.editorObj.startPosition.y));\n global.editorObj.selectArea.width(Math.abs(currentX - global.editorObj.startPosition.x));\n if (scrolledTop <= 0) {\n if (currentY < global.editorObj.startPosition.y) global.editorObj.selectArea.y(currentY);\n } else {\n global.editorObj.startPosition.y >= currentY ? global.editorObj.selectArea.y(currentY) : global.editorObj.selectArea.y(global.editorObj.startPosition.y);\n if (global.editorObj.isScrolling) {\n if (global.editorObj.startPosition.y < global.editorObj.svgChildBlock.height()) {\n global.editorObj.selectArea.height(global.editorObj.selectArea.height() + scrolledTop);\n } else {\n global.editorObj.selectArea.height(global.editorObj.selectArea.height());\n }\n }\n }\n if (scrolledLeft <= 0) {\n if (currentX < global.editorObj.startPosition.x) global.editorObj.selectArea.x(currentX);\n } else {\n global.editorObj.startPosition.x >= currentX ? global.editorObj.selectArea.x(currentX) : global.editorObj.selectArea.x(global.editorObj.startPosition.x);\n if (global.editorObj.isScrolling) {\n global.editorObj.selectArea.width(global.editorObj.selectArea.width() + scrolledLeft);\n }\n }\n }\n },\n\n // deleting selecting tool\n endSelecting: function (event) {\n if (!$(event.target).hasClass('editor_cont') && $(event.target).parents('editor_cont').length == 0){\n global.editorObj.panZoom.pan.mousedown = false;\n window.editor.editorObj.disableHtmlSelect(false);\n }\n if (global.isProductionPage) return true;\n if (event == undefined) return true;\n var clickEl = event.target;\n if (global.editorObj.dragSarted) return true;\n if (global.editorObj.selectArea && global.editorObj.selectArea.height() == 0 && $(clickEl).is($(global.editorObj.selectArea.node))) {\n //global.editorObj.deselectElements();\n }\n if (global.editorObj.selectEnable) {\n global.editorObj.selectEnable = false;\n if (global.editorObj.selectArea && global.editorObj.selectArea.width() != 0) {\n // check if elements are in select area\n if (global.editorObj.allSingleElements && global.editorObj.allSingleElements.length > 0 && global.editorObj.selectArea.width() != 0) {\n global.editorObj.allSingleElements.each(function () {\n if (this.instance.visible() && !global.editorObj.isEmptyBbox(this.instance.bbox())){\n if (global.editorObj.isInside(global.editorObj.selectArea, this.instance)) {\n this.instance.addClass('tmp');\n } else {\n this.instance.removeClass('tmp');\n }\n }\n });\n }\n if (global.editorObj.selectArea) {\n global.editorObj.selectArea.remove();\n delete global.editorObj.selectArea;\n }\n }\n global.editorObj.disableHtmlSelect(false);\n if (global.editorObj.ctrlPressed) global.editorObj.removeGroup(global.editorObj.selectedGroup);\n var selectedElements;\n if (!global.editorObj.ctrlPressed) {\n selectedElements = $('.tmp');\n } else {\n selectedElements = $('.current,.tmp');\n }\n if (selectedElements.length > 0) {\n // multiple array was selected\n global.editorObj.changeCurrentElement(selectedElements);\n global.editorObj.selectedGroup = global.editorObj.createGroup();\n selectedElements.each(function () {\n this.instance.removeClass('tmp');\n global.editorObj.selectedGroup.add(this.instance);\n });\n global.editorObj.addDraggableAction(global.editorObj.selectedGroup);\n global.editorObj.isGroupSelected = true;\n } else if ($('.clicked').length == 0) {\n // clear everything if nothing was selected\n /*global.editorObj.isGroupSelected = false;\n global.editorObj.changeCurrentElement(null);\n if ($('.clicked').length > 0) $('.clicked')[0].instance.removeClass('clicked');*/\n }\n }\n if (!global.isProductionPage) global.selectHandler(global.editorObj.currentElement);\n },\n\n // add draggable action for each element\n addDraggableAction: function (element, params) {\n if (global.generalMoving) {\n var dragEl,\n translate = {\n x: element.transform().x,\n y: element.transform().y\n };\n element.beforestart = function (event) {\n\n }\n element.dragstart = function (event) {\n if (global.isPreviewPage){\n element.translate(translate.x, translate.y);\n }else{\n global.editorObj.disableHtmlSelect(true);\n }\n global.editorObj.dragSarted = true;\n if (global.editorObj.tooltipCont.is(':visible')) global.editorObj.tooltipCont.hide().text(\"\");\n }\n element.dragend = function (event) {\n if (global.isPreviewPage){\n element.translate(translate.x, translate.y);\n }else{\n global.editorObj.disableHtmlSelect(false);\n }\n global.editorObj.dragSarted = false;\n global.editorObj.isDraging = false;\n }\n element.dragmove = function (event) {\n if (global.isPreviewPage) element.translate(translate.x, translate.y);\n global.editorObj.isDraging = true;\n }\n if (element.hasClass('transformed')) {\n var dragGroup = element.parent.group();\n dragGroup.add(element);\n dragEl = dragGroup;\n } else {\n dragEl = element;\n }\n if (params) {\n dragEl.draggable(function (x, y) {\n return {\n x: x < params.maxX || (global.container.width()) && x > (params.minX || 0),\n y: y < (params.maxY || global.container.height()) && y > (params.minY || 0)\n }\n });\n } else {\n dragEl.draggable();\n }\n }\n return element;\n },\n\n // remove draggable action\n removeDraggableAction: function (element) {\n element.fixed();\n },\n\n startSelectingMObile: function (event) {\n var clickEl = event.target;\n if (clickEl.tagName != \"svg\" && clickEl.instance != null) {\n if (!clickEl.instance.data('selectable')) return;\n if (global.isPreviewPage && clickEl.instance.hasClass('imported')) return; // don't allow select decorative in preview pages\n global.editorObj.singleClickElement = clickEl.instance;\n /*if (!global.editorObj.singleClickElement.hasClass('clicked')) {\n if ($('.clicked').length > 0) $('.clicked')[0].instance.removeClass('clicked');\n global.editorObj.removeGroup(global.editorObj.selectedGroup);\n global.editorObj.selectedGroup = global.editorObj.createGroup();\n global.editorObj.selectedGroup.add(global.editorObj.singleClickElement);\n global.editorObj.addDraggableAction(global.editorObj.selectedGroup);\n global.editorObj.singleClickElement.addClass('clicked');\n }*/\n if (!global.editorObj.singleClickElement.hasClass('current')) {\n global.editorObj.changeCurrentElement(global.editorObj.singleClickElement);\n if (window.JSInterface) window.JSInterface.clickHandler(global.editorObj.singleClickElement.attr('id'), global.editorObj.singleClickElement.attr('data-server_id'), global.editorObj.singleClickElement.attr('data-type'));\n } else {\n global.editorObj.changeCurrentElement(null);\n if (window.JSInterface) window.JSInterface.clickHandler(\"null\", \"null\", \"null\");\n }\n } else if (clickEl.tagName == \"svg\") {\n if (global.editorObj.selectedGroup) global.editorObj.removeGroup(global.editorObj.selectedGroup);\n global.editorObj.changeCurrentElement(null);\n if (window.JSInterface) window.JSInterface.clickHandler(\"null\", \"null\", \"null\");\n if ($('.clicked').length > 0) $('.clicked')[0].instance.removeClass('clicked');\n }\n },\n\n endSelectingMobile: function (event) {\n global.selectHandler(global.editorObj.currentElement);\n },\n\n // get all single elements in svg\n getElements: function () {\n // don't allow select decorative in preview pages\n if (!global.isPreviewPage) {\n this.allSingleElements = $('.rect, .native, .imported').not(global.editorObj.selectArea).not('[data-selectable=\"false\"]');\n } else {\n this.allSingleElements = $('.rect, .native').not(global.editorObj.selectArea).not('.imported').not('[data-selectable=\"false\"]');\n }\n return this.allSingleElements;\n },\n\n //check if element is in some box\n isInside: function (box, element) {\n var elementBbox = element.bbox(),\n elCoords = {\n x1: elementBbox.x,\n x2: elementBbox.x2,\n y1: elementBbox.y,\n y2: elementBbox.y2,\n cx: elementBbox.cx,\n cy: elementBbox.cy\n };\n var parTrans = {\n x: this.nodes.transform().x,\n y: this.nodes.transform().y,\n scale: this.nodes.transform().scaleX\n };\n if (parTrans){\n elCoords = {\n x1: elementBbox.x*parTrans.scale + parTrans.x,\n x2: elementBbox.x2*parTrans.scale + parTrans.x,\n y1: elementBbox.y*parTrans.scale + parTrans.y,\n y2: elementBbox.y2*parTrans.scale + parTrans.y,\n cx: elementBbox.cx*parTrans.scale + parTrans.x,\n cy: elementBbox.cy*parTrans.scale + parTrans.y\n };\n }\n return (box.inside(elCoords.cx, elCoords.cy) || box.inside(elCoords.x1, elCoords.y1) || box.inside(elCoords.x2, elCoords.y1) || box.inside(elCoords.x1, elCoords.y2) || box.inside(elCoords.x2, elCoords.y2));\n },\n\n // refactor coordinates when transform is used\n transformCoords: function (x, y, rotation, zoom) {\n var transformedCoords = {};\n transformedCoords.x = (x * Math.cos(rotation) + y * Math.sin(rotation));\n transformedCoords.y = Math.abs(y * Math.cos(rotation) + x * Math.sin(-rotation));\n return transformedCoords;\n },\n\n\n //create group of elements\n createGroup: function (container) {\n var group = this.nodes.group();\n return group;\n },\n\n //add element to group\n addToGroup: function (group, element) {\n group.add(element);\n return group;\n },\n\n //remove element from group\n removeFromGroup: function (group, element) {\n group.remove(element);\n if (group.children().length == 0) {\n group.remove();\n return false;\n }\n return group;\n },\n\n //remove group without removing elements\n removeGroup: function (group) {\n if (group) {\n var groupEl = group.node.childNodes;\n if (groupEl && groupEl.length > 0) {\n // move elemts from group to parent (duplicates)\n var new_elements = [];\n $(groupEl).each(function (i, children) {\n var oldEl = children.instance;\n new_elements.push(global.editorObj.copyElement(oldEl, group));\n oldEl.remove();\n });\n this.currentElement = $('.current'); // TODO ise new_elements\n }\n global.editorObj.selectedGroup.remove();\n }\n },\n\n // dublicate element before deleting\n copyElement: function (oldEl, group, group_params) {\n var new_element;\n new_element = outerHTML(oldEl.node);\n this.setImport(new_element, false);\n var elScale = this.just_created.transform().scaleX;\n var parX = group.x();\n var parY = group.y();\n if (elScale != 1) {\n parX /= elScale;\n parY /= elScale;\n this.just_created.scale(1);\n }\n this.just_created.x(oldEl.x() + parX).y(oldEl.y() + parY);\n this.just_created.scale(elScale);\n if (!oldEl.visible()) {\n this.just_created.hide();\n }\n return this.just_created;\n },\n\n //change previous current active element\n changeCurrentElement: function (new_element) {\n if (global.editorObj.currentElement) {\n if (global.editorObj.currentElement.length == null || isNaN(global.editorObj.currentElement.length) || typeof global.editorObj.currentElement.length == \"function\") {\n global.editorObj.currentElement.removeClass('current');\n } else {\n global.editorObj.currentElement.each(function () {\n this.instance.removeClass('current');\n });\n }\n }\n if (new_element != null) {\n if (new_element.length == null || isNaN(new_element.length) || typeof new_element.length == \"function\") {\n new_element.addClass(\"current\");\n } else {\n new_element.each(function () {\n this.instance.addClass(\"current\");\n });\n }\n }\n global.editorObj.currentElement = new_element;\n\n var userAgent = window.navigator.userAgent;\n if (userAgent.match(/iPad/i) || userAgent.match(/iPhone/i)) {\n window.location.href = \"callback://placeSelectionChanged\";\n }\n },\n\n // set custom active elements\n setCustomSelectedElements: function (selectedElements) {\n selectedElements = selectedElements.not('[data-selectable=\"false\"]');\n this.changeCurrentElement(selectedElements);\n this.selectedGroup = this.createGroup();\n selectedElements.each(function () {\n this.instance.removeClass('tmp');\n window.editor.editorObj.selectedGroup.add(this.instance);\n });\n this.addDraggableAction(this.selectedGroup);\n this.isGroupSelected = true;\n },\n\n // deselect custom match of elementa\n deselectCustomElementsSet: function(elementsSet){\n if (elementsSet && elementsSet.length > 0){\n elementsSet.each(function(pos, el){\n el = el.instance;\n if (el && global.editorObj.currentElement.length > 0) {\n for (var i = 0; i < global.editorObj.currentElement.length; i++) {\n if ($(el.node).is($(global.editorObj.currentElement[i]))) {\n global.editorObj.currentElement.splice(i, 1);\n break;\n }\n }\n }\n el.removeClass('current');\n el.removeClass('clicked');\n el.removeClass('tmp');\n global.editorObj.copyElement(el, global.editorObj.selectedGroup);\n el.remove();\n delete el;\n if (global.editorObj.currentElement.length == 0){\n global.editorObj.changeCurrentElement(null);\n }\n });\n global.selectHandler(global.editorObj.currentElement, true);\n }\n },\n\n\n // deselect all elements in editor\n deselectElements: function () {\n global.editorObj.isGroupSelected = false;\n global.editorObj.changeCurrentElement(null);\n if ($('.clicked').length > 0) $('.clicked')[0].instance.removeClass('clicked');\n window.editor.editorObj.removeGroup(window.editor.editorObj.selectedGroup);\n if (global.editorObj.selectArea) {\n global.editorObj.selectArea.remove();\n delete global.editorObj.selectArea;\n }\n global.selectHandler(null);\n },\n\n // change margin of elements\n addMargin: function (value, type) {\n if (type && value && this.selectedGroup) {\n var margin = parseFloat(value);\n var groupXCenter = global.editorObj.selectedGroup.bbox().cx;\n var groupYCenter = global.editorObj.selectedGroup.bbox().cy;\n this.selectedGroup.each(function () {\n var elementXCenter = parseFloat(this.bbox().cx) + parseFloat(global.editorObj.selectedGroup.transform().x);\n var elementYCenter = parseFloat(this.bbox().cy) + parseFloat(global.editorObj.selectedGroup.transform().y);\n switch (parseFloat(type)) {\n case 0:\n if (elementXCenter == groupXCenter) {\n return false;\n } else {\n if (elementXCenter > groupXCenter) {\n if (margin > 0) {\n this.dx((margin + (elementXCenter - groupXCenter) / 2));\n } else if (margin < 0) {\n this.dx((margin - (elementXCenter - groupXCenter) / 2));\n }\n } else if (elementXCenter < groupXCenter) {\n if (margin > 0) {\n this.dx(-(margin + (groupXCenter - elementXCenter) / 2));\n } else if (margin < 0) {\n this.dx(-(margin - (groupXCenter - elementXCenter) / 2));\n }\n }\n }\n break;\n case 1:\n if (elementYCenter == groupYCenter) {\n return false;\n } else {\n if (elementYCenter > groupYCenter) {\n if (margin > 0) {\n this.dy((margin + (elementYCenter - groupYCenter) / 2));\n } else if (margin < 0) {\n this.dy((margin - (elementYCenter - groupYCenter) / 2));\n }\n } else if (elementYCenter < groupYCenter) {\n if (margin > 0) {\n this.dy(-(margin + (groupYCenter - elementYCenter) / 2));\n } else if (margin < 0) {\n this.dy(-(margin - (groupYCenter - elementYCenter) / 2));\n }\n }\n }\n break;\n case 2:\n // TODO both x and y margin\n break;\n }\n });\n } else if (!this.selectedGroup) {\n console.log('No elements selected');\n }\n },\n\n addReflection: function (type) {\n if (this.selectedGroup) {\n this.selectedGroup.each(function () {\n switch (type) {\n case \"x\":\n var groupXCenter = parseFloat(global.editorObj.selectedGroup.bbox().cx);\n var elementXCenter = parseFloat(this.bbox().cx) + parseFloat(global.editorObj.selectedGroup.transform().x);\n if (elementXCenter > groupXCenter) {\n this.data('reflection', {type: \"x\", \"value\": -(elementXCenter - groupXCenter) * 2});\n } else if (elementXCenter < groupXCenter) {\n this.data('reflection', {type: \"x\", \"value\": (groupXCenter - elementXCenter) * 2});\n }\n break;\n case \"y\":\n var groupYCenter = global.editorObj.selectedGroup.bbox().cy;\n var elementYCenter = parseFloat(this.bbox().cy) + parseFloat(global.editorObj.selectedGroup.transform().y);\n if (elementYCenter > groupYCenter) {\n this.data('reflection', {type: \"y\", \"value\": -(elementYCenter - groupYCenter) * 2});\n } else if (elementYCenter < groupYCenter) {\n this.data('reflection', {type: \"y\", \"value\": (groupYCenter - elementYCenter) * 2});\n }\n break;\n }\n });\n this.selectedGroup.each(function () {\n if (this.data('reflection')) {\n var type = this.data('reflection').type;\n var value = this.data('reflection').value;\n if (type == \"x\") {\n this.dx(value);\n } else if (type == \"y\") {\n this.dy(value);\n }\n this.data('reflection', null);\n }\n });\n } else {\n console.log('Nothing for reflection');\n }\n },\n\n // move current element with control on some value\n moveElement: function (direction, moveValue) {\n if (this.currentElement != null) {\n if($('#move_value').length > 0 && moveValue == undefined) moveValue = Number($('#move_value').val());\n if (!isNaN(moveValue) && moveValue != 0 && !this.isPreviewPage) {\n switch (direction) {\n case 'left':\n this.selectedGroup.dx(-moveValue);\n break;\n case 'top':\n this.selectedGroup.dy(-moveValue);\n break;\n case 'right':\n this.selectedGroup.dx(moveValue);\n break;\n case 'bottom':\n this.selectedGroup.dy(moveValue);\n break;\n }\n }\n } else {\n console.log('Nothing for generalMoving');\n }\n },\n\n // turn current element with control on some degrees\n turnElement: function (direction, type) {\n if (this.selectedGroup) {\n var moveValue;\n switch (type) {\n case \"group\":\n moveValue = Number($('#turn_group_value').val());\n break;\n }\n if (!isNaN(moveValue) && moveValue != 0 && moveValue <= 360) {\n switch (type) {\n case \"group\":\n switch (direction) {\n case 'left':\n this.selectedGroup.rotate(parseInt(this.selectedGroup.transform().rotation) - moveValue, this.selectedGroup.cx(), this.selectedGroup.cy());\n break;\n case 'right':\n this.selectedGroup.rotate(parseInt(this.selectedGroup.transform().rotation) + moveValue, this.selectedGroup.cx(), this.selectedGroup.cy());\n break;\n }\n this.selectedGroup.each(function () {\n this.rotate(0);\n this.data('rotation_center', {\n 'x': global.editorObj.selectedGroup.cx(),\n 'y': global.editorObj.selectedGroup.cy(),\n 'value': parseInt(global.editorObj.selectedGroup.transform().rotation) - moveValue\n });\n });\n break;\n }\n } else {\n console.log('wrong value for turning' + moveValue);\n }\n } else {\n console.log('Nothing for turning');\n }\n },\n\n createRectangle: function (params, container) {\n var new_rectangle;\n if (container) {\n new_rectangle = container.rect(params.width, params.height).addClass('rect native').fill(params.fill || \"#DDDDDD\").stroke(params.stroke || 'none').attr('transform', params.transform || null).attr('rx', params.rx || 20);\n } else {\n new_rectangle = this.nodes.rect(params.width, params.height).addClass('rect native').fill(params.fill || \"#DDDDDD\").stroke(params.stroke || 'none').attr('transform', params.transform || null).attr('rx', params.rx || 20);\n }\n return new_rectangle;\n },\n\n createLine: function (params, container) {\n var new_line;\n if (container) {\n new_line = container.line(params.x1, params.y1, params.x2, params.y2).addClass('line').fill(\"none\").attr({\n 'stroke': params.stroke,\n 'stroke-width': params.stroke_width != 0 ? params.stroke_width : 1\n });\n } else {\n new_line = this.mainSVG.line(params.x1, params.y1, params.x2, params.y2).addClass('line').fill(\"none\").attr({\n 'stroke': params.stroke,\n 'stroke-width': params.stroke_width != 0 ? params.stroke_width : 1\n });\n }\n return new_line;\n },\n\n createText: function (params, container) {\n var new_text;\n if (container) {\n new_text = container.text(function (add) {\n add.plain(params.text)\n }).addClass('text').attr({\n 'transform': params.transform,\n 'stroke': params.stroke || 'none',\n 'fill': params.fill,\n 'font-family': params.font_family,\n 'font-size': params.font_size\n });\n } else {\n new_text = this.mainSVG.text(function (add) {\n add.plain(params.text)\n }).addClass('text').attr({\n 'transform': params.transform,\n 'stroke': params.stroke || 'none',\n 'fill': params.fill,\n 'font-family': params.font_family,\n 'font-size': params.font_size\n });\n }\n return new_text;\n },\n\n //give border radius\n addBorderRadius: function () {\n if (this.selectedGroup) {\n var roundValue = Number($('#round_value').val());\n if (!isNaN(roundValue) && roundValue >= 0) {\n this.selectedGroup.each(function () {\n this.radius(roundValue);\n });\n } else {\n console.log('wrong value for rounding' + moveValue);\n }\n } else {\n console.log('Nothing for rounding');\n }\n },\n\n // import foreign svg elements\n importSVG: function () {\n var doc = prompt('Paste raw SVG here:')\n if (doc != null && doc != '') {\n this.setDefaultZoom();\n this.setImport(doc, true);\n }\n },\n\n // setImported svg elements\n setImport: function (doc, reimport) {\n var just_created,\n addedArr = [],\n addedIds = [],\n importingJustSector = true,\n decorativeCleared = false;\n if (reimport){\n this.nodes.move(0, 0);\n this.setDefaultZoom();\n this.deselectElements();\n }\n this.nodes.svg(doc, function (level) {\n if (reimport) {\n //console.log(this);\n this.attr({'id':null,'name': this.attr('id')});\n var oldElemnt = SVG.get(this.attr('name'));\n var sectorId;\n var isNative = false;\n var elementId = this.attr('id') || this.attr('name');\n if (elementId && elementId.length > 0) {\n var neededSearch = elementId.search('sector');\n sectorId = elementId.substring(neededSearch + 6);\n if (neededSearch >= 0) isNative = true;\n }\n var sectorItem = $('#' + sectorId),\n allowImportNative = sectorItem.length > 0 && sectorItem.parent().hasClass('active');\n if (oldElemnt != undefined){\n var attrb = {\n 'id': oldElemnt.attr('id'),\n 'data_label': oldElemnt.attr('data-label'),\n 'data_selectable': oldElemnt.attr('data-selectable'),\n 'data_joined_to': oldElemnt.attr('data-joined-to'),\n 'class': oldElemnt.attr('class'),\n 'data_type': oldElemnt.attr('data-type'),\n 'data_status': oldElemnt.attr('data-status'),\n 'data_price': oldElemnt.attr('data-price'),\n 'data_server_id': oldElemnt.attr('data-server_id'),\n 'sector_id': oldElemnt.attr('sector_id'),\n 'data_quote_id': oldElemnt.attr('data-quote_id'),\n 'data_count': oldElemnt.attr('data-count'),\n 'data_amount': oldElemnt.attr('data-amount')\n };\n this.attr({\n 'data-label': attrb.data_label,\n 'data-selectable': attrb.data_selectable,\n 'data-joined-to': attrb.data_joined_to,\n 'class': attrb.class,\n 'data-type': attrb.data_type,\n 'data-status': attrb.data_status,\n 'data-price': attrb.data_price,\n 'data-server_id': attrb.data_server_id,\n 'sector_id': attrb.sector_id,\n 'data-quote_id': attrb.data_quote_id,\n 'data-count': attrb.data_count,\n 'data-amount': attrb.data_amount\n });\n if ((this.hasClass('makroControl') && global.editorObj.isMicroView) || (this.hasClass('native') && this.attr('data-type') != 2 && !global.editorObj.isMicroView)){\n global.editorObj.removeTotaly(this);\n return;\n }\n if (isNative){\n if (allowImportNative){\n global.editorObj.removeTotaly(oldElemnt);\n }else{\n global.editorObj.removeTotaly(this);\n }\n }else{\n global.editorObj.removeTotaly(oldElemnt);\n }\n }else{\n if (!isNative && !this.hasClass('makroControl')){\n if (importingJustSector && !decorativeCleared){\n importingJustSector = false;\n decorativeCleared = true;\n var exc = $('.makroControl');\n if (addedArr.length > 0){\n for (var i = 0; i < addedArr.length; i++){\n exc = exc.add(addedArr[i].node);\n }\n }\n console.log(exc);\n global.editorObj.deleteImported(exc);\n }\n }\n if (isNative && sectorId && sectorId.length > 0) {\n if (allowImportNative) {\n this.addClass('native');\n }\n } else {\n this.addClass('imported');\n }\n this.data('selectable', true);\n }\n if ((this.hasClass('makroControl') && global.editorObj.isMicroView) || (this.hasClass('native') && this.attr('data-type') != 2 && !global.editorObj.isMicroView)) {\n global.editorObj.removeTotaly(this);\n return;\n }\n } else {\n //console.log('just created');\n if (this.hasClass('imported')) {\n this.data('selectable', true);\n }\n if (global.editorObj.visualBox && !$.isEmptyObject(global.editorObj.visualBox)) {\n this.x(this.x() - global.editorObj.visualBox.minX);\n this.y(this.y() - global.editorObj.visualBox.minY);\n }\n }\n just_created = this;\n if (just_created != undefined){\n addedIds.push(this.attr('name') || this.attr('id'));\n addedArr.push(this);\n global.createElementHandler(this);\n }\n });\n this.just_created = just_created;\n if (addedArr.length > 0) {\n for (var i = 0; i < addedArr.length; i++) {\n if (addedArr[i].attr('id') == undefined || addedArr[i].attr('id') == null) addedArr[i].attr({'id':addedArr[i].attr('name'),'name':null});\n this.setHoverHandlers(addedArr[i]);\n if (global.isProductionPage){\n addedArr[i].off(\"mousedown\")\n .off(\"mousemove\")\n .off(\"mouseup\");\n addedArr[i].on(\"mousedown\", window.EventListeners.mouse_down)\n .on(\"mousemove\", window.EventListeners.mouse_move)\n .on(\"mouseup\", window.EventListeners.mouse_up);\n }\n }\n }\n if (window.loader && window.loader.is(':visible')) window.loader.hide();\n },\n\n removeTotaly: function(inst){\n inst.remove();\n $(inst.node).remove();\n },\n\n exportSVG: function () {\n this.setDefaultZoom();\n this.nodes.move(0, 0);\n this.setDefaultZoom();\n var exported = this.mainSVG.exportSvg({\n exclude: function () {\n return this.data('exclude') || global.editorObj.isEmptyBbox(this.bbox());\n },\n whitespace: '\\t'\n });\n var w = window.open();\n var wrapper = $('<pre>');\n $(w.document.body).append(wrapper);\n wrapper.text(exported);\n },\n\n isEmptyBbox: function(bbox){\n return bbox.x == 0 && bbox.y == 0 && bbox.x2 == 0 && bbox.y2 == 0;\n },\n\n addScene: function () {\n var sceneByIdLength = $('#scene').length,\n sceneByNameLength = $('[name=\"scene\"]').length;\n if (( sceneByIdLength > 0 || sceneByNameLength > 0 || this.scene) && confirm(\"Scene already exist. Do you want overwrite it ?\")) {\n this.removeScene();\n this.scene = this.createRectangle({width: 200, height: 100}).attr({\n 'id': 'scene',\n 'data-selectable': 'true'\n }).fill('yellow').addClass('imported');\n } else if (sceneByIdLength == 0 && sceneByNameLength == 0 && !this.scene) {\n this.scene = this.createRectangle({width: 200, height: 100}).attr({\n 'id': 'scene',\n 'data-selectable': 'true'\n }).fill('yellow').addClass('imported');\n }\n },\n\n removeScene: function () {\n var sceneById = $('#scene'),\n sceneByName = $('[name=\"scene\"]');\n if (sceneById.length > 0) {\n sceneById[0].instance.remove();\n sceneById.remove();\n delete this.scene;\n } else if (sceneByName.length > 0) {\n sceneByName[0].instance.remove();\n sceneByName.remove();\n delete this.scene;\n } else {\n alert(\"Scene is not added\");\n }\n },\n\n // check if ctrl key is pressed\n isCrlPressed: function () {\n if (global.keepPreviousSelected) global.editorObj.ctrlPressed = true;\n $(window).keydown(function (e) {\n if (e.keyCode == 46) global.editorObj.deleteImported($('.makroControl'));\n if ((e.ctrlKey && !this.isMac()) || (e.keyCode == 91 || e.keyCode == 93) && this.isMac()) {\n global.editorObj.ctrlPressed = true;\n }\n });\n $(window).keyup(function (e) {\n if ((e.keyCode == 17 && !this.isMac()) || (e.keyCode == 91 || e.keyCode == 93) && this.isMac()) {\n if (!global.keepPreviousSelected) global.editorObj.ctrlPressed = false;\n }\n });\n },\n\n\n // check if shift key is pressed\n isShiftPressed: function () {\n $(window).keydown(function (e) {\n if ((e.keyCode == 16 && !this.isMac()) || (e.keyCode == 91 || e.keyCode == 93) && this.isMac()) { // TODO check keycode for mac\n global.editorObj.shiftPressed = true;\n }\n });\n $(window).keyup(function (e) {\n if ((e.keyCode == 16 && !this.isMac()) || (e.keyCode == 91 || e.keyCode == 93) && this.isMac()) { // TODO check keycode for mac\n global.editorObj.shiftPressed = false;\n }\n });\n },\n\n\n // parse json data to object\n parseJson: function (json) {\n if (json.length != 0) return JSON.parse(json);\n return false;\n },\n\n // parse element id from net\n parseNetElementId: function (id) {\n if (id.length != 0) {\n var parsedId = {};\n var row = id.search(\"row\");\n var col = id.search(\"col\");\n var sector = id.search(\"sector\");\n parsedId.row = parseInt(id.substring(row + 3, col));\n parsedId.col = parseInt(id.substring(col + 3, sector));\n return parsedId;\n } else {\n console.log(\"Element id is empty\");\n return false;\n }\n },\n\n // load external data to editor\n setData: function (json, type) {\n var jsonObj = this.parseJson(json);\n if (!$.isEmptyObject(jsonObj)) {\n switch (type) {\n case \"netDump\": // json with data from net\n if (!$.isEmptyObject(jsonObj.scheme.cell.simple_cell)) {\n this.buildDefaultSeat(jsonObj.scheme.cell.simple_cell, jsonObj);\n }\n break;\n case \"visualDump\":\n if (jsonObj.scheme.visual) {\n this.setImport(jsonObj.scheme.visual, false);\n }\n if (!$.isEmptyObject(jsonObj.scheme.cell.simple_cell)) {\n this.buildDefaultSeat(jsonObj.scheme.cell.simple_cell, jsonObj);\n }\n break;\n case \"fun_zone\":\n if (!$.isEmptyObject(jsonObj.visual)) {\n if (jsonObj.visual) {\n this.setImport(jsonObj.visual, false);\n }\n } else {\n var fun_zone = this.createRectangle({\n fill: jsonObj.fill,\n width: jsonObj.visual.width || 400,\n height: jsonObj.visual.height || 200\n }).attr({'sector_id': jsonObj.sector_id, 'id': jsonObj.id, 'rx': 0}).data('type', jsonObj.type != undefined ? jsonObj.type : 2);\n if (!global.isPreviewPage) fun_zone.attr('data-selectable', 'true');\n global.createElementHandler(fun_zone);\n if (window.loader && window.loader.is(':visible')) window.loader.hide();\n }\n break;\n }\n } else {\n console.log(\"Loaded data is empty\");\n }\n\n },\n\n // build default seat from structure editor\n buildDefaultSeat: function (elementArray, jsonObj) {\n var elementsArray = [];\n var minRow = Number.MAX_VALUE;\n var maxRow = Number.MIN_VALUE;\n var minCol = Number.MAX_VALUE;\n var maxCol = Number.MIN_VALUE;\n for (var i = 0; i < elementArray.length; i++) {\n // find area for trimming from empty cells\n this.parseNetElementId(elementArray[i].id);\n elementsArray[i] = elementArray[i].id;\n var elRow = this.parseNetElementId(elementArray[i].id).row;\n var elCol = this.parseNetElementId(elementArray[i].id).col;\n minRow = (elRow < minRow) ? elRow : minRow;\n maxRow = (elRow > maxRow) ? elRow : maxRow;\n minCol = (elCol < minCol) ? elCol : minCol;\n maxCol = (elCol > maxCol) ? elCol : maxCol;\n }\n var elementsArrayLength = elementsArray.length;\n if (elementsArrayLength > 0) {\n for (var i = 0; i < elementsArrayLength; i++) {\n // create seats with right width and margins\n var seat = this.createRectangle({\n width: global.seatWidth,\n height: global.seatHeight,\n fill: elementArray[i].fill\n }).attr({'id': elementArray[i].id, 'sector_id': jsonObj.id}).data('type', elementArray[i].type);\n var seatRow = this.parseNetElementId(elementsArray[i]).row;\n var seatCol = this.parseNetElementId(elementsArray[i]).col;\n seat.x((global.seatWidth + global.seatMarginRight) * (Math.abs(seatCol - minCol)));\n seat.y((global.seatHeight + global.seatMarginBottom) * (Math.abs(seatRow - minRow)));\n if (global.editorObj.visualBox && !$.isEmptyObject(global.editorObj.visualBox)) {\n seat.x(seat.x() - global.editorObj.visualBox.minX);\n seat.y(seat.y() - global.editorObj.visualBox.minY);\n }\n if (!$.isEmptyObject(elementArray[i].price_info)) this.setPriceInfo(seat, elementArray[i].price_info);\n if (elementArray[i].label) seat.data('label', elementArray[i].label);\n if (elementArray[i].quote_id) seat.data('quote-id', elementArray[i].quote_id);\n if (elementArray[i].selectable) {\n seat.data('selectable', elementArray[i].selectable);\n } else {\n seat.data('selectable', \"false\");\n }\n this.setHoverHandlers(seat);\n global.createElementHandler(seat);\n }\n } else {\n console.log(\"There are no elements selected\");\n }\n if (window.loader && window.loader.is(':visible')) window.loader.hide();\n },\n\n // set price info\n setPriceInfo: function (seat, infoObj) {\n seat.data({\n 'price': infoObj.price,\n 'server_id': infoObj.server_id,\n 'status': infoObj.status\n }).attr('fill', infoObj.fill);\n if (!$.isEmptyObject(infoObj.partner)) { // array pf partners\n seat.data('partner_id', infoObj.partner);\n //seat.data('color', infoObj.color); TODO\n }\n if (seat.data('type') == 2) {\n seat.data({\n 'amount': infoObj.amount,\n 'count': infoObj.count,\n 'sold': infoObj.sold_count\n });\n }\n },\n\n // set hover handlers\n setHoverHandlers: function (el) {\n if (!global.isMobile) {\n el.on('mouseover', function () {\n if (!global.editorObj.dragSarted && (!global.dragMode || global.isProductionPage)) {\n var elLabel = el.data('label');\n if (elLabel && elLabel.length > 0) {\n global.editorObj.tooltipCont.text(elLabel).css({\n left: $(el.node).offset().left,\n top: $(el.node).offset().top - 30\n }).show();\n }\n }\n });\n el.on('mouseout', function () {\n if (global.editorObj.tooltipCont.is(':visible')) global.editorObj.tooltipCont.hide().text(\"\");\n });\n }\n },\n\n // initialize cont for elements labels\n createTooltip: function () {\n this.tooltipCont = $('<div class=\"tooltipCont\">');\n $('body').append(this.tooltipCont.hide());\n },\n\n // parse element id\n parseNetElementId: function (id) {\n if (id.length != 0) {\n var parsedId = {};\n var row = id.search(\"row\");\n var col = id.search(\"col\");\n var sector = id.search(\"sector\");\n parsedId.row = parseInt(id.substring(row + 3, col));\n parsedId.col = parseInt(id.substring(col + 3, sector));\n return parsedId;\n } else {\n console.log(\"Element id is empty\");\n return false;\n }\n },\n\n // get specific sector\n getSectorData: function (sector_id) {\n var visualDump = $('[sector_id=' + sector_id + ']');\n return visualDump;\n },\n\n // get all imported elements\n getImportedElements: function () {\n return global.container.find('.imported').add('#scene');\n },\n\n // delete imported elements\n deleteImported: function (exception) {\n var exc;\n if (exception && exception.length > 0) exc = exception;\n if (global.container.find('.imported').length > 0) {\n console.log(global.container.find('.imported').not(exc));\n global.container.find('.imported').not(exc).each(function () {\n global.editorObj.removeTotaly(this.instance);\n });\n }\n },\n\n // disable selecting html elements\n disableHtmlSelect: function (boolean) {\n if (boolean) {\n $('body').addClass('blocked');\n } else {\n $('body').removeClass('blocked');\n }\n },\n\n // change visibility of amount info block\n checkAmountBlockStatus: function (selectedElements) {\n if (selectedElements == null) {\n this.changeVisibility(this.amountInfoBlock, false);\n } else {\n if (typeof selectedElements == 'object') {\n var isFun = this.isJustFunZones(selectedElements);\n if (isFun) {\n this.setInfoToAmountBlock(selectedElements);\n this.changeVisibility(this.amountInfoBlock, true);\n } else {\n this.changeVisibility(this.amountInfoBlock, false);\n }\n }\n }\n },\n\n // update amount info block\n setInfoToAmountBlock: function (element) {\n var soldAmount = $('#sold_amount'),\n availableAmount = $('#available_amount'),\n totalAmount = $('#total_amount');\n if (element.length != undefined & element.length > 0) { // multiple selected elements\n var soldA = 0,\n totalA = 0,\n availableA = 0;\n element.each(function () {\n if (this.instance.data('type') == global.editorObj.IDD_FAN_ZONE) {\n soldA += parseInt(this.instance.data('sold'));\n totalA += parseInt(this.instance.data('count'));\n availableA += parseInt(this.instance.data('count')) - parseInt(this.instance.data('sold'));\n }\n });\n soldAmount.text(soldA);\n totalAmount.text(totalA);\n availableAmount.text(availableA);\n } else { // single selected element\n soldAmount.text(element.data('sold') || 0);\n totalAmount.text(element.data('count') || 0);\n availableAmount.text(parseInt(element.data('count')) - parseInt(element.data('sold')) || 0);\n }\n },\n\n // check if single selected element is fun zone\n isFunzone: function (element) {\n var elementType = element.data('type');\n var isFunZone = false;\n if (elementType == this.IDD_FAN_ZONE) {\n isFunZone = true;\n }\n return isFunZone;\n },\n\n // check if all selected elements are fun zones\n isJustFunZones: function (selectedElements) {\n var isFun = false;\n if (selectedElements.length != undefined && selectedElements.length > 0) { // multiple selected elements\n selectedElements.each(function () {\n if ($(this).data('type') == global.editorObj.IDD_FAN_ZONE) {\n isFun = true;\n return;\n }\n });\n } else { // single selected element\n isFun = this.isFunzone(selectedElements);\n }\n return isFun;\n },\n\n // change element visibility\n changeVisibility: function (element, visible) {\n if (visible) {\n if (element.css('visibility') == \"hidden\") element.css({\n opacity: 0.0,\n visibility: \"visible\"\n }).animate({opacity: 1.0});\n } else {\n if (element.css('visibility') == \"visible\") element.css({\n opacity: 1.0,\n visibility: \"hidden\"\n }).animate({opacity: 0.0});\n }\n },\n\n // get size of all elements box\n getVisualBox: function (getFrom) {\n var minX = 100000,\n minY = 100000,\n maxX = 0,\n maxY = 0,\n allEl;\n if (getFrom) { allEl = getFrom; } else { allEl = $('svg .imported, svg .native').not('.makroControl'); }\n allEl.each(function () {\n var elInst = this.instance;\n var elBox = elInst.bbox();\n if (elBox.x < minX) minX = elBox.x;\n if (elBox.y < minY) minY = elBox.y;\n if (elBox.x2 > maxX) maxX = elBox.x2;\n if (elBox.y2 > maxY) maxY = elBox.y2;\n /*if (minX < 0){\n maxX += Math.abs(minX);\n minX += Math.abs(minX);\n }\n if (maxX < 0){\n minX += Math.abs(maxX);\n maxX += Math.abs(maxX);\n }\n if (minY < 0){\n maxY += Math.abs(minY);\n minY += Math.abs(minY);\n }\n if (maxY < 0){\n minY += Math.abs(maxY);\n maxY += Math.abs(maxY);\n }*/\n });\n return {minX: Math.round(minX), minY: Math.round(minY), maxX: Math.round(maxX), maxY: Math.round(maxY)};\n },\n\n // set size of svg box depending on saved box from visual editor\n setVisualBox: function (box) {\n var cont = $(this.mainSVG.parent),\n w, h;\n if (box) {\n if (!$.isEmptyObject(box) && global.isPreviewPage) {\n w = box.maxX - box.minX + 40;\n h = box.maxY - box.minY + 40;\n cont.css({width: w, height: h});\n cont.attr({'data-width': w, 'data-height': h});\n this.visualBox = box;\n this.visualBox.minX -= 20;\n this.visualBox.minY -= 20;\n if (w < this.svgChildBlock.width()){\n this.disableWheelZoom = h < this.svgChildBlock.height();\n this.neededZoom = 1;\n }else{\n this.neededZoom = (this.svgChildBlock.outerWidth()) / cont.width();\n this.disableWheelZoom = false;\n }\n }\n } else {\n cont.css({width: 5000, height: 5000});\n cont.attr({'data-width': 5000, 'data-height': 5000});\n }\n this.checkDragControlsVisibility();\n },\n\n checkDragControlsVisibility: function () {\n if (!global.isMobile) {\n if (!global.isProductionPage){\n this.dragControlSelect.show();\n this.dragControlHand.show();\n }else{\n this.dragControlSelect.hide();\n this.dragControlHand.hide();\n }\n }\n },\n\n changeZoomControlsVisibility: function () {\n if (!global.isMobile) window.editor.editorObj.controlsCont.show();\n },\n\n setTrimmedZoom: function (customZoom) {\n if (global.isMobile && this.mobileInfo.systemName == 'Android' && this.mobileInfo.systemVersion <= 4.2){\n window.editor.editorObj.neededZoom = 0.4;\n $('head').prepend('<meta name=\"viewport\" content=\"width=device-width, minimum-scale=1.0 initial-scale=0, minimum-scale=0, maximum-scale=5.0\"/>');\n }\n if (customZoom != null) window.editor.editorObj.neededZoom = customZoom;\n if (window.editor.editorObj.neededZoom && window.editor.editorObj.neededZoom < 1) {\n var trimmedValue = window.editor.editorObj.neededZoom.toFixed(2);\n window.editor.editorObj.zoom = trimmedValue;\n window.editor.editorObj.zoomElements(trimmedValue);\n if (window.editor.editorObj.scaleControl) {\n window.editor.editorObj.scaleControl.val(trimmedValue);\n if (global.isProductionPage){\n //window.editor.editorObj.minZoom = trimmedValue;\n //window.editor.editorObj.scaleControl.attr('min', trimmedValue);\n }\n }\n } else {\n if (window.editor.editorObj.scaleControl && global.isProductionPage){\n //window.editor.editorObj.minZoom = 0.7;\n //window.editor.editorObj.scaleControl.attr('min', 0.7);\n }\n }\n },\n\n clearPreviousScheme: function(){\n this.svgParentNode.html('');\n $('#controls_cont').remove();\n $('#loader').remove();\n },\n\n createLoader: function(){\n window.loader = $('<div id=\"loader\">');\n this.svgChildBlock.prepend(window.loader);\n window.loader.show();\n },\n\n initialize: function () {\n this.clearPreviousScheme();\n this.createLoader();\n this.createEditor();\n }\n\n };\n\n global.editorObj.initialize();\n return global;\n\n}", "title": "" }, { "docid": "8bbea63ccee77accda05eee4f1b3efa0", "score": "0.5858024", "text": "function editor_generate(objname,userConfig) {\n// Default Settings\n\tvar config = new editor_defaultConfig(objname);\n\tif (userConfig) { \n\tfor (var thisName in userConfig) {\n\tif (userConfig[thisName]) { config[thisName] = userConfig[thisName]; }\n\t}\n}\ndocument.all[objname].config = config; // store config settings\n\n// set size to specified size or size of original object\n\tvar obj = document.all[objname];\n\tif (!config.width || config.width == \"auto\") {\n\tif (obj.style.width) { config.width = obj.style.width; } // use css style\n\telse if (obj.cols) { config.width = (obj.cols * 8) + 22; } // col width + toolbar\n\telse { config.width = '100%'; } // default\n\t}\n\t\n\tif (!config.height || config.height == \"auto\") {\n\tif (obj.style.height) { config.height = obj.style.height; } // use css style\n\telse if (obj.rows) { config.height = obj.rows * 17 } // row height\n\telse { config.height = '200'; } // default\n\t}\n\n\tvar tblOpen = '<table border=1 cellspacing=0 cellpadding=0 style=\"float: left;\" unselectable=\"on\"><tr><td style=\"border: none; padding: 1 0 0 0; font-family: MS Shell Dlg;\"><nobr>';\n\tvar tblClose = '</nobr></td></tr></table>\\n';\n\n// build button toolbar\n\tvar toolbar = '';\n\tvar btnGroup, btnItem, aboutEditor;\n\tfor (var btnGroup in config.toolbar){\n\n// linebreak\n\tif (config.toolbar[btnGroup].length == 1 &&\tconfig.toolbar[btnGroup][0].toLowerCase() == \"linebreak\") {\n\ttoolbar += '<br clear=\"all\">';\n\tcontinue;\n\t}\n\n\ttoolbar += tblOpen;\n\tfor (var btnItem in config.toolbar[btnGroup]) {\n\tvar btnName = config.toolbar[btnGroup][btnItem].toLowerCase();\n\n// formatblock inserted by lvn\n\tif (btnName == \"formatblock\") {\n\ttoolbar += '&nbsp;&nbsp;Format <select id=\"_' +objname+ '_FormatBlock\" onChange=\"editor_action(this.id)\" unselectable=\"on\" style=\"margin: 1 2 0 2; font-size: 12px;\">';\n\tfor (var i in config.formatblocks) {\n\tvar fbObj = config.formatblocks[i];\n\tvar fbvalue = \"\";\n\tvar fbname = \"\";\n\tfor (var j in fbObj.formatblocklangs) {\n\tvar fblangObj = fbObj.formatblocklangs[j];\n\tif (fblangObj.lang == config.systemLang[0]) {fbvalue = fblangObj.name;}\n\tif (fblangObj.lang == config.browserLang[0]) {fbname = fblangObj.name;}\n\t}\n\ttoolbar += '<option value=\"' +fbvalue+ '\">' + fbname + '</option>';\n\t}\n\ttoolbar += '</select>'; continue;\n\t}\n// end insert by lvn\n// fontname\n\tif (btnName == \"fontname\") {\n\ttoolbar += ' Font Name <select id=\"_' +objname+ '_FontName\" onChange=\"editor_action(this.id)\" unselectable=\"on\" style=\"margin: 1 2 0 2; font-size: 12px;\">';\n\tfor (var fontname in config.fontnames) {\n\ttoolbar += '<option value=\"' +config.fontnames[fontname]+ '\">' +fontname+ '</option>'\n\t}\n\ttoolbar += '</select>';\n\tcontinue;\n\t}\n\n// fontsize\n\tif (btnName == \"fontsize\") {\n\ttoolbar += '&nbsp;&nbsp;Font Size <select id=\"_' +objname+ '_FontSize\" onChange=\"editor_action(this.id)\" unselectable=\"on\" style=\"margin: 1 2 0 0; font-size: 12px;\">';\n\tfor (var fontsize in config.fontsizes) {\n\ttoolbar += '<option value=\"' +config.fontsizes[fontsize]+ '\">' +fontsize+ '</option>'\n\t}\n\ttoolbar += '</select>\\n';\n\tcontinue;\n\t}\n\n// font style\n\tif (btnName == \"fontstyle\") {\n\ttoolbar += '&nbsp;&nbsp;Font Style <select id=\"_' +objname+ '_FontStyle\" onChange=\"editor_action(this.id)\" unselectable=\"on\" style=\"margin: 1 2 0 0; font-size: 12px;\">';\n\t+ '<option value=\"\">Font Style</option>';\n\tfor (var i in config.fontstyles) {\n\tvar fontstyle = config.fontstyles[i];\n\ttoolbar += '<option value=\"' +fontstyle.className+ '\">' +fontstyle.name+ '</option>'\n\t}\n\t\ttoolbar += '</select>';\n\tcontinue;\n\t}\n// separator\n\tif (btnName == \"separator\") {\n\ttoolbar += '<span style=\"border: 1px inset; width: 1px; font-size: 16px; height: 16px; margin: 0 2 0 2\"></span>';\n\tcontinue;\n\t}\n// buttons\n\tvar btnObj = config.btnList[btnName];\n\tif (btnName == 'linebreak') { alert(\"htmlArea error: 'linebreak' must be in a subgroup by itself, not with other buttons.\\n\\nhtmlArea wysiwyg editor not created.\"); return; }\n\tif (!btnObj) { alert(\"htmlArea error: button '\" +btnName+ \"' not found in button list when creating the wysiwyg editor for '\"+objname+\"'.\\nPlease make sure you entered the button name correctly.\\n\\nhtmlArea wysiwyg editor not created.\"); return; }\n\tvar btnCmdID = btnObj[0];\n\tvar btnTitle = btnObj[1];\n\tvar btnOnClick = btnObj[2];\n\tvar btnImage = btnObj[3];\n\ttoolbar += '<button title=\"' +btnTitle+ '\" id=\"_' +objname+ '_' +btnCmdID+ '\" class=\"btn\" onClick=\"' +btnOnClick+ '\" onmouseover=\"if(this.className==\\'btn\\'){this.className=\\'btnOver\\'}\" onmouseout=\"if(this.className==\\'btnOver\\'){this.className=\\'btn\\'}\" unselectable=\"on\"><img src=\"' +config.imgURL + btnImage+ '\" border=0 unselectable=\"on\"></button>';\n\t} // end of button sub-group\n\ttoolbar += tblClose;\n\t} // end of entire button set\n\n// build editor\n\tvar editor = '<span id=\"_editor_toolbar\"><table border=1 cellspacing=0 cellpadding=0 bgcolor=\"buttonface\" style=\"padding: 1 0 0 2\" width=' + config.width + ' unselectable=\"on\"><tr><td>\\n'\n\t+ toolbar\n\t+ '</td></tr></table>\\n'\n\t+ '</td></tr></table></span>\\n'\n\t+ '<textarea ID=\"_' +objname + '_editor\" style=\"width:' +config.width+ '; height:' +config.height+ '; margin-top: -1px; margin-bottom: -1px;\" wrap=soft></textarea>';\n\n// add context menu\n editor += '<div id=\"_' +objname + '_cMenu\" style=\"position: absolute; visibility: hidden;\"></div>';\n\n// hide original textarea and insert htmlarea after it\n\tif (!config.debug) { document.all[objname].style.display = \"none\"; }\n\t\n\tif (config.plaintextInput) { // replace nextlines with breaks\n\tvar contents = document.all[objname].value;\n\tcontents = contents.replace(/\\r\\n/g, '<br>');\n\tcontents = contents.replace(/\\n/g, '<br>');\n\tcontents = contents.replace(/\\r/g, '<br>');\n\tdocument.all[objname].value = contents;\n\t}\n\n// insert wysiwyg\n document.all[objname].insertAdjacentHTML('afterEnd', editor)\n\n// convert htmlarea from textarea to wysiwyg editor\n editor_setmode(objname, 'init');\n\n// call filterOutput when user submits form\n\tfor (var idx=0; idx < document.forms.length; idx++) {\n\tvar r = document.forms[idx].attachEvent('onsubmit', function() { editor_filterOutput(objname); });\n\tif (!r) { alert(\"Error attaching event to form!\"); }\n\t}\n\treturn true;\n\t}", "title": "" }, { "docid": "acb32fb6cf4eb006d911075b6aea54a9", "score": "0.5816013", "text": "function KJSONEditor(struct, field, options_in)\n{\n\tvar jsoneditor = new Object();\n\n\tvar options = \n\t{\n\t\tparseonblur:true,\n\t\tlog: true,\n\t\teditable: 1,\n\t\tcopybutton:0,\n\t\ttype: \"json\" // can be json or jscode\n\t}\n\t$.extend(true, options, options_in);\n\n\tvar $container = $(\"<div class='KJSONEditor'></div>\")\n\t//var $codeCheck = $(\"<div class='modernbutton small green' style='position:absolute;top:0;right:0'><i class='fa fa-check'></i>validate code</div>\").click(function(){jsoneditor.JSONparse()}).appendTo($container);\n\n\tjsoneditor.$textarea = $(\"<textarea autocorrect='off' autocapitalize='off' spellcheck='false'>{a:1}</textarea>\").appendTo($container);\n\t\n\tif(!options.editable)\n\t\tjsoneditor.$textarea.attr('readonly', \"true\")\n\n\tjsoneditor.$log = $(\"<div class='KJSONEditor_log'></div>\").appendTo($container);\n\t//jsoneditor.$applybtn = $(\"<div class='modernbutton green'>Apply</div>\").appendTo($container);\n\n\n\tjsoneditor.$log = $(\"<div class='KJSONEditor_log'></div>\").appendTo($container);\n\n\tif(options.copybutton)\n\t{\n\t\tvar $copy= $(\"<div class='modernbutton small gray' style='position:absolute;top:0;right:10px'><i class='fa fa-copy'></i>copy top clipboard</div>\")\n\t\t\t.appendTo($container).click( function(){jsoneditor.copyText()} );\n\t}\n\n\n\tjsoneditor.copyText = function()\n\t{\n\t\tvar ta = jsoneditor.$textarea.get(0);\n\t\tjsoneditor.$textarea.focus();\n\t\tta.selectionStart = 0;\n\t\tta.selectionEnd = jsoneditor.$textarea.val().length; \n\t\tvar successful = document.execCommand('copy');\n\t\tta.selectionEnd = 0;\n\t\tif(successful)\n \t \t$.notify(\" Copied to clipboard\",\"success\");\n\n\t}\n\n\n\tjsoneditor.pasteText = function(content, selectCopied)\n\t{\n\t\tvar $ta = jsoneditor.$textarea;\n\t\tta = $ta.get(0);\n\t\t$ta.val($ta.val());\n\t\tvar s = ta.selectionEnd || $ta.val().length;\n\t\t//console.log(s);\n\t\t$ta.val($ta.val().substr(0, s) + \"\" + content + \"\" + $ta.val().substr(s+1));\n\t\tif(selectCopied)\n\t\t{\n\t\t\tta.selectionStart = s;\n\t\t\tta.selectionEnd = s + content.length;\n\t\t}\n\t\t$ta.focus();\n\t}\n\t\n\tjsoneditor.JSONstringify = function()\n\t{\n\t\tif(options.type !== \"jscode\")\n\t\t\tvar str = myJSONStringify(struct[field], \"\", 0);\n\t\telse\n\t\t\tvar str = struct[field];\n\t\t\t\n\t\tjsoneditor.$textarea.val(str);\n\t\treturn str;\n\t}\n\n\tjsoneditor.JSONparse = function(forceEval)\n\t{\n\t jsoneditor.$log.html(\"\");\n\t var ret = false;\n\t try\n\t { \n\t \t // keep comments and linebreaks: to be implemented\n// \t \t var txt = jsoneditor.$textarea.val();\n// \t\t\tvar pos = txt.indexOf(\"//\");\n// \t\t\tvar lastline;\n// \t\t\twhile(pos > -1) \n// \t\t\t{\n// \t\t\t\t pos = txt.indexOf(\"//\", pos+1);\n// \t\t\t}\n\t\t\tvar text = jsoneditor.$textarea.val() ;\n\t\t\t// JSON in javascript has the convention that all \\ must be escaped, otherwise they will be removed in eval\n\t\t\t// However, we want to be able to write \"lazy\" in the code, so escape \\ here manually.\n\t\t\t//text = text.replace(/\\\\/g , \"\\\\\\\\\");\n\t\t\t// but only single bslahes (not followed by another \\) and NOT \\\" (this is an escape seq)\n\t\t\ttext = text.replace(/(\\\\)(?=[^\\\\\"])/g , \"\\\\\\\\\");\n\t\t\t// escaped doble quotes \\\" in json need some special treatment ...?\n\t\t\t// text = text.replace(/\\\\\"/g , '\\\\\\\\\"');\n\t\t\tif(options.type !== \"jscode\")\n\t\t\t{\n\t\t\t\tif( struct[field] instanceof Array)\n\t\t\t\t\ttext = \"[\" + text + \"]\";\n\t\t\t\telse //if( struct[field] instanceof Object)\n\t\t\t\t\ttext = \"{\" + text + \"}\";\n\n\t\t\t\teval('var parsed = ' + text );\n\t\t\t\tstruct[field] = parsed;\n\t\t\t\tjsoneditor.JSONstringify();\n\t\t\t}\n\t\t\t// this will run the code directly. Difference is, that code is not an object or array, but does return\n\t\t\telse\n\t\t\t{\n\t\t\t\tstruct[field] = text;\n\t\t\t\tif(forceEval)\n\t\t\t\t\teval(text);\n\t\t\t}\n\t\t\tjsoneditor.$log.html(\"Code seems to be correct\").css('color','green');\n\t\t\tret = true;\n\t }\n\t catch(err)\n\t {\n\t\t jsoneditor.$log.html(\"Error: \" + err).css('color','red');\n\t\t //jsoneditor.JSONstringify();\n\t }\n\t return ret;\n\t}\n\t\n\tjsoneditor.getJSONtxt = function()\n\t{\n\t\treturn jsoneditor.$textarea.val();\n\t}\n\n\t// enable tab stops in textarea\n\tjsoneditor.$textarea.on(\"keydown\", function(e)\n\t{\n if(e.keyCode==9 || e.which==9){\n e.preventDefault();\n \tvar s = this.selectionStart;\n \tthis.value = this.value.substring(0,this.selectionStart) + \"\\t\" + this.value.substring(this.selectionEnd);\n \tthis.selectionEnd = s+1; \n }\n\n });\n\n\n\tjsoneditor.JSONstringify();\n\n\tif(options.parseonblur)\n\t\tjsoneditor.$textarea.on(\"blur\", function(){jsoneditor.JSONparse()} );\n\n\tjsoneditor.$container = $container; \n\treturn jsoneditor;\n}", "title": "" }, { "docid": "581e5c6cf74064ec63e715eab7a42206", "score": "0.5812715", "text": "openEditor(){\n window.System.openEditorForPart(this.model.id);\n }", "title": "" }, { "docid": "581e5c6cf74064ec63e715eab7a42206", "score": "0.5812715", "text": "openEditor(){\n window.System.openEditorForPart(this.model.id);\n }", "title": "" }, { "docid": "18e1b10f65887713b25e21214f0e04eb", "score": "0.5805511", "text": "function BaseEditor() {}", "title": "" }, { "docid": "7c54613d6f2e67b12a17007c2a3c563e", "score": "0.57839906", "text": "function editor_defaultConfig(objname) {\n\nthis.version = \"2.03.1\"\nthis.width = \"auto\";\nthis.height = \"auto\";\n//this.stylesheet = \"..\\CSSStyleSheet.css\"; // full URL to stylesheet\nthis.bodyStyle = 'background-color: white; font-family: \"Verdana\"; font-size: 9pt;';\nthis.tdStyle = 'font-family: \"Arial\"; font-size: 9pt;'; \nthis.bordersStyle = 'border:1px dotted #ff0000;height:20px';\nthis.marqueeStyle = 'border:1px dashed #0066FF;height:20px';\nthis.imgURL = _editor_url + 'images/';\nthis.debug = 0;\nthis.replaceNextlines = 0; // replace nextlines from spaces (on output)\nthis.plaintextInput = 0; // replace nextlines with breaks (on input)\nthis.toolbar = [\n//Font Related Tools\n ['fontname', 'fontsize','forecolor','backcolor'],\n//\t['fontstyle'],\n//\t['template'],\n//\t['linebreak'],\n\n//Help, about and mode switching\n//['help','htmlmode','popupeditor'],\n//['linebreak'],\n\n//Edit\n//\t['selectall','cut','copy','paste','delete'],['remove','undo','redo','find',],\n\n//Format Text Style\n\t['bold','italic','underline']\n// Format Text Alignment\n//\t['justifyleft','justifycenter','justifyright','justifyfull','justifynone'],\n//Format Text Block\n//\t['OrderedList','UnOrderedList','Outdent','Indent'],\n//\t['insertlink']\n\n//\t['linebreak'],\n\t\n//Persistent Buttons\n//\t['preview'],\n\n//Utility tools\n//\t['InsertImage','line','specchar','today','marquee'],\n\n//Insert/Modify Tools\t\n//Hyperlinks and Images\n//\t['insertlink','unlink','anchor'],\n//\t['multipleselect','liveresize']\n\n//Tables\n//\t['InsertTable','showborder','TableProperties',\n//Table Rows\n//\t'RowProperties'],['InsertRowBefore','InsertRowAfter','DeleteRow','SplitRow',\n//Table Columns\n//\t'InsertColumnBefore','InsertColumnAfter','DeleteColumn'],\n//Table Cells\n//\t['CellProperties','InsertCellBefore','InsertCellAfter','DeleteCell','SplitCell','MergeCells']\n\n ];\n\nthis.fontnames = {\n \"Arial\": \"arial, helvetica, sans-serif\",\n \"Courier New\": \"courier new, courier, mono\",\n \"Georgia\": \"Georgia, Times New Roman, Times, Serif\",\n \"Tahoma\": \"Tahoma, Arial, Helvetica, sans-serif\",\n \"Times New Roman\": \"times new roman, times, serif\",\n \"Verdana\": \"Verdana, Arial, Helvetica, sans-serif\",\n \"impact\": \"impact\",\n\t\"WingDings\": \"WingDings\"};\n\nthis.fontsizes = {\n \"1 (8 pt)\": \"1\",\n \"2 (10 pt)\": \"2\",\n \"3 (12 pt)\": \"3\",\n \"4 (14 pt)\": \"4\",\n \"5 (18 pt)\": \"5\",\n \"6 (24 pt)\": \"6\",\n \"7 (36 pt)\": \"7\"\n };\n// inserted by lvn\nthis.formatblocks = [\n {tag: \"\", \t\t formatblocklangs: [{lang: \"en\", name: \"Normal\"},\n {lang: \"nl\", name: \"Normaal\"}]},\n {tag: \"<address>\", formatblocklangs: [{lang: \"en\", name: \"Address\"},\n {lang: \"nl\", name: \"Adres\"}]},\n {tag: \"<dd>\", formatblocklangs: [{lang: \"en\", name: \"Definition\"},\n {lang: \"nl\", name: \"Definitie\"}]},\n {tag: \"<dt>\", formatblocklangs: [{lang: \"en\", name: \"Definition Term\"},\n {lang: \"nl\", name: \"Definitieterm\"}]},\n {tag: \"<ol>\", formatblocklangs: [{lang: \"en\", name: \"Numbered List\"},\n {lang: \"nl\", name: \"Genummerde lijst\"}]},\n {tag: \"<dir>\", formatblocklangs: [{lang: \"en\", name: \"Directory List\"},\n {lang: \"nl\", name: \"Inhoud\"}]},\n {tag: \"<h1>\", formatblocklangs: [{lang: \"en\", name: \"Heading 1\"},\n {lang: \"nl\", name: \"Kop 1\"}]},\n {tag: \"<h2>\", formatblocklangs: [{lang: \"en\", name: \"Heading 2\"},\n {lang: \"nl\", name: \"Kop 3\"}]},\n {tag: \"<h3>\", formatblocklangs: [{lang: \"en\", name: \"Heading 3\"},\n {lang: \"nl\", name: \"Kop 3\"}]},\n {tag: \"<h4>\", formatblocklangs: [{lang: \"en\", name: \"Heading 4\"},\n {lang: \"nl\", name: \"Kop 4\"}]},\n {tag: \"<h5>\", formatblocklangs: [{lang: \"en\", name: \"Heading 5\"},\n {lang: \"nl\", name: \"Kop 5\"}]},\n {tag: \"<ul>\", formatblocklangs: [{lang: \"en\", name: \"Bulleted List\"},\n {lang: \"nl\", name: \"Lijst met opsommingstekens\"}]},\n {tag: \"<menu>\", formatblocklangs: [{lang: \"en\", name: \"Menu List\"},\n {lang: \"nl\", name: \"Menulijst\"}]},\n {tag: \"<pre>\", formatblocklangs: [{lang: \"en\", name: \"Formatted\"},\n {lang: \"nl\", name: \"Met opmaak\"}]}\n]; \nthis.systemLang= navigator.systemLanguage.split(\"-\");\nthis.userLang = navigator.userLanguage.split(\"-\");\nthis.browserLang = navigator.userLanguage.split(\"-\");\nthis.showborders = true;\n// end insert by lvn\n\nthis.fontstyles = [ // make sure these exist in the header of page the content is being display as well in or they won't work!\n { name: \"headline\", className: \"headline\", classStyle: \"font-family: arial black, arial; font-size: 28px; letter-spacing: -2px;\" },\n { name: \"arial red\", className: \"headline2\", classStyle: \"font-family: arial black, arial; font-size: 12px; letter-spacing: -2px; color:red\" },\n { name: \"verdana blue\", className: \"headline4\", classStyle: \"font-family: verdana; font-size: 18px; letter-spacing: -2px; color:blue\" },\n];\n\nthis.btnList = {\n//\t buttonName: \t\tcommandID, title, \t\t\t\t\t\t\t\t\t\t\t\t onclick, image, \n//Row 1: Font Related Tools\n//Persistent Buttons\n//\t\"openword\": \t\t ['OpenWord', 'Open a Word Document', \t'editor_action(this.id)', 'ed_word.gif'],\n \"removefont\": \t\t ['RemoveFont', 'Remove all Fonts', \t\t'editor_action(this.id)', 'ed_removefont.gif'],\n// \"template\": \t \t ['template', 'Select a Template', \t'editor_action(this.id)', 'ed_template.gif'],\n// \"save\":\t\t\t\t ['save', \t \t\t\t 'Save This page on Your Computer', 'editor_action(this.id)', 'ed_save.gif'],\n\t\"htmlmode\": \t\t ['HtmlMode', 'View HTML Source', \t\t\t\t'editor_setmode(\\''+objname+'\\')', 'ed_html.gif'],\n \"popupeditor\": \t ['popupeditor', 'Enlarge Editor', \t\t\t\t'editor_action(this.id)', 'fullscreen_maximize.gif'],\n \"about\": \t\t ['about', 'About this editor', \t\t\t\t'editor_about(\\''+objname+'\\')', 'ed_about.gif'],\n \"help\": \t\t ['showhelp', \t 'Help', \t\t\t \t\t\t\t'editor_action(this.id)', 'ed_help.gif'],\n//Row 2: File, Edit, Format Tools\n//File\n// \t\"refresh\": \t ['Refresh', 'Clear Contents', \t\t'editor_action(this.id)', 'ed_refresh.gif'],\n// \"preview\": \t \t ['Preview', 'Preview', \t\t\t\t'editor_action(this.id)', 'ed_preview.gif'],\n// \"print\": \t \t ['Print', 'Print', \t\t\t\t'editor_action(this.id)', 'ed_print.gif'],\n//Edit\n\t\"selectall\": \t \t ['selectall', 'Select All', \t \t\t\t\t'editor_action(this.id)', 'ed_selectall.gif'],\n \"cut\": \t \t ['Cut', 'Cut', \t\t\t\t\t'editor_action(this.id)', 'ed_cut.gif'],\n \"copy\": \t \t ['Copy', 'Copy', \t\t\t\t'editor_action(this.id)', 'ed_copy.gif'],\n \"paste\": \t \t ['Paste', 'Paste', \t\t\t\t'editor_action(this.id)', 'ed_paste.gif'],\n \"delete\": \t \t ['delete', 'Delete Selection', \t\t\t\t'editor_action(this.id)', 'ed_delete.gif'],\n \"remove\": \t ['RemoveFormat', 'Remove Format in selected text', \t'editor_action(this.id)', 'ed_remove.gif'],\n \"undo\": \t ['Undo', 'Undo Ctrl+z', \t\t\t\t\t\t'editor_action(this.id)', 'ed_undo.gif'],\n \"redo\": \t ['Redo', 'Redo Ctrl+y', \t\t'editor_action(this.id)', 'ed_redo.gif'],\n \"find\": \t \t ['Find', 'Find', \t\t\t\t'editor_action(this.id)', 'ed_find.gif'],\n//Format Text Style\n\t\"bold\": \t ['Bold', 'Bold', \t\t\t\t'editor_action(this.id)', 'ed_format_bold.gif'],\n \"italic\": \t ['Italic', 'Italic', \t\t\t\t'editor_action(this.id)', 'ed_format_italic.gif'],\n \"underline\": \t ['Underline', 'Underline', \t\t\t\t'editor_action(this.id)', 'ed_format_underline.gif'],\n \"strikethrough\": \t ['StrikeThrough', 'Strikethrough', \t\t\t\t'editor_action(this.id)', 'ed_format_strike.gif'],\n \"subscript\": \t ['SubScript', 'Subscript', \t\t\t\t'editor_action(this.id)', 'ed_format_sub.gif'],\n \"superscript\": \t ['SuperScript', 'Superscript', \t\t\t\t'editor_action(this.id)', 'ed_format_sup.gif'],\n// Format Text Alignment\n\t\"justifyleft\": \t ['JustifyLeft', 'Justify Left', \t\t\t\t'editor_action(this.id)', 'ed_align_left.gif'],\n \"justifycenter\": \t ['JustifyCenter', 'Justify Center', \t\t\t\t'editor_action(this.id)', 'ed_align_center.gif'],\n \"justifyright\": \t ['JustifyRight', 'Justify Right', \t\t\t\t'editor_action(this.id)', 'ed_align_right.gif'],\n \"justifyfull\": \t ['JustifyFull', \t\t 'Justify Full', \t\t\t\t\t\t'editor_action(this.id)', 'ed_align_justify.gif'], \n\t\"justifynone\": \t ['JustifyNone', \t\t 'Remove Alignment', \t\t\t\t\t'editor_action(this.id)', 'ed_align_none.gif'], \n//Format Text Block\n\t\"orderedlist\": \t ['InsertOrderedList', 'Ordered List', \t\t\t\t'editor_action(this.id)', 'ed_list_num.gif'],\n \"unorderedlist\": \t ['InsertUnorderedList', 'Bulleted List', \t\t\t\t'editor_action(this.id)', 'ed_list_bullet.gif'],\n \"outdent\": \t ['Outdent', 'Decrease Indent', \t\t\t\t'editor_action(this.id)', 'ed_indent_less.gif'],\n \"indent\": \t ['Indent', 'Increase Indent', \t\t\t\t'editor_action(this.id)', 'ed_indent_more.gif'],\n \"forecolor\": \t ['ForeColor', 'Font Color', \t\t\t\t'editor_action(this.id)', 'ed_color_fg.gif'],\n \"backcolor\": \t ['BackColor', 'Background Color', \t\t\t\t'editor_action(this.id)', 'ed_color_bg.gif'],\n\n//#Row 3: Insert/Modify Tools\n\t\"insertlink\": \t ['insertlink', 'Hyperlink', \t\t\t\t\t\t'editor_action(this.id)', 'ed_link.gif']\n// end: custom buttons\n\n };\n\n// insert by lvn : check editor changes\nthis.checkChanges = 0;\n}", "title": "" }, { "docid": "8dc85ad6307fd7de6b60c7b227eff814", "score": "0.57653785", "text": "function editor_setmode(objname, mode) {\n var config = document.all[objname].config;\n var editor_obj = document.all[\"_\" +objname + \"_editor\"];\n\n // wait until document is fully loaded\n if (document.readyState != 'complete') {\n setTimeout(function() { editor_setmode(objname,mode) }, 25);\n return;\n }\n\n // define different editors\n var TextEdit = '<textarea ID=\"_' +objname + '_editor\" style=\"width:' +editor_obj.style.width+ '; height:' +editor_obj.style.height+ '; margin-top: -1px; margin-bottom: -1px;\"></textarea>';\n var RichEdit = '<iframe ID=\"_' +objname+ '_editor\" style=\"width:' +editor_obj.style.width+ '; height:' +editor_obj.style.height+ ';\"></iframe>';\n\n // src=\"' +_editor_url+ 'popups/blank.html\"\n\n //\n // Switch to TEXTEDIT mode\n //\n\n if (mode == \"textedit\" || editor_obj.tagName.toLowerCase() == 'iframe') {\n config.mode = \"textedit\";\n var editdoc = editor_obj.contentWindow.document;\n // inserted by lvn\n // show table borders\n nullBorders(editdoc,'hide');\n // end insert by lvn\n var contents = cleanHTML(editdoc.body.createTextRange().htmlText);\n editor_obj.outerHTML = TextEdit;\n editor_obj = document.all[\"_\" +objname + \"_editor\"];\n editor_obj.value = contents;\n editor_event(objname);\n // inserted by lvn\n if (config.showborders) {\n editor_updateToolbar(objname, \"disable\");\n config.showborders = true;\n } else {\n // end insert by lvn\n editor_updateToolbar(objname, \"disable\"); // disable toolbar items\n // insert by lvn\n }\n // end insert by lvn\n \n// set event handlers\n editor_obj.onkeydown = function() { editor_event(objname); }\n editor_obj.onkeypress = function() { editor_event(objname); }\n editor_obj.onkeyup = function() { editor_event(objname); }\n editor_obj.onmouseup = function() { editor_event(objname); }\n editor_obj.ondrop = function() { editor_event(objname, 100); } // these events fire before they occur\n editor_obj.oncut = function() { editor_event(objname, 100); }\n editor_obj.onpaste = function() { editor_event(objname, 100); }\n editor_obj.onblur = function() { editor_event(objname, -1); }\n\n editor_updateOutput(objname);\n editor_focus(editor_obj);\n }\n\n //\n // Switch to WYSIWYG mode\n //\n\n else {\n config.mode = \"wysiwyg\";\n var contents = editor_obj.value;\n if (mode == 'init') { contents = document.all[objname].value; } // on init use original textarea content\n\n // create editor\n editor_obj.outerHTML = RichEdit;\n editor_obj = document.all[\"_\" +objname + \"_editor\"];\n\n // get iframe document object\n\n // create editor contents (and default styles for editor)\n var html = \"\";\n html += '<html><head>\\n';\n if (config.stylesheet) {\n html += '<link href=\"' +config.stylesheet+ '\" rel=\"stylesheet\" type=\"text/css\">\\n';\n }\n html += '<style>\\n';\n html += 'body {' +config.bodyStyle+ '} \\n';\n html += 'td {' +config.tdStyle+ '} \\n';\n\thtml += '.borders {' +config.bordersStyle+ '} \\n';\n\thtml += 'MARQUEE {' +config.marqueeStyle+ '} \\n';\n for (var i in config.fontstyles) {\n var fontstyle = config.fontstyles[i];\n if (fontstyle.classStyle) {\n html += '.' +fontstyle.className+ ' {' +fontstyle.classStyle+ '}\\n';\n }\n }\n html += '</style>\\n'\n + '</head>\\n'\n + '<body contenteditable=\"true\" topmargin=1 leftmargin=1'\n\n// still working on this\n// updated by lvn: table actions (uncommented next line to show in popupmenu)\n\t //+ ' oncontextmenu=\"return false;\"'\n + ' oncontextmenu=\"parent.editor_cMenu_generate(window,\\'' +objname+ '\\');\"'\n +'>'\n + contents\n + '</body>\\n'\n + '</html>\\n';\n\n // write to editor window\n var editdoc = editor_obj.contentWindow.document;\n\n editdoc.open();\n editdoc.write(html);\n editdoc.close();\n \n\teditor_updateToolbar(objname, \"enable\"); // enable toolbar items\n\n // store objname under editdoc\n editdoc.objname = objname;\n\n // set event handlers\n editdoc.onkeydown = function() { editor_event(objname); }\n editdoc.onkeypress = function() { editor_event(objname); }\n editdoc.onkeyup = function() { editor_event(objname); }\n editdoc.onmouseup = function() { editor_event(objname); }\n editdoc.body.ondrop = function() { editor_event(objname, 100); } // these events fire before they occur\n editdoc.body.oncut = function() { editor_event(objname, 100); }\n editdoc.body.onpaste = function() { editor_event(objname, 100); }\n editdoc.body.onblur = function() { editor_event(objname, -1); }\n\n // inserted by lvn\n // show table borders\n\t\n\t// show table borders \n\tif (config.showborders) { \n\tnullBorders(editdoc,'show'); \n\tvar btnObj = document.all[\"_\" +objname+ \"_ShowBorder\"]; \n\tif(btnObj) { btnObj.className = 'btnDown'; } \n\t} \n\n // end insert by lvn\n\n// bring focus to editor. \n\t//Don't focus on page load, only on mode switch\n\tif (mode != 'init') {editor_focus(editor_obj);} \n\t// insert by lvn : check editor changes)\n\telse { \n\tif (config.checkChanges == 1) { \n\tvar localVar = getGlobalVar(\"objnames\");\n\tif (localVar == null){setGlobalVar(\"objnames\",objname);} \n\telse {\tlocalVar = localVar + ',' + objname; setGlobalVar(\"objnames\",localVar);}\n\t\n\tsetGlobalVar(\"_\" +objname + \"_initialText\",editdoc.body.innerHTML);\n\tif (window.onbeforeunload == null){window.onbeforeunload = function() {discardOnExit();}}\n\t}\n// end insert by lvn\n\t}\n\t}\n\n // Call update UI\n // don't update UI on page load, only on mode switch\n\tif (mode != 'init') {editor_event(objname);}\n\t}", "title": "" }, { "docid": "11d0004dc181af5d20866e2dcf950136", "score": "0.57650316", "text": "function nm_editor(str_op, str_form, str_field)\n{\n\n /* Quando existir mais de 1 textarea */\t\n if (document.getElementById('hid_txt_ativ') != null)\n {\n\tstr_field = document.getElementById('hid_txt_ativ').value;\n }\n\t\n\t\n txtarea = document.forms[str_form].elements[str_field];\n str_ins = '';\n /* Indentacao */\n if ('ind_inc' == str_op || 'ind_dec' == str_op)\n {\n if (nm_is_ie)\n {\n str_sel = document.selection.createRange().text;\n txtarea.focus();\n if ('' != str_sel)\n {\n nm_indent_ie(str_op);\n }\n }\n else if (txtarea.selectionEnd && txtarea.selectionEnd >= txtarea.selectionStart)\n {\n nm_indent_mozilla(str_op, txtarea.selectionStart, txtarea.selectionEnd);\n }\n }\n /* sc_btn_insert, sc_btn_update, sc_btn_delete, sc_btn_new,\n sc_before_insert, sc_before_update, sc_before_delete,\n sc_after_insert, sc_after_update, sc_after_delete\n -------------------------------------------------- */\n if ('sc_btn_insert' == str_op || 'sc_btn_update' == str_op || 'sc_btn_delete' == str_op || 'sc_btn_new' == str_op ||\n 'sc_before_insert' == str_op || 'sc_before_update' == str_op || 'sc_before_delete' == str_op ||\n 'sc_after_insert' == str_op || 'sc_after_update' == str_op || 'sc_after_delete' == str_op)\n {\n str_ins = str_op;\n }\n /* sc_btn_display\n -------------------------------------------------- */\n else if ('sc_btn_display' == str_op)\n {\n str_btn = prompt(var_msg_btndisplay_1, var_ex_botao);\n if (str_btn)\n {\n str_act = prompt(var_msg_btndisplay_2, var_ex_acao);\n if (str_act)\n {\n str_act = ('off' == str_act.toLowerCase()) ? 'off' : 'on';\n str_ins = 'sc_btn_display(\"' + str_btn + '\", \"' + str_act + '\");';\n } // str_act\n } // str_btn\n }\n /* sc_changed\n -------------------------------------------------- */\n else if ('sc_changed' == str_op)\n {\n str_cmp = prompt(var_msg_changed, var_ex_campo);\n if (str_cmp)\n {\n str_ins = 'sc_changed({' + str_cmp + '})';\n }\n }\n /* sc_confirm\n -------------------------------------------------- */\n else if ('sc_confirm' == str_op)\n {\n str_msg = prompt(var_msg_confirm, var_ex_msg);\n if (str_msg)\n {\n str_ins = 'sc_confirm(\"' + str_msg + '\");';\n }\n }\n /* sc_data\n -------------------------------------------------- */\n else if ('sc_data' == str_op)\n {\n str_cmp = prompt(var_msg_data_1, var_ex_campo);\n if (str_cmp)\n {\n str_fmt = prompt(var_msg_data_2, var_ex_formato);\n if (str_fmt)\n {\n str_opd = prompt(var_msg_data_3, var_ex_operador);\n if (str_opd)\n {\n str_dia = prompt(var_msg_data_4, var_ex_dias);\n if (str_dia)\n {\n str_mes = prompt(var_msg_data_5, var_ex_meses);\n if (str_mes)\n {\n str_ano = prompt(var_msg_data_6, var_ex_anos);\n if (str_ano)\n {\n str_ins = var_macro_data + '({' + str_cmp + '}, \"' + str_fmt + '\", \"' + str_opd + '\", ' + str_dia + ', ' + str_mes + ', ' + str_ano + ');';\n } // str_ano\n } // str_mes\n } // str_dia\n } // str_opd\n } // str_fmt\n } // str_cmp\n }\n /* sc_date_conv\n -------------------------------------------------- */\n else if ('sc_date_conv' == str_op)\n {\n str_cmp = prompt(var_msg_dateconv_1, var_ex_campo);\n if (str_cmp)\n {\n str_in = prompt(var_msg_dateconv_2, var_ex_formato);\n if (str_in)\n {\n str_out = prompt(var_msg_dateconv_2, var_ex_formato);\n if (str_out)\n {\n str_ins = 'sc_date_conv({' + str_cmp + '}, \"' + str_in + '\", \"' + str_out + '\");';\n } // str_out\n } // str_in\n } // str_cmp\n }\n /* sc_date_empty\n -------------------------------------------------- */\n else if ('sc_date_empty' == str_op)\n {\n str_cmp = prompt(var_msg_dateconv_1, var_ex_campo);\n if (str_cmp)\n {\n str_ins = 'sc_date_empty({' + str_cmp + '})';\n }\n }\n /* sc_erro_mensagem\n -------------------------------------------------- */\n else if ('sc_erro_mensagem' == str_op)\n {\n str_msg = prompt(var_msg_erromensagem, var_ex_msg);\n if (str_msg)\n {\n str_ins = var_macro_erro_msg + '(\"' + str_msg + '\");';\n }\n }\n /* sc_exec_sql\n -------------------------------------------------- */\n else if ('sc_exec_sql' == str_op)\n {\n str_sql = prompt(var_msg_execsql, var_ex_sql);\n if (str_sql)\n {\n str_ins = 'sc_exec_sql(\"' + str_sql + '\");';\n }\n }\n /* sc_exit\n -------------------------------------------------- */\n else if ('sc_exit' == str_op)\n {\n str_act = prompt(var_msg_exit_2, var_ex_exit_act);\n if (str_act)\n {\n str_act = ('R' == str_act.toUpperCase() || 'S' == str_act.toUpperCase()) ? str_act.toUpperCase() : 'V';\n str_ok = prompt(var_msg_exit_1, var_ex_ok);\n if (str_ok)\n {\n str_ok = ('N' == str_ok.toUpperCase()) ? 'N' : 'S';\n str_ins = 'sc_exit(';\n if ('R' == str_act)\n {\n str_ins += 'ref';\n }\n else if ('S' == str_act)\n {\n str_ins += 'sel';\n }\n else\n {\n str_ins += 'exit';\n }\n if ('S' == str_ok)\n {\n str_ins += ',ok';\n }\n str_ins += ');';\n }\n }\n }\n /* sc_image\n -------------------------------------------------- */\n else if ('sc_image' == str_op)\n {\n str_cnt = prompt(var_msg_image_1, var_ex_quantidade);\n if (str_cnt)\n {\n if (!nm_is_int(str_cnt) || 0 == str_cnt)\n {\n str_cnt = 1;\n }\n bol_imagem = true;\n for (i = 0; i < str_cnt && bol_imagem; i++)\n {\n str_img = prompt(var_msg_image_2 + (i + 1), var_ex_img);\n if (str_img)\n {\n if ('' != str_ins)\n {\n str_ins += ',';\n }\n str_ins += str_img;\n }\n else\n {\n bol_imagem = false;\n }\n }\n if (bol_imagem)\n {\n str_ins = 'sc_image(' + str_ins + ');';\n }\n else\n {\n str_ins = '';\n }\n }\n }\n /* sc_lookup\n -------------------------------------------------- */\n else if ('sc_lookup' == str_op)\n {\n str_ti = nm_tab_init();\n str_ds = prompt(var_msg_lookup_1, var_ex_dataset);\n if (str_ds)\n {\n str_sql = prompt(var_msg_lookup_2, var_ex_sql);\n if (str_sql)\n {\n str_errf = prompt(var_msg_lookup_3, var_ex_ok);\n if (str_errf)\n {\n bol_show = true;\n str_errf = ('N' == str_errf.toUpperCase()) ? 'N' : 'S';\n if ('S' == str_errf)\n {\n str_errm = prompt(var_msg_lookup_4, var_ex_msg);\n if (str_errm)\n {\n str_errb = prompt(var_msg_lookup_5, var_ex_ok);\n if (str_errb)\n {\n str_errb = ('N' == str_errb.toUpperCase()) ? 'N' : 'S';\n }\n else\n {\n bol_show = false;\n } // str_errb\n }\n else\n {\n bol_show = false;\n } // str_errm\n }\n if (bol_show)\n {\n str_eoff = prompt(var_msg_lookup_6, var_ex_ok);\n if (str_eoff)\n {\n str_eoff = ('N' == str_eoff.toUpperCase()) ? 'N' : 'S';\n if ('S' == str_eoff)\n {\n str_eofm = prompt(var_msg_lookup_7, var_ex_msg);\n if (!str_eofm)\n {\n bol_show = false;\n }\n }\n }\n else\n {\n bol_show = false;\n } // str_eoff\n if (bol_show)\n {\n str_ins = 'sc_lookup(' + str_ds + ', \"' + str_sql + '\");';\n if ('S' == str_errf)\n {\n str_ins += '\\n';\n str_ins += str_ti + 'if (FALSE === {' + str_ds + '}) ' + var_msg_lookup_8 + '\\n';\n str_ins += str_ti + '{\\n';\n str_ins += str_ti + ' sc_erro_mensagem(\"' + str_errm;\n if ('S' == str_errb)\n {\n str_ins += '<BR>\" . {' + str_ds + '_erro});\\n';\n }\n else\n {\n str_ins += '\");\\n';\n }\n str_ins += str_ti + '}';\n } // erro\n if ('S' == str_eoff)\n {\n str_ins += '\\n' + str_ti;\n if ('S' == str_errf)\n {\n str_ins += 'else';\n }\n str_ins += 'if (empty({' + str_ds + '})) ' + var_msg_lookup_9 + '\\n';\n str_ins += str_ti + '{\\n';\n str_ins += str_ti + ' sc_erro_mensagem(\"' + str_eofm + '\");\\n';\n str_ins += str_ti + '}';\n } // eof\n if ('S' == str_errf || 'S' == str_eoff)\n {\n str_ins += '\\n';\n str_ins += str_ti + 'else ' + var_msg_lookup_10 + '\\n';\n str_ins += str_ti + '{\\n';\n str_ins += str_ti + ' \\n';\n str_ins += str_ti + '}';\n }\n } // bol_show\n } // bol_show\n } // str_errf\n } // str_sql\n } // str_ds\n }\n /* sc_reset_global\n -------------------------------------------------- */\n else if ('sc_reset_global' == str_op)\n {\n str_cnt = prompt(var_msg_resetglobal_1, var_ex_quantidade);\n if (str_cnt)\n {\n if (!nm_is_int(str_cnt) || 0 == str_cnt)\n {\n str_cnt = 1;\n }\n bol_var = true;\n for (i = 0; i < str_cnt && bol_var; i++)\n {\n str_var = prompt(var_msg_resetglobal_2 + (i + 1), var_ex_var);\n if (str_var)\n {\n if ('' != str_ins)\n {\n str_ins += ',';\n }\n str_ins += '[' + str_var + ']';\n }\n else\n {\n bol_var = false;\n }\n }\n if (bol_var)\n {\n str_ins = 'sc_reset_global(' + str_ins + ');';\n }\n else\n {\n str_ins = '';\n }\n }\n }\n /* php: if\n -------------------------------------------------- */\n else if ('if' == str_op)\n {\n str_ti = nm_tab_init();\n str_cnd = prompt(var_msg_phpif_1, var_ex_condicao);\n if (str_cnd)\n {\n str_els = prompt(var_msg_phpif_2, var_ex_ok);\n if (str_els)\n {\n str_els = ('N' == str_els.toUpperCase()) ? 'N' : 'S';\n str_eif = prompt(var_msg_phpif_3, var_ex_elseif);\n if (str_eif)\n {\n if (!nm_is_int(str_eif))\n {\n str_eif = 0;\n }\n bol_show = true;\n str_ins = 'if (' + str_cnd + ')\\n';\n str_ins += str_ti + '{\\n';\n str_ins += str_ti + ' \\n';\n str_ins += str_ti + '}';\n for (i = 0; i < str_eif && bol_show; i++)\n {\n str_cnde = prompt(var_msg_phpif_4 + (i + 1), var_ex_condicao);\n if (str_cnde)\n {\n str_ins += '\\n';\n str_ins += str_ti + 'elseif (' + str_cnde + ')\\n';\n str_ins += str_ti + '{\\n';\n str_ins += str_ti + ' \\n';\n str_ins += str_ti + '}';\n }\n else\n {\n bol_show = false;\n }\n }\n if (bol_show)\n {\n if ('S' == str_els)\n {\n str_ins += '\\n';\n str_ins += str_ti + 'else\\n';\n str_ins += str_ti + '{\\n';\n str_ins += str_ti + ' \\n';\n str_ins += str_ti + '}';\n }\n }\n else\n {\n str_ins = '';\n } // bol_show\n } // str_eif\n } // str_els\n } // str_cnd\n }\n /* Insere comando */\n if ('' != str_ins)\n {\n if (nm_is_ie)\n {\n str_sel = document.selection.createRange().text;\n txtarea.focus();\n document.selection.createRange().text = str_ins;\n }\n else if (txtarea.selectionEnd && txtarea.selectionEnd >= txtarea.selectionStart)\n {\n str_bef = txtarea.value.substr(0, txtarea.selectionStart);\n str_sel = txtarea.value.substr(txtarea.selectionStart, txtarea.selectionEnd - txtarea.selectionStart);\n str_aft = txtarea.value.substr(txtarea.selectionEnd);\n txtarea.value = str_bef + str_ins + str_aft;\n }\n }\n}", "title": "" }, { "docid": "5abf664d558f0e4f28e07e031a3131da", "score": "0.5762228", "text": "function display_editor(editor,buttonList, addReturns,justCount){\n\t// old removed\n}", "title": "" }, { "docid": "e408839da842e56f437560a041e2dbc1", "score": "0.5746376", "text": "function compCode_20160614_155450() {\r\rapp.beginUndoGroup(\"oven\");\r\rtry {\r\r// Create Folder hierarchy\r\tvar zcompcodescripts_folder = getItem(\"Z_Compcode_Scripts\", FolderItem, app.project.rootFolder);\r\tif (zcompcodescripts_folder === null) {\r\t\tzcompcodescripts_folder = app.project.items.addFolder(\"Z_Compcode_Scripts\");\r\t}\r\tvar kitchen_folder = getItem(\"Kitchen\", FolderItem, zcompcodescripts_folder);\r\tif (kitchen_folder === null) {\r\t\tkitchen_folder = app.project.items.addFolder(\"Kitchen\");\r\t\tkitchen_folder.parentFolder = zcompcodescripts_folder;\r\t}\r\tvar out_folder = getItem(\"OUT\", FolderItem, kitchen_folder);\r\tif (out_folder === null) {\r\t\tout_folder = app.project.items.addFolder(\"OUT\");\r\t\tout_folder.parentFolder = kitchen_folder;\r\t}\r\tvar precomps_folder = getItem(\"PreComps\", FolderItem, kitchen_folder);\r\tif (precomps_folder === null) {\r\t\tprecomps_folder = app.project.items.addFolder(\"PreComps\");\r\t\tprecomps_folder.parentFolder = kitchen_folder;\r\t}\r\r// Create Compositions\r\tvar oven_comp = app.project.items.addComp(\"oven\", 412, 412, 1, 2.8, 25);\r\t\toven_comp.time = 2.76;\r\t\toven_comp.bgColor = [0,0,0];\r\t\toven_comp.parentFolder = out_folder;\r\tvar ovenanimation_comp = getItem(\"oven_animation\", CompItem, precomps_folder);\r\tvar ovenanimation_comp_populate = false;\r\tif (ovenanimation_comp === null) {\r\t\tovenanimation_comp = app.project.items.addComp(\"oven_animation\", 412, 412, 1, 2.8, 25);\r\t\tovenanimation_comp.time = 2.76;\r\t\tovenanimation_comp.bgColor = [0,0,0];\r\t\tovenanimation_comp.parentFolder = precomps_folder;\r\t\tovenanimation_comp_populate = true;\r\t}\r\r// Working with comp \"oven\", varName \"oven_comp\";\r\toven_comp.openInViewer();\r\t// Add existing composition \"oven_animation\", varName \"ovenanimation_comp\";\r\tvar ovenanimation = oven_comp.layers.add(ovenanimation_comp);\r\t\tovenanimation.collapseTransformation = true;\r\t\tovenanimation.motionBlur = true;\r\t\tovenanimation.moveToEnd();\r\t\tovenanimation.selected = false;\r\t// Add Shape Layer \"Icon_bg_mask\", varName \"iconbgmask\";\r\tvar iconbgmask = oven_comp.layers.addShape();\r\t\ticonbgmask.name = \"Icon_bg_mask\";\r\t\ticonbgmask.enabled = false;\r\t\ticonbgmask.motionBlur = true;\r\t\ticonbgmask.moveToEnd();\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).name = \"chemicals Outlines - Group 22\";\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).addProperty(\"ADBE Vector Group\");\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).name = \"Group 22\";\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar iconbgmaskPath = iconbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\tvar iconbgmaskPath_newShape = new Shape();\r\t\t\ticonbgmaskPath_newShape.vertices = [[144, 0], [0, 144], [-144, 0], [0, -144]];\r\t\t\ticonbgmaskPath_newShape.inTangents = [[0, -79.5289916992188], [79.5289916992188, 0], [0, 79.5289916992188], [-79.5290069580078, 0]];\r\t\t\ticonbgmaskPath_newShape.outTangents = [[0, 79.5289916992188], [-79.5290069580078, 0], [0, -79.5289916992188], [79.5289916992188, 0]];\r\t\t\ticonbgmaskPath_newShape.closed = true;\r\t\ticonbgmaskPath.setValue(iconbgmaskPath_newShape);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).addProperty(\"ADBE Vector Graphic - Stroke\");\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(2).property(\"ADBE Vector Stroke Color\").setValue([0,0,0,1]);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(2).property(\"ADBE Vector Stroke Width\").setValue(12);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(2).property(\"ADBE Vector Stroke Line Cap\").setValue(2);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(2).property(\"ADBE Vector Stroke Line Join\").setValue(2);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(3).property(\"ADBE Vector Position\").setValue([206,206]);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(3).property(\"ADBE Vector Anchor\").setValue([206,206]);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(3).property(\"ADBE Vector Position\").setValue([206,206]);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).name = \"chemicals Outlines - Group 23\";\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).property(2).addProperty(\"ADBE Vector Group\");\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).name = \"Group 23\";\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar iconbgmaskPath = iconbgmask.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\tvar iconbgmaskPath_newShape = new Shape();\r\t\t\ticonbgmaskPath_newShape.vertices = [[144, 0], [0, 144], [-144, 0], [0, -144]];\r\t\t\ticonbgmaskPath_newShape.inTangents = [[0, -79.5289916992188], [79.5289916992188, 0], [0, 79.5289916992188], [-79.5290069580078, 0]];\r\t\t\ticonbgmaskPath_newShape.outTangents = [[0, 79.5289916992188], [-79.5290069580078, 0], [0, -79.5289916992188], [79.5289916992188, 0]];\r\t\t\ticonbgmaskPath_newShape.closed = true;\r\t\ticonbgmaskPath.setValue(iconbgmaskPath_newShape);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).addProperty(\"ADBE Vector Graphic - Fill\");\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).property(2).property(\"ADBE Vector Fill Color\").setValue([0.14100000718061,0.67099998324525,0.88999998803232,1]);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(3).property(\"ADBE Vector Position\").setValue([206,206]);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).property(3).property(\"ADBE Vector Anchor\").setValue([206,206]);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).property(3).property(\"ADBE Vector Position\").setValue([206,206]);\r\t\ticonbgmask.property(\"ADBE Transform Group\").property(\"ADBE Anchor Point\").setValue([206,206,0]);\r\t\tvar iconbgmaskScale = iconbgmask.property(\"ADBE Transform Group\").property(\"ADBE Scale\");\r\t\t\tvar iconbgmaskScale_keyTimesArray = [0,0.4,2.4,2.76];\r\t\t\tvar iconbgmaskScale_valuesArray = [[0,0,100],[100,100,100],[100,100,100],[0,0,100]];\r\t\t\ticonbgmaskScale.setValuesAtTimes(iconbgmaskScale_keyTimesArray, iconbgmaskScale_valuesArray);\r\t\t\tvar iconbgmaskScale_easeInSpeedArray = [[0,0,0],[0,0,0],[0,0,0],[0,0,0]];\r\t\t\tvar iconbgmaskScale_easeInInfluArray = [[50,50,50],[50,50,50],[50,50,50],[50,50,50]];\r\t\t\tvar iconbgmaskScale_easeOutSpeedArray = [[0,0,0],[0,0,0],[0,0,0],[0,0,0]];\r\t\t\tvar iconbgmaskScale_easeOutInfluArray = [[50,50,50],[50,50,50],[50,50,50],[50,50,50]];\r\t\t\tvar iconbgmaskScale_keyInInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tvar iconbgmaskScale_keyOutInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tapplyEasing(iconbgmaskScale, iconbgmaskScale_keyTimesArray, [iconbgmaskScale_easeInSpeedArray, iconbgmaskScale_easeInInfluArray], [iconbgmaskScale_easeOutSpeedArray, iconbgmaskScale_easeOutInfluArray], [iconbgmaskScale_keyInInterpolationType, iconbgmaskScale_keyOutInterpolationType]);\r\r\t\ticonbgmask.selected = false;\r\t// Add existing composition \"oven_animation\", varName \"ovenanimation_comp\";\r\tvar shadow = oven_comp.layers.add(ovenanimation_comp);\r\t\tshadow.name = \"shadow\";\r\t\tshadow.collapseTransformation = true;\r\t\tshadow.motionBlur = true;\r\t\tshadow.moveToEnd();\r\t\tshadow.trackMatteType = TrackMatteType.ALPHA;\r\t\tshadow.property(\"ADBE Effect Parade\").addProperty(\"ADBE Fill\");\r\t\tshadow.property(\"ADBE Effect Parade\").property(1).property(\"ADBE Fill-0002\").setValue([0,0,0,1]);\r\t\tvar shadowPosition = shadow.property(\"ADBE Transform Group\").property(\"ADBE Position\");\r\t\t\tvar shadowPosition_keyTimesArray = [0.28,0.6,2.2,2.48];\r\t\t\tvar shadowPosition_valuesArray = [[206,206,0],[227.5,218.5,0],[227.5,218.5,0],[206,206,0]];\r\t\t\tshadowPosition.setValuesAtTimes(shadowPosition_keyTimesArray, shadowPosition_valuesArray);\r\t\t\tvar shadowPosition_inSpatialTangents = [[-3.58333325386047,-2.08333325386047,0],[-3.58333325386047,-2.08333325386047,0],[0,0,0],[3.58333325386047,2.08333325386047,0]];\r\t\t\tvar shadowPosition_outSpatialTangents = [[3.58333325386047,2.08333325386047,0],[0,0,0],[-3.58333325386047,-2.08333325386047,0],[-3.58333325386047,-2.08333325386047,0]];\r\t\t\tapplySpatialTangents(shadowPosition, shadowPosition_keyTimesArray, shadowPosition_inSpatialTangents, shadowPosition_outSpatialTangents);\r\t\t\tvar shadowPosition_easeInSpeedArray = [0,0,0,0];\r\t\t\tvar shadowPosition_easeInInfluArray = [16.666666667,50,50,16.666666667];\r\t\t\tvar shadowPosition_easeOutSpeedArray = [0,0,0,0];\r\t\t\tvar shadowPosition_easeOutInfluArray = [50,16.666666667,16.666666667,50];\r\t\t\tvar shadowPosition_keyInInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tvar shadowPosition_keyOutInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tapplyEasing(shadowPosition, shadowPosition_keyTimesArray, [shadowPosition_easeInSpeedArray, shadowPosition_easeInInfluArray], [shadowPosition_easeOutSpeedArray, shadowPosition_easeOutInfluArray], [shadowPosition_keyInInterpolationType, shadowPosition_keyOutInterpolationType]);\r\r\t\tshadow.property(\"ADBE Transform Group\").property(\"ADBE Opacity\").setValue(20);\r\t\tshadow.selected = false;\r\t// Add Shape Layer \"Icon_bg\", varName \"iconbg\";\r\tvar iconbg = oven_comp.layers.addShape();\r\t\ticonbg.name = \"Icon_bg\";\r\t\ticonbg.motionBlur = true;\r\t\ticonbg.moveToEnd();\r\t\ticonbg.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).name = \"chemicals Outlines - Group 22\";\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).addProperty(\"ADBE Vector Group\");\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).name = \"Group 22\";\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar iconbgPath = iconbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\tvar iconbgPath_newShape = new Shape();\r\t\t\ticonbgPath_newShape.vertices = [[144, 0], [0, 144], [-144, 0], [0, -144]];\r\t\t\ticonbgPath_newShape.inTangents = [[0, -79.5289916992188], [79.5289916992188, 0], [0, 79.5289916992188], [-79.5290069580078, 0]];\r\t\t\ticonbgPath_newShape.outTangents = [[0, 79.5289916992188], [-79.5290069580078, 0], [0, -79.5289916992188], [79.5289916992188, 0]];\r\t\t\ticonbgPath_newShape.closed = true;\r\t\ticonbgPath.setValue(iconbgPath_newShape);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).addProperty(\"ADBE Vector Graphic - Stroke\");\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(2).property(\"ADBE Vector Stroke Color\").setValue([0,0,0,1]);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(2).property(\"ADBE Vector Stroke Width\").setValue(12);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(2).property(\"ADBE Vector Stroke Line Cap\").setValue(2);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(2).property(\"ADBE Vector Stroke Line Join\").setValue(2);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(3).property(\"ADBE Vector Position\").setValue([206,206]);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(3).property(\"ADBE Vector Anchor\").setValue([206,206]);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(3).property(\"ADBE Vector Position\").setValue([206,206]);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).name = \"chemicals Outlines - Group 23\";\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(2).addProperty(\"ADBE Vector Group\");\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).name = \"Group 23\";\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar iconbgPath = iconbg.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\tvar iconbgPath_newShape = new Shape();\r\t\t\ticonbgPath_newShape.vertices = [[144, 0], [0, 144], [-144, 0], [0, -144]];\r\t\t\ticonbgPath_newShape.inTangents = [[0, -79.5289916992188], [79.5289916992188, 0], [0, 79.5289916992188], [-79.5290069580078, 0]];\r\t\t\ticonbgPath_newShape.outTangents = [[0, 79.5289916992188], [-79.5290069580078, 0], [0, -79.5289916992188], [79.5289916992188, 0]];\r\t\t\ticonbgPath_newShape.closed = true;\r\t\ticonbgPath.setValue(iconbgPath_newShape);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).addProperty(\"ADBE Vector Graphic - Fill\");\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).property(2).property(\"ADBE Vector Fill Color\").setValue([0.1410000026226,0.6710000038147,0.88999998569489,1]);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).property(2).property(\"ADBE Vector Fill Opacity\").setValue(60);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(3).property(\"ADBE Vector Position\").setValue([206,206]);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(3).property(\"ADBE Vector Anchor\").setValue([206,206]);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(3).property(\"ADBE Vector Position\").setValue([206,206]);\r\t\ticonbg.property(\"ADBE Transform Group\").property(\"ADBE Anchor Point\").setValue([206,206,0]);\r\t\tvar iconbgScale = iconbg.property(\"ADBE Transform Group\").property(\"ADBE Scale\");\r\t\t\tvar iconbgScale_keyTimesArray = [0,0.4,2.4,2.76];\r\t\t\tvar iconbgScale_valuesArray = [[0,0,100],[100,100,100],[100,100,100],[0,0,100]];\r\t\t\ticonbgScale.setValuesAtTimes(iconbgScale_keyTimesArray, iconbgScale_valuesArray);\r\t\t\tvar iconbgScale_easeInSpeedArray = [[0,0,0],[0,0,0],[0,0,0],[0,0,0]];\r\t\t\tvar iconbgScale_easeInInfluArray = [[50,50,50],[50,50,50],[50,50,50],[50,50,50]];\r\t\t\tvar iconbgScale_easeOutSpeedArray = [[0,0,0],[0,0,0],[0,0,0],[0,0,0]];\r\t\t\tvar iconbgScale_easeOutInfluArray = [[50,50,50],[50,50,50],[50,50,50],[50,50,50]];\r\t\t\tvar iconbgScale_keyInInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tvar iconbgScale_keyOutInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tapplyEasing(iconbgScale, iconbgScale_keyTimesArray, [iconbgScale_easeInSpeedArray, iconbgScale_easeInInfluArray], [iconbgScale_easeOutSpeedArray, iconbgScale_easeOutInfluArray], [iconbgScale_keyInInterpolationType, iconbgScale_keyOutInterpolationType]);\r\r\t\ticonbg.selected = false;\r// Working with comp \"oven_animation\", varName \"ovenanimation_comp\";\rif (ovenanimation_comp_populate === true) {\r\t// Add Shape Layer \"Layer 6 Outlines 3\", varName \"layer6Outlines3\";\r\tvar layer6Outlines3 = ovenanimation_comp.layers.addShape();\r\t\tlayer6Outlines3.name = \"Layer 6 Outlines 3\";\r\t\tlayer6Outlines3.startTime = -10.6;\r\t\tlayer6Outlines3.outPoint = 10.88;\r\t\tlayer6Outlines3.inPoint = 0;\r\t\tlayer6Outlines3.outPoint = 10.88;\r\t\tlayer6Outlines3.motionBlur = true;\r\t\tlayer6Outlines3.moveToEnd();\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(1).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar layer6Outlines3Path = layer6Outlines3.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\tvar layer6Outlines3Path_newShape = new Shape();\r\t\t\tlayer6Outlines3Path_newShape.vertices = [[5.93505859375, -0.00001525878906], [0, 5.93501281738281], [-5.93505859375, -0.00001525878906], [0, -5.93501281738281]];\r\t\t\tlayer6Outlines3Path_newShape.inTangents = [[0, -3.27799987792969], [3.2779541015625, 0], [0, 3.27803039550781], [-3.2779541015625, 0]];\r\t\t\tlayer6Outlines3Path_newShape.outTangents = [[0, 3.27803039550781], [-3.2779541015625, 0], [0, -3.27799987792969], [3.2779541015625, 0]];\r\t\t\tlayer6Outlines3Path_newShape.closed = true;\r\t\tlayer6Outlines3Path.setValue(layer6Outlines3Path_newShape);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(1).property(2).addProperty(\"ADBE Vector Graphic - Fill\");\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(1).property(2).property(2).property(\"ADBE Vector Fill Color\").setValue([0.90196078431373,0.90196078431373,0.90196078431373,1]);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(1).property(3).property(\"ADBE Vector Position\").setValue([661.195983886719,88.5741653442383]);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(2).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar layer6Outlines3Path = layer6Outlines3.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\tvar layer6Outlines3Path_newShape = new Shape();\r\t\t\tlayer6Outlines3Path_newShape.vertices = [[5.93505859375, -0.00001525878906], [0, 5.93501281738281], [-5.93505859375, -0.00001525878906], [0, -5.93501281738281]];\r\t\t\tlayer6Outlines3Path_newShape.inTangents = [[0, -3.27799987792969], [3.2779541015625, 0], [0, 3.27803039550781], [-3.2779541015625, 0]];\r\t\t\tlayer6Outlines3Path_newShape.outTangents = [[0, 3.27803039550781], [-3.2779541015625, 0], [0, -3.27799987792969], [3.2779541015625, 0]];\r\t\t\tlayer6Outlines3Path_newShape.closed = true;\r\t\tlayer6Outlines3Path.setValue(layer6Outlines3Path_newShape);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(2).property(2).addProperty(\"ADBE Vector Graphic - Fill\");\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(2).property(2).property(2).property(\"ADBE Vector Fill Color\").setValue([0.90196078431373,0.90196078431373,0.90196078431373,1]);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(2).property(3).property(\"ADBE Vector Position\").setValue([751.693664550781,88.5741653442383]);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(3).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar layer6Outlines3Path = layer6Outlines3.property(\"ADBE Root Vectors Group\").property(3).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\tvar layer6Outlines3Path_newShape = new Shape();\r\t\t\tlayer6Outlines3Path_newShape.vertices = [[5.93505859375, -0.00001525878906], [0, 5.93501281738281], [-5.93505859375, -0.00001525878906], [0, -5.93501281738281]];\r\t\t\tlayer6Outlines3Path_newShape.inTangents = [[0, -3.27799987792969], [3.2779541015625, 0], [0, 3.27803039550781], [-3.2779541015625, 0]];\r\t\t\tlayer6Outlines3Path_newShape.outTangents = [[0, 3.27803039550781], [-3.2779541015625, 0], [0, -3.27799987792969], [3.2779541015625, 0]];\r\t\t\tlayer6Outlines3Path_newShape.closed = true;\r\t\tlayer6Outlines3Path.setValue(layer6Outlines3Path_newShape);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(3).property(2).addProperty(\"ADBE Vector Graphic - Fill\");\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(3).property(2).property(2).property(\"ADBE Vector Fill Color\").setValue([0.90196078431373,0.90196078431373,0.90196078431373,1]);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(3).property(3).property(\"ADBE Vector Position\").setValue([735.465026855469,88.5741653442383]);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(4).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar layer6Outlines3Path = layer6Outlines3.property(\"ADBE Root Vectors Group\").property(4).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\tvar layer6Outlines3Path_newShape = new Shape();\r\t\t\tlayer6Outlines3Path_newShape.vertices = [[-33.4714965820312, -0.00001525878906], [-33.4714965820312, -0.00001525878906], [-30.0905151367188, 3.38101196289062], [30.0914916992188, 3.38101196289062], [33.4714965820312, -0.00001525878906], [30.0914916992188, -3.38101196289062], [-30.0905151367188, -3.38101196289062]];\r\t\t\tlayer6Outlines3Path_newShape.inTangents = [[0, -1.86698913574219], [0, 0], [-1.8670654296875, 0], [0, 0], [0, 1.86701965332031], [1.866943359375, 0], [0, 0]];\r\t\t\tlayer6Outlines3Path_newShape.outTangents = [[0, 0], [0, 1.86701965332031], [0, 0], [1.866943359375, 0], [0, -1.86698913574219], [0, 0], [-1.8670654296875, 0]];\r\t\t\tlayer6Outlines3Path_newShape.closed = true;\r\t\tlayer6Outlines3Path.setValue(layer6Outlines3Path_newShape);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(4).property(2).addProperty(\"ADBE Vector Graphic - Fill\");\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(4).property(2).property(2).property(\"ADBE Vector Fill Color\").setValue([0,0,0,1]);\r\t\tvar layer6Outlines3Position = layer6Outlines3.property(\"ADBE Root Vectors Group\").property(4).property(3).property(\"ADBE Vector Position\");\r\t\t\tvar layer6Outlines3Position_keyTimesArray = [0.6,1,1.8,2.2];\r\t\t\tvar layer6Outlines3Position_valuesArray = [[706.087890625,112.842460632324],[706.087890625,120.842460632324],[706.087890625,120.842460632324],[706.087890625,112.842460632324]];\r\t\t\tlayer6Outlines3Position.setValuesAtTimes(layer6Outlines3Position_keyTimesArray, layer6Outlines3Position_valuesArray);\r\t\t\tvar layer6Outlines3Position_inSpatialTangents = [[0,-1.33333337306976],[0,-1.33333337306976],[0,0],[0,1.33333337306976]];\r\t\t\tvar layer6Outlines3Position_outSpatialTangents = [[0,1.33333337306976],[0,0],[0,-1.33333337306976],[0,-1.33333337306976]];\r\t\t\tapplySpatialTangents(layer6Outlines3Position, layer6Outlines3Position_keyTimesArray, layer6Outlines3Position_inSpatialTangents, layer6Outlines3Position_outSpatialTangents);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(5).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar layer6Outlines3Path = layer6Outlines3.property(\"ADBE Root Vectors Group\").property(5).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\tvar layer6Outlines3Path_newShape = new Shape();\r\t\t\tlayer6Outlines3Path_newShape.vertices = [[645.374572753906, 103.164657592773], [766.374572753906, 103.164657592773]];\r\t\t\tlayer6Outlines3Path_newShape.closed = false;\r\t\tlayer6Outlines3Path.setValue(layer6Outlines3Path_newShape);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(5).property(2).addProperty(\"ADBE Vector Graphic - Stroke\");\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(5).property(2).property(2).property(\"ADBE Vector Stroke Color\").setValue([0,0,0,1]);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(5).property(2).property(2).property(\"ADBE Vector Stroke Width\").setValue(3);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(5).property(2).property(2).property(\"ADBE Vector Stroke Miter Limit\").setValue(10);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(5).property(3).property(\"ADBE Vector Anchor\").setValue([706.25,103]);\r\t\tvar layer6Outlines3Position = layer6Outlines3.property(\"ADBE Root Vectors Group\").property(5).property(3).property(\"ADBE Vector Position\");\r\t\t\tvar layer6Outlines3Position_keyTimesArray = [0.6,1,1.8,2.2];\r\t\t\tvar layer6Outlines3Position_valuesArray = [[706.25,103],[706.25,106],[706.25,106],[706.25,103]];\r\t\t\tlayer6Outlines3Position.setValuesAtTimes(layer6Outlines3Position_keyTimesArray, layer6Outlines3Position_valuesArray);\r\t\t\tvar layer6Outlines3Position_inSpatialTangents = [[0,-0.5],[0,-0.5],[0,0],[0,0.5]];\r\t\t\tvar layer6Outlines3Position_outSpatialTangents = [[0,0.5],[0,0],[0,-0.5],[0,-0.5]];\r\t\t\tapplySpatialTangents(layer6Outlines3Position, layer6Outlines3Position_keyTimesArray, layer6Outlines3Position_inSpatialTangents, layer6Outlines3Position_outSpatialTangents);\r\t\t\tvar layer6Outlines3Position_easeInSpeedArray = [0,0,0,0];\r\t\t\tvar layer6Outlines3Position_easeInInfluArray = [16.666666667,60,60,16.666666667];\r\t\t\tvar layer6Outlines3Position_easeOutSpeedArray = [0,0,0,0];\r\t\t\tvar layer6Outlines3Position_easeOutInfluArray = [30,16.666666667,16.666666667,30];\r\t\t\tvar layer6Outlines3Position_keyInInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tvar layer6Outlines3Position_keyOutInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tapplyEasing(layer6Outlines3Position, layer6Outlines3Position_keyTimesArray, [layer6Outlines3Position_easeInSpeedArray, layer6Outlines3Position_easeInInfluArray], [layer6Outlines3Position_easeOutSpeedArray, layer6Outlines3Position_easeOutInfluArray], [layer6Outlines3Position_keyInInterpolationType, layer6Outlines3Position_keyOutInterpolationType]);\r\r\t\tvar layer6Outlines3Scale = layer6Outlines3.property(\"ADBE Root Vectors Group\").property(5).property(3).property(\"ADBE Vector Scale\");\r\t\t\tvar layer6Outlines3Scale_keyTimesArray = [0.6,1,1.8,2.2];\r\t\t\tvar layer6Outlines3Scale_valuesArray = [[100,100],[106,204],[106,204],[100,100]];\r\t\t\tlayer6Outlines3Scale.setValuesAtTimes(layer6Outlines3Scale_keyTimesArray, layer6Outlines3Scale_valuesArray);\r\t\t\tvar layer6Outlines3Scale_easeInSpeedArray = [[0,0],[0,0],[0,0],[0,0]];\r\t\t\tvar layer6Outlines3Scale_easeInInfluArray = [[16.666666667,16.666666667],[60,60],[60,60],[16.666666667,16.666666667]];\r\t\t\tvar layer6Outlines3Scale_easeOutSpeedArray = [[0,0],[0,0],[0,0],[0,0]];\r\t\t\tvar layer6Outlines3Scale_easeOutInfluArray = [[30,30],[16.666666667,16.666666667],[16.666666667,16.666666667],[30,30]];\r\t\t\tvar layer6Outlines3Scale_keyInInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tvar layer6Outlines3Scale_keyOutInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tapplyEasing(layer6Outlines3Scale, layer6Outlines3Scale_keyTimesArray, [layer6Outlines3Scale_easeInSpeedArray, layer6Outlines3Scale_easeInInfluArray], [layer6Outlines3Scale_easeOutSpeedArray, layer6Outlines3Scale_easeOutInfluArray], [layer6Outlines3Scale_keyInInterpolationType, layer6Outlines3Scale_keyOutInterpolationType]);\r\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(6).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar layer6Outlines3Path = layer6Outlines3.property(\"ADBE Root Vectors Group\").property(6).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\t\tvar layer6Outlines3Path_keyTimesArray = [0.6, 1, 1.8, 2.2];\r\t\t\tvar layer6Outlines3Path_object = {};\r\t\t\t\tlayer6Outlines3Path_object.closed = true;\r\t\t\t\tlayer6Outlines3Path_object.vertices = [[[-60.1814575195312, -36.7020111083984], [-60.2374725341797, -14.3086090087891], [-60.2374725341797, -10.30859375], [-60.1814575195312, 36.7020111083984], [-53.2694702148438, 43.6150054931641], [53.2694702148438, 43.6150054931641], [60.1814575195312, 36.7020111083984], [60.2383575439453, -9.80860900878906], [60.2383575439453, -14.30859375], [60.1814575195312, -36.7020111083984], [53.2694702148438, -43.6150054931641], [-53.2694702148438, -43.6150054931641]], [[-60.1814575195312, -36.7020111083984], [-60.2374725341797, -10.4961090087891], [-63.9874725341797, -10.30859375], [-60.1814575195312, 36.7020111083984], [-53.2694702148438, 43.6150054931641], [53.2694702148438, 43.6150054931641], [60.1814575195312, 36.7020111083984], [63.9883575439453, -9.80860900878906], [60.2383575439453, -10.49609375], [60.1814575195312, -36.7020111083984], [53.2694702148438, -43.6150054931641], [-53.2694702148438, -43.6150054931641]], [[-60.1814575195312, -36.7020111083984], [-60.2374877929688, -10.4961090087891], [-63.9874877929688, -10.30859375], [-60.1814575195312, 36.7020111083984], [-53.2694702148438, 43.6150054931641], [53.2694702148438, 43.6150054931641], [60.1814575195312, 36.7020111083984], [63.9883422851562, -9.80860900878906], [60.2383422851562, -10.49609375], [60.1814575195312, -36.7020111083984], [53.2694702148438, -43.6150054931641], [-53.2694702148438, -43.6150054931641]], [[-60.1814575195312, -36.7020111083984], [-60.2374877929688, -14.30859375], [-60.2374877929688, -10.30859375], [-60.1814575195312, 36.7020111083984], [-53.2694702148438, 43.6150054931641], [53.2694702148438, 43.6150054931641], [60.1814575195312, 36.7020111083984], [60.2383422851562, -9.80860900878906], [60.2383422851562, -14.30859375], [60.1814575195312, -36.7020111083984], [53.2694702148438, -43.6150054931641], [-53.2694702148438, -43.6150054931641]]];\r\t\t\t\tlayer6Outlines3Path_object.inTangents = [[[0, -3.8179931640625], [0, 0], [0, 0], [0, 0], [-3.8170166015625, 0], [0, 0], [0, 3.8179931640625], [0, 0], [0, 0], [0, 0], [3.8170166015625, 0], [0, 0]], [[0, -3.8179931640625], [0, 0], [0, 0], [0, 0], [-3.8170166015625, 0], [0, 0], [0, 3.8179931640625], [0, 0], [0, 0], [0, 0], [3.8170166015625, 0], [0, 0]], [[0, -3.8179931640625], [0, 0], [0, 0], [0, 0], [-3.8170166015625, 0], [0, 0], [0, 3.8179931640625], [0, 0], [0, 0], [0, 0], [3.8170166015625, 0], [0, 0]], [[0, -3.8179931640625], [0, 0], [0, 0], [0, 0], [-3.8170166015625, 0], [0, 0], [0, 3.8179931640625], [0, 0], [0, 0], [0, 0], [3.8170166015625, 0], [0, 0]]];\r\t\t\t\tlayer6Outlines3Path_object.outTangents = [[[0, 0], [0, 0], [0, 0], [0, 3.8179931640625], [0, 0], [3.8170166015625, 0], [0, 0], [0, 0], [0, 0], [0, -3.8179931640625], [0, 0], [-3.8170166015625, 0]], [[0, 0], [0, 0], [0, 0], [0, 3.8179931640625], [0, 0], [3.8170166015625, 0], [0, 0], [0, 0], [0, 0], [0, -3.8179931640625], [0, 0], [-3.8170166015625, 0]], [[0, 0], [0, 0], [0, 0], [0, 3.8179931640625], [0, 0], [3.8170166015625, 0], [0, 0], [0, 0], [0, 0], [0, -3.8179931640625], [0, 0], [-3.8170166015625, 0]], [[0, 0], [0, 0], [0, 0], [0, 3.8179931640625], [0, 0], [3.8170166015625, 0], [0, 0], [0, 0], [0, 0], [0, -3.8179931640625], [0, 0], [-3.8170166015625, 0]]];\r\t\t\taddShapeKeyframes(layer6Outlines3Path, layer6Outlines3Path_keyTimesArray, layer6Outlines3Path_object);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(6).property(2).addProperty(\"ADBE Vector Graphic - Stroke\");\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(6).property(2).property(2).property(\"ADBE Vector Stroke Color\").setValue([0,0,0,1]);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(6).property(2).property(2).property(\"ADBE Vector Stroke Width\").setValue(4);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(6).property(2).property(2).property(\"ADBE Vector Stroke Line Cap\").setValue(2);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(6).property(2).property(2).property(\"ADBE Vector Stroke Line Join\").setValue(2);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(6).property(3).property(\"ADBE Vector Position\").setValue([706.088134765625,116.223258972168]);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(7).name = \"Group 10\";\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(7).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar layer6Outlines3Path = layer6Outlines3.property(\"ADBE Root Vectors Group\").property(7).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\tvar layer6Outlines3Path_newShape = new Shape();\r\t\t\tlayer6Outlines3Path_newShape.vertices = [[-60.1814575195312, -36.7020111083984], [-60.0107574462891, -12.0480041503906], [60.3521575927734, -12.0480041503906], [60.1814575195312, -36.7020111083984], [53.2694702148438, -43.6150054931641], [-53.2694702148438, -43.6150054931641]];\r\t\t\tlayer6Outlines3Path_newShape.inTangents = [[0, -3.8179931640625], [0, 0], [0, 0], [0, 0], [3.8170166015625, 0], [0, 0]];\r\t\t\tlayer6Outlines3Path_newShape.outTangents = [[0, 0], [0, 0], [0, 0], [0, -3.8179931640625], [0, 0], [-3.8170166015625, 0]];\r\t\t\tlayer6Outlines3Path_newShape.closed = true;\r\t\tlayer6Outlines3Path.setValue(layer6Outlines3Path_newShape);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(7).property(2).addProperty(\"ADBE Vector Graphic - Fill\");\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(7).property(2).property(2).property(\"ADBE Vector Fill Color\").setValue([0.30196078431373,0.30196078431373,0.30196078431373,1]);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(7).property(3).property(\"ADBE Vector Position\").setValue([706.088134765625,116.223258972168]);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(8).name = \"Group 7\";\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(8).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar layer6Outlines3Path = layer6Outlines3.property(\"ADBE Root Vectors Group\").property(8).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\t\tvar layer6Outlines3Path_keyTimesArray = [0.6, 1, 1.8, 2.2];\r\t\t\tvar layer6Outlines3Path_object = {};\r\t\t\t\tlayer6Outlines3Path_object.closed = true;\r\t\t\t\tlayer6Outlines3Path_object.vertices = [[[-60.1814575195312, -36.7020111083984], [-60.3235626220703, -10.80859375], [-60.4312286376953, -5.80833435058594], [-60.1814575195312, 36.7020111083984], [-53.2694702148438, 43.6150054931641], [53.2694702148438, 43.6150054931641], [60.1814575195312, 36.7020111083984], [60.1737518310547, -5.55848693847656], [60.2660675048828, -10.5585784912109], [60.1814575195312, -36.7020111083984], [53.2694702148438, -43.6150054931641], [-53.2694702148438, -43.6150054931641]], [[-60.1814575195312, -36.7020111083984], [-60.3235626220703, -10.80859375], [-64.1812286376953, -10.3083343505859], [-60.1814575195312, 36.7020111083984], [-53.2694702148438, 43.6150054931641], [53.2694702148438, 43.6150054931641], [60.1814575195312, 36.7020111083984], [63.9237518310547, -10.0584869384766], [60.2660675048828, -10.5585784912109], [60.1814575195312, -36.7020111083984], [53.2694702148438, -43.6150054931641], [-53.2694702148438, -43.6150054931641]], [[-60.1814575195312, -36.7020111083984], [-60.3235473632812, -10.80859375], [-64.1812133789062, -10.3083343505859], [-60.1814575195312, 36.7020111083984], [-53.2694702148438, 43.6150054931641], [53.2694702148438, 43.6150054931641], [60.1814575195312, 36.7020111083984], [63.9237670898438, -10.0584869384766], [60.26611328125, -10.5585784912109], [60.1814575195312, -36.7020111083984], [53.2694702148438, -43.6150054931641], [-53.2694702148438, -43.6150054931641]], [[-60.1814575195312, -36.7020111083984], [-60.3235473632812, -10.80859375], [-60.4312133789062, -5.80833435058594], [-60.1814575195312, 36.7020111083984], [-53.2694702148438, 43.6150054931641], [53.2694702148438, 43.6150054931641], [60.1814575195312, 36.7020111083984], [60.1737060546875, -5.55848693847656], [60.2660522460938, -10.5585784912109], [60.1814575195312, -36.7020111083984], [53.2694702148438, -43.6150054931641], [-53.2694702148438, -43.6150054931641]]];\r\t\t\t\tlayer6Outlines3Path_object.inTangents = [[[0, -3.8179931640625], [0, 0], [0, 0], [0, 0], [-3.8170166015625, 0], [0, 0], [0, 3.8179931640625], [0, 0], [0, 0], [0, 0], [3.8170166015625, 0], [0, 0]], [[0, -3.8179931640625], [0, 0], [0, 0], [0, 0], [-3.8170166015625, 0], [0, 0], [0, 3.8179931640625], [0, 0], [0, 0], [0, 0], [3.8170166015625, 0], [0, 0]], [[0, -3.8179931640625], [0, 0], [0, 0], [0, 0], [-3.8170166015625, 0], [0, 0], [0, 3.8179931640625], [0, 0], [0, 0], [0, 0], [3.8170166015625, 0], [0, 0]], [[0, -3.8179931640625], [0, 0], [0, 0], [0, 0], [-3.8170166015625, 0], [0, 0], [0, 3.8179931640625], [0, 0], [0, 0], [0, 0], [3.8170166015625, 0], [0, 0]]];\r\t\t\t\tlayer6Outlines3Path_object.outTangents = [[[0, 0], [0, 0], [0, 0], [0, 3.8179931640625], [0, 0], [3.8170166015625, 0], [0, 0], [0, 0], [0, 0], [0, -3.8179931640625], [0, 0], [-3.8170166015625, 0]], [[0, 0], [0, 0], [0, 0], [0, 3.8179931640625], [0, 0], [3.8170166015625, 0], [0, 0], [0, 0], [0, 0], [0, -3.8179931640625], [0, 0], [-3.8170166015625, 0]], [[0, 0], [0, 0], [0, 0], [0, 3.8179931640625], [0, 0], [3.8170166015625, 0], [0, 0], [0, 0], [0, 0], [0, -3.8179931640625], [0, 0], [-3.8170166015625, 0]], [[0, 0], [0, 0], [0, 0], [0, 3.8179931640625], [0, 0], [3.8170166015625, 0], [0, 0], [0, 0], [0, 0], [0, -3.8179931640625], [0, 0], [-3.8170166015625, 0]]];\r\t\t\taddShapeKeyframes(layer6Outlines3Path, layer6Outlines3Path_keyTimesArray, layer6Outlines3Path_object);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(8).property(2).addProperty(\"ADBE Vector Graphic - Fill\");\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(8).property(2).property(2).property(\"ADBE Vector Fill Color\").setValue([1,1,1,1]);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(8).property(3).property(\"ADBE Vector Position\").setValue([706.088134765625,116.223258972168]);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(9).name = \"Group 8\";\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(9).enabled = false;\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(9).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar layer6Outlines3Path = layer6Outlines3.property(\"ADBE Root Vectors Group\").property(9).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\tvar layer6Outlines3Path_newShape = new Shape();\r\t\t\tlayer6Outlines3Path_newShape.vertices = [[97.3724975585938, -0.00001525878906], [0.00042724609375, 97.3720092773438], [-97.3724975585938, -0.00001525878906], [0.00042724609375, -97.3720092773438]];\r\t\t\tlayer6Outlines3Path_newShape.inTangents = [[0, -53.7769927978516], [53.7769775390625, 0], [0, 53.7770233154297], [-53.7779541015625, 0]];\r\t\t\tlayer6Outlines3Path_newShape.outTangents = [[0, 53.7770233154297], [-53.7779541015625, 0], [0, -53.7769927978516], [53.7769775390625, 0]];\r\t\t\tlayer6Outlines3Path_newShape.closed = true;\r\t\tlayer6Outlines3Path.setValue(layer6Outlines3Path_newShape);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(9).property(2).addProperty(\"ADBE Vector Graphic - Stroke\");\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(9).property(2).property(2).property(\"ADBE Vector Stroke Color\").setValue([0,0,0,1]);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(9).property(2).property(2).property(\"ADBE Vector Stroke Width\").setValue(8.11400032043457);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(9).property(2).property(2).property(\"ADBE Vector Stroke Line Cap\").setValue(2);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(9).property(2).property(2).property(\"ADBE Vector Stroke Line Join\").setValue(2);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(9).property(3).property(\"ADBE Vector Position\").setValue([705.9189453125,117.656959533691]);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(10).name = \"Group 9\";\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(10).enabled = false;\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(10).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar layer6Outlines3Path = layer6Outlines3.property(\"ADBE Root Vectors Group\").property(10).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\tvar layer6Outlines3Path_newShape = new Shape();\r\t\t\tlayer6Outlines3Path_newShape.vertices = [[97.3724975585938, -0.00001525878906], [0.00042724609375, 97.3720092773438], [-97.3724975585938, -0.00001525878906], [0.00042724609375, -97.3720092773438]];\r\t\t\tlayer6Outlines3Path_newShape.inTangents = [[0, -53.7769927978516], [53.7769775390625, 0], [0, 53.7770233154297], [-53.7779541015625, 0]];\r\t\t\tlayer6Outlines3Path_newShape.outTangents = [[0, 53.7770233154297], [-53.7779541015625, 0], [0, -53.7769927978516], [53.7769775390625, 0]];\r\t\t\tlayer6Outlines3Path_newShape.closed = true;\r\t\tlayer6Outlines3Path.setValue(layer6Outlines3Path_newShape);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(10).property(2).addProperty(\"ADBE Vector Graphic - Fill\");\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(10).property(2).property(2).property(\"ADBE Vector Fill Color\").setValue([0.14100000718061,0.67099998324525,0.88999998803232,1]);\r\t\tlayer6Outlines3.property(\"ADBE Root Vectors Group\").property(10).property(3).property(\"ADBE Vector Position\").setValue([705.9189453125,117.656959533691]);\r\t\tlayer6Outlines3.property(\"ADBE Transform Group\").property(\"ADBE Anchor Point\").setValue([705.9189453125,117.656959533691,0]);\r\t\tvar layer6Outlines3Scale = layer6Outlines3.property(\"ADBE Transform Group\").property(\"ADBE Scale\");\r\t\t\tvar layer6Outlines3Scale_keyTimesArray = [0.2,0.6,2.2,2.6];\r\t\t\tvar layer6Outlines3Scale_valuesArray = [[0,0,100],[148.026989260851,148.026989260851,100],[148.026989260851,148.026989260851,100],[0,0,100]];\r\t\t\tlayer6Outlines3Scale.setValuesAtTimes(layer6Outlines3Scale_keyTimesArray, layer6Outlines3Scale_valuesArray);\r\t\t\tvar layer6Outlines3Scale_easeInSpeedArray = [[0,0,0],[0,0,0],[0,0,0],[0,0,0]];\r\t\t\tvar layer6Outlines3Scale_easeInInfluArray = [[16.666666667,16.666666667,16.666666667],[60,60,60],[60,60,60],[16.666666667,16.666666667,16.666666667]];\r\t\t\tvar layer6Outlines3Scale_easeOutSpeedArray = [[0,0,0],[0,0,0],[0,0,0],[0,0,0]];\r\t\t\tvar layer6Outlines3Scale_easeOutInfluArray = [[30,30,30],[16.666666667,16.666666667,16.666666667],[16.666666667,16.666666667,16.666666667],[16.666666667,16.666666667,16.666666667]];\r\t\t\tvar layer6Outlines3Scale_keyInInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tvar layer6Outlines3Scale_keyOutInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tapplyEasing(layer6Outlines3Scale, layer6Outlines3Scale_keyTimesArray, [layer6Outlines3Scale_easeInSpeedArray, layer6Outlines3Scale_easeInInfluArray], [layer6Outlines3Scale_easeOutSpeedArray, layer6Outlines3Scale_easeOutInfluArray], [layer6Outlines3Scale_keyInInterpolationType, layer6Outlines3Scale_keyOutInterpolationType]);\r\r\t\tlayer6Outlines3.selected = false;\r\t// Add Shape Layer \"chemicals_animation\", varName \"chemicalsanimation\";\r\tvar chemicalsanimation = ovenanimation_comp.layers.addShape();\r\t\tchemicalsanimation.name = \"chemicals_animation\";\r\t\tchemicalsanimation.enabled = false;\r\t\tchemicalsanimation.motionBlur = true;\r\t\tchemicalsanimation.moveToEnd();\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(1).name = \"Group 3\";\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(1).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).name = \"Path 5\";\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(\"ADBE Vector Shape Direction\").setValue(3);\r\t\tvar chemicalsanimationPath = chemicalsanimation.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\tvar chemicalsanimationPath_newShape = new Shape();\r\t\t\tchemicalsanimationPath_newShape.vertices = [[178, 206], [195, 206]];\r\t\t\tchemicalsanimationPath_newShape.closed = false;\r\t\tchemicalsanimationPath.setValue(chemicalsanimationPath_newShape);\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(1).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(1).property(2).property(2).name = \"Path 4\";\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(1).property(2).property(2).property(\"ADBE Vector Shape Direction\").setValue(3);\r\t\tvar chemicalsanimationPath = chemicalsanimation.property(\"ADBE Root Vectors Group\").property(1).property(2).property(2).property(\"ADBE Vector Shape\");\r\t\tvar chemicalsanimationPath_newShape = new Shape();\r\t\t\tchemicalsanimationPath_newShape.vertices = [[171, 219], [188, 219]];\r\t\t\tchemicalsanimationPath_newShape.closed = false;\r\t\tchemicalsanimationPath.setValue(chemicalsanimationPath_newShape);\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(1).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(1).property(2).property(3).name = \"Path 3\";\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(1).property(2).property(3).property(\"ADBE Vector Shape Direction\").setValue(3);\r\t\tvar chemicalsanimationPath = chemicalsanimation.property(\"ADBE Root Vectors Group\").property(1).property(2).property(3).property(\"ADBE Vector Shape\");\r\t\tvar chemicalsanimationPath_newShape = new Shape();\r\t\t\tchemicalsanimationPath_newShape.vertices = [[164, 232], [182, 232]];\r\t\t\tchemicalsanimationPath_newShape.closed = false;\r\t\tchemicalsanimationPath.setValue(chemicalsanimationPath_newShape);\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(1).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(1).property(2).property(4).name = \"Path 1\";\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(1).property(2).property(4).property(\"ADBE Vector Shape Direction\").setValue(3);\r\t\tvar chemicalsanimationPath = chemicalsanimation.property(\"ADBE Root Vectors Group\").property(1).property(2).property(4).property(\"ADBE Vector Shape\");\r\t\tvar chemicalsanimationPath_newShape = new Shape();\r\t\t\tchemicalsanimationPath_newShape.vertices = [[158, 246], [174, 246]];\r\t\t\tchemicalsanimationPath_newShape.closed = false;\r\t\tchemicalsanimationPath.setValue(chemicalsanimationPath_newShape);\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(1).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(1).property(2).property(5).name = \"Path 2\";\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(1).property(2).property(5).property(\"ADBE Vector Shape Direction\").setValue(3);\r\t\tvar chemicalsanimationPath = chemicalsanimation.property(\"ADBE Root Vectors Group\").property(1).property(2).property(5).property(\"ADBE Vector Shape\");\r\t\tvar chemicalsanimationPath_newShape = new Shape();\r\t\t\tchemicalsanimationPath_newShape.vertices = [[151, 258], [168, 258]];\r\t\t\tchemicalsanimationPath_newShape.closed = false;\r\t\tchemicalsanimationPath.setValue(chemicalsanimationPath_newShape);\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(1).property(2).addProperty(\"ADBE Vector Filter - Trim\");\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(1).property(2).property(6).property(\"ADBE Vector Trim Start\").setValue(100);\r\t\tvar chemicalsanimationEnd = chemicalsanimation.property(\"ADBE Root Vectors Group\").property(1).property(2).property(6).property(\"ADBE Vector Trim End\");\r\t\t\tvar chemicalsanimationEnd_keyTimesArray = [0.56,1,1.8,2.24];\r\t\t\tvar chemicalsanimationEnd_valuesArray = [100,0,0,100];\r\t\t\tchemicalsanimationEnd.setValuesAtTimes(chemicalsanimationEnd_keyTimesArray, chemicalsanimationEnd_valuesArray);\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(1).property(2).property(6).property(\"ADBE Vector Trim Type\").setValue(2);\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(1).property(2).addProperty(\"ADBE Vector Graphic - Stroke\");\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(1).property(2).property(7).property(\"ADBE Vector Stroke Color\").setValue([0,0,0,1]);\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(1).property(2).property(7).property(\"ADBE Vector Stroke Width\").setValue(6);\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(1).property(2).property(7).property(\"ADBE Vector Stroke Line Cap\").setValue(2);\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(1).property(2).property(7).property(\"ADBE Vector Stroke Line Join\").setValue(2);\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(2).name = \"Group 11\";\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(2).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar chemicalsanimationPath = chemicalsanimation.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\t\tvar chemicalsanimationPath_keyTimesArray = [0.4, 0.8, 0.96, 1.84, 2, 2.4];\r\t\t\tvar chemicalsanimationPath_object = {};\r\t\t\t\tchemicalsanimationPath_object.closed = true;\r\t\t\t\tchemicalsanimationPath_object.vertices = [[[58.0595092773438, -3.2139892578125], [58.3724975585938, -3.45100402832031], [48.3406677246094, 29.8196258544922], [-4.50250244140625, 31.4495086669922], [-54.5885162353516, 26.3347473144531], [-55.0824890136719, -7.33900451660156], [-58.9785003662109, -2.385986328125], [-40.6235046386719, 31.3089904785156], [40.2654876708984, 31.3089904785156]], [[58.0595092773438, -3.2139892578125], [58.3724975585938, -3.07600402832031], [26.7781372070312, -6.85398864746094], [4.92387390136719, -5.64077758789062], [-25.1529083251953, -19.487060546875], [-45.0824890136719, -28.3390045166016], [-58.9785003662109, -2.385986328125], [-40.6234893798828, 31.3089904785156], [40.2655029296875, 31.3089904785156]], [[58.0595092773438, -3.2139892578125], [43.6224975585938, -27.7010040283203], [16.1374969482422, -29.0709991455078], [-5.17250061035156, -22.6129913330078], [-18.0885009765625, -23.2590026855469], [-45.0824890136719, -28.3390045166016], [-58.9785003662109, -2.385986328125], [-40.6234893798828, 31.3089904785156], [40.2655029296875, 31.3089904785156]], [[58.0595092773438, -3.2139892578125], [43.6224975585938, -27.7010040283203], [16.1374969482422, -29.0709991455078], [-5.17250061035156, -22.6129913330078], [-18.0885009765625, -23.2590026855469], [-45.0824890136719, -28.3390045166016], [-58.9785003662109, -2.385986328125], [-40.6234893798828, 31.3089904785156], [40.2655029296875, 31.3089904785156]], [[58.0595092773438, -3.2139892578125], [58.3724975585938, -3.07598876953125], [26.7781372070312, -6.85397338867188], [4.92387390136719, -5.64077758789062], [-25.1529083251953, -19.4870452880859], [-45.0824890136719, -28.3390045166016], [-58.9785003662109, -2.385986328125], [-40.6234893798828, 31.3089904785156], [40.2655029296875, 31.3089904785156]], [[58.0595092773438, -3.2139892578125], [58.3724975585938, -3.45098876953125], [48.3406677246094, 29.8196411132812], [-4.50250244140625, 31.4494934082031], [-54.5885009765625, 26.3347473144531], [-55.0824890136719, -7.3389892578125], [-58.9785003662109, -2.385986328125], [-40.6235046386719, 31.3089904785156], [40.2654724121094, 31.3089904785156]]];\r\t\t\t\tchemicalsanimationPath_object.inTangents = [[[10.302978515625, 14.4630126953125], [0, 0], [16.7316284179688, -8.99223327636719], [12.4497833251953, -0.55961608886719], [5.78581237792969, 8.30514526367188], [-3.84521484375, 7.66639709472656], [0, 0], [-17.3029937744141, 0], [0, 0]], [[10.302978515625, 14.4630126953125], [0, 0], [12.5441589355469, -8.69361877441406], [7.71092224121094, -1.28182983398438], [16.8502044677734, 0.9459228515625], [9.06198120117188, 0.69000244140625], [0, 0], [-17.3030090332031, 0], [0, 0]], [[10.302978515625, 14.4630126953125], [0, 0], [9.40000915527344, -2.23799133300781], [7.74900817871094, -1.29200744628906], [4.52101135253906, 1.29200744628906], [9.06199645996094, 0.69000244140625], [0, 0], [-17.3030090332031, 0], [0, 0]], [[10.302978515625, 14.4630126953125], [0, 0], [9.40000915527344, -2.23799133300781], [7.74900817871094, -1.29200744628906], [4.52101135253906, 1.29200744628906], [9.06199645996094, 0.69000244140625], [0, 0], [-17.3030090332031, 0], [0, 0]], [[10.302978515625, 14.4630126953125], [0, 0], [12.5441589355469, -8.69363403320312], [7.71092224121094, -1.28182983398438], [16.8502044677734, 0.94590759277344], [9.06198120117188, 0.69000244140625], [0, 0], [-17.3030090332031, 0], [0, 0]], [[10.302978515625, 14.4630126953125], [0, 0], [16.7316284179688, -8.99224853515625], [12.4497680664062, -0.55960083007812], [5.78579711914062, 8.30514526367188], [-3.84521484375, 7.6663818359375], [0, 0], [-17.3029937744141, 0], [0, 0]]];\r\t\t\t\tchemicalsanimationPath_object.outTangents = [[[0, 0], [6.57479858398438, 10.9033966064453], [-6.64335632324219, 1.44526672363281], [-22.2024993896484, -1.27059936523438], [-17.2141876220703, -13.3823547363281], [0, 0], [-9.38398742675781, 14.5369873046875], [0, 0], [17.7569885253906, 0]], [[0, 0], [-8.99497985839844, -1.50299072265625], [-6.84764099121094, 1.376708984375], [-14.3440399169922, -0.41877746582031], [-12.2747955322266, -0.8040771484375], [0, 0], [-9.38398742675781, 14.5369873046875], [0, 0], [17.7570037841797, 0]], [[0, 0], [-8.9949951171875, -1.50299072265625], [-7.10299682617188, 1.29100036621094], [-4.52099609375, 0.64599609375], [-9.38699340820312, -1.56399536132812], [0, 0], [-9.38398742675781, 14.5369873046875], [0, 0], [17.7569885253906, 0]], [[0, 0], [-8.9949951171875, -1.50299072265625], [-7.10299682617188, 1.29100036621094], [-4.52099609375, 0.64599609375], [-9.38699340820312, -1.56399536132812], [0, 0], [-9.38398742675781, 14.5369873046875], [0, 0], [17.7569885253906, 0]], [[0, 0], [-8.9949951171875, -1.50299072265625], [-6.84764099121094, 1.37667846679688], [-14.3440399169922, -0.41876220703125], [-12.2747955322266, -0.80409240722656], [0, 0], [-9.38398742675781, 14.5369873046875], [0, 0], [17.7569885253906, 0]], [[0, 0], [6.57479858398438, 10.9033813476562], [-6.64335632324219, 1.44525146484375], [-22.2024841308594, -1.27059936523438], [-17.2142028808594, -13.3823547363281], [0, 0], [-9.38398742675781, 14.5369873046875], [0, 0], [17.7570190429688, 0]]];\r\t\t\taddShapeKeyframes(chemicalsanimationPath, chemicalsanimationPath_keyTimesArray, chemicalsanimationPath_object);\r\t\t\tvar chemicalsanimationPath_easeInSpeedArray = [0,1,1,0,1,0];\r\t\t\tvar chemicalsanimationPath_easeInInfluArray = [16.666666667,16.666666667,16.666666667,16.666666667,16.666666667,16.666666667];\r\t\t\tvar chemicalsanimationPath_easeOutSpeedArray = [0,1,0,1,1,0];\r\t\t\tvar chemicalsanimationPath_easeOutInfluArray = [50,16.666666667,16.666666667,16.666666667,16.666666667,50];\r\t\t\tvar chemicalsanimationPath_keyInInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.LINEAR,KeyframeInterpolationType.LINEAR,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tvar chemicalsanimationPath_keyOutInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.HOLD,KeyframeInterpolationType.LINEAR,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tapplyEasing(chemicalsanimationPath, chemicalsanimationPath_keyTimesArray, [chemicalsanimationPath_easeInSpeedArray, chemicalsanimationPath_easeInInfluArray], [chemicalsanimationPath_easeOutSpeedArray, chemicalsanimationPath_easeOutInfluArray], [chemicalsanimationPath_keyInInterpolationType, chemicalsanimationPath_keyOutInterpolationType]);\r\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(2).property(2).addProperty(\"ADBE Vector Graphic - Stroke\");\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(2).property(2).property(2).property(\"ADBE Vector Stroke Color\").setValue([0,0,0,1]);\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(2).property(2).property(2).property(\"ADBE Vector Stroke Width\").setValue(5.81199979782104);\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(2).property(2).property(2).property(\"ADBE Vector Stroke Line Cap\").setValue(2);\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(2).property(2).property(2).property(\"ADBE Vector Stroke Line Join\").setValue(2);\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(2).property(2).addProperty(\"ADBE Vector Graphic - Fill\");\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(2).property(2).property(3).property(\"ADBE Vector Fill Color\").setValue([0.47843137254902,0.78823529411765,0.26274509803922,1]);\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(2).property(3).property(\"ADBE Vector Anchor\").setValue([-0.18749999999999,-59.453125]);\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(2).property(3).property(\"ADBE Vector Position\").setValue([205.990203857422,205.969482421875]);\r\t\tvar chemicalsanimationScale = chemicalsanimation.property(\"ADBE Root Vectors Group\").property(2).property(3).property(\"ADBE Vector Scale\");\r\t\t\tvar chemicalsanimationScale_keyTimesArray = [0.2,0.6,2.2,2.6];\r\t\t\tvar chemicalsanimationScale_valuesArray = [[0,0],[100,100],[100,100],[0,0]];\r\t\t\tchemicalsanimationScale.setValuesAtTimes(chemicalsanimationScale_keyTimesArray, chemicalsanimationScale_valuesArray);\r\t\t\tvar chemicalsanimationScale_easeInSpeedArray = [[0,0],[0,0],[0,0],[0,0]];\r\t\t\tvar chemicalsanimationScale_easeInInfluArray = [[50,50],[50,50],[50,50],[50,50]];\r\t\t\tvar chemicalsanimationScale_easeOutSpeedArray = [[0,0],[0,0],[0,0],[0,0]];\r\t\t\tvar chemicalsanimationScale_easeOutInfluArray = [[50,50],[50,50],[50,50],[50,50]];\r\t\t\tvar chemicalsanimationScale_keyInInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tvar chemicalsanimationScale_keyOutInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tapplyEasing(chemicalsanimationScale, chemicalsanimationScale_keyTimesArray, [chemicalsanimationScale_easeInSpeedArray, chemicalsanimationScale_easeInInfluArray], [chemicalsanimationScale_easeOutSpeedArray, chemicalsanimationScale_easeOutInfluArray], [chemicalsanimationScale_keyInInterpolationType, chemicalsanimationScale_keyOutInterpolationType]);\r\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(3).name = \"Group 13\";\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(3).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar chemicalsanimationPath = chemicalsanimation.property(\"ADBE Root Vectors Group\").property(3).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\t\tvar chemicalsanimationPath_keyTimesArray = [0.4, 0.8, 0.96, 1.84, 2, 2.4];\r\t\t\tvar chemicalsanimationPath_object = {};\r\t\t\t\tchemicalsanimationPath_object.closed = true;\r\t\t\t\tchemicalsanimationPath_object.vertices = [[[-3.77250671386719, 117.509994506836], [49.0716400146484, 115.880126953125], [59.1025085449219, 82.6094665527344], [18.5724945068359, 14.6355133056641], [14.6074981689453, 0.10450744628906], [14.6074981689453, -54.7875061035156], [5.30148315429688, -64.093505859375], [-8.37451171875, -64.093505859375], [-17.6804809570312, -54.7875061035156], [-17.6804809570312, 0.73249816894531], [-21.0695037841797, 14.2384948730469], [-54.3525085449219, 78.7214660644531], [-53.8584899902344, 112.395263671875]], [[5.65390014648438, 80.4197082519531], [27.5091400146484, 79.2065124511719], [59.1025085449219, 82.9844665527344], [18.572509765625, 14.6354675292969], [14.6074676513672, 0.10450744628906], [14.6074676513672, -54.7875061035156], [5.30149841308594, -64.093505859375], [-8.37449645996094, -64.093505859375], [-17.6805114746094, -54.7875061035156], [-17.6805114746094, 0.73249816894531], [-21.0695037841797, 14.2384796142578], [-44.3525085449219, 57.7214965820312], [-24.4228668212891, 66.5734558105469]], [[-4.44248962402344, 63.4474945068359], [16.8684997558594, 56.989501953125], [44.3525085449219, 58.3594970703125], [18.572509765625, 14.635498046875], [14.6074981689453, 0.10450744628906], [14.6074981689453, -54.7875061035156], [5.30149841308594, -64.093505859375], [-8.37449645996094, -64.093505859375], [-17.6804962158203, -54.7875061035156], [-17.6804962158203, 0.73249816894531], [-21.0695037841797, 14.2384948730469], [-44.3524932861328, 57.7214965820312], [-17.3584899902344, 62.8014984130859]], [[-4.44248962402344, 63.4474945068359], [16.8684997558594, 56.989501953125], [44.3525085449219, 58.3594970703125], [18.572509765625, 14.635498046875], [14.6074981689453, 0.10450744628906], [14.6074981689453, -54.7875061035156], [5.30149841308594, -64.093505859375], [-8.37449645996094, -64.093505859375], [-17.6804962158203, -54.7875061035156], [-17.6804962158203, 0.73249816894531], [-21.0695037841797, 14.2384948730469], [-44.3524932861328, 57.7214965820312], [-17.3584899902344, 62.8014984130859]], [[5.65388488769531, 80.4197082519531], [27.5091400146484, 79.2065124511719], [59.1025085449219, 82.9844665527344], [18.572509765625, 14.6354675292969], [14.6074676513672, 0.10450744628906], [14.6074676513672, -54.7875061035156], [5.30148315429688, -64.093505859375], [-8.37451171875, -64.093505859375], [-17.6805114746094, -54.7875061035156], [-17.6805114746094, 0.73249816894531], [-21.0695037841797, 14.2384643554688], [-44.3525085449219, 57.7214965820312], [-24.4228820800781, 66.5734558105469]], [[-3.77249145507812, 117.509979248047], [49.0716400146484, 115.880126953125], [59.1025085449219, 82.6094665527344], [18.5724945068359, 14.635498046875], [14.6074981689453, 0.10450744628906], [14.6074981689453, -54.7875061035156], [5.30148315429688, -64.093505859375], [-8.37451171875, -64.093505859375], [-17.6804809570312, -54.7875061035156], [-17.6804809570312, 0.73249816894531], [-21.0695037841797, 14.2384948730469], [-54.3525085449219, 78.7214660644531], [-53.8584899902344, 112.395263671875]]];\r\t\t\t\tchemicalsanimationPath_object.inTangents = [[[-4.51998901367188, 0.64601135253906], [-7.10401916503906, 1.29202270507812], [7.0751953125, 11.6536254882812], [0, 0], [0, 5.11099243164062], [0, 0], [5.14006042480469, 0], [0, 0], [0, -5.13998413085938], [0, 0], [2.22499084472656, -4.15399169921875], [0, 0], [-16.7138061523438, -13.1321716308594]], [[-14.1636962890625, -0.5316162109375], [-7.10401916503906, 1.29202270507812], [-8.99502563476562, -1.50291442871094], [0, 0], [0, 5.11099243164062], [0, 0], [5.1400146484375, 0], [0, 0], [0, -5.13998413085938], [0, 0], [2.22500610351562, -4.15397644042969], [0, 0], [-12.2744293212891, -0.80389404296875]], [[-4.52000427246094, 0.64601135253906], [-7.10400390625, 1.29200744628906], [-8.99501037597656, -1.50299072265625], [0, 0], [0, 5.11099243164062], [0, 0], [5.13999938964844, 0], [0, 0], [0, -5.13998413085938], [0, 0], [2.22500610351562, -4.15399169921875], [0, 0], [-9.38600158691406, -1.56399536132812]], [[-4.52000427246094, 0.64601135253906], [-7.10400390625, 1.29200744628906], [-8.99501037597656, -1.50299072265625], [0, 0], [0, 5.11099243164062], [0, 0], [5.13999938964844, 0], [0, 0], [0, -5.13998413085938], [0, 0], [2.22500610351562, -4.15399169921875], [0, 0], [-9.38600158691406, -1.56399536132812]], [[-14.1636810302734, -0.5316162109375], [-7.10401916503906, 1.29202270507812], [-8.99502563476562, -1.5029296875], [0, 0], [0, 5.11099243164062], [0, 0], [5.1400146484375, 0], [0, 0], [0, -5.13998413085938], [0, 0], [2.22500610351562, -4.15396118164062], [0, 0], [-12.2744140625, -0.80389404296875]], [[-4.52000427246094, 0.64602661132812], [-7.10401916503906, 1.29202270507812], [7.0751953125, 11.6536254882812], [0, 0], [0, 5.11099243164062], [0, 0], [5.14004516601562, 0], [0, 0], [0, -5.13998413085938], [0, 0], [2.22499084472656, -4.15399169921875], [0, 0], [-16.7138061523438, -13.1321716308594]]];\r\t\t\t\tchemicalsanimationPath_object.outTangents = [[[7.74903869628906, -1.2919921875], [15.7310638427734, -9.74203491210938], [0, 0], [-2.59500122070312, -4.40301513671875], [0, 0], [0, -5.13998413085938], [0, 0], [-5.13996887207031, 0], [0, 0], [0, 4.71299743652344], [0, 0], [-3.96978759765625, 7.7916259765625], [5.78619384765625, 8.24282836914062]], [[7.74900817871094, -1.2919921875], [12.1685638427734, -8.69342041015625], [0, 0], [-2.59504699707031, -4.40299987792969], [0, 0], [0, -5.13998413085938], [0, 0], [-5.13999938964844, 0], [0, 0], [0, 4.71299743652344], [0, 0], [9.06301879882812, 0.69100952148438], [16.9130706787109, 0.94610595703125]], [[7.74899291992188, -1.2919921875], [9.40000915527344, -2.23800659179688], [0, 0], [-2.59500122070312, -4.40299987792969], [0, 0], [0, -5.13998413085938], [0, 0], [-5.13999938964844, 0], [0, 0], [0, 4.71299743652344], [0, 0], [9.06300354003906, 0.69100952148438], [4.52099609375, 1.29200744628906]], [[7.74899291992188, -1.2919921875], [9.40000915527344, -2.23800659179688], [0, 0], [-2.59500122070312, -4.40299987792969], [0, 0], [0, -5.13998413085938], [0, 0], [-5.13999938964844, 0], [0, 0], [0, 4.71299743652344], [0, 0], [9.06300354003906, 0.69100952148438], [4.52099609375, 1.29200744628906]], [[7.74900817871094, -1.2919921875], [12.1685638427734, -8.69342041015625], [0, 0], [-2.59506225585938, -4.40299987792969], [0, 0], [0, -5.13998413085938], [0, 0], [-5.13998413085938, 0], [0, 0], [0, 4.71299743652344], [0, 0], [9.06300354003906, 0.69100952148438], [16.9130859375, 0.94610595703125]], [[7.7490234375, -1.2919921875], [15.7310638427734, -9.74203491210938], [0, 0], [-2.59501647949219, -4.40301513671875], [0, 0], [0, -5.13998413085938], [0, 0], [-5.13996887207031, 0], [0, 0], [0, 4.71299743652344], [0, 0], [-3.96978759765625, 7.7916259765625], [5.78619384765625, 8.24282836914062]]];\r\t\t\taddShapeKeyframes(chemicalsanimationPath, chemicalsanimationPath_keyTimesArray, chemicalsanimationPath_object);\r\t\t\tvar chemicalsanimationPath_easeInSpeedArray = [0,1,1,0,1,0];\r\t\t\tvar chemicalsanimationPath_easeInInfluArray = [16.666666667,16.666666667,16.666666667,16.666666667,16.666666667,16.666666667];\r\t\t\tvar chemicalsanimationPath_easeOutSpeedArray = [0,1,0,1,1,0];\r\t\t\tvar chemicalsanimationPath_easeOutInfluArray = [50,16.666666667,16.666666667,16.666666667,16.666666667,50];\r\t\t\tvar chemicalsanimationPath_keyInInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.LINEAR,KeyframeInterpolationType.LINEAR,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tvar chemicalsanimationPath_keyOutInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.HOLD,KeyframeInterpolationType.LINEAR,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tapplyEasing(chemicalsanimationPath, chemicalsanimationPath_keyTimesArray, [chemicalsanimationPath_easeInSpeedArray, chemicalsanimationPath_easeInInfluArray], [chemicalsanimationPath_easeOutSpeedArray, chemicalsanimationPath_easeOutInfluArray], [chemicalsanimationPath_keyInInterpolationType, chemicalsanimationPath_keyOutInterpolationType]);\r\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(3).property(2).addProperty(\"ADBE Vector Graphic - Stroke\");\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(3).property(2).property(2).property(\"ADBE Vector Stroke Color\").setValue([0,0,0,1]);\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(3).property(2).property(2).property(\"ADBE Vector Stroke Width\").setValue(5.81199979782104);\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(3).property(2).property(2).property(\"ADBE Vector Stroke Line Cap\").setValue(2);\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(3).property(2).property(2).property(\"ADBE Vector Stroke Line Join\").setValue(2);\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(3).property(2).addProperty(\"ADBE Vector Graphic - Fill\");\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(3).property(2).property(3).property(\"ADBE Vector Fill Color\").setValue([1,1,1,1]);\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(3).property(2).property(3).property(\"ADBE Vector Fill Opacity\").setValue(30);\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(3).property(3).property(\"ADBE Vector Anchor\").setValue([0.546875,26.625]);\r\t\tchemicalsanimation.property(\"ADBE Root Vectors Group\").property(3).property(3).property(\"ADBE Vector Position\").setValue([205.994171142578,205.986907958984]);\r\t\tvar chemicalsanimationScale = chemicalsanimation.property(\"ADBE Root Vectors Group\").property(3).property(3).property(\"ADBE Vector Scale\");\r\t\t\tvar chemicalsanimationScale_keyTimesArray = [0.2,0.6,2.2,2.6];\r\t\t\tvar chemicalsanimationScale_valuesArray = [[0,0],[100,100],[100,100],[0,0]];\r\t\t\tchemicalsanimationScale.setValuesAtTimes(chemicalsanimationScale_keyTimesArray, chemicalsanimationScale_valuesArray);\r\t\t\tvar chemicalsanimationScale_easeInSpeedArray = [[0,0],[0,0],[0,0],[0,0]];\r\t\t\tvar chemicalsanimationScale_easeInInfluArray = [[16.666666667,16.666666667],[50,50],[50,50],[50,50]];\r\t\t\tvar chemicalsanimationScale_easeOutSpeedArray = [[0,0],[0,0],[0,0],[0,0]];\r\t\t\tvar chemicalsanimationScale_easeOutInfluArray = [[50,50],[50,50],[50,50],[50,50]];\r\t\t\tvar chemicalsanimationScale_keyInInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tvar chemicalsanimationScale_keyOutInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tapplyEasing(chemicalsanimationScale, chemicalsanimationScale_keyTimesArray, [chemicalsanimationScale_easeInSpeedArray, chemicalsanimationScale_easeInInfluArray], [chemicalsanimationScale_easeOutSpeedArray, chemicalsanimationScale_easeOutInfluArray], [chemicalsanimationScale_keyInInterpolationType, chemicalsanimationScale_keyOutInterpolationType]);\r\r\t\tchemicalsanimation.property(\"ADBE Transform Group\").property(\"ADBE Anchor Point\").setValue([206,206,0]);\r\t\tvar chemicalsanimationScale = chemicalsanimation.property(\"ADBE Transform Group\").property(\"ADBE Scale\");\r\t\t\tvar chemicalsanimationScale_keyTimesArray = [0,0.4,2.4,2.76];\r\t\t\tvar chemicalsanimationScale_valuesArray = [[0,0,100],[100,100,100],[100,100,100],[0,0,100]];\r\t\t\tchemicalsanimationScale.setValuesAtTimes(chemicalsanimationScale_keyTimesArray, chemicalsanimationScale_valuesArray);\r\t\t\tvar chemicalsanimationScale_easeInSpeedArray = [[0,0,0],[0,0,0],[0,0,0],[0,0,0]];\r\t\t\tvar chemicalsanimationScale_easeInInfluArray = [[50,50,50],[50,50,50],[50,50,50],[50,50,50]];\r\t\t\tvar chemicalsanimationScale_easeOutSpeedArray = [[0,0,0],[0,0,0],[0,0,0],[0,0,0]];\r\t\t\tvar chemicalsanimationScale_easeOutInfluArray = [[50,50,50],[50,50,50],[50,50,50],[50,50,50]];\r\t\t\tvar chemicalsanimationScale_keyInInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tvar chemicalsanimationScale_keyOutInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tapplyEasing(chemicalsanimationScale, chemicalsanimationScale_keyTimesArray, [chemicalsanimationScale_easeInSpeedArray, chemicalsanimationScale_easeInInfluArray], [chemicalsanimationScale_easeOutSpeedArray, chemicalsanimationScale_easeOutInfluArray], [chemicalsanimationScale_keyInInterpolationType, chemicalsanimationScale_keyOutInterpolationType]);\r\r\t\tchemicalsanimation.selected = false;\r}\roven_comp.openInViewer();\r\r} catch(e) {\r\talert(e.toString() + \"\\nError on line: \" + e.line.toString());\r}\rapp.endUndoGroup();\r\r\rfunction getItem(itemName, itemInstanceName, locationObject) {\r\tif (locationObject.numItems > 0) {\r\t\tfor (var i = 1; i <= locationObject.numItems; i ++) {\r\t\t\tvar curItem = locationObject.item(i);\r\t\t\tif (curItem.name === itemName) {\r\t\t\t\tif (curItem instanceof itemInstanceName || (curItem.mainSource !== \"undefined\" && curItem.mainSource instanceof itemInstanceName)) {\r\t\t\t\t\treturn curItem;\r\t\t\t\t}\r\t\t\t}\r\t\t}\r\t}\r\treturn null;\r}\r\rfunction applyEasing(property, keyTimesArray, easeInArray, easeOutArray, keyInterpolationArray) {\r\tfor (var i = 0; i < keyTimesArray.length; i ++) {\r\t\tif (property.propertyValueType === PropertyValueType.TwoD) {\r\t\t\tvar easeIn0 = new KeyframeEase(easeInArray[0][i][0], easeInArray[1][i][0]);\r\t\t\tvar easeOut0 = new KeyframeEase(easeOutArray[0][i][0], easeOutArray[1][i][0]);\r\t\t\tvar easeIn1 = new KeyframeEase(easeInArray[0][i][1], easeInArray[1][i][1]);\r\t\t\tvar easeOut1 = new KeyframeEase(easeOutArray[0][i][1], easeOutArray[1][i][1]);\r\t\t\tproperty.setTemporalEaseAtKey(i+1, [easeIn0, easeIn1], [easeOut0, easeOut1]);\r\t\t} else if (property.propertyValueType === PropertyValueType.ThreeD) {\r\t\t\tvar easeIn0 = new KeyframeEase(easeInArray[0][i][0], easeInArray[1][i][0]);\r\t\t\tvar easeOut0 = new KeyframeEase(easeOutArray[0][i][0], easeOutArray[1][i][0]);\r\t\t\tvar easeIn1 = new KeyframeEase(easeInArray[0][i][1], easeInArray[1][i][1]);\r\t\t\tvar easeOut1 = new KeyframeEase(easeOutArray[0][i][1], easeOutArray[1][i][1]);\r\t\t\tvar easeIn2 = new KeyframeEase(easeInArray[0][i][2], easeInArray[1][i][2]);\r\t\t\tvar easeOut2 = new KeyframeEase(easeOutArray[0][i][2], easeOutArray[1][i][2]);\r\t\t\tproperty.setTemporalEaseAtKey(i+1, [easeIn0, easeIn1, easeIn2], [easeOut0, easeOut1, easeOut2]);\r\t\t} else {\r\t\t\tvar easeIn = new KeyframeEase(easeInArray[0][i], easeInArray[1][i]);\r\t\t\tvar easeOut = new KeyframeEase(easeOutArray[0][i], easeOutArray[1][i]);\r\t\t\tif (keyInterpolationArray[1][i] !== KeyframeInterpolationType.HOLD) {\r\t\t\t\tproperty.setTemporalEaseAtKey(i+1, [easeIn], [easeOut]);\r\t\t\t} else {\r\t\t\t\tproperty.setTemporalEaseAtKey(i+1, [easeIn]);\r\t\t\t}\r\t\t}\r\t\tproperty.setInterpolationTypeAtKey(i+1, keyInterpolationArray[0][i], keyInterpolationArray[1][i]);\r\t}\r}\r\rfunction applySpatialTangents(property, keyTimesArray, inSpatialTangentsArray, outSpatialTangentsArray) {\r\tfor (var sp = 0; sp < keyTimesArray.length; sp ++) {\r\t\tproperty.setSpatialTangentsAtKey(sp+1, inSpatialTangentsArray[sp], outSpatialTangentsArray[sp]);\r\t}\r}\rfunction addShapeKeyframes(myPath, keyTimesArray, myShapeObject) {\r\tvar valuesArray = [];\r\tfor (var i = 0, il = keyTimesArray.length; i < il; i ++) {\r\t\tvar newShape = new Shape();\r\t\tfor (var prop in myShapeObject) {\r\t\t\tif (myShapeObject[prop] instanceof Array) { newShape[prop] = myShapeObject[prop][i]; }\r\t\t\telse { newShape[prop] = myShapeObject[prop]; }\r\t\t}\r\t\tvaluesArray.push(newShape);\r\t}\r\tmyPath.setValuesAtTimes(keyTimesArray, valuesArray);\r}\r\r}", "title": "" }, { "docid": "b0696f7f63e127abdd54bf4263d13430", "score": "0.5725572", "text": "createFirstEditor () {\n this.editor = new SimpleMDE(\n {\n autoDownloadFontAwesome: false,\n autofocus: false,\n element: document.getElementById('md-editor'),\n spellChecker: false,\n status: false,\n toolbar: this.settingsMarkdownEditor\n }\n )\n }", "title": "" }, { "docid": "a9f24c42370b8746356b6ae390be29ca", "score": "0.571119", "text": "createSecondEditor () {\n this.secondEditor = new SimpleMDE(\n {\n autoDownloadFontAwesome: false,\n autofocus: false,\n element: document.getElementById('md-editor-2'),\n spellChecker: false,\n status: false,\n toolbar: this.settingsMarkdownEditor\n }\n )\n }", "title": "" }, { "docid": "55b434ab726117b0ae55ea905300102e", "score": "0.56945235", "text": "function InitStandaloneEditorApp()\r\n{\r\n Ubernote.m_bStandaloneEditor = true;\r\n window.app = new StandaloneEditorApp(); \r\n window.app.init();\r\n}", "title": "" }, { "docid": "d29b4000468c832d02fd0810fa16a752", "score": "0.56943434", "text": "function EditorConstructor() {}", "title": "" }, { "docid": "5474aebcf73c0ab1d4003b5698cbf60e", "score": "0.5682181", "text": "function x(){\n// clear unnecessary tags when editor view empty\nvar a=\"\"==H.text()&&H.html().length<12?\"\":H.html();B.val(w(a))}", "title": "" }, { "docid": "a85dcaa0a20e6929672129f6fee7d68f", "score": "0.5675975", "text": "formatCode () {\r\n this.jsEditor.getAction('editor.action.formatDocument').run();\r\n }", "title": "" }, { "docid": "10e3b59032dc2dd06282d16124f07c8e", "score": "0.5660352", "text": "function createEditor(editorId)\r\n{\r\n //there is already a editor, no need to create it again\r\n var editor = eval(\"listOfEditors[\"+editorId+\"]\");\r\n if (editor)\r\n {\r\n \treturn; \r\n }\r\n\r\n //get the contents of the current text editor\r\n/*\r\n var textAreaNumber= \"htmlbody-\"+editorId;\r\n var sourceCode = document.getElementById(textAreaNumber).value;\r\n document.getElementById(\"editor-\"+editorId).removeChild(document.getElementById(textAreaNumber));\r\n */\r\n //create the editor\r\n\tdocument.getElementById(\"editor-\"+editorId);\r\n\tlistOfEditors[editorId] = CKEDITOR.replace( 'htmlbody-'+editorId, {\r\n\t\t\t\t\t\t\t\t\t\t\t skin: 'office2003',\r\n toolbar :\r\n [\r\n \r\n\r\n\r\n ['Source','Maximize','-','ShowBlocks','-','Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],\r\n\t\t\t'/',\r\n\t\t\t['Bold', 'Italic','Underline','Strike', '-', 'NumberedList', 'BulletedList','-','Subscript','Superscript','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock', '-','Outdent','Indent','Blockquote','-', 'Link','Image','SpellChecker'],['Link','Unlink','Anchor',],\r\n\r\n '/',\r\n\r\n ['Format','Font','FontSize','TextColor','BGColor','-','-','Table','CreateDiv'],\r\n\r\n\r\n ]\r\n\r\n } );\r\n\t\r\n}", "title": "" }, { "docid": "3b8ccf8dc1fd4c5717a6f3f966e6514e", "score": "0.56537324", "text": "function execEditorContents() {\n\tnoerror()\n\texecute(editor.getValue() + ';');\n}", "title": "" }, { "docid": "4e4589caa0e9a6be902f8e13ea338f55", "score": "0.5653627", "text": "function setInlineEditor(){\n}", "title": "" }, { "docid": "12aeaec08ea123df990ad1906ce52174", "score": "0.56388944", "text": "function makeDisplay(place, docStart) { // 92\n var d = {}; // 93\n // 94\n var input = d.input = elt(\"textarea\", null, null, \"position: absolute; padding: 0; width: 1px; height: 1em; outline: none;\");\n if (webkit) input.style.width = \"1000px\"; // 96\n else input.setAttribute(\"wrap\", \"off\"); // 97\n // if border: 0; -- iOS fails to open keyboard (issue #1287) // 98\n if (ios) input.style.border = \"1px solid black\"; // 99\n input.setAttribute(\"autocorrect\", \"off\"); input.setAttribute(\"autocapitalize\", \"off\"); // 100\n // 101\n // Wraps and hides input textarea // 102\n d.inputDiv = elt(\"div\", [input], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\"); // 103\n // The actual fake scrollbars. // 104\n d.scrollbarH = elt(\"div\", [elt(\"div\", null, null, \"height: 1px\")], \"CodeMirror-hscrollbar\"); // 105\n d.scrollbarV = elt(\"div\", [elt(\"div\", null, null, \"width: 1px\")], \"CodeMirror-vscrollbar\"); // 106\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\"); // 107\n // DIVs containing the selection and the actual code // 108\n d.lineDiv = elt(\"div\"); // 109\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\"); // 110\n // Blinky cursor, and element used to ensure cursor fits at the end of a line // 111\n d.cursor = elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"); // 112\n // Secondary cursor, shown when on a 'jump' in bi-directional text // 113\n d.otherCursor = elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"); // 114\n // Used to measure text size // 115\n d.measure = elt(\"div\", null, \"CodeMirror-measure\"); // 116\n // Wraps everything that needs to exist inside the vertically-padded coordinate system // 117\n d.lineSpace = elt(\"div\", [d.measure, d.selectionDiv, d.lineDiv, d.cursor, d.otherCursor], // 118\n null, \"position: relative; outline: none\"); // 119\n // Moved around its parent to cover visible view // 120\n d.mover = elt(\"div\", [elt(\"div\", [d.lineSpace], \"CodeMirror-lines\")], null, \"position: relative\"); // 121\n // Set to the height of the text, causes scrolling // 122\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\"); // 123\n // D is needed because behavior of elts with overflow: auto and padding is inconsistent across browsers // 124\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerCutOff + \"px; width: 1px;\"); // 125\n // Will contain the gutters, if any // 126\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\"); // 127\n d.lineGutter = null; // 128\n // Helper element to properly size the gutter backgrounds // 129\n var scrollerInner = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], null, \"position: relative; min-height: 100%\");\n // Provides scrolling // 131\n d.scroller = elt(\"div\", [scrollerInner], \"CodeMirror-scroll\"); // 132\n d.scroller.setAttribute(\"tabIndex\", \"-1\"); // 133\n // The element in which the editor lives. // 134\n d.wrapper = elt(\"div\", [d.inputDiv, d.scrollbarH, d.scrollbarV, // 135\n d.scrollbarFiller, d.scroller], \"CodeMirror\"); // 136\n // Work around IE7 z-index bug // 137\n if (ie_lt8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; } // 138\n if (place.appendChild) place.appendChild(d.wrapper); else place(d.wrapper); // 139\n // 140\n // Needed to hide big blue blinking cursor on Mobile Safari // 141\n if (ios) input.style.width = \"0px\"; // 142\n if (!webkit) d.scroller.draggable = true; // 143\n // Needed to handle Tab key in KHTML // 144\n if (khtml) { d.inputDiv.style.height = \"1px\"; d.inputDiv.style.position = \"absolute\"; } // 145\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8). // 146\n else if (ie_lt8) d.scrollbarH.style.minWidth = d.scrollbarV.style.minWidth = \"18px\"; // 147\n // 148\n // Current visible range (may be bigger than the view window). // 149\n d.viewOffset = d.lastSizeC = 0; // 150\n d.showingFrom = d.showingTo = docStart; // 151\n // 152\n // Used to only resize the line number gutter when necessary (when // 153\n // the amount of lines crosses a boundary that makes its width change) // 154\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null; // 155\n // See readInput and resetInput // 156\n d.prevInput = \"\"; // 157\n // Set to true when a non-horizontal-scrolling widget is added. As // 158\n // an optimization, widget aligning is skipped when d is false. // 159\n d.alignWidgets = false; // 160\n // Flag that indicates whether we currently expect input to appear // 161\n // (after some event like 'keypress' or 'input') and are polling // 162\n // intensively. // 163\n d.pollingFast = false; // 164\n // Self-resetting timeout for the poller // 165\n d.poll = new Delayed(); // 166\n // True when a drag from the editor is active // 167\n d.draggingText = false; // 168\n // 169\n d.cachedCharWidth = d.cachedTextHeight = null; // 170\n d.measureLineCache = []; // 171\n d.measureLineCachePos = 0; // 172\n // 173\n // Tracks when resetInput has punted to just putting a short // 174\n // string instead of the (large) selection. // 175\n d.inaccurateSelection = false; // 176\n // 177\n // Tracks the maximum line length so that the horizontal scrollbar // 178\n // can be kept static when scrolling. // 179\n d.maxLine = null; // 180\n d.maxLineLength = 0; // 181\n d.maxLineChanged = false; // 182\n // 183\n // Used for measuring wheel scrolling granularity // 184\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null; // 185\n // 186\n return d; // 187\n } // 188", "title": "" }, { "docid": "3e69a0f086f4c8182822510f6869afe4", "score": "0.5635883", "text": "viewEditor() {\n\t\t\t\tpaneResizer.toggleEditor();\n\t\t\t}", "title": "" }, { "docid": "d0877db5a0acd35c9293612cb240cb4c", "score": "0.5632966", "text": "function Display(place, doc) {\n var d = this;\n\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n var input = d.input = elt(\"textarea\", null, null, \"position: absolute; padding: 0; width: 1px; height: 1em; outline: none\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) input.style.width = \"1000px\";\n else input.setAttribute(\"wrap\", \"off\");\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) input.style.border = \"1px solid black\";\n input.setAttribute(\"autocorrect\", \"off\"); input.setAttribute(\"autocapitalize\", \"off\"); input.setAttribute(\"spellcheck\", \"false\");\n\n // Wraps and hides input textarea\n d.inputDiv = elt(\"div\", [input], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The fake scrollbar elements.\n d.scrollbarH = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n d.scrollbarV = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = elt(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = elt(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [elt(\"div\", [d.lineSpace], \"CodeMirror-lines\")], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerCutOff + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.inputDiv, d.scrollbarH, d.scrollbarV,\n d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n // Needed to hide big blue blinking cursor on Mobile Safari\n if (ios) input.style.width = \"0px\";\n if (!webkit) d.scroller.draggable = true;\n // Needed to handle Tab key in KHTML\n if (khtml) { d.inputDiv.style.height = \"1px\"; d.inputDiv.style.position = \"absolute\"; }\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) d.scrollbarH.style.minHeight = d.scrollbarV.style.minWidth = \"18px\";\n\n if (place.appendChild) place.appendChild(d.wrapper);\n else place(d.wrapper);\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastSizeC = 0;\n d.updateLineNumbers = null;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // See readInput and resetInput\n d.prevInput = \"\";\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n d.pollingFast = false;\n // Self-resetting timeout for the poller\n d.poll = new Delayed();\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks when resetInput has punted to just putting a short\n // string into the textarea instead of the full selection.\n d.inaccurateSelection = false;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n }", "title": "" }, { "docid": "d0877db5a0acd35c9293612cb240cb4c", "score": "0.5632966", "text": "function Display(place, doc) {\n var d = this;\n\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n var input = d.input = elt(\"textarea\", null, null, \"position: absolute; padding: 0; width: 1px; height: 1em; outline: none\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) input.style.width = \"1000px\";\n else input.setAttribute(\"wrap\", \"off\");\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) input.style.border = \"1px solid black\";\n input.setAttribute(\"autocorrect\", \"off\"); input.setAttribute(\"autocapitalize\", \"off\"); input.setAttribute(\"spellcheck\", \"false\");\n\n // Wraps and hides input textarea\n d.inputDiv = elt(\"div\", [input], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The fake scrollbar elements.\n d.scrollbarH = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n d.scrollbarV = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = elt(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = elt(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [elt(\"div\", [d.lineSpace], \"CodeMirror-lines\")], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerCutOff + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.inputDiv, d.scrollbarH, d.scrollbarV,\n d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n // Needed to hide big blue blinking cursor on Mobile Safari\n if (ios) input.style.width = \"0px\";\n if (!webkit) d.scroller.draggable = true;\n // Needed to handle Tab key in KHTML\n if (khtml) { d.inputDiv.style.height = \"1px\"; d.inputDiv.style.position = \"absolute\"; }\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) d.scrollbarH.style.minHeight = d.scrollbarV.style.minWidth = \"18px\";\n\n if (place.appendChild) place.appendChild(d.wrapper);\n else place(d.wrapper);\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastSizeC = 0;\n d.updateLineNumbers = null;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // See readInput and resetInput\n d.prevInput = \"\";\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n d.pollingFast = false;\n // Self-resetting timeout for the poller\n d.poll = new Delayed();\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks when resetInput has punted to just putting a short\n // string into the textarea instead of the full selection.\n d.inaccurateSelection = false;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n }", "title": "" }, { "docid": "62c5bad9cf66eaff8d169bedc3c2d589", "score": "0.5632966", "text": "function Display(place, doc) {\n var d = this;\n\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n var input = d.input = elt(\"textarea\", null, null, \"position: absolute; padding: 0; width: 1px; height: 1em; outline: none\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) input.style.width = \"1000px\";\n else input.setAttribute(\"wrap\", \"off\");\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) input.style.border = \"1px solid black\";\n input.setAttribute(\"autocorrect\", \"off\"); input.setAttribute(\"autocapitalize\", \"off\"); input.setAttribute(\"spellcheck\", \"false\");\n\n // Wraps and hides input textarea\n d.inputDiv = elt(\"div\", [input], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The fake scrollbar elements.\n d.scrollbarH = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n d.scrollbarV = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = elt(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = elt(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [elt(\"div\", [d.lineSpace], \"CodeMirror-lines\")], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerCutOff + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.inputDiv, d.scrollbarH, d.scrollbarV,\n d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie_upto7) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n // Needed to hide big blue blinking cursor on Mobile Safari\n if (ios) input.style.width = \"0px\";\n if (!webkit) d.scroller.draggable = true;\n // Needed to handle Tab key in KHTML\n if (khtml) { d.inputDiv.style.height = \"1px\"; d.inputDiv.style.position = \"absolute\"; }\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie_upto7) d.scrollbarH.style.minHeight = d.scrollbarV.style.minWidth = \"18px\";\n\n if (place.appendChild) place.appendChild(d.wrapper);\n else place(d.wrapper);\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastSizeC = 0;\n d.updateLineNumbers = null;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // See readInput and resetInput\n d.prevInput = \"\";\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n d.pollingFast = false;\n // Self-resetting timeout for the poller\n d.poll = new Delayed();\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks when resetInput has punted to just putting a short\n // string into the textarea instead of the full selection.\n d.inaccurateSelection = false;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n }", "title": "" }, { "docid": "d0877db5a0acd35c9293612cb240cb4c", "score": "0.5632966", "text": "function Display(place, doc) {\n var d = this;\n\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n var input = d.input = elt(\"textarea\", null, null, \"position: absolute; padding: 0; width: 1px; height: 1em; outline: none\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) input.style.width = \"1000px\";\n else input.setAttribute(\"wrap\", \"off\");\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) input.style.border = \"1px solid black\";\n input.setAttribute(\"autocorrect\", \"off\"); input.setAttribute(\"autocapitalize\", \"off\"); input.setAttribute(\"spellcheck\", \"false\");\n\n // Wraps and hides input textarea\n d.inputDiv = elt(\"div\", [input], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The fake scrollbar elements.\n d.scrollbarH = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n d.scrollbarV = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = elt(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = elt(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [elt(\"div\", [d.lineSpace], \"CodeMirror-lines\")], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerCutOff + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.inputDiv, d.scrollbarH, d.scrollbarV,\n d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n // Needed to hide big blue blinking cursor on Mobile Safari\n if (ios) input.style.width = \"0px\";\n if (!webkit) d.scroller.draggable = true;\n // Needed to handle Tab key in KHTML\n if (khtml) { d.inputDiv.style.height = \"1px\"; d.inputDiv.style.position = \"absolute\"; }\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) d.scrollbarH.style.minHeight = d.scrollbarV.style.minWidth = \"18px\";\n\n if (place.appendChild) place.appendChild(d.wrapper);\n else place(d.wrapper);\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastSizeC = 0;\n d.updateLineNumbers = null;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // See readInput and resetInput\n d.prevInput = \"\";\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n d.pollingFast = false;\n // Self-resetting timeout for the poller\n d.poll = new Delayed();\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks when resetInput has punted to just putting a short\n // string into the textarea instead of the full selection.\n d.inaccurateSelection = false;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n }", "title": "" }, { "docid": "d0877db5a0acd35c9293612cb240cb4c", "score": "0.5632966", "text": "function Display(place, doc) {\n var d = this;\n\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n var input = d.input = elt(\"textarea\", null, null, \"position: absolute; padding: 0; width: 1px; height: 1em; outline: none\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) input.style.width = \"1000px\";\n else input.setAttribute(\"wrap\", \"off\");\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) input.style.border = \"1px solid black\";\n input.setAttribute(\"autocorrect\", \"off\"); input.setAttribute(\"autocapitalize\", \"off\"); input.setAttribute(\"spellcheck\", \"false\");\n\n // Wraps and hides input textarea\n d.inputDiv = elt(\"div\", [input], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The fake scrollbar elements.\n d.scrollbarH = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n d.scrollbarV = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = elt(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = elt(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [elt(\"div\", [d.lineSpace], \"CodeMirror-lines\")], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerCutOff + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.inputDiv, d.scrollbarH, d.scrollbarV,\n d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n // Needed to hide big blue blinking cursor on Mobile Safari\n if (ios) input.style.width = \"0px\";\n if (!webkit) d.scroller.draggable = true;\n // Needed to handle Tab key in KHTML\n if (khtml) { d.inputDiv.style.height = \"1px\"; d.inputDiv.style.position = \"absolute\"; }\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) d.scrollbarH.style.minHeight = d.scrollbarV.style.minWidth = \"18px\";\n\n if (place.appendChild) place.appendChild(d.wrapper);\n else place(d.wrapper);\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastSizeC = 0;\n d.updateLineNumbers = null;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // See readInput and resetInput\n d.prevInput = \"\";\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n d.pollingFast = false;\n // Self-resetting timeout for the poller\n d.poll = new Delayed();\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks when resetInput has punted to just putting a short\n // string into the textarea instead of the full selection.\n d.inaccurateSelection = false;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n }", "title": "" }, { "docid": "76cf58416a6e8cb047de0ff92b4df918", "score": "0.5617061", "text": "function execEditorScriptContents () {\n\tnoerror()\n\texecuteScript (editorScript.getValue() + ';');\n}", "title": "" }, { "docid": "066c2f68b3084b50c4327789d1f395bf", "score": "0.5606551", "text": "function execEditorContents () {\n\tnoerror()\n\texecute (editor.getValue() + ';');\n}", "title": "" }, { "docid": "fe4348a28419dbf427215442de64f4b4", "score": "0.5606422", "text": "function pythonEditor(id) {\n // An object that encapsulates the behaviour of the editor.\n editor = {};\n\n // Represents the ACE based editor.\n var ACE = ace.edit(id); // The editor is in the tag with the referenced id.\n ACE.setOptions({\n enableSnippets: true // Enable code snippets.\n })\n ACE.setTheme(\"ace/theme/kr_theme\"); // Make it look nice.\n ACE.getSession().setMode(\"ace/mode/python\"); // We're editing Python.\n ACE.getSession().setTabSize(4); // Tab=4 spaces.\n ACE.getSession().setUseSoftTabs(true); // Tabs are really spaces.\n editor.ACE = ACE;\n\n // Gets the textual content of the editor (i.e. what the user has written).\n editor.getCode = function() {\n return ACE.getValue();\n };\n\n // Sets the textual content of the editor (i.e. the Python script).\n editor.setCode = function(code) {\n ACE.setValue(code);\n };\n\n // Give the editor user input focus.\n editor.focus = function() {\n ACE.focus();\n }\n\n // Set a handler function to be run if code in the editor changes.\n editor.on_change = function(handler) {\n ACE.getSession().on('change', handler);\n };\n\n // Return details of all the snippets this editor knows about.\n editor.getSnippets = function() {\n var snippetManager = ace.require(\"ace/snippets\").snippetManager;\n return snippetManager.snippetMap.python;\n };\n\n // Triggers a snippet by name in the editor.\n editor.triggerSnippet = function(snippet) {\n var snippetManager = ace.require(\"ace/snippets\").snippetManager;\n var snippet = snippetManager.snippetNameMap.python[snippet];\n if(snippet) {\n snippetManager.insertSnippet(ACE, snippet.content);\n }\n };\n\n /*\n Turn a Python script into Intel HEX format to be concatenated at the\n end of the MicroPython firmware.hex. A simple header is added to the\n script.\n\n - takes a Python script as a string\n - returns hexlified string, with newlines between lines\n */\n editor.hexlify = function(script) {\n function hexlify(ar) {\n var result = '';\n for (var i = 0; i < ar.length; ++i) {\n if (ar[i] < 16) {\n result += '0';\n }\n result += ar[i].toString(16);\n }\n return result;\n }\n // add header, pad to multiple of 16 bytes\n data = new Uint8Array(4 + script.length + (16 - (4 + script.length) % 16));\n data[0] = 77; // 'M'\n data[1] = 80; // 'P'\n data[2] = script.length & 0xff;\n data[3] = (script.length >> 8) & 0xff;\n for (var i = 0; i < script.length; ++i) {\n data[4 + i] = script.charCodeAt(i);\n }\n // TODO check data.length < 0x2000\n // convert to .hex format\n var addr = 0x3e000; // magic start address in flash\n var chunk = new Uint8Array(5 + 16);\n var output = [];\n for (var i = 0; i < data.length; i += 16, addr += 16) {\n chunk[0] = 16; // length of data section\n chunk[1] = (addr >> 8) & 0xff; // high byte of 16-bit addr\n chunk[2] = addr & 0xff; // low byte of 16-bit addr\n chunk[3] = 0; // type (data)\n for (var j = 0; j < 16; ++j) {\n chunk[4 + j] = data[i + j];\n }\n var checksum = 0;\n for (var j = 0; j < 4 + 16; ++j) {\n checksum += chunk[j];\n }\n chunk[4 + 16] = (-checksum) & 0xff;\n output.push(':' + hexlify(chunk).toUpperCase())\n }\n return output.join('\\n');\n };\n\n // Generates a hex file containing the user's Python from the firmware.\n editor.getHexFile = function(firmware) {\n var hexlified_python = this.hexlify(this.getCode());\n var insertion_point = \":::::::::::::::::::::::::::::::::::::::::::\";\n return firmware.replace(insertion_point, hexlified_python);\n }\n\n return editor;\n}", "title": "" }, { "docid": "3fd3c82cf345aa40559f8c79d7c53a55", "score": "0.55950165", "text": "function EditorConstructor() { }", "title": "" }, { "docid": "3fd3c82cf345aa40559f8c79d7c53a55", "score": "0.55950165", "text": "function EditorConstructor() { }", "title": "" }, { "docid": "655a507ba8deceb74e0365a467c25d45", "score": "0.55881166", "text": "function compCode_20160721_103924() {\r\rapp.beginUndoGroup(\"Ian_lowerThirds\");\r\rtry {\r\r// Create Folder hierarchy\r\tvar zcompcodescripts_folder = getItem(\"Z_Compcode_Scripts\", FolderItem, app.project.rootFolder);\r\tif (zcompcodescripts_folder === null) {\r\t\tzcompcodescripts_folder = app.project.items.addFolder(\"Z_Compcode_Scripts\");\r\t}\r\tvar lowerthirds_folder = getItem(\"LowerThirds\", FolderItem, zcompcodescripts_folder);\r\tif (lowerthirds_folder === null) {\r\t\tlowerthirds_folder = app.project.items.addFolder(\"LowerThirds\");\r\t\tlowerthirds_folder.parentFolder = zcompcodescripts_folder;\r\t}\r\tvar lessonintro_folder = getItem(\"lesson_intro\", FolderItem, lowerthirds_folder);\r\tif (lessonintro_folder === null) {\r\t\tlessonintro_folder = app.project.items.addFolder(\"lesson_intro\");\r\t\tlessonintro_folder.parentFolder = lowerthirds_folder;\r\t}\r\r// Create Compositions\r\tvar ianlowerthirds_comp = app.project.items.addComp(\"Ian_lowerThirds\", 1920, 1080, 1, 57.8, 25);\r\t\tianlowerthirds_comp.time = 26.8;\r\t\tianlowerthirds_comp.bgColor = [0,0,0];\r\t\tianlowerthirds_comp.shutterPhase = -90;\r\t\tianlowerthirds_comp.label = 11;\r\t\tianlowerthirds_comp.parentFolder = lessonintro_folder;\r\r// Working with comp \"Ian_lowerThirds\", varName \"ianlowerthirds_comp\";\r\tianlowerthirds_comp.openInViewer();\r\tvar lecturer = ianlowerthirds_comp.layers.addText(\"----- Lecturer\");\r\t\tlecturer.label = 14;\r\t\tlecturer.startTime = -0.4;\r\t\tlecturer.inPoint = 0;\r\t\tlecturer.outPoint = 57.8;\r\t\tlecturer.motionBlur = true;\r\t\tlecturer.moveToEnd();\r\t\tvar lecturer_TextProp = lecturer.property(\"ADBE Text Properties\").property(\"ADBE Text Document\");\r\t\tvar lecturer_TextDocument = lecturer_TextProp.value;\r\t\t\tlecturer_TextDocument.font = \"OpenSans\";\r\t\t\tlecturer_TextDocument.fontSize = 20;\r\t\t\tlecturer_TextDocument.applyFill = true;\r\t\t\tlecturer_TextDocument.fillColor = [1,1,1];\r\t\t\tlecturer_TextDocument.applyStroke = false;\r\t\t\tlecturer_TextDocument.justification = ParagraphJustification.LEFT_JUSTIFY;\r\t\t\tlecturer_TextDocument.tracking = 0;\r\t\t\tif (parseFloat(app.version) >= 13.2 ) {\r\t\t\t\tlecturer_TextDocument.verticalScale = 1;\r\t\t\t\tlecturer_TextDocument.horizontalScale = 1;\r\t\t\t\tlecturer_TextDocument.baselineShift = 0;\r\t\t\t\tlecturer_TextDocument.tsume = 0;\r\t\t\t\t// These values are read-only. You have to set them manually in the comp.\r\t\t\t\t// lecturer_TextDocument.fauxBold = false;\r\t\t\t\t// lecturer_TextDocument.fauxItalic = false;\r\t\t\t\t// lecturer_TextDocument.allCaps = false;\r\t\t\t\t// lecturer_TextDocument.smallCaps = false;\r\t\t\t\t// lecturer_TextDocument.superscript = false;\r\t\t\t\t// lecturer_TextDocument.subscript = false;\r\t\t\t}\r\t\t\tlecturer_TextProp.setValue(lecturer_TextDocument);\r\t\tlecturer.property(\"ADBE Effect Parade\").addProperty(\"ADBE Gaussian Blur\");\r\t\tlecturer.property(\"ADBE Effect Parade\").property(1).property(\"ADBE Gaussian Blur-0001\").setValue(0.08870568025698);\r\t\tlecturer.property(\"ADBE Transform Group\").property(\"ADBE Anchor Point\").setValue([-2.218994140625,-21.817626953125,0]);\r\t\tlecturer.property(\"ADBE Transform Group\").property(\"ADBE Position\").setValue([103.526467715975,955.182059268853,0]);\r\t\tlecturer.property(\"ADBE Transform Group\").property(\"ADBE Scale\").setValue([264.705882352941,264.705882352941,100]);\r\t\tvar lecturerOpacity = lecturer.property(\"ADBE Transform Group\").property(\"ADBE Opacity\");\r\t\t\tvar lecturerOpacity_keyTimesArray = [21.24,22.48,31.76,33];\r\t\t\tvar lecturerOpacity_valuesArray = [0,99.7782357993575,99.7782357993575,0];\r\t\t\tlecturerOpacity.setValuesAtTimes(lecturerOpacity_keyTimesArray, lecturerOpacity_valuesArray);\r\t\t\tvar lecturerOpacity_easeInSpeedArray = [0,0,0,0];\r\t\t\tvar lecturerOpacity_easeInInfluArray = [16.666666667,60,60,60];\r\t\t\tvar lecturerOpacity_easeOutSpeedArray = [0,0,0,0];\r\t\t\tvar lecturerOpacity_easeOutInfluArray = [60,16.666666667,60,16.666666667];\r\t\t\tvar lecturerOpacity_keyInInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tvar lecturerOpacity_keyOutInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tapplyEasing(lecturerOpacity, lecturerOpacity_keyTimesArray, [lecturerOpacity_easeInSpeedArray, lecturerOpacity_easeInInfluArray], [lecturerOpacity_easeOutSpeedArray, lecturerOpacity_easeOutInfluArray], [lecturerOpacity_keyInInterpolationType, lecturerOpacity_keyOutInterpolationType]);\r\r\t\tlecturer.selected = false;\r\tvar ianSharp = ianlowerthirds_comp.layers.addText(\"Ian Sharp\");\r\t\tianSharp.label = 14;\r\t\tianSharp.startTime = -0.6;\r\t\tianSharp.inPoint = 0;\r\t\tianSharp.outPoint = 57.8;\r\t\tianSharp.motionBlur = true;\r\t\tianSharp.moveToEnd();\r\t\tvar ianSharp_TextProp = ianSharp.property(\"ADBE Text Properties\").property(\"ADBE Text Document\");\r\t\tvar ianSharp_TextDocument = ianSharp_TextProp.value;\r\t\t\tianSharp_TextDocument.font = \"OpenSans-Semibold\";\r\t\t\tianSharp_TextDocument.fontSize = 23;\r\t\t\tianSharp_TextDocument.applyFill = true;\r\t\t\tianSharp_TextDocument.fillColor = [1,1,1];\r\t\t\tianSharp_TextDocument.applyStroke = false;\r\t\t\tianSharp_TextDocument.justification = ParagraphJustification.LEFT_JUSTIFY;\r\t\t\tianSharp_TextDocument.tracking = 0;\r\t\t\tif (parseFloat(app.version) >= 13.2 ) {\r\t\t\t\tianSharp_TextDocument.verticalScale = 1;\r\t\t\t\tianSharp_TextDocument.horizontalScale = 1;\r\t\t\t\tianSharp_TextDocument.baselineShift = 0;\r\t\t\t\tianSharp_TextDocument.tsume = 0;\r\t\t\t\t// These values are read-only. You have to set them manually in the comp.\r\t\t\t\t// ianSharp_TextDocument.fauxBold = false;\r\t\t\t\t// ianSharp_TextDocument.fauxItalic = false;\r\t\t\t\t// ianSharp_TextDocument.allCaps = false;\r\t\t\t\t// ianSharp_TextDocument.smallCaps = false;\r\t\t\t\t// ianSharp_TextDocument.superscript = false;\r\t\t\t\t// ianSharp_TextDocument.subscript = false;\r\t\t\t}\r\t\t\tianSharp_TextProp.setValue(ianSharp_TextDocument);\r\t\tianSharp.property(\"ADBE Effect Parade\").addProperty(\"ADBE Gaussian Blur\");\r\t\tianSharp.property(\"ADBE Effect Parade\").property(1).property(\"ADBE Gaussian Blur-0001\").setValue(0.08870568025698);\r\t\tianSharp.property(\"ADBE Transform Group\").property(\"ADBE Anchor Point\").setValue([-2.218994140625,-21.817626953125,0]);\r\t\tianSharp.property(\"ADBE Transform Group\").property(\"ADBE Position\").setValue([103.526467715975,857.182059268853,0]);\r\t\tianSharp.property(\"ADBE Transform Group\").property(\"ADBE Scale\").setValue([264.705882352941,264.705882352941,100]);\r\t\tvar ianSharpOpacity = ianSharp.property(\"ADBE Transform Group\").property(\"ADBE Opacity\");\r\t\t\tvar ianSharpOpacity_keyTimesArray = [19.68,20.92,31.76,33];\r\t\t\tvar ianSharpOpacity_valuesArray = [0,99.7782357993575,99.7782357993575,0];\r\t\t\tianSharpOpacity.setValuesAtTimes(ianSharpOpacity_keyTimesArray, ianSharpOpacity_valuesArray);\r\t\t\tvar ianSharpOpacity_easeInSpeedArray = [0,0,0,0];\r\t\t\tvar ianSharpOpacity_easeInInfluArray = [16.666666667,60,60,60];\r\t\t\tvar ianSharpOpacity_easeOutSpeedArray = [0,0,0,0];\r\t\t\tvar ianSharpOpacity_easeOutInfluArray = [60,16.666666667,60,16.666666667];\r\t\t\tvar ianSharpOpacity_keyInInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tvar ianSharpOpacity_keyOutInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tapplyEasing(ianSharpOpacity, ianSharpOpacity_keyTimesArray, [ianSharpOpacity_easeInSpeedArray, ianSharpOpacity_easeInInfluArray], [ianSharpOpacity_easeOutSpeedArray, ianSharpOpacity_easeOutInfluArray], [ianSharpOpacity_keyInInterpolationType, ianSharpOpacity_keyOutInterpolationType]);\r\r\t\tianSharp.selected = false;\rianlowerthirds_comp.openInViewer();\r\r} catch(e) {\r\talert(e.toString() + \"\\nError on line: \" + e.line.toString());\r}\rapp.endUndoGroup();\r\r\rfunction getItem(itemName, itemInstanceName, locationObject) {\r\tif (locationObject.numItems > 0) {\r\t\tfor (var i = 1; i <= locationObject.numItems; i ++) {\r\t\t\tvar curItem = locationObject.item(i);\r\t\t\tif (curItem.name === itemName) {\r\t\t\t\tif (curItem instanceof itemInstanceName || (curItem.mainSource !== \"undefined\" && curItem.mainSource instanceof itemInstanceName)) {\r\t\t\t\t\treturn curItem;\r\t\t\t\t}\r\t\t\t}\r\t\t}\r\t}\r\treturn null;\r}\r\rfunction applyEasing(property, keyTimesArray, easeInArray, easeOutArray, keyInterpolationArray) {\r\tfor (var i = 0; i < keyTimesArray.length; i ++) {\r\t\tif (property.propertyValueType === PropertyValueType.TwoD) {\r\t\t\tvar easeIn0 = new KeyframeEase(easeInArray[0][i][0], easeInArray[1][i][0]);\r\t\t\tvar easeOut0 = new KeyframeEase(easeOutArray[0][i][0], easeOutArray[1][i][0]);\r\t\t\tvar easeIn1 = new KeyframeEase(easeInArray[0][i][1], easeInArray[1][i][1]);\r\t\t\tvar easeOut1 = new KeyframeEase(easeOutArray[0][i][1], easeOutArray[1][i][1]);\r\t\t\tproperty.setTemporalEaseAtKey(i+1, [easeIn0, easeIn1], [easeOut0, easeOut1]);\r\t\t} else if (property.propertyValueType === PropertyValueType.ThreeD) {\r\t\t\tvar easeIn0 = new KeyframeEase(easeInArray[0][i][0], easeInArray[1][i][0]);\r\t\t\tvar easeOut0 = new KeyframeEase(easeOutArray[0][i][0], easeOutArray[1][i][0]);\r\t\t\tvar easeIn1 = new KeyframeEase(easeInArray[0][i][1], easeInArray[1][i][1]);\r\t\t\tvar easeOut1 = new KeyframeEase(easeOutArray[0][i][1], easeOutArray[1][i][1]);\r\t\t\tvar easeIn2 = new KeyframeEase(easeInArray[0][i][2], easeInArray[1][i][2]);\r\t\t\tvar easeOut2 = new KeyframeEase(easeOutArray[0][i][2], easeOutArray[1][i][2]);\r\t\t\tproperty.setTemporalEaseAtKey(i+1, [easeIn0, easeIn1, easeIn2], [easeOut0, easeOut1, easeOut2]);\r\t\t} else {\r\t\t\tvar easeIn = new KeyframeEase(easeInArray[0][i], easeInArray[1][i]);\r\t\t\tvar easeOut = new KeyframeEase(easeOutArray[0][i], easeOutArray[1][i]);\r\t\t\tif (keyInterpolationArray[1][i] !== KeyframeInterpolationType.HOLD) {\r\t\t\t\tproperty.setTemporalEaseAtKey(i+1, [easeIn], [easeOut]);\r\t\t\t} else {\r\t\t\t\tproperty.setTemporalEaseAtKey(i+1, [easeIn]);\r\t\t\t}\r\t\t}\r\t\tproperty.setInterpolationTypeAtKey(i+1, keyInterpolationArray[0][i], keyInterpolationArray[1][i]);\r\t}\r}\r\r}", "title": "" }, { "docid": "55149bbeab291eb5d327046950af6cb4", "score": "0.55876046", "text": "function execEditorContents () {\n\tnoerror()\n\texecute (editorSql.getValue() + ';');\n}", "title": "" }, { "docid": "6e081b02364d69849a42eff1a229bcf1", "score": "0.5574653", "text": "function Init(){\niViewField.document.designMode = 'On';\niViewField.document.open();\niViewField.document.write(HTMLeditor.htmlsource.value);\niViewField.document.close();\n}", "title": "" }, { "docid": "aab5e506cb46a8c7922af2a616aae391", "score": "0.55720747", "text": "function BaseEditor() { }", "title": "" }, { "docid": "aab5e506cb46a8c7922af2a616aae391", "score": "0.55720747", "text": "function BaseEditor() { }", "title": "" }, { "docid": "0c7848d4f979ec08442a61d57f2a1e1f", "score": "0.5559504", "text": "get editor() { return this[editorSym]; }", "title": "" }, { "docid": "1246fcd409aac972b583d4dcab9fdbec", "score": "0.55563205", "text": "function showEditorView() {\n showHeaderBar();\n showEditorBody();\n}", "title": "" }, { "docid": "61e2a3e125240951dd8be6e64e9d425f", "score": "0.55537087", "text": "function PreserveScripts(_1){\r\nthis.editor=_1;\r\n}", "title": "" }, { "docid": "61258d6c6d8bf36a10535a88441b5a5f", "score": "0.5533806", "text": "function Et(e){const t=e.o,n=e.i18n.bind(e),r=T.JO.get.bind(T.JO),o=t.filebrowser.ajax.url||t.uploader.url,i=t.image.useImageEditor;return e.c.fromHTML(`<div style=\"${t.image.editSrc?\"\":\"display:none\"}\" class=\"jodit-form__group\">\\n\\t\\t\\t<label>${n(\"Src\")}</label>\\n\\t\\t\\t<div class=\"jodit-input_group\">\\n\\t\\t\\t\\t<input data-ref=\"imageSrc\" class=\"jodit-input\" type=\"text\"/>\\n\\t\\t\\t\\t<div\\n\\t\\t\\t\\t\\tclass=\"jodit-input_group-buttons\"\\n\\t\\t\\t\\t\\tstyle=\"${o?\"\":\"display: none\"}\"\\n\\t\\t\\t\\t>\\n\\t\\t\\t\\t\\t\\t<a\\n\\t\\t\\t\\t\\t\\t\\tdata-ref=\"changeImage\"\\n\\t\\t\\t\\t\\t\\t\\tclass=\"jodit-button\"\\n\\t\\t\\t\\t\\t\\t>${r(\"image\")}</a>\\n\\t\\t\\t\\t\\t\\t<a\\n\\t\\t\\t\\t\\t\\t\\tdata-ref=\"editImage\"\\n\\t\\t\\t\\t\\t\\t\\tclass=\"jodit-button\"\\n\\t\\t\\t\\t\\t\\t\\tstyle=\"${i?\"\":\"display: none\"}\"\\n\\t\\t\\t\\t\\t\\t>${r(\"crop\")}</a>\\n\\t\\t\\t\\t</div>\\n\\t\\t\\t</div>\\n\\t\\t</div>\\n\\t\\t<div style=\"${t.image.editTitle?\"\":\"display:none\"}\" class=\"jodit-form__group\">\\n\\t\\t\\t<label>${n(\"Title\")}</label>\\n\\t\\t\\t<input data-ref=\"imageTitle\" type=\"text\" class=\"jodit-input\"/>\\n\\t\\t</div>\\n\\t\\t<div style=\"${t.image.editAlt?\"\":\"display:none\"}\" class=\"jodit-form__group\">\\n\\t\\t\\t<label>${n(\"Alternative\")}</label>\\n\\t\\t\\t<input data-ref=\"imageAlt\" type=\"text\" class=\"jodit-input\"/>\\n\\t\\t</div>\\n\\t\\t<div style=\"${t.image.editLink?\"\":\"display:none\"}\" class=\"jodit-form__group\">\\n\\t\\t\\t<label>${n(\"Link\")}</label>\\n\\t\\t\\t<input data-ref=\"imageLink\" type=\"text\" class=\"jodit-input\"/>\\n\\t\\t</div>\\n\\t\\t<div style=\"${t.image.editLink?\"\":\"display:none\"}\" class=\"jodit-form__group\">\\n\\t\\t\\t<label class=\"jodit_vertical_middle\">\\n\\t\\t\\t\\t<input data-ref=\"imageLinkOpenInNewTab\" type=\"checkbox\" class=\"jodit-checkbox\"/>\\n\\t\\t\\t\\t<span>${n(\"Open link in new tab\")}</span>\\n\\t\\t\\t</label>\\n\\t\\t</div>`)}", "title": "" }, { "docid": "cb228a90aead99f3c97c7f9aff819967", "score": "0.55329514", "text": "init(element) {\n this.editor = new Editor({\n element: element,\n extensions: [\n StarterKit,\n ],\n content: this.content,\n onUpdate: ({ editor }) => {\n this.content = editor.getHTML()\n },\n onSelectionUpdate: () => {\n this.updatedAt = Date.now()\n },\n })\n }", "title": "" }, { "docid": "9a0d3e51066556aee139624ffa75813e", "score": "0.55233735", "text": "function createEditor1() {\n // let defaultEditorCode1 = \"//livecode window\";\n let defaultEditorCode1 = \"\";\n let editor1code = window.localStorage.getItem(\"editor1\");\n if (editor1code)\n defaultEditorCode1 = editor1code;\n\n editor1 = CodeMirror(document.getElementById('editor1'), {\n // theme: \"abcdef\",\n value: defaultEditorCode1,\n showCursorWhenSelecting: true,\n // theme: \"monokai\",\n mode: \"none\",\n theme: mainTheme,\n lineNumbers: true,\n lineWrapping: true,\n extraKeys: {\n // [\"Cmd-Enter\"]: () => playAudio(),\n [\"Cmd-Enter\"]: () => evalLiveCodeEditorExpression(),\n [\"Ctrl-Enter\"]: () => evalLiveCodeEditorExpression(),\n [\"Shift-Enter\"]: () => evalLiveCodeEditorExpression(),\n // [\"Cmd-.\"]: () => stopAudio(),\n // [\"Cmd--\"]: () => decreaseVolume(),\n // [\"Cmd-=\"]: () => increaseVolume(),\n // [\"Cmd-]\"]: () => changeSynth()\n }\n });\n editor1.setSize('100%', '100%');\n editor1.setOption(\"vimMode\", false);\n\n // console.log(\"editor init\", document.getElementById('editor1'));\n // alert(document.getElementById('editor1').style.color); \n}", "title": "" }, { "docid": "06181ee7883a8b1da8ea82380c8d52e3", "score": "0.55157334", "text": "setupEditor_() {\n\t\tlet prevEditorContent = '{\"state\": \"will be displayed here...\"}';\n\t\tlet prevCursorPos = null;\n\n\t\tif (this.editor_) {\n\t\t\tcancelDebounce(this.saveEditorFn_);\n\n\t\t\tprevEditorContent = this.editor_.getValue();\n\t\t\tprevCursorPos = this.editor_.getCursorPosition();\n\t\t\tlet oldDiv = this.editor_.container;\n\t\t\tlet newDiv = oldDiv.cloneNode(false);\n\n\t\t\tthis.editor_.session.removeAllListeners('change');\n\t\t\tthis.editor_.destroy();\n\n\t\t\toldDiv.parentNode.replaceChild(newDiv, oldDiv);\n\n\t\t\tlet renderedComponentNode = this.element.querySelector('.metal-playground-rendered-component');\n\t\t\trenderedComponentNode.innerHTML = '';\n\n\t\t\tif (core.isDefAndNotNull(this.currentComponent) && core.isDefAndNotNull(this.currentComponent.element)) {\n\t\t\t\trenderedComponentNode.appendChild(this.currentComponent.element);\n\t\t\t}\n\t\t}\n\n\t\tthis.editor_ = window.ace.edit(this.element.querySelector('.metal-playground-editor'));\n\t\tthis.editor_.$blockScrolling = Infinity;\n\t\tthis.editor_.getSession().setMode('ace/mode/json');\n\t\tthis.editor_.setTheme('ace/theme/github');\n\t\tthis.editor_.setValue(prevEditorContent, 1);\n\n\t\tif (core.isDefAndNotNull(prevCursorPos)) {\n\t\t\tthis.editor_.moveCursorTo(prevCursorPos.row, prevCursorPos.column);\n\t\t}\n\n\t\tthis.saveEditorFn_ = debounce(this.onEditorSaveHandler_.bind(this), 200);\n\t\tthis.editor_.on('change', this.saveEditorFn_);\n\t}", "title": "" }, { "docid": "69dd15011dce04f533657b49124e8f3f", "score": "0.5513376", "text": "function SourceEditTool(sourcebuttonid, sourceareaid) {\n /* Source edit tool to edit document's html source */\n this.sourceButton = document.getElementById(sourcebuttonid);\n this.sourceArea = document.getElementById(sourceareaid);\n \n this.initialize = function(editor) {\n /* attach the event handlers */\n this.editor = editor;\n addEventHandler(this.sourceButton, \"click\", this.switchSourceEdit, this);\n this.editor.logMessage('Source edit tool initialized');\n };\n \n this.switchSourceEdit = function(event) {\n var kupu = this.editor;\n var editorframe = kupu.getDocument().getEditable();\n var sourcearea = this.sourceArea;\n var kupudoc = kupu.getInnerDocument();\n \n if (editorframe.style.display != 'none') {\n if (kupu.getBrowserName() == 'Mozilla') {\n kupudoc.designMode = 'Off';\n };\n kupu._initialized = false;\n var data = kupu.getInnerDocument().documentElement.getElementsByTagName('body')[0].innerHTML;\n sourcearea.value = data;\n editorframe.style.display = 'none';\n sourcearea.style.display = 'block';\n } else {\n var data = sourcearea.value;\n kupu.getInnerDocument().documentElement.getElementsByTagName('body')[0].innerHTML = data;\n sourcearea.style.display = 'none';\n editorframe.style.display = 'block';\n if (kupu.getBrowserName() == 'Mozilla') {\n kupudoc.designMode = 'On';\n };\n kupu._initialized = true;\n };\n };\n}", "title": "" }, { "docid": "7d3cd8abeacf3be07bd968c36baf2d14", "score": "0.5502881", "text": "function Test() {\n return(\n\t\t\t<Editor\n\t\t\t\tapiKey=\"qagffr3pkuv17a8on1afax661irst1hbr4e6tbv888sz91jc\"\n\t\t\t\t// onEditorChange={this.handleEditorChange}\n\t\t\t\t// value={this.state.editorContent}\n\t\t\t\tinit={{\n\t\t\t\t\ticons: \"jam\",\n\t\t\t\t\tskin: \"fabric\",\n\t\t\t\t\tcontent_css: \"document\",\n\t\t\t\t\tresize: false\n\t\t\t\t}}\n\t\t\t/>\n );\n}", "title": "" }, { "docid": "95b2bdf52258e229b6a94ee388012e51", "score": "0.55021375", "text": "function start_kaizou_editor_on_doc(doc){\r\n \r\n // Collect frames (includes at least top frame)\r\n doc.kaizou_frames = new Frames(doc);\r\n \r\n // Add our listeners to each framed document\r\n var docs = doc.kaizou_frames.getAllDocuments();\r\n for(var i in docs){\r\n add_kaizou_editor_listeners(docs[i]);\r\n }\r\n \r\n // Capture window events\r\n window.captureEvents(Event.KeyPress);\r\n \r\n // This one is for stopping the editor on document unload\r\n doc.addEventListener(\"onunload\",stop_kaizou_editor, false);\r\n \r\n // Set kaizou editor variables\r\n doc.kaizou_started = true;\r\n doc.kaizou_focus = null;\r\n doc.kaizou_focus_frozen = false;\r\n doc.kaizou_window = window;\r\n \r\n // Create new Kaizou document\r\n reset_kaizou_doc(doc);\r\n\r\n}", "title": "" }, { "docid": "45533c37ee020c787fd5de4f6787e1b3", "score": "0.55011696", "text": "function Display(place, doc) {\n var d = this;\n\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n var input = d.input = elt(\"textarea\", null, null, \"position: absolute; padding: 0; width: 1px; height: 1em; outline: none\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) input.style.width = \"1000px\";\n else input.setAttribute(\"wrap\", \"off\");\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) input.style.border = \"1px solid black\";\n input.setAttribute(\"autocorrect\", \"off\"); input.setAttribute(\"autocapitalize\", \"off\"); input.setAttribute(\"spellcheck\", \"false\");\n\n // Wraps and hides input textarea\n d.inputDiv = elt(\"div\", [input], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n d.scrollbarFiller.setAttribute(\"not-content\", \"true\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n d.gutterFiller.setAttribute(\"not-content\", \"true\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = elt(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = elt(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [elt(\"div\", [d.lineSpace], \"CodeMirror-lines\")], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n d.sizerWidth = null;\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerGap + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.inputDiv, d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n // Needed to hide big blue blinking cursor on Mobile Safari\n if (ios) input.style.width = \"0px\";\n if (!webkit) d.scroller.draggable = true;\n // Needed to handle Tab key in KHTML\n if (khtml) { d.inputDiv.style.height = \"1px\"; d.inputDiv.style.position = \"absolute\"; }\n\n if (place) {\n if (place.appendChild) place.appendChild(d.wrapper);\n else place(d.wrapper);\n }\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n d.reportedViewFrom = d.reportedViewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n d.renderedView = null;\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastWrapHeight = d.lastWrapWidth = 0;\n d.updateLineNumbers = null;\n\n d.nativeBarWidth = d.barHeight = d.barWidth = 0;\n d.scrollbarsClipped = false;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // See readInput and resetInput\n d.prevInput = \"\";\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n d.pollingFast = false;\n // Self-resetting timeout for the poller\n d.poll = new Delayed();\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks when resetInput has punted to just putting a short\n // string into the textarea instead of the full selection.\n d.inaccurateSelection = false;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n }", "title": "" }, { "docid": "1ea7debf21240ccf31d1e1892656e790", "score": "0.5498902", "text": "function editor_action(button_id) {\n// split up button name into \"editorID\" and \"cmdID\"\n\tvar BtnParts = Array();\n\tBtnParts = button_id.split(\"_\");\n\tvar objname = button_id.replace(/^_(.*)_[^_]*$/, '$1');\n\tvar cmdID = BtnParts[ BtnParts.length-1 ];\n\tvar button_obj = document.all[button_id];\n\tvar editor_obj = document.all[\"_\" +objname + \"_editor\"];\n\tvar config = document.all[objname].config;\n\n// help popup\n\tif (cmdID == 'showhelp') {\n\t\twindow.showHelp(_editor_url + \"popups/editor_help.htm\");\n\t\treturn false;\n\t\t}\n\telse if (cmdID == 'save') { \n\t\teditor_updateOutput(objname); \n\t\tsave(); \n\t\t} \n//\tif (cmdID == 'explorer') {\n//\t\twindow.open(_editor_url + \"popups/explorer.php\", 'explorer','Width=500px,left=100,top=20, Height=510px,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no');\n//\t\treturn;\n//\t\t}\n\n// popup editor (original V2.0) \n\telse if (cmdID == 'popupeditor') { \n\t\tshowModalDialog(_editor_url + \"popups/fullscreen.html?\"+objname, window, \"resizable: yes; help: no; status: no; scroll: no; \", 'popupeditor'); \n\t\treturn;\n\t\t} \n\t\t\n// inserted by lvn\n// show 0 borders\n\tif (cmdID == 'ShowBorder'){\n\tvar btnObj = document.all[\"_\" +objname+ \"_ShowBorder\"];\n\tif (config.showborders){ // toggle is on : put borders off\n\t\tnullBorders(editor_obj.contentWindow.document,'hide');\n\t\tbtnObj.className = 'btn';\n\t\tconfig.showborders = false;\n\t} \n\telse {\n\t\tnullBorders(editor_obj.contentWindow.document,'show');\n\t\tbtnObj.className = 'btnDown';\n\t\tconfig.showborders = true;\n\t}\n\treturn;\n\t}\n\n// inserted by lvn (Find function)\n\tif (cmdID == 'Find') {\n\t\tsetGlobalVar (\"_editor_field\",objname);\n\t\tvar findRange = editor_obj.contentWindow.document.body.createTextRange();\n\t\tshowModelessDialog(_editor_url + \"popups/find.html\",window, \"resizable: no; help: no; status: no; scroll: no; \");\n\t\treturn;\n\t}\n// end insert by lvn \n\n// check editor mode (don't perform actions in textedit mode)\n\tif (editor_obj.tagName.toLowerCase() == 'textarea') { return; }\n\tvar editdoc = editor_obj.contentWindow.document;\n\n// inserted by lvn : preview\nif (cmdID == 'Preview'){\n\tvar predoc = editdoc.body.createTextRange().htmlText;\n\tif (config.showborders) {\n\tvar re1 = /BORDER-RIGHT: #c0c0c0 1px dotted; BORDER-TOP: #c0c0c0 1px dotted; BORDER-LEFT: #c0c0c0 1px dotted; BORDER-BOTTOM: #c0c0c0 1px dotted/g;\n\tvar re2 = / style=\"\"/g;\n\tpredoc = predoc.replace(re1,\"\");\n\tpredoc = predoc.replace(re2,\"\");\n\t};\n\twin = window.open('','preview','toolbar=no,location=no,menubar=no,status=yes,scrollbars=yes,resizable=yes');\n\tdoc=win.document.open();\n\tdoc.writeln('<html>\\n<head>\\n<title>Preview</title>');\n\tif (config.stylesheet) {\n\tdoc.writeln('<link rel=\"stylesheet\" href=\"' + config.stylesheet +'\" type=\"text/css\">');\n\t}\n\tdoc.writeln('<style>');\n\tdoc.writeln('body {' +config.bodyStyle+ '}');\n\tfor (var i in config.fontstyles) {\n\tvar fontstyle = config.fontstyles[i];\n\tif (fontstyle.classStyle) {\n\tdoc.writeln('.' +fontstyle.className+ ' {' +fontstyle.classStyle+ '}');\n\t}\n\t}\n\tdoc.writeln('</style>');\n\tdoc.writeln('</head>\\n<body>');\n\tdoc.writeln(predoc);\n\tdoc.writeln('</body>\\n</html>\\n');\n\tdoc=win.document.close();\n\twin.focus();\n\treturn;\n\t}\n// end insert by lvn\n\teditor_focus(editor_obj);\n// get index and value for pulldowns\n\tvar idx = button_obj.selectedIndex;\n\tvar val = (idx != null) ? button_obj[ idx ].value : null;\n\tif (0) {} // use else if for easy cutting and pasting\n\n\telse if (cmdID == 'Today') { // insert some text from a popup window\n\t\tvar myTitle = \"Insert Today's Date\";\n\t\tvar myText = showModalDialog(_editor_url + \"popups/today.html\",\n\t\tmyTitle, \"resizable: yes; help: no; status: no; scroll: no; \");\n\t\tif (myText) { editor_insertHTML(objname, myText); }\n\t\t}\n\n\telse if (cmdID == 'Refresh') { \n\t\teditdoc.execCommand('SelectAll'); \n\t\teditdoc.execCommand('Delete'); \n\t\t} \n\n\telse if (cmdID == 'spell') { \n\tif (confirm(\"This function works when only the text is selected.\\n\\n* Make sure your selection does not include images or other objects as they might be lost.\\n\\n* If the text you want to spellcheck is inside a table, You will need to select either the complete table or the text inside a single cell. If a table is partially selected the spellchecker will return unexpected results.\\n\\n* Make sure to select complete paragraphs. If you select single words, they will be split in a new paragraph.\\n\\n* For most detailed instructions click on the Help icon.\\n\\nTo continue click OK. To make changes before proceeding click Cancel\")){\n\teditdoc.execCommand('copy'); \n\tif (editdoc.selection.createRange().text != \"\") {\n\tCheckDocument(); return true;\n\t} \n\telse {alert('Nothing to spellcheck. Please select the text you want htmlArea to check.\\nTo avoid unexpected results, we recommend you to select complete paragraphs.');} \n\t//Invert selection to force spell checking in whole document\n\t//else {editdoc.execCommand('selectall');editdoc.execCommand('copy');}\n\t//CheckDocument(); return true;\n\t} }\n\n\telse if (cmdID == 'Paste') { \n//\tif (confirm(\"This function will clean the HTML code of the contents in your clipboard overwriting the current selection and cannot be undone.\\nAre you sure you want to perform this action?\")){\n\teditdoc.execCommand('Paste');\n//\tmyclean(editdoc);\n//\teditor_setmode(objname, 'init');\n//\teditor_setmode(objname, '');\n\t\t}\n\t\n\telse if (cmdID == 'RemoveFont') { \n\toTags = editdoc.all.tags(\"FONT\"); \t\tif (oTags != null) {for (var i = oTags.length - 1; i >= 0; i--) {oTags[i].outerHTML = oTags[i].innerHTML;}}\n\t}\n\t\t\n\telse if (cmdID == 'OpenWord') { \n\teditdoc.execCommand('SelectAll');\n\teditdoc.execCommand('cut');\n\tshowModalDialog(_editor_url + \"popups/openword.html\",\n\tmyTitle, \"resizable: yes; help: no; status: no; scroll: no; \");\n\teditdoc.execCommand('paste');\n//\tmyclean(editdoc);\n//\teditor_setmode(objname, 'init');\n//\teditor_setmode(objname, ''); \n\treturn;\n\t\t}\t\n\n// inserted by lvn : table operations\n\telse if ( cmdID == 'TableProperties'||cmdID == 'RowProperties'||cmdID == 'InsertRowBefore'||cmdID == 'InsertRowAfter'||cmdID == 'DeleteRow'||cmdID == 'InsertColumnBefore'||cmdID == 'InsertColumnAfter'||cmdID == 'DeleteColumn'||cmdID == 'CellProperties'||cmdID == 'InsertCellBefore'||cmdID == 'InsertCellAfter'||cmdID == 'SplitCell'||cmdID == 'MergeRows'||cmdID == 'SplitRow'||cmdID == 'MergeCells'||cmdID == 'DeleteCell' ) \n\t{\n// table operations\n\tvar table_src_element = editdoc.selection.createRange().parentElement();\n\twhile (table_src_element != null && table_src_element.tagName != 'TD' && table_src_element.tagName != 'TH'){\n\ttable_src_element = table_src_element.parentElement;\n\t}\n\tif (table_src_element == null) {alert('Table operations not allowed here');} \n\telse {tables_action(button_id,table_src_element);}\n\t}\n// end insert by lvn\n\n// FontName\n\telse if (cmdID == 'FontName' && val) {\n\t\teditdoc.execCommand(cmdID,0,val);\n\t\t}\n\n// inserted by lvn\n // Formatblock\n\telse if (cmdID == 'FormatBlock' && val) {\n\t\teditdoc.execCommand(cmdID,0,val);\n\t\t}\n\n// special characters\n\telse if (cmdID == 'SpecChar') {\n\t\tvar newchar = showModalDialog(_editor_url + \"popups/insert_char.html\", '', \"dialogWidth:493px; dialogHeight: 140px; resizable: no; help: no; status: no; scroll: no;\");\n\t\tif (newchar == '') {return;} \n\t\telse {editor_insertHTML(objname,newchar);}\n\t\t}\n// end insert by lvn\n\n// FontSize\n\telse if (cmdID == 'FontSize' && val) {editdoc.execCommand(cmdID,0,val);}\n\n// FontStyle (change CSS className)\n\telse if (cmdID == 'FontStyle' && val) {\n\t\teditdoc.execCommand('RemoveFormat');\n\t\teditdoc.execCommand('FontName',0,'636c6173734e616d6520706c616365686f6c646572');\n\t\tvar fontArray = editdoc.all.tags(\"FONT\");\n\t\tfor (i=0; i<fontArray.length; i++) {\n\t\tif (fontArray[i].face == '636c6173734e616d6520706c616365686f6c646572') {\n\t\tfontArray[i].face = \"\";\n\t\tfontArray[i].className = val;\n\t\tfontArray[i].outerHTML = fontArray[i].outerHTML.replace(/face=['\"]+/, \"\");\n\t\t}\n\t\t}\n\t\tbutton_obj.selectedIndex =0;\n\t\t}\n\n// fgColor and bgColor\n\telse if (cmdID == 'ForeColor' || cmdID == 'BackColor') {\n\t\tvar oldcolor = _dec_to_rgb(editdoc.queryCommandValue(cmdID));\n\t\tvar newcolor = showModalDialog(_editor_url + \"popups/select_color.html\", oldcolor, \"resizable: no; help: no; status: no; scroll: no;\");\n\t\tif (newcolor != null) { editdoc.execCommand(cmdID, false, \"#\"+newcolor); }\n\t\t}\n \n// execute command for buttons - if we didn't catch the cmdID by here we'll assume it's a\n// commandID and pass it to execCommand(). See http://msdn.microsoft.com/workshop/author/dhtml/reference/commandids.asp\n\telse {\n// subscript & superscript, disable one before enabling the other\n\t\tif (cmdID.toLowerCase() == 'subscript' && editdoc.queryCommandState('superscript')) { editdoc.execCommand('superscript'); }\n\t\tif (cmdID.toLowerCase() == 'superscript' && editdoc.queryCommandState('subscript')) { editdoc.execCommand('subscript'); }\n\n\n// if (cmdID.toLowerCase() == 'insertlink'){\n// editdoc.execCommand('CreateLink',1);\n// }\n// insert link (modified)\n\tif (cmdID.toLowerCase() == 'insertlink') {\n\t\tvar theRange = editdoc.selection.createRange();\n\t\tvar highlightedText = \"\";\n\t\tvar linkText = '';\n\t\tvar href_attribute = '';\n\t\tvar tar_attribute = '';\n\t\tvar elmSelectedImage;\n\t\tvar htmlSelectionControl = \"Control\";\n\t\n\tif (editdoc.selection.type == htmlSelectionControl) {\n// actully we have an image.\n\t\telmSelectedImage = theRange.item(0);\n\t\thighlightedText = elmSelectedImage.outerHTML;\n\t\t\n//convert the ControlRange to a TextRange\n\t\ttheRange = editdoc.body.createTextRange();\n\t\ttheRange.moveToElementText(elmSelectedImage);\n\t\ttheRange.select();\n\t\tfullElement = theRange.htmlText;\n\t\t} \n\t\n\telse {\n\t\thighlightedText = theRange.htmlText;\n\t\tfullElement = theRange.parentElement().outerHTML;\n\t\t}\n\n//in case we happen to select the link itself!\n\tif (highlightedText.search(/^\\<[A|a]/) != -1) {fullElement = highlightedText;}\n\n//extract attributes from HTML\n\tif (fullElement.search(/^\\<[A|a]/) != -1) {\n\t\tfullElement = fullElement.replace(/\\\"/g, \"\");\n\t\tfullElement = fullElement.replace(/\\'/g, \"\");\n\n// here, we have an <a> tag. Now let's extract... \n// 1. the href attribute\n\t\tvar href_value = fullElement.split(/href=/);\n\t\thref_value2 = href_value[1].split(/\\s|>/);\n\t\thref_attribute = href_value2[0];\n\n// 2. the target attribute\n\t\tif (fullElement.search(/target=/) != -1) {\n\t\tvar tar = fullElement.split(/target=/);\n\t\ttar2 = tar[1].split(/\\s|>/);\n\t\ttar_attribute = tar2[0];\n\t\t}\n\n// 3. the link text (more robust as includes all html code aswell)\n\t\tpos1 = fullElement.indexOf(\">\");\n\t\tpos2 = fullElement.lastIndexOf(\"<\");\n\t\tlinkText = fullElement.substring(pos1+1,pos2);\n\t\t}\n\n\t\tvar myValues = new Object();\n\t\tmyValues.highlightedText = highlightedText;\n\t\tmyValues.tar_attribute = tar_attribute;\n\t\tmyValues.href_attribute = href_attribute;\n\t\tmyValues.linkText = linkText;\n\n\t\tvar myText = showModalDialog(_editor_url + \"popups/insert_link.html\", myValues, \"status=no; scroll=no\");\n\n\tif (linkText != '') { \n\tif (myText) { \n\t\ttheRange.parentElement().outerHTML = '';\n\t\teditor_insertHTML(objname, unescape( myText) );\n\t\t}\n\t\t} \n\t\n\telse {\n\tif (myText) { \n\t\teditor_insertHTML(objname, unescape(myText) ); // this function ALWAYS puts in an absolute link \n\t\t} \n\t\t}\n\t\t}\n\t\t\n// all other commands microsoft Command Identifiers\n\telse { editdoc.execCommand(cmdID); }\n\t}\n\t\n\teditor_event(objname);\n\t//editor_obj.focus();\n\t}", "title": "" }, { "docid": "997967137d17e48146a5fd407489a1fc", "score": "0.5494341", "text": "function Editor(browser, url) {\n this.browser = browser;\n this.url = url || browser.baseUrl + '/editor';\n\n // debounce timer after edits is 250ms\n // frontend/scripts/app/editor/view/editor/description/editorRichText.coffee\n this.debounceTimerMs = 400;\n\n this.divEditor = this.browser.$('.Editor');\n\n this.tblMenuBar = this.browser.$('.MenuBar');\n this.btnSaveDraft = this.tblMenuBar.$('.jsSaveDraft');\n\n // was: this.lblDraftSaved = this.tblMenuBar.$('.draftSaved');\n // but this throwed StaleReferenceError\n // because this item is later dynamically added\n this.lblDraftSaved = this.browser.$('.MenuBar .draftSaved');\n\n this.txtHeadline = this.divEditor.$('.Headline h1');\n this.txtDescription = this.divEditor.$('.Description .RichText');\n}", "title": "" }, { "docid": "670591fc5896811f0d4df0884ad5feb4", "score": "0.5486193", "text": "get editor() {\n return this._input.editor;\n }", "title": "" }, { "docid": "41b09ad4a3fd31ab68a64b9ee0d2c093", "score": "0.54836315", "text": "function load_editor() {\n \n // Get the textarea where we will load the file editor.\n var editor_textarea = presto.get(\"editor_textarea\");\n \n // If we don't have Code Mirror then just open the control panel.\n if (CodeMirror === undefined) {\n editor_textarea.nodeName = \"div\";\n editor_textarea.innerHTML = \"This server does not yet have Code Mirror installed on it\";\n\n } else {\n \n // Create a new instance of CodeMirror.\n editor = CodeMirror.fromTextArea(editor_textarea, {\n lineNumbers : true,\n indentUnit : 4,\n rulers : [80]\n });\n\n // Set the size of the editor and set some hotkeys.\n editor.setSize(\"100%\", \"100%\");\n editor.setOption(\"extraKeys\", {\n \"Ctrl-B\" : bug_check,\n \"Ctrl-S\" : save,\n \"Ctrl-/\" : insert_comment_line,\n \"Tab\" : function(cm) {\n var spaces = Array(cm.getOption(\"indentUnit\") + 1).join(\" \");\n cm.replaceSelection(spaces);\n }\n });\n }\n \n // If we don't have a file name then open the control panel.\n if (current_file_name === \"\") {\n toggle_control_panel();\n } else {\n toggle_control_panel();\n open_file_path(current_directory + \"/\" + current_file_name);\n open_file_path(current_directory);\n }\n}", "title": "" }, { "docid": "c86632bb9779fb50320ca5839e3e165d", "score": "0.54760134", "text": "function DocumentEditor(editor,params) {\r\n\t\r\n\tnomedit=params[0];\r\n\tnewPage=\"<div id='header'></div><div id='edit'></div><div id='footer'></div>\";\r\n\t\r\n\tvar cfg = editor.config;\r\n\tvar toolbar = cfg.toolbar;\r\n\tvar self = this;\r\n\tvar i18n = DocumentEditor.I18N;\r\n\tvar doc = editor._doc;\r\n\tthis.range=null;\r\n\tthis._statusBar=null;\r\n\tcfg.statusBar=false;\r\n\t\r\n\t\r\n\tcfg.registerButton(\"pageNum\",i18n[\"Page number\"], editor.imgURL(\"images/ico_no_page.gif\"), false,\r\n\t\t function(editor, id) {\r\n\t\t\t self.btnPress(editor, id);\r\n\t\t });\r\n\tcfg.registerButton(\"nbPage\",i18n[\"Number of pages\"], editor.imgURL(\"images/ico_nb_pages.gif\"), false,\r\n\t\t function(editor, id) {\r\n\t\t\t self.btnPress(editor, id);\r\n\t\t });\r\n\tcfg.registerButton(\"zoomin\",i18n[\"Zoom in\"], editor.imgURL(\"images/ico_zoom_in.gif\"), false,zoomIn);\r\n\tcfg.registerButton(\"zoomout\",i18n[\"Zoom out\"], editor.imgURL(\"images/ico_zoom_out.gif\"), false,zoomOut);\r\n\t\r\n\tcfg.registerButton(\"paste\",HTMLArea.I18N.tooltips[\"paste\"], editor.imgURL(\"images/ed_paste.gif\"), false, self.btnPress);\t \r\n\tcfg.registerButton(\"bold\",HTMLArea.I18N.tooltips[\"bold\"], editor.imgURL(\"images/ed_format_bold.gif\"), false, self.btnPress);\t \r\n\tcfg.registerButton(\"italic\",HTMLArea.I18N.tooltips[\"italic\"], editor.imgURL(\"images/ed_format_italic.gif\"), false, self.btnPress);\t \r\n\tcfg.registerButton(\"underline\",HTMLArea.I18N.tooltips[\"underline\"], editor.imgURL(\"images/ed_format_underline.gif\"), false, self.btnPress);\t \r\n\tcfg.registerButton(\"justifyleft\",HTMLArea.I18N.tooltips[\"justifyleft\"], editor.imgURL(\"images/ed_align_left.gif\"), false, self.btnPress);\t \r\n\tcfg.registerButton(\"justifycenter\",HTMLArea.I18N.tooltips[\"justifycenter\"], editor.imgURL(\"images/ed_align_center.gif\"), false, self.btnPress);\t \r\n\tcfg.registerButton(\"justifyright\",HTMLArea.I18N.tooltips[\"justifyright\"], editor.imgURL(\"images/ed_align_right.gif\"), false, self.btnPress);\t \r\n\tcfg.registerButton(\"justifyfull\",HTMLArea.I18N.tooltips[\"justifyfull\"], editor.imgURL(\"images/ed_align_justify.gif\"), false, self.btnPress);\t \r\n\tcfg.registerButton(\"insertorderedlist\",HTMLArea.I18N.tooltips[\"insertorderedlist\"], editor.imgURL(\"images/ed_list_num.gif\"), false, self.btnPress);\t \r\n\tcfg.registerButton(\"insertunorderedlist\",HTMLArea.I18N.tooltips[\"insertunorderedlist\"], editor.imgURL(\"images/ed_list_bullet.gif\"), false, self.btnPress);\t \r\n\tcfg.registerButton(\"outdent\",HTMLArea.I18N.tooltips[\"outdent\"], editor.imgURL(\"images/ed_indent_less.gif\"), false, self.btnPress);\t \r\n\tcfg.registerButton(\"indent\",HTMLArea.I18N.tooltips[\"indent\"], editor.imgURL(\"images/ed_indent_more.gif\"), false, self.btnPress);\t \r\n\tcfg.registerButton(\"justifyfull\",HTMLArea.I18N.tooltips[\"justifyfull\"], editor.imgURL(\"images/ed_align_justify.gif\"), false, self.btnPress);\t \r\n\t\r\n\r\n\tcfg.fontsize = {\"8\":\"8pt\",\"9\":\"9pt\",\"10\":\"10pt\",\"11\":\"11pt\",\"12\":\"12pt\",\"14\":\"14pt\",\"16\":\"16pt\",\"18\":\"18pt\",\"20\":\"20pt\",\"22\":\"22pt\",\"24\":\"24pt\",\"26\":\"26pt\",\"28\":\"28pt\",\"36\":\"36pt\",\"48\":\"48pt\",\"72\":\"72pt\"};\r\n\tvar myfontname = {\r\n\t\t\"Arial\":\t 'Arial',\r\n\t\t\"Courier New\": 'Courier New',\r\n\t\t\"Georgia\":\t 'Georgia',\r\n\t\t\"Tahoma\":\t 'Tahoma',\r\n\t\t\"Times New Roman\": 'Times New Roman',\r\n\t\t\"Verdana\":\t 'Verdana',\r\n\t\t\"Impact\":\t 'Impact',\r\n\t\t\"WingDings\":\t 'Wingdings'\r\n\t};\t\r\n\r\n\t\r\n\tcfg.registerDropdown({\r\n\t\t\t\t\t\tid\t: 'myfontname',\r\n\t\t\t\t\t\toptions\t: myfontname,\r\n\t\t\t\t\t\trefresh : self.comboRefresh,\r\n\t\t\t\t\t\taction : self.comboChange\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\tcfg.registerDropdown({\r\n\t\t\t\t\t\tid\t: 'myfontsize',\r\n\t\t\t\t\t\toptions\t: cfg.fontsize,\r\n\t\t\t\t\t\trefresh : self.comboRefresh,\r\n\t\t\t\t\t\taction : self.comboChange\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\ttoolbar[0].unshift(\"myfontsize\");\r\n\ttoolbar[0].unshift(\"myfontname\");\r\n\t\t\t \r\n\tvar tb=[\"linebreak\"];\r\n\ttb.push(\"pageNum\");\r\n\ttb.push(\"nbPage\");\r\n\ttb.push(\"zoomin\");\r\n\ttb.push(\"zoomout\");\r\n\ttoolbar.push(tb); \r\n\t\r\n\tif(editor.plugins[\"ContextMenu\"]!=null)\r\n\t\teditor.plugins[\"ContextMenu\"].instance.applyTo=this;\r\n\teditor.onGenerate=function()\r\n\t{\t\t\t\t\r\n\r\n\t\t\r\n\t\tHTMLArea._removeEvent = function(el, evname, func) {\r\n\tif (HTMLArea.is_ie) {\r\n\t\tel.detachEvent(\"on\" + evname, func);\r\n\t} else {\r\n\t\tel.removeEventListener(evname, func, true);\r\n\t}\r\n};\r\n\t\tinitDocument(this);\r\n\t\tinitStatusBar(this);\r\n\t\teditor._iframe.style.width=document.body.clientWidth-2;\r\n\t}\r\n\t\r\n}", "title": "" }, { "docid": "456eea9c65c17495bdde8ecc1c2b2957", "score": "0.5458992", "text": "function openEditor() {\n\twindow.open(\"http://shaofantasy.cn/MiuOnline\", \"Miu Online - New File\");\n}", "title": "" }, { "docid": "ccc6e5e28688cc173710ada18ef97da2", "score": "0.5453141", "text": "edit() {\n\n }", "title": "" }, { "docid": "ccc6e5e28688cc173710ada18ef97da2", "score": "0.5453141", "text": "edit() {\n\n }", "title": "" }, { "docid": "7f811241f9d7aeddb27f8f828d277daf", "score": "0.54386806", "text": "function SmartReplace(_1){\r\nthis.editor=_1;\r\nvar _2=_1.config;\r\nvar _3=this;\r\n_2.registerButton({id:\"smartreplace\",tooltip:this._lc(\"SmartReplace\"),image:Xinha.getPluginDir(\"SmartReplace\")+\"/img/smartquotes.gif\",textMode:false,action:function(e,_5,_6){\r\n_3.buttonPress(null,_6);\r\n}});\r\n_2.addToolbarElement(\"smartreplace\",\"htmlmode\",1);\r\n}", "title": "" }, { "docid": "c4c8f4689aa8c74bd62c8ca625ade6e0", "score": "0.54372376", "text": "function EditorComponent(collaboration, route) {\n this.collaboration = collaboration;\n this.route = route;\n this.languages = ['Java', 'Python'];\n this.language = 'Java';\n this.defaultContent = {\n \"Java\": \"public class Example {\\n public static void main(String[] args) {\\n // Type your Java code here\\n }\\n }\",\n 'Python': \"class Solution:\\n def example():\\n # write your python code here.\\n \"\n };\n }", "title": "" }, { "docid": "4570655c0655c4b868f5c56d553377b5", "score": "0.5432633", "text": "function compCode_20160721_104005() {\r\rapp.beginUndoGroup(\"Ian_Unit_LowerThirds\");\r\rtry {\r\r// Create Folder hierarchy\r\tvar zcompcodescripts_folder = getItem(\"Z_Compcode_Scripts\", FolderItem, app.project.rootFolder);\r\tif (zcompcodescripts_folder === null) {\r\t\tzcompcodescripts_folder = app.project.items.addFolder(\"Z_Compcode_Scripts\");\r\t}\r\tvar lowerthirds_folder = getItem(\"LowerThirds\", FolderItem, zcompcodescripts_folder);\r\tif (lowerthirds_folder === null) {\r\t\tlowerthirds_folder = app.project.items.addFolder(\"LowerThirds\");\r\t\tlowerthirds_folder.parentFolder = zcompcodescripts_folder;\r\t}\r\tvar unitintro_folder = getItem(\"unit_intro\", FolderItem, lowerthirds_folder);\r\tif (unitintro_folder === null) {\r\t\tunitintro_folder = app.project.items.addFolder(\"unit_intro\");\r\t\tunitintro_folder.parentFolder = lowerthirds_folder;\r\t}\r\r// Create Compositions\r\tvar ianunitlowerthirds_comp = app.project.items.addComp(\"Ian_Unit_LowerThirds\", 1920, 1080, 1, 7.28, 25);\r\t\tianunitlowerthirds_comp.time = 3.2;\r\t\tianunitlowerthirds_comp.bgColor = [0,0,0];\r\t\tianunitlowerthirds_comp.displayStartTime = 22.6800994873047;\r\t\tianunitlowerthirds_comp.motionBlur = true;\r\t\tianunitlowerthirds_comp.parentFolder = unitintro_folder;\r\r// Working with comp \"Ian_Unit_LowerThirds\", varName \"ianunitlowerthirds_comp\";\r\tianunitlowerthirds_comp.openInViewer();\r\tvar useOnSideCam = ianunitlowerthirds_comp.layers.addText(\"Use on side cam\");\r\t\tuseOnSideCam.guideLayer = true;\r\t\tuseOnSideCam.moveToEnd();\r\t\tvar useOnSideCam_TextProp = useOnSideCam.property(\"ADBE Text Properties\").property(\"ADBE Text Document\");\r\t\tvar useOnSideCam_TextDocument = useOnSideCam_TextProp.value;\r\t\t\tuseOnSideCam_TextDocument.font = \"ArialMT\";\r\t\t\tuseOnSideCam_TextDocument.fontSize = 30;\r\t\t\tuseOnSideCam_TextDocument.applyFill = true;\r\t\t\tuseOnSideCam_TextDocument.fillColor = [0,1,0.6941180229187];\r\t\t\tuseOnSideCam_TextDocument.applyStroke = false;\r\t\t\tuseOnSideCam_TextDocument.justification = ParagraphJustification.LEFT_JUSTIFY;\r\t\t\tuseOnSideCam_TextDocument.tracking = 0;\r\t\t\tif (parseFloat(app.version) >= 13.2 ) {\r\t\t\t\tuseOnSideCam_TextDocument.verticalScale = 1;\r\t\t\t\tuseOnSideCam_TextDocument.horizontalScale = 1;\r\t\t\t\tuseOnSideCam_TextDocument.baselineShift = 1;\r\t\t\t\tuseOnSideCam_TextDocument.tsume = 0;\r\t\t\t\t// These values are read-only. You have to set them manually in the comp.\r\t\t\t\t// useOnSideCam_TextDocument.fauxBold = false;\r\t\t\t\t// useOnSideCam_TextDocument.fauxItalic = false;\r\t\t\t\t// useOnSideCam_TextDocument.allCaps = false;\r\t\t\t\t// useOnSideCam_TextDocument.smallCaps = false;\r\t\t\t\t// useOnSideCam_TextDocument.superscript = false;\r\t\t\t\t// useOnSideCam_TextDocument.subscript = false;\r\t\t\t}\r\t\t\tuseOnSideCam_TextProp.setValue(useOnSideCam_TextDocument);\r\t\tuseOnSideCam.property(\"ADBE Transform Group\").property(\"ADBE Position\").setValue([948,446,0]);\r\t\tuseOnSideCam.selected = false;\r\t// Add Shape Layer \"Shape Layer 1\", varName \"shapeLayer1\";\r\tvar shapeLayer1 = ianunitlowerthirds_comp.layers.addShape();\r\t\tshapeLayer1.guideLayer = true;\r\t\tshapeLayer1.moveToEnd();\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(1).name = \"Ellipse 5\";\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(1).property(2).addProperty(\"ADBE Vector Shape - Ellipse\");\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(\"ADBE Vector Ellipse Size\").setValue([348.5234375,278.0234375]);\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(1).property(2).addProperty(\"ADBE Vector Graphic - Stroke\");\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(1).property(2).addProperty(\"ADBE Vector Graphic - Fill\");\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(1).property(2).property(3).property(\"ADBE Vector Fill Color\").setValue([0.56887296788833,0.37883899165135,0.37883899165135,1]);\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(1).property(3).property(\"ADBE Vector Position\").setValue([98.26171875,-98.98828125]);\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(2).name = \"Shape 4\";\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(2).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar shapeLayer1Path = shapeLayer1.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\tvar shapeLayer1Path_newShape = new Shape();\r\t\t\tshapeLayer1Path_newShape.vertices = [[16, -72], [-64, -72], [-100, -12], [-44, -12], [14, -18]];\r\t\t\tshapeLayer1Path_newShape.closed = true;\r\t\tshapeLayer1Path.setValue(shapeLayer1Path_newShape);\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(2).property(2).addProperty(\"ADBE Vector Graphic - Stroke\");\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(2).property(2).addProperty(\"ADBE Vector Graphic - Fill\");\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(2).property(2).property(3).property(\"ADBE Vector Fill Color\").setValue([0.56887296788833,0.37883899165135,0.37883899165135,1]);\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(3).name = \"Shape 3\";\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(3).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar shapeLayer1Path = shapeLayer1.property(\"ADBE Root Vectors Group\").property(3).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\tvar shapeLayer1Path_newShape = new Shape();\r\t\t\tshapeLayer1Path_newShape.vertices = [[-414, 50], [-276, 36]];\r\t\t\tshapeLayer1Path_newShape.inTangents = [[-22, -28], [-22, 60]];\r\t\t\tshapeLayer1Path_newShape.outTangents = [[22, 28], [22, -60]];\r\t\t\tshapeLayer1Path_newShape.closed = false;\r\t\tshapeLayer1Path.setValue(shapeLayer1Path_newShape);\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(3).property(2).addProperty(\"ADBE Vector Graphic - Stroke\");\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(3).property(2).addProperty(\"ADBE Vector Graphic - Fill\");\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(3).property(2).property(3).property(\"ADBE Vector Fill Color\").setValue([0.56887296788833,0.37883899165135,0.37883899165135,1]);\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(4).name = \"Ellipse 4\";\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(4).property(2).addProperty(\"ADBE Vector Shape - Ellipse\");\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(4).property(2).property(1).property(\"ADBE Vector Ellipse Size\").setValue([54,60.328125]);\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(4).property(2).addProperty(\"ADBE Vector Graphic - Stroke\");\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(4).property(2).addProperty(\"ADBE Vector Graphic - Fill\");\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(4).property(2).property(3).property(\"ADBE Vector Fill Color\").setValue([0.56887296788833,0.37883899165135,0.37883899165135,1]);\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(4).property(3).property(\"ADBE Vector Position\").setValue([-269,-113.8359375]);\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(5).name = \"Ellipse 3\";\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(5).property(2).addProperty(\"ADBE Vector Shape - Ellipse\");\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(5).property(2).property(1).property(\"ADBE Vector Ellipse Size\").setValue([69.0546875,49.671875]);\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(5).property(2).addProperty(\"ADBE Vector Graphic - Stroke\");\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(5).property(2).addProperty(\"ADBE Vector Graphic - Fill\");\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(5).property(2).property(3).property(\"ADBE Vector Fill Color\").setValue([0.56887296788833,0.37883899165135,0.37883899165135,1]);\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(5).property(3).property(\"ADBE Vector Position\").setValue([-447.47265625,-107.1640625]);\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(6).name = \"Shape 2\";\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(6).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar shapeLayer1Path = shapeLayer1.property(\"ADBE Root Vectors Group\").property(6).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\tvar shapeLayer1Path_newShape = new Shape();\r\t\t\tshapeLayer1Path_newShape.vertices = [[-316, -190], [-208, -196]];\r\t\t\tshapeLayer1Path_newShape.closed = false;\r\t\tshapeLayer1Path.setValue(shapeLayer1Path_newShape);\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(6).property(2).addProperty(\"ADBE Vector Graphic - Stroke\");\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(6).property(2).addProperty(\"ADBE Vector Graphic - Fill\");\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(6).property(2).property(3).property(\"ADBE Vector Fill Color\").setValue([0.56887296788833,0.37883899165135,0.37883899165135,1]);\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(7).name = \"Shape 1\";\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(7).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar shapeLayer1Path = shapeLayer1.property(\"ADBE Root Vectors Group\").property(7).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\tvar shapeLayer1Path_newShape = new Shape();\r\t\t\tshapeLayer1Path_newShape.vertices = [[-528, -175.933715820312], [-410, -182.041427612305]];\r\t\t\tshapeLayer1Path_newShape.closed = false;\r\t\tshapeLayer1Path.setValue(shapeLayer1Path_newShape);\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(7).property(2).addProperty(\"ADBE Vector Graphic - Stroke\");\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(7).property(2).addProperty(\"ADBE Vector Graphic - Fill\");\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(7).property(2).property(3).property(\"ADBE Vector Fill Color\").setValue([0.56887296788833,0.37883899165135,0.37883899165135,1]);\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(7).property(3).property(\"ADBE Vector Scale\").setValue([100,99.5874297752809]);\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(8).name = \"Ellipse 1\";\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(8).property(2).addProperty(\"ADBE Vector Shape - Ellipse\");\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(8).property(2).property(1).property(\"ADBE Vector Ellipse Size\").setValue([505.90625,505.90625]);\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(8).property(2).addProperty(\"ADBE Vector Graphic - Stroke\");\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(8).property(2).addProperty(\"ADBE Vector Graphic - Fill\");\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(8).property(2).property(3).property(\"ADBE Vector Fill Color\").setValue([0.56887296788833,0.37883899165135,0.37883899165135,1]);\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(8).property(3).property(\"ADBE Vector Position\").setValue([-387.046875,-103.046875]);\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(9).name = \"Ellipse 2\";\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(9).property(2).addProperty(\"ADBE Vector Shape - Ellipse\");\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(9).property(2).property(1).property(\"ADBE Vector Ellipse Size\").setValue([494.765625,580.84375]);\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(9).property(2).addProperty(\"ADBE Vector Graphic - Stroke\");\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(9).property(2).addProperty(\"ADBE Vector Graphic - Fill\");\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(9).property(2).property(3).property(\"ADBE Vector Fill Color\").setValue([0.56887296788833,0.37883899165135,0.37883899165135,1]);\r\t\tshapeLayer1.property(\"ADBE Root Vectors Group\").property(9).property(3).property(\"ADBE Vector Position\").setValue([-397.203125,368.671875]);\r\t\tshapeLayer1.selected = false;\r\tvar businessLecturer = ianunitlowerthirds_comp.layers.addText(\"Business Lecturer\");\r\t\tbusinessLecturer.startTime = 1.32;\r\t\tbusinessLecturer.outPoint = 7.28;\r\t\tbusinessLecturer.motionBlur = true;\r\t\tbusinessLecturer.moveToEnd();\r\t\tvar businessLecturer_TextProp = businessLecturer.property(\"ADBE Text Properties\").property(\"ADBE Text Document\");\r\t\tvar businessLecturer_TextDocument = businessLecturer_TextProp.value;\r\t\t\tbusinessLecturer_TextDocument.font = \"OpenSans\";\r\t\t\tbusinessLecturer_TextDocument.fontSize = 65;\r\t\t\tbusinessLecturer_TextDocument.applyFill = true;\r\t\t\tbusinessLecturer_TextDocument.fillColor = [1,1,1];\r\t\t\tbusinessLecturer_TextDocument.applyStroke = false;\r\t\t\tbusinessLecturer_TextDocument.justification = ParagraphJustification.RIGHT_JUSTIFY;\r\t\t\tbusinessLecturer_TextDocument.tracking = 0;\r\t\t\tif (parseFloat(app.version) >= 13.2 ) {\r\t\t\t\tbusinessLecturer_TextDocument.verticalScale = 1;\r\t\t\t\tbusinessLecturer_TextDocument.horizontalScale = 1;\r\t\t\t\tbusinessLecturer_TextDocument.baselineShift = 0;\r\t\t\t\tbusinessLecturer_TextDocument.tsume = 0;\r\t\t\t\t// These values are read-only. You have to set them manually in the comp.\r\t\t\t\t// businessLecturer_TextDocument.fauxBold = false;\r\t\t\t\t// businessLecturer_TextDocument.fauxItalic = false;\r\t\t\t\t// businessLecturer_TextDocument.allCaps = false;\r\t\t\t\t// businessLecturer_TextDocument.smallCaps = false;\r\t\t\t\t// businessLecturer_TextDocument.superscript = false;\r\t\t\t\t// businessLecturer_TextDocument.subscript = false;\r\t\t\t}\r\t\t\tbusinessLecturer_TextProp.setValue(businessLecturer_TextDocument);\r\t\tbusinessLecturer.property(\"ADBE Effect Parade\").addProperty(\"ADBE Gaussian Blur\");\r\t\tvar businessLecturerBlurriness = businessLecturer.property(\"ADBE Effect Parade\").property(1).property(\"ADBE Gaussian Blur-0001\");\r\t\t\tvar businessLecturerBlurriness_keyTimesArray = [8.2,9];\r\t\t\tvar businessLecturerBlurriness_valuesArray = [0,40];\r\t\t\tbusinessLecturerBlurriness.setValuesAtTimes(businessLecturerBlurriness_keyTimesArray, businessLecturerBlurriness_valuesArray);\r\t\t\tvar businessLecturerBlurriness_easeInSpeedArray = [0,0];\r\t\t\tvar businessLecturerBlurriness_easeInInfluArray = [16.666666667,60];\r\t\t\tvar businessLecturerBlurriness_easeOutSpeedArray = [0,0];\r\t\t\tvar businessLecturerBlurriness_easeOutInfluArray = [60,16.666666667];\r\t\t\tvar businessLecturerBlurriness_keyInInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tvar businessLecturerBlurriness_keyOutInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tapplyEasing(businessLecturerBlurriness, businessLecturerBlurriness_keyTimesArray, [businessLecturerBlurriness_easeInSpeedArray, businessLecturerBlurriness_easeInInfluArray], [businessLecturerBlurriness_easeOutSpeedArray, businessLecturerBlurriness_easeOutInfluArray], [businessLecturerBlurriness_keyInInterpolationType, businessLecturerBlurriness_keyOutInterpolationType]);\r\r\t\tbusinessLecturer.property(\"ADBE Transform Group\").property(\"ADBE Position\").setValue([1787.63946533203,978,0]);\r\t\tvar businessLecturerOpacity = businessLecturer.property(\"ADBE Transform Group\").property(\"ADBE Opacity\");\r\t\t\tvar businessLecturerOpacity_keyTimesArray = [1.32,2.16,8.2,9];\r\t\t\tvar businessLecturerOpacity_valuesArray = [0,100,100,0];\r\t\t\tbusinessLecturerOpacity.setValuesAtTimes(businessLecturerOpacity_keyTimesArray, businessLecturerOpacity_valuesArray);\r\t\t\tvar businessLecturerOpacity_easeInSpeedArray = [0,0,0,0];\r\t\t\tvar businessLecturerOpacity_easeInInfluArray = [60,60,60,60];\r\t\t\tvar businessLecturerOpacity_easeOutSpeedArray = [0,0,0,0];\r\t\t\tvar businessLecturerOpacity_easeOutInfluArray = [60,60,60,16.666666667];\r\t\t\tvar businessLecturerOpacity_keyInInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tvar businessLecturerOpacity_keyOutInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tapplyEasing(businessLecturerOpacity, businessLecturerOpacity_keyTimesArray, [businessLecturerOpacity_easeInSpeedArray, businessLecturerOpacity_easeInInfluArray], [businessLecturerOpacity_easeOutSpeedArray, businessLecturerOpacity_easeOutInfluArray], [businessLecturerOpacity_keyInInterpolationType, businessLecturerOpacity_keyOutInterpolationType]);\r\r\t\tbusinessLecturer.selected = false;\r\tvar ianSharp = ianunitlowerthirds_comp.layers.addText(\"Ian Sharp\");\r\t\tianSharp.motionBlur = true;\r\t\tianSharp.moveToEnd();\r\t\tvar ianSharp_TextProp = ianSharp.property(\"ADBE Text Properties\").property(\"ADBE Text Document\");\r\t\tvar ianSharp_TextDocument = ianSharp_TextProp.value;\r\t\t\tianSharp_TextDocument.font = \"OpenSans-Semibold\";\r\t\t\tianSharp_TextDocument.fontSize = 65;\r\t\t\tianSharp_TextDocument.applyFill = true;\r\t\t\tianSharp_TextDocument.fillColor = [1,1,1];\r\t\t\tianSharp_TextDocument.applyStroke = false;\r\t\t\tianSharp_TextDocument.justification = ParagraphJustification.RIGHT_JUSTIFY;\r\t\t\tianSharp_TextDocument.tracking = 0;\r\t\t\tif (parseFloat(app.version) >= 13.2 ) {\r\t\t\t\tianSharp_TextDocument.verticalScale = 1;\r\t\t\t\tianSharp_TextDocument.horizontalScale = 1;\r\t\t\t\tianSharp_TextDocument.baselineShift = 0;\r\t\t\t\tianSharp_TextDocument.tsume = 0;\r\t\t\t\t// These values are read-only. You have to set them manually in the comp.\r\t\t\t\t// ianSharp_TextDocument.fauxBold = false;\r\t\t\t\t// ianSharp_TextDocument.fauxItalic = false;\r\t\t\t\t// ianSharp_TextDocument.allCaps = false;\r\t\t\t\t// ianSharp_TextDocument.smallCaps = false;\r\t\t\t\t// ianSharp_TextDocument.superscript = false;\r\t\t\t\t// ianSharp_TextDocument.subscript = false;\r\t\t\t}\r\t\t\tianSharp_TextProp.setValue(ianSharp_TextDocument);\r\t\tianSharp.property(\"ADBE Effect Parade\").addProperty(\"ADBE Gaussian Blur\");\r\t\tvar ianSharpBlurriness = ianSharp.property(\"ADBE Effect Parade\").property(1).property(\"ADBE Gaussian Blur-0001\");\r\t\t\tvar ianSharpBlurriness_keyTimesArray = [8.2,9];\r\t\t\tvar ianSharpBlurriness_valuesArray = [0,40];\r\t\t\tianSharpBlurriness.setValuesAtTimes(ianSharpBlurriness_keyTimesArray, ianSharpBlurriness_valuesArray);\r\t\t\tvar ianSharpBlurriness_easeInSpeedArray = [0,0];\r\t\t\tvar ianSharpBlurriness_easeInInfluArray = [16.666666667,60];\r\t\t\tvar ianSharpBlurriness_easeOutSpeedArray = [0,0];\r\t\t\tvar ianSharpBlurriness_easeOutInfluArray = [60,16.666666667];\r\t\t\tvar ianSharpBlurriness_keyInInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tvar ianSharpBlurriness_keyOutInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tapplyEasing(ianSharpBlurriness, ianSharpBlurriness_keyTimesArray, [ianSharpBlurriness_easeInSpeedArray, ianSharpBlurriness_easeInInfluArray], [ianSharpBlurriness_easeOutSpeedArray, ianSharpBlurriness_easeOutInfluArray], [ianSharpBlurriness_keyInInterpolationType, ianSharpBlurriness_keyOutInterpolationType]);\r\r\t\tianSharp.property(\"ADBE Transform Group\").property(\"ADBE Position\").setValue([1790.05157470703,898,0]);\r\t\tvar ianSharpOpacity = ianSharp.property(\"ADBE Transform Group\").property(\"ADBE Opacity\");\r\t\t\tvar ianSharpOpacity_keyTimesArray = [0,0.84,8.2,9];\r\t\t\tvar ianSharpOpacity_valuesArray = [0,100,100,0];\r\t\t\tianSharpOpacity.setValuesAtTimes(ianSharpOpacity_keyTimesArray, ianSharpOpacity_valuesArray);\r\t\t\tvar ianSharpOpacity_easeInSpeedArray = [0,0,0,0];\r\t\t\tvar ianSharpOpacity_easeInInfluArray = [60,60,60,60];\r\t\t\tvar ianSharpOpacity_easeOutSpeedArray = [0,0,0,0];\r\t\t\tvar ianSharpOpacity_easeOutInfluArray = [60,60,60,16.666666667];\r\t\t\tvar ianSharpOpacity_keyInInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tvar ianSharpOpacity_keyOutInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tapplyEasing(ianSharpOpacity, ianSharpOpacity_keyTimesArray, [ianSharpOpacity_easeInSpeedArray, ianSharpOpacity_easeInInfluArray], [ianSharpOpacity_easeOutSpeedArray, ianSharpOpacity_easeOutInfluArray], [ianSharpOpacity_keyInInterpolationType, ianSharpOpacity_keyOutInterpolationType]);\r\r\t\tianSharp.selected = false;\rianunitlowerthirds_comp.openInViewer();\r\r} catch(e) {\r\talert(e.toString() + \"\\nError on line: \" + e.line.toString());\r}\rapp.endUndoGroup();\r\r\rfunction getItem(itemName, itemInstanceName, locationObject) {\r\tif (locationObject.numItems > 0) {\r\t\tfor (var i = 1; i <= locationObject.numItems; i ++) {\r\t\t\tvar curItem = locationObject.item(i);\r\t\t\tif (curItem.name === itemName) {\r\t\t\t\tif (curItem instanceof itemInstanceName || (curItem.mainSource !== \"undefined\" && curItem.mainSource instanceof itemInstanceName)) {\r\t\t\t\t\treturn curItem;\r\t\t\t\t}\r\t\t\t}\r\t\t}\r\t}\r\treturn null;\r}\r\rfunction applyEasing(property, keyTimesArray, easeInArray, easeOutArray, keyInterpolationArray) {\r\tfor (var i = 0; i < keyTimesArray.length; i ++) {\r\t\tif (property.propertyValueType === PropertyValueType.TwoD) {\r\t\t\tvar easeIn0 = new KeyframeEase(easeInArray[0][i][0], easeInArray[1][i][0]);\r\t\t\tvar easeOut0 = new KeyframeEase(easeOutArray[0][i][0], easeOutArray[1][i][0]);\r\t\t\tvar easeIn1 = new KeyframeEase(easeInArray[0][i][1], easeInArray[1][i][1]);\r\t\t\tvar easeOut1 = new KeyframeEase(easeOutArray[0][i][1], easeOutArray[1][i][1]);\r\t\t\tproperty.setTemporalEaseAtKey(i+1, [easeIn0, easeIn1], [easeOut0, easeOut1]);\r\t\t} else if (property.propertyValueType === PropertyValueType.ThreeD) {\r\t\t\tvar easeIn0 = new KeyframeEase(easeInArray[0][i][0], easeInArray[1][i][0]);\r\t\t\tvar easeOut0 = new KeyframeEase(easeOutArray[0][i][0], easeOutArray[1][i][0]);\r\t\t\tvar easeIn1 = new KeyframeEase(easeInArray[0][i][1], easeInArray[1][i][1]);\r\t\t\tvar easeOut1 = new KeyframeEase(easeOutArray[0][i][1], easeOutArray[1][i][1]);\r\t\t\tvar easeIn2 = new KeyframeEase(easeInArray[0][i][2], easeInArray[1][i][2]);\r\t\t\tvar easeOut2 = new KeyframeEase(easeOutArray[0][i][2], easeOutArray[1][i][2]);\r\t\t\tproperty.setTemporalEaseAtKey(i+1, [easeIn0, easeIn1, easeIn2], [easeOut0, easeOut1, easeOut2]);\r\t\t} else {\r\t\t\tvar easeIn = new KeyframeEase(easeInArray[0][i], easeInArray[1][i]);\r\t\t\tvar easeOut = new KeyframeEase(easeOutArray[0][i], easeOutArray[1][i]);\r\t\t\tif (keyInterpolationArray[1][i] !== KeyframeInterpolationType.HOLD) {\r\t\t\t\tproperty.setTemporalEaseAtKey(i+1, [easeIn], [easeOut]);\r\t\t\t} else {\r\t\t\t\tproperty.setTemporalEaseAtKey(i+1, [easeIn]);\r\t\t\t}\r\t\t}\r\t\tproperty.setInterpolationTypeAtKey(i+1, keyInterpolationArray[0][i], keyInterpolationArray[1][i]);\r\t}\r}\r\r}", "title": "" }, { "docid": "9f61be630c9ca871ff16af1078ca9701", "score": "0.5412567", "text": "function getTheEditor(_editor)\n {\n editor = EditorFactory.editorLoaded(_editor);\n thedocument = editor.getDoc();\n editor.setOption('hintOptions', {schemaInfo: vm.navigatorModel});\n editor.foldCode(CodeMirror.Pos(0,0));\n editor.foldCode(CodeMirror.Pos(thedocument.lineCount(),0));\n showNav(); \n showConf();\n showConf();\n }", "title": "" }, { "docid": "8ebb9078c0044a5f4d07bbcab0b76bbd", "score": "0.5404634", "text": "function Springy() {\n\n // default options\n var _defaults = {\n // the editor id\n id: 'cfeditor',\n\n // the field or input element id where to store the editor value\n // if you want set the start editor value (content) like when you're going to edit\n // an existing content, you can fill the fieldId value and when the editor is ready\n // set the content value, ready to be edited\n fieldId: 'cfeditor_temp',\n\n // the editor width\n width: '100%',\n\n // the editor height\n height: '300px',\n\n // indicate if the editor grow its heght based on the content. Default value is false\n autosize: false,\n\n // the current domain (format: http|http|other)\n domain: '', //'http://127.0.0.1:82/',\n\n // indicate if the editor font styles used in the page must be used in the editor\n usePageStyles: true,\n\n // connectors are used for the editor components such as image browser, add link and other\n connectors: SpringyConnectors,\n\n // the editor toolbar style. The default value is blue\n style: 'blue'\n };\n\n // custom options\n var _opts = null;\n \n // tollbar identifier\n var _toolbarId = null;\n\n // the content editable iframe\n var _iframe = null;\n\n // function: evaluate string or object funcions\n var _eval = function (obj) { var getType = {}; if (obj && getType.toString.call(obj) === '[object Function]') { obj(); } else if (obj != null) { if (obj.length > 0) { jQuery.globalEval(obj); } } };\n \n // function: extend an object with the second\n var _extend = function (obj, extObj) { if (obj) { for (var i in extObj) { if (obj[i] == undefined) { obj[i] = extObj[i]; } } } return obj; }\n \n // function: get the object length\n var _getObjectSize = function (obj) { var size = 0, key; for (key in obj) { if (obj.hasOwnProperty(key)) size++; } return size; };\n \n // function: clear the input from microsoft word html tags (see http://www.1stclassmedia.co.uk/developers/clean-ms-word-formatting.php)\n var _purgeMSWordTags = function (value) {\n value = value.replace(/\\<![ \\r\\n\\t]*(--([^\\-]|[\\r\\n]|-[^\\-])*--[ \\r\\n\\t]*)\\>/gi, \"\");\n /*value = value.replace(/\\<!(--([^\\-]|[\\r\\n]|-[^\\-])*--[ \\r\\n\\t]*)\\>/gi, \"\") ;*/\n /*//value = value.replace(/<!--(.*?)-->/, \"\");*/\n /*alternate//value = value.replace(/&lt;!--(.*?)--&gt;/g, \"\");*/\n value = value.replace(/<o:p>\\s*<\\/o:p>/g, \"\"); value = value.replace(/<o:p>.*?<\\/o:p>/g, \"&nbsp;\"); value = value.replace(/\\s*mso-[^:]+:[^;\"]+;?/gi, \"\");\n value = value.replace(/\\s*MARGIN: 0cm 0cm 0pt\\s*;/gi, \"\"); value = value.replace(/\\s*MARGIN: 0cm 0cm 0pt\\s*\"/gi, \"\\\"\"); value = value.replace(/\\s*TEXT-INDENT: 0cm\\s*;/gi, \"\");\n value = value.replace(/\\s*TEXT-INDENT: 0cm\\s*\"/gi, \"\\\"\"); value = value.replace(/\\s*TEXT-ALIGN: [^\\s;]+;?\"/gi, \"\\\"\"); value = value.replace(/\\s*PAGE-BREAK-BEFORE: [^\\s;]+;?\"/gi, \"\\\"\");\n value = value.replace(/\\s*FONT-VARIANT: [^\\s;]+;?\"/gi, \"\\\"\"); value = value.replace(/\\s*tab-stops:[^;\"]*;?/gi, \"\"); value = value.replace(/\\s*tab-stops:[^\"]*/gi, \"\");\n value = value.replace(/\\s*face=\"[^\"]*\"/gi, \"\"); value = value.replace(/\\s*face=[^ >]*/gi, \"\"); value = value.replace(/\\s*FONT-FAMILY:[^;\"]*;?/gi, \"\");\n value = value.replace(/<(\\w[^>]*) class=([^ |>]*)([^>]*)/gi, \"<$1$3\"); value = value.replace(/<(\\w[^>]*) style=\"([^\\\"]*)\"([^>]*)/gi, \"<$1$3\"); value = value.replace(/\\s*style=\"\\s*\"/gi, '');\n value = value.replace(/<SPAN\\s*[^>]*>\\s*&nbsp;\\s*<\\/SPAN>/gi, '&nbsp;'); value = value.replace(/<SPAN\\s*[^>]*><\\/SPAN>/gi, ''); value = value.replace(/<(\\w[^>]*) lang=([^ |>]*)([^>]*)/gi, \"<$1$3\");\n value = value.replace(/<SPAN\\s*>(.*?)<\\/SPAN>/gi, '$1'); value = value.replace(/<FONT\\s*>(.*?)<\\/FONT>/gi, '$1'); value = value.replace(/<\\\\?\\?xml[^>]*>/gi, \"\"); value = value.replace(/<\\/?\\w+:[^>]*>/gi, \"\");\n \n /*value = value.replace( /<H\\d>\\s*<\\/H\\d>/gi, '');*/\n /*value = value.replace( /<H1([^>]*)>/gi, '');*/\n /*value = value.replace( /<H2([^>]*)>/gi, '');*/\n /*value = value.replace( /<H3([^>]*)>/gi, '');*/\n /*value = value.replace( /<H4([^>]*)>/gi, '');*/\n /*value = value.replace( /<H5([^>]*)>/gi, '');*/\n /*value = value.replace( /<H6([^>]*)>/gi, '');*/\n /*value = value.replace( /<\\/H\\d>/gi, '<br>'); \n //remove this to take out breaks where Heading tags were*/\n /*value = value.replace( /<(U|I|STRIKE)>&nbsp;<\\/\\1>/g, '&nbsp;');*/\n /*value = value.replace( /<(B|b)>&nbsp;<\\/\\(b|B)>/g, '');*/\n\n value = value.replace(/<b>&nbsp;<\\/b>/g, ''); value = value.replace(/<([^\\s>]+)[^>]*>\\s*<\\/\\1>/g, ''); value = value.replace(/<([^\\s>]+)[^>]*>\\s*<\\/\\1>/g, ''); value = value.replace(/<([^\\s>]+)[^>]*>\\s*<\\/\\1>/g, '');\n //some RegEx code for the picky browsers\n var re = new RegExp(\"(<P)([^>]*>.*?)(<\\/P>)\", \"gi\"); \n value = value.replace(re, \"<div$2</div>\");\n var re2 = new RegExp(\"(<font|<FONT)([^*>]*>.*?)(<\\/FONT>|<\\/font>)\", \"gi\");\n value = value.replace(re2, \"<div$2</div>\"); \n value = value.replace(/size|SIZE = ([\\d]{1})/g, '');\n return value;\n };\n\n // TODO: optimize this function, check if element exists, add the element to the current dialog and show the message\n // function: handle error messages\n var _hem = function (b, m) {\n if (b) {\n $(\".modal-dialog > .content-navigator > .right-side > .tab > .rte_error\").html(m).removeClass(\"hide\");\n setTimeout(function () {\n _hem(false);\n }, 2500);\n }\n else {\n $(\".modal-dialog > .content-navigator > .right-side > .tab > .rte_error\").html(\"\").addClass(\"hide\");\n }\n }\n\n // function: make the editor grow its height based on the content\n var _editorFixSize = function (editor) {\n var innerDoc = (editor.get(0).contentDocument) ? editor.get(0).contentDocument : editor.get(0).contentWindow.document;\n if (innerDoc.body.scrollHeight != 0 && innerDoc.body.scrollHeight != undefined) {\n //editor.height(innerDoc.body.scrollHeight);\n editor.height(innerDoc.body.offsetHeight + 10);\n }\n return;\n };\n\n // function: execute a browser command for contenteditable elements\n // see https://developer.mozilla.org/en-US/docs/Web/API/document/execCommand\n var _cmd = function (e, x, y) { e.contentDocument.execCommand(x, false, y); };\n \n // function: add html content to the editor using the execCommand, usually used by tools\n var _cmd_addcontent = function (e, html) {\n var doc = e.contentWindow.document;\n\n if (doc.selection && doc.selection.createRange) {\n /* IE */\n var range = doc.selection.createRange();\n if (range.htmlText === '') {\n doc.body.innerHTML = doc.body.innerHTML + html;\n }\n else {\n range.pasteHTML(html);\n }\n } else {\n /* FF */\n if (!doc.execCommand('insertHTML', false, html)) {\n doc.body.innerHTML = doc.body.innerHTML + html;\n }\n }\n };\n \n // function: ajax Synchronous call\n var _callSync = function (url, onDone) {\n $.ajax({\n async: false,\n url: url,\n beforeSend: function( xhr ) {\n xhr.overrideMimeType(\"text/html;\");\n }\n }).done(function(data) {\n _eval(onDone(data));\n });\n };\n\n // function: open a modal dialog\n var _loadModal = function (settings) {\n /*\n settings:\n href : the url to be loaded (must return html)\n callback : after the dialog creation an ajax call will be performed. The callback will be executed on success\n title : dialog title\n noTitleBar : (true|false) if set to true the dialog title bar will be removed and the settings.title will be ignored. False is the default value\n customDialogId : set the dialog identifier (id) suffix\n buttons : dialog buttons, if not null\n REMOVED - mode\n */\n var dialogId = \"rte_tool_dialog\";\n\n if (settings.customDialogId) {\n dialogId = settings.customDialogId;\n }\n\n dialogId += _opts.id;\n\n // if the dialog already exists, will be removed before creation\n if ($(\"#\" + dialogId).length > 0) {\n $(\"#\" + dialogId).remove();\n }\n\n // check for empty title\n if (!settings.title) { \n settings.title = \"&nbsp;\"; \n }\n\n // add the dialog to the page\n $(\"body\").append('<div id=\"' + dialogId + '\" title=\"' + settings.title + '\"></div>');\n\n // the callbackbuilder function will be executed if the ajax call (below in the code) run with success\n var callbackbuilder = function () {\n \n // prepare the dialog\n $(\"#\" + dialogId).dialog({\n draggable: true, resizable: false, width: 'auto', height: 'auto', modal: true,\n position: { of: window, my: \"center\", at: \"center\", collision: \"flip\" },\n autoOpen: false,\n /*REM*///dialogClass: (settings.title) ? \"\" : 'no-title',\n close: function () { $(this).dialog('destroy').remove(); }\n });\n\n // check for titlebar removal\n if (settings.noTitleBar === true) {\n $(\".ui-dialog-titlebar\", $(\"#\" + dialogId).parent()).attr(\"style\", \"-moz-user-select: none; background: none repeat scroll 0% 0% transparent; position: absolute; height: 80px; width: 80%; border: medium none;\");\n $(\".ui-dialog-titlebar-close\", $(\"#\" + dialogId).parent()).hide();\n }\n\n // if no sialog buttons are passed as parameters or the length is zero, the button bar will be removed\n if (settings.buttons == null || _getObjectSize(settings.buttons)) {\n $('.ui-dialog-buttonpane').remove();\n }\n else if (_getObjectSize(settings.buttons) > 0) {\n // buttons found in parameterrs, get the current button set\n var dialog_buttons = $(\"#\" + dialogId).dialog(\"option\", \"buttons\");\n \n // extend the current buttons or add new\n if (dialog_buttons.length > 0) {\n $.extend(dialog_buttons, settings.buttons);\n }\n else {\n dialog_buttons = settings.buttons;\n }\n\n // add buttons to the dialog\n $(\"#\" + dialogId).dialog(\"option\", \"buttons\", dialog_buttons); // setter\n }\n\n // open the dialog and set the position to center screen\n $(\"#\" + dialogId).dialog('open');\n $(\"#\" + dialogId).dialog(\"option\", \"position\",\n {\n of: window,\n my: \"center center\",\n at: \"center center\",\n collision: \"flip flip\"\n });\n\n // evaluate callback function\n _eval(settings.callback($(\"#\" + dialogId)));\n };\n\n $(\"#\" + dialogId).load(settings.href, function (response, status, err) {\n switch (status) {\n case \"error\":\n alert(\"Error while loading the module: \" + err.status + \" \" + err.statusText, false);\n break;\n case \"success\":\n _eval(callbackbuilder);\n break;\n };\n return false;\n });\n };\n \n // function: show the add link tool\n var _cmd_aad_link = function () {\n _loadModal({\n href: _opts.domain + _opts.connectors.link.url,\n noTitleBar: true,\n customDialogId: null,\n buttons: _opts.connectors.link.buttons,\n callback: function (dialog) {\n $(\"#rte_createlink\").click(function () {\n if ($(\"#rte_linkvalue\").val() && $(\"#rte_linktext\").val()) {\n \n var html = '&nbsp;<a href=\"' + $(\"#rte_linkvalue\").val() + '\"[target]>' + $(\"#rte_linktext\").val() + '</a>&nbsp;';\n html = html.replace(\"[target]\", $(\"#rte_linktarget\").val() ? 'target=\"' + $(\"#rte_linktarget\").val() + '\"' : '');\n _cmd_addcontent($('#' + _opts.id).get(0), html);\n \n $(dialog).dialog('destroy').remove();\n }\n else {\n _hem(true, \"Completare tutti i campi per l'inserimento del link\");\n }\n });\n $(\"#rte_createlinkCancel\").unbind(\"click\").bind(\"click\", function () {\n $(dialog).dialog('destroy').remove();\n });\n }\n });\n };\n \n // function: show the add image tool\n var _cmd_aad_image = function () {\n _loadModal({\n href: _opts.domain + _opts.connectors.image.url,\n noTitleBar: true,\n customDialogId: null,\n buttons: _opts.connectors.image.buttons,\n callback: function (dialog) {\n $(\"#image_upload\").attr(\"action\", _opts.connectors.image.postUrl)\n $(\"#rte_createimage\").unbind(\"click\").bind(\"click\", function () {\n if ($(\"#rte_image\").attr(\"src\")) {\n var imageAttributes = \"\";\n /* SRC */imageAttributes += ' src=\"' + $(\"#rte_image\").attr(\"src\") + '\"';\n /* STYLE */if ($(\"#rte_image\").attr(\"style\") != \"\") { imageAttributes += ' style=\"' + $(\"#rte_image\").attr(\"style\") + '\"'; }\n /* ALIGNMENT */if ($(\"#rte_image\").attr(\"align\") != \"\") { imageAttributes += ' align=\"' + $(\"#rte_image\").attr(\"align\") + '\"'; }\n\n var html = '<img ' + imageAttributes + ' />';\n _cmd_addcontent($('#' + _opts.id).get(0), html);\n $(dialog).dialog('destroy').remove();\n }\n else {\n _hem(true, \"Completare tutti i campi per l'inserimento dell'immagine\");\n }\n });\n $(\"#rte_createimageCancel\").unbind(\"click\").bind(\"click\", function () {\n $(dialog).dialog('destroy').remove();\n });\n }\n });\n };\n\n // function: show the color picker tool\n var _cmd_color_picker = function () {\n _loadModal({\n href: _opts.domain + _opts.connectors.colorpicker.url,\n noTitleBar: true,\n customDialogId: null,\n buttons: _opts.connectors.colorpicker.buttons,\n callback: function (dialog) {\n\n $(\"#rte_colorpicker td\").each(function () {\n $(this).unbind(\"click\").bind(\"click\", function () {\n _cmd($('#' + _opts.id).get(0), 'forecolor', $(this).attr(\"bgcolor\"));\n $(dialog).dialog('destroy').remove();\n });\n });\n }\n });\n };\n\n // function: create the editor instance and add it to the page\n this.Create = function (o) {\n _opts = _extend(o, _defaults);\n\n if (_opts.domain.length == 0) {\n _opts.domain = window.location.origin;\n }\n if (_opts.domain.substr(-1) == '/') {\n _opts.domain = _opts.domain.substr(0, _opts.domain.length - 1);\n }\n\n _toolbarId = _opts.id + \"_toolbar\";\n\n // prepare the editor in page\n // wrap the editor\n $('#' + _opts.id).wrap('<div class=\"rte_editor\"></div>');\n\n //set editor (and wrapper) size\n $('#' + _opts.id).css({\n width: _opts.width,\n height: _opts.height,\n border: \"1px solid #dddddd\"\n });\n // adjust parent container\n $('#' + _opts.id).parent(\".rte_editor\").css({\n width: \"auto\",\n height: \"auto\"\n });\n\n // and load the toolbar\n $('#' + _opts.id).before('<div id=\"' + _toolbarId + '\"></div>');\n\n // toolbar size\n $('#' + _toolbarId).css({ width: $('#' + _opts.id).width() });\n // load buttons\n _callSync(_opts.domain + \"/springy/toolbar.htm\", function (data) {\n $('#' + _toolbarId).html(data);\n });\n // toolbar style\n if (_opts.style.length > 0 && typeof (_opts.style) === \"string\") {\n $('#' + _toolbarId + \" > .rte_toolbar\").addClass(_opts.style);\n }\n\n // add content to the editor if exists any\n _iframe = $('#' + _opts.id).contents().get(0);\n if ($('#' + _opts.fieldId) && $('#' + _opts.fieldId).val()) {\n _iframe.open();\n _iframe.write($('#' + _opts.fieldId).val());\n _iframe.close();\n }\n _iframe.designMode = 'on';\n\n // if editor auto size is enabled, attach the event on keyup to the iframe\n if (_opts.autosize) {\n _iframe.addEventListener('keyup', function () {\n _editorFixSize($('#' + _opts.id));\n }, true);\n }\n\n // toolbar bold\n $(\"#\" + _toolbarId + \" .cmd.rte_bold\").each(function () {\n $(this).unbind(\"click\").bind(\"click\", function () {\n _cmd($('#' + _opts.id).get(0), 'bold');\n return false;\n });\n });\n // toolbar italic\n $(\"#\" + _toolbarId + \" .cmd.rte_italic\").each(function () {\n $(this).unbind(\"click\").bind(\"click\", function () {\n _cmd($('#' + _opts.id).get(0), 'italic');\n return false;\n });\n });\n // toolbar underline\n $(\"#\" + _toolbarId + \" .cmd.rte_underline\").each(function () {\n $(this).unbind(\"click\").bind(\"click\", function () {\n _cmd($('#' + _opts.id).get(0), 'underline');\n return false;\n });\n });\n // toolbar justify left\n $(\"#\" + _toolbarId + \" .cmd.rte_justifyleft\").each(function () {\n $(this).unbind(\"click\").bind(\"click\", function () {\n _cmd($('#' + _opts.id).get(0), 'justifyleft');\n return false;\n });\n });\n // toolbar justify center\n $(\"#\" + _toolbarId + \" .cmd.rte_justifycenter\").each(function () {\n $(this).unbind(\"click\").bind(\"click\", function () {\n _cmd($('#' + _opts.id).get(0), 'justifycenter');\n return false;\n });\n });\n // toolbar justify right\n $(\"#\" + _toolbarId + \" .cmd.rte_justifyright\").each(function () {\n $(this).unbind(\"click\").bind(\"click\", function () {\n _cmd($('#' + _opts.id).get(0), 'justifyright');\n return false;\n });\n });\n // toolbar justify full\n $(\"#\" + _toolbarId + \" .cmd.rte_justifyfull\").each(function () {\n $(this).unbind(\"click\").bind(\"click\", function () {\n _cmd($('#' + _opts.id).get(0), 'justifyfull');\n return false;\n });\n });\n\n // toolbar create link\n $(\"#\" + _toolbarId + \" .cmd.rte_toollink\").each(function () {\n $(this).unbind(\"click\").bind(\"click\", function () {\n _cmd_aad_link();\n return false;\n });\n });\n // toolbar remove link\n $(\"#\" + _toolbarId + \" .cmd.rte_toollink_remove\").each(function () {\n $(this).unbind(\"click\").bind(\"click\", function () {\n _cmd($('#' + _opts.id).get(0), 'unlink');\n return false;\n });\n });\n // toolbar add image\n $(\"#\" + _toolbarId + \" .cmd.rte_toolimage\").each(function () {\n $(this).unbind(\"click\").bind(\"click\", function () {\n _cmd_aad_image();\n return false;\n });\n });\n // toolbar ordered list\n $(\"#\" + _toolbarId + \" .cmd.rte_insertorderedlist\").each(function () {\n $(this).unbind(\"click\").bind(\"click\", function () {\n _cmd($('#' + _opts.id).get(0), 'insertorderedlist');\n return false;\n });\n });\n // toolbar bullets list\n $(\"#\" + _opts.id + \"_toolbar .cmd.rte_insertunorderedlist\").each(function () {\n $(this).unbind(\"click\").bind(\"click\", function () {\n _cmd($('#' + _opts.id).get(0), 'insertunorderedlist');\n return false;\n });\n });\n // toolbar outdent\n $(\"#\" + _opts.id + \"_toolbar .cmd.rte_outdent\").each(function () {\n $(this).unbind(\"click\").bind(\"click\", function () {\n _cmd($('#' + _opts.id).get(0), 'outdent');\n return false;\n });\n });\n // toolbar indent\n $(\"#\" + _opts.id + \"_toolbar .cmd.rte_indent\").each(function () {\n $(this).unbind(\"click\").bind(\"click\", function () {\n _cmd($('#' + _opts.id).get(0), 'indent');\n return false;\n });\n });\n\n // toolbar font size\n $(\"#\" + _opts.id + \"_toolbar .cmd.rte_fontsize\").each(function () {\n $(this).unbind(\"change\").bind(\"change\", function () {\n _cmd($('#' + _opts.id).get(0), 'FontSize', this[this.selectedIndex].value);\n return false;\n });\n });\n // toolbar font color\n $(\"#\" + _opts.id + \"_toolbar .cmd.rte_forecolor\").each(function () {\n $(this).unbind(\"click\").bind(\"click\", function () {\n _cmd_color_picker();\n return false;\n });\n });\n // toolbar undo\n $(\"#\" + _opts.id + \"_toolbar .cmd.rte_undo\").each(function () {\n $(this).unbind(\"click\").bind(\"click\", function () {\n _cmd($('#' + _opts.id).get(0), 'undo');\n return false;\n });\n });\n // toolbar redo\n $(\"#\" + _opts.id + \"_toolbar .cmd.rte_redo\").each(function () {\n $(this).unbind(\"click\").bind(\"click\", function () {\n _cmd($('#' + _opts.id).get(0), 'redo');\n return false;\n });\n });\n\n // toolbar copy (disabled)\n //_iframe.addEventListener('copy', function() { alert('copy done!') });\n\n // toolbar cut (disabled)\n //_iframe.addEventListener('cut', function() { alert('cut behaviour detected!') });\n\n // toolbar paste, handled by iframe with purge regexp\n jQuery(_iframe).bind('paste', function (e) {\n e.preventDefault();\n var text = (e.originalEvent || e).clipboardData.getData('text/plain') || prompt('Paste something..');\n\n _cmd_addcontent($('#' + _opts.id).get(0), _purgeMSWordTags(text));\n setTimeout(function () {\n if (_opts.autosize) {\n _editorFixSize($('#' + _opts.id));\n }\n }, 150);\n });\n\n // add iframe Head informations for default styles\n //$('head', $('#' + _opts.id).get(0).contentWindow.document).append('<link rel=\"stylesheet\" href=\"/springy/css/editor-area.css\" type=\"text/css\">');\n\n // add iframe style informations\n if (_opts.usePageStyles) {\n $('body', $('#' + _opts.id).get(0).contentWindow.document).css(\"background-color\", \"#ffffff\");\n $('body', $('#' + _opts.id).get(0).contentWindow.document).css(\"color\", window.getComputedStyle(document.body).getPropertyValue('color'));\n $('body', $('#' + _opts.id).get(0).contentWindow.document).css(\"font-family\", window.getComputedStyle(document.body).getPropertyValue(\"font-family\"));\n $('body', $('#' + _opts.id).get(0).contentWindow.document).css(\"font-size\", window.getComputedStyle(document.body).getPropertyValue(\"font-size\"));\n $('body', $('#' + _opts.id).get(0).contentWindow.document).css(\"font-size-adjust\", window.getComputedStyle(document.body).getPropertyValue(\"font-size-adjust\"));\n $('body', $('#' + _opts.id).get(0).contentWindow.document).css(\"font-stretch\", window.getComputedStyle(document.body).getPropertyValue(\"font-stretch\"));\n $('body', $('#' + _opts.id).get(0).contentWindow.document).css(\"font-style\", window.getComputedStyle(document.body).getPropertyValue(\"font-style\"));\n $('body', $('#' + _opts.id).get(0).contentWindow.document).css(\"font-variant\", window.getComputedStyle(document.body).getPropertyValue(\"font-variant\"));\n $('body', $('#' + _opts.id).get(0).contentWindow.document).css(\"font-weight\", window.getComputedStyle(document.body).getPropertyValue(\"font-weight\"));\n $('body', $('#' + _opts.id).get(0).contentWindow.document).css(\"justify-content\", window.getComputedStyle(document.body).getPropertyValue(\"justify-content\"));\n $('body', $('#' + _opts.id).get(0).contentWindow.document).css(\"letter-spacing\", window.getComputedStyle(document.body).getPropertyValue(\"letter-spacing\"));\n //$('body', $('#' + _opts.id).get(0).contentWindow.document).css(\"line-height\", window.getComputedStyle(document.body).getPropertyValue(\"line-height\"));\n $('body', $('#' + _opts.id).get(0).contentWindow.document).css(\"line-height\", \"auto\");\n }\n\n // check if autosize is enabled and adjust the size/content first time, or add scrollbars to the iframe\n if (_opts.autosize) {\n $('#' + _opts.id).attr(\"scrolling\", \"no\");\n setTimeout(function () {\n _editorFixSize($('#' + _opts.id));\n }, 150);\n }\n else {\n $('#' + _opts.id).attr(\"scrolling\", \"auto\");\n }\n };\n\n // function: get the editor value\n this.value = function () {\n\n // get the content\n var val = $('#' + _opts.id).get(0).contentWindow.document.body.innerHTML;\n \n // remove all withespaces and br tags to check if the content is empty\n var test = val;\n test = test.replace(/\\n/g, \"\");\n test = test.replace(/[\\t ]+\\</g, \"<\");\n test = test.replace(/\\>[\\t ]+\\</g, \"><\");\n test = test.replace(/\\>[\\t ]+$/g, \">\");\n test = test.replace(/\\s+/g, \"\");\n test = test.replace(/(<br\\ ?\\/?>)+/g, \"\");\n \n // if the content length is zero, vall will be an empty string\n if (test.length == 0) {\n val = \"\";\n }\n\n temp = \"\";\n return val;\n };\n\n}", "title": "" }, { "docid": "854be2ccc3ffee3ee919a6b31b487f2b", "score": "0.5403829", "text": "function inspect(){\r\n\tvar monitor,path,file,nr,obj;\r\n\tmonitor = nset.Code;\r\n\tpath = monitor.Output.Location;\r\n\tfile = monitor.Output.File; \r\n\tnr = bfig.screen >1? bfig.screen -1 : 0;\r\n\tobj = gui.Window.open(path +\"/\" +file +\".html\",{\r\n\t\t\"title\": \"code\",\r\n\t\t\"name\": \"code\",\r\n\t\t//\"icon\": \"red.png\",\r\n\t\t\"toolbar\":false,\r\n\t\t\"frame\":true,\r\n\t\t\"show\":true,\r\n\t\t\"resizable\":true,\r\n\t\t\"x\":monitor.position[nr][0],\r\n\t\t\"y\":monitor.position[nr][1],\r\n\t\t\"width\": monitor.size[nr][0],\r\n\t\t\"height\": monitor.size[nr][1]\r\n\t});\r\n\tobj.on(\"resize\", function(){\r\n\t\tnset.oCode.size[nr] = [this.width,this.height];\r\n\t});\r\n\tobj.on(\"move\", function(){\r\n\t\tnset.oCode.position[nr] = [this.x,this.y];\r\n\t});\r\n\tobj.on(\"close\", function(){\r\n\t\tthis.show(false);\r\n\t\tmonitor.show = false;\r\n\t});\r\n\tobj.on(\"loaded\", function(){\r\n\t\tmonitor.win = win.length;\r\n\t\twin.push(this);\r\n\t\tthis.show(true);\r\n\t\tmonitor.show = true;\r\n\t});\r\n}", "title": "" }, { "docid": "835c17107d6b6a7341b3327b38103df9", "score": "0.5398555", "text": "function EditorState() {\n }", "title": "" }, { "docid": "3e808d7fb168bd127f1d87af66c9e7e4", "score": "0.53912514", "text": "initTextEditor() {\n // Add listener to show and hide text editor\n var showTextEditorBox = this.query(\"#showTextEditorBox\");\n showTextEditorBox.addEventListener('click', () => {\n if(showTextEditorBox.checked) {\n this.textEditor.style.display = 'flex';\n this.updateTextEditor();\n } else {\n this.textEditor.style.display = 'none';\n }\n });\n \n // Add listener to run code\n this.query('#runCodeButton').addEventListener('click', () => {\n try {\n let generated = lpe_babel.generate(this.ast, {\n retainFunctionParens: true\n });\n eval(generated.code);\n } catch (e) {\n window.alert(\"Could not run code\");\n console.error('LPE: Could not run code');\n }\n });\n }", "title": "" }, { "docid": "11592741dd01f4bad3208c15f2757b53", "score": "0.5387716", "text": "function onSaveText()\n{\n\tif( current_editor ) current_editor.saveText() ;\n}", "title": "" }, { "docid": "226edfe67572e221c8ab78e56d9c5b49", "score": "0.5386607", "text": "setEditor(editor) {\n this.editor = editor;\n }", "title": "" }, { "docid": "f753117a3d7c907bc0a2b61b6ba88cf9", "score": "0.53779995", "text": "function switchEditingComponent() {\n objectEditorComponent++;\n\n if (objectEditorComponent === OBJECT_EDITOR_COMPONENTS)\n {\n objectEditorComponent = 0;\n }\n}", "title": "" }, { "docid": "c06551bc8af2ff28886f47427742c03a", "score": "0.53761834", "text": "static get tag() {\n return \"rich-text-editor\";\n }", "title": "" }, { "docid": "a13ffe509834bf90e308875122bc5b76", "score": "0.53721726", "text": "if (null === editorState) {\n editorState = convertFromJSON(\n EMPTY_DOC_JSON,\n null,\n this._defaultEditorSchema,\n plugins,\n this._defaultEditorPlugins\n );\n this.showAlert();\n }", "title": "" }, { "docid": "1ca9f1171b2020b9020c7d11b83556ec", "score": "0.53655535", "text": "create_window(filename,text)\n {\n let new_session = new this.EditSession(text);\n\n // Disable the info text on the left.\n if(filename_to_kind(filename)===\"HTML\")\n {\n new_session.setUseWorker(false);\n }\n if(filename.endsWith(\".js\"))\n {\n new_session.setMode(\"ace/mode/javascript\");\n }\n else if(filename.endsWith(\".css\"))\n {\n new_session.setMode(\"ace/mode/css\");\n }\n else if(filename.endsWith(\".html\"))\n {\n new_session.setMode(\"ace/mode/html\");\n }\n new_session.on('change', function(delta) {\n this.save_current_file();\n if(this.navigator.current_menu != \"EDITOR\")\n {\n this.navigator.disable_all_menus();\n this.navigator.enable_menu_of_kind(\"EDITOR\");\n }\n }.bind(this));\n this.files.push([filename,new_session]);\n \n }", "title": "" }, { "docid": "1c743097da255e30ae5613f0f4b370df", "score": "0.5360749", "text": "switchEditorMode(mode) {\n this.target.mode = mode;\n this.init();\n }", "title": "" }, { "docid": "87256d21a8a168306f476ecf2d088c91", "score": "0.53392017", "text": "updateEditorValue(node){if(node){var content=\"\",children=node;if(\"TEMPLATE\"!==node.tagName){console.warn(\"code-editor works best with a template tag provided in light dom\");children=dom(this).getEffectiveChildNodes();if(0<children.length){// loop through everything found in the slotted area and put it back in\nfor(var j=0,len2=children.length;j<len2;j++){if(typeof children[j].tagName!==typeof void 0){content+=children[j].outerHTML}else{content+=children[j].textContent}}}}else{content=children.innerHTML}if(content){this.shadowRoot.querySelector(\"#codeeditor\").value=content.trim()}}}", "title": "" }, { "docid": "9d35339d0b9f4007194d6f0140f805aa", "score": "0.533529", "text": "function switchToDesignMode(){\n try{\n if(!isOndesignMode){\n disableElement(document.getElementById(\"textToolsContainer\"));\n document.getElementById(\"sourceTxt\").style.display=\"none\"\n textEditorElement.style.display=\"block\"\n usedFrame.innerHTML=document.getElementById(\"sourceTxt\").value;\n isOnSourceMode=false;\n isOndesignMode=true;\n }\n }\n catch(error){\n alert(error.name + \": \" + error.message + error.lineNumber);\n }\n}", "title": "" }, { "docid": "4334fa358fe0f5500351e2b8222ed817", "score": "0.5329479", "text": "function js() {\n}", "title": "" }, { "docid": "4334fa358fe0f5500351e2b8222ed817", "score": "0.5329479", "text": "function js() {\n}", "title": "" }, { "docid": "d1db949ff6e8c710f5254a743efa684a", "score": "0.53274393", "text": "function ImageManager(editor)\n{\n\n}", "title": "" }, { "docid": "6fb35cab99901b262bab197137a0505c", "score": "0.5327027", "text": "async function init_editor(data){\n if (!data){\n data =\n`//Create a new script\nmodule.exports = function(){\n return new Promise(function (resolve, reject) {\n if (ObjC.available) {\n\n } else if (Java.available) {\n Java.perform(function () {\n\n })\n } else {\n reject(new Error('Language not supported'))\n }\n\n });\n};\n`\n }\n // Load editor\n let loader = require('monaco-loader');\n let monaco = await loader();\n $scope.editor = monaco.editor.create(\n document.getElementById('container'), {\n language: 'javascript',\n // theme: 'vs-dark',\n // automaticLayout: true,\n value: data,\n wrappingColumn: set_wrap(window.innerWidth)\n });\n // If data is changed then save button is blue\n $scope.editor.addListener('contentChanged', () => {\n $scope.$parent.main.file.changed =\n !($scope.$parent.main.file.md5 === md5($scope.editor.getValue()));\n $scope.$parent.$apply()\n });\n }", "title": "" }, { "docid": "e53491f3b728234b439b42108d4db0a1", "score": "0.5322167", "text": "function openDefaultEditor() {\n var strURL = \"?MODALITA=NEW\";\n if (document.location.href.lastIndexOf(\"?\") != -1) {\n strURL = document.location.href.substring(document.location.href.lastIndexOf(\"/\") + 1, document.location.href.lastIndexOf(\"?\")).replace(\"_MSB_\", \"_MSE_\") + strURL;\n }\n else {\n strURL = document.location.href.substr(document.location.href.lastIndexOf(\"/\") + 1).replace(\"_MSB_\", \"_MSE_\") + strURL;\n }\n openEditor(strURL);\n}", "title": "" }, { "docid": "3d738b595b645e18a942a5579a4a4b87", "score": "0.5319936", "text": "function setupEditor() {\n var editor = ace.edit(\"src-code\");\n editor.setTheme(\"ace/theme/monokai\");\n editor.session.setMode(\"ace/mode/javascript\");\n\n var test = ace.edit(\"test-code\");\n test.setTheme(\"ace/theme/monokai\");\n test.session.setMode(\"ace/mode/javascript\");\n}", "title": "" }, { "docid": "54e5bfa49eafab4027e573bcc8c75d0a", "score": "0.5319852", "text": "static get tag(){return\"rich-text-editor-toolbar\"}", "title": "" }, { "docid": "f4a91b37505e2435a63ab1df225fd68e", "score": "0.53154534", "text": "function recreate_editor(){\n var chld = [$D(gvar.id_textarea).parentNode, $D(gvar.id_smilebox)]; // txtarea, smilebox\n var par = getByClas('panel', 'div'); // style yakin >,<\n par = getTag('div', par);\n var Attr, div0,ctbl,ctr,ctd, tbl,tr,td;\n tbl = mycreateElement('table', {cellpadding:'0',cellspacing:'0',border:'0'});\n tr = mycreateElement('tr',{}); \n td = mycreateElement('td',{id:'vB_Editor_001',colspan:'2','class':'vBulletin_editor',width:par[0].clientWidth});\n div0 = mycreateElement('div',{'class':'controlbar',id:'vB_Editor_001_controls'});\n Attr = {cellpadding:'0',cellspacing:'0',border:'0'};\n ctbl = mycreateElement('table',Attr);\n ctr = mycreateElement('tr',{});\n ctd = mycreateElement('td',{},false,'&nbsp;'); // harus &nbsp; utk xpath\n ctr.appendChild(ctd);\n ctd = mycreateElement('td',{width:'100%'},false,'&nbsp;'); // harus 100% utk xpath\n ctr.appendChild(ctd);\n ctbl.appendChild(ctr);\n div0.appendChild(ctbl);\n td.appendChild(div0);\n \n ctbl = mycreateElement('table',Attr);\n ctr = mycreateElement('tr',{});\n ctd = mycreateElement('td',{});\n ctr.appendChild(ctd);\n ctbl.appendChild(ctr); \n div0.appendChild(ctbl);\n td.appendChild(div0);\n // end vB_Editor_001_controls\n \n ctbl = mycreateElement('table',Attr);\n ctr = mycreateElement('tr',{});\n ctd = mycreateElement('td',{valign:'top'});\n ctd.appendChild(chld[0]); // appending textarea\n ctr.appendChild(ctd);\n ctd = mycreateElement('td',{valign:'top'});\n ctd.appendChild(chld[1]); // appending smilebox\n ctr.appendChild(ctd);\n ctbl.appendChild(ctr); \n td.appendChild(ctbl);\n tr.appendChild(td);\n\n tbl.appendChild(tr);\n par[0].appendChild(tbl); \n}", "title": "" }, { "docid": "92ca818db0bcbd730fe5171a893f80e9", "score": "0.5313687", "text": "function contenteditable(id, content, stylesheet, container) {\n\tvar html = '';\n\tcontenteditable_contents[id] = content;\n\tif (stylesheet) {\n\t\tvar stylesheet_toggle = document.getElementById('stylesheet_toggle');\n\t\tif (stylesheet_toggle) stylesheet_toggle.checked = true;\n\t\tcontenteditable_stylesheet[id] = stylesheet;\n\t} else {\n\t\tvar stylesheet_toggle = document.getElementById('stylesheet_toggle');\n\t\tif (stylesheet_toggle) stylesheet_toggle.checked = true;\n\t\tcontenteditable_stylesheet[id] = webeditor.rootpath + 'default.css';\n\t}\n\tvar style = '';\n\tstyle += 'width: ' + webeditor.width + '; height: ' + webeditor.height + ';';\n\tif (webeditor.minWidth) {\n\t\tstyle += ' min-width: ' + webeditor.minWidth + ';';\n\t}\n\tif (webeditor.maxWidth) {\n\t\tstyle += ' max-width: ' + webeditor.maxWidth + ';';\n\t}\n\tif (webeditor.minHeight) {\n\t\tstyle += ' min-height: ' + webeditor.minHeight + ';';\n\t}\n\tif (webeditor.maxHeight) {\n\t\tstyle += ' max-height: ' + webeditor.maxHeight + ';';\n\t}\n\tif ((webbrowser == \"MSIE\") && (webeditor.majorVersion == 6)) {\n\t\tif (webeditor.width == \"100%\") {\n\t\t\tstyle += ' width: auto !important;';\n\t\t\tif (webeditor.minWidth) {\n\t\t\t\tstyle += ' width: ' + webeditor.minWidth + ';';\n\t\t\t}\n\t\t}\n\t\tif (webeditor.height == \"100%\") {\n\t\t\tstyle += ' height: auto !important;';\n\t\t\tif (webeditor.minHeight) {\n\t\t\t\tstyle += ' height: ' + webeditor.minHeight + ';';\n\t\t\t}\n\t\t}\n\t}\n\thtml += '<textarea id=\"'+id+'_textarea\" name=\"'+id+'\" cols=\"1\" rows=\"1\" style=\"display:none\"></textarea>';\n\tif ((webeditor.type == \"safari\") && ((browserIs(\"iPad\")) || (browserIs(\"iPhone\")))) {\n\t\thtml += '<div style=\"width:'+webeditor.width+'px; height:'+webeditor.height+'px; overflow:auto; -webkit-overflow-scrolling:touch;\">';\n\t}\n\thtml += '<iframe src=\"' + webeditor.rootpath + 'empty.' + webeditor.language + '?basehref=' + encodeURIComponent(webeditor.baseHref) + '\" id=\"'+id+'\" class=\"webeditor_contenteditable\" width=\"' + webeditor.width + '\" height=\"' + webeditor.height + '\" style=\"' + style + '\">' + '</iframe>';\n//QQQ\thtml += '<iframe onblur=\"webeditor_onblur();\" onmouseover=\"webeditor_iframe_fix(this);\" src=\"' + webeditor.rootpath + 'empty.' + webeditor.language + '?basehref=' + encodeURIComponent(webeditor.baseHref) + '\" id=\"'+id+'\" class=\"webeditor_contenteditable\" width=\"' + webeditor.width + '\" height=\"' + webeditor.height + '\" style=\"' + style + '\">' + '</iframe>';\n\tif ((webeditor.type == \"safari\") && ((browserIs(\"iPad\")) || (browserIs(\"iPhone\")))) {\n\t\thtml += '</div>';\n\t}\n\n\tcontenteditable_inited[id] = false;\n\tcontenteditable_inited_document[id] = false;\n\tcontenteditable_inited_stylesheet[id] = false;\n\tif (container && (typeof(container)=='string') && document.getElementById(container)) {\n\t\tdocument.getElementById(container).innerHTML = html;\n\t} else if (container && (typeof(container)=='string') && (! document.getElementById(container))) {\n\t\t// ignore - non-existing container - contenteditable mode or error\n\t\twebeditor.contentEditable = true;\n\t} else if (container && (typeof(container.innerHTML)!='undefined')) {\n\t\tcontainer.innerHTML = html;\n\t} else {\n\t\tdocument.write(html);\n\t}\n}", "title": "" }, { "docid": "3c087261da882dd6ba1573bcc72de35a", "score": "0.5312821", "text": "function dt_init_new_editor( editor_id ){\r\n\t\tif ( typeof tinyMCEPreInit.mceInit[editor_id] != undefined ) {\r\n\t\t\tquicktags( { id : editor_id, buttons:\"strong,em,link,block,del,ins,img,ul,ol,li,code,more,spell,close\" } );\r\n\t\t\treturn;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "8d64d8dfdad0e9d0f8e5b9222cacce88", "score": "0.5306012", "text": "function jc_render_texteditor(context, myHeight, myWidth, editorId, urlPrefix, disabledFlag) {\r\n\t// Ignore the disable flag until problem with YUI Is resolved.\r\n\tdisabledFlag = false;\r\n\t\r\n\tvar myConfig = {\r\n\t height: myHeight + 'px',\r\n//\t width: myWidth,\r\n\t disabled: disabledFlag\r\n\t};\r\n\t\r\n\tvar objectName = 'jc_editor_' + editorId;\r\n\tvar cmd = objectName + ' = new YAHOO.widget.Editor(\\'' + editorId + '\\', myConfig);';\r\n\teval(cmd);\r\n\teval('editor = ' + objectName);\r\n\teditor.render();\r\n//\teditor.set('disabled', disabledFlag);\r\n/*\r\n editor.addListener('editorContentLoaded', function(master) {\r\n \talert(\"done\");\r\n \teditor.set('disabled', false);\r\n \teditor.setEditorHTML('testing');\r\n \teditor.set('disabled', true);\r\n });\r\n*/ \r\n\tvar heightValue = 600 + 'px';\r\n\tvar jsiu_config = {\r\n\t height: heightValue,\r\n\t width: '600px',\r\n\t linkStyle: 'yui_image_browser_a',\r\n\t textStyle: 'yui_image_browser_text',\r\n\t urlPrefix: urlPrefix\r\n\t}\r\n\tjsiu_getInstance(context, editor, jsiu_config);\r\n}", "title": "" }, { "docid": "4c62b664cbd7ae89f14966af64d69242", "score": "0.5304794", "text": "function e3_Editor(targetId, options)\n{\n\tvar _me = this;\n\n\tthis._target = ($.type(targetId) === \"string\") ? $(\"#\" + targetId) : targetId;\n\tthis._tools = null;\n\tthis._editor = null;\n\tthis._picker = null;\n\tthis._myfilesUserId = null;\n\tthis._toolButtons = {};\n\tthis._enabled = false;\n\tthis._onChange = null;\n\n\tthis._i18n = new e3_i18n(etudes_editor_i10n, \"en-us\");\n\tthis._i18n.init();\n\n\t// TODO: \n\tthis._options = \n\t{\n\t\tsites: \"T\", // F, T, H\n\t\tsidebar: true,\n\t\tautoSidebar: true,\n\t\teditor: \n\t\t{\n\t\t\tsize:\"S\", // S, L\n\t\t\tshape:\"R\", // S, R\n\t\t\toutline:\"F\" // T, F\n\t\t}\n\t};\n\n\tthis._commands =\n\t[\n\t\t{key:\"undo\", dflt:\"undo\", icon:\"action-undo\", cmd:\"undo\"},\n\t\t{key:\"redo\", dflt:\"redo\", icon:\"action-redo\", cmd:\"redo\"},\n\t\t{key:\"selectall\", dflt:\"select all\", icon:\"infinity\", cmd:\"selectAll\"},\n\t\t{key:\"heading\", dflt:\"heading\", icon:\"header\", special:function(a)\n\t\t\t{\n\t\t\t\t$(a).contextPopup(\n\t\t\t\t{\n\t\t\t\t\tevent: \"click\",\n\t\t\t\t\t// title: _me._i18n.lookup(\"label_styles\", \"Styles\"),\n\t\t\t\t\titems:\n\t\t\t\t\t[\n\t\t\t\t {label:_me._i18n.lookup(\"style_h1\", \"H1\"), action:function(){_me._command(\"formatBlock\",\"h1\");return false;}},\n\t\t\t\t {label:_me._i18n.lookup(\"style_h2\", \"H2\"), action:function(){_me._command(\"formatBlock\",\"h2\");return false;}},\n\t\t\t\t {label:_me._i18n.lookup(\"style_h3\", \"H3\"), action:function(){_me._command(\"formatBlock\",\"h3\");return false;}},\n\t\t\t\t {label:_me._i18n.lookup(\"style_h4\", \"H4\"), action:function(){_me._command(\"formatBlock\",\"h4\");return false;}},\n\t\t\t\t {label:_me._i18n.lookup(\"style_h5\", \"H5\"), action:function(){_me._command(\"formatBlock\",\"h5\");return false;}},\n\t\t\t\t {label:_me._i18n.lookup(\"style_h6\", \"H6\"), action:function(){_me._command(\"formatBlock\",\"h6\");return false;}},\n\t\t\t\t null,\n\t\t\t\t {label:_me._i18n.lookup(\"style_pre\", \"pre\"), action:function(){_me._command(\"formatBlock\",\"pre\");return false;}},\n\t\t\t\t {label:_me._i18n.lookup(\"style_div\", \"div\"), action:function(){_me._command(\"formatBlock\",\"div\");return false;}},\n\t\t\t\t {label:_me._i18n.lookup(\"style_p\", \"p\"), action:function(){_me._command(\"formatBlock\",\"p\");return false;}}\n\t\t\t\t\t]\n\t\t\t\t});\n\t\t\t}},\n\t\t{key:\"bold\", dflt:\"bold\", icon:\"bold\", cmd:\"bold\"},\n\t\t{key:\"italic\", dflt:\"italic\", icon:\"italic\", cmd:\"italic\"},\n\t\t{key:\"underline\", dflt:\"underline\", icon:\"underline\", cmd:\"underline\"},\n\t\t{key:\"strikethrough\", dflt:\"strike through\", icon:\"strikethrough\", cmd:\"strikeThrough\"},\n\t\t{key:\"subscript\", dflt:\"subscript\", icon:\"arrow-bottom\", cmd:\"subscript\"},\n\t\t{key:\"superscript\", dflt:\"superscript\", icon:\"arrow-top\", cmd:\"superscript\"},\n\t\t{key:\"removeFormat\", dflt:\"clear\", icon:\"bolt\", cmd:\"removeFormat\"},\n\t\t{key:\"image\", dflt:\"image\", icon:\"image\", click:function(){_me._image();}},\n\t\t{key:\"emoji\", dflt:\"emoji\", icon:\"star\", click:function(){_me._emoji();}},\n\t\t{key:\"hr\", dflt:\"hr\", icon:\"minus\", cmd:\"insertHorizontalRule\"},\n\t\t{key:\"link\", dflt:\"link\", icon:\"link-intact\", click:function(){_me._link();}, special:function(a){_me._toolButtons[\"createLink\"] = a;}},\n\t\t{key:\"unlink\", dflt:\"unlink\", icon:\"link-broken\", cmd:\"unlink\"},\n\t\t{key:\"alignleft\", dflt:\"align left\", icon:\"align-left\", cmd:\"justifyLeft\"},\n\t\t{key:\"aligncenter\", dflt:\"align center\", icon:\"align-center\", cmd:\"justifyCenter\"},\n\t\t{key:\"alignright\", dflt:\"align right\", icon:\"align-right\", cmd:\"justifyRight\"},\n\t\t{key:\"alignfull\", dflt:\"justify\", icon:\"justify-center\", cmd:\"justifyFull\"},\n\t\t{key:\"indent\", dflt:\"increase indent\", icon:\"account-login\", cmd:\"indent\"},\n\t\t{key:\"outdent\", dflt:\"decrease indent\", icon:\"account-logout\", cmd:\"outdent\"},\t\t\n\t\t{key:\"print\", dflt:\"print\", icon:\"print\", click:function(){_me._print();}},\n\t\t{key:\"source\", dflt:\"source\", icon:\"code\", click:function(){_me._show();}}\n\t];\n\n\tthis._init = function()\n\t{\n\t\t_me._tools = $(\"<div />\");\n\t\t_me._tools.addClass(\"e3_editor_toolbar\");\n\t\t_me._editor = $(\"<div />\");\n\t\t_me._editor.addClass(\"e3_content\");\n\t\t\n\t\t_me._target.empty();\n\t\t_me._target.append(_me._tools);\n\t\t_me._target.append(_me._editor);\n\n\t\t$.each(_me._commands, function(index, command)\n\t\t{\n\t\t\ta = $(\"<a />\", {href:\"\", title:_me._i18n.lookup(command.key, command.dflt, \"title\"), \"class\":\"e3_editorTool\"});\n\t\t\ta.addClass(\"e3_icon_\" + command.icon + ((_me._options.editor.size == \"L\") ? \"_16x16\" : \"_8x8\"));\n\t\t\tif (command.special != null)\n\t\t\t{\n\t\t\t\tcommand.special(a);\n\t\t\t}\n\t\t\tif (command.cmd != null)\n\t\t\t{\n\t\t\t\tonClick(a, function(){_me._command(command.cmd);});\n\t\t\t\t_me._toolButtons[command.cmd] = a;\n\t\t\t}\n\t\t\telse if (command.click != null)\n\t\t\t{\n\t\t\t\tonClick(a, command.click);\n\t\t\t}\n\t\t\t_me._tools.append(a);\t\t\t\n\t\t});\n\t\t\n\t\tif ($(\"#editor_picker\").length == 0)\n\t\t{\n\t\t\tvar dialogDiv = $(\"<div />\", {id:\"editor_picker\", title:_me._i18n.lookup(\"picker\", \"Select\", \"title\"), style:\"display:none;\"});\n\t\t\t$(\"#portal_content\").append(dialogDiv);\n\t\t\tvar instructionsDiv = $(\"<div />\", {\"class\":\"e3_dialogBody\"}).html(_me._i18n.lookup(\"picker\", \"Select to insert\"));\n\t\t\t$(dialogDiv).append(instructionsDiv);\n\t\t\tvar div = $(\"<div />\", {id:\"editor_picker_gallery\"});\n\t\t\t$(dialogDiv).append(div);\n\t\t}\n\t\t_me._picker = $(\"#editor_picker_gallery\");\n\n\t\tif ($(\"#editor_emoji\").length == 0)\n\t\t{\n\t\t\tvar dialogDiv = $(\"<div />\", {id:\"editor_emoji\", title:_me._i18n.lookup(\"picker\", \"Select\", \"title\"), style:\"display:none;\"});\n\t\t\t$(\"#portal_content\").append(dialogDiv);\n\t\t\tvar div = $(\"<div />\", {id:\"editor_emoji_gallery\", \"class\":\"e3_dialogBody\", style:\"font-size:24px;\"});\n\t\t\t$(dialogDiv).append(div);\n\n\t\t\t// the emoticons block\n\t\t\tfor (var code = 0x1F600; code <= 0x1F64F; code++)\n\t\t\t{\n\t\t\t\t// skip these\n\t\t\t\tif ((code >= 0x1F641) && (code <= 0x1F644)) continue;\n\n\t\t\t\t_me._setPickerChar(div, code, \"editor_emoji\");\n\t\t\t}\n\n\t\t\t// the Transport and Map Symbols Block\n\t\t\t$(div).append(\"<hr />\");\n\t\t\tfor (var code = 0x1F680; code <= 0x1F6C5; code++)\n\t\t\t{\n\t\t\t\t// skip these\n\t\t\t\tif ((code >= 0x1F641) && (code <= 0x1F644)) continue;\n\n\t\t\t\t_me._setPickerChar(div, code, \"editor_emoji\");\n\t\t\t}\n\n\t\t\t// the Miscellaneous Symbols and Pictographs Block\n\t\t\t$(div).append(\"<hr />\");\n\t\t\tfor (var code = 0x1F300; code <= 0x1F5FF; code++)\n\t\t\t{\n\t\t\t\t// skip these\n\t\t\t\tif (((code >= 0x1F321) && (code <= 0x1F32F))\n\t\t\t\t\t\t|| (code == 0x1F336)\n\t\t\t\t\t\t|| ((code >= 0x1F37D) && (code <= 0x1F37F))\n\t\t\t\t\t\t|| ((code >= 0x1F394) && (code <= 0x1F39F))\n\t\t\t\t\t\t|| ((code >= 0x1F3CB) && (code <= 0x1F3DF))\n\t\t\t\t\t\t|| ((code >= 0x1F3F1) && (code <= 0x1F3FF))\n\t\t\t\t\t\t|| (code == 0x1F43F)\n\t\t\t\t\t\t|| (code == 0x1F441)\n\t\t\t\t\t\t|| (code == 0x1F4F8)\n\t\t\t\t\t\t|| ((code >= 0x1F4FD) && (code <= 0x1F4FF))\n\t\t\t\t\t\t|| ((code >= 0x1F53E) && (code <= 0x1F54F))\n\t\t\t\t\t\t|| ((code >= 0x1F568) && (code <= 0x1F5FA))) continue;\n\n\t\t\t\t_me._setPickerChar(div, code, \"editor_emoji\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($(\"#editor_link\").length == 0)\n\t\t{\n\t\t\tvar dialogDiv = $(\"<div />\", {id:\"editor_link\", title:_me._i18n.lookup(\"linker\", \"Link URL\", \"title\"), style:\"display:none;\"});\n\t\t\t$(\"#portal_content\").append(dialogDiv);\n\t\t\tvar div = $(\"<div />\", {id:\"editor_linker_body\", \"class\":\"e3_dialogBody\"});\n\t\t\t$(dialogDiv).append(div);\n\t\t\tvar sect = $(\"<div />\", {\"class\":\"e3_section\"});\n\t\t\t$(div).append(sect);\n\t\t\tvar fldSet = $(\"<fieldset />\", {\"class\":\"e3_horizontal\"});\n\t\t\t$(sect).append(fldSet);\n\t\t\tvar entryDiv = $(\"<div />\", {\"class\":\"e3_entry\"});\n\t\t\t$(fldSet).append(entryDiv);\n\t\t\tvar label = $(\"<label />\", {\"class\":\"e3_label\", \"for\":\"editor_link_url\"}).text(\"Link URL\");\n\t\t\t$(entryDiv).append(label);\n\t\t\tvar input = $(\"<input size='80' type='text' value='' class='e3_data' id='editor_link_url'/>\");\n\t\t\t$(entryDiv).append(input);\n\t\t}\n\t\t\n\t\tif (_me._options.editor.shape == \"R\")\n\t\t{\n\t\t\t_me._tools.find(\".e3_editorTool\").addClass(\"round\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t_me._tools.find(\".e3_editorTool\").addClass(\"square\");\n\t\t}\n\t\tif (_me._options.editor.outline == \"T\")\n\t\t{\n\t\t\t_me._tools.find(\".e3_editorTool\").addClass(\"outline\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t_me._tools.find(\".e3_editorTool\").addClass(\"noOutline\");\t\n\t\t}\n\t};\n\n\tthis._setPickerChar = function(div, code, dialogId)\n\t{\n\t\tvar html = \"&#x\" + code.toString(16) + \";\"\n\t\tvar a = $(\"<a />\", {href:\"\", \"class\":\"e3_toolUiLink\", title:html}).html(html + \" \");\n\t\tonClick(a, function()\n\t\t{\n\t\t\t_me._command(\"insertHtml\", html);\n\t\t\tportal_tool.dialogs.close(dialogId);\n\t\t});\n\t\t$(div).append(a);\n\t};\n\n\tthis._stealthCommand = function(cmd, arg)\n\t{\n\t\t// https://developer.mozilla.org/en-US/docs/Web/API/document.execCommand\n\t\t// https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#execcommand()\n\t\t// TODO: copy paste cut are all \"insecure\", may need our own clipboard\n\t\ttry\n\t\t{\n\t\t\tdocument.execCommand(cmd, false, arg);\n\t\t}\n\t\tcatch (err)\n\t\t{\n\t\t\terror(err);\n\t\t}\n\t};\n\n\tthis._command = function(cmd, arg)\n\t{\n\t\t_me._stealthCommand(cmd, arg);\n\n\t\t_me._updateButtons();\n\t\t_me._changed();\n\t\t_me._editor.focus();\n\t};\n\n\tthis._updateButtons = function()\n\t{\n\t\t// http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html\n\t\t// https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html\n\t\tvar range = rangy.getSelection().getRangeAt(0);\n\t\tvar container = range.commonAncestorContainer;\n\t\tif (container.nodeType == 3) {container = container.parentNode;}\n//\t\tconsole.log(\"rangy.getSelection\",rangy.getSelection());\n//\t\tconsole.log(\"range\",range);\n//\t\tconsole.log(\"container\",container);\n//\t\tconsole.log(\"window.getSelection()\", window.getSelection());\n//\t\tconsole.log(\"window.getSelection().toString()\", window.getSelection().toString());\n//\t\tconsole.log(\"window.getSelection().getRangeAt(0)\", window.getSelection().getRangeAt(0));\n\t\t\n\t\tvar isAnchor = container.nodeName === \"A\";\n\n\t\t$(\".e3_editorTool\").removeClass(\"active\");\n\t\t$.each(_me._toolButtons, function(name, value)\n\t\t{\n\t\t\tvar state = document.queryCommandState(name);\n\t\t\t\n\t\t\tif (state && name == \"underline\" && isAnchor) state = false;\n\n\t\t\tif (state)\n\t\t\t{\n\t\t\t\t_me._toolButtons[name].addClass(\"active\");\n\t\t\t}\n\t\t});\n\n\t\tif (isAnchor)\n\t\t{\n\t\t\t_me._toolButtons[\"unlink\"].addClass(\"active\");\n\t\t}\n\t};\n\n\tthis._image = function()\n\t{\n\t\t$(_me._picker).empty();\n\t\t\n\t\t// get myFiles\n\t\tvar params = portal_tool.cdp.params();\n\t\tif (_me._myfilesUserId != null)\n\t\t{\n\t\t\tparams.url.id = _me._myfilesUserId;\n\t\t}\n\t\tparams.url.type = \"image/\";\n\t\tportal_tool.cdp.request(\"myfiles_get\", params, function(data)\n\t\t{\n\t\t\t$.each(data.myfiles, function(index, file)\n\t\t\t{\n\t\t\t\tvar figure = $(\"<figure />\",{style:\"display:inline-block;\"});\n\t\t\t\tvar caption = $(\"<figcaption />\").html(file.name);\n\t\t\t\tvar img = $(\"<img />\", {src: file.downloadUrl, border:\"0\", alt:file.name, style:\"width:64px; height:auto;\"});\n\t\t\t\t$(figure).append(img);\n\t\t\t\t$(figure).append(caption);\n\t\t\t\tvar a = $(\"<a />\", {href:\"\", class:\"e3_toolUiLinkU\"});\n\t\t\t\tonClick(a, function()\n\t\t\t\t{\n\t\t\t\t\tvar html = \"<img class='e3_editorImage' id='e3_editorNewImage' src='\" + file.downloadUrl + \"' />\";\n\t\t\t\t\t_me._command(\"insertHtml\", html);\n\n\t\t\t\t\tvar img = $(\"#e3_editorNewImage\").removeAttr(\"id\");\n\t\t\t\t\t_me._setImageContextMenu(img);\n\n\t\t\t\t\tportal_tool.dialogs.close(\"editor_picker\");\n\t\t\t\t});\n\t\t\t\t$(a).append(figure);\n\t\t\t\t$(_me._picker).append(a);\n\t\t\t\tif ((index+1) % 4 == 0) $(_me._picker).append(\"<br />\");\n\t\t\t});\n\t\t});\n\n\t\tvar sel = rangy.getSelection();\n\t\tvar range = sel.getRangeAt(0);\n\t\tportal_tool.dialogs.openAlert(\"editor_picker\", function()\n\t\t{\n\t\t\t_me._editor.focus();\n\t\t\tsel.removeAllRanges();\n\t\t\tsel.addRange(range);\n\t\t});\n\t\treturn false;\n\t};\n\n\tthis._setImageContextMenu = function(img)\n\t{\n\t\t$(img).contextPopup(\n\t\t{\n\t\t\ttitle: _me._i18n.lookup(\"label_actions\", \"Actions\"),\n\t\t\titems:\n\t\t\t[\n\t\t {label:_me._i18n.lookup(\"action_undo\", \"Undo\"), icon:'/ui/icons/action-undo-2x.png', action:function(){_me._command(\"undo\");return false;}},\n\t\t null,\n\t\t {label:_me._i18n.lookup(\"action_cut\", \"Cut\"), icon:'/ui/icons/flag_green.png', action:function(){_me._command(\"undo\");return false;}},\n\t\t {label:_me._i18n.lookup(\"action_copy\", \"Copy\"), icon:'/ui/icons/magnifier.png', action:function(){_me._command(\"undo\");return false;}},\n\t\t {label:_me._i18n.lookup(\"action_paste\", \"Paste\"), icon:'/ui/icons/arrow_down.png', action:function(){_me._command(\"undo\");return false;}},\n\t\t {label:_me._i18n.lookup(\"action_delete\", \"Delete\"), icon:'/ui/icons/arrow_down.png', action:function(){_me._command(\"undo\");return false;}},\n\t\t null,\n\t\t {label:_me._i18n.lookup(\"action_selectAll\", \"Select All\"), icon:'/ui/icons/ui-text-field-select.png', action:function(){_me._command(\"selectAll\");return false;}},\n\t\t null,\n\t\t {label:_me._i18n.lookup(\"action_imageProperties\", \"Image Properties\"), icon:'/ui/icons/file-2x.png', action:function(){_me._imageProperties(img);return false;}},\n\t\t\t]\n\t\t});\n\t};\n\n\tthis._setAContextMenu = function(a)\n\t{\n\t\t$(a).contextPopup(\n\t\t{\n\t\t\ttitle: _me._i18n.lookup(\"label_actions\", \"Actions\"),\n\t\t\titems:\n\t\t\t[\n\t\t {label:_me._i18n.lookup(\"action_undo\", \"Undo\"), icon:'/ui/icons/action-undo-2x.png', action:function(){_me._command(\"undo\");return false;}},\n\t\t null,\n\t\t {label:_me._i18n.lookup(\"action_cut\", \"Cut\"), icon:'/ui/icons/flag_green.png', action:function(){_me._command(\"undo\");return false;}},\n\t\t {label:_me._i18n.lookup(\"action_copy\", \"Copy\"), icon:'/ui/icons/magnifier.png', action:function(){_me._command(\"undo\");return false;}},\n\t\t {label:_me._i18n.lookup(\"action_paste\", \"Paste\"), icon:'/ui/icons/arrow_down.png', action:function(){_me._command(\"undo\");return false;}},\n\t\t {label:_me._i18n.lookup(\"action_delete\", \"Delete\"), icon:'/ui/icons/arrow_down.png', action:function(){_me._command(\"undo\");return false;}},\n\t\t null,\n\t\t {label:_me._i18n.lookup(\"action_selectAll\", \"Select All\"), icon:'/ui/icons/ui-text-field-select.png', action:function(){_me._command(\"selectAll\");return false;}},\n\t\t null,\n\t\t {label:_me._i18n.lookup(\"action_linkProperties\", \"Link Properties\"), icon:'/ui/icons/link-intact-2x.png', action:function(){_me._linkProperties(a);return false;}},\n\t\t\t]\n\t\t});\n\t};\n\n\tthis._emoji = function()\n\t{\n\t\tvar sel = rangy.getSelection();\n\t\tvar range = sel.getRangeAt(0);\n\t\tportal_tool.dialogs.openAlert(\"editor_emoji\", function()\n\t\t{\n\t\t\t_me._editor.focus();\n\t\t\tsel.removeAllRanges();\n\t\t\tsel.addRange(range);\n\t\t});\n\t\treturn false;\n\t};\n\t\n\tthis._link = function()\n\t{\n\t\tvar sel = rangy.getSelection();\n\t\tvar range = sel.getRangeAt(0);\n\n\t\tvar container = range.commonAncestorContainer;\n\t\tif (container.nodeType == 3) container = container.parentNode;\n\t\tif (container.nodeName === \"A\")\n\t\t{\n\t\t\t$(\"#editor_link_url\").val($(container).attr(\"href\"));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$(\"#editor_link_url\").val(sel.toString());\n\t\t}\n\n\t\tportal_tool.dialogs.openDialog(\"editor_link\", _me._i18n.lookup(\"button_add\", \"Set\"), function()\n\t\t{\n\t\t\tvar url = $.trim($(\"#editor_link_url\").val());\n\t\t\t_me._editor.focus();\n\t\t\tsel.removeAllRanges();\n\t\t\tsel.addRange(range);\n\t\t\t_me._command(\"createLink\", url);\n\t\t\t\n\t\t\t_me._editor.find(\"a\").each(function(index)\n\t\t\t{\n\t\t\t\t$(this).off(\"contextmenu\");\n\t\t\t\t_me._setAContextMenu(this);\n\t\t\t});\n\t\t\t\n\t\t\treturn true;\n\t\t}, function()\n\t\t{\n\t\t\t_me._editor.focus();\n\t\t\tsel.removeAllRanges();\n\t\t\tsel.addRange(range);\n\t\t});\n\n\t\treturn false;\n\t};\n\n\tthis._show = function()\n\t{\n\t\tconsole.log(\"contents\", $.trim(_me._editor.html()));\n\t\tconsole.log(\"cleaned\", _me.get());\n\t\treturn false;\n\t};\n\n\tthis._imageProperties = function(image)\n\t{\n\t\tconsole.log(\"image properties\", image);\n\t\tconsole.log(\"image src\", $(image).attr(\"src\"));\n\t\t_me._changed();\n\t};\n\n\tthis._linkProperties = function(a)\n\t{\n\t\tconsole.log(\"link properties\", a);\n\t\tconsole.log(\"link href\", $(a).attr(\"href\"));\n\t\t_me._changed();\n\t};\n\n\tthis._changed = function()\n\t{\n\t\tif (_me._onChange != null)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_me._onChange();\n\t\t\t}\n\t\t\tcatch (e)\n\t\t\t{\n\t\t\t\terror(e);\n\t\t\t}\n\t\t}\n\t};\n\n\tthis.enable = function(onChange, withFocus)\n\t{\n\t\t_me._onChange = onChange;\n\t\tif (_me._enabled) return;\n\n\t\t_me._enabled = true;\n\t\t_me._editor.addClass(\"e3_editor_body\");\n\t\t_me._editor.css({height: (((options !== undefined) && (options.height !== undefined)) ? options.height : 600)});\n\t\t_me._editor.css(\"overflow\", \"auto\");\n\t\t_me._editor.attr(\"contenteditable\", true);\n\t\t_me._editor.on('drop', function(e){return _me._onDrop(e);});\n\t\t_me._editor.on('dragover', function(e){return _me._onDragover(e);});\n\t\t_me._tools.removeClass(\"e3_offstage\");\n\t\t_me._editor.on('keyup', function(e){_me._onkeyup(); return true;});\n\t\t_me._editor.on('mouseup', function(e){_me._onmouseup(); return true;});\n\t\t\n\t\t_me._editor.contextPopup(\n\t\t{\n\t\t\ttitle: _me._i18n.lookup(\"label_actions\", \"Actions\"),\n\t\t\titems:\n\t\t\t[\n\t\t {label:_me._i18n.lookup(\"action_undo\", \"Undo\"), icon:'/ui/icons/action-undo-2x.png', action:function(){_me._command(\"undo\");return false;}},\n\t\t null,\n\t\t {label:_me._i18n.lookup(\"action_cut\", \"Cut\"), icon:'/ui/icons/flag_green.png', action:function(){_me._command(\"cut\"); return false;}},\n\t\t {label:_me._i18n.lookup(\"action_copy\", \"Copy\"), icon:'/ui/icons/magnifier.png', action:function(){_me._command(\"copy\");return false;}},\n\t\t {label:_me._i18n.lookup(\"action_paste\", \"Paste\"), icon:'/ui/icons/arrow_down.png', action:function(){_me._command(\"paste\");return false;}},\n\t\t {label:_me._i18n.lookup(\"action_delete\", \"Delete\"), icon:'/ui/icons/arrow_down.png', action:function(){_me._command(\"delete\");return false;}},\n\t\t null,\n\t\t {label:_me._i18n.lookup(\"action_selectAll\", \"Select All\"), icon:'/ui/icons/ui-text-field-select.png', action:function(){_me._command(\"selectAll\");return false;}}\n\t\t\t]\n\t\t});\n\t\t_me._editor.find(\"img\").each(function(index)\n\t\t{\n\t\t\t_me._setImageContextMenu(this);\n\t\t});\n\t\t_me._editor.find(\"a\").each(function(index)\n\t\t{\n\t\t\t_me._setAContextMenu(this);\n\t\t});\n\t\t\n\t\tif ((withFocus === undefined) || withFocus) _me._editor.focus();\n\t\t_me._stealthCommand(\"styleWithCSS\", true);\n\t\t_me._stealthCommand(\"insertBrOnReturn\", false);\n\t\t_me._stealthCommand(\"defaultParagraphSeparator\", \"div\"); // chrome, safari, not ff\n\t};\n\n\tthis.disable = function()\n\t{\n\t\tif (!_me._enabled) return;\n\n\t\t_me._editor.blur();\n\t\t_me._editor.off(\"contextmenu\");\n\t\t_me._editor.find(\"img\").off(\"contextmenu\");\n\t\t_me._editor.off('keyup');\n\t\t_me._editor.off('mouseup');\n\t\t_me._editor.off('dragover');\n\t\t_me._editor.off('drop');\n\t\t_me._editor.attr(\"contenteditable\", false);\n\t\t_me._editor.prop(\"style\").removeProperty(\"height\");\n\t\t_me._editor.prop(\"style\").removeProperty(\"width\");\n\t\t_me._editor.prop(\"style\").removeProperty(\"overflow\");\n\t\t_me._editor.removeClass(\"e3_editor_body\");\n\t\t_me._tools.addClass(\"e3_offstage\");\n\t\t_me._enabled = false;\n\t};\n\n\tthis.isEnabled = function()\n\t{\n\t\treturn _me._enabled;\n\t};\n\n\tthis.set = function(value)\n\t{\n\t\t_me._editor.empty();\n\t\tif (value != null)\n\t\t{\n\t\t\t_me._editor.html(value);\n\t\t}\n\t};\n\n\tthis.get = function()\n\t{\n\t\t// return $.trim(_me._editor.html());\n\t\treturn _me._postProcess();\n\t};\n\n\tthis.myfilesUser = function(userId)\n\t{\n\t\t_me._myfilesUserId = userId;\n\t};\n\n\tthis._entitizeSurrogates = function(source)\n\t{\n\t\tvar rv = \"\";\n\t\tfor (var i = 0; i < source.length; i++)\n\t\t{\n\t\t\tvar cp = source.charCodeAt(i);\n\t\t\tif (0xD800 <= cp && cp <= 0xDBFF)\n\t\t\t{\n\t\t\t\tvar hiSurrogate = cp;\n\t\t\t\ti++;\n\t\t\t\tvar lowSurrogate = source.charCodeAt(i);\n\t\t\t\tcp = ((hiSurrogate - 0xD800) * 0x400) + (lowSurrogate - 0xDC00) + 0x10000;\n\t\t\t\trv = rv + \"&#x\" + cp.toString(16) + \";\";\n\t\t\t}\n\n\t\t\telse\n\t\t\t{\n\t\t\t\trv = rv + String.fromCharCode(cp);\n\t\t\t}\n\t\t}\n\n\t\treturn rv;\n\t};\n\n\tthis._postProcess = function()\n\t{\n\t\tvar div = _me._editor.clone();\n\n\t\t$(div).find(\".e3_editorImage\").removeAttr(\"class\");\n\n\t\t$(div).find(\"a\").each(function(index)\n\t\t{\n\t\t\t$(this).attr(\"target\",\"_blank\");\n\t\t\t$(this).off(\"contextmenu\");\n\t\t});\n\n\t\t$(div).find(\"img\").each(function(index)\n\t\t{\n\t\t\t$(this).off(\"contextmenu\");\n\t\t});\n\n\t\tvar rv = trim($(div).html());\n\t\t\n\t\t// if (rv.endsWith(\"<br>\")) rv = rv.substring(0, rv.length-4);\n\t\tif (rv == \"<br>\") rv = null;\n\t\t// return $.trim(_me._entitizeSurrogates(_me._editor.html()));\n\n\t\treturn rv;\n\t};\n\n\t// opens a visible window, otherwise works\n\tthis._printA = function()\n\t{\n\t\t// http://stackoverflow.com/questions/2255291/print-the-contents-of-a-div\n\t\tvar w = window.open('', '', 'height=400,width=600');\n w.document.write('<html><head><title></title></head><body>');\n w.document.write(_me.get());\n w.document.write('</body></html>');\n w.document.close();\n w.focus();\n w.print();\n w.close();\t\t\n\t};\n\n\t// takes over the portal window, otherwise works\n\tthis._printB = function()\n\t{\n\t\tvar oldstr = document.body.innerHTML;\n\t\tdocument.body.innerHTML = \"<html><head><title></title></head><body>\"\n\t\t\t+ _me.get()\n\t\t\t+ \"</body></html>\";\n\t\twindow.print();\n\t\tdocument.body.innerHTML = oldstr;\n\t}\n\n\tthis._print = function()\n\t{\n\t\tvar frameId = \"F\" + Math.floor(Math.random() * (100000 - 1)) + 1;\n\t\tvar iframe = $(\"<iframe>\").attr(\"id\", frameId).css(\"width\",\"0px\").css(\"height\",\"0px\").css(\"border\",\"0\").appendTo(_me._tools);\n\n\t\tiframe[0].contentWindow.document.write(\"</head><body onload=\\\"setTimeout(function(){Print(); Close();},100);\\\" >\");\n\t\tiframe[0].contentWindow.document.write(_me.get());\n\t\tiframe[0].contentWindow.document.write(\"<script type='text/javascript'>function Print(){window.print();}; function Close(){window.parent.document.getElementById('\" \n\t\t\t\t+ frameId + \"').parentNode.removeChild(window.parent.document.getElementById('\" \n\t\t\t\t+ frameId + \"'));};</script>\");\n\t\tiframe[0].contentWindow.document.write('</body></html>');\n\t\tiframe[0].contentWindow.document.close();\t\t\t\t\n\t};\n\n\tthis._onkeyup = function()\n\t{\n\t\t_me._changed();\n\t\t_me._updateButtons();\n\t\treturn true;\n\t};\n\n\tthis._onmouseup = function()\n\t{\n\t\t_me._updateButtons();\n\t\t// https://developer.mozilla.org/en-US/docs/Web/API/Selection\n\t\t// https://developer.mozilla.org/en-US/docs/Web/API/Range\n\t\t// https://developer.mozilla.org/en-US/docs/Web/API/Node\n\t\t// console.log(\"MOUSE UP\", window.getSelection().toString(), window.getSelection().getRangeAt(0), window.getSelection().getRangeAt(0).startContainer, window.getSelection().getRangeAt(0).startContainer.parentNode, window.getSelection().getRangeAt(0).startContainer.nextSibling, _me.get());\n\t\t// http://msdn.microsoft.com/en-us/library/ie/ms533049%28v=vs.85%29.aspx\n\t\t// console.log(\"BOLD: \", document.queryCommandState(\"Bold\"));\n\t\treturn true;\n\t};\n\n\tthis._onDrop = function(e)\n\t{\n\t\t// don't let the portal's blanked blocker get this\n\t\te.stopPropagation();\n\n\t\t// does it contain text/plain or text/html?\n\t\tvar isText = false;\n\t\t$.each(e.originalEvent.dataTransfer.types, function(index, type)\n\t\t{\n\t\t\tif (type == 'text/html' || type == 'text/plain') isText = true;\n\t\t});\n\n\t\t// block non text\n\t\tif (!isText)\n\t\t{\n\t\t\te.preventDefault();\n\t\t\treturn false;\n\t\t}\n\t\t// TODO: accept images into myfiles\n\t\t\n\t\treturn true;\n\t};\n\t\n\tthis._onDragover = function(e)\n\t{\n\t\t// don't let the portal's blanked blocker get this\n\t\te.stopPropagation();\n\n\t\treturn true;\n\t}\n\n\ttry\n\t{\n\t\tthis._init();\n\t}\n\tcatch (e)\n\t{\n\t\terror(e);\n\t}\n}", "title": "" }, { "docid": "95ef0ac7dc16156c452bd56168c015e3", "score": "0.5302276", "text": "openEditorCmdHandler(){\n let editor = document.querySelector('st-editor');\n editor.render(this);\n if(!editor.isOpen){\n editor.open();\n }\n }", "title": "" }, { "docid": "ba90e2988c5cc7fbd67002c9a0909ac6", "score": "0.5295171", "text": "function setupEditor(message) {\n // Setup the Ace editor.\n EDITOR = pythonEditor('editor');\n currentVersion = message.script.baseSnapshot;\n var state = message.script.editorState;\n setName(message.script.metadata.name);\n setDescription(message.script.metadata.comment);\n if (!message.script.metadata.comment)\n // If there's no description, default to something sensible.\n setDescription(\"A MicroPython script\");\n if(message.script.scriptText.length > 0) {\n EDITOR.setCode(message.script.scriptText);\n } else {\n // A sane default starting point for a new script.\n EDITOR.setCode(\"# Add your Python code here. E.g.\\n\" +\n \"from microbit import *\\n\\n\\n\" +\n \"while True:\\n\" +\n \" display.scroll('Hello, World!')\\n\" +\n \" display.show(Image.HEART)\\n\" +\n \" sleep(2000)\\n\");\n // Marked as dirty so when the user exits the script is saved.\n dirty = true;\n }\n EDITOR.ACE.gotoLine(EDITOR.ACE.session.getLength());\n window.setTimeout(function () {\n // Handles what to do if the user changes the content of the editor.\n EDITOR.on_change(function () {\n statusMsg(\"✎ local changes\", 0 /* Ok */);\n statusIcon(\"pencil\");\n dirty = true;\n });\n }, 1);\n // Handles what to do if the name is changed.\n $(\"#script-name\").on(\"input keyup blur\", function () {\n statusMsg(\"✎ local changes\", 0 /* Ok */);\n statusIcon(\"pencil\");\n dirty = true;\n });\n // Handles what to do if the description is changed.\n $(\"#script-description\").on(\"input keyup blur\", function () {\n statusMsg(\"✎ local changes\", 0 /* Ok */);\n statusIcon(\"pencil\");\n dirty = true;\n });\n // Describes what to do if the user attempts to close the editor without first saving their work.\n window.addEventListener(\"beforeunload\", function (e) {\n if (dirty) {\n var confirmationMessage = \"Some of your changes have not been saved. Quit anyway?\";\n (e || window.event).returnValue = confirmationMessage;\n return confirmationMessage;\n }\n });\n // Automatically save what the user is doing anyway every 5 seconds.\n window.setInterval(function () {\n doSave();\n }, 5000);\n // When you click the link-log (the little \"bug\" icon) display a popup.\n setupPopup($(\"#link-log\"), $(\"#popup-log\"));\n setupPopups();\n // Configure the zoom related buttons.\n $(\"#zoom-in\").click(function (e) {\n e.stopPropagation();\n zoomIn();\n });\n $(\"#zoom-out\").click(function (e) {\n e.stopPropagation();\n zoomOut();\n });\n // Log the status of the editor.\n console.log(\"[loaded] cloud version \" + message.script.baseSnapshot + \"(dated from: \" + state.lastSave + \")\");\n // Bind the ESCAPE key.\n $(document).keyup(function(e) {\n if (e.keyCode == 27) { // ESCAPE\n $('#link-log').focus();\n }\n });\n // Focus on the element with TAB-STATE=1\n $(\"#command-quit\").focus();\n }", "title": "" }, { "docid": "00c51eab3258c01643419b0769f75443", "score": "0.52909493", "text": "setEditorial(mxEl, el) {}", "title": "" }, { "docid": "cec469cbc213c2e2d35b02339661fc1c", "score": "0.5288277", "text": "function display_buffer(name)\n\t\t{\n\t\tvar buf = prefix.cm_buffer[name];\n\t\tif (buf)\n\t\t\t{\n\t\t\tprefix.cm.swapDoc(buf);\n\t\t\tif ($(\"#plugin_misterpah_CodemirrorEditor_editor\").css(\"display\") == \"none\")\n\t\t\t\t{\n\t\t\t\t$(\"#plugin_misterpah_CodemirrorEditor_editor\").css(\"display\",\"block\");\n\t\t\t\t$(\"#inspector_position\").css(\"display\",\"block\");\n\t\t\t\t}\n\t\t\tprefix.cm.refresh();\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tconsole.log(\"no buffer found\");\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "e6a64da482236ba44748ad9b216c3647", "score": "0.5288154", "text": "_computeCodePenData(title,editorValue){return{title:title,html:editorValue}}", "title": "" }, { "docid": "f052fa788d1f5bba85cab7b1593fc4e2", "score": "0.5286745", "text": "function webeditor_init() {\n\tcontenteditable_inited = new Array();\n\tcontenteditable_init();\n\twebeditor_init_toolbar();\n//\twebeditor.inited += 1;\n\tif (webeditor.inited >= webeditor.count) {\n\t\twebeditor_dropdown_refresh('formatclass');\n\t\twebeditor_dropdown_refresh('formatblock');\n\t\twebeditor_dropdown_refresh('fontname');\n\t\twebeditor_dropdown_refresh('fontsize');\n\t}\n\tcontenteditable_position(true);\n}", "title": "" }, { "docid": "71b12c7659ed9af9ed41b7ac7b0507e9", "score": "0.52827555", "text": "function FindReplace(_1){\r\nthis.editor=_1;\r\nvar _2=_1.config;\r\nvar _3=this;\r\n_2.registerButton(\"FR-findreplace\",this._lc(\"Find and Replace\"),_1.imgURL(\"ed_find.gif\",\"FindReplace\"),false,function(_4){\r\n_3.buttonPress(_4);\r\n});\r\n_2.addToolbarElement([\"FR-findreplace\",\"separator\"],[\"formatblock\",\"fontsize\",\"fontname\"],-1);\r\n}", "title": "" }, { "docid": "16d4ecc7048014b27d6e205e233f500e", "score": "0.52810585", "text": "function jocjs(response, data) {\n\n file.readFile('js/joc.js', function (err, data) {\n response.writeHead(200, { \"Content-Type\": \"text/html\" });\n response.write(data);\n response.end();\n });\n}", "title": "" } ]
42ac43d804e4ce89c3478b19cd20d8b2
Analysis data for single file
[ { "docid": "312bfc74bbbb99ce7305056d69dca0ad", "score": "0.5758317", "text": "function FileAnalysis(path, analysis) {\n this.path = path;\n\n this.dependencies = analysis.dependencies;\n\n // Scale to between 0 and 100\n this.maintainability = Math.max(0, analysis.maintainability * 100 / 171);\n this.sloc = analysis.aggregate.sloc.logical;\n\n const functionsMax = _max(analysis.methods.map(m => m.cyclomatic)) || 0;\n const classMethodsMax = _max(\n flatMap(analysis.classes.map(c => c.methods.map(m => m.cyclomatic)))\n ) || 0;\n this.cyclomatic = {\n avg: analysis.methodAverage.cyclomatic,\n max: _max([functionsMax, classMethodsMax])\n };\n this.difficulty = analysis.aggregate.halstead.difficulty\n this.bugs = analysis.aggregate.halstead.bugs;\n\n this.functions = analysis.methods.map(f => ({\n name: f.name,\n line: f.lineStart,\n params: f.paramCount,\n sloc: f.sloc.logical,\n cyclomatic: f.cyclomatic,\n difficulty: f.halstead.difficulty,\n bugs: f.halstead.bugs\n }));\n\n this.classes = analysis.classes.map(c => ({\n name: c.name,\n line: c.lineStart,\n sloc: c.aggregate.sloc.logical,\n difficulty: c.aggregate.halstead.difficulty,\n bugs: c.aggregate.halstead.bugs,\n methods: c.methods.map(method => ({\n name: method.name,\n line: method.lineStart,\n params: method.paramCount,\n sloc: method.sloc.logical,\n cyclomatic: method.cyclomatic,\n difficulty: method.halstead.difficulty,\n bugs: method.halstead.bugs\n }))\n }))\n\n Object.freeze(this);\n}", "title": "" } ]
[ { "docid": "86f161de2fe83916ceb4e182b591b347", "score": "0.6184508", "text": "function readSingleFile(e) {\n const file = e.target.files[0];\n if (!file) {\n return;\n }\n // Extract data from file and distribute it in some relevant structures:\n // results for all guid-related( for now they are not\n // divided in 3 parts depending on the type ) and\n // all results with sample-value-related and\n // map guid to value within the same structure\n const reader = new FileReader();\n reader.onload = function(e) {\n const contents = extractData(e.target.result);\n const sampleArr = contents.sampleValueArray;\n const guidValueInfo = contents.guidValueInfo;\n const metricAverage = new Map();\n for (const e of sampleArr) {\n if (metricAverage.has(e.name)) {\n const aux = metricAverage.get(e.name);\n aux.push(average(e.sampleValues));\n metricAverage.set(e.name, aux);\n } else {\n metricAverage.set(e.name, [average(e.sampleValues)]);\n }\n }\n\n // The content for the default table: with name\n // of the mtric, the average value of the sample values\n // plus an id. The latest is used to expand the row.\n // It may disappear later.\n const tableElems = [];\n let id = 1;\n for (const [key, value] of metricAverage.entries()) {\n tableElems.push(\n new TableRow(id++, key, average(value))\n );\n }\n app.gridData = tableElems;\n app.sampleArr = sampleArr;\n app.guidValue = guidValueInfo;\n };\n reader.readAsText(file);\n}", "title": "" }, { "docid": "de79fd782440b86a595849443be056f0", "score": "0.614693", "text": "function inferFile()\r\n {\r\n findColumnHeadings();\r\n extractCategories(category_index, sub_category_index);\r\n /* console.log(categories);\r\n console.log(sub_categories);\r\n console.log(description);\r\n console.log(models);*/\r\n createCategoriesMenu();\r\n createDescriptionView();\r\n }", "title": "" }, { "docid": "3cb53645e9c1b5f0dba8b7d80abffe76", "score": "0.61014724", "text": "function defineAnalysisData() {\r\n // TODO: more parameters to be added to this data structure to support\r\n // reporting. Example which column from the data set should be\r\n // used to amalgamate the data.\r\n var ds1, ds2;\r\n ds1 = {\r\n wmsName : 'Mule Deer Risk',\r\n wmsURL : gce_wms,\r\n wmsParams : {\r\n layers : 'cum_effects:mule_deer',\r\n STYLES : '',\r\n format : 'image/png',\r\n tiled : true,\r\n tilesOrigin : map.maxExtent.left + ',' + map.maxExtent.bottom,\r\n transparent : true\r\n },\r\n wmsOptions : {\r\n opacity : 0.35,\r\n buffer : 0,\r\n displayOutsideMaxExtent : true,\r\n isBaseLayer : false\r\n },\r\n wfsName : 'Mule Deer WFS',\r\n wfsProtocolParams : {\r\n url : gce_wfs,\r\n version : \"1.1.0\",\r\n featureType : \"mule_deer\",\r\n featurePrefix : 'cum_effects',\r\n srsName : webMercatorProj\r\n },\r\n wfsLayerParams : {\r\n styleMap : wfsStyleMap,\r\n strategies : [new OpenLayers.Strategy.BBOX()],\r\n projection : new OpenLayers.Projection(webMercatorProj) //EPSG:4326 EPSG:900913 This is how the coordinates will be served\r\n },\r\n filter : new OpenLayers.Filter.Comparison({\r\n type : OpenLayers.Filter.Comparison.NOT_EQUAL_TO,\r\n property : 'RISK',\r\n value : 'NOT APPLICABLE'\r\n }),\r\n summaryColumn : \"RISK\"\r\n };\r\n // ds2 = {\r\n // wmsName : 'Study Area Boundary',\r\n // wmsURL : gce_wms,\r\n // wmsParams : {\r\n // layers : 'cum_effects:study_bndry',\r\n // STYLES : '',\r\n // format : 'image/png',\r\n // tiled : true,\r\n // tilesOrigin : map.maxExtent.left + ',' + map.maxExtent.bottom,\r\n // transparent : true\r\n // },\r\n // wmsOptions : {\r\n // opacity : 0.35,\r\n // buffer : 0,\r\n // displayOutsideMaxExtent : true,\r\n // isBaseLayer : false\r\n // }\r\n // };\r\n //analysisData = [ds1, ds2];\r\n analysisData = [ds1];\r\n }", "title": "" }, { "docid": "b936da74c5b68cbfcb2c34d1069a665f", "score": "0.59511447", "text": "async postParsingAnalysis () {\n var fileName = `${this.baseOutPath}-${analysisName}.json`\n var fileContent = {\n // Signal and format to visualize as piechart\n piechart: {\n datasets: [{\n backgroundColor: ['#77BA99','#FFBA49', '#D33F49', '#23FFD9', '#392061', '#27B299', '#831A49'],\n data: [\n this.results.echo,\n this.results.echoreply,\n this.results.unreachable,\n this.results.redirect,\n this.results.ra,\n this.results.rs,\n this.results.ttl\n ]\n }],\n labels: [\n 'Echo Request',\n 'Echo Reply',\n 'Destination Unreachable',\n 'Redirect',\n 'Router Advertisement',\n 'Router Solicitation',\n 'Time Exceeded'\n ]\n },\n hint: 'The labels of this chart have been computed using temporally sensitive data'\n }\n var summary = {\n fileName: fileName,\n attackCategory: 'Network Layer',\n analysisName: this.getName(),\n supportedDiagrams: ['PieChart']\n }\n return await this.storeAndReturnResult(fileName, fileContent, summary)\n }", "title": "" }, { "docid": "d20c26bc9473f05e6f2a9d29f26c37d2", "score": "0.5946282", "text": "async postParsingAnalysis () {\n var mapped = Object.keys(this.results).map((key) => {\n return {id: key, count: this.results[key]}\n })\n var sortedByCount = this.sortEntriesByCount(mapped)\n var topNentries = this.getTopN(sortedByCount, N)\n\n var fileName = `${this.baseOutPath}-${analysisName}.json`\n var fileContent = {\n // Signal and format to visualize as piechart\n piechart: {\n datasets: [{\n backgroundColor: ['#D33F49', '#77BA99', '#23FFD9', '#27B299', '#831A49'],\n data: this.formatData(topNentries)\n }],\n labels: this.formatLabels(topNentries)\n },\n hint: 'The labels of this chart have been computed using temporally sensitive data'\n }\n var summary = {\n fileName: fileName,\n attackCategory: 'Link Layer',\n analysisName: `Top ${N} VLANs`,\n supportedDiagrams: ['PieChart']\n }\n return await this.storeAndReturnResult(fileName, fileContent, summary)\n }", "title": "" }, { "docid": "04ad059d9927e1c22d5da30370d0c92b", "score": "0.57955456", "text": "function readFile() {\n var fileInput, file, label, reader;\n\n fileInput = document.getElementById(\"file-input\");\n file = fileInput.files[0];\n\n reader = new FileReader();\n reader.onload = function (e) {\n var text = reader.result;\n analyses = JSON.parse(text);\n\n // saveData(file.name, analyses);\n createAnalyses(analyses);\n };\n\n reader.readAsText(file);\n\n // Update the input label to reflect the file name\n label = document.getElementById(\"file-label\");\n label.innerHTML = \"File: \" + file.name;\n}", "title": "" }, { "docid": "0ab04d9be7d80b35b59c7e9d7228c92d", "score": "0.5726119", "text": "function readSingleFile(e) {\n const file = e.target.files[0];\n if (!file) {\n return;\n }\n /*\n * Extract data from file and distribute it in some relevant structures:\n * results for all guid-related( for now they are not\n * divided in 3 parts depending on the type ) and\n * all results with sample-value-related and\n * map guid to value within the same structure\n */\n const reader = new FileReader();\n reader.onload = function(e) {\n const contents = extractData(e.target.result);\n const sampleArr = contents.sampleValueArray;\n const guidValueInfo = contents.guidValueInfo;\n\n app.sampleArr = sampleArr;\n app.guidValue = guidValueInfo;\n\n /*\n * Data is displayed in a default format.\n */\n\n // displayContents(sampleArr, guidValueInfo);\n visibleAll();\n\n /*\n * Every button should be able to filter the information regarding\n * one of the possibilities of choosing.\n */\n document.getElementById('storyBtn')\n .addEventListener('click', function() {\n displayContents(sampleArr, guidValueInfo, 'stories');\n }, false);\n document.getElementById('storyTagsBtn')\n .addEventListener('click', function() {\n displayContents(sampleArr, guidValueInfo, 'storyTags');\n }, false);\n document.getElementById('storysetRepeatsBtn')\n .addEventListener('click', function() {\n displayContents(sampleArr, guidValueInfo, 'storysetRepeats');\n }, false);\n document.getElementById('traceStartBtn')\n .addEventListener('click', function() {\n displayContents(sampleArr, guidValueInfo, 'traceStart');\n }, false);\n document.getElementById('traceUrlsBtn')\n .addEventListener('click', function() {\n displayContents(sampleArr, guidValueInfo, 'traceUrls');\n }, false);\n };\n reader.readAsText(file);\n}", "title": "" }, { "docid": "7d681151a4f5865ac75fcaa8a0e9c443", "score": "0.5663736", "text": "function dataRead(infile, id, type, options) {\n\n//\tconsole.info(options);\n\tginfile = infile; // make global\n\n\tif (typeof chartData == 'undefined')\n\t\tchartData = new Array();\n\n\tif (infile == '')\n\t\tdemoShows(id, '', type, options);\n\telse if (infile.indexOf(\".json\") > 0)\n\td3.json(infile,function(error,data) {\n\t\t// console.info(data);\n\t\t// jsonbody = data;\n\t\t// printLines(data);\n\t\tchartSelector(id, data, type, options);\n\t});\n\telse if (infile.indexOf('.xml') > 0)\n\td3.text(infile,function(error,data) { // d3.xml has parsing problems\n//\t\tdata = buildXML(data);\n\t\tdata = xml2json(data, ' ');\n\t\tchartSelector(id, data, type, options); \n\t});\n\telse if (infile.indexOf(\".tsv\") > 0)\n\td3.tsv(infile,function(error,data) { \n//\t\tconsole.info(data);\n\t\tdata = parseJSON(data,type);\n//\t\tconsole.info(data);\n//\t\tconsole.info(options);\n\t\tchartSelector(id, data, type, options);\n\n\toptions.datatype = 'tsv';\n\toptions.infile = infile;\n\tif ((options.exports || options.chartpicker) && !options.inPopup) { // Record data & options into DOM\n\t\tif (typeof chartData == 'undefined')\n\t\t\tchartData = new Array();\n\t\tchartData[id] = new Object( options );\n\t}\n\t});\n\telse if (infile.indexOf('.csv') > 0)\n\td3.csv(infile,function(error,data) {\n\t\t// console.info(data);\n\t\tdata = parseJSON(data,type);\n\t\tchartSelector(id, data, type, options);\n\n\toptions.datatype = 'csv';\n\toptions.infile = infile;\n\tif ((options.exports || options.chartpicker) && !options.inPopup) { // Record data & options into DOM\n\t\tif (typeof chartData == 'undefined')\n\t\t\tchartData = new Array();\n\t\tchartData[id] = new Object( options );\n\t}\n\t});\n\telse if (options.values && !options.tsv) { // Direct input (like D3 simplecharts plugin has)\n\t\tconsole.info('direct!');\n\t\tvar titles = ['Labels','DataSet1','DataSet2','DataSet3'];\n\t\tif (options.series) // Name of data's columns given\n\t\tif (!options.inPopup && options.series != 'Labels') {\n\t\t\tvar arr = ['Labels'];\n\t\t\ttitles = arr.concat(options.series);\n\t\t\toptions.series = titles;\n\t\t}\n\t\tvar out = new Array();\n\t\tfor (i=0; i<options.values.length; i++) {\n\t\t\tvar o = new Object();\n\t\t\tif (options.labels)\n\t\t\t\to[ titles[0] ] = options.labels[i];\n\t\t\telse\n\t\t\t\to[ titles[0] ] = i+1;\n\t\t\to[ titles[1] ] = options.values[i];\n\t\t\tout.push(o);\n\t\t}\n\t\tvar data = parseJSON(out, type);\n\t\tchartSelector(id, data, type, options);\n\n\toptions.datatype = 'direct';\n\toptions.infile = 'foo';\n\t// if ((options.exports || options.chartpicker) && !options.inPopup) { // Record data & options into DOM\n\tif (!options.inPopup) {\n\t\tif (typeof chartData == 'undefined')\n\t\t\tchartData = new Array();\n\t\tchartData[id] = new Object( options );\n\t}\n\t}\n\telse if (options.table) { // ID of table exists\n\t\t// Parsing OpenOffice table as automagically as possible\n\t\tvar idtable = options.table;\n\t\tif (typeof options.inPopup == 'undefined' || !options.inPopup) {\n\t\t\tvar colors = colColors( idtable );\n\t\t\tif (typeof options.autocoloring == \"undefined\")\n\t\t\t\toptions.colors = colors;\t// table => chart coloring\n\t\t\telse {\n\t\t\t\tif (options.autocoloring == 'table')\n\t\t\t\t\toptions.autocoloring = colors;\t// chart => table coloring\n\t\t\t\telse if (options.autocoloring == 'chart' || options.autocoloring == true)\n\t\t\t\t\toptions.colors = colors;\t// table => chart coloring\n\t\t\t}\n\t\t}\n\t if (!options.tsv) {\n\t\tvar dataset2 = d3.selectAll('#'+idtable+' tr').selectAll('td');\n\t\tvar tsv = \"key\\t\";\n\t\tfor (row=0; row<dataset2.length; row++) {\n\t\t\tfor (cols=0; cols<dataset2[row].length; cols++)\n\t\t\t\tif (dataset2[row][cols].innerText) {\n\t\t\t\t\tvar acell = dataset2[row][cols].innerText;\n\t\t\t\t\ttsv = tsv + acell;\n\t\t\t\t\tif (cols != dataset2[row].length-1)\n\t\t\t\t\t\ttsv = tsv + \"\\t\";\n\t\t\t\t}\n\t\t\ttsv = tsv + \"\\n\";\n\t\t}\n\t\toptions.tsv = tsv;\n\t }\n\t\tvar out = d3.tsv.parse(options.tsv);\n\t\tvar datax = parseJSON(out,type);\n\t\tchartSelector(id, datax, type, options);\n\n\t\trecordDOM(options);\n\t}\n\telse if (options.class) { // Data set is embedded into document all over its HTML tags / table\n//\t\tconsole.info(options);\n\t\tjQuery(document).ready(function() { // Wait until DOM is ready for input read\n\t\t\tvar data = parseJSON(cells2set(options), type);\n\t\t\t// console.info(cells2set(options));\n//\t\t\tconsole.info(data);\n//\t\t\tconsole.info(options);\n\t\t\tchartSelector(id, data, type, options);\n\t\t\t/*\n\t\t\toptions.series = series;\n\t\t\toptions.labels = labels;\n\t\t\toptions.values = datapoints;\n\t\t\t*/\n\t\t\t// TODO: extract data sets above for popup win\n\t\t\trecordDOM(options);\n\t\t});\n\t} else if (typeof infile == 'object') // Pure raw data set by JSON variable (= formats on examples/ folder's JSONs)\n\t\tchartSelector(id, infile, type, options);\n\nfunction colColors(id) {\n\n\tvar cells = d3.selectAll('#'+id).selectAll('tbody tr').selectAll('td');\n\tif (cells.length > 1)\n\t\tcells = cells[1]; // Pick 2nd line of data table\n\telse\n\t\tcells = cells[0];\n\n\tvar bgcolors = new Array();\n\tfor (col=1; col<cells.length; col++)\n\t\tbgcolors.push(cells[col]['attributes']['bgcolor']['value']);\n\n\treturn bgcolors.join();\n}\n\nfunction recordDOM(options) {\n\n//\t\tconsole.info(options);\n\t\toptions.datatype = 'direct';\n\t\toptions.infile = 'foo';\n\t\tif ((options.exports || options.chartpicker) && !options.inPopup) { // Record data & options into DOM\n\t\t\tif (typeof chartData == 'undefined')\n\t\t\t\tchartData = new Array();\n\t\t\tchartData[id] = new Object( options );\n\t\t}\n}\n\nfunction cells2set(options) {\n\n\tvar set = new Array(); var labels = new Array(); var series = new Array();\n\t\t\tif (typeof options.class == 'string') {\n\t\t\t\tset.push( d3.selectAll('.'+options.class) );\n\t\t\t} else if (typeof options.class == 'object') {\n\t\t\t\tif (options.class.id && options.class.bgcolor && typeof options.class.bgcolor == 'string')\n\t\t\t\t\tvar bgcolor = options.class.bgcolor;\n\t\t\t\t\tif (options.class.coloring)\n\t\t\t\t\t\toptions.colors = options.class.bgcolor;\n\t\t\t\t\tif (bgcolor.indexOf(\",\") == -1)\n\t\t\t\t\t\tset.push( d3.selectAll('#'+options.class.id+' [bgcolor=\"'+bgcolor+'\"]') );\n\t\t\t\t\telse {\t // Multi series data case\n\t\t\t\t\t\tvar stack = bgcolor.split(\",\");\n\t\t\t\t\t\t// console.info( d3.selectAll('#'+options.class.id+' [bgcolor=\"'+stack[1]+'\"]').style(\"background-color\") );\n\t\t\t\t\t\tfor (i=0; i<stack.length; i++)\n\t\t\t\t\t\t\tset.push( d3.selectAll('#'+options.class.id+' [bgcolor=\"'+stack[i]+'\"]') );\n\t\t\t\t\t}\n\t\t\t\tif (options.class.id && options.class.titlecolor) {\n\t\t\t\t\tvar stack = d3.selectAll('#'+options.class.id+' [bgcolor=\"'+options.class.titlecolor+'\"]');\n\t\t\t\t\tfor (c=0; c<stack[0].length; c++) // Bg.colored labels from stack\n\t\t\t\t\t\tlabels.push( jQuery(stack[0][c]).text() );\n\t\t\t\t\tvar setlength = set[0][0].length*set.length;\n\t\t\t\t\tif (setlength > labels.length) { // Less labels than data points\n\t\t\t\t\t\tvar repeat = 0;\n\t\t\t\t\t\tvar inf = 100000;\n\t\t\t\t\t\twhile (labels.length < setlength && labels.length<inf) { \n\t\t\t\t\t\t\tlabels.push( labels[repeat] );\n\t\t\t\t\t\t\trepeat++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (options.class.id && options.class.seriescolor) {\n\t\t\t\t\tvar stack = d3.selectAll('#'+options.class.id+' [bgcolor=\"'+options.class.seriescolor+'\"]');\n\t\t\t\t\tfor (c=0; c<stack[0].length; c++) // Bg.colored labels from stack\n\t\t\t\t\t\tseries.push( jQuery(stack[0][c]).text() );\n\t\t\t\t}\n\t\t\t}\n\t\t\t// console.info(set);\n\t\t\treturn set2values(set, labels, series, options);\n}\n\nfunction set2values(aset, labels, series, options) {\n\t\t\tvar label_c = 1;\n\t\t\tvar values = new Array();\n//\t\t\tvar cname = options.class;\n\t\t\t// TODO: a loop to get multidim sets - set by set ...\n\t\tvar backtrack = new Array();\n\t\tfor (s=0; s<aset.length; s++) {\n\t\t\tvar set = aset[s];\n\n\t\t\tvar all_labels = new Array();\n\t\t\tif (set[0])\n\t\t\tfor (d=0; d<set[0].length; d++)\n\t\t\t\tif (set[0][d]['innerText']) {\n\t\t\t\t\t\tvar stitles = 'Data '+(s+1);\n\t\t\t\t\t\tif (series.length)\n\t\t\t\t\t\t\tstitles = series[s];\n\t\t\t\t\t\tvar nro = set[0][d]['innerText'].replace(/[^0-9^.^,^-]+/g, \"\");\n\t\t\t\t\t\tif (+nro) { // value must be number && its arr index too\n\t\t\t\t\t\tif (set[0][d]['attributes'])\n\t\t\t\t\t\tif (set[0][d]['attributes']['id']) { // Labels from each cell's ID\n\t\t\t\t\t\t\tvar alabel = set[0][d]['attributes']['id']['value'];\n\t\t\t\t\t\t\tvar rec = {'Labels':alabel};\n\t\t\t\t\t\t\trec[stitles] = +nro;\n\t\t\t\t\t\t} else { // Labels autonumbered or from 1 row/column of table\n\t\t\t\t\t\t\tvar alabel = label_c;\n\t\t\t\t\t\t\tif (labels[label_c-1])\n\t\t\t\t\t\t\t\talabel = labels[label_c-1];\n\t\t\t\t\t\t\tvar rec = { 'Labels':alabel };\n\t\t\t\t\t\t\trec[stitles] = +nro;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!backtrack[alabel] && backtrack[alabel] != 0) {\n\t\t\t\t\t\t\tbacktrack[alabel] = values.length;\n\t\t\t\t\t\t\tvalues.push(rec);\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\tvalues[ backtrack[alabel] ][stitles] = +nro;\n\t\t\t\t\t\tlabel_c++;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n//\t\tconsole.info(values);\n\t\treturn values;\n}\n\nfunction demoShows(id, data, type, options) {\n\n\t// Demo data sets for gallery\n\tvar demos = { lineplusbar:'linePlusBarData.json', simpleline:'simpleLineData.json', cumulativeline:'cumulativeLineData.json', stackedarea: 'stackedAreaData.json', discretebar:'discreteBarData.json', horizontalmultibar:'multibarData.json', pie:'pieData.json', donut:'pieData.json', bullet:'bulletData.json', scatterbubble:'scatterData.json', multibar:'multiData.json', viewfinder:'viewFinderData.json' };\n\n\tif (options.xmldemo)\n\t\tdemos[type] = demos[type].replace(/json/g, 'xml');\n\n\t// Home dir of demo data sets\n\tvar infile = 'wp-content/plugins/nvd3/data/'+demos[type];\n\tif (rootpath) // Global URL of root set by shortcode of WP\n\t\t infile = rootpath + demos[type];\n\n\tvar desc = 'Data File: data/'+demos[type];\n\tvar subs = '<sup> ?</sup>';\n\tvar msg = '<b class=\"title_nvd3\" title=\"'+desc+'\">Chart Type: '+type+subs+'</b>';\n\tmsg = '<br /><a href=\"'+infile+'\" target=\"_blank\">'+msg+'</a>';\n\n\tvar pp = rootpath+'../postchart.php?new=';\n\tvar ctype = '&type='+type;\n\tvar filepath = '&filepath='+demos[type];\n\tvar tt = 'Clone data set from this example into your new draft on WordPress';\n\n\tvar shortmsg = '<br />Add this into: ';\n\n\tvar idmenu = \"gmenu\"+id;\n\tvar mpostpage = '<select id='+idmenu+'><option value=\"post\">New Post</option><option value=\"page\">New Page</option></select>';\n\n\tvar helps = new Array();\n\thelps.push('Data input from ext. JSON file');\n\thelps.push('Data input from ext. XML file');\n\thelps.push('Data input from ext. CSV file');\n\thelps.push('Data input from ext. TSV file');\n\thelps.push('Data input from HTML tags of page/post');\n\thelps.push('Data input from shortcode: values, labels, series');\n\thelps.push('Data input from simple table (OpenOffice)');\n\thelps.push('Data input from 2x2 dim. table (OpenOffice)');\n\tvar idmenu2 = \"gformat\"+id;\n\tvar mformat = '<select id='+idmenu2+'><option value=\"json\" title=\"'+helps[0]+'\">JSON data</option><option value=\"xml\" title=\"'+helps[1]+'\">XML data</option><option value=\"csv\" title=\"'+helps[2]+'\">CSV data</option><option value=\"tsv\" title=\"'+helps[3]+'\">TSV data</option><option value=\"cells\" title=\"'+helps[4]+'\">Document cells</option><option value=\"direct\" title=\"'+helps[5]+'\">Direct input</option><option value=\"table\" title=\"'+helps[6]+'\">Document TABLE</option><option value=\"table2\" title=\"'+helps[7]+'\">TABLE (2x2 dim.)</option></select>';\n\n\tvar query = rootpath+\"../postchart.php?type=\"+type;\n\tvar ctype = demos[type];\n\tvar mbutt = '<button style=\"cursor:pointer\" onclick=\"newpost2('+sQuote(query)+', '+sQuote(ctype)+', '+sQuote(idmenu)+', '+sQuote(idmenu2)+')\" title=\"'+tt+'\">New Chart</button>'\n\n\tvar aform = shortmsg + mpostpage + ' from ' + mformat + mbutt;\n\n\tif (infile.indexOf(\".json\") > 0)\n\td3.json(infile,function(error,data) {\n\t\tchartSelector(id, data, type, options);\n\t\tconsole.info('Drawing chart \"'+type+'\" from a file: data/'+demos[type]);\n\t\tjQuery(\"#chart\"+id).append(msg+aform);\n\t});\n\telse if (infile.indexOf('.xml') > 0)\n\td3.text(infile,function(error,data) { // d3.xml has parsing problems\n//\t\tdata = buildXML(data);\n\t\tdata = xml2json(data, ' ');\n\t\t// console.info(data);\n\t\tchartSelector(id, data, type, options);\n\t\tconsole.info('Drawing chart \"'+type+'\" from a XML file: data/'+demos[type]); // demos[type]\n\t\tjQuery(\"#chart\"+id).append(msg+aform);\n\t});\n\nfunction sQuote(w) { return \" '\"+w+\"' \"; }\n} // demoShows \n\n}", "title": "" }, { "docid": "8333a9f9cef7eee91c239dfaf12ee5ee", "score": "0.566117", "text": "function analyze(filename) {\n\n if (!filename) {\n\n console.log('Please enter a filename to analyze.')\n\n return false\n }\n\n let project_structure = null\n\n fs.readFile(filename, codec, (err, contents) => {\n\n if (err) throw err;\n\n project_structure = JSON.parse(contents)\n\n if (!project_structure) {\n\n console.log('The file may be bad! Please check!')\n return false\n }\n\n let result = danalyzer.analyze_parsed_mdj(project_structure)\n\n console.log(`Design metrics for ${filename}:`)\n // console.log(JSON.stringify(result, null, 4))\n display_table(result)\n })\n\n return true\n}", "title": "" }, { "docid": "64a57deb8c0b5748382c1b7feea02cf8", "score": "0.56544775", "text": "function writeDataFiles(avgfile, rawfile, ancfile)\r\n{ \r\n let dup_trace = traceAncestor(pop_dup); // return [tps,fitnesses,gsizes,exprs,exprs_max]\r\n let hgt_trace = traceAncestor(pop_hgt);\r\n\r\n let gsize_dup_raw = pop_dup.map(({genomesize}) => genomesize);\r\n let gsize_dup = mean(gsize_dup_raw); // Gsize arr.reduce((cum,val) => cum + val, 0) / arr.length;\r\n let gsize_hgt_raw = pop_hgt.map(({genomesize}) => genomesize);\r\n let gsize_hgt = mean(gsize_hgt_raw);\r\n\r\n let fit_dup_raw = pop_dup.map(({fitness}) => fitness); //Fitness\r\n let fit_dup = mean(fit_dup_raw);\r\n let fit_hgt_raw = pop_hgt.map(({fitness}) => fitness);\r\n let fit_hgt = mean(fit_hgt_raw);\r\n \r\n let expr_dup_raw = pop_dup.map(({sumexpression}) => sumexpression); // Sum expression\r\n expr_dup_raw = expr_dup_raw.map(function(n, i) { return n / gsize_dup_raw[i]; }); // Divide by gsize = avg expr.\r\n let expr_dup = mean(expr_dup_raw);\r\n let expr_hgt_raw = pop_hgt.map(({sumexpression}) => sumexpression);\r\n expr_hgt_raw = expr_hgt_raw.map(function(n, i) { return n / gsize_hgt_raw[i]; }); // Divide by gsize = avg expr.\r\n let expr_hgt = mean(expr_hgt_raw);\r\n\r\n var fs = __webpack_require__(0);\r\n fs.appendFileSync(avgfile,`${src_Time}\t${fit_dup}\t${gsize_dup} ${expr_dup} \t${fit_hgt}\t${gsize_hgt} ${expr_hgt} \\n`);\r\n if(src_Time%interval_Raw === 0)\r\n {\r\n fs.appendFileSync(rawfile,`${src_Time}, dup, gsize,${gsize_dup_raw}\\n`);\r\n fs.appendFileSync(rawfile,`${src_Time}, hgt, gsize,${gsize_hgt_raw}\\n`);\r\n fs.appendFileSync(rawfile,`${src_Time}, dup, fitness,${fit_dup_raw}\\n`);\r\n fs.appendFileSync(rawfile,`${src_Time}, hgt, fitness,${fit_hgt_raw}\\n`);\r\n fs.appendFileSync(rawfile,`${src_Time}, dup, expression,${expr_dup_raw}\\n`);\r\n fs.appendFileSync(rawfile,`${src_Time}, hgt, expression,${expr_hgt_raw}\\n`);\r\n fs.appendFileSync(ancfile,`${src_Time}, dup, time_birth, ${dup_trace[0]}\\n`);\r\n fs.appendFileSync(ancfile,`${src_Time}, dup, fitness, ${dup_trace[1]}\\n`);\r\n fs.appendFileSync(ancfile,`${src_Time}, dup, gsizes, ${dup_trace[2]}\\n`);\r\n fs.appendFileSync(ancfile,`${src_Time}, dup, exprs, ${dup_trace[3]}\\n`);\r\n fs.appendFileSync(ancfile,`${src_Time}, dup, exprs_max, ${dup_trace[4]}\\n`);\r\n fs.appendFileSync(ancfile,`${src_Time}, hgt, time_birth, ${hgt_trace[0]}\\n`);\r\n fs.appendFileSync(ancfile,`${src_Time}, hgt, fitness, ${hgt_trace[1]}\\n`);\r\n fs.appendFileSync(ancfile,`${src_Time}, hgt, gsizes, ${hgt_trace[2]}\\n`);\r\n fs.appendFileSync(ancfile,`${src_Time}, hgt, exprs, ${hgt_trace[3]}\\n`);\r\n fs.appendFileSync(ancfile,`${src_Time}, hgt, exprs_max, ${hgt_trace[4]}\\n`);\r\n }\r\n}", "title": "" }, { "docid": "5f277553729b7800d14f6c06c2a954e8", "score": "0.5597287", "text": "function buildData() {\n const dataPath = path.join(__dirname, '..', 'data', 'raw', 'tng');\n\n // Find the files in the directory.\n fs.readdir(dataPath, (err, files) => {\n if (err) {\n throw err;\n }\n\n // Open a write stream.\n const stream = fs.createWriteStream(path.join(__dirname, '..', 'data', 'input.txt'), 'utf8');\n\n // Make sure there are files.\n if (files.length <= 0) {\n throw new Error('No files in directory');\n }\n\n // Parse files.\n let ind = 0;\n let parse = function() {\n parseFile(path.join(dataPath, files[ind])).then((str) => {\n ind++;\n if (ind < files.length) {\n // Write the string to the stream.\n let skipDrain = stream.write(str, 'utf8');\n if (skipDrain) {\n // If no draining is needed, parse right away.\n parse();\n }\n else {\n // Otherwise, parse on drain.\n stream.once('drain', () => {\n parse();\n });\n }\n }\n }).catch((err) => {\n throw err;\n });\n };\n\n // Parse as soon as the file opens.\n stream.on('open', () => {\n parse();\n });\n\n // Handle errors.\n stream.on('error', (err) => {\n console.log(err);\n });\n\n });\n}", "title": "" }, { "docid": "06f7b3a86e21b3051f6072401616f611", "score": "0.5576053", "text": "function submitData(event) {\n\n event.preventDefault();\n\n // Get headers from input.\n const orgLevelHeaders = document.getElementById('org_level_headers').value.split(',');\n\n // Grab the type of parsing requested: tree or flat.\n const parseType = document.getElementById('output_structure').value;\n if (parseType === 'compileResults') {\n parseConfig.complete = compileResults;\n } else {\n parseConfig.complete = compileTreeResults;\n }\n\n // Handle any errors.\n // @todo Make this an early exit.\n handleErrors(currentFiles, orgLevelHeaders);\n\n // Parse the file handled separately in a callback.\n Papa.parse(currentFiles[0], parseConfig);\n}", "title": "" }, { "docid": "9aad6c21f1bcaf550e11e8c6824b0510", "score": "0.5548963", "text": "function loadData() {\r\n \r\n\r\n // line chart input files\r\n var inputLineDataFile = \"data/data - line.csv\";\r\n var inputLineChartFieldsFile = \"data/inputFieldnames - line.csv\";\r\n \r\n // pyramid chart input files\r\n // var inputPyramidDataFile = \"data/data - pyramid.csv\";\r\n // var inputPyramidChartFieldsFile = \"data/inputFieldnames - pyramid.csv\";\r\n \r\n // // pyramid chart input files\r\n // var inputDotDataFile = \"data/data - dot.csv\";\r\n // var inputDotChartFieldsFile = \"data/inputFieldnames - dot.csv\";\r\n \r\n // store all input files as a Promise\r\n Promise.all([\r\n d3.csv(inputLineDataFile),\r\n d3.csv(inputLineChartFieldsFile),\r\n \r\n // d3.csv(inputPyramidDataFile),\r\n // d3.csv(inputPyramidChartFieldsFile),\r\n \r\n // d3.csv(inputDotDataFile),\r\n // d3.csv(inputDotChartFieldsFile),\r\n ]).then(function (data) {\r\n // locally store data\r\n lineData = data[0];\r\n aleph.inputLineFieldnames_src = data[1];\r\n \r\n // pyramidData = data[2];\r\n // aleph.inputPyramidFieldnames_src = data[3];\r\n \r\n // dotData = data[4];\r\n // aleph.inputDotFieldnames_src = data[5];\r\n \r\n aleph.inputFieldnames = { line: {}/* , pyramid: {}, dot: {} */ };\r\n \r\n aleph.inputLineFieldnames_src.forEach(function (d) {\r\n aleph.inputFieldnames.line[d[\"codeFieldName\"]] = d[\"dataFileFieldName\"];\r\n aleph.LineNonYearFields.push(d[\"dataFileFieldName\"]);\r\n }); // end forEach\r\n \r\n // aleph.inputPyramidFieldnames_src.forEach(function (d) {\r\n // aleph.inputFieldnames.pyramid[d[\"codeFieldName\"]] =\r\n // d[\"dataFileFieldName\"];\r\n // aleph.PyramidNonYearFields.push(d[\"dataFileFieldName\"]);\r\n // }); // end forEach\r\n \r\n // aleph.inputDotFieldnames_src.forEach(function (d) {\r\n // aleph.inputFieldnames.dot[d[\"codeFieldName\"]] = d[\"dataFileFieldName\"];\r\n // aleph.DotNonYearFields.push(d[\"dataFileFieldName\"]);\r\n // }); // end forEach\r\n \r\n // stores all data ahas JSON element in global JSON object\r\n aleph.data = {\r\n line: lineData/* ,\r\n pyramid: pyramidData,\r\n dot: dotData, */\r\n };\r\n \r\n // console.log(aleph.data.pyramid);\r\n \r\n // call function to draw Line chart frame.\r\n drawLineChart();\r\n // addSVGtoSliders();\r\n });\r\n \r\n return;\r\n } // end function loadData();", "title": "" }, { "docid": "75ac34c58c189873c7d24d8da989025e", "score": "0.5535092", "text": "function analyzeall(data) {\n var arr = [];\n var line_max = 0;\n\n for (var i = 0; i < data.asm.length; i++) {\n if (data.asm[i].source != null &&\n data.asm[i].text.indexOf(':') == -1) {\n // console.log(data.asm[i].text)\n var f = new Format(data.asm[i].text);\n arr.push(f);\n }\n }\n\n return arr;\n\n}", "title": "" }, { "docid": "a1760188cea62cf80f6b7f3b6b94d270", "score": "0.5522974", "text": "function handleFiles(files)\n {\n if(files.length)//if successful to read\n {\n var file = files[0];\n var reader = new FileReader();\n reader.onload = function()\n {\n\t\t content=this.result;\n\t\t analyzeFile(content);//store in global varialbe: content\n\t };\n reader.readAsText(file);//type: text\n }\n }", "title": "" }, { "docid": "ac72b7e575e4a2d0a24b9c4c069b648b", "score": "0.5431148", "text": "function main() {\n\n console.log(':::Design Analyzer:::')\n\n rl.question('Enter file name:', (filename) => {\n\n let status = analyze(filename)\n\n rl.close()\n\n if (!status) {\n\n console.log('The file has some problem!')\n\n return\n }\n })\n}", "title": "" }, { "docid": "26849e7d8a3d394399f45ebf7589bb15", "score": "0.5355561", "text": "function loadFileHandler(event)\r\n\t{\r\n\t var content = event.target.result.split(\"\\n\");\r\n\t var StartDate = new Date();\r\n\t\tvar StartTime = StartDate.getTime();\r\n\t\tvar parser = new ANALYSISFileParser();\r\n\t\t\r\n\t\t\r\n\t for(var i = 0 ; i < content.length; i++)\r\n\t {\r\n\t \tvar line = content[i];\r\n\t \tparser.LineHandler(line);\r\n\t\t}\r\n\t\tparser.ProcessDone(StartTime,callback,arg1,arg2,arg3);\r\n\t}", "title": "" }, { "docid": "062399dd19dd964c4ec12be94e7cdecf", "score": "0.5354188", "text": "function data_analyze(data, scope, ops) {\n var output = [],\n source = null,\n modify = false,\n generate = false,\n upstream, i, n, t, m;\n\n if (data.values) {\n // hard-wired input data set\n if (util_hasSignal(data.values) || util_hasSignal(data.format)) {\n // if either values or format has signal, use dynamic loader\n output.push(data_load(scope, data));\n output.push(source = data_collect());\n } else {\n // otherwise, ingest upon dataflow init\n output.push(source = data_collect({\n $ingest: data.values,\n $format: data.format\n }));\n }\n } else if (data.url) {\n // load data from external source\n if (util_hasSignal(data.url) || util_hasSignal(data.format)) {\n // if either url or format has signal, use dynamic loader\n output.push(data_load(scope, data));\n output.push(source = data_collect());\n } else {\n // otherwise, request load upon dataflow init\n output.push(source = data_collect({\n $request: data.url,\n $format: data.format\n }));\n }\n } else if (data.source) {\n // derives from one or more other data sets\n source = upstream = Object(vega_util[\"i\" /* array */])(data.source).map(function(d) {\n return util_ref(scope.getData(d).output);\n });\n output.push(null); // populate later\n }\n\n // scan data transforms, add collectors as needed\n for (i=0, n=ops.length; i<n; ++i) {\n t = ops[i];\n m = t.metadata;\n\n if (!source && !m.source) {\n output.push(source = data_collect());\n }\n output.push(t);\n\n if (m.generates) generate = true;\n if (m.modifies && !generate) modify = true;\n\n if (m.source) source = t;\n else if (m.changes) source = null;\n }\n\n if (upstream) {\n n = upstream.length - 1;\n output[0] = transforms_Relay({\n derive: modify,\n pulse: n ? upstream : upstream[0]\n });\n if (modify || n) {\n // collect derived and multi-pulse tuples\n output.splice(1, 0, data_collect());\n }\n }\n\n if (!source) output.push(data_collect());\n output.push(transforms_Sieve({}));\n return output;\n}", "title": "" }, { "docid": "177cbdbdf7a789eb6e47daa66647777c", "score": "0.53444386", "text": "loadData(e, kwh, volt, mult)\n {\n let file = e.files[0];\n let reader = new FileReader();\n\n reader.readAsText(file);\n reader.onerror = () => console.log(reader.error);\n\n //Get contents of file.\n reader.onload = () =>\n {\n //Convert contents to an array of objects.\n let dataArray = JSON.parse(reader.result);\n \n //Make sure this not a shaft alignment data file.\n if(dataArray[0].type !== Sam.COST)\n {\n console.log(\"Invalid data file\");\n return;\n }\n\n //Clear any colors indicating errors.\n kwh.style.backgroundColor = \"\";\n volt.style.backgroundColor = \"\";\n mult.style.backgroundColor = \"\";\n\n //Clear out old data.\n this.history = [];\n this.parentDiv.innerHTML = \"\";\n\n //Load report title and comments.\n this.reportTitle = dataArray[0].reportTitle;\n this.reportComments = dataArray[0].reportComments;\n\n //Load cost data.\n let costKwh = dataArray[0].hasOwnProperty(\"costKwh\") ? dataArray[0].costKwh : undefined;\n let voltage = dataArray[0].hasOwnProperty(\"motorVoltage\") ? dataArray[0].motorVoltage : undefined;\n let multiplier = dataArray[0].hasOwnProperty(\"usageMultiplier\") ? dataArray[0].usageMultiplier : undefined;\n let period = dataArray[0].hasOwnProperty(\"timePeriod\") ? dataArray[0].timePeriod : Sam.MONTHLY;\n this.changeCostData(costKwh, voltage, multiplier, period, this.reportTitle, this.reportComments);\n \n //Iterate through data objects and load.\n for(let i = 1; i < dataArray.length; i++)\n {\n switch(dataArray[i].type)\n {\n case Sam.ADJ:\n this.addAdjustment(dataArray[i]);\n break;\n case Sam.MEAS:\n this.addMeasurement(dataArray[i]);\n break;\n default:\n console.log(\"Unknown object type\");\n break;\n }\n }\n\n //Update cost text.\n this.updateCosts();\n };\n }", "title": "" }, { "docid": "263caa1d0a531bc9fae0e497cfdb69fe", "score": "0.53244925", "text": "function main(){\n try{\n console.log('--------------------START------------------- \\n');\n \n // read file\n const data = readTextFile('./test.txt');\n console.log(`READ-DATA: \\n \\n ${data}`);\n\n // filter file\n const filteredData = filterTextFile(data);\n console.log(`FILTERED-DATA: \\n \\n ${filteredData}`);\n\n // create csv file\n \n console.log('\\n--------------------END---------------------');\n }\n catch(err){\n console.log('ERROR HAS OCCURRED:', err);\n }\n \n \n}", "title": "" }, { "docid": "780945c916b9eb2dc7d4a5f8abc5f3d3", "score": "0.5323912", "text": "function processFile(contents,fullFileName) {\n let splitter = \"Instance:\"\n //let arResults = []\n let arInstances = contents.split(splitter); //the instances defined in this file\n\n arInstances.forEach(function(i) { //check each instance\n\n let fileContents = splitter + i //add back in the splitter\n \n let summary = {description:\"\",title:\"\"}\n let ar = fileContents.split('\\n')\n ar.forEach(function(lne){\n lne = lne.replace(/['\"]+/g, ''); //get rid of all the quotes\n if (lne.substr(0,11) == 'InstanceOf:') {\n summary.type = lne.substr(12)\n } else if (lne.substr(0,9) == 'Instance:') {\n summary.id = lne.substr(10)\n } else if (lne.substr(0,11) == '//BaseType:') {\n summary.baseType = lne.substr(12).trim();\n } else if (lne.substr(0,6) == 'Title:') {\n summary.title = lne.substr(7)\n } else if (lne.substr(0,12) == 'Description:') {\n summary.description = lne.substr(13)\n }\n })\n\n if (summary.type && summary.id) {\n //summary.content = fileContents;\n \n summary.fileName = fullFileName\n if (summary.baseType) {\n summary.link = summary.baseType + \"-\" + summary.id + \".json.html\"\n }\n \n hashExamples[summary.type] = hashExamples[summary.type] || []\n hashExamples[summary.type].push(summary);\n }\n\n\n //console.log(summary.id)\n\n })\n \n\n\n}", "title": "" }, { "docid": "c83779bf14f69247bdaa7a2bb058cc38", "score": "0.52878016", "text": "function loadData() {\n\tvitaminData = require(dataFile)\n}", "title": "" }, { "docid": "99e37fe425ec4acdc367709e6fd98ce0", "score": "0.51919913", "text": "function parseData(createGraph){\n\tPapa.parse(\"../data/motion_sensor_data.csv\", { // Parsing data\n\t\tdownload: true,\n\t\tcomplete: function(results) {\n\t\t\tconsole.log(results.data);\n\t\t\tcreateGraph(results.data); // Run function createGraph() with the data parsed with Papa.parse\n\t}\n});\n}", "title": "" }, { "docid": "6ae80f7ff599f7865be2491b744ced7e", "score": "0.51570964", "text": "function initializeAnalysisSummayData(analysisDataSet) {\n refreshAnalysisSummary(analysisDataSet);\n }", "title": "" }, { "docid": "38ebea1453d6ca37cc63229c9cbaa918", "score": "0.51470286", "text": "parseData(e) {\n\t\tthis.updateFileName();\n\t\tvar file = this.refs.fileID.files[0];\n\t\tif(file.value !== \"\") {\n\t\t\tthis.setState({\n\t\t\t\thasFile: true\n\t\t\t});\n\n\t\t\tif (file.name.includes('.csv')){\n\t\t\t\tvar Papa = require(\"papaparse/papaparse.min.js\");\n\t\t\t\tPapa.parse(file, {\n\t\t\t\t\theader: true,\n\t\t\t\t\tdownload: true,\n\t\t\t\t\tskipEmptyLines: true,\n\t\t\t\t\tcomplete: this.updateData\n\t\t\t\t});\n\t\t\t} else if(file.name.includes('.xlsx') || file.name.includes('.xls')){\t\n\t\t\t\tconst reader = new FileReader();\n\t\t\t\treader.onload = (e) => {\n\t\t\t\t\tconst bstr = e.target.result;\n\t\t\t\t\tconst wb = XLSX.read(bstr, {type:'binary'});\n\t\t\t\t\tconst wsname = wb.SheetNames[0];\n\t\t\t\t\tconst ws = wb.Sheets[wsname];\n\t\t\t\t\t// eslint-disable-next-line\n\t\t\t\t\tconst conversion = XLSX.utils.sheet_to_json(ws);\n\t\t\t\t};\n\t\t\t\treader.readAsBinaryString(file);\n\t\t\t} else {\n\t\t\t\tthis.updateData({\n\t\t\t\t\tdata: file\t\t\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tthis.setState({\n\t\t\t\thasFile: false\t\t\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "c29e4e69631499f093c3021978bf3e62", "score": "0.514384", "text": "function handleDataFile() {\n // Activate the loading page.\n $('.psl-viz .splash').hide();\n $('.psl-viz .loading').show();\n\n let reader = new FileReader();\n reader.onload = function(event) {\n let compressedData = new Uint8Array(event.target.result);\n\n let gunZipper = new Zlib.Gunzip(compressedData);\n let decompressedData = gunZipper.decompress();\n\n let text = new TextDecoder(\"utf-8\").decode(decompressedData);\n let json = JSON.parse(text);\n init(json);\n }\n\n reader.readAsArrayBuffer(this.files[0]);\n}", "title": "" }, { "docid": "2e72e13ba077463fd891f3443b3a7611", "score": "0.5115996", "text": "function main(file){\n\tvar element = document.getElementById(\"canvas1\");\n\tdata = document.getElementById(\"data\");\n\tc = element.getContext(\"2d\");\n\t//read the width and height of the canvas\n\tvar width = parseInt(element.getAttribute(\"width\"));\n\tvar height = parseInt(element.getAttribute(\"height\"));\n\t//create a new pixel array\n\tvar imageData = Create2DArray(height);\n\t//imageData = c.createImageData(width, height);\n\n\t//init();\n\treadData(file, imageData);\n\t/* ideally next showData will get executed */\n}", "title": "" }, { "docid": "8f750efd2a0118728f572166e003acb4", "score": "0.51123214", "text": "function load ()\n\t{ \n\t\treadTextFile('includes/data.txt',function(data_){\t\t\t\t\t \n\t\t var lines = data_.split('\\n');\n\t\t\tfor(var i=0; i<lines.length; i++)\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t{\t\n\t\t\t\tshapeRepository[i] = [];\n\t\t\t\tfor(var k=0; k<lines[i].split(',').length; k++)\n\t\t\t\t{\n\t\t\t\t\tshapeRepository[i][k]= lines[i].split(',')[k];\n\t\t\t\t}\n\t\t\t}\t \t\t\n\t \t\tnormalization();\n\t \t\tperspective();\t\n\t\t});\n\t}", "title": "" }, { "docid": "1d8d6a3d9e68da563ea20220d291f818", "score": "0.5107599", "text": "function readData( data ){\n reset();\n\n //Add application nodes\n for(var i=0; i<data.Applications.length; i++){\n addApp(String(data.Applications[i]));\n }\n\n //Add application connections\n for(var i=0; i<data.edges.length; i++){\n //Add connectionPoints\n cy.add([\n { group: \"nodes\", data: { type: 'conPointNode', id:'conP'+i}, position: {x: cy.$('#aEnd').position().x + 70, y: i*200/data.edges.length } }, //Connection point\n\n { group: \"edges\", data: { source: data.edges[i].source, target: data.edges[i].target, type: 'spaghEdge' } }, //Spaghetti edge\n { group: \"edges\", data: { source: data.edges[i].source, target: 'conP'+i, type: 'goodIntEdge' } }, //int edge source->conP\n { group: \"edges\", data: { source: 'conP'+i, target: data.edges[i].target, type: 'goodIntEdge' } } //int edge source->conP\n ]);\n\n //Add the integration edge\n cy.add({ \n group: \"edges\", \n data: { source: data.edges[i].source, target: data.edges[i].target, type: 'spaghEdge' } \n });\n }\n}", "title": "" }, { "docid": "6c088aa0f28279ab233df5873881f008", "score": "0.5107557", "text": "function readData() {\n\n var filename = document.getElementById(\"files\").files[0];\n var freader = new FileReader();\n freader.readAsText(filename);\n freader.onload = storeData_Handler;\n\n}", "title": "" }, { "docid": "4434f9e491d4cf0a9619666c7c958152", "score": "0.5105014", "text": "function main(){\n\n\tvar file = process.argv[2]\n\tif(file === undefined || process.argv > 3){\n\t\tconsole.log(\"Error: No file argument!\\nRun \\\"node lex.js <.cjs file>\\\" (sample: node lex.js sample.cjs)\");\n\t\treturn\n\t}\n\tvar reader = new FileReader();\n\n\treader.onload = function(e) {\n\t\tinput = reader.result;\n\t\tanalyze(input, file);\n\t}\n\n\treader.readAsText(new File(file));\n\n}", "title": "" }, { "docid": "d245773b3249e9260e9343ffd03defe6", "score": "0.5104312", "text": "function read_subset_file(data){\n hierarchy = [];\n clearROIs();\n clearExcluded();\n clearObstructed();\n var max_vertices = 500;\n var lines = data.toString().split('\\n');\n for(line = 0;line < lines.length; line++){\n var split_line = lines[line].match(/\\S+/g);\n if(split_line){\n //console.log('split line: ' + split_line);\n if(split_line[0].toUpperCase()=='BEGIN'){\n hierarchy.push(split_line[1]);\n if(split_line[1].toUpperCase()=='SUBSET_COORDINATES'){\n vertex = 0;\n while(vertex < max_vertices){\n num_line = lines[line+1+vertex].match(/\\S+/g).map(Number);\n if(isNaN(num_line[0])) break;\n vertex++;\n subsetCoordinatesX.push(num_line[0]);\n subsetCoordinatesY.push(num_line[1]);\n }\n line+=vertex;\n }\n // TODO check for valid input file (for example prevent loading a conformal subset for subset mode or an ROI for tracking)\n // see if this is a set of vertices\n if(split_line[1].toUpperCase()=='VERTICES'){\n // read the sets of vertices\n var vertex = 0;\n var vertex_x = [];\n var vertex_y = [];\n while(vertex < max_vertices){\n num_line = lines[line+1+vertex].match(/\\S+/g).map(Number);\n if(isNaN(num_line[0])) break;\n vertex++;\n vertex_x.push(num_line[0]);\n vertex_y.push(num_line[1]);\n }\n line+=vertex;\n console.log('vertex x: ' + vertex_x);\n console.log('vertex y: ' + vertex_y);\n if(hierarchy[hierarchy.length-3].toUpperCase()=='BOUNDARY'){\n //console.log('ciurrent ROI index is ' + currentROIIndex);\n //console.log(ROIDefsX);\n if(currentROIIndex!=0){\n ROIDefsX.push([]);\n ROIDefsY.push([]);\n }\n for(i=0;i<vertex_x.length;i++){\n ROIDefsX[ROIDefsX.length-1].push(vertex_x[i]);\n ROIDefsY[ROIDefsY.length-1].push(vertex_y[i]);\n }\n currentROIIndex += 1;\n }\n else if(hierarchy[hierarchy.length-3].toUpperCase()=='EXCLUDED'){\n if(currentExcludedIndex!=0){\n excludedDefsX.push([]);\n excludedDefsY.push([]);\n }\n for(i=0;i<vertex_x.length;i++){\n excludedDefsX[excludedDefsX.length-1].push(vertex_x[i]);\n excludedDefsY[excludedDefsY.length-1].push(vertex_y[i]);\n }\n excludedAssignments.push(currentROIIndex-1);\n currentExcludedIndex += 1;\n }\n else if((hierarchy[hierarchy.length-3].toUpperCase()=='OBSTRUCTED')&&currentROIIndex==1){\n if(currentObstructedIndex!=0){\n obstructedDefsX.push([]);\n obstructedDefsY.push([]);\n }\n for(i=0;i<vertex_x.length;i++){\n obstructedDefsX[obstructedDefsX.length-1].push(vertex_x[i]);\n obstructedDefsY[obstructedDefsY.length-1].push(vertex_y[i]);\n }\n currentObstructedIndex += 1;\n }\n }\n }\n else if(split_line[0]=='end' && hierarchy.length > 0){\n hierarchy.pop();\n }\n } // end split_line\n } // end lines\n console.log('subsetCoordinatesX');\n console.log(subsetCoordinatesX);\n console.log('subsetCoordinatesY');\n console.log(subsetCoordinatesY);\n console.log('ROIDefsX:');\n console.log(ROIDefsX);\n console.log('ROIDefsY:');\n console.log(ROIDefsY);\n console.log('ExcludedDefsX:');\n console.log(excludedDefsX);\n console.log('ExcludedDefsY:');\n console.log(excludedDefsY);\n console.log('excludedAssignments');\n console.log(excludedAssignments);\n console.log('obstructedDefsX:');\n console.log(obstructedDefsX);\n console.log('obstructedDefsY:');\n console.log(obstructedDefsY);\n drawROIs();\n}", "title": "" }, { "docid": "b7165a5fae3e75868915175e42349759", "score": "0.5092481", "text": "function READFile(Types){\n Types.forEach((Type)=>{\n \n fs.readFile('./data'+Type+'.json','utf8',(err,data)=>{\n data = JSON.parse(data);\n\n Entype = data.aggregations[0].aggregations[0].results;\n\n Entype.forEach((number)=>{\n entities = number.key;\n console.log(\"Emit\",Type,entities)\n\n //io.emit(Type, entities)\n if(Type==\"Person\"||Type==\"Quantity\"||Type==\"Location\"){\n io.emit(Type, entities)\n console.log(\"Emit\",Type,entities)\n } else{\n io.emit(\"Other\",entities+\",\"+ Type)\n console.log(\"Other\",entities +\",\"+Type)\n }\n\n })\n })\n });\n}", "title": "" }, { "docid": "a4c0cab9523ffd02b12dc02d61eb239e", "score": "0.50740874", "text": "function parse_data_cov(buffer) {\n console.log(\"Parsing Covering binary file...\");\n // initialize solutions data arrays\n var sols = []; // list of solutions\n var var_names = []; // names of variables in the manifold\n var names_id = {};\n var mins = []; // list of minimums, i.e. lower bounds\n var maxs = []; // list of maximums, i.e. upper bounds\n\n sol_set = new Object(); // object to store all data about the solution set\n\n try {\n // use standard js TextDecoder to process binary data\n var dec = new TextDecoder();\n // The file starts with a signature on 20 bytes which should look like: IBEX MANIFOLD FILE 2\n // 2 is a number corresponding to the current version of this format\n // start to read the 19 first bytes\n const signature = dec.decode(buffer.slice(0, 19));\n // use of standard js DataView to convert bytes to numbers (float or integer) or strings\n // we start the view to byte 20 to avoid considering the 19 first bytes\n const view = new DataView(buffer.slice(20));\n // initialization of current cursor in the view\n var cursor = 0;\n // read the current level of the format (2: Optim, 5: Solver)\n const level = view.getUint32(cursor, true);\n // Uint32 are stored on 4 bytes\n cursor += 4;\n\n console.log(signature + level);\n sol_set.version = level;\n\n var format_id = new Array(level + 1);\n var format_ver = new Array(level + 1);\n\n for (var i = 0; i <= level; i++) {\n format_id[i] = view.getUint32(cursor, true);\n cursor += 4;\n }\n for (var i = 0; i <= level; i++) {\n format_ver[i] = view.getUint32(cursor, true);\n cursor += 4;\n }\n\n console.log(\"Current format identification: \" + format_id.toString());\n console.log(\"Current format version: \" + format_ver.toString());\n\n var nb_var;\n nb_var = view.getUint32(cursor, true);\n cursor += 4;\n console.log(nb_var + \" dimensions in covering!\");\n sol_set.nb_var = nb_var;\n \n if (level == 5) { // solver data\n\n sol_set.sols = new Array();\n if (format_id[1] == 0) {\n cursor = parse_cov_list(view, cursor, nb_var, sol_set);\n console.log(sol_set.sols.length + \" solutions parsed\");\n }\n try {\n if (format_id[2] == 0) {\n cursor = parse_cov_inner(view, cursor, sol_set);\n }\n if (format_id[3] == 0) {\n cursor = parse_cov_boundary(view, cursor, sol_set);\n }\n if (format_id[4] == 0) {\n cursor = parse_cov_manifold(view, cursor, sol_set);\n }\n if (format_id[5] == 0) {\n cursor = parse_cov_solver_data(buffer, view, cursor, sol_set);\n var_names = sol_set.var_names;\n }\n } catch (err) {\n console.log(`There was an error while parsing Solver COV additional format: ${err}`);\n //return null;\n }\n\n } else if (level == 2) {\n sol_set.sols = new Array();\n if (format_id[1] == 0) {\n cursor = parse_cov_list(view, cursor, nb_var, sol_set);\n console.log(sol_set.sols.length + \" solutions parsed\");\n }\n try {\n if (format_id[2] == 1) {\n cursor = parse_cov_optim_data(buffer, view, cursor, sol_set, nb_var);\n var_names = sol_set.var_names;\n }\n } catch (err) {\n console.log(`There was an error while parsing Optimizer COV additional format: ${err}`);\n //return null;\n }\n }\n console.log(sol_set.sols.length + \" solutions read using \" + cursor + \" Bytes!\");\n //return sol_set;\n } catch (err) {\n console.log(`There was an error: ${err}`);\n //return null;\n }\n\n console.log(JSON.stringify(sol_set));\n\n return sol_set;\n}", "title": "" }, { "docid": "c7458f9cda0070480a41f7317527265b", "score": "0.50672185", "text": "function startAnalysis() {\n disableInput();\n var data = cur_dataset;\n var id = cur_id;\n startScan(id, {\n accuracy: document.getElementById(\"manual-accuracy-display\"),\n status: document.getElementById(\"manual-status-display\")\n }, manualChart, manualData, function () {\n logger.log_info(\"Succesfully scanned \" + id);\n manualAdjustResult.style.display = 'block';\n enableInput();\n });\n}", "title": "" }, { "docid": "80fc24d3bdd7c295359cc7f8347d2c13", "score": "0.50507456", "text": "function analyseContent(){\n\t// Ignore the analysis in regular mode\n//\tvar authorStats = computeAuthorshipStatistics();\n\n//\tvar coauthorshipGraph = constructCoauthorshipGraph(authorStats);\n//\texportBlob(exportCoauthorshipGraphGML(coauthorshipGraph, authorStats), \"text/plain\");\n//\t//exportBlob(exportCoauthorshipGraphGV(coauthorshipGraph, authorStats), \"text/plain\");\n\n//\t// Invoke auxiliary functions, if necessary\n//\tif (typeof printSummaryTableLatex == \"function\") {\n//\t\tprintSummaryTableLatex();\n//\t}\n//\tif (typeof printSummaryMatrix == \"function\") {\n//\t\tprintSummaryMatrix();\n//\t}\n//\tif (typeof printTemporalMatrix == \"function\") {\n//\t\tprintTemporalMatrix();\n//\t}\n}", "title": "" }, { "docid": "c629117a6f9c325ecc1784c422f77468", "score": "0.5044851", "text": "processData(){\n // filter out cars with missing values\n this._filterData();\n\n // create array of arrays for druidjs\n this._transformToArray();\n \n // perform kMeans clustering\n this._performClustering();\n \n // perform PCA\n this._performPCA();\n \n }", "title": "" }, { "docid": "b39bb93542da4a0bb6d03bffd27ca44e", "score": "0.5040131", "text": "function logAnalysis() {\n console.log('======== LYRICA RAW ANALYSIS RESULTS ========');\n Object.keys(Lyrica.Analyser.state.results.prolific).map(category => {\n if (category == 'primaryArtists') console.log('Category :: ======== Primary Lyrical Sections ========')\n if (category == 'actualArtists') console.log('Category :: ======== Actual Lyrical Sections ========')\n if (category == 'uniqueWords') console.log('Category :: ======== Unique Words ========')\n Lyrica.Analyser.state.results.prolific[`${category}`].map((result, idx) => {\n if (category == 'primaryArtists') console.log(`Artist RAnk #${idx+1} — ${result[0]} :: ${result[1]} Primary Lyrical Sections`)\n if (category == 'actualArtists') console.log(`Artist RAnk #${idx+1} — ${result[0]} :: ${result[1]} Actual Lyrical Sections`)\n if (category == 'uniqueWords') console.log(`Artist RAnk #${idx+1} — ${result[0]} :: ${result[1]} Unique Words`)\n })\n })\n console.log('======== LYRICA RAW ANALYSIS RESULTS ========');\n}", "title": "" }, { "docid": "d9c5a72c8688aae440ebc3755db93dce", "score": "0.50388545", "text": "function readClimateData (){\r\n collectModelInputs()\r\n const reader = new FileReader();\r\n reader.onload = function(e){ \r\n let lines = reader.result.split('\\n');\r\n\r\n // Start from second array. First array is for the headers\r\n for(let i=1; i<lines.length; i++){\r\n if(lines[i].length > 0){\r\n let values = lines[i].split(',');\r\n climate.push( { year:parseInt(values[0]), month:parseInt(values[1]), day:parseInt(values[2]), \r\n tempMax:parseFloat(values[3]), tempMin:parseFloat(values[4]), \r\n rhMax:parseFloat(values[5]), rhMin:parseFloat(values[6]),\r\n precip:parseFloat(values[7]), solarRad:parseFloat(values[8]), windSpeed:parseFloat(values[9])} );\r\n }\r\n };\r\n for(let i=0; i<climate.length; i++){ climate[i].tempAvg = (climate[i].tempMax + climate[i].tempMin)/2}\r\n for(let i=0; i<climate.length; i++){ climate[i].date = new Date(climate[i].year, climate[i].month-1, climate[i].day) }\r\n for(let i=0; i<climate.length; i++){ climate[i].doy = getDayOfYear(climate[i].date) }\r\n for(let i=0; i<climate.length; i++){ climate[i].ETref = computeReferenceET(geolocation,climate[i], 'grass')}\r\n M.toast({html: 'Climate loaded!'})\r\n e.target.value = '';\r\n if(isWeatherLoaded){run()}\r\n }\r\n reader.readAsText(climateInputElement.files[0])\r\n\r\n}", "title": "" }, { "docid": "7baf7e5bd6a73c5e77497612bead7851", "score": "0.50365543", "text": "function readFile(){\n originalInput = [];\n userArray = [];\n header = [];\n hVal = [];\n machineCode = [];\n labelList = ['name:', 'input:', 'init:', 'accept:'];\n \n //get file, filename, and the file extension\n var fileInput = document.getElementById('inputFile');\n var file = fileInput.files[0];\n var filename = getFilename();\n var ext = getExtension(filename);\n \n //do not continue for wrong file types\n if (ext !== 'txt'){\n alert(\"Please provide only .txt files, please try again\");\n }\n else{\n var reader = new FileReader();\n reader.readAsBinaryString(file);\n }\n \n \n /**\n * This function begins the actual process of gathering data.\n * \n * @param {file} file\n */\n reader.onload = function(file){\n context.clearRect(0,0,width,height);\n softreset();\n displayTextWindow(file);\n \n //the following try/catch to prevent excessively long, short, or empty text files\n try{\n originalInput = this.result.split('\\n'); //seperate by lines\n if(originalInput.length > 50000) throw \"Too many lines in file\";\n if(originalInput.length <= 6 ) throw \"Not enough lines in file\";\n if(originalInput.length === 0) throw \"Empty file\";\n \n //continue if no errors in file\n userArray = deleteComments(originalInput); //get rid of comments\n \n \n //note: the following 2 assignments will ignore blank lines\n header = getHeader(userArray, labelList); //take the lines with header labels only\n machineCode = getMachineCode(userArray); //take everything from the BEGIN keyword until the END keyword\n \n //for(var k = 0; k < header.length; k++)\n // console.log(header[k]);\n \n hVal = getHeaderValues(header, labelList);\n sendValues(hVal, machineCode);\n \n \n //logResults();\n initializeprogram();\n //logResults();\n }\n catch(error){\n clearValues();\n fileContentException(error);\n }\n };\n //logResults();\n}", "title": "" }, { "docid": "85cd806fa2426382e2f199c311a89b67", "score": "0.5004675", "text": "function getdata(){\n\n\t\t//Get the csv file into a variable\n\n\t\tload=getme(\"Playgrounds.csv\");\n\n\t\t\n\n\t\t//Check sucess\n\n\t\tif (load != null){\n\n\t\t\t//Failed run convert on the few hardcoded CSVs.\n\n\t\t\tconvert(load);\n\n\t\t}else{\n\n\t\t\t//Sucess run convert on the .CSV's contents.\n\n\t\t\tconvert(hardcode);\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "bc065a6ff820c0a4d745633bc6620c6f", "score": "0.5002787", "text": "function getSummaryData() {\n var loopcounter = 0;\n var finalOutput = [];\n var finalObject;\n var finalObjectArray = [];\n var analysisArray = [];\n var returnObject;\n workbook = viz.getWorkbook(); \n for( var i=0;i<reportAttributes.sheetName.length;i++) {\n sheet = viz.getWorkbook().getActiveSheet().getWorksheets().get(reportAttributes.sheetName[i]);\n options = {\n maxRows: 0, // Max rows to return. Use 0 to return all rows\n ignoreAliases: false,\n ignoreSelection: true,\n includeAllColumns: false\n };\n\n sheet.getSummaryDataAsync(options).then(function(t) {\n table = t;\n var tcol = table.getColumns();\n //the data returned from the tableau API\n var columns = table.getColumns();\n var datafromTableau = table.getData();\n var getIndexAttributes = [];\n var niceData = reduceToObjects(columns, datafromTableau);\n analysisArray.push(niceData);\n loopcounter++;\n if(loopcounter == reportAttributes.sheetName.length )\n {\n AnalyzeJSON(analysisArray);\n }\n });\n }\n\t\t}", "title": "" }, { "docid": "d1b192fbb3d5ec3d8afa128c9cdc935a", "score": "0.4993932", "text": "function extractData(command, params) {\n\t\tcommand.output(params.dir + '/' + params.file + '.data')\n\t\t\t.duration(params.duration)\n\t\t\t.outputOptions(['-map data-re', '-codec copy', '-f data', '-y']);\n\t\treturn command;\n\t}", "title": "" }, { "docid": "e503ad236cec71ba670773e051cd26c3", "score": "0.49857733", "text": "function processFile(text){\n var flows = JSON.parse(text);\n var servers = getServers(flows);\n var time_stats = generateTimeStats(flows);\n\n flow_map = buildFlowMap(flows, time_stats);\n //console.log(flow_map);\n\n\n //console.log(flows);\n //console.log(time_stats);\n\n /* TODO: I shouldn't need the flows in the setup, right?*/\n setup(servers, flows, time_stats, flow_map);\n}", "title": "" }, { "docid": "e1e8681c54068a0192f52a646ce43727", "score": "0.49797013", "text": "function filter_JDX_data(data) {\n\n\t\tmoleculeIrData = new Array();\n\t //split raw text by line\n\t var lines = data.split( \"\\n\" );\n\n\t // loop throught each line (-1 = don't get the last blank line)\n\t for( var n = 0; n < lines.length - 1; n++ ) {\n\n\t\t\t\t//Line is not empty\n\t\t\t\tif( typeof(lines[n]) !== undefined && lines[n] !== '') {\n\n\t\t\t\t\t\t// Check if first character of the line\n\t\t\t\t\t\tvar firstChar = lines[n].charAt(0);\n\n\t\t\t\t // is a number, so it is not a comment\n\t\t\t\t if( firstChar % 1 === 0 ) {\n\n\t\t\t\t\t\t\t\tvar data_column = lines[n].split(\" \");\n\n\t\t\t\t\t\t\t\t// Store data in global var\n\t\t\t\t\t\t\t\tmoleculeIrData.push({\n\t\t\t\t\t\t\t\t\tfrequency: parseFloat(data_column[0]),\n\t\t\t\t\t\t\t\t\tvalue: parseFloat(data_column[1])\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t } else {\n\n\t\t\t\t\t // Show data origin and comments\n\t\t\t\t\t var container = document.getElementById('data-comments');\n\t\t\t\t\t\t\t\tvar modal \t\t= document.getElementById('comment-source-file-modal');\n\t\t\t\t\t\t\t\tvar extract \t= document.createElement('p');\n\t\t\t\t\t\t\t\tvar content \t= document.createElement('p');\n\n\t\t\t\t\t\t\t\t// But delete the two first # before adding to the html markup\n\t\t\t\t\t\t\t\tif( firstChar == \"#\" ) {\n\n\t\t\t\t\t\t\t\t\t\tif( n < 9 ) {\n\t\t\t\t\t\t\t\t\t\t\t\textract.innerHTML = lines[n].substring(2);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tcontent.innerHTML = lines[n].substring(2);\n\n\n\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\tif( n < 9 ) {\n\t\t\t\t\t\t\t\t\t\t\t\textract.innerHTML = lines[n].substring(2);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tcontent.innerHTML = lines[n];\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t container.append( extract );\n\t\t\t\t\t\t\t\tmodal.appendChild( content );\n\t\t\t\t }\n\t\t\t\t}\n\t }\n\t\t// Once the whole document is parsed\n\n\t\t//get transmitance hit (depends to threshold slider value)\n\t\tgetTransmitanceHit();\n\n\t\t// fire our function to make a chart\n\t\tchart_this( moleculeIrData );\n\n\t\t// fire our function to make sound\n\t\tmake_sound();\n\n\t\t// fire our function to make 3D\n}", "title": "" }, { "docid": "93f75098cf350400f1160bcda77c5c19", "score": "0.49781722", "text": "function start(){\n\tvar ds = new Miso.Dataset({\n\t\t url : 'http://www.student.kuleuven.be/~s0187958/Thesis/Data/PL_allseasons_matchday.csv',\n//\t\t url : 'http://www.student.kuleuven.be/~s0187958/Thesis/Visualisatie3/Data/E0_1112_matchday_hazzled.csv',\n\t\t delimiter : ';'\n\t});\n\t\n\tds.fetch({\n\t\tsuccess : function() {\n\t\t\tconsole.log(\"Data loaded succesfully...\");\n\t\t\tconsole.log(\"Available Columns:\" + this.columnNames());\n\t\t\tconsole.log(\"There are \" + this.length + \" rows\");\n\t\t\tthis.each(function(row) {\n\t\t\t\tdata.push(row);\n\t\t\t});\n\t\t\tconsole.log(data.length);\n\t\t\tload(data, ds)\n\t\t},\n\t\t\n\t\terror : function() {\n\t\t\tconsole.log(\"Are you sure you are connected to the internet?\");\n\t\t}\n\t});\n}", "title": "" }, { "docid": "9d2ee235db462c0e6f1d3d76c66ee248", "score": "0.49779835", "text": "function parseInputFiles() {\n parseDomain(generateInputWindow);\n}", "title": "" }, { "docid": "9f704b71128bb3dd339917a4f9539252", "score": "0.49724358", "text": "function analyze(data, scope, ops) {\n const output = [];\n let source = null,\n modify = false,\n generate = false,\n upstream,\n i,\n n,\n t,\n m;\n\n if (data.values) {\n // hard-wired input data set\n if (isSignal(data.values) || hasSignal(data.format)) {\n // if either values is signal or format has signal, use dynamic loader\n output.push(load(scope, data));\n output.push(source = collect());\n } else {\n // otherwise, ingest upon dataflow init\n output.push(source = collect({\n $ingest: data.values,\n $format: data.format\n }));\n }\n } else if (data.url) {\n // load data from external source\n if (hasSignal(data.url) || hasSignal(data.format)) {\n // if either url or format has signal, use dynamic loader\n output.push(load(scope, data));\n output.push(source = collect());\n } else {\n // otherwise, request load upon dataflow init\n output.push(source = collect({\n $request: data.url,\n $format: data.format\n }));\n }\n } else if (data.source) {\n // derives from one or more other data sets\n source = upstream = (0, _vegaUtil.array)(data.source).map(d => ref(scope.getData(d).output));\n output.push(null); // populate later\n } // scan data transforms, add collectors as needed\n\n\n for (i = 0, n = ops.length; i < n; ++i) {\n t = ops[i];\n m = t.metadata;\n\n if (!source && !m.source) {\n output.push(source = collect());\n }\n\n output.push(t);\n if (m.generates) generate = true;\n if (m.modifies && !generate) modify = true;\n if (m.source) source = t;else if (m.changes) source = null;\n }\n\n if (upstream) {\n n = upstream.length - 1;\n output[0] = Relay({\n derive: modify,\n pulse: n ? upstream : upstream[0]\n });\n\n if (modify || n) {\n // collect derived and multi-pulse tuples\n output.splice(1, 0, collect());\n }\n }\n\n if (!source) output.push(collect());\n output.push(Sieve({}));\n return output;\n}", "title": "" }, { "docid": "dbac926a3cf5f590c25b83cee6441b45", "score": "0.49721768", "text": "function loadData(name, diagnostic, opts) {\n d3.text(\"data/\" + name + \".csv\", makePlotCallback(diagnostic, opts));\n}", "title": "" }, { "docid": "af176e232b508dd4c6daec242ac6de54", "score": "0.49715862", "text": "function saveData() {\n for (let i = 0; i < data.length; ++i) {\n resultStream.arrayToFile([data[i].score]);\n }\n }", "title": "" }, { "docid": "f2d41387c5d4d2d05d745490f4c0162f", "score": "0.49630088", "text": "function loadData() {\n d3.dsv(',','data/languages_education_work.csv').then((dataLoaded) => {\n dataReasons = dataLoaded; \n drawGraph();\n });\n }", "title": "" }, { "docid": "953230c4629db514fcf61f0289f52e8c", "score": "0.4961743", "text": "function initData() {\n \n _readPersData(); \n _readAllVV();\n \n \n \n \n }", "title": "" }, { "docid": "6c08767d3d4f6db6011b8d4bf546ecbf", "score": "0.49610686", "text": "function evalFile(){\n\tObject.values(testData).forEach(val => {\n\t\t \n\t\t var dataOutput;\n\t\t \n\t\t var cptCorrect = 0;\n\t\t var cptTotal = 0;\n\t\t // permet d'écrire les données ssi c'est une racine est qu'elle est une sortie ou memoire ayant une description ( un bloc logique ne peut aps avoir de description)\n\t\t if(val.IsRoot){\n\t\t\t if(val.PreNode.length >0){\n\t\t\t \n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\treferVal = referData[outputKey[val.Description]];\n\t\t\t\tconsole.log(\"testData \" + evalData(testData,val));\n\t\t\t\tconsole.log(\"referData \" + evalData(referData,referVal));\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t \n\t\t\t\t \n\t\t\t\t \n\t\t\t\t \n\t\t\t\t \n\t\t\t\t \n\t\t\t\t \n\t\t\t\t \n\t\t\t\t \n\t\t\t\t //modif ici pour eval data comparer les data pour testData et referData pour chauqe entree possible\n\t\t\t\t \n\t\t\t\t /*\n\t\t\t\t if(compareData(val)){\n\t\t\t\t\t cptCorrect++;\n\t\t\t\t\t \n\t\t\t\t\t console.log(val.Description + \" test \" + evalData(testData,val) + \" : \" + eval(evalData(testData,val)));\n\t\t\t\t\t console.log(val.Description + \" refer \" + evalData(referData,val)+ \" : \" + eval(evalData(referData,val)));\n\t\t\t\t\t console.log(cptCorrect+ \"/\"+cptTotal);\n\t\t\t\t }\n\t\t\t\t cptTotal++;\n\t\t\t\t \n\t\t\t\t while(!nextEntriesSet(entries)){\n\t\t\t\t\t \n\t\t\t\t\t //var memory = \n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t if(compareData(val)){\n\t\t\t\t\t\t cptCorrect++;\n\t\t\t\t\t }\n\t\t\t\t\t cptTotal++;\n\t\t\t\t\t \n\t\t\t\t\t console.log(val.Description + \" test \" + evalData(testData,val) + \" : \" + eval(evalData(testData,val)));\n\t\t\t\t\t console.log(val.Description + \" refer \" + evalData(referData,val)+ \" : \" + eval(evalData(referData,val)));\n\t\t\t\t\t console.log(cptCorrect+ \"/\"+cptTotal);\n\t\t\t\t }*/\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t do {\n\t\t\t\t\t \t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t// do{\n\t\t\t\t\t\t // ici on fera le traitement des cas \"interdit\"\n\t\t\n\t\t\t\t\t\t // du code\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\tmemoryChange(referData,memoryRefer);\n\t\t\t\t\t\tmemoryChange(testData,memoryTest);\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 if(compareData(val)){\n\t\t\t\t\t\t\t cptCorrect++;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t cptTotal++;\n\t\t\t\t\t\t \n\t\t\t\t\t\t console.log(val.Description + \" test \" + evalData(testData,val) + \" : \" + eval(evalData(testData,val)));\n\t\t\t\t\t\t console.log(val.Description + \" refer \" + evalData(referData,val)+ \" : \" + eval(evalData(referData,val)));\n\t\t\t\t\t\t console.log(cptCorrect+ \"/\"+cptTotal);\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 //} while(!nextEntriesSet(memory));\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t //compteur de reussite\n\t\t\t\t\t\tif(compareData(val)){\n\t\t\t\t\t\t\t cptCorrect++;\n\t\t\t\t\t\t }\n\t\t\t\t\t cptTotal++;\n\t\t\t\t\t \n\t\t\t\t\t console.log(entries);\n\t\t\t\t\t \n\t\t\t\t\t ///////////////////////////////////////////////////////////////////////////////////////////affichage desactiver pour moins de calcul\n\t\t\t\t\t console.log(val.Description + \" test \" + evalData(testData,val) );\n\t\t\t\t\t console.log(val.Description + \" refer \" + evalData(referData,referVal));\n\t\t\t\t\t console.log(cptCorrect+ \"/\"+cptTotal);\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t \n\t\t\t\t } while(!nextEntriesSet(entries));\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t console.log(val.Description + \" : \" + cptCorrect + \" / \" + cptTotal);\n\t\t\t\t \n\t\t\t\t if(cptCorrect == cptTotal){\n\t\t\t\t\t sessionStorage.output_validated++;\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t else{\n\t\t\t\t\t erreur.wrong_output.push(\"La sortie \" + val.Description + \" n'a pas le comportement attendu: \" + cptCorrect + \" / \" + cptTotal);\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t //console.log(val)\n\t\t\t\t //console.log(referData[outputKey[val.Description]]);\n\t\t\t\t //console.log(dataOutput);\n\t\t\t }\n\t\t\t else{\n\t\t\t\t erreur.block_alone.push(val.Description);\n\t\t\t\t //sessionStorage.setItem('missing_gate_output',true);\n\t\t\t }\n\t\t }\n\t\t \n\t\t});\n\t\tsessionStorage.erreur = JSON.stringify(erreur);\n}", "title": "" }, { "docid": "d11d6de24a36ae71cb13bdaa12db7199", "score": "0.49561176", "text": "function question3() {\r\n fs.readFile('./day2.txt', (err, data) => {\r\n const list = data.toString().split('\\r\\n').map(dimension => {\r\n return dimension = dimension.split('x');\r\n });\r\n const total = list.reduce((acc, current) => {\r\n return acc += calculateArea(...current);\r\n }, 0)\r\n console.log(total);\r\n })\r\n}", "title": "" }, { "docid": "e963acc23f2fa317a11d929f4ac97c96", "score": "0.49557924", "text": "function loadQSOsFromFile(file) {\n\tvar reader = new FileReader();\n\treader.onload = function (e) {\n\t\tvar [header, loadedQsos] = Adif.parseAdif(e.target.result);\n\t\tsetTitle(header);\n\t\taddQsos(loadedQsos);\n\t};\n\n\treader.readAsText(file);\n}", "title": "" }, { "docid": "e6c0c0dc8cd0cb03f6ded0e29c594ebe", "score": "0.49513564", "text": "function csvProcessor() {\n\n /*Passing file name to csvProcessor*/\n var inputs = fs.createReadStream(fileName[0]);\n rlMain = readline.createInterface({\n input: inputs\n });\n\n /*Check if file exists*/\n rlMain.on('line', function(line) {\n index = 0;\n temp = line.split(\",\");\n /*Selecting the first line*/\n if (temp[0] == \"countryName\") {\n title = temp;\n index = 1;\n }\n /*JSON for India - Arable land (% of land area)*/\n if (temp !== '' && index === 0) {\n /*Criteria to opulating Agewise data*/\n if (temp[0] == \"India\" && temp[2] == \"Arable land (% of land area)\") {\n for (i = 4; i <= 59; i++) {\n if (temp[i] !== '' && indiaPercentLand[title[i]] === undefined) {\n years = title[i];\n indiaPercentLand[years] = {\n year: years,\n percent: parseFloat(temp[i])\n };\n }\n }\n }\n /*JSON for India - Arable land (hectares per person)*/\n if (temp[0] == \"India\" && temp[2] == \"Arable land (hectares per person)\") {\n for (i = 4; i <= 59; i++) {\n if (temp[i] !== '' && indiaHectPerPerson[title[i]] === undefined) {\n years = title[i];\n indiaHectPerPerson[years] = {\n year: years,\n percent: parseFloat(temp[i])\n };\n }\n }\n }\n /*JSON for India - Arable land (hectares)*/\n if (temp[0] == \"India\" && temp[2] == \"Arable land (hectares)\") {\n for (i = 4; i <= 59; i++) {\n if (temp[i] !== '' && indiaHectares[title[i]] === undefined) {\n years = title[i];\n indiaHectares[years] = {\n year: years,\n total: parseFloat(temp[i])\n };\n }\n }\n }\n /*JSON for Africa - Arable land (% of land area)*/\n if (country[temp[0]] == \"Africa\" && temp[2] == \"Arable land (% of land area)\") {\n if (temp[54] !== '' && title[54] == \"2010\") {\n var tempCountry = temp[0];\n africaPercentLand[tempCountry] = {\n countryName: tempCountry,\n total: parseFloat(temp[54])\n };\n }\n }\n /*JSON for Continent-Wise : Arable land (hectares)*/\n if (temp[2] == \"Arable land (hectares)\") {\n var tempContinent = country[temp[0]];\n for (i = 4; i <= 59; i++) {\n years = title[i];\n if (temp[i] !== '' && tempContinent !== undefined) {\n if (continentHectares[years]) {\n var record = continentHectares[years];\n var value = record[tempContinent] || 0;\n record[tempContinent] = value + parseFloat(temp[i]);\n } else {\n var object = {};\n object.year = years;\n object[tempContinent] = parseFloat(temp[i]);\n continentHectares[years] = object;\n }\n }\n }\n }\n }\n });\n\n /*Writing into the JSON files*/\n rlMain.on('close', function() {\n fs.writeFile('../../Feed/continentHectares.json', JSON.stringify(values(continentHectares),null,'\\t'));\n fs.writeFile('../../Feed/africaPercentLand.json', JSON.stringify(values(africaPercentLand),null,'\\t'));\n fs.writeFile('../../Feed/indiaPercentLand.json', JSON.stringify(values(indiaPercentLand),null,'\\t'));\n fs.writeFile('../../Feed/indiaHectPerPerson.json', JSON.stringify(values(indiaHectPerPerson),null,'\\t'));\n fs.writeFile('../../Feed/indiaHectares.json', JSON.stringify(values(indiaHectares),null,'\\t'));\n });\n}", "title": "" }, { "docid": "5769c148025ea5f7863c599d28a55b70", "score": "0.49476582", "text": "function parseData(file) {\r\n 'use strict';\r\n $.ajax({\r\n url: file,\r\n dataType: 'json',\r\n async: false\r\n }).success(function(returnedData) {\r\n loadData(returnedData);\r\n }).fail(function() {\r\n hideProgressAnimation();\r\n modal.open({\r\n content: 'Error occurred while loading chart data!'\r\n });\r\n });\r\n}", "title": "" }, { "docid": "8f357d7e754b21a256999a91a9ea7f46", "score": "0.49367547", "text": "function readWeatherData (){\r\n collectModelInputs()\r\n const reader = new FileReader();\r\n reader.onload = function(e){ \r\n let lines = reader.result.split('\\n');\r\n let headers = lines[0].split(',');\r\n \r\n if(headers.length > 14){\r\n M.toast({html: 'Too many variables in spreadsheet'})\r\n document.getElementById('weatherFileName').value = ''; \r\n }\r\n\r\n // Start from second array. First array is for the headers\r\n for(let i=1; i<lines.length; i++){\r\n if(lines[i].length > 0){\r\n let values = lines[i].split(',');\r\n weather.push( { year:parseInt(values[0]), month:parseInt(values[1]), day:parseInt(values[2]), \r\n tempMax:parseFloat(values[3]), tempMin:parseFloat(values[4]), \r\n rhMax:parseFloat(values[5]), rhMin:parseFloat(values[6]),\r\n precip:parseFloat(values[7]), solarRad:parseFloat(values[8]), windSpeed:parseFloat(values[9]),\r\n irrigation: parseFloat(values[10]), surfaceSoilWaterObs:parseFloat(values[11]), \r\n rootzoneSoilWaterObs:parseFloat(values[12]), canopyCoverObs:parseFloat(values[13]) } )\r\n }\r\n }\r\n\r\n for(let i=0; i<weather.length; i++){ weather[i].tempAvg = (weather[i].tempMax + weather[i].tempMin)/2}\r\n for(let i=0; i<weather.length; i++){ weather[i].date = new Date(weather[i].year, weather[i].month-1, weather[i].day) }\r\n for(let i=0; i<weather.length; i++){ weather[i].doy = getDayOfYear(weather[i].date) }\r\n for(let i=0; i<weather.length; i++){ weather[i].ETref = computeReferenceET(geolocation, weather[i], 'grass')}\r\n\r\n M.toast({html: 'Observations loaded!'})\r\n e.target.value = '';\r\n\r\n let startDate = timestamp(weather[0].year, weather[0].month, weather[0].day);\r\n let endDate = timestamp(weather[weather.length-1].year, weather[weather.length-1].month, weather[weather.length-1].day);\r\n\r\n // Update management slider with weather boundaries\r\n managementDatesSlider.noUiSlider.updateOptions( {range: {'min': startDate, 'max': endDate} }); // Update the range of the date slider \r\n managementDatesSlider.noUiSlider.set( [startDate,endDate]); // Set the date slider using the first and last dates of the weather dataset\r\n \r\n isWeatherLoaded = true;\r\n run()\r\n }\r\n reader.readAsText(weatherInputElement.files[0])\r\n}", "title": "" }, { "docid": "e3fc7e952f56cd43dd4614dc53c10690", "score": "0.4935097", "text": "async exportData() {\n // Convert operations to csv format\n let csvFormattedData = this.convertOperationsToCSVComplex();\n // Export operations to disk\n await this.exportFile(this.filename, csvFormattedData);\n }", "title": "" }, { "docid": "db43bfec9ac20f54d669283ee5cab081", "score": "0.49333167", "text": "resolveData(data) {\n if (typeof data === 'string') {\n if (data.includes('.csv')) {\n return () => {\n csv(data).then(d => {\n this.getTotal(d);\n this.data = d;\n this.drawFromFile();\n });\n };\n } else if (data.includes('.tsv')) {\n return () => {\n tsv(data).then(d => {\n this.getTotal(d);\n this.data = d;\n this.drawFromFile();\n });\n };\n }\n } else {\n return () => {\n this.data = data;\n for (let i = 0; i < data.length; ++i) {\n let t = 0;\n let keys = Object.keys(data[i]);\n keys.forEach(d => {\n if (d !== this.labels) {\n t += data[i][d];\n data[i].total = t;\n }\n })\n }\n this.drawFromObject();\n };\n }\n }", "title": "" }, { "docid": "831fa50ca113a8a0fb8746d6d38ac529", "score": "0.4926377", "text": "function processData(fileArray) {\n for (var i = 0; i < fileArray.length; i++) {\n var jsonFile = fileArray[i];\n getBuildData(jsonFile);\n }\n}", "title": "" }, { "docid": "fb2e70cd8ecb2298e4e3af00a238dd05", "score": "0.49220094", "text": "function readData2( data ){\n reset();\n\n //Add application nodes\n for(var i=0; i<data.Applications.length; i++){\n addApp(String(data.Applications[i]));\n }\n\n //Add application connections\n //for each edge\n for(var i=0; i<data.edges.length; i++){\n var sourceConPosX = cy.$('#'+String(data.edges[i].source)).position().x;\n var targetConPosX = cy.$('#'+String(data.edges[i].target)).position().x;\n\n //Connection points\n incMidBarWidth();\n cy.add([\n { group: \"nodes\", data: { type: 'conPointNode', id:'sConP'+i}, position: {x: sourceConPosX, y: 100-i*15 } },\n { group: \"nodes\", data: { type: 'conPointNode', id:'tConP'+i}, position: {x: targetConPosX, y: 100-i*15 } },\n\n { group: \"edges\", data: { source: data.edges[i].source, target: 'sConP'+i, type: 'goodIntEdge' } },\n { group: \"edges\", data: { source: 'sConP'+i, target: 'tConP'+i, type: 'goodIntEdge' } },\n { group: \"edges\", data: { source: 'tConP'+i, target: data.edges[i].target, type: 'goodIntEdge' } },\n { group: \"edges\", data: { source: data.edges[i].source, target: data.edges[i].target, type: 'spaghEdge' } }\n ]);\n }\n}", "title": "" }, { "docid": "1070fc25acdceb1cbfc22c307c5ab60d", "score": "0.4916975", "text": "function DemographicData(id) {\n // Read the SAMPLES.JSON file into D3 so you can work with its data to build tables & visualizations.\n d3.json(\"samples.json\").then((data)=> {\n // Get metadata from SAMPLES.JSON. We'll use this info for the Demographic Panel visualization.\n var metadata = data.metadata;\n console.log(metadata);\n // Filter the Demographic Metadata for a specific Patient ID (starting with the first Patient ID).\n var result = metadata.filter(meta => meta.id.toString() === id)[0];\n console.log(result);\n // Select the Demographic Panel from INDEX.HTML so you can put the selected Patient's demographic data in there.\n var demographicInfo = d3.select(\"#sample-metadata\");\n // Clear the Demographic Panel, to enable input of the specified Patient ID.\n demographicInfo.html(\"\");\n // Collect the Demographic Metadata for the selected Patient ID, and display it in the Demographic Panel.\n Object.entries(result).forEach((key) => { \n demographicInfo.append(\"h5\").text(key[0].toUpperCase() + \": \" + key[1] + \"\\n\"); \n });\n });\n }", "title": "" }, { "docid": "7196eaf39c2594c6c072db3878831a18", "score": "0.49092856", "text": "GetSpectrumData() {}", "title": "" }, { "docid": "e8ae45fdf9f7eb1aa1269bfdaa6515ba", "score": "0.4908747", "text": "function extract(file, data) {//, draw) {\n zip.createReader(new zip.HttpReader(file), function(reader) {\n\n reader.getEntries(function(entries) {\n\n entries[0].getData(new zip.TextWriter(), function(text) {\n \n process(text, data);\n\n reader.close(function() {\n // onclose callback\n \t\t\td3.select(\"#mnist_load\").classed(\"inactive\", true)\n \t\t\td3.select(\"#mnist_start\").classed(\"inactive\", false)\n \t\t\td3.select(\"#mnist_step\").classed(\"inactive\", false)\n });\n }, function(current, total) {\n // onprogress callback\n d3.select(\"#percent\").text(d3.format(\".0%\")(current / total));\n });\n }\n );\n }, function(error) {\n // onerror callback\n console.log('error loading ' + file);\n });\n}", "title": "" }, { "docid": "9632c5ce788291f98a713de7ee3b7cac", "score": "0.49083483", "text": "function loadData() {\r\n // load the demographics.csv file \r\n // assign it to the data variable, and call the visualize function by first filtering the data\r\n // call the visualization function by first findingDataItem\r\n d3.csv(\"data/demographics.csv\", function (d) {\r\n data = d;\r\n data.forEach(function (item) {\r\n item.n = parseInt(item.n);\r\n });\r\n\r\n visualizeSquareChart(findDataItem());\r\n\r\n });\r\n}", "title": "" }, { "docid": "950b00acf0796324850144a58c4fb752", "score": "0.49075317", "text": "function main_loadfiles_readvar(){\n g.medical_read = {\n /*\n out: {'1':g.module_lang.text[g.module_lang.current].chart_out_label1,\n '2':g.module_lang.text[g.module_lang.current].chart_out_label2,\n '3':g.module_lang.text[g.module_lang.current].chart_out_label3,\n '4':g.module_lang.text[g.module_lang.current].chart_out_label4},\n sev: {A:g.module_lang.text[g.module_lang.current].chart_sev_labelA,\n B:g.module_lang.text[g.module_lang.current].chart_sev_labelB,\n C:g.module_lang.text[g.module_lang.current].chart_sev_labelC},\n sexpreg: {'12':g.module_lang.text[g.module_lang.current].chart_sexpreg_label12,\n '22':g.module_lang.text[g.module_lang.current].chart_sexpreg_label22,\n '21':g.module_lang.text[g.module_lang.current].chart_sexpreg_label21},\n */\n fyo: {u:g.module_lang.text[g.module_lang.current].chart_fyo_labelu,\n o:g.module_lang.text[g.module_lang.current].chart_fyo_labelo},\n \n };\n}", "title": "" }, { "docid": "af703e0d6dc9e76d3d6fa8c18bff78cb", "score": "0.49056384", "text": "function readFile() {\n\tvar reader = new FileReader();\n\n\treader.onload = function(e) {\n\t\tvar text = reader.result;\n\t\tconsole.log(\"Onload file contents: \\n\" + text);\n\t\tvar converted = convertDotFile(text);\n\t\tdisplayGraph(converted[0], converted[1]);\n\t}\n\n\tif (getSelectedOption() != null) {\n\t\tconsole.log(\"Reading file \" + getSelectedOption());\n\t\treader.readAsText(fileMap[getSelectedOption()]);\n\t} else {\n\t\talert(\"No file selected.\");\n\t}\n}", "title": "" }, { "docid": "c224fe2eed00149ec19595e5aaa29f17", "score": "0.4905234", "text": "function runAnalyze() {\n var textDoc = getTextDoc();\n Logger.log(\"Source Text: %s\", JSON.stringify(textDoc));\n var problems = analyze(textDoc);\n //var problems = mockAnalyze(textDoc);\n Logger.log(\"Problems: %s\", JSON.stringify(problems));\n markupDoc(problems);\n}", "title": "" }, { "docid": "8981f917c2e81bfdd0cbce4e4b7e11fd", "score": "0.48988295", "text": "function process_plant_tsv(file_str) {\r\n var rows = [];\r\n var feature_arr = [];\r\n var row_id = 0;\r\n var header = true;\r\n\r\n var lines = file_str.split('\\n');\r\n for (line of lines) {\r\n row_id += 1;\r\n var arr = line.trim().split('\\t');\r\n // Get an array of header\r\n if (header) {\r\n num_of_cols = arr.length;\r\n for (var i = 0; i < num_of_cols; i++) {\r\n feature_arr.push(arr[i].trim());\r\n }\r\n header = false;\r\n } else {\r\n if (arr.length < num_of_cols) {\r\n console.log('Error on row', row_id, 'Not enough columns!', arr);\r\n continue;\r\n }\r\n for (var i = 0; i < arr.length; i++) {\r\n arr[i] = arr[i].trim();\r\n }\r\n\r\n row = arr.slice(0, num_of_cols);\r\n labels = arr.slice(num_of_cols, arr.length);\r\n rows.push([row].concat([labels]));\r\n }\r\n }\r\n\r\n attr_header = feature_arr; //global\r\n data_rows = rows; //global\r\n}", "title": "" }, { "docid": "6303193ea3bfb3fa13e2567c00c14be1", "score": "0.48984107", "text": "function analyseCSV(){\n if (fileExtName === \"csv\"){\n setDelimiter()\n /*console.log(\"delimiter\")\n console.log(delimiter)*/\n splitCSV(fileContent)\n setAttributes(columns)\n setEntityClass(attributesNumeric_CSV,attributesNominal_CSV,rows,columns)\n setTags();\n setDatasetSource();\n setDSDatalake();\n setIngest();\n attributesNumeric_CSV = JSON.stringify(attributesNumeric_CSV).replace(/\\\"/g, \"\")\n attributesNumeric_CSV = JSON.stringify(attributesNumeric_CSV).replace(/\\:/g,\"\\:\\\"\").replace(/\\,/g,\"\\\"\\,\").replace(/\\}\\]/g,\"\\\"\\}\\]\").replace(/\\}\\\"\\,\\{/g,\"\\\"\\}\\,\\{\")\n attributesNumeric_CSV = attributesNumeric_CSV.replace(/^\\\"|\\\"$/g,'')\n\n attributesNominal_CSV = JSON.stringify(attributesNominal_CSV).replace(/\\\"/g, \"\")\n attributesNominal_CSV = JSON.stringify(attributesNominal_CSV).replace(/\\:/g,\"\\:\\\"\").replace(/\\,/g,\"\\\"\\,\").replace(/\\}\\]/g,\"\\\"\\}\\]\").replace(/\\}\\\"\\,\\{/g,\"\\\"\\}\\,\\{\")\n attributesNominal_CSV = attributesNominal_CSV.replace(/^\\\"|\\\"$/g,'')\n\n tags_CSV = JSON.stringify(tags_CSV).replace(/\\\"/g, \"\")\n tags_CSV = JSON.stringify(tags_CSV).replace(/\\:/g,\"\\:\\\"\").replace(/\\,/g,\"\\\"\\,\").replace(/\\}\\]/g,\"\\\"\\}\\]\").replace(/\\}\\\"\\,\\{/g,\"\\\"\\}\\,\\{\")\n tags_CSV = tags_CSV.replace(/^\\\"|\\\"$/g,'')\n\n console.log(\"---------\")\n console.log(fileContent)\n console.log(columns)\n console.log(rows)\n console.log(entityClass_CSV)\n console.log(attributesNumeric_CSV)\n console.log(attributesNominal_CSV)\n console.log(tags_CSV)\n console.log(\"---------\")\n }\n}", "title": "" }, { "docid": "b353a02696e61f87e2f5adbf10e4bcd3", "score": "0.4897311", "text": "function open_coords_file(event) {\n\tconsole.log(\"in open_coords_file\");\n\t\t\n\tvar raw_data;\n\tvar reader = new FileReader();\n\n\tif (this.files[0].size > 1000000) {\n\t\tuser_message(\"Warning\",\"Loading large file may take a while.\");\n\t}\n\n\treader.readAsText(this.files[0]);\n\treader.onload = function(event) {\n\t\traw_data = event.target.result;\n\t\tclear_coords_input();\n\t\tcoords_input_changed(raw_data);\n\t\td3.select(\"#collapsible_alignment_input_box\").attr(\"class\",\"panel-collapse collapse\");\n\t}\n}", "title": "" }, { "docid": "1d4d9e2c7bc2f8e82386e42877ea3fb7", "score": "0.4893331", "text": "function loadFileHandler(text)\r\n\t{\r\n\t var content = text.split(\"\\n\");\r\n\t var StartDate = new Date();\r\n\t\tvar StartTime = StartDate.getTime();\r\n\t\tvar parser = new ANALYSISFileParser();\r\n\t\t\r\n\t\t\r\n\t for(var i = 0 ; i < content.length; i++)\r\n\t {\r\n\t \tvar line = content[i];\r\n\t \tparser.LineHandler(line);\r\n\t\t}\r\n\t\tparser.ProcessDone(StartTime,callback,arg1,arg2,arg3);\r\n\t}", "title": "" }, { "docid": "b781c14ed24eff2d9bbe65800dd98ce0", "score": "0.4888502", "text": "function main() {\r\n d3.csv(\"OverzichtLeerlingen.csv\").then(function (leerlingen_data) {\r\n storeStudentDataInArrays(leerlingen_data);\r\n d3.csv(\"activiteiten.csv\").then(function (activiteiten_data) {\r\n storeActivitiesDataInArrays(activiteiten_data);\r\n visualizeMembersByRegion(); // default view\r\n visualiseActivitiesOnMap();\r\n });\r\n });\r\n // Add toggle event to toggle button \r\n d3.select(\"#activity-toggle\").on('click', function () { toggleAllActivities() });\r\n // Add initial filter pillButton manually (animaties is already true in dictionary)\r\n addFilter(\"Animaties\");\r\n updateYearLegend();\r\n}", "title": "" }, { "docid": "93e59089d25af1ca048cfb83d53f6353", "score": "0.48883808", "text": "function loadFile() { \n // Get the sampling frequency from the input box\n\tlet val = $(\"#sampling_freqency\").val();\n\tvar freq=0;\n\tif(isNumber(val)) freq = parseFloat(val);\n if(!isNumber(val) || (freq < 1)){\n alert(\"Invalid or empty sampling frequency! Please input a valid sampling frequency greater than 0.\");\n return;\n }\n\n // Parse the CSV file\n var data = d3.csvParse(reader.result);\n if(data){\n $(\"#data_loaded\").show();\n $(\"#file-upload-div\").hide();\n \n var columnNames = d3.keys(data[0]);\n\n let time = $('#time_check').is(\":checked\")? true: false;\n\n // Put the raw data into a d3 compatible object\n allData = addTimeData(columnNames, data, freq, time);\n\n // Update the dropdown with the channel names\n if(time) columnNames.shift();\n updateDropdown(columnNames);\n\n // Draw the raw data and the FFT\n draw(allData[0], freq);\n }\n}", "title": "" }, { "docid": "2cee0aecd1bd819130cce05fec3b7971", "score": "0.48877862", "text": "function getDataFromFiles(dataFiles, lng, lat, distance, year, beginning, ending, timeInterval,res){\n \n console.log(\"\\nIn GETDATAFROMFILLE\\n\");\n\n if( dataFiles.length == 0 ){\n\tdataJson.error = \"Cannot find files to processing\";\n\tres.json(dataJson);\n }\n\n // create temp files for input and output for GDAL exec\n var fs = require('fs');\n var temp = require('temp');\n\n var l8Name, l8Outname, tempeName, tempeOutname;\n var ndviName, ndviOutname, reflectName, reflectOutname;\n\n for( var i = 0; i < dataFiles.length; i++ ){\n\tif( dataFiles[i].operatetype == \"L8Image\" ){\n\t l8Name = temp.path({suffix: '.txt'});\n\t l8Outname = temp.path({suffix: '.txt'});\n\t}\n\telse if(dataFiles[i].operatetype == \"temperature\" ){\n\t tempeName = temp.path({suffix: '.txt'});\n\t tempeOutname = temp.path({suffix: '.txt'});\n\t}\n\telse if(dataFiles[i].operatetype == \"reflectance\" ){\n\t reflectName = temp.path({suffix: '.txt'});\n\t reflectOutname = temp.path({suffix: '.txt'});\n\t}\n\telse if(dataFiles[i].operatetype == \"ndvi\" ){\n\t ndviName = temp.path({suffix: '.txt'});\n\t ndviOutname = temp.path({suffix: '.txt'});\n\t}\n\tconsole.log(\"Index: \" + i);\n }\n \n // loop each query type\n var dataJson = {};\n dataJson.L8Image = null;\n for( var i = 0; i < dataFiles.length; i++ ){\n\tvar docs = dataFiles[i].body;\n\tvar type = dataFiles[i].operatetype;\n\n\tconsole.log(\"Loop operation type: \" + type);\n\n\tvar exename;\n\tif( type == \"L8Image\" ){\n\t \n\t console.log(\"\\nIn L8IMAGE: \" + i);\n\n\t dataJson.L8Image = null;\n\t var list = buildNewLocationList( docs, distance);\n\t if( list.length > 0 ){\n\t\texename = buildExeCommand( list, lng, lat, distance, \n\t\t\t\t\t l8Name, l8Outname, type,\n\t\t\t\t\t beginning, ending, timeInterval);\n\t\tconsole.log(\"EXENAME: \" + exename);\n\t\tif( exename != \"\" ){\n\t\t var imgData = runGetDataCommand(exename, l8Outname, list, type);\n\t\t if( imgData.length > 0 )\n\t\t\tdataJson.l8image = imgData[0];\n\t\t \n\t\t}\n\t }\n\t}\n\telse if( type == \"temperature\" ||\n\t\t type == \"reflectance\" ||\n\t\t type == \"ndvi\" ){\n\t \n\t console.log(\"\\nIn Modis Temp/Ref/NDVI: \" + i);\n\n\t dataJson.temperature = null;\n\t dataJson.reflectance = null;\n\t dataJson.ndvi = null;\n\t var list = buildNameList( docs, distance, type, year, beginning, ending);\n\t console.log(\"Modis file size: \" + list.length);\n\t if( list.length > 0 ){\n\t\tif( type == \"temperature\" )\n\t\t exename = buildExeCommand( list, lng, lat, distance, \n\t\t\t\t\t tempeName, tempeOutname, type,\n\t\t\t\t\t beginning, ending, timeInterval);\n\t\telse if( type == \"reflectance\" )\n\t\t exename = buildExeCommand( list, lng, lat, distance, \n\t\t\t\t\t reflectName, reflectOutname, type,\n\t\t\t\t\t beginning, ending, timeInterval);\n\t\telse\n\t\t exename = buildExeCommand( list, lng, lat, distance, \n\t\t\t\t\t ndviName, ndviOutname, type,\n\t\t\t\t\t beginning, ending, timeInterval);\n\n\t\tconsole.log(\"EXENAME: \" + exename);\n\t\tif( exename != \"\" ){\n\t\t var imgData;\n\t\t if( type == \"temperature\" )\n\t\t\timgData = runGetDataCommand(exename, tempeOutname, list, type);\n\t\t else if( type == \"reflectance\" )\n\t\t\timgData = runGetDataCommand(exename, reflectOutname, list, type);\n\t\t else\n\t\t\timgData = runGetDataCommand(exename, ndviOutname, list, type);\n\t\t if( imgData.length > 0 ){\n\t\t\tif( type == \"temperature\" )\n\t\t\t dataJson.temperature = imgData[0];\n\t\t\telse if( type == \"reflectance\" )\n\t\t\t dataJson.reflectance = imgData[0];\n\t\t\telse\n\t\t\t dataJson.ndvi = imgData[0];\n\t\t }\n\t\t}\n\t }\n\t}\n }\n \n var bFound = false;\n for( var i = 0; i < dataFiles.length; i++ ){\n\ttype = dataFiles[i].operatetype;\n\tif( type == \"L8Image\" && dataJson.l8image != null ){\n\t bFound = true;\n\t break;\n\t}\n\telse if( type == \"temperature\" && dataJson.temperature != null ){\n\t bFound = true;\n\t break;\n\t}\n\telse if( type == \"reflectance\" && dataJson.reflectance != null ){\n\t bFound = true;\n\t break;\n\t}\n\telse if( type == \"ndvi\" && dataJson.ndvi != null ){\n\t bFound = true;\n\t break;\n\t}\n }\n if( bFound == false )\n\tdataJson.error = \"Cannot find data\";\n else\n\tdataJson.error = \"None\";\n \n res.json(dataJson);\n}", "title": "" }, { "docid": "bf957910ba30670e423bba73db3f3d51", "score": "0.48873624", "text": "loadData() {\r\n\r\n\t}", "title": "" }, { "docid": "a229a3af383dfd2e4e08a8f77d36dab9", "score": "0.48855552", "text": "function getDataObjects() {\n // stream parser for customer info\n fs.createReadStream(custfilename, {highWaterMark:2*1024})\n .pipe(cp)\n .on('data', (element) => {\n custq.enqueue(element);\n //console.log('customer q contains: ', custq.size());\n })\n .on('end', ()=> {\n done += 1; // finished this data\n //console.log('\\t\\t\\tcustomers complete');\n })\n // stream parser for address data\n fs.createReadStream(adrfilename, {highWaterMark:2*1024})\n .pipe(ap)\n .on('data', (element) => {\n adrq.enqueue(element);\n //console.log('adress q contains: ', adrq.size());\n })\n .on('end', ()=> {\n done += 1; // finished this file\n //console.log('\\t\\t\\taddresses complete');\n })\n}", "title": "" }, { "docid": "68b70b33073e0d3adef5c68420333cf0", "score": "0.4875559", "text": "async function load_process_data() {\n \n let df = await dfd.read_csv(\"https://github.com/opeyemibami/tensorflowjs-and-danfojs/blob/master/dataset/wine_dataset.csv\")\n df.head().print() \n}", "title": "" }, { "docid": "4881a94d25308a8360c05c4e9774e372", "score": "0.48703504", "text": "function load_data()\n{\n if (!fs.existsSync(filename)) return;\n\n console.log('Reading ' + filename);\n logItems = JSON.parse(fs.readFileSync(filename));\n console.log('Parsed ' + logItems.length + ' entries');\n}", "title": "" }, { "docid": "b67e0b3f76bd53926c43fd67b58e9404", "score": "0.4866246", "text": "async readFile() {\n\t\tconst file = $(`#${ID_INPUT_FILE_DATA}`)[0].files[0];\n\t\tif (!file)\n return;\n \n const options = $(`#${ID_OPTION_FILE_TYPE_INPUT}`).val();\n\n let data;\n if (options == \"ROUTE_CONFIG\") {\n data = await readYamlFile(file);\n } else {\n data = await readDataFileJson(file);\n }\n\n\t\tif (!data)\n\t\t\treturn;\n\n\t\tthis.parent.separateDataToManagement(data, options, file.name);\n\t}", "title": "" }, { "docid": "16148791a2306eebd073570d2c231dae", "score": "0.48641178", "text": "function onGraph() {\n const fileId = this.fileId;\n const fileName = this.file;\n $.get( \"/checkFile/\"+fileName, function( data ) {\n // if ABF file\n if(data.length == 0) {\n // take more information\n $.get( \"/getCSVdetails/\" + fileId, function( data ) { \n drawGraphABF(data[0].pulseNumber, fileName, data[0].recording);\n });\n }\n // if ASC file\n else {\n drawGraphASC(data.length, fileName, data);\n }\n }); \n}", "title": "" }, { "docid": "d59bc8a0e8576580f1c0a3cf520532ce", "score": "0.48637947", "text": "function changeData() {\n let dataFile = document.getElementById('dataset').value;\n if (document.getElementById('random').checked) {\n randomSubset();\n }\n else {\n d3.csv('data/' + dataFile + '.csv', update);\n }\n}", "title": "" }, { "docid": "21804bf91fdfba40cb350550f93f76c5", "score": "0.48635483", "text": "loadSpreadsheetData() {\n this.loadSFVData();\n this.loadDbfzData();\n }", "title": "" }, { "docid": "e893bb989bc00b810f11c83d2d311ac4", "score": "0.48585153", "text": "function loadData() {\n if (!chart1) return;\n\n var tracksToPlot = [];\n for (trackName in tracksMap) {\n if (isInDiseaseScheme(trackName, curScheme)) {\n tracksToPlot.push(trackName);\n }\n }\n \n tracksToPlot.sort(cmpTracks);\n for (var i = 0; i < tracksToPlot.length; i++) {\n plotTrack(tracksToPlot[i]);\n }\n \n if (tracksToPlot.length == 0) {\n $('#no-items-msg').html('No items to display.');\n $('#show-no-items').css('display', 'inline');\n $('#export-button').css('display', 'none');\n $('#lab-key').css('display', 'none');\n } else {\n $('#show-no-items').css('display', 'none');\n $('#export-button').css('display', 'inline');\n $('#lab-key').css('display', 'inline');\n }\n}", "title": "" }, { "docid": "65af63cd98b7d1502f6ae3d9b2c74c1d", "score": "0.4857614", "text": "function analyze(data, nbline) {\n var arr = [];\n for (var i = 0; i < data.asm.length; i++) {\n var item = data.asm[i];\n if (item.source != null && item.source.line == nbline) {\n console.log(item.text)\n var f = new Format(item.text)\n console.log(\"opcode\", f.bit)\n console.log(\" \")\n arr.push(f)\n }\n }\n return arr;\n}", "title": "" }, { "docid": "44117ed0da0977709826dac38b33483f", "score": "0.4855212", "text": "function sumFiles(data) {\n\n return sumProjectFileValues(data);\n}", "title": "" }, { "docid": "3f4f525e2e0e4a26c9f062f72748f966", "score": "0.4846466", "text": "function parsePartialData(fileobj) {\n\n\talert(\"*** \" + fileobj.name);\n\tPapa.parse(fileobj, {\n\t\t\t// base config to use for each file\n\t\tpreview: 10,\n\t\theader: true,\n\t\tbefore: function(file, inputElem)\n\t\t{\n\t\t\t// executed before parsing each file begins;\n\t\t\t// what you return here controls the flow\n\t\t},\n\t\terror: function(err, file, inputElem, reason)\n\t\t{\n\t\t\tconsole.log(err);\n\t\t\tconsole.log(reason);\n\t\t\t// executed if an error occurs while loading the file,\n\t\t\t// or if before callback aborted for some reason\n\t\t},\n\t\tcomplete: function(results)\n\t\t{\n\t\t\t//console.log(results);\n\t\t\tpopulatePartialTable(results.meta.fields, results.data);\n\t\t\t// executed after all files are complete\n\t\t}\n\t});\n}", "title": "" }, { "docid": "9122009757373e71bbfa39d4d8739666", "score": "0.48445335", "text": "function computeData(){\n\t// calculate sums of majors grouped together\n\tdata.forEach(function (d) {\n\t\td.stem = +d.bio + +d.chem + +d.cs + +d.phys + +d.engr + +d.psych + +d.geo + +d.nursing + +d.math;\n\t\td.humanities = +d.eng + +d.cas + +d.history + +d.phil + +d.classics + +d.religion;\n\t\td.socsci = +d.polisci + +d.intldev + +d.econ + +d.business + +d.soc;\n\t\td.arts = +d.music + +d.art;\n\t\td.lang = +d.asian + +d.germ + +d.french + +d.spanish;\n\t\td[\"pre-prof\"] = +d[\"pre-arch\"] + +d[\"pre-law\"] + +d[\"pre-dent\"] + +d[\"pre-med\"] + +d[\"pre-occ\"] + +d[\"pre-opt\"] + +d[\"pre-pharm\"] + +d[\"pre-phys\"] + +d[\"pre-ass\"] + +d[\"pre-sem\"];\t\t\n\t});\n\n firstvalue += offset;\n \tcolor.domain(d3.keys(data[0]).filter(function(key) { \n return catSelector[dataType].indexOf(key) > -1; \n })); //is it in our selected array?\n\n \tdata.forEach(function(d) {\n \tvar y0 = 0;\n \t\n \td.series = color.domain().map(function(name) { return {name: name, year:d.year}; });\n \t\n \ttargetorder = catSelector[dataType];\n \td.series.sort(function(a, b) { return targetorder.indexOf(a.name) - targetorder.indexOf(b.name); })\n\t\n d.series.forEach(function(e) {\n \te.y0 = y0;\n \te.y1 = y0 += +d[e.name];\n });\n \t\n \t \td.total = d.series[d.series.length - 1].y1;\n \n\t});\n\t\n\t//console.log(data);\n\t//data.sort(function(a, b) { return b.total - a.total; });\n\n\tx.domain(data.map(function(d) { return d.year; }));\n\ty.domain([0, d3.max(data, function(d) { return d.total; })]);\n}", "title": "" }, { "docid": "a119994e96b810814d755f34eef8728c", "score": "0.48427472", "text": "function onClickLoadData() {\r\n $(\"#btn_train_loading\").show();\r\n\r\n let file = document.getElementById(\"prediction_data_upload\").files[0];\r\n\r\n\ttry {\r\n Papa.parse(file, {\r\n complete: function (results) {\r\n CleanRawData(results.data);\r\n }\r\n });\r\n } catch (e) {\r\n console.log(e)\r\n $(\"#btn_train_loading\").hide();\r\n $(\"#div_trainingdata\").html(\"<span>Error with the uploaded SPR</span>\");\r\n }\r\n}", "title": "" }, { "docid": "1981bdfe1bded79eb5e93bead98233a2", "score": "0.48322698", "text": "function handleDatasetAnalysis() {\n let myHeaders = new Headers();\n myHeaders.append(\"X-USER\", state.userID);\n\n let requestOptions = {\n method: 'GET',\n headers: myHeaders,\n redirect: 'follow'\n };\n dispatch({type: \"SET_LOADING\", payload: {isLoading: true}});\n fetch(state.APIendpoint +\"/GetModelAnalysis\", requestOptions)\n .then((response) => {\n if (!response.ok) {\n throw \"Response not OK\";\n }\n return response.text();\n })\n .then((result) => {\n const jsonResult = JSON.parse(result);\n //Debugging\n dispatch({type: \"SET_LOADING\", payload: {isLoading: false}}); //Stop the loading animation\n dispatch({type: \"SET_DATASET_ANALYSIS\", payload: {datasetAnalysis: jsonResult}}); //Store the analysis results in global state\n })\n .catch((error) => {\n dispatch({type: \"SET_LOADING\", payload: {isLoading: false}}); //Stop the loading animation\n console.log(\"error\", error); //Log the error to the console\n history.push(\"/404\"); //Take the user to the error page\n });\n }", "title": "" }, { "docid": "3c5eaeacc0481b32d1d585ebe44f495c", "score": "0.48297226", "text": "function Files() {\n console.info(`Checking file directory...`)\n let dir = file.substr(0, file.lastIndexOf(\"/\")) ;\n let files = fs.readdirSync(dir), fname = file.substr(file.lastIndexOf(\"/\")+1) ;\n count.global = files.length - 1 ;\n console.info(`${count.global} other file(s) found in ${dir}`) ;\n files.forEach((f) => {\n if (f == fname) { return ; } else { f = path.join(dir, f); }\n let parser = new PDFParser(this, 1) ;\n //Erreur\n parser.on(\"pdfParser_dataError\", (err) => {\n console.error(`${f} : An error occured`) ;\n analyzed.global++;\n End();\n })\n //Lu\n parser.on(\"pdfParser_dataReady\", (data) => {\n console.info(`${f} : Tests in progress`) ;\n Analyze(f, parser.getRawTextContent()) ;\n })\n parser.loadPDF(f);\n }) ;\n }", "title": "" }, { "docid": "0c6fa59c205032c8d451d186a8d2cf12", "score": "0.48290002", "text": "function loopData(file) {\r\n\r\n //loop throught data file\r\n file.map(function(d) {\r\n d.obesity = +d.obesity;\r\n d.income = +d.income;\r\n d.smokes = +d.smokes;\r\n d.age = +d.age;\r\n d.healthcare = +d.healthcare;\r\n d.poverty = +d.poverty;\r\n })\r\n\r\n // crate variables for x and y values\r\n var xValue = d => d.obesity\r\n var yValue = d => d.income\r\n\r\n // create scales for graph\r\n const xScale = d3.scaleLinear()\r\n .domain([0, d3.max(file, xValue)])\r\n .range([0, width]);\r\n\r\n const yScale = d3.scaleLinear()\r\n .domain([d3.max(file, yValue), 0])\r\n .range([0, height]);\r\n\r\n // create the variables for the axis\r\n const yAxis = d3.axisLeft(yScale);\r\n const xAxis = d3.axisBottom(xScale);\r\n\r\n // add the axis to the group\r\n const yAxisGroup = g.append('g').call(yAxis);\r\n\r\n const xAxisGroup = g.append('g').call(xAxis)\r\n .attr('transform', `translate(0, ${height})`);\r\n\r\n // add labels for axis\r\n var xAxisLabel = 'Obesity Rate';\r\n var yAxisLAbel = 'Income';\r\n\r\n xAxisGroup.append('text')\r\n .attr(\"transform\", `translate(${width/2}, ${0 + (margin.bottom/2)})`)\r\n .attr('class', 'aText active x')\r\n .text(xAxisLabel) ;\r\n \r\n yAxisGroup.append('text')\r\n .attr(\"transform\", 'rotate(-90)')\r\n .attr('x', 0 - height/2)\r\n .attr('y', 0 - margin.bottom/2 - margin.right)\r\n .attr('class', 'aText active x')\r\n .text(yAxisLAbel);\r\n\r\n // add the circles to the scatter plot\r\n var circles = g.selectAll('circle').data(file).enter()\r\n \r\n \r\n circles.append('circle')\r\n .attr('cx', d => xScale(d.obesity))\r\n .attr('cy', d => yScale(d.income))\r\n .attr('r', '12')\r\n .attr('fill', '#788dc2')\r\n .attr('opacity', '.75');\r\n\r\n // add text to each circle\r\n circles.append('text')\r\n .attr('x', d => xScale(d.obesity))\r\n .attr('y', d => yScale(d.income))\r\n .style(\"font-size\", \"9px\")\r\n .style('fill', '#fff')\r\n .style('text-anchor', 'middle')\r\n .text(d => (d.abbr));\r\n \r\n}", "title": "" }, { "docid": "32c4f7254d05b8ba495ff2c76af247f5", "score": "0.48285204", "text": "function analyzer (data) {\n data = JSON.parse(JSON.stringify(data)) //clone the data\n let options = {\n done: () => data, //get the transformed data\n filter: (prop, func) => { //remove entries that dont match a condition\n data = data.filter(e => func(e[prop]))\n return options\n },\n partition: (prop) => { //count up all unique occurences of a certain property\n let counts = {}\n for (let i in data) {\n const value = data[i][prop]\n if (!counts[value]) counts[value] = 0\n counts[value]++\n }\n data = []\n for (let prop in counts) {\n data.push({\n name: prop,\n count: counts[prop]\n })\n }\n return options\n },\n max: (prop, howMany = 1) => { //finds the datum with the maximum value of a certain property\n return data.sort((a, b) => b[prop] - a[prop]).slice(0, howMany)\n },\n min: (prop, howMany = 1) => { //finds the datum with the minimum value of a certain property\n return data.sort((a, b) => a[prop] - b[prop]).slice(0, howMany)\n }\n }\n return options\n}", "title": "" }, { "docid": "ccc87d8bad60f47bf7d2cc5f9f22e275", "score": "0.48249838", "text": "displayData_worldPopulation(){\n const datas=this.readFile(this.csv1);\n return datas;\n }", "title": "" }, { "docid": "ae6138b99f89826e3d97cba3dd0fdfee", "score": "0.4819801", "text": "logTotalStats(data) {\n if (!data.length) {\n console.log(chalk.red('\\r\\nError: No Files to validate found.'));\n return;\n } \n\n console.log(chalk.bold(`\\r\\n${data.length} files validated.`));\n \n if (data.every(d => d.success)) {\n // All files validated successfully\n console.log(chalk.bold(`Validation ${chalk.green('succeded')} for all files.`));\n } else {\n // Some files failed validation\n console.log(chalk.bold(`Validation ${chalk.red('failed')} for the following files:`));\n data\n .filter(d => !d.success)\n .forEach(d => console.log(`- ${d.file} (${d.errors} Errors, ${d.warnings} Warnings)`));\n }\n }", "title": "" }, { "docid": "c9e6455db75b8dd5560da4222e002492", "score": "0.48147517", "text": "function getData(data) {\n\t\tdata.forEach(function(d) {\n\t\t\td.album_release_year = +d.album_release_year;\n\t\t\td.danceability = +d.danceability;\n\t\t\td.tempo = +d.tempo;\n\t\t\td.energy = +d.energy;\n\t\t\td.loudness = +d.loudness;\n\t\t\td.mode = +d.mode;\n\t\t\td.speechiness = +d.speechiness;\n\t\t\td.acousticness = +d.acousticness;\n\t\t\td.instrumentalness = +d.instrumentalness;\n\t\t\td.liveness = +d.liveness;\n\t\t\td.valence = +d.valence;\n\t\t\td.duration_ms = +d.duration_ms;\n\t\t\td.duration_sec = +d.duration_ms / 1000;\n\t\t\td.duration_min = +d.duration_sec / 60;\n\t\t\td.key = +d.key;\n\t\t\treturn d;\n\t\t});\n\n\t\tdata_full = data;\n\t\t// the following groups by album name and spits out average danceability, tempo, etc.\n\t\t// it allows for better ordering on the y axis\n\t\t// https://stackoverflow.com/questions/51040651/group-by-and-calculate-mean-average-of-properties-in-a-javascript-array\n\t\t// Calculate the sums and group data (while tracking count)\n\t\treduced = data.reduce(function(m, d) {\n\t\t\tif (!m[d.album_name]) {\n\t\t\t\tm[d.album_name] = { ...d, count: 1 };\n\t\t\t\treturn m;\n\t\t\t}\n\t\t\tm[d.album_name].danceability += d.danceability;\n\t\t\tm[d.album_name].tempo += d.tempo;\n\t\t\tm[d.album_name].energy += d.energy;\n\t\t\tm[d.album_name].loudness += d.loudness;\n\t\t\tm[d.album_name].mode += d.mode;\n\t\t\tm[d.album_name].speechiness += d.speechiness;\n\t\t\tm[d.album_name].acousticness += d.acousticness;\n\t\t\tm[d.album_name].instrumentalness += d.instrumentalness;\n\t\t\tm[d.album_name].liveness += d.liveness;\n\t\t\tm[d.album_name].valence += d.valence;\n\t\t\tm[d.album_name].key += d.key;\n\t\t\tm[d.album_name].duration_min += d.duration_min;\n\t\t\tm[d.album_name].count += 1;\n\t\t\treturn m;\n\t\t}, {});\n\n\t\taverages_data = Object.keys(reduced).map(function(k) {\n\t\t\tconst item = reduced[k];\n\t\t\treturn {\n\t\t\t\talbum_name : item.album_name,\n\t\t\t\ttempo : item.tempo / item.count,\n\t\t\t\tdanceability : item.danceability / item.count,\n\t\t\t\tenergy : item.energy / item.count,\n\t\t\t\tloudness : item.loudness / item.count,\n\t\t\t\tmode : item.mode / item.count,\n\t\t\t\tspeechiness : item.speechiness / item.count,\n\t\t\t\tacousticness : item.acousticness / item.count,\n\t\t\t\tinstrumentalness : item.instrumentalness / item.count,\n\t\t\t\tliveness : item.liveness / item.count,\n\t\t\t\tvalence : item.valence / item.count,\n\t\t\t\tkey : item.key / item.count,\n\t\t\t\tduration_min : item.duration_min / item.count\n\t\t\t};\n\t\t});\n\t}", "title": "" }, { "docid": "4f581fb84bad3d06499f96da01f9d4ae", "score": "0.48129186", "text": "function loadData() {\r\n // load the demographics.csv file\r\n d3.csv(\"./data/mapData.csv\", function (d) {\r\n // assign it to the data variable, and call the visualize function by first filtering the data\r\n all_data = d;\r\n all_data.forEach(function (item) {\r\n //console.log(item);\r\n });\r\n var params = getDataVals();\r\n var dataItem = findDataItem(params);\r\n //console.log(country_dict);\r\n visualizeAfricaChart(dataItem);\r\n });\r\n // call the visualization function by first findingDataItem\r\n}", "title": "" }, { "docid": "57d79f5c75b2acc395e766232c3e61fa", "score": "0.48113105", "text": "function loadFiles () {\n\t\tvar language;\n\t\tfor (i=0; i <= languages.length; i++) {\n\t\t\t\n\t\t\tif (i == languages.length) {\n\t\t\t\t//singal initDataCompleted\n\t\t\t\tconsole.log('initDataCompleted!');\n\t\t\t\tinitDataCompleted = true;\n\t\t\t\tconsole.log('data[language]', data.en);\n\t\t\t\tconsole.log('data[language][name]', data.en['Traits-Summary']);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tlanguage = languages[i];\n\t\t\t\n\t\t\t//addition: also load the traits-summary/info which is not specific to perspective (perspective independent) \n\t\t\tInitFileProvider.initData(language, 'Traits-Summary', 'info/suggestion/' +language + '/Traits-Summary.json');\t\t\t\n\t\t\t\n\t\t\tvar perspective;\n\t\t\t\n\t\t\tfor (j=0; j< perspectives.length; j++) {\n\t\t\t\tperspective = perspectives[j];\n\t\t\t\tInitFileProvider.initData(language, perspective, 'info/suggestion/'+language+'/' + perspective + '/traits.json');\n\t\t\t\t//console.log('info/suggestion/'+language+'/' + perspective + '/traits.json');\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "cb2d174f8c7f209a55862dc7e532b275", "score": "0.48076245", "text": "function readUserDataFromFile() {\n\t//read file \"filename\" using fs\n\tfs.readFile('./'+ filename, 'utf8', function (err,data) {\n\t\t//if there is an error, print it\n\t\tif (err) {\n\t\t\treturn console.log(err);\n\t\t}\n\t\t//put file contents into array\n\t\tuserDetailsArray = JSON.parse(data);\n\t\t//display file load success msg\n\t\tconsole.log(\"Data loaded successfully from: \" + filename);\n\t\t//display server listening msg\n\t\tconsole.log(`FindAChemist Server listening on: ${serverAddress}`);\n\t});\t\n}", "title": "" } ]
8f5b758f0f5f342215afd86caa505c1d
function to access exhibit home page
[ { "docid": "64012f9033075f61b363c3835128767b", "score": "0.58429927", "text": "function displayEx() {\n let pageNo = \"1439\";\n let token = window.localStorage.getItem(\"token\");\n $.ajax({\n url: \"/api/page?pageid=\" + pageNo,\n type: \"GET\",\n headers: { \"X-Auth\": token },\n statusCode: {\n 401: (resObj, textStatus, jqXHR) => {\n alert(\"Not authorized to access page\");\n },\n 404: (resObj, textStatus, jqXHR) => {\n alert(\"Page not found\");\n }\n }\n })\n .fail((jqXHR) => {\n if ((jqXHR.status != 401) || jqXHR.status != 404) {\n alert(\"Server error\");\n }\n })\n .done((data) => {\n data = data.trim();\n $(\"#main\").html(data);\n loadExhibits();\n return false;\n });\n }", "title": "" } ]
[ { "docid": "a1dd27b9e032e0d4f80f5bbbb2688541", "score": "0.7316765", "text": "function home() {\n navigate(settings['home-url']);\n }", "title": "" }, { "docid": "a6f80e92ebb857199e20dcfde1ac1775", "score": "0.70445794", "text": "function goHome() {\n var url = window.location.href;\n var urlPrefix = url.substring(0, url.lastIndexOf('archibus/') + 9);\n if (expressTabHtmlFragment) {\n loadQuasiFrameAndDisplay(\"#expressHomeFrame\", expressTabHtmlFragment, urlPrefix);\n }\n restoreTab(0);\n}", "title": "" }, { "docid": "c6696ec7ad0aeb20cd1b7b8a27c4707c", "score": "0.6755378", "text": "function home() {\n\n $state.go('home');\n }", "title": "" }, { "docid": "42e3547f971635777e7f70bcf308d980", "score": "0.6753749", "text": "function goHome() {\n if (signOutOnTimeOut()) { return; }\n\n var url = window.location.href;\n restoreTab(0);\n if (PageNavUserInfo.homeTabHtmlFragment) {\n loadQuasiFrameAndDisplay(\"#homeTabView\", PageNavUserInfo.homeTabHtmlFragment, url.substring(0, url.lastIndexOf(PageNavUserInfo.webAppContextPath) +\n PageNavUserInfo.webAppContextPath.length));\n }\n refreshFavorites();\n}", "title": "" }, { "docid": "b825bd23d2c859c26c4392a25b761478", "score": "0.6637194", "text": "function setAndLoadHomePage() {\n dynamicViewCache['vis_lhome'] = $home;\n currentActiveView = $home.show();\n VIS.HomeMgr.initHome($home);\n }", "title": "" }, { "docid": "559a5aa8610d05b63eec971c9ef63850", "score": "0.6636827", "text": "function home() {\n location.href=\"/home\";\n}", "title": "" }, { "docid": "cf3e819b90769f4a30a96f10be2cd57c", "score": "0.65872663", "text": "function getHomePage(req, res){\n\tres.render('home', { pageTitle: 'Monster Workshop' });\n}", "title": "" }, { "docid": "61f5ea702de135ce855e05ef07b3920f", "score": "0.6551108", "text": "async function home() {\r\n\r\n await showMessage(Date, true, agent.query);\r\n let request = {\r\n method: 'PUT',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'x-access-token': token\r\n },\r\n body: JSON.stringify({\r\n back: false,\r\n dialogFlowUpdate: true,\r\n page: \"/\" + username\r\n })\r\n }\r\n\r\n const serverReturn = await fetch(ENDPOINT_URL + '/application', request)\r\n const serverResponse = await serverReturn.json()\r\n\r\n let success = \"Redirecting to homepage\";\r\n let error = \"Sorry there was an error please re-enter a category\"\r\n console.log(serverResponse.message)\r\n if (serverResponse.message === \"Application state modified!\") {\r\n agent.add(success);\r\n await showMessage(Date(), false, success);\r\n }\r\n else {\r\n agent.add(error)\r\n await showMessage(Date(), false, error)\r\n }\r\n }", "title": "" }, { "docid": "74637b4779524c8b377f6fb148991d2f", "score": "0.6530925", "text": "function isHome() {\n return \"home\" == gadgets.views.getCurrentView().name_;\n}", "title": "" }, { "docid": "544a527df06ddf86dfbae018b722affd", "score": "0.6487658", "text": "function display_index_page() {\n}", "title": "" }, { "docid": "9efad10e67a5965562e9e99d7dc5b6b2", "score": "0.6483944", "text": "function goHome() {\n if(Authentication.user) {\n $state.go('search');\n }\n else {\n $state.go('home');\n }\n }", "title": "" }, { "docid": "04bd25a0a4e917e5e5710fd3c3c8519c", "score": "0.6459957", "text": "function handleHomeClick() {\n document.getElementById(\"drive\").style.display = 'none';\n document.getElementById(\"home\").style.display = 'block';\n AnalyticsManager.clickedHome();\n displayCurrentHomePath(homeManager);\n}", "title": "" }, { "docid": "92e81d5b14777fedbdf3921f071a05a6", "score": "0.64536726", "text": "function backToHomepage() {\n reveal('homePage');\n hide('aboutTheGame');\n hide('gameBody');\n}", "title": "" }, { "docid": "8846b51bdc87d75365433656d83991fc", "score": "0.6444147", "text": "function displayHome(ctx) {\n if (!auth.isAuth()) {\n ctx.loadPartials({\n\n footer: './templates/common/footer.hbs',\n loginForm: './templates/forms/loginForm.hbs',\n registerForm: './templates/forms/registerForm.hbs'\n }).then(function () {\n this.partial('./templates/welcomeView.hbs');\n })\n } else {\n ctx.redirect('#/catalog');\n }\n }", "title": "" }, { "docid": "7d634b8464d12d2c1625524c3a8be920", "score": "0.6436542", "text": "function showHomeView() {\n showView(\"viewHome\");\n }", "title": "" }, { "docid": "080240ebcbb59016a3758780b3a07310", "score": "0.63979536", "text": "function homePage()\n{\n\twindow.open(\"homepage.html\", \"_self\");\n}", "title": "" }, { "docid": "429e98840e2274dcaa0ced4878d3ee46", "score": "0.63512206", "text": "function goHome() {\n messenger.send(\"goHome\", \"request to go home\");\n}", "title": "" }, { "docid": "8adb5b979eabdfe2ceea927ca8f7b993", "score": "0.63503915", "text": "function homeHandler(req, res)\n{res.status(200).send('Home route LOL');\n}", "title": "" }, { "docid": "2710735591b566634b1b84101020c22d", "score": "0.6338171", "text": "function gotoHome() {\r\n\tnavigateTo(\"home\");\r\n}", "title": "" }, { "docid": "9233697f19aaced45fba10255274a698", "score": "0.6337272", "text": "function display_home(url, request, response){\n\tvar myHTML = '<html>';\n\tmyHTML += '<body><h1>HomePage, Welcome<h1>';\n\tmyHTML += \"<a href='/surveyPage'>Survey</a>\";\n\tmyHTML += '</body></html>';\n\n\tresponse.writeHead(200, {'Content-Type': 'text/html'});\n\tresponse.end(myHTML);\n}", "title": "" }, { "docid": "e73bb902e70e6c06eca60cde7512e245", "score": "0.6333807", "text": "goToHomePage(destination) {\n\n if(destination === 'login') {\n window.location = \"https://whats-to-eat.vercel.app/loginPage\";\n\n }else if (destination === 'homepage') {\n window.location = \"https://whats-to-eat.vercel.app\";\n }\n \n }", "title": "" }, { "docid": "bfc5c9fecfeb1c7389cb4f4a8ecdca55", "score": "0.6326365", "text": "function homePage(request, response) {\n response.sendFile(path.join(__dirname, 'home.html'));\n}", "title": "" }, { "docid": "f60252bf48d60b883dab8fafe888a334", "score": "0.6315897", "text": "function Home() {}", "title": "" }, { "docid": "15aad7e72672e3948b7f34433e565440", "score": "0.62885576", "text": "function doHomepage(req, res, next) {\n\t\n\tres.writeHead(200, {'Content-Type': 'text/plain'});\n \n\tres.end('Welcome to the flights app.');\n\t\n}", "title": "" }, { "docid": "2815aae1e8c1b9e27f56358ed4ff7104", "score": "0.62860715", "text": "function onDefaultEvent () {\n\t// reset to splash - THIS MUST BE BEFORE Backbone history starts\n\tif (navigator.splashscreen) {\n\t\tnavigator.splashscreen.hide();\n\t}\n\t\n\t// lets to default home page\n\tconsole.log(\"loading default home page\");\n\n\tif (settings.isEnrolled()) {\n \t//app.homeScan();\n \t}\n}", "title": "" }, { "docid": "588935cface081f5bd5d263fcf326bfa", "score": "0.62835014", "text": "function goHome(){\n location.href = \"https://brocow.github.io/WDD330_FrontEnd-II/\";\n}", "title": "" }, { "docid": "32f3be6457439f621b591e9971daf74f", "score": "0.628305", "text": "function toNonLoginHome(){\n document.forms.nonloginmyaccountform.action = \"index.html\";\n }", "title": "" }, { "docid": "00f53ffdec119f659f2509cc995173c7", "score": "0.62743425", "text": "function homePage() {\r\n\r\n var homePage = _(\"homePage\");\r\n if (homePage) {\r\n homePage.addEventListener(\"click\", function () {\r\n\r\n var url = \"index.html\";\r\n window.location.href = url;\r\n\r\n });\r\n }\r\n\r\n}", "title": "" }, { "docid": "bebefe9c82abf36d0a97af0cce6ff7e0", "score": "0.6256023", "text": "function home() {\n window.location = \"index.html\";\n}", "title": "" }, { "docid": "ed512b6b8226248b43197f2598e653df", "score": "0.62424684", "text": "function getHome(req, res) {\n res.render('pages/index');\n}", "title": "" }, { "docid": "87c4eedee3ca9b1435ede5c152834aff", "score": "0.62357247", "text": "function getHome(req,res){\n res.statusCode = 200;\n res.render('home');\n}", "title": "" }, { "docid": "bc7fdd97971a67f42074ca6310fff3ce", "score": "0.62315613", "text": "function onHomeClick(e) {\n\ttry {\n\t\tAlloy.Globals.NAVIGATION_CONTROLLER.openWindow('healthDataScreen');\n\n\t} catch(ex) {\n\t\tcommonFunctions.handleException(\"home\", \"homeClick\", ex);\n\t}\n}", "title": "" }, { "docid": "fac5645e28f76ce0d99dad1f7937570b", "score": "0.6226615", "text": "onEnterPublicPage() {\n if (Meteor.userId()) {\n this.props.history.replace('/home');\n }\n }", "title": "" }, { "docid": "f64e7e12dbda46f3246b30d560bc8583", "score": "0.62099594", "text": "function goToHomePage() {\r\n location.href = \"index.html\";\r\n}", "title": "" }, { "docid": "7841c5addf797d63ad49292ffeb41f0f", "score": "0.620809", "text": "function Home(pn_is_sub) {\n /*document.write\n (\"<a HREF=\\'\"+getpath(pn_is_sub)+\"index.html\\'> <img src=\\\"\"+getpath(pn_is_sub)+\n\t\t\t\"pictures/Firmowka2.png\\\" width=\\\"258\\\" height=\\\"67\\\" alt=\\\"Index\\\" /></a>\");\n*/\n}", "title": "" }, { "docid": "ce01881d73c420fa058ca0b53c572911", "score": "0.6181743", "text": "function show() {\n var accountHomeAsset, pageMeta, Content;\n session.custom.lastUrlBeforeLogin = session.clickStream.last.referer;\n\n\tif(request.httpSecure){\n\t\tapp.getController('Account').UserAccountShow();\n\t} else {\n\t\tvar httpsUrl = require('app_rapala_core/cartridge/scripts/account/RedirectingToHttps.ds').getHttpsUrl(request);\n\t\tif(!empty(httpsUrl) && httpsUrl != null){\n\t\t\tresponse.redirect(httpsUrl);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9ac73b79ec8701e47f1e162f94a9d85c", "score": "0.6173249", "text": "function homePage() {\n if (document.getElementById(\"main\").className == \"unhidden\") {\n changeVisibility(\"main\");\n }\n if (document.getElementById(\"home\").className == \"hidden\") {\n changeVisibility(\"home\");\n }\n if (document.getElementById(\"index\").className == \"unhidden\") {\n changeVisibility(\"index\");\n showIndex = false;\n genreIndex = false;\n }\n if (document.getElementById(\"previous\").className == \"unhidden\") {\n changeVisibility(\"previous\");\n }\n showPages = 0;\n fetchRandShows();\n fetchSchedule();\n}", "title": "" }, { "docid": "49ab90ab2b9a65ab6ee2fd7c2450f0c4", "score": "0.61486506", "text": "clickHome() {\n cy.get(HOME_LINK_CSS)\n .click();\n\n return homePage();\n }", "title": "" }, { "docid": "a9471711ba3bf24dbd519b4d376b45c3", "score": "0.6148312", "text": "function HomePage()\n{\n\tvar html = '';\n\thtml += '<h1>' + TITLE + '</h1>';\n\thtml += '<p>';\n\tvar tables = [\n\t\t[\"N\", \"surnames.html\"],\n [\"I\", \"persons.html\"],\n [\"F\", \"families.html\"],\n [\"S\", \"sources.html\"],\n [\"M\", \"medias.html\"],\n [\"P\", \"places.html\"],\n [\"R\", \"repositories.html\"]\n\t];\n\tvar sep = '';\n\tfor (var i = 0; i < tables.length; i += 1)\n\t{\n\t\tvar j = $.inArray(tables[i][1], PAGES_FILE_INDEX);\n\t\tif (j == -1) continue;\n\t\thtml += sep\n\t\thtml +=\t'<a href=\"' + tables[i][1] + '?' + Dwr.BuildSearchString() + '\">';\n\t\thtml +=\tPAGES_TITLE_INDEX[j] + ': ' + DB_SIZES[tables[i][0]];\n\t\thtml +=\t'</a>';\n\t\tsep = '<br>';\n\t}\n\thtml += '<br> <p>' + Dwr.embedSearchText() + '<p>';\n\treturn html;\n}", "title": "" }, { "docid": "4bd067beac1dc7d6ac81b1a0c21d6f30", "score": "0.6147773", "text": "function setHomepage(homepage) \n{ if (document.all)\n\t{\n\t\tdocument.body.style.behavior='url(#default#homepage)'; document.body.setHomePage(homepage); \n\t}\n\telse if (window.sidebar)\n\t{ \n\t\tif(window.netscape) \n\t\t{ \n\t\t\ttry \n\t\t\t{ \n\t\t\t\tnetscape.security.PrivilegeManager.enablePrivilege(\"UniversalXPConnect\"); \n\t\t\t}\n\t\t\tcatch(e) \n\t\t\t{\n\t\t\t\talert(\"this action was aviod by your browser,if you want to enable,please enter about:config in your address line,and change the value of signed.applets.codebase_principal_support to true\"); \n\t\t\t} \n\t\t} \n\t\tvar prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch); \n\t\tprefs.setCharPref('browser.startup.homepage',homepage); \n\t}\n}", "title": "" }, { "docid": "5e14cbd0dc176a4721157119556ce24a", "score": "0.61452717", "text": "function displayHome() {\n let pageNo = \"4962\";\n let token = window.localStorage.getItem(\"token\");\n $.ajax({\n url: \"/api/page?pageid=\" + pageNo,\n type: \"GET\",\n headers: { \"X-Auth\": token },\n statusCode: {\n 401: (resObj, textStatus, jqXHR) => {\n alert(\"Not authorized to access page\");\n },\n 404: (resObj, textStatus, jqXHR) => {\n alert(\"Page not found\");\n }\n }\n })\n .fail((jqXHR) => {\n if ((jqXHR.status != 401) || jqXHR.status != 404) {\n alert(\"Server error\");\n }\n })\n .done((data) => {\n data = data.trim();\n $(\"#main\").html(data);\n loadImages();\n return false;\n });\n }", "title": "" }, { "docid": "5e14cbd0dc176a4721157119556ce24a", "score": "0.61452717", "text": "function displayHome() {\n let pageNo = \"4962\";\n let token = window.localStorage.getItem(\"token\");\n $.ajax({\n url: \"/api/page?pageid=\" + pageNo,\n type: \"GET\",\n headers: { \"X-Auth\": token },\n statusCode: {\n 401: (resObj, textStatus, jqXHR) => {\n alert(\"Not authorized to access page\");\n },\n 404: (resObj, textStatus, jqXHR) => {\n alert(\"Page not found\");\n }\n }\n })\n .fail((jqXHR) => {\n if ((jqXHR.status != 401) || jqXHR.status != 404) {\n alert(\"Server error\");\n }\n })\n .done((data) => {\n data = data.trim();\n $(\"#main\").html(data);\n loadImages();\n return false;\n });\n }", "title": "" }, { "docid": "91b6b3eedf728a92f65e0aed232de0ad", "score": "0.6143703", "text": "function showHomePanel(){\r\n\t\t$('#homePanel').fadeIn(300);\r\n\t\t$('#invoicePanel').hide();\r\n\t\t$('#paymentPanel').hide();\r\n\t\t$('#customerPanel').hide();\r\n\t\t\r\n\t\tvar part = window.location.pathname.substring(0,3);\r\n\t\twindow.history.pushState({},'', part + '/home');\t\t\t\t\t\t//put it in url so we can f5\r\n\t\t\r\n\t\tsetTimeout(function(){\r\n\t\t\tws.send(JSON.stringify({type: 'get', v: 1}));\t\t\t\t\t\t//need to wait a bit\r\n\t\t\tws.send(JSON.stringify({type: 'chainstats', v: 1}));\r\n\t\t}, 1000);\r\n\t}", "title": "" }, { "docid": "74fe879813f4f920e95e0459864dc630", "score": "0.61374533", "text": "function home(req, res) {\n res.redirect('/index.html')\n}", "title": "" }, { "docid": "14c23a89829b6120db6400366abb90a2", "score": "0.6135387", "text": "function homePage() {\n window.open('index.html', '_self');\n}", "title": "" }, { "docid": "550dd1a45cb071c772de507207866685", "score": "0.61313564", "text": "function homePage() {\n\twindow.location.href = '/main?param1='+sessionStorage.getItem(\"token\");\n}", "title": "" }, { "docid": "4209acd238bb2637a8f26e22d11812b4", "score": "0.61260295", "text": "function redirectHome(e) {\n\twindow.location.href = \"/\"; \n}", "title": "" }, { "docid": "922c363453ca5f4cad014dfe1824956a", "score": "0.61107516", "text": "function returnToHome() {\n location.href = \"../HTML/home.html\";\n}", "title": "" }, { "docid": "e213fc9c89794a89387a0840a1b3e802", "score": "0.6109435", "text": "function isHome() {\n var siteRootWithoutSlash = siteRoot.slice(-1) === \"/\" ? siteRoot.slice(0, -1) : siteRoot;\n\n // This is the check for the fourth exception (with url arguments)\n if (requestPath.replace(/\\.html\\?(.*)/, '') === siteRootWithoutSlash) {\n return true;\n }\n\n // And for the other three checks:\n return (requestPath === \"\") ||\n (requestPath === siteRootWithoutSlash) ||\n (requestPath === siteRootWithoutSlash + '.html');\n }", "title": "" }, { "docid": "147b47c0ca4a72edcf854f8ec20a005b", "score": "0.6106799", "text": "function home() {\n window.location.href = \"../index.html\";\n}", "title": "" }, { "docid": "38152ddb277fc71d28a56bf1423a2756", "score": "0.6099173", "text": "function GoHome() {\n window.location = \"https://darkstarteam.github.io/destinyflavortext/\"\n }", "title": "" }, { "docid": "c013c7ecd30ccafae0b8f8e075dc1b51", "score": "0.60937625", "text": "async function navHome() {\r\n console.log(\"Home\");\r\n console.log(username);\r\n console.log(token);\r\n agent.add('Navigating to the home page');\r\n await postUserMessages(agent.query);\r\n await postBotMessages(\"Navigating to the home page\");\r\n let body = JSON.stringify({ page: \"/\" + username, dialogflowUpdated: true, back: false });\r\n let request = {\r\n method: 'PUT',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'x-access-token': token\r\n },\r\n body: body,\r\n redirect: 'follow'\r\n }\r\n await fetch('https://mysqlcs639.cs.wisc.edu/application', request);\r\n\r\n }", "title": "" }, { "docid": "524ec916654d774bdd714fbe8b79f442", "score": "0.60757715", "text": "function clickHome(){\r\n window.location.href = \"/\";\r\n}", "title": "" }, { "docid": "8e8d7ecaa653584fc416018359d2e86d", "score": "0.60734415", "text": "function getHomePage (req, res) {\n db.getAllPosts()\n .then(function (posts) {\n var data = {\n title: \"Anna Ulyanova | EDA Blog | Main\",\n posts: posts\n }\n res.render(\"home\", data)\n })\n .catch(function (err) {\n res.status(500).send('Error' + err.message)\n })\n}", "title": "" }, { "docid": "6ce7b0919867c221ff519e9da53fe0e6", "score": "0.60688114", "text": "get isHomeRoute() {\n return true;\n }", "title": "" }, { "docid": "6ce7b0919867c221ff519e9da53fe0e6", "score": "0.60688114", "text": "get isHomeRoute() {\n return true;\n }", "title": "" }, { "docid": "c633c9d0eff4d881be72fc28bec75615", "score": "0.6066253", "text": "function explore() {\n location.href='/explore';\n\n}", "title": "" }, { "docid": "b6a2e99ceff4939acd4a3eeb894473cb", "score": "0.60571486", "text": "function home() {\n var re = /^https?:\\/\\/[^/]+/i;\n window.location.href = re.exec(window.location.href)[0];\n}", "title": "" }, { "docid": "aa9ae97f013ce8b4483fe72c63abebdb", "score": "0.6053132", "text": "function homescreen(){\n\t\tvar registereduser=JSON.parse(localStorage.getItem(\"user\"));\n\t\tif(registereduser!=null){\n\t\t\tregView(registereduser);\n\t\t}else{\n\t\t\t//pass uuid to server in order to query SQL database\n\t\t\tgetRequest(apiGetUser,dataGetUser, regView);\n\t\t};\n\t}", "title": "" }, { "docid": "f27a89e02c205cc03a9ec8cbfe0819d7", "score": "0.6045813", "text": "function loadHomePage() {\n resetLockedRecord('root');\n el(\"productlogo\").focus();\n initInterface(\"Dashboard\");\n}", "title": "" }, { "docid": "49e2388ab7a76ced5ff70f66a035ec50", "score": "0.60423464", "text": "function home(){\n window.open('/Clima/inicioT.html', '_self');\n}", "title": "" }, { "docid": "5c361a259761f28374b58512a58caf3c", "score": "0.6032341", "text": "function invokeHomePage() {\n /* homeAppMenuClose();\n catid=\"cat00000\";\n count=0;\n getsegmentdata();\n BreadCrumbText=[];\n HomeCategories.Breadcrumlabel.text=kony.i18n.getLocalizedString(\"Home\");\n HomeCategories.Backbuttonflex.isVisible=false; */\n}", "title": "" }, { "docid": "6ff84156a5432ce7e97db65bfa37ae8c", "score": "0.6024033", "text": "function GGGadget_hostedAtHome ()\r\n{\r\n\treturn (GGGadget_hostedOn (gGGGadget_HomeRoot));\r\n}", "title": "" }, { "docid": "0ca7aba39e9f3677573f46589a93e2dd", "score": "0.60098577", "text": "function HomePageSettings() {}", "title": "" }, { "docid": "ada8bb0e75e46b719dd2c4f3db9b34b3", "score": "0.60014296", "text": "function tohome(loc) {\n var url=\"index.html\";\n if (loc == \"non-payment\") // if the logo button is clicked in non payment pages , it will directly direct to homepage\n {\n window.location.href=url;\n }\n else // if logo button is clicked in payment page then user has to confirm to leave the page\n {\n if(window.confirm(\"Are you sure you want to leave?\"))\n {\n window.location.href=url;\n }\n else\n {\n die();\n }\n\n\n }\n\n}", "title": "" }, { "docid": "aa30f9befd90ef0dd3ee1f47108aff36", "score": "0.5997059", "text": "function goToHomePage() {\n window.location.href = \"/\";\n}", "title": "" }, { "docid": "f68a1fb8bf2518a9a474d51947c80bad", "score": "0.5986654", "text": "function landing_page(){\n window.location.replace('./prototype.html');\n}", "title": "" }, { "docid": "ac13d0dd7d13b5598ed31cf00ac5ffd7", "score": "0.59820473", "text": "function toLlHome(){\n document.forms.llupdateform.action = \"index.html\";\n }", "title": "" }, { "docid": "c9963835743a7763e6532dcc567199a0", "score": "0.59805685", "text": "function goHome(req, res){\n res.redirect('/');\n res.end();\n}", "title": "" }, { "docid": "f04752b35b46c3bfa9a2b0e10be4d0bc", "score": "0.59746635", "text": "function goToHomePage () {\n window.location.href = \"index.html\"\n}", "title": "" }, { "docid": "4db566c701c33cafa378af8b85a4b9f0", "score": "0.59733254", "text": "function view_index_page() {\n location.href = \"index.html\";\n}", "title": "" }, { "docid": "b6f1cd7432cde62998126706ae112f98", "score": "0.5952866", "text": "function backHome() {\r\n\t//Takes the user back to home page\r\n\twindow.location.replace(\"HomePage.html\");\r\n}", "title": "" }, { "docid": "80ec534d6a0c493d160c8997d8c1c11e", "score": "0.5952102", "text": "get homeLink() {\n // if we are on the homepage then load the first item in the manifest and set it active\n if (this.manifest) {\n const firstItem = this.manifest.items.find(\n (i) => typeof i.id !== \"undefined\"\n );\n if (firstItem) {\n return firstItem.slug;\n }\n }\n return \"/\";\n }", "title": "" }, { "docid": "f48ae4f78ab2df37c70099d433073657", "score": "0.5945578", "text": "function init_home_page () {\n\t//\n\tinit_game();\n}", "title": "" }, { "docid": "e9a3f2165a3a02c616ce8bf9697ed2c8", "score": "0.5939278", "text": "function home(req,res){\n //Renderizamos el archivo index.edge\n return res.render('index');\n}", "title": "" }, { "docid": "133209cc98481b990830675bb5fa6e1d", "score": "0.59337276", "text": "navigateToHomePage() {\n this[NavigationMixin.Navigate]({\n type: 'standard__namedPage',\n attributes: {\n pageName: 'home'\n },\n });\n }", "title": "" }, { "docid": "0262a2ec32e481c82a0d9e6d36b7e554", "score": "0.5931587", "text": "function atHome() {return path().length === 0}", "title": "" }, { "docid": "51923d3478c66696e9a412767641e5b4", "score": "0.59206456", "text": "function redirectToHome(res) {\n\tres.redirect(HOME_PATH);\n}", "title": "" }, { "docid": "6cafa2c813056088f127cc5dc26a7d63", "score": "0.5907126", "text": "function goHome(){\n window.location.href = \"/\";\n}", "title": "" }, { "docid": "8de05be0823f8dfa955f519a7b82539c", "score": "0.5903704", "text": "function display_home(){\n //if this is being called from the library on the 'tours' page\n $.get('/folders',{user_id: user_id},function(){})\n}", "title": "" }, { "docid": "8e8137940a83635c574d85e01d04ec03", "score": "0.5896927", "text": "function redirectHome()\n{\n\tvar url = '/app/center/card.nl?sc=';\n\tdocument.location.href = url;\n}", "title": "" }, { "docid": "38957092cfafe386eabf7bc4f1aa624b", "score": "0.58907956", "text": "function doGet(e){\n Route.path(\"profile\", profile_page);\n Route.path(\"covid19_dashboard\", covid19_page);\n Route.path(\"login\", login_page);\n Route.path(\"signup\", signup_page);\n Route.path(\"answer\", answer_page);\n \n if(Route[e.parameters.v]){\n return Route[e.parameters.v]();\n }else{\n return home_page();\n }\n}", "title": "" }, { "docid": "fcc951904696e92f3f525bb5c21783f8", "score": "0.58897686", "text": "function goHome() {\n location.reload();\n }", "title": "" }, { "docid": "0ea8c75f238f497c2cf280ec14f95677", "score": "0.5887517", "text": "function renderHomePage(req, res) {\n return res.render('mentor/index');\n // return routerHelper.render(req, res, 'mentor/index');\n}", "title": "" }, { "docid": "189a38b5ad688d684768c66740bc26b9", "score": "0.5884999", "text": "init(app){\n const parent_dir = 'pages/home/';\n app.get('/', function(req, res){\n res.render(parent_dir + 'homeLandingPage', {\n 'title': 'SnapSell Home page',\n });\n });\n }", "title": "" }, { "docid": "80f9331a863d085090e1839a6db2b9b0", "score": "0.588236", "text": "function landingpage(){\n toggleAddOnScroll()\n const hashVal = window.location.hash.slice(1)\n\n if(window.location.hash === \"\"){\n console.log(\"%c Overview landingpage\", `${consoleStyling}`)\n overviewLocalStorageCheck()\n }else if(isNumeric(hashVal)){\n console.log(\"%c Detail landingpage\", `${consoleStyling}`)\n detailLocalStorageCheck()\n }else{\n console.log(\"%c Load to overviewpage\", `${consoleStyling}`)\n window.location.hash = \"\"\n }\n}", "title": "" }, { "docid": "183983e2646b0c5ca6f4c95bf4ea79c3", "score": "0.58792216", "text": "function openHome() // Home-Reiter öffnen\n{\t\n\tdeleteContent();\n\tsetTitle('Kontrollzentrum');\n\t\n\tvar icon1 = jQuery('<img/>', {\n\t src: 'images/icons/document.png'\n\t});\n\tvar link1 = jQuery('<a/>', {\n\t href: '#contents',\n\t class: 'icon'\n\t}).append(icon1).appendTo('#content');\n\t\n\t\n\tvar icon2 = jQuery('<img/>', {\n\t src: 'images/icons/user.png'\n\t});\n\tvar link2 = jQuery('<a/>', {\n\t href: '#user',\n\t class: 'icon'\n\t}).append(icon2).appendTo('#content');\n}", "title": "" }, { "docid": "69290cdbbe6668897f6379354db29fa1", "score": "0.58545965", "text": "function clickHome(){\n //hide home page\n document.getElementById(\"mainContent\").setAttribute(\"class\", \"\");\n document.getElementById(\"item\").setAttribute(\"class\", \"hide\");\n let title = document.getElementById(\"title\");\n title.innerHTML = \"ACME site\";\n console.log(\"Home page displayed\");\n}", "title": "" }, { "docid": "e8b363f25d922dd6208cf797691a0cad", "score": "0.5847838", "text": "function home(req, res) {\r\n res.status(200).send({\r\n message: 'Hola mon, pagina inicial arrel.'\r\n });\r\n}", "title": "" }, { "docid": "5307f723a48b12146460b25bbb663be4", "score": "0.58385456", "text": "function toViewAllPPWOLHome(){\n document.forms.viewallppwithoutloginform.action = \"index.html\";\n}", "title": "" }, { "docid": "37eba06d7ad6e18ff06fb70ed9f1a7b8", "score": "0.5824961", "text": "function goToHome() {\n\t \tsetTimeout(function() {\n\t\t \tthat.hashChange();\t \t\n\t\t \twindow.location = '#/';\n\t \t}, 450);\n \t}", "title": "" }, { "docid": "fb0d4a1dfa323c0fd23415b17a22a368", "score": "0.58207726", "text": "function goHome() {\n (window.location.replace(\"/\"));\n}", "title": "" }, { "docid": "2441882709bcbdd29f8b430d8c8017bb", "score": "0.58198255", "text": "function homeClicked() {\nrefreshToolbar();\n\t//\t\n\t// $('#downloadTemplateImg').show();\n\t// $('#quickUploadImg').show();\n\t// $('#uploadDocumentImg').show();\n\t//\t\n\t// $('#leftlinks').show();\n\t// $('#myIntrays').show();\n\t// $(\"#dynContentMetadata\").hide();\n\t// $(\"#dynContent\").show();\n\t// loadAllDocuments();\n}", "title": "" }, { "docid": "510a2b18fc01845cd93a14af8ef04772", "score": "0.58169496", "text": "function homeContent() {\n\t$('#main-nav li').removeClass('current');\n\t$('#home-btn').parent().addClass('current');\n\tperformGetRequest(serviceRootUrl + 'page' + pageNO() + videoLibraryCount(), onVideoLibrariesPerPageLoadSuccess, videoLibrariesErrorMessage);\n}", "title": "" }, { "docid": "d74b25109d80462b427a2b6b028c4f86", "score": "0.5813326", "text": "function getHome(req, res) {\n queryUserLibrary().then(result => {\n res.render('pages/index.ejs', {results : result.rows});\n })\n}", "title": "" }, { "docid": "b0e5c2a9b19096bdae0b60acfc7b71cc", "score": "0.5808942", "text": "function renderHome(req,res,locals){\n res.render('home', extend({\n title: 'Welcome',\n csrfToken: req.csrfToken(),\n projectName: '', \n projectlisting: req.user.customData.projects,\n nameofUser: req.user.username,\n },locals||{}));\n\n}", "title": "" }, { "docid": "1bc572d235520af3872ae59124d38008", "score": "0.58088833", "text": "function routeHome() {\n window.location.href = 'index.html'; \n}", "title": "" }, { "docid": "1eb594413f6c97886212b035b10218fe", "score": "0.5800321", "text": "function goHome() {\n let participant = JSON.parse(localStorage.getItem(\"participant\"));\n if (participant !== null) {\n window.location.href = \"../participant/participant.html?id=\" + participant.id;\n } else {\n let admin = JSON.parse(localStorage.getItem(\"admin\"));\n if (admin !== null) {\n window.location.href = \"../admin/admin.html?id=\" + admin.id;\n } else {\n alert(\"Not logged in as participant or admin.\");\n }\n }\n}", "title": "" }, { "docid": "148d1975994f1e11cb60af5bb308f18b", "score": "0.5796204", "text": "function homeController(){\n return{\n index(req,res){\n Menu.find().then(function(pizzas){\n\n res.render(\"home\" , {pizzass:pizzas}) // pizzass reflectded in frontend page\n })\n\n }\n }\n}", "title": "" }, { "docid": "4ad11e3c6b4601a4f0a180e8818683e4", "score": "0.579443", "text": "function checkUrl(){\n var index = location.href.indexOf(\"#\");\n if (index === -1) return; //default to profile\n var targ = location.href.substr(index,15);\n if (targ===\"#\")\n showUserHome();\n else if (targ===\"#profile\")\n showProfile();\n else if(targ===\"#settings\")\n showSettings();\n else if(targ===\"#myconsign\")\n showConsigned();\n else if(targ===\"#myrequest\")\n showRequested();\n else if(targ===\"#help_consign\")\n showHelp('selling');\n else if(targ===\"#help_buying\")\n showHelp('buying'); \n}", "title": "" } ]
72e719976d1b520d34ea4b82e1ddbabe
Checks if there is a error parameter in the url and returns error and error description
[ { "docid": "057d20766e12186bccb4c53eb82df8bf", "score": "0.71687466", "text": "parseUrlAuthErrors() {\n const error = GenericHelpers.getUrlParameter('error');\n const errorDescription = GenericHelpers.getUrlParameter('errorDescription');\n if (error) {\n return { error, errorDescription };\n }\n return;\n }", "title": "" } ]
[ { "docid": "9f8d71d814ea747e4b291305ba97da66", "score": "0.7367831", "text": "function getError() {\n const error = getUrlParamValue(\"error\");\n let result; \n\n if (error) {\n const description = getUrlParamValue(\"error_description\");\n\n result = {\n title: error,\n description: description\n }; \n }\n\n return result;\n}", "title": "" }, { "docid": "ad73e211327e5f1cb85fa745c03e29d4", "score": "0.7049033", "text": "error() {\n const isAbsolute = this.options.fail.indexOf('://') > -1;\n const url = isAbsolute ? this.options.fail : this.options.url + this.options.fail;\n\n this.request(url);\n }", "title": "" }, { "docid": "c1a742640f5542f3955cab28ef23d6e5", "score": "0.6898971", "text": "function getErrorMessage(request, url) {\n\n var errorMessage = \"HTTP Request Failed. URL: \" + url;\n if (request.responseText && request.responseText.indexOf(\"{\") == 0) {\n try {\n var responseJson = JSON.parse(request.responseText);\n if (responseJson) {\n if (responseJson.status) {\n errorMessage = \"HTTP Request failed with status \" + responseJson.status;\n }\n if (responseJson.errors && responseJson.errors.length > 0) {\n errorMessage = errorMessage + \" : \" + responseJson.errors[0].description;\n }\n }\n } catch (e) {\n // ignore\n }\n }\n return errorMessage;\n}", "title": "" }, { "docid": "64301b633e4b131f0bbfb73219d9c9e5", "score": "0.6795693", "text": "function getErrorMessage(status, url){\n if(status === undefined){\n return \"Error by processing of file \" + url + \". False JSON format\";\n }\n return \"Error by load of file \" + url + \". HTTP Status: \" + status;\n}", "title": "" }, { "docid": "3b42cf932f1f37d92647c243d367b847", "score": "0.66239214", "text": "function getErrorMessage() {\n\tvar params = {}, queryString = location.hash.substring(1), regex = /([^&=]+)=([^&]*)/g, m;\n\twhile (m = regex.exec(queryString)) {\n\t\tparams[decodeURIComponent(m[1])] = decodeURIComponent(m[2]);\n\t}\n\tif (params.error_description) {\n\t\treturn params.error_description;\n\t}\n\treturn params[\"error\"];\n\n}", "title": "" }, { "docid": "f41e61cfb6a8f9d0a53e17c834687223", "score": "0.6545517", "text": "function failToGet(error) {\n\tconsole.log(error.code);\n}", "title": "" }, { "docid": "690d9f13d3986c6bc4e03650c866b1b4", "score": "0.6298297", "text": "function validateURL(cb_err) {\n if(typeof this.url !== 'undefined') {\n if(!validator.isURL(this.url)){\n cb_err();\n }\n }\n }", "title": "" }, { "docid": "b7cb2d8931116c339749921823205cf2", "score": "0.62852794", "text": "function error(err){\n console.log('Request Failed', err); //err details willl be in the err object\n}", "title": "" }, { "docid": "b2ac8a1da4c7ddc1e37f2fb5536959cd", "score": "0.62774223", "text": "function checkErr() {\n let query = window.location.search;\n if (query != \"\") {\n document.getElementById(\"errMsg\").style.display = \"block\";\n }\n else {\n document.getElementById(\"errMsg\").style.display = \"none\";\n }\n}", "title": "" }, { "docid": "96973da5d636304197bde1e39b656b6e", "score": "0.6210974", "text": "function validateURL (url) {\n\n}", "title": "" }, { "docid": "7231a6cdcacdb07d8d7d8bf82e0d1466", "score": "0.61702377", "text": "function validateURL(req, res, next) {\n const url = req.params.url;\n \n if (!isValidURL(url))\n return res.status(422).json({\n error: \"Format of provided URL is invalid. Remember to use an http:// or https:// prefix.\",\n provided_url: url\n });\n \n next();\n }", "title": "" }, { "docid": "1fc3f38020136ea8495845a86e36d5d4", "score": "0.6089823", "text": "function requestFailure(error) {\n console.log(error);\n}", "title": "" }, { "docid": "1fc3f38020136ea8495845a86e36d5d4", "score": "0.6089823", "text": "function requestFailure(error) {\n console.log(error);\n}", "title": "" }, { "docid": "0a9e11af937588b0b5fa5c8f2ae9bc7f", "score": "0.6084009", "text": "function OnRequestFail(error) {\n print(\"error=\"+JSON.stringify(error)+'\\n');\n }", "title": "" }, { "docid": "7de4db379c3b41341896bd8f80f31258", "score": "0.6075441", "text": "function onFail(error)\n{\n\tvar errorType = {\n\t\t\t\t\t\t0: \"Unknown Error\",\n\t\t\t\t\t\t1: \"Permission denied by the user\",\n\t\t\t\t\t\t2: \"Position of the user not available\",\n\t\t\t\t\t\t3: \"Request timed out\"\n\t\t\t\t\t};\n \n\tvar errMsg = errorType[error.code];\n \n\tif(error.code == 0 || error.code == 2){\n\t\terrMsg = errMsg+\" - \"+error.message;\n\t}\n \n\t$(\"p\").html(errMsg);\n}", "title": "" }, { "docid": "534c84bbfbb12628e28563e457d023e8", "score": "0.6051304", "text": "function error(err) {\n\tdocument.getElementById(\"jok\").innerHTML = err\n console.log('Request Failed', err); //error details will be in the \"err\" object\n}", "title": "" }, { "docid": "1338b616352a06ad1c21023f468d641a", "score": "0.6024066", "text": "function errorCallback(error) {\n //If 404 send login flow\n console.error(\"Server responded with Status Code: \" + error);\n}", "title": "" }, { "docid": "12cf0d770a2f262d78338b63a5596601", "score": "0.5987791", "text": "function findWebsiteByIdError(error) {\n errorMessage.message = \"Could not fetch website. Please try again later.\";\n res.status(500).json(errorMessage);\n }", "title": "" }, { "docid": "47278104568c0e036e9292f4af9698cc", "score": "0.59302753", "text": "interpretErrorResponse(error) {\n let errorMessage = \"\";\n if (error.response) {\n errorMessage = error.response.data\n ? error.response.data\n : \"Unable to handle request\";\n } else if (error.request) {\n errorMessage = \"Currently, unable to handle request!\"\n } else {\n errorMessage = \"Something went wrong!\"\n }\n\n if (typeof errorMessage === \"string\") {\n return errorMessage;\n }\n else if (Array.isArray(errorMessage)) {\n return errorMessage.join(',');\n } else {\n return \"Something went wrong!\";\n }\n }", "title": "" }, { "docid": "929c823341de47d825ef7a75a2292302", "score": "0.59245056", "text": "function showMissingParameterMessage() {\n\n\t$(\"#error_message\").empty();\n\t$(\"#error_message\").append('<div class=\"ui-state-error ui-corner-all\" style=\"padding: 0 .7em;\"><p><span class=\"ui-icon ui-icon-alert\" style=\"float: left; margin-right: .3em;\"></span><strong>Error:</strong> Missing performance parameter. Please adjust the URL and try again.</p></div>');\n\t$(\"#error_message\").show();\n}", "title": "" }, { "docid": "666112976c8a0c23f66164724016038a", "score": "0.59184515", "text": "parseError(error) {\n if (error.code === 400 && (error.details && error.details.length)) {\n return {\n code: error.code,\n msg: _.first(error.details),\n };\n }\n return error;\n }", "title": "" }, { "docid": "3e4160825273bd95660e96a2672efab2", "score": "0.5829609", "text": "function getFailed(error) {\n logError(error.message);\n}", "title": "" }, { "docid": "37ef813c9b0eccf516a04e41888a9af7", "score": "0.5824322", "text": "checkErrors(response){\n if (response.meta.code !== 200) {\n throw new Error('Invalid response:' + response.error_description);\n }\n }", "title": "" }, { "docid": "5932bea1662ed4eea04c1977c3659c3d", "score": "0.5823238", "text": "function failure(error) {\n console.log(error);\n refreshResult(false, \"Server Error\");\n }", "title": "" }, { "docid": "1d105efe97b602acd02194de92ef789d", "score": "0.5812633", "text": "function GetMalLink(result){\n}", "title": "" }, { "docid": "24482e3a50a0a7227f0b47bd2b4c7c55", "score": "0.580919", "text": "function APIError(data) {\n\n}", "title": "" }, { "docid": "21022dc8c386c050621a6840c3d6992c", "score": "0.58082724", "text": "onFail(errors){\n $('.loading-button').button('reset');\n if(window.debug_){\n console.log(errors);\n }\n this.errors.record(errors);\n if(errors.status == '404'){\n window.location.href = '/not-found';\n }\n }", "title": "" }, { "docid": "24ddbef31086e986bd7b73c37e85b633", "score": "0.5791912", "text": "function normalizeError(reason) {\n // Check if error has Uri attached.\n var uri = \"no URI reported\";\n if (reason.hasOwnProperty(\"uri\")) {\n uri = reason.uri;\n }\n var apiError = reason;\n if (apiError.code && apiError.message) {\n return apiError;\n }\n if (reason.status && reason.statusText) {\n var err = reason;\n var message = null;\n var subCode = null;\n var severity = null;\n var swyfftError = false;\n if (err.responseJSON) {\n if (err.responseJSON.hasOwnProperty('ExceptionMessage')) {\n message = err.responseJSON.ExceptionMessage;\n }\n if (err.responseJSON.hasOwnProperty('ErrorMessage')) {\n message = err.responseJSON.ErrorMessage;\n }\n if (err.responseJSON.hasOwnProperty('ErrorCode')) {\n subCode = err.responseJSON.ErrorCode;\n }\n if (err.responseJSON.hasOwnProperty('Severity')) {\n severity = err.responseJSON.Severity;\n }\n if (err.responseJSON.hasOwnProperty('SwyfftError')) {\n swyfftError = err.responseJSON.SwyfftError;\n }\n if (err.responseJSON.hasOwnProperty('ErrorCode')) {\n swyfftError = err.responseJSON.ErrorCode;\n }\n }\n if (!message) {\n if (err.responseText) {\n // At least sometimes, the responseText comes down as a JSON-encoded string, so let's try to decode it first.\n try {\n message = JSON.parse(err.responseText);\n if (typeof message !== \"object\") {\n message = err.responseText;\n }\n }\n catch (unused) {\n message = err.responseText;\n }\n }\n }\n if (!severity) {\n try {\n severity = JSON.parse(err.responseText).severity;\n if (typeof severity === \"undefined\") {\n severity = \"ERROR\";\n }\n }\n catch (unused) {\n severity = \"ERROR\"; // default to error\n }\n }\n if (message) {\n if (message.Message) {\n message = message.Message + \"\\r\\n\";\n }\n if (message.MessageDetail) {\n message += \"\" + message.MessageDetail;\n }\n }\n var msg = (message || \"\").trim();\n var lastChar = msg.substr(msg.length - 1, 1);\n if (lastChar !== \".\" && lastChar !== \"?\" && lastChar !== \"!\") {\n msg += \".\";\n }\n return new Models.ApiError(err.status, severity, msg, subCode, \"\", \"\", swyfftError ? Models.ApiErrorTypes.SwyfftErrorCode : Models.ApiErrorTypes.HttpStatusCode, uri);\n }\n if (typeof reason === \"object\" && reason.message && reason.stack && reason.name) {\n var reference = Util.makeGuid().substring(0, 8).toUpperCase();\n return new Models.ApiError(\"Unexpected\", \"ERROR\", \"An unexpected error has occurred. Please try again later.\", null, reason.message + \"\\n\" + reference + \"\\n\" + reason.stack.toString(), reference, Models.ApiErrorTypes.UnexpectedError, uri);\n }\n try {\n var message = void 0;\n if (typeof reason === \"string\") {\n message = reason;\n }\n else {\n message = reason.exceptionMessage || JSON.stringify(reason);\n }\n if (message === Constants.ErrorMessages.authFailed) {\n return new Models.ApiError(Constants.HttpStatusCodes.authenticationFailed, \"ERROR\", message);\n }\n if (message === Constants.ErrorMessages.noQuote) {\n return new Models.ApiError(message, \"ERROR\", message);\n }\n return new Models.ApiError(\"Unexpected\", \"ERROR\", message, null, \"\", \"\", Models.ApiErrorTypes.UnexpectedError, uri);\n }\n catch (e) {\n return new Models.ApiError(\"Unexpected\", \"ERROR\", reason.toString(), null, \"\", \"\", Models.ApiErrorTypes.UnexpectedError, uri);\n }\n}", "title": "" }, { "docid": "47583511e0df8f13c79ff02902c04f2f", "score": "0.5769128", "text": "static get notFoundError() {\n return getErrorObject('DEVICE_NOT_FOUND', 404);\n }", "title": "" }, { "docid": "88bce48308d1263404c911978fb1a415", "score": "0.57679635", "text": "function apiError(response, url) {\n\t\n\tvar errorHtml = \n\t\t\"<p>There was an error with the following query:</p>\" + \n\t\t\"<p>\" + url + \"</p>\" + \n\t\t\"<p>Error message:</p>\" + \n\t\t\"<p>\" + response + \"</p>\";\n\t\n\tvar dialog = $( \"#errorDialog\" );\n\t\n\tvar existingErrors = dialog.html();\n\t\n\t\t$( \"#errorDialog\" )\n\t\t.html(existingErrors + errorHtml)\n\t\t.dialog({\n\t\t\twidth: 500,\n\t\t\theight: 200,\n\t\t\tmodal: true\n\t\t});\n}", "title": "" }, { "docid": "41c9865964a3e6152e853ad3c21e501e", "score": "0.5757626", "text": "function findUserByIdError(error) {\n if (error.status === 404) {\n $location.url(\"/\");\n } else if (error.data && error.data.message) {\n vm.error = error.data.message;\n } else {\n vm.error = \"Unable to fetch profile information. Please try again later.\";\n }\n }", "title": "" }, { "docid": "2d92c2f278cac8919bc6dd16bd775137", "score": "0.5752901", "text": "function analyzeUrl(url, error) {\n if (app.url && app.url.length) {\n error.message = \"\"\n var readed = false\n var request = http.get(app.url, function (res) {\n rs = res\n rs.setEncoding('utf8')\n if ((app.url.indexOf('csv') > 0) || (app.url.indexOf('tsv' > 0))) {\n app.fileType = 'csv'\n }\n else if (app.url.indexOf('xml') > 0) {\n app.fileType = 'xml'\n }\n getStreamStructure(rs, app.fileType)\n })\n request.on('error', function (e) {\n showApp()\n error.message = e.message\n })\n }\n}", "title": "" }, { "docid": "41ca64d0c75a6d52e2e2ed3ea4eefc28", "score": "0.5751031", "text": "function getError(textStatus, errorThrown, error) {\n if (errorThrown === \"BAD REQUEST\"){\n var tmp = error.split(/(?:Expected|: Found)+/);\n var expected = tmp[1];\n var found = tmp[2];\n\n $(\"#results\").html(\"<div class='alert alert-danger r-8 mb-4' role='alert' id='error'>\" +\n \"<button class='close' id='closeError' type='button' onclick='closeError()'>\" +\n \"<span aria-hidden='true'>&times;</span></button>\" +\n \"<p class='mb-2'>Error found: \" + found + \"</p>\" +\n \"<p class='mb-2'>Expected: \" + expected + \"</p>\");\n }\n //if error isn't a false user input\n else{\n $(\"#results\").html(\"<div class='alert alert-danger r-8 mb-4' role='alert' id='error'>\" +\n \"<button class='close' id='closeError' type='button' onclick='closeError()'>\" +\n \"<span aria-hidden='true'>&times;</span></button>\" +\n \"<p class='mb-2'>Error Status: \" + textStatus + \"</p>\" +\n \"<p class='mb-2'>Error Thrown: \" + errorThrown + \"</p>\");\n }\n\n}", "title": "" }, { "docid": "c068f04e0f12b937b01376bedc92c98b", "score": "0.5730097", "text": "function checkValidUrl(title,url){\n if(validateURL(url)===false){\n alertMsg(\"You must enter a valid URL beginning with http://\")\n } else {\n makeLinkCard(title,url);\n }\n}", "title": "" }, { "docid": "4f79356b31ea72c0b9d7928eb67f5538", "score": "0.5681168", "text": "function errorCallback(error) {\n \n var errores = { \n 1: 'Permission denied',\n 2: 'Position unavailable',\n 3: 'Request timeout'\n };\n\n console.log(\"Navigator error:\" + errores[error]);\n \n} //gotErr", "title": "" }, { "docid": "728690cdec6265e781eca321f38b4a30", "score": "0.5678421", "text": "function displayError(error) {\n var errors = { \n 1: 'Permission denied',\n 2: 'Position unavailable',\n 3: 'Request timeout'\n };\n alert(\"Error: \" + errors[error.code]);\n}", "title": "" }, { "docid": "1269a2c5278ed1a06fd99c6811add623", "score": "0.56779325", "text": "function addErrorUrlMacros(ad) {\n if (ad.wrapper && ad.wrapper.error) {\n errorURLMacros.push(ad.wrapper.error);\n }\n\n if (ad.inLine && ad.inLine.error) {\n errorURLMacros.push(ad.inLine.error);\n }\n }", "title": "" }, { "docid": "662752f59442104797fe14b98bbf592e", "score": "0.5674503", "text": "get error() {}", "title": "" }, { "docid": "78fdcacc596e37cb70b67dc005c0b0e6", "score": "0.5670713", "text": "function error() {\n location.innerHTML = 'Unable to retrieve your location';\n }", "title": "" }, { "docid": "5a2a16c22c848956350d5858029de846", "score": "0.56692606", "text": "function getErrorMessage(field) {\n var response = {\n success: false,\n message: field + ' field is missing or Invalid in the request'\n };\n return response;\n}", "title": "" }, { "docid": "4aa8b5ba4c0a9ebda89247c223e899f2", "score": "0.5665728", "text": "function getErrStrFromResponse(error, response, body){\n\tvar res = '';\n\tif (error) res = error.message;\n\telse {\t\t\t\n\t\tif (response.statusCode != 200) res = \"response.statusCode=\"+response.statusCode;\n\t\telse {\n\t\t\tvar d = JSON.parse(body);\n\t\t\tif (d.search['return'].code != 0) {\n\t\t\t\tres = 'Error ['+d.search['return'].code+']: '+d.search['return'].message;\n\t\t\t}\n\t\t}\n\t}\n\treturn res;\n}", "title": "" }, { "docid": "18b3deff056b006a55b1a3a5c97f3f7b", "score": "0.56625354", "text": "function isKnownError(error) {\n const { status, code, source } = error;\n const { pointer } = source || {};\n const errorStatus = status || code;\n\n return (\n isServerError(error) ||\n (errorStatus === undefined || (errorStatus >= 400 && pointer))\n );\n}", "title": "" }, { "docid": "3dce8707e240edce2ce224d655c39a47", "score": "0.5661885", "text": "function apiError(response, url) {\n\n\t\tvar errorHtml = \n\t\t\t\"<p>There was an error with the following query:</p>\" + \n\t\t\t\"<p>\" + url + \"</p>\" + \n\t\t\t\"<p>Error message:</p>\" + \n\t\t\t\"<p>\" + response + \"</p>\";\n\n $(\"#chart\").css(\"background\", \"\");\n\t\t\n\t\tvar dialog = $( \"#errorDialog\" );\n\t\t\n\t\tvar existingErrors = dialog.html();\n\t\t\n\t\t$( \"#errorDialog\" )\n\t\t\t.html(existingErrors + errorHtml)\n\t\t\t.dialog({\n\t\t\t\twidth: 500,\n\t\t\t\theight: 200,\n\t\t\t\tmodal: true\n\t\t\t});\n\t}", "title": "" }, { "docid": "528dd3a837c571c4d53db09211d3ca19", "score": "0.5650819", "text": "validateResponse (data) {\n\t\tAssert.equal(data, '/web/confirm-email-error?error=AUTH-1002', 'improper redirect');\n\t}", "title": "" }, { "docid": "ec39f7a6d8a7811e34f1b921b984952c", "score": "0.5650245", "text": "function addressNotFound(address) {\n const { erro: error } = address;\n return error;\n}", "title": "" }, { "docid": "15ca779e39f2911e695a9d44b937741e", "score": "0.5620316", "text": "function bn(e){this.status=400,this.name=\"query_parse_error\",this.message=e,this.error=!0;try{Error.captureStackTrace(this,bn)}catch(e){}}", "title": "" }, { "docid": "3dca633903c30a0c2ea3f7743c298933", "score": "0.5605132", "text": "function site_OnError(message,uri,line)\r\n{\r\n try\r\n {\r\n var txt=\"There was an error on this page.\\n\\n\";\r\n txt+=\"Error: \" + message + \"\\n\";\r\n txt+=\"URL: \" + uri + \"\\n\";\r\n txt+=\"Line: \" + line+ \"\\n\\n\";\r\n txt+=\"Click OK to continue.\\n\\n\";\r\n alert(txt);\r\n }\r\n catch (e)\r\n {\r\n alert(message);\r\n }\r\n \r\n return true;\r\n}", "title": "" }, { "docid": "cb731637ca846041962db687d7bf6114", "score": "0.56043774", "text": "function InvalidResponseError(originalError, url, data) {\n this.originalError = originalError;\n this.url = url;\n this.responseData = data;\n }", "title": "" }, { "docid": "3c1154049ae308e9f38688b8fd54be99", "score": "0.55995774", "text": "function checkForErrors(error, result) {\r\n\t\t\t//If there is an error, we return an error\r\n\t\t\tif (error) {\r\n\t\t\t\tcallback(error);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t//No errors in the error parameter, let's look in the response\r\n\t\t\tlog.debug('parsing errors in HotelDetail...');\r\n\t\t\tvar errorReader = new XmlReader (result, atlasDefaults.errorDescriptionMap);\r\n\t\t\terrorReader.readObjects(function(errorParsing, parsedErrors){\r\n\t\t\t\tif ('ErrorList' in parsedErrors) {\t//There were errors coded in the response\r\n\t\t\t\t\tvar errorToSend = {\r\n\t\t\t\t\t\terror: '004-bad-request',\r\n\t\t\t\t\t\tstatusCode: 400,\r\n\t\t\t\t\t\tdescription: 'Faulty HotelDetail request made to Atlas. See stack trace for details',\r\n\t\t\t\t\t\tcontact: 'dlafuente@tuitravel-ad.com'\r\n\t\t\t\t\t};\r\n\t\t\t\t\tif (debug) {\r\n\t\t\t\t\t\terrorToSend.stack = JSON.stringify(parsedErrors.ErrorList);\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn callback(errorToSend);\r\n\t\t\t\t}\r\n\t\t\t\tlog.debug('No errors in hotelDetail. Parsing response ...');\r\n\t\t\t\tvar xmlReader = new XmlReader (result, descriptionMap, tag);\r\n\t\t\t\txmlReader.readObjects(function(errorParsing, parsedResponse) {\r\n\t\t\t\t\tif (errorParsing) { //something went wrong when parsing\r\n\t\t\t\t\t\tif (debug) {\r\n\t\t\t\t\t\t\terrorParsing.stack = result;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn callback(errorParsing);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcallback(null, parsedResponse);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}", "title": "" }, { "docid": "c6245053e0b489875b967f298f889fbf", "score": "0.5586772", "text": "function paramsError(errorMessage) {\n $(\"#banner\").html(errorMessage);\n}", "title": "" }, { "docid": "e531e96ff4f66cb136cd858e84e26e15", "score": "0.5571128", "text": "getListsFailure(error) {\n console.error(error)\n }", "title": "" }, { "docid": "52f38ea5da95ec701638af4533a8bb1f", "score": "0.5566772", "text": "function locationErr(error) {\n alert(\"Unable to retrieve your location due to \" + error.code + \": \" + error.message);\n }", "title": "" }, { "docid": "085f2637b350f249beb4789fd95e3cfe", "score": "0.555791", "text": "static get ERROR_INVALID() {\n return \"Invalid homeserver discovery response\";\n }", "title": "" }, { "docid": "ba09c8b4393dc197373337e6ad904ac1", "score": "0.55519235", "text": "function fail(error) {\n console.log(error.code);\n}", "title": "" }, { "docid": "fcfaef1d81d38213b2a51d6bb7385810", "score": "0.55478257", "text": "function askError() {\n\tgetData(\"http://httpstat.us/500\", errorHandler);\n}", "title": "" }, { "docid": "e7d3f8b8aed025d4a3876bec5fd19a29", "score": "0.5538752", "text": "function checkGetRequest(url) {\r\n let urlx = url.toString();\r\n return urlx.indexOf(\"&\") > -1;\r\n}", "title": "" }, { "docid": "c881309aa43ee056e29091df0d932b1b", "score": "0.55325085", "text": "function customDataError(error) {\n var errorNumber = parseInt(error.error_code);\n var errorContent = error.error.toLowerCase();\n var errorRequest = error.request.toLowerCase();\n var errorParams = error.params;\n if (!schneider.util.inArray(errorNumber, [20006, 21327, 21334, 21335, 21305, 21332, 21333, 21334, 21335, 21336])) {\n if (errorNumber == 20007) {\n if (schneider.util.inString(\"tag\", errorContent)) { \n errorTipDis(\"tag_already_exists\")\n } else if (schneider.util.inString(\"gateway\", errorContent)) { \n errorTipDis(\"gateway_already_exists\")\n } else if (schneider.util.inString(\"name\", errorContent)) {\n if (schneider.util.inString(\"device\", errorRequest)) { \n errorTipDis(\"device_already_exists\")\n } else if (schneider.util.inString(\"sites\", errorRequest)) { \n errorTipDis(\"site_already_exists\")\n }\n } else if (schneider.util.inString(\"serival\", errorContent)) { \n errorTipDis(\"serial_number_already_exists\")\n } else if (schneider.util.inString(\"devices\", errorRequest)) { \n errorTipDis(\"serial_number_already_exists\")\n } else if (schneider.util.inString(\"group\", errorRequest)) { \n errorTipDis(\"group_already_exists\")\n } else if (schneider.util.inString(\"machines\", errorRequest)) { \n errorTipDis(\"controller_already_exists\")\n }else { \n errorTipDis(errorNumber)\n// dialog.render({\n// lang: \"resource_already_exists\"\n// });\n }\n } else if (errorNumber == 21322) {\n if (schneider.util.inString(\"machines\", errorRequest)) { \n errorTipDis(\"controller_already_exists\")\n }\n else if (schneider.util.inString(\"devices\", errorRequest)) { \n errorTipDis(\"gateway_already_exists\")\n }\n else if (schneider.util.inString(\"sites\", errorRequest)) { \n errorTipDis(\"site_already_exists\")\n }\n else if (schneider.util.inString(\"models\", errorRequest)) { \n errorTipDis(\"model_already_exists\")\n }\n } else {\n if ($.isArray(errorParams)) {\n var _prompt = locale.get(errorNumber, errorParams);\n dialog.render({\n text: _prompt\n })\n } else {\n errorTipDis(errorNumber) \n }\n }\n }\n unload();\n }", "title": "" }, { "docid": "dc6386577e5929fe53fec6aed2bfefec", "score": "0.55313843", "text": "function validateEntryInfo(req, res, next) {\n const entry = req.body;\n if(entry.url) {\n next();\n }\n else {\n res.status(422).json({\"errorMessage\": \"Missing entry info\"});\n }\n}", "title": "" }, { "docid": "5590b71845b95fd18e903815e3e910d3", "score": "0.55288774", "text": "function error(status) {\n\tdisplayLoading('none');\n\tvar message = \"something wrong, THIS IS HTTP \" + status + \" ERROR\";\n\tdocument.getElementById('errors').innerHTML = message;\n}", "title": "" }, { "docid": "9f4b361f661edcef34b905f907d7c867", "score": "0.5528694", "text": "function badRequest() {\n var err = new Error();\n err.status = 400;\n return err;\n}", "title": "" }, { "docid": "2a2bd7534463dd1b7a124b9af7dcf713", "score": "0.55266285", "text": "function checkForUrl (url){\n\tvar httpCheck = url.indexOf(\"http\");\n\tvar dotCom = url.indexOf(\".\");\n\tif (httpCheck === -1){\n\t\tconsole.log(\"This URL looks incomplete.\")\n\t\t} else if (dotCom === -1){\n\t\t\tconsole.log(\"This begins to look like a web address\")\n\t} else {\n\t\tconsole.log(\"This looks like a web address\")\n\t}\t\n\n}", "title": "" }, { "docid": "e7ac66dadf65da2fd126bae562d8af32", "score": "0.5518542", "text": "function failure(result) {\n debug(result.responseText);\n }", "title": "" }, { "docid": "e4ffd1c09c54d414c8f542ed9e51c764", "score": "0.5518318", "text": "function errorCallback() {\n alert(\"There was an error making the request.\");\n}", "title": "" }, { "docid": "7bf41d79033e28e9437fa56efdec2e8b", "score": "0.55151594", "text": "function err(){\n push()\n push( \"Please provide both 'email' and 'password'\")\n push()\n // I provide a link to the \"offending\" page\n push( on_page.name)\n // It is a good idea to provide some help, let's hope these pages exist\n push( \"Help\" + cmd)\n push( \"Help\" + on_page.name)\n return done()\n }", "title": "" }, { "docid": "c645606639c414e6bd6d8f0a4180fb3d", "score": "0.55048335", "text": "function errorCallback(err) {\n __result1 = err.name;\n }", "title": "" }, { "docid": "7a238b47f923d37066475de8e4701424", "score": "0.5502829", "text": "function failure(error) {\n console.log(error);\n loginResult(false, \"Server Error\");\n }", "title": "" }, { "docid": "379329adfe9c2ef242aff1891a47b133", "score": "0.55021554", "text": "function showError(error){\n if(error.code == 1){\n result.innerHTML = \"You've decided not to share your position, but it's OK. We won't ask you again.\";\n } else if(error.code == 2){\n result.innerHTML = \"The network is down or the positioning service can't be reached.\";\n } else if(error.code == 3){\n result.innerHTML = \"The attempt timed out before it could get the location data.\";\n } else{\n result.innerHTML = \"Geolocation failed due to unknown error.\";\n }\n}", "title": "" }, { "docid": "d4bec2e6ef4e83fa177218b3dbba089b", "score": "0.5488298", "text": "function endpointUrlValidator(urlRe) {\n return function (control) {\n var correctUrl = urlRe.test(control.value);\n return correctUrl ? null : { 'incorrectUrl': { value: control.value } };\n };\n}", "title": "" }, { "docid": "86c3d6ce74b3625f1f68c58c23bd1592", "score": "0.5488015", "text": "function postError(errorMessage)\n{\n console.log(errorMessage);\n}", "title": "" }, { "docid": "7b43b07ae63e5225d39755d96918c961", "score": "0.548763", "text": "function displayError(error) {\n\t\tsetLoadingDisp(\"none\");\n\t\tvar errorSpace = document.getElementById(\"errors\");\n\n\t\tif (error == 410) {\n\t\t\tdocument.getElementById(\"nodata\").style.display = \"block\";\n\t\t\t// hide buttons and slider for aesthetics\n\t\t\tdocument.getElementById(\"buttons\").style.display = \"none\";\n\t\t\tdocument.getElementById(\"slider\").style.display = \"none\";\n\t\t} else {\n\t\t\tvar errorMsg = \"Error \" + error + \": \";\n\n\t\t\t// construct the message\n\t\t\tif ((parseInt(error / 100)) == 3) { // error in the 300s\n\t\t\t\terrorMsg += \"[redirect] Hold on a minute, then give up if not resolved.\";\n\t\t\t} else if ((parseInt(error / 100)) == 4) { // error in the 400s\n\t\t\t\terrorMsg += \"[client error] Something terrible happened, and it's probably your fault.\";\n\t\t\t} else { // error most likely in the 500s\n\t\t\t\terrorMsg += \"[server error] Something terrible happened, but at least you had nothing to do with it.\";\n\t\t\t}\n\n\t\t\t// print the message\n\t\t\terrorSpace.innerHTML = errorMsg;\n\t\t}\n\t}", "title": "" }, { "docid": "9bd6433c7e459eb38ef7950855212a09", "score": "0.5486851", "text": "function _handleError(xhr) {\n\t\tvar error;\n\n\t\tswitch (xhr.status) {\n\t\tcase 401:\n\t\t\terror = 'authorization required, please check your api-key';\n\t\t\tbreak;\n\t\tcase 0:\n\t\tcase 404:\n\t\t\terror = 'no additional data found';\n\t\t\tif ( $.papi._notfound ) {\n\t\t\t\treturn $.papi._notfound.apply($.papi, [xhr]);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 500:\n\t\t\terror = 'server error, shit has hit the fan yo! Contact @postcodeapi';\n\t\t\tbreak;\n\t\t}\n\n\t\tthrow new Error('PAPI error: ' + error);\n\t}", "title": "" }, { "docid": "866c10374841219ea695f79c1cbfdd97", "score": "0.5486834", "text": "function error() {\n self.errorMessage = 'Unable to retrieve your location';\n }", "title": "" }, { "docid": "ad0b0a254b0ee49f31c498df6a17d4a5", "score": "0.5486119", "text": "function resp_on_error(err){\n}", "title": "" }, { "docid": "3b4d4a1b8391aabec43bde9868a24868", "score": "0.5483368", "text": "onFail(error) {\n this.errors.record(error.response.data.errors);\n this.loading = false;\n return error;\n }", "title": "" }, { "docid": "17ee7657971dcca612d75f5ca68875a1", "score": "0.5478827", "text": "function geo_error(err) {\n\t if (err.code == 1) {\n\t error('The user denied the request for location information.')\n\t } else if (err.code == 2) {\n\t error('Your location information is unavailable.')\n\t } else if (err.code == 3) {\n\t error('The request to get your location timed out.')\n\t } else {\n\t error('An unknown error occurred while requesting your location.')\n\t }\n\t}", "title": "" }, { "docid": "ba540d8b7da0abf0fea77207cc0bbb8b", "score": "0.54671425", "text": "function formErrorMessage(param, type) {\n\t\t\t\ttry{\n\t\t\t\tvar tmpMessage = \"Wrong \";\n\t\t\t\t\tswitch (type) {\n\t\t\t\t\tcase \"GUID\":\n\t\t\t\t\t\ttmpMessage += \"GUID at \";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\ttmpMessage += \"parameter(unknown) at \";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\ttmpMessage += param;\n\t\t\t\t\t}catch(e){console.error(e + \" @renderer\");tmpMessage = \"none;\";}\n\t\t\t\treturn tmpMessage;\n\t\t\t}", "title": "" }, { "docid": "b1642e6f3d31541b0157faf194af1d1f", "score": "0.5462181", "text": "function onLocationFail(error) {\n console.log(\"Error: \" + error.message);\n}", "title": "" }, { "docid": "6259b4583a09850b88775eef8550763e", "score": "0.5458891", "text": "function display_error(res, message) {\n var params = get_parameters();\n params.error = message;\n res.render(error_url, params);\n res.end();\n}", "title": "" }, { "docid": "30f24c657630e20230504eb789af5980", "score": "0.54522556", "text": "function atgValidation_validateURL(testString) {\n // If the field is null or empty, do not proceed with validation. If this is a required field,\n // the required field validator should be used in conjunction with this validator\n if ((testString == null) || (testString == \"\"))\n return validationCode.SUCCESS;\n \n var invalidCharacters = \"!#$^*()+[]\\\\\\',{}|\\\"<>\";\n for (charCount = 0; charCount < testString.length; charCount++) { \n charLetter = testString.charAt(charCount);\n if (invalidCharacters.indexOf(charLetter,0) != -1) {\n \treturn validationCode.ERROR_URL_FORMAT;\n }\n }\n\n return validationCode.SUCCESS;\n}", "title": "" }, { "docid": "28db669341e08b64b0aa29f2f2731897", "score": "0.5442911", "text": "function displayError(error) {\n var errors = { \n 1: 'Geolocation Permission denied',\n 2: 'Position unavailable',\n 3: 'Request timeout'\n };\n alert(\"Error: \" + errors[error.code]);\n}", "title": "" }, { "docid": "755d24b265f42edffb0e54e817112b24", "score": "0.5441839", "text": "function RequestError(statusCode, statusText, url, message) {\n this.url = url;\n this.message = message;\n this.statusCode = statusCode;\n this.statusText = statusText;\n }", "title": "" }, { "docid": "4724262bb1aad4899463f7233cb01842", "score": "0.5435792", "text": "function printError(error){\n\n if (error.syscall == 'connect'){\n console.error(\"There was an error connecting to this URL. (\" + error.code + \").\");// could make friendlier message...\n }\n else{\n console.error(error.message);\n } \n\n}", "title": "" }, { "docid": "22d456ef40afa5c278dcc823e9198293", "score": "0.54316384", "text": "static pageError (desc) {\n console.log('XCODE ERROR:', desc); // eslint-disable-line no-console\n if (window.location.href.indexOf('home.html') > -1) {\n if (Lobby.errorTimer) {\n Lobby.errorLoading(desc);\n }\n }\n }", "title": "" }, { "docid": "df347233ea46a5d85569f898e06157e1", "score": "0.543098", "text": "function showError(error) {\r\n\tswitch (error) {\r\n\t\tcase \"noserver\":\r\n\t\tcase \"data\":\r\n\t\t\talert(\"Avatardaten können nicht geladen werden. Bitte beachten Sie, dass dieser erst nach 4 Tagesprotokollen zur Verfügung steht.\");\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"nointernet\":\r\n\t\t\talert(\"Der Avatar kann nicht abgerufen werden, da keine Verbindung zum Internet besteht.\");\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tdefault:\r\n\t\t\talert(\"Ein unbekannter Fehler ist aufgetaucht. Bitte melden Sie sich bei da.meusburger@gmail.com\")\r\n\t}\r\n}", "title": "" }, { "docid": "25c255bba582ef5007399c833f5a1233", "score": "0.5430537", "text": "function OnRequestFail(error) {\n print(\"error=\"+JSON.stringify(error)+CR);\n OvmsNotify.Raise(\"info\", \"usr.abrp.status\", \"ABRP::\" + JSON.stringify(error));\n }", "title": "" }, { "docid": "351511d18bf514ce0700672a79bb6b07", "score": "0.54245704", "text": "function error() {\n status.textContent = 'Unable to retrieve your location';\n}", "title": "" }, { "docid": "6ab40e26bed2e3bad6a041706a224493", "score": "0.5421874", "text": "function error(error) {\n // Parameter error berhasil dari Proise.reject()\n console.log(\"Error : \" + error);\n}", "title": "" }, { "docid": "3c9dc9e1e4312f88b1a4f5eae9e3f89e", "score": "0.54213345", "text": "function showError(error){\n if(error.code == 1){\n result.innerHTML = \"You've decided not to share your position, but it's OK. We won't ask you again.\";\n } else if(error.code == 2){\n result.innerHTML = \"The network is down or the positioning service can't be reached.\";\n } else if(error.code == 3){\n result.innerHTML = \"The attempt timed out before it could get the location data.\";\n } else{\n result.innerHTML = \"Geolocation failed due to unknown error.\";\n }\n }", "title": "" }, { "docid": "8a4b2afe938e67430d2a978e1d317c4a", "score": "0.54138595", "text": "getCondition() { return 'Bad Request' }", "title": "" }, { "docid": "a833948e9cfa4fb41f54172481c32c47", "score": "0.54089874", "text": "function Fail(errorData, response)\n{\n console.log(response);\n}", "title": "" }, { "docid": "b1680b1925ea89ab27a11aa7aa0f1ea2", "score": "0.54081196", "text": "function processServerError(error) {\n return Object.keys(error).reduce(\n function(newDict, key) {\n if (key === \"non_field_errors\") {\n newDict[\"_error\"].push(error[key]);\n } else if (key === \"token\") {\n // token sent with request is invalid\n newDict[\"_error\"].push(\"The link is not valid any more.\");\n } else {\n newDict[key] = error[key];\n }\n\n return newDict;\n },\n { _error: [] }\n );\n}", "title": "" }, { "docid": "ea6098faa87af35593c940cc2e2e1cb8", "score": "0.54056793", "text": "function FailedCallback(error)\n{\n // Display the error. \n var RsltElem = document.getElementById(\"NearestSchoolResult\");\n RsltElem.innerHTML = \n \"Service Error: \" + error.get_message();\n}", "title": "" }, { "docid": "5b041c1586b6e851ecb4d65f0e3d73d6", "score": "0.540065", "text": "_handleError(object, title, message) {\n if (!title || !message) {\n // try to get details of known possible errors\n let maybeDetail = (object || {}).detail;\n let maybeError = (maybeDetail || {}).error;\n let maybeRequest = (maybeDetail || {}).request;\n let maybeXhr = (maybeRequest || {}).xhr;\n\n // TODO: this is for from perfect. all fields should be checked before usage\n if ((maybeXhr || {}).readyState === 4 && (maybeXhr || {}).status === 0) { // network issues\n title = 'Network Connection Error';\n message = 'Could not connect to: ' + (maybeRequest || {}).url;\n } else if ((maybeXhr || {}).status && (maybeXhr.response || {}).msg) {\n title = maybeXhr.status + \" - \" + maybeXhr.statusText;\n message = maybeXhr.response.msg;\n } else if ((maybeXhr || {}).status && (maybeError || {}).message) {\n title = maybeXhr.status + \" - \" + maybeXhr.statusText;\n message = maybeError.message;\n } else {\n title = \"Unknown error\";\n message = \"Could not determine type of error, check manually in console\"\n }\n\n if ( ((maybeRequest || {}).__data || {}).status == 404 )\n {\n title = \"Service unreachable\";\n if ( (maybeRequest || {}).url.includes(\"/contactservice/\") )\n {\n message = \"ContactService not reachable. Ensure it is running.\";\n if ( !this._isContactServiceRunning )\n return;\n this._isContactServiceRunning = false;\n }\n if ( (maybeRequest || {}).url.includes(\"/fileservice/\") )\n {\n message = \"FileService not reachable. Ensure it is running.\";\n if ( !this._isFileServiceRunning )\n return;\n this._isFileServiceRunning = false;\n }\n }\n if ( message.includes(\"Node does not use registry\") ) {\n this._isEthNode = false;\n }\n if ( message.includes(\"Couldn't query mobsos success model for group\") )\n {\n this._error = { title: \"Couldn't query MobSOS success model\", msg: \"Either the service is not running or the success model is not setup.\" };\n return;\n }\n }\n this._error = { title: title, msg: message, obj: object };\n }", "title": "" }, { "docid": "199fd2c1d87046aedf1fd3ae6b1b9d91", "score": "0.5400627", "text": "function checkInputLink(originalLink) {\n if(originalLink == \"\") {\n return \"Please add a link\";\n } else if (!validateUlr(originalLink)) {\n return \"Invalid URL (\\\"https://www.example.com\\\")\";\n }\n return 0;\n}", "title": "" }, { "docid": "511539c1ec993dff7003057aaf9ccadc", "score": "0.5398051", "text": "function wikiApiError() {\n alert(\"Wiki failed to retrieve data. Please try again.\");\n}", "title": "" }, { "docid": "b823982b8fdfb5593207712e29e55d65", "score": "0.53972673", "text": "function error_handling(cod){\r\n if(cod === '404'){\r\n notiElement.innerHTML = 'City not found'\r\n }else if(cod==='400'){\r\n notiElement.innerHTML = 'Enter a city'\r\n }else if(cod==='401'){\r\n notiElement.innerHTML = 'invalid api key'\r\n }\r\n else{\r\n notiElement.innerHTML = ''\r\n }\r\n}", "title": "" }, { "docid": "d7aabc5013107ade01303890c790d9ee", "score": "0.53964376", "text": "function displayError(xhr, message, errorThrown) {\n if (xhr.status === 404) {\n alert(\"Item not found\");\n }\n else {\n alert(\"Ajax error occurred: \" + errorThrown);\n }\n}", "title": "" }, { "docid": "504ca7699f9e70cc6d46be31c9b77dc7", "score": "0.53943485", "text": "function showError() {\n\talert(\"Location can't be found\");\n}", "title": "" }, { "docid": "0289eec3885d13d01af61ac284912125", "score": "0.5386371", "text": "function getApiErrorMessage (error) {\n\t\tvar errorMessage;\n\n\t\ttry{\n\t\t\t_.each(error.response.data.error.errors, function (err) {\n\t\t\t\terrorMessage += \" \" + err.message + \",\";\n\t\t\t})\n\t\t} catch (e) {console.error('error-getting-error', e)}\n\n\t\treturn errorMessage;\n\t}", "title": "" }, { "docid": "f27d1c4a7253b440b0b5540f42ea5acb", "score": "0.53854877", "text": "function checkError(errorCode) {\n switch(errorCode) {\n case 0:\n return 'Geen watertoevoer';\n case 1:\n return 'Temperatuur te laag';\n case 2:\n return 'Koffiebonen op';\n case 3:\n return 'Afvalbak vol';\n case 4:\n return 'Geen druk';\n default:\n return 'Onbekende foutcode';\n }\n}", "title": "" } ]
d7159c6871f76bed2780c065a44c2353
GraphControls is a special child component. To maximize responsiveness we disable rendering on zoom level changes, but this component still needs to update. This function ensures that it updates into the container quickly upon zoom changes without causing a full GraphView render.
[ { "docid": "8393e08f95398091af8df832522736d4", "score": "0.7885903", "text": "renderGraphControls() {\n if (!this.props.showGraphControls || !this.viewWrapper) {\n return;\n }\n\n const graphControlsWrapper = this.viewWrapper.current.querySelector('.graph-controls-wrapper')\n if (graphControlsWrapper) {\n ReactDOM.render(\n <GraphControls\n ref={this.graphControls}\n minZoom={this.props.minZoom}\n maxZoom={this.props.maxZoom}\n zoomLevel={this.state.viewTransform ? this.state.viewTransform.k : 1}\n zoomToFit={this.handleZoomToFit}\n modifyZoom={this.modifyZoom}\n nodeSelect={this.props.nodeSelect}\n />,\n graphControlsWrapper\n );\n }\n }", "title": "" } ]
[ { "docid": "585d808f6301eb81162fee67079067ce", "score": "0.608352", "text": "function renderGraph() {\n calculateLayout();\n if (svg === undefined) {\n renderNewGraph();\n } else {\n repaintExistingGraph();\n }\n if (options.showButtons) {\n if (!buttonLayer) createButtonLayer();\n resizeButtonLayer();\n }\n redraw();\n }", "title": "" }, { "docid": "7d2d8005db4fd22d3764f834d906d98c", "score": "0.603587", "text": "shouldComponentUpdate(nextProps) {\n if (this.props.tracking && !nextProps.tracking) {\n const tracker = this.main.select(\"rect.trackZoom\");\n tracker.attr(\"display\", \"none\");\n }\n this.chartType.updateProps(nextProps);\n return (\n this.props.selected !== nextProps.selected ||\n this.props.chartType !== nextProps.chartType\n );\n }", "title": "" }, { "docid": "eb3d7c8c212ee32c39afeff4697a49d2", "score": "0.5948353", "text": "function renderGraph() {\n calculateLayout();\n if (svg === undefined) {\n renderNewGraph();\n } else {\n repaintExistingGraph();\n }\n if (options.showButtons) {\n if (!buttonLayer) createButtonLayer();\n resizeButtonLayer();\n }\n if (options.legendLabels.length > 0) {\n if (!legendLayer) {\n createLegendLayer();\n }\n updateLegendVisibility();\n }\n redraw();\n }", "title": "" }, { "docid": "845801303141c6f473f721d2f89041e9", "score": "0.5823463", "text": "renderChartControls() {\n const { viewBy } = this.props;\n if (viewBy === 'drug') {\n return this.renderDrugChartControls();\n }\n\n return this.renderCellLineChartControls();\n }", "title": "" }, { "docid": "7baecfe1c22c10e8efd4fdfd96268d4a", "score": "0.5791395", "text": "function renderControls() {\n ej.base.enableRipple(currentTheme === MATERIAL || currentTheme === 'material-dark');\n\n setControlContents();\n\n // set visible to hidden controls which is filtered already.\n for (var controlId of HIDDEN_CONTROLS) {\n var hiddenControl = document.getElementById(controlId);\n if (filteredControls.indexOf(controlId) !== -1 && hiddenControl) {\n hiddenControl.style.display = '';\n }\n }\n\n // rendering numeric text-box control\n if (isFiltered('numerictextbox')) {\n var numericTextbox = new ej.inputs.NumericTextBox({\n value: 15\n });\n numericTextbox.appendTo('#sf-numeric-textbox');\n }\n\n // rendering masked text-box control\n if (isFiltered('maskedtextbox')) {\n var maskedTextbox = new ej.inputs.MaskedTextBox({\n mask: '000-000-0000'\n });\n maskedTextbox.appendTo('#sf-masked-textbox');\n }\n\n // rendering signature control\n if (isFiltered('signature')) {\n var signature = new ej.inputs.Signature({});\n signature.appendTo('#sf-signature');\n }\n\n // rendering slider control\n if (isFiltered('slider')) {\n var slider = new ej.inputs.Slider({\n value: 30,\n type: 'MinRange',\n tooltip: { isVisible: true, showOn: 'Focus' },\n });\n slider.appendTo('#sf-slider');\n }\n\n // rendering grid control\n if (isFiltered('grid')) {\n var grid = new ej.grids.Grid({\n allowPaging: true,\n allowGrouping: true,\n allowFiltering: true,\n dataSource: window.gridData,\n filterSettings: { type: 'Menu' },\n groupSettings: { columns: ['OrderID'] },\n pageSettings: { pageCount: 3, pageSize: 3 },\n columns: [\n { field: 'OrderID', headerText: 'Order ID', width: 120 },\n { field: 'OrderDate', headerText: 'Order Date', format: 'yMd', width: 120 },\n { field: 'Freight', width: 120, format: 'C2', width: 130 },\n { field: 'ShippedDate', headerText: 'Shipped Date', format: 'yMd', width: 180 },\n { field: 'ShipCountry', headerText: 'Ship Country', width: 150 }\n ],\n actionComplete: (args) => {\n if (args.requestType === 'grouping') {\n grid.pageSettings.pageSize = 3;\n }\n if (args.requestType === 'ungrouping') {\n grid.pageSettings.pageSize = 6;\n }\n }\n });\n grid.appendTo('#sf-grid');\n\n // Change Grid card size based on theme name.\n var isBiggerSize = currentTheme.indexOf('highcontrast') !== -1 || currentTheme.indexOf('fabric') !== -1;\n ej.base.select('#sf-grid').closest('.e-card-content').style.height = isBiggerSize ? '420px' : '400px';\n }\n\n // rendering auto-complete control\n if (isFiltered('auto-complete')) {\n var autoComplete = new ej.dropdowns.AutoComplete({\n dataSource: window.sportsData,\n placeholder: 'e.g. Basketball'\n });\n autoComplete.appendTo('#sf-auto-complete');\n }\n\n // rendering dropdown list control\n if (isFiltered('drop-down-list')) {\n var dropdownList = new ej.dropdowns.DropDownList({\n index: 2,\n popupHeight: '200px',\n placeholder: 'Select a game'\n });\n dropdownList.appendTo('#sf-drop-down-list');\n }\n\n // rendering dropdown tree control\n if (isFiltered('drop-down-tree')) {\n //define the array of JSON\n var data = [\n {\n nodeId: '01', nodeText: 'Music',\n nodeChild: [\n { nodeId: '01-01', nodeText: 'Gouttes.mp3' }\n ]\n },\n {\n nodeId: '02', nodeText: 'Videos', expanded: true,\n nodeChild: [\n { nodeId: '02-01', nodeText: 'Naturals.mp4' },\n { nodeId: '02-02', nodeText: 'Wild.mpeg' },\n ]\n },\n {\n nodeId: '03', nodeText: 'Documents',\n nodeChild: [\n { nodeId: '03-01', nodeText: 'Environment Pollution.docx' },\n { nodeId: '03-02', nodeText: 'Global Water, Sanitation, & Hygiene.docx' },\n { nodeId: '03-03', nodeText: 'Global Warming.ppt' },\n { nodeId: '03-04', nodeText: 'Social Network.pdf' },\n { nodeId: '03-05', nodeText: 'Youth Empowerment.pdf' },\n ]\n }];\n var dropdownTree = new ej.dropdowns.DropDownTree({\n //binding data source through fields property\n fields: { dataSource: data, value: 'nodeId', text: 'nodeText', child: 'nodeChild' }\n });\n dropdownTree.appendTo('#sf-drop-down-tree');\n }\n\n // rendering dialog control\n if (isFiltered('dialog')) {\n var dialog = new ej.popups.Dialog({\n width: '40%',\n isModal: true,\n showCloseIcon: true,\n header: 'Delete Multiple Items',\n animationSettings: { effect: 'None' },\n content: '<span>Are you sure you want to permanently delete these items ?</span>',\n target: document.getElementById('theme-dialog-wrapper'),\n buttons: [\n {\n click: () => {\n dialog.hide();\n },\n buttonModel: { content: 'Yes', isPrimary: true }\n },\n {\n click: () => {\n dialog.hide();\n },\n buttonModel: { content: 'No' }\n }\n ],\n });\n dialog.appendTo('#sf-dialog');\n // create button to open the dialog control\n var dialogBtn = new ej.buttons.Button({});\n dialogBtn.appendTo('#sf-dialog-button');\n document.getElementById('sf-dialog-button').onclick = () => dialog.show();\n }\n\n // rendering multi-select control\n if (isFiltered('multi-select')) {\n var multiSelect = new ej.dropdowns.MultiSelect({\n mode: 'Box',\n placeholder: 'Favorite Sports'\n });\n multiSelect.appendTo('#sf-multi-select');\n }\n\n // rendering combo-box control\n if (isFiltered('combo-box')) {\n var comboBox = new ej.dropdowns.ComboBox({\n popupHeight: '270px',\n allowFiltering: true,\n placeholder: 'Select a country',\n dataSource: window.ddCountryData,\n fields: { text: 'Name', value: 'Code' },\n filtering: (e) => {\n var query = new ej.data.Query();\n query = (e.text !== '') ? query.where('Name', 'startswith', e.text, true) : query;\n e.updateData(window.ddCountryData, query);\n }\n });\n comboBox.appendTo('#sf-combo-box');\n }\n\n // rendering calendar control\n if (isFiltered('calendar')) {\n var calendar = new ej.calendars.Calendar({});\n calendar.appendTo('#sf-calendar');\n }\n\n // rendering date-picker control\n if (isFiltered('datepicker')) {\n var datePicker = new ej.calendars.DatePicker();\n datePicker.appendTo('#sf-datepicker');\n }\n\n // rendering time-picker control\n if (isFiltered('timepicker')) {\n var timePicker = new ej.calendars.TimePicker();\n timePicker.appendTo('#sf-timepicker');\n }\n\n // rendering date-time-picker control\n if (isFiltered('datetimepicker')) {\n var dateTimePicker = new ej.calendars.DateTimePicker();\n dateTimePicker.appendTo('#sf-datetimepicker');\n }\n\n // rendering date-range-picker control\n if (isFiltered('daterangepicker')) {\n var dateRangePicker = new ej.calendars.DateRangePicker();\n dateRangePicker.appendTo('#sf-daterangepicker');\n }\n\n // rendering button controls\n if (isFiltered('button')) {\n var normalButton = new ej.buttons.Button({});\n normalButton.appendTo('#sf-normal-button');\n var primaryButton = new ej.buttons.Button({ isPrimary: true });\n primaryButton.appendTo('#sf-primary-button');\n var outlineButton = new ej.buttons.Button({ cssClass: 'e-outline', isPrimary: true });\n outlineButton.appendTo('#sf-outline-button');\n var successButton = new ej.buttons.Button({ cssClass: 'e-success' });\n successButton.appendTo('#sf-success-button');\n var warningButton = new ej.buttons.Button({ cssClass: 'e-warning' });\n warningButton.appendTo('#sf-warning-button');\n var toggleButton = new ej.buttons.Button({\n isToggle: true,\n cssClass: 'e-flat e-primary',\n iconCss: 'e-btn-sb-icons e-play-icon'\n });\n toggleButton.appendTo('#sf-toggle-button');\n toggleButton.element.onclick = function () {\n if (toggleButton.element.classList.contains('e-active')) {\n toggleButton.content = 'Pause';\n toggleButton.iconCss = 'e-btn-sb-icons e-pause-icon';\n } else {\n toggleButton.content = 'Play';\n toggleButton.iconCss = 'e-btn-sb-icons e-play-icon';\n }\n };\n }\n\n // rendering dropdown button controls\n if (isFiltered('drop-down-button')) {\n var dropDownButton = new ej.splitbuttons.DropDownButton({ items: window.dropDownButtonItems });\n dropDownButton.appendTo('#sf-drop-down-button');\n dropDownButton = new ej.splitbuttons.DropDownButton({ items: window.dropDownButtonItems, cssClass: 'e-caret-hide' });\n dropDownButton.appendTo('#sf-drop-down-button-custom');\n dropDownButton = new ej.splitbuttons.DropDownButton({\n cssClass: 'e-primary',\n iconCss: 'e-ddb-icons e-profile',\n items: window.dropDownButtonItems\n });\n dropDownButton.appendTo('#sf-drop-down-button-icon');\n }\n\n // rendering split button controls\n if (isFiltered('split-button')) {\n var splitButton = new ej.splitbuttons.SplitButton({ items: splitButtonItems, iconCss: 'e-btn-icons e-paste' });\n splitButton.appendTo('#sf-split-button-icons');\n splitButton = new ej.splitbuttons.SplitButton({ items: splitButtonItems, content: 'Paste', cssClass: 'e-primary' });\n splitButton.appendTo('#sf-split-button-primary');\n splitButton = new ej.splitbuttons.SplitButton({ items: splitButtonItems, content: 'Paste', iconCss: 'e-btn-icons e-paste' });\n splitButton.appendTo('#sf-split-button-context');\n }\n\n // rendering list view control\n if (isFiltered('listview')) {\n var listView = new ej.lists.ListView({\n dataSource: window.listData,\n fields: { groupBy: 'category' }\n });\n listView.appendTo('#sf-listview');\n }\n\n // rendering tree view control\n if (isFiltered('treeview')) {\n var treeView = new ej.navigations.TreeView({\n fields: {\n id: 'id',\n text: 'name',\n child: 'subChild',\n dataSource: window.hierarchicalData\n }\n });\n treeView.appendTo('#sf-treeview');\n }\n\n // rendering ribbon control\n if (isFiltered('ribbon')) {\n var fontSize = ['8', '9', '10', '11', '12', '14', '16', '18', '20', '22', '24', '26', '28', '36', '48', '72', '96'];\n var fontStyle = ['Algerian', 'Arial', 'Calibri', 'Cambria', 'Cambria Math', 'Courier New', 'Candara', 'Georgia', 'Impact', 'Segoe Print', 'Segoe Script', 'Segoe UI', 'Symbol', 'Times New Roman', 'Verdana', 'Windings'\n ];\n var tabs = [{\n header: \"Home\",\n groups: [{\n header: \"Clipboard\",\n showLauncherIcon: true,\n groupIconCss: 'e-icons e-paste',\n collections: [{\n items: [{\n type: 'SplitButton',\n simplifiedMode: 'Group',\n disabled: true,\n id: 'pastebtn',\n allowedSize: ej.ribbon.RibbonItemSize.Large,\n splitButtonSettings: {\n iconCss: 'e-icons e-paste',\n items: [{ text: 'Keep Source Format' }, { text: 'Merge format' }, { text: 'Keep text only' }],\n content: 'Paste'\n }\n }]\n }, {\n items: [{\n type: 'Button',\n buttonSettings: {\n content: 'Cut',\n iconCss: 'e-icons e-cut',\n clicked: function () { enablePaste(); },\n simplifiedMode: 'Popup'\n }\n }, {\n type: 'Button',\n buttonSettings: {\n simplifiedMode: 'Group',\n content: 'Copy',\n clicked: function () { enablePaste(); },\n iconCss: 'e-icons e-copy'\n }\n }, {\n type: 'Button',\n buttonSettings: {\n simplifiedMode: 'Auto',\n content: 'Format Painter',\n iconCss: 'e-icons e-format-painter'\n }\n }]\n },]\n }, {\n header: \"Font\",\n isCollapsible: false,\n enableGroupOverflow: true,\n orientation: 'Row',\n groupIconCss: 'e-icons e-bold',\n cssClass: 'font-group',\n collections: [{\n items: [{\n type: 'ComboBox',\n simplifiedMode:'Group',\n comboBoxSettings: {\n dataSource: fontStyle,\n index: 3,\n allowFiltering: true,\n width: '150px'\n }\n }, {\n type: 'ComboBox',\n simplifiedMode: 'Group',\n comboBoxSettings: {\n dataSource: fontSize,\n index: 3,\n width: '65px'\n }\n }]\n }, {\n items: [{\n type: 'ColorPicker',\n displayOptions: ej.ribbon.DisplayMode.Simplified,\n allowedSizes: ej.ribbon.RibbonItemSize.Small,\n colorPickerSettings: {\n value: '#123456',\n }\n },{\n type: 'Button',\n allowedSize: ej.ribbon.RibbonItemSize.Small,\n buttonSettings: {\n iconCss: 'e-icons e-bold'\n }\n }, {\n type: 'Button',\n allowedSize: ej.ribbon.RibbonItemSize.Small,\n buttonSettings: {\n iconCss: 'e-icons e-italic'\n }\n }, {\n type: 'Button',\n allowedSize: ej.ribbon.RibbonItemSize.Small,\n buttonSettings: {\n iconCss: 'e-icons e-underline'\n }\n },{\n allowedSize: ej.ribbon.RibbonItemSize.Small,\n type: 'Button',\n buttonSettings: {\n iconCss: 'e-icons e-strikethrough'\n }\n }, {\n allowedSize:ej.ribbon.RibbonItemSize.Small,\n type: 'Button',\n buttonSettings: {\n iconCss: 'e-icons e-change-case'\n }\n }\n ]\n }]\n }, {\n header: \"Editing\",\n groupIconCss: 'e-icons e-edit',\n orientation: 'Column',\n collections: [{\n items: [{\n type: 'SplitButton',\n splitButtonSettings: {\n iconCss: 'e-icons e-search',\n content: 'Find',\n items: [\n { text: 'Find', iconCss: 'e-icons e-search' },\n { text: 'Advanced find', iconCss: 'e-icons e-search' },\n { text: 'Go to', iconCss: 'e-icons e-arrow-right' }\n ]\n }\n }, {\n type: 'Button',\n buttonSettings: {\n content: 'Replace',\n iconCss: 'e-icons e-replace'\n }\n }, {\n type: 'SplitButton',\n splitButtonSettings: {\n iconCss: 'e-icons e-mouse-pointer',\n content: 'Select',\n items: [{ text: 'Select All' }, { text: 'Select Objects' }]\n }\n }]\n }]\n }, {\n header: \"Voice\",\n isCollapsible: false,\n groupIconCss: 'sf-icon-dictate',\n collections: [{\n items: [{\n type: 'SplitButton',\n allowedSizes: ej.ribbon.RibbonItemSize.Large,\n splitButtonSettings: {\n content: 'Dictate',\n iconCss: 'sf-icon-dictate',\n items: [{ text: 'Chinese' }, { text: 'English' }, { text: 'German' }, { text: 'French' }]\n }\n }]\n }]\n }, {\n header: \"Editor\",\n isCollapsible: false,\n groupIconCss: 'sf-icon-editor',\n collections: [{\n items: [{\n type: 'Button',\n allowedSizes: ej.ribbon.RibbonItemSize.Large,\n buttonSettings: {\n content: 'Editor',\n iconCss:'sf-icon-editor'\n }\n }]\n }]\n }, {\n header: \"Reuse Files\",\n isCollapsible: false,\n groupIconCss: 'sf-icon-reuse',\n collections: [{\n items: [{\n type: 'Button',\n allowedSizes: ej.ribbon.RibbonItemSize.Large,\n disabled: true,\n buttonSettings: {\n iconCss:'sf-icon-reuse',\n content: 'Reuse Files'\n }\n }]\n }]\n }]\n }, {\n header: 'Insert',\n groups: [{\n header: 'Tables',\n isCollapsible: false,\n collections: [{\n id: 'defaultcollection9',\n items: [{\n id: 'defaultitem18',\n simplifiedMode:'Group',\n type: 'SplitButton',\n allowedSizes: ej.ribbon.RibbonItemSize.Large,\n splitButtonSettings: {\n iconCss: 'e-icons e-table',\n content: 'Table',\n items: [\n { text: 'Insert Table' }, { text: 'Draw Table' },\n { text: 'Convert Table' }, { text: 'Excel SpreadSheet' }\n ]\n }\n }]\n }]\n }, {\n header: 'Illustrations',\n showLauncherIcon: true,\n orientation: 'Row',\n enableGroupOverflow: true,\n collections: [{\n items: [{\n type: 'SplitButton',\n splitButtonSettings: {\n content: 'Pictures',\n iconCss: 'e-icons e-image',\n items: [{ text: 'Stock Images' }, { text: 'This device' }, { text: 'Online Images' }]\n }\n }, {\n type: 'SplitButton',\n splitButtonSettings: {\n content: 'Shapes',\n iconCss:'sf-icon-shapes',\n items: [{ text: 'Lines' }, { text: 'Rectangles' }, { text: 'Basic Arrows' }, { text: 'Basic Shapes' }, { text: 'FlowChart' }]\n }\n }, {\n type: 'Button',\n buttonSettings: {\n content: '3D Models',\n iconCss:'sf-icon-3d-model'\n }\n }, {\n type: 'Button',\n buttonSettings: {\n iconCss: 'sf-icon-smart-art',\n content: 'SmartArt',\n }\n }, {\n type: 'Button',\n buttonSettings: {\n content: 'Chart',\n iconCss:'sf-icon-chart'\n }\n }, {\n type: 'Button',\n buttonSettings: {\n content: 'Screenshot',\n iconCss:'sf-icon-screenshot'\n }\n }]\n }]\n }, {\n header: 'Header & Footer',\n showLauncherIcon: true,\n orientation: 'Column',\n groupIconCss: 'e-icons e-table',\n collections: [{\n items: [{\n type: 'DropDown',\n dropDownSettings: {\n content: 'Header',\n iconCss: 'e-icons e-header',\n items: [{ text: 'Insert Header' }, { text: 'Edit Header' }, { text: 'Remove Header' }]\n }\n }, {\n type: 'DropDown',\n dropDownSettings: {\n iconCss: 'e-icons e-footer',\n content: 'Footer',\n items: [{ text: 'Insert Footer' }, { text: 'Edit Footer' }, { text: 'Remove Footer' }]\n }\n }, {\n type: 'DropDown',\n dropDownSettings: {\n content: 'Page Number',\n simplifiedMode:'Popup',\n iconCss: 'e-icons e-page-numbering',\n items: [{ text: 'Insert Top of page' }, { text: 'Insert Bottom of page' }, { text: 'Format Page Number' }, { text: 'Remove Page Number' }]\n }\n }]\n }]\n },\n {\n header: 'Comments',\n isCollapsible: false,\n collections: [{\n items: [{\n type: 'Button',\n allowedSizes: ej.ribbon.RibbonItemSize.Large,\n simplifiedMode:'Group',\n buttonSettings: {\n content: 'New Comment',\n iconCss: 'e-icons e-comment-add'\n }\n }]\n }]\n }, {\n header: 'Link',\n groupIconCss: 'e-icons e-link',\n isCollapsible: false,\n collections: [{\n items: [{\n type: 'DropDown',\n allowedSizes: ej.ribbon.RibbonItemSize.Large,\n dropDownSettings: {\n content: 'Link',\n iconCss: 'e-icons e-link',\n items: [{ text: 'Insert Link', iconCss: 'e-icons e-link' },\n { text: 'Recent Links', iconCss: 'e-icons e-clock' },\n { text: 'Bookmarks', iconCss: 'e-icons e-bookmark' }\n ]\n }\n }]\n }]\n }]\n }, {\n header: 'View',\n groups: [{\n header: 'Views',\n groupIconCss: 'e-icons e-print',\n orientation: 'Row',\n collections: [{\n items: [{\n type: 'Button',\n buttonSettings: {\n iconCss: 'sf-icon-read',\n content: 'Read Mode'\n }\n }, {\n type: 'Button',\n buttonSettings: {\n content: 'Print Layout',\n iconCss: 'e-print e-icons'\n }\n }, {\n type: 'Button',\n buttonSettings: {\n iconCss: 'sf-icon-web-layout',\n content: 'Web Layout'\n }\n }]\n }]\n }, {\n header: 'Zoom',\n orientation: 'Row',\n groupIconCss: 'e-icons e-zoom-to-fit',\n collections: [{\n items: [{\n type: 'Button',\n buttonSettings: {\n content: 'Zoom In',\n iconCss: 'e-icons e-zoom-in'\n }\n }, {\n type: 'Button',\n buttonSettings: {\n iconCss: 'e-icons e-zoom-out',\n content: 'Zoom Out'\n }\n }]\n }]\n }, {\n header: 'Show',\n isCollapsible: false,\n collections: [{\n items: [{\n type: 'CheckBox',\n checkBoxSettings: {\n label: 'Ruler',\n checked: false\n }\n }, {\n type: 'CheckBox',\n checkBoxSettings: {\n checked: false,\n label: 'Gridlines'\n }\n }, {\n type: 'CheckBox',\n checkBoxSettings: {\n label: 'Navigation Pane',\n checked: true\n }\n }]\n }]\n }, {\n header: 'Dark Mode',\n isCollapsible: false,\n collections: [{\n items: [{\n type: 'Button',\n allowedSizes: ej.ribbon.RibbonItemSize.Large,\n buttonSettings: {\n iconCss: 'sf-icon-mode',\n content: 'Dark Mode'\n }\n }]\n }]\n }]\n }];\n var menuItems = [\n { text: 'New', iconCss:'e-icons e-file-new', id: 'new' }, \n { text: 'Open', iconCss:'e-icons e-folder-open', id: 'open' },\n { text: 'Rename', iconCss:'e-icons e-rename', id: 'rename' },\n {\n text: 'Save as',\n iconCss:'e-icons e-save',\n id: 'save',\n items: [\n { text: 'Microsoft Word (.docx)', iconCss:'sf-icon-word', id: 'newword' },\n { text: 'Microsoft Word 97-2003(.doc)', iconCss:'sf-icon-word', id: 'oldword' },\n { text: 'Download as PDF', iconCss:'e-icons e-export-pdf', id: 'pdf' }\n ]\n }\n ];\n var files = ({\n header: 'File',\n menuItems: menuItems,\n visible: true\n });\n var ribbon = new ej.ribbon.Ribbon({\n tabs: tabs,\n fileMenu: files,\n });\n ribbon.appendTo(\"#sf-ribbon\");\n var isPasteDisabled = true; \n function enablePaste() { \n if (!isPasteDisabled) { return; } \n ribbon.enableItem('pastebtn');\n isPasteDisabled = false;\n }\n }\n\n // rendering bread crumb control\n if (isFiltered('breadcrumb')) {\n var items = [\n {\n iconCss: 'e-icons e-home',\n url: \"https://ej2.syncfusion.com/javascript/demos\",\n },\n {\n text: \"Components\",\n url: \"https://ej2.syncfusion.com/javascript/demos/#/material/grid/grid-overview\",\n },\n {\n text: \"Navigations\",\n url: \"https://ej2.syncfusion.com/javascript/demos/#/material/grid/menu/default\",\n },\n {\n text: \"Breadcrumb\",\n url: \"./breadcrumb/default\",\n }\n ];\n \n var breadCrumb = new ej.navigations.Breadcrumb({\n items: items,\n enableNavigation: false\n }, '#sf-breadcrumb');\n }\n\n // rendering carousel control\n if (isFiltered('carousel')) {\n var carouselObj = new ej.navigations.Carousel({\n cssClass: 'default-carousel',\n items: [\n { template: '<figure class=\"img-container\"><img src=\"../Images/carousel/bridge.jpg\" alt=\"bridge\" style=\"height:100%;width:100%;\" /><figcaption class=\"img-caption\">Golden Gate Bridge, San Francisco</figcaption></figure>' },\n { template: '<figure class=\"img-container\"><img src=\"../Images/carousel/trees.jpg\" alt=\"spring_trees\" style=\"height:100%;width:100%;\" /><figcaption class=\"img-caption\">Spring Flower Trees</figcaption></figure>' },\n { template: '<figure class=\"img-container\"><img src=\"../Images/carousel/waterfall.jpg\" alt=\"waterfall\" style=\"height:100%;width:100%;\" /><figcaption class=\"img-caption\">Oddadalen Waterfalls, Norway</figcaption></figure>' },\n { template: '<figure class=\"img-container\"><img src=\"../Images/carousel/sea.jpg\" alt=\"sea\" style=\"height:100%;width:100%;\" /><figcaption class=\"img-caption\">Anse Source d`Argent, Seychelles</figcaption></figure>' },\n { template: '<figure class=\"img-container\"><img src=\"../Images/carousel/rocks.jpeg\" alt=\"rocks\" style=\"height:100%;width:100%;\" /><figcaption class=\"img-caption\">Stonehenge, England</figcaption></figure>' }\n ]\n });\n carouselObj.appendTo('#sf-carousel');\n }\n\n // rendering sidebar control\n if (isFiltered('sidebar')) {\n var sidebar = new ej.navigations.Sidebar({\n showBackdrop: true,\n type: \"Push\",\n width: '280px'\n });\n sidebar.appendTo('#sf-sidebar');\n // Toggle(Open/Close) the sidebar\n document.getElementById('toggle').onclick = function() {\n sidebar.toggle();\n };\n\n // Close the sidebar\n document.getElementById('close').onclick = function() {\n sidebar.hide();\n };\n }\n\n // rendering accordion control\n if (isFiltered('accordion')) {\n var accordion = new ej.navigations.Accordion({\n items: [\n { header: 'Athletics', iconCss: 'e-athletics e-acrdn-icons', content: '#athletics', expanded: true },\n { header: 'Water Games', iconCss: 'e-water-game e-acrdn-icons', content: '#water-games' }\n ]\n });\n accordion.appendTo('#sf-accordion');\n }\n\n // rendering tab control\n if (isFiltered('tab')) {\n var tabs = new ej.navigations.Tab({\n items: window.tabItems\n });\n tabs.appendTo('#sf-tab');\n }\n\n // rendering schedule control\n if (isFiltered('schedule')) {\n var schedule = new ej.schedule.Schedule({\n height: '550px',\n selectedDate: new Date(2018, 1, 15),\n eventSettings: { dataSource: ej.base.extend([], window.scheduleData, null, true) }\n });\n schedule.appendTo('#sf-schedule');\n }\n\n // rendering checkbox controls\n if (isFiltered('check-box')) {\n var checkbox = new ej.buttons.CheckBox({ label: 'CheckBox', checked: true, });\n checkbox.appendTo('#sf-check-box-checked');\n checkbox = new ej.buttons.CheckBox({ label: 'Unchecked', checked: false, disabled: true });\n checkbox.appendTo('#sf-check-box-unchecked');\n checkbox = new ej.buttons.CheckBox({ label: 'Indeterminate', indeterminate: true, disabled: true });\n checkbox.appendTo('#sf-check-box-intermediate');\n }\n\n // rendering radio-button controls\n if (isFiltered('radio-button')) {\n var radioButton = new ej.buttons.RadioButton({\n checked: true,\n name: 'payment',\n value: 'credit/debit',\n label: 'Credit/Debit Card',\n });\n radioButton.appendTo('#sf-radio-button1');\n radioButton = new ej.buttons.RadioButton({ label: 'Net Banking', name: 'payment', value: 'netbanking' });\n radioButton.appendTo('#sf-radio-button2');\n radioButton = new ej.buttons.RadioButton({ label: 'Cash on Delivery', name: 'payment', value: 'cashondelivery' });\n radioButton.appendTo('#sf-radio-button3');\n }\n\n // rendering toolbar control\n if (isFiltered('toolbar')) {\n var toolbar = new ej.navigations.Toolbar({\n items: window.toolbarItems\n });\n toolbar.appendTo('#sf-toolbar');\n }\n\n // rendering file upload control\n if (isFiltered('uploader')) {\n var fileUpload = new ej.inputs.Uploader({\n autoUpload: false,\n dropArea: ej.base.select('#upload-area'),\n files: [\n { name: 'TypeScript Succintly', size: 12000, type: '.pdf' },\n { name: 'ASP.NET Webhooks', size: 500000, type: '.docx' },\n ],\n asyncSettings: {\n saveUrl: 'https://ej2.syncfusion.com/services/api/uploadbox/Save',\n removeUrl: 'https://ej2.syncfusion.com/services/api/uploadbox/Remove'\n }\n });\n fileUpload.appendTo('#sf-uploader');\n }\n\n // rendering context menu control \n if (isFiltered('context-menu')) {\n var contextMenu = new ej.navigations.ContextMenu({\n items: menuItems,\n target: '#sf-context-menu-target'\n });\n contextMenu.appendTo('#sf-context-menu');\n }\n\n // rendering tooltip control\n if (isFiltered('tooltip')) {\n var tooltipButton = new ej.buttons.Button();\n tooltipButton.appendTo('#sf-tooltip');\n var tooltip = new ej.popups.Tooltip({\n content: 'Lets go green & Save Earth !!!'\n });\n tooltip.appendTo('#sf-tooltip');\n }\n\n // rendering color-picker control\n if (isFiltered('color-picker')) {\n var colorPicker = new ej.inputs.ColorPicker({});\n colorPicker.appendTo('#sf-color-picker');\n }\n\n // rendering switch controls\n if (isFiltered('switch')) {\n var switchControl = new ejs.buttons.Switch({ checked: true });\n switchControl.appendTo('#sf-switch-checked');\n switchControl = new ejs.buttons.Switch({});\n switchControl.appendTo('#sf-switch-unchecked');\n }\n\n // rendering toast control\n if (isFiltered('toast')) {\n var toast = new ej.notifications.Toast({\n width: 230,\n height: 250,\n target: '#element',\n title: 'Anjolie Stokes',\n position: { X: 'Center', Y: 'Bottom' },\n content: '<p><img src=\"https://ej2.syncfusion.com/documentation/samples/toast/actionBtn-cs1/laura.png\"></p>',\n buttons: [{\n model: { content: 'Ignore' },\n click: () => toast.hide()\n }, {\n model: { content: 'reply' }\n }],\n beforeOpen: (e) => {\n e.cancel = toast.element.childElementCount > 0;\n }\n });\n toast.appendTo('#sf-toast');\n toast.show();\n ej.base.select('#sf-toast-button').onclick = () => toast.show();\n }\n\n // rendering rating control\n if(isFiltered('rating')) {\n var basic = new ej.inputs.Rating({});\n basic.appendTo('#sf-rating1');\n\n var reset = new ej.inputs.Rating({\n allowReset: true,\n value: 3.0\n });\n reset.appendTo('#sf-rating2');\n\n var single = new ej.inputs.Rating({\n enableSingleSelection: true,\n value: 3.0\n });\n single.appendTo('#sf-rating3');\n\n var read = new ej.inputs.Rating({\n readOnly: true,\n value: 3.0\n });\n read.appendTo('#sf-rating4');\n\n var disable = new ej.inputs.Rating({\n disabled: true,\n value: 3.0\n });\n disable.appendTo('#sf-rating5');\n\n var itemCount = new ej.inputs.Rating({\n itemsCount: 8,\n value: 3.0\n });\n itemCount.appendTo('#sf-rating6');\n }\n\n // rendering message control\n if (isFiltered('message')) {\n var showButton = new ej.buttons.Button({ content: 'Show Default Message', cssClass: \"e-outline e-primary msg-hidden\" });\n showButton.appendTo('#sf-btn1');\n showButton.element.onclick = function () {\n show(msgDefaultIcon, showButton);\n };\n\n var infoButton = new ej.buttons.Button({ content: 'Show Info Message', cssClass: \"e-outline e-primary e-info msg-hidden\" });\n infoButton.appendTo('#sf-btn2');\n infoButton.element.onclick = function () {\n show(msgInfoIcon, infoButton);\n }; \n\n var successButton = new ej.buttons.Button({ content: 'Show Success Message', cssClass: \"e-outline e-primary e-success msg-hidden\" });\n successButton.appendTo('#sf-btn3');\n successButton.element.onclick = function () {\n show(msgSuccessIcon, successButton);\n };\n\n var warningButton = new ej.buttons.Button({ content: 'Show Warning Message', cssClass: \"e-outline e-primary e-warning msg-hidden\" });\n warningButton.appendTo('#sf-btn4');\n warningButton.element.onclick = function () {\n show(msgWarningIcon, warningButton);\n };\n\n var errorButton = new ej.buttons.Button({ content: 'Show Error Message', cssClass: \"e-outline e-primary e-danger msg-hidden\" });\n errorButton.appendTo('#sf-btn5');\n errorButton.element.onclick = function () {\n show(msgErrorIcon, errorButton);\n };\n\n var msgDefaultIcon = new ej.notifications.Message({\n content: \"Editing is restricted\",\n showCloseIcon: true,\n closed: function () {\n showButton.element.classList.remove('msg-hidden');\n }\n });\n msgDefaultIcon.appendTo('#sf-msg_default_icon');\n\n var msgInfoIcon = new ej.notifications.Message({\n content: \"Please read the comments carefully\",\n severity: \"Info\",\n showCloseIcon: true,\n closed: function () {\n infoButton.element.classList.remove('msg-hidden');\n }\n }); \n msgInfoIcon.appendTo('#sf-msg_info_icon');\n\n var msgSuccessIcon = new ej.notifications.Message({\n content: \"Your message has been sent successfully\",\n severity: \"Success\",\n showCloseIcon: true,\n closed: function () {\n successButton.element.classList.remove('msg-hidden');\n }\n });\n msgSuccessIcon.appendTo('#sf-msg_success_icon');\n\n var msgWarningIcon = new ej.notifications.Message({\n content: \"There was a problem with your network connection\",\n severity: \"Warning\",\n showCloseIcon: true,\n closed: function () {\n warningButton.element.classList.remove('msg-hidden');\n }\n });\n msgWarningIcon.appendTo('#sf-msg_warning_icon');\n\n var msgErrorIcon = new ej.notifications.Message({\n content: \"A problem has been occurred while submitting your data\",\n severity: \"Error\",\n showCloseIcon: true,\n closed: function () {\n errorButton.element.classList.remove('msg-hidden');\n }\n }); \n msgErrorIcon.appendTo('#sf-msg_error_icon');\n function show(message, btn) {\n message.visible = true;\n btn.element.classList.add('msg-hidden');\n }\n }\n\n // rendering flaoting action button control\n if (isFiltered('floating-action-button')) {\n var fabObj = new ej.buttons.Fab({\n iconCss: 'e-icons e-plus',\n position:'BottomLeft',\n target: '#floating-action-button'\n });\n fabObj.appendTo('#sf-fab');\n var fabObj1 = new ej.buttons.Fab({\n iconCss: 'e-icons e-plus',\n content:'Add',\n target: '#floating-action-button'\n });\n fabObj1.appendTo('#sf-fab1');\n }\n\n //rendering speed dial control\n if(isFiltered('speed-dial')) {\n var itemlist = [\n { text: 'Cut', iconCss: 'e-icons e-cut' },\n { text: 'Copy', iconCss: 'e-icons e-copy' },\n { text: 'Paste', iconCss: 'e-icons e-paste' },\n ];\n var sdObj1 = new ej.buttons.SpeedDial({\n openIconCss: 'e-icons e-edit',\n target: '#speed-dial',\n items:itemlist,\n mode: \"Radial\"\n });\n sdObj1.appendTo('#sf-speeddial');\n var sdObj2 = new ej.buttons.SpeedDial({\n openIconCss: 'e-icons e-edit',\n target: '#speed-dial',\n content: \"Edit\",\n items:itemlist,\n position: \"BottomLeft\",\n });\n sdObj2.appendTo('#sf-speeddial1');\n }\n\n //rendering skeleton control\n\n if (isFiltered('skeleton')) {\n var skeletonCircleSmall = new ej.notifications.Skeleton({\n shape: 'Circle',\n width: \"2rem\"\n });\n skeletonCircleSmall.appendTo(\"#sf-skeletonCircleSmall\");\n\n var skeletonCircleMedium = new ej.notifications.Skeleton({\n shape: 'Circle',\n width: \"48px\"\n });\n skeletonCircleMedium.appendTo(\"#sf-skeletonCircleMedium\");\n\n var skeletonCircleLarge = new ej.notifications.Skeleton({\n shape: 'Circle',\n width: \"64px\"\n });\n skeletonCircleLarge.appendTo(\"#sf-skeletonCircleLarge\");\n\n var skeletonCircleLarger = new ej.notifications.Skeleton({\n shape: 'Circle',\n width: \"80px\"\n });\n skeletonCircleLarger.appendTo(\"#sf-skeletonCircleLarger\");\n\n var skeletonSquareSmall = new ej.notifications.Skeleton({\n shape: 'Square',\n width: \"2rem\"\n });\n skeletonSquareSmall.appendTo(\"#sf-skeletonSquareSmall\");\n\n var skeletonSquareMedium = new ej.notifications.Skeleton({\n shape: 'Square',\n width: \"48px\"\n });\n skeletonSquareMedium.appendTo(\"#sf-skeletonSquareMedium\");\n\n var skeletonSquareLarge = new ej.notifications.Skeleton({\n shape: 'Square',\n width: \"64px\"\n });\n skeletonSquareLarge.appendTo(\"#sf-skeletonSquareLarge\");\n\n var skeletonSquareLarger = new ej.notifications.Skeleton({\n shape: 'Square',\n width: \"80px\"\n });\n skeletonSquareLarger.appendTo(\"#sf-skeletonSquareLarger\");\n\n var skeletonText = new ej.notifications.Skeleton({\n width: \"100%\",\n height: \"15px\"\n });\n skeletonText.appendTo(\"#sf-skeletonText\");\n\n var skeletonTextMedium = new ej.notifications.Skeleton({\n width: \"30%\",\n height: \"15px\"\n });\n skeletonTextMedium.appendTo(\"#sf-skeletonTextMedium\");\n\n var skeletonTextSmall = new ej.notifications.Skeleton({\n width: \"15%\",\n height: \"15px\"\n });\n skeletonTextSmall.appendTo(\"#sf-skeletonTextSmall\");\n\n var skeletonTextMedium1 = new ej.notifications.Skeleton({\n width: \"60%\",\n height: \"15px\"\n });\n skeletonTextMedium1.appendTo(\"#sf-skeletonTextMedium1\");\n\n var skeletonTextSmall1 = new ej.notifications.Skeleton({\n width: \"15%\",\n height: \"15px\"\n });\n skeletonTextSmall1.appendTo(\"#sf-skeletonTextSmall1\");\n\n var skeletonRectangle = new ej.notifications.Skeleton({\n shape: 'Rectangle',\n width: '100%',\n height: '100px'\n });\n skeletonRectangle.appendTo(\"#sf-skeletonRectangle\");\n\n var skeletonRectangleMedium = new ej.notifications.Skeleton({\n shape: 'Rectangle',\n width: '20%',\n height: '35px'\n });\n skeletonRectangleMedium.appendTo(\"#sf-skeletonRectangleMedium\");\n\n var skeletonRectangleMediumRight = new ej.notifications.Skeleton({\n shape: 'Rectangle',\n width: '20%',\n height: '35px'\n });\n skeletonRectangleMediumRight.appendTo(\"#sf-skeletonRectangleMediumRight\");\n }\n\n // rendering appbar control\n if (isFiltered('appbar')) {\n var lightAppBarObj = new ej.navigations.AppBar({\n colorMode: 'Light'\n });\n lightAppBarObj.appendTo('#lightAppBar');\n \n var lightButtonMenuObj = new ej.buttons.Button({ cssClass: 'e-inherit menu', iconCss: 'e-icons e-menu' });\n lightButtonMenuObj.appendTo('#lightButtonMenu');\n \n var lightButtonLoginObj = new ej.buttons.Button({ cssClass: 'e-inherit login', content: 'FREE TRIAL' });\n lightButtonLoginObj.appendTo('#lightButtonLogin');\n \n var darkAppBarObj = new ej.navigations.AppBar({\n colorMode: 'Dark'\n });\n darkAppBarObj.appendTo('#darkAppBar');\n \n var darkButtonMenuObj = new ej.buttons.Button({ cssClass: 'e-inherit menu', iconCss: 'e-icons e-menu' });\n darkButtonMenuObj.appendTo('#darkButtonMenu');\n \n var darkButtonLoginObj = new ej.buttons.Button({ cssClass: 'e-inherit login', content: 'FREE TRIAL' });\n darkButtonLoginObj.appendTo('#darkButtonLogin');\n \n var primaryAppBarObj = new ej.navigations.AppBar({\n colorMode: 'Primary',\n });\n primaryAppBarObj.appendTo('#primaryAppBar');\n \n var primaryButtonMenuObj = new ej.buttons.Button({ cssClass: 'e-inherit menu', iconCss: 'e-icons e-menu' });\n primaryButtonMenuObj.appendTo('#primaryButtonMenu');\n \n var primaryButtonLoginObj = new ej.buttons.Button({ cssClass: 'e-inherit login', content: 'FREE TRIAL' });\n primaryButtonLoginObj.appendTo('#primaryButtonLogin');\n }\n\n //rendering mention control\n if (isFiltered('mention')) {\n // Initialize Textbox component.\n window.emailData = [\n { Name: 'Selma Rose', Eimg: '7', EmailId: 'selma@gmail.com' }, \n { Name: 'Russo Kay', Eimg: '8', EmailId: 'russo@gmail.com' },\n { Name: 'Camden Kate', Eimg: '9', EmailId: 'camden@gmail.com' },\n { Name: 'Garth', Eimg: '3', EmailId: 'garth@gmail.com' }, \n { Name: 'Ursula Ann', Eimg: '10', EmailId: 'ursula@gmail.com' },\n { Name: 'Margaret', Eimg: '5', EmailId: 'margaret@gmail.com' }, \n { Name: 'Laura Grace', Eimg: '7', EmailId: 'laura@gmail.com' },\n { Name: 'Robert', Eimg: '8', EmailId: 'robert@gmail.com' }, \n { Name: 'Albert', Eimg: '9', EmailId: 'albert@gmail.com' },\n { Name: 'Michale', Eimg: '10', EmailId: 'michale@gmail.com' }, \n { Name: 'Andrew James', Eimg: '3', EmailId: 'james@gmail.com' },\n { Name: 'William', Eimg: '4', EmailId: 'william@gmail.com' }, \n { Name: 'David', Eimg: '5', EmailId: 'david@gmail.com' },\n { Name: 'Richard Rose', Eimg: '7', EmailId: 'richard@gmail.com' }, \n { Name: 'Joseph', Eimg: '8', EmailId: 'joseph@gmail.com' },\n { Name: 'Thomas', Eimg: '9', EmailId: 'thomas@gmail.com' }, \n { Name: 'Charles Danny', Eimg: '10', EmailId: 'charles@gmail.com' },\n { Name: 'Daniel', Eimg: '3', EmailId: 'daniel@gmail.com' }, \n { Name: 'Matthew', Eimg: '2', EmailId: 'matthew@gmail.com' },\n { Name: 'Donald Krish', Eimg: '1', EmailId: 'donald@gmail.com' },\n { Name: 'Paul', Eimg: '4', EmailId: 'paul@gmail.com' },\n { Name: 'Kevin Paul', Eimg: '5', EmailId: 'kevin@gmail.com' }\n ];\n \n var emailTextbox = new ej.inputs.TextBox({\n placeholder: 'Type @ and tag the email'\n });\n emailTextbox.appendTo('#emailsMention');\n\n\t // Initialize Mention component.\n var emailObj = new ej.dropdowns.Mention({\n dataSource: window.emailData,\n fields: { text: 'EmailId' }\n });\n emailObj.appendTo('#emailsMention');\n\n var messageData = new ej.dropdowns.Mention({\n dataSource: window.emailData,\n fields: { text: 'Name' }\n });\n messageData.appendTo('#commentsMention');\n }\n\n //rendering image editor control\n if (isFiltered('image-editor')) {\n var imageEditorObj = new ej.imageeditor.ImageEditor({\n width: '100%',\n height: '100%',\n created: function () {\n if (ej.base.Browser.isDevice) {\n imageEditorObj.open('../Images/image-editor/horizontal.jpg');\n } else {\n imageEditorObj.open('../Images/image-editor/vertical.jpg');\n }\n imageEditorObj.theme = window.location.href.split('theme=')[1];\n }\n });\n imageEditorObj.appendTo('#sf-imageeditor');\n }\n // rendering rich-text-editor control\n if (isFiltered('rich-text-editor')) {\n var richTextEditor = new ej.richtexteditor.RichTextEditor({\n toolbarSettings: {\n items: ['Bold', 'Italic', 'Underline', 'StrikeThrough',\n 'FontName', 'FontSize', 'FontColor', 'BackgroundColor',\n 'LowerCase', 'UpperCase', '|',\n 'Formats', 'Alignments', 'OrderedList', 'UnorderedList',\n 'Outdent', 'Indent', '|',\n 'CreateLink', 'Image', '|', 'ClearFormat', 'Print',\n 'SourceCode', 'FullScreen', '|', 'Undo', 'Redo']\n }\n });\n richTextEditor.appendTo('#sf-rich-text-editor');\n }\n\n // rendering progress button controls\n if (isFiltered('progress-button')) {\n var progressButton = new ej.splitbuttons.ProgressButton({\n content: 'Spin Left', isPrimary: true\n });\n progressButton.appendTo('#sf-progress-button-left');\n progressButton = new ej.splitbuttons.ProgressButton({\n content: 'Spin Right', spinSettings: { position: 'Right' }, isPrimary: true\n });\n progressButton.appendTo('#sf-progress-button-right');\n progressButton = new ej.splitbuttons.ProgressButton({\n content: 'Download', duration: 4000, enableProgress: true,\n cssClass: 'e-hide-spinner e-progress-top', iconCss: 'e-btn-sb-icons e-download-icon'\n });\n progressButton.appendTo('#sf-progress-button-download');\n progressButton = new ej.splitbuttons.ProgressButton({ content: 'Disabled', disabled: true });\n progressButton.appendTo('#sf-progress-button-disabled');\n }\n\n // rendering menu control\n if (isFiltered('menu')) {\n var menu = new ej.navigations.Menu({\n items: window.menuItems\n });\n menu.appendTo('#sf-menu');\n }\n\n // rendering pivot-view control\n if (isFiltered('pivotview')) {\n var pivotGridObj = new ej.pivotview.PivotView({\n height: 600,\n width: '100%',\n showFieldList: true,\n showGroupingBar: true,\n allowCalculatedField: true,\n gridSettings: { columnWidth: 140 },\n dataSourceSettings: {\n filters: [],\n expandAll: true,\n enableSorting: true,\n dataSource: window.pivotData,\n valueSortSettings: { headerDelimiter: ' - ' },\n columns: [{ name: 'Year' }, { name: 'Quarter' }],\n rows: [{ name: 'Country' }, { name: 'Products' }],\n formatSettings: [{ name: 'Amount', format: 'C0' }],\n values: [{ name: 'Sold', caption: 'Units Sold' }, { name: 'Amount', caption: 'Sold Amount' }]\n }\n });\n pivotGridObj.appendTo('#sf-pivotview');\n }\n\n // rendering tree-grid control\n if (isFiltered('treegrid')) {\n var treeGridData = new ej.data.DataManager({\n crossDomain: true,\n adaptor: new ej.data.WebApiAdaptor(),\n url: 'https://ej2services.syncfusion.com/production/web-services/api/SelfReferenceData'\n });\n var treeGrid = new ej.treegrid.TreeGrid({\n height: 260,\n height: 380,\n allowPaging: true,\n treeColumnIndex: 1,\n idMapping: 'TaskID',\n dataSource: treeGridData,\n hasChildMapping: 'isParent',\n parentIdMapping: 'ParentItem',\n columns: [\n { field: 'TaskID', headerText: 'Task ID', width: 80, textAlign: 'Right' },\n { field: 'TaskName', headerText: 'Task Name', width: 200, textAlign: 'Left' },\n { field: 'StartDate', headerText: 'Start Date', width: 90, textAlign: 'Right', type: 'date', format: 'yMd' },\n { field: 'Duration', headerText: 'Duration', width: 90, textAlign: 'Right' },\n ]\n });\n treeGrid.appendTo('#sf-treegrid');\n }\n\n // rendering in-place editor control\n if (isFiltered('inplace-editor')) {\n var inPlaceEditor = new ej.inplaceeditor.InPlaceEditor({\n type: 'Text',\n mode: 'Inline',\n value: 'Andrew',\n submitOnEnter: true,\n model: {\n placeholder: 'Enter employee name'\n }\n });\n inPlaceEditor.appendTo('#sf-inplace-editor');\n }\n\n // rendering splitter control\n if (isFiltered('splitter')) {\n var splitter = new ej.layouts.Splitter({\n height: '110px',\n width: '100%',\n separatorSize: 4,\n paneSettings: [\n { size: '25%', min: '60px' },\n { size: '50%', min: '60px' },\n { size: '25%', min: '60px' }\n ]\n });\n splitter.appendTo('#sf-splitter');\n }\n\n // rendering pdf-viewer control\n if (isFiltered('pdfviewer')) {\n var pdfViewer = new ej.pdfviewer.PdfViewer({\n documentPath: 'PDF_Succinctly.pdf',\n serviceUrl: 'https://ej2services.syncfusion.com/production/web-services/api/pdfviewer'\n });\n ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation);\n pdfViewer.appendTo('#Component-pdfviewer');\n }\n\n // rendering document editor control\n if (isFiltered('document-editor')) {\n var documenteditor = new ej.documenteditor.DocumentEditor({ isReadOnly: false });\n documenteditor.acceptTab = true;\n documenteditor.enableAllModules();\n documenteditor.pageOutline = '#E0E0E0';\n\n //Documenteditor control rendering starts\n documenteditor.appendTo('#Component-documenteditor');\n }\n\n // rendering query builder control\n if (isFiltered('query-builder')) {\n var importRules = {\n 'condition': 'and',\n 'rules': [{\n 'label': 'Employee ID',\n 'field': 'EmployeeID',\n 'type': 'number',\n 'operator': 'equal',\n 'value': 1\n },\n {\n 'label': 'Title',\n 'field': 'Title',\n 'type': 'string',\n 'operator': 'equal',\n 'value': 'Sales Manager'\n }]\n };\n var columnData = [\n { field: 'EmployeeID', label: 'Employee ID', type: 'number' },\n { field: 'FirstName', label: 'First Name', type: 'string' },\n { field: 'TitleOfCourtesy', label: 'Title Of Courtesy', type: 'boolean', values: ['Mr.', 'Mrs.'] },\n { field: 'Title', label: 'Title', type: 'string' },\n { field: 'HireDate', label: 'Hire Date', type: 'date', format: 'dd/MM/yyyy' },\n { field: 'Country', label: 'Country', type: 'string' },\n { field: 'City', label: 'City', type: 'string' }\n ];\n var queryBuilder = new ej.querybuilder.QueryBuilder({\n width: '100%',\n rule: importRules,\n columns: columnData,\n dataSource: window.queryBuilderData\n });\n queryBuilder.appendTo('#sf-query-builder');\n }\n\n // rendering chips control\n if (isFiltered('chips')) {\n var chips = new ej.buttons.ChipList({ chips: window.chipsData.defaultData });\n chips.appendTo('#sf-chips');\n }\n\n // rendering list-box control\n if (isFiltered('list-box')) {\n var listBox = new ej.dropdowns.ListBox({\n dataSource: window.listBoxData,\n fields: { text: 'text', value: 'id' },\n selectionSettings: { type: 'CheckBox' }\n });\n listBox.appendTo('#sf-list-box');\n }\n\n // rendering file manager control\n if (isFiltered('file-manager')) {\n var hostUrl = 'https://ej2services.syncfusion.com/production/web-services/';\n var fileManager = new ej.filemanager.FileManager({\n view: 'Details',\n ajaxSettings: {\n url: hostUrl + 'api/FileManager/FileOperations',\n getImageUrl: hostUrl + 'api/FileManager/GetImage',\n uploadUrl: hostUrl + 'api/FileManager/Upload',\n downloadUrl: hostUrl + 'api/FileManager/Download'\n }\n });\n fileManager.appendTo('#sf-file-manager');\n }\n\n // rendering gantt control\n if (isFiltered('gantt')) {\n var ganttChart = new ej.gantt.Gantt({\n height: '450px',\n highlightWeekends: true,\n dataSource: projectNewData,\n labelSettings: {\n leftLabel: 'TaskName'\n },\n taskFields: {\n id: 'TaskID',\n name: 'TaskName',\n child: 'subtasks',\n endDate: 'EndDate',\n duration: 'Duration',\n progress: 'Progress',\n startDate: 'StartDate',\n dependency: 'Predecessor',\n },\n eventMarkers: [\n {\n day: new Date('04/09/2019'),\n label: 'Research phase'\n }, {\n day: new Date('04/30/2019'),\n label: 'Design phase'\n }, {\n day: new Date('05/23/2019'),\n label: 'Production phase'\n }, {\n day: new Date('06/20/2019'),\n label: 'Sales and marketing phase'\n }\n ]\n });\n ganttChart.appendTo('#sf-gantt');\n }\n\n // rendering spread-sheet control\n if (isFiltered('spreadsheet')) {\n var spreadSheet = new ej.spreadsheet.Spreadsheet({\n sheets: [\n {\n name: 'Car Sales Report',\n ranges: [{ dataSource: defaultData }],\n rows: [\n {\n index: 30,\n cells: [\n { index: 4, value: 'Total Amount:', style: { fontWeight: 'bold', textAlign: 'right' } },\n { formula: '=SUM(F2:F30)', style: { fontWeight: 'bold' } },\n ]\n }\n ],\n columns: [\n { width: 180 }, { width: 130 }, { width: 130 }, { width: 180 },\n { width: 130 }, { width: 120 }\n ]\n }\n ],\n openUrl: 'https://ej2services.syncfusion.com/production/web-services/api/spreadsheet/open',\n saveUrl: 'https://ej2services.syncfusion.com/production/web-services/api/spreadsheet/save',\n created: function () {\n spreadSheet.cellFormat({ fontWeight: 'bold', textAlign: 'center', verticalAlign: 'middle' }, 'A1:F1');\n spreadSheet.numberFormat('$#,##0.00', 'F2:F31');\n }\n });\n spreadSheet.appendTo('#sf-spreadsheet');\n }\n\n // rendering dashboard-layout control\n if (isFiltered('dashboard-layout')) {\n var dashboard = new ej.layouts.DashboardLayout({\n cellSpacing: [15, 15],\n columns: 4,\n allowResizing: true,\n });\n dashboard.appendTo('#defaultLayout');\n var dashboardObject = document.getElementById('defaultLayout').ej2_instances[0];\n }\n // rendering spinner control\n if (isFiltered('spinner')) {\n ej.popups.createSpinner({\n target: ej.base.select('#sf-spinner')\n });\n ej.popups.showSpinner(ej.base.select('#sf-spinner'));\n }\n\n // rendering kanban control\n if (isFiltered('kanban')) {\n var kanban = new ej.kanban.Kanban({\n keyField: 'Status',\n dataSource: kanbanData,\n cardSettings: {\n headerField: 'Id',\n contentField: 'Summary'\n },\n columns: [\n { headerText: 'To Do', keyField: 'Open' },\n { headerText: 'In Progress', keyField: 'InProgress' },\n { headerText: 'Testing', keyField: 'Testing' },\n { headerText: 'Done', keyField: 'Close' }\n ]\n });\n kanban.appendTo('#sf-kanban');\n }\n}", "title": "" }, { "docid": "91fda051d466da1649976ef5756fba81", "score": "0.5759881", "text": "componentDidUpdate() {\n this.renderGraph();\n }", "title": "" }, { "docid": "64bb558ff3550ea3a6e19aebb08fe469", "score": "0.5747437", "text": "handleMouseWheelEvent(event) {\n event.preventDefault();\n let zoomIntensity = .02;\n let br = this.rect.root.getBoundingClientRect();\n let x = event.clientX - br.left;\n let y = event.clientY - br.top;\n let wheel = event.deltaY < 0 ? 1 : -1;\n let zoom = Math.exp(wheel * zoomIntensity);\n // transform the internal coordinate system\n let deltaX = x / (this.scaleX * zoom) - x / this.scaleX;\n let deltaY = y / (this.scaleY * zoom) - y / this.scaleY;\n this.internalX -= deltaX;\n this.internalY -= deltaY;\n this.scaleX *= zoom;\n this.scaleY *= zoom;\n this.visibleWidth = this._width / this.scaleX;\n this.visibleHeight = this._height / this.scaleY;\n // update the elements in the static (svg) coordinate system\n this._x = this.internalX * this.scaleX;\n this._y = this.internalY * this.scaleY;\n // update the position of the display circle\n if (this.displayCircle != undefined) {\n this.displayCircle.cx = event.clientX - br.left + this._x;\n }\n // redraw visual elements\n this.drawGrid();\n this.draw();\n }", "title": "" }, { "docid": "828c93c1764a40939404e0f30b21fc28", "score": "0.5586908", "text": "render() {\n const graph = graphs.buildGraphFromNetwork(\n this.props.compressed_network,\n this.props.layer_extreme_dimensions,\n this.props.preferences\n );\n var nodes = [];\n graph.nodes().forEach(function (e) {\n nodes.push(graph.node(e));\n });\n var edges = [];\n graph.edges().forEach(function (e) {\n edges.push({ v: e.v, w: e.w, points: graph.edge(e) });\n });\n const group_t = this.props.group_transform;\n const layer_types_settings = this.props.layer_types_settings;\n var networkElement = document.getElementById(\"networkComponent\"); // Get the main SVG Element\n var centerTransformation = { x: 0, y: 0 }; // Transformation to center the Graph initially\n if (this.props.network_bbox.x !== undefined) {\n // If the elements exist already\n centerTransformation.x =\n networkElement.getBoundingClientRect().width / 2.0 -\n (this.props.network_bbox.width * group_t.scale) / 2.0 -\n this.props.network_bbox.x * group_t.scale; // Transformation to center the graph in x direction\n centerTransformation.y =\n networkElement.getBoundingClientRect().height / 2.0 -\n (this.props.network_bbox.height * group_t.scale) / 2.0 -\n this.props.network_bbox.y * group_t.scale; // Transformation to center the graph in y direction\n }\n const transform = `translate(${group_t.x + centerTransformation.x}, ${\n group_t.y + centerTransformation.y\n }) scale(${group_t.scale})`; // Manipulate the position of the graph\n return (\n <g id=\"main_group\" transform={transform}>\n {nodes.map((layer) => (\n <Edges layer={layer} key={layer.layer.id} edges={edges} />\n ))}\n {nodes.map((layer) => (\n <Layer\n layer={layer}\n settings={layer_types_settings[layer.layer.name]}\n key={layer.layer.id}\n edges={edges}\n complexAction={this.complexSelectionTriggered}\n />\n ))}\n </g>\n );\n }", "title": "" }, { "docid": "802d89dba56faa10300acde37c6b07bd", "score": "0.5572815", "text": "zoomIn(amount) { this.renderer.zoomIn(amount); }", "title": "" }, { "docid": "676308fc3177e0a49f654664240cdc84", "score": "0.5564386", "text": "componentDidUpdate() {\n this.drawGraph();\n }", "title": "" }, { "docid": "c9aec36ba4364c5f2d6257a3d88a867e", "score": "0.5549172", "text": "onResize() {\n this.chartComponent.current.chart.reflow();\n }", "title": "" }, { "docid": "c9aec36ba4364c5f2d6257a3d88a867e", "score": "0.5549172", "text": "onResize() {\n this.chartComponent.current.chart.reflow();\n }", "title": "" }, { "docid": "c9aec36ba4364c5f2d6257a3d88a867e", "score": "0.5549172", "text": "onResize() {\n this.chartComponent.current.chart.reflow();\n }", "title": "" }, { "docid": "170da56c1dcba6f239d19de30ad09e37", "score": "0.5531875", "text": "[_resize] () {\n this.renderer.setSize(window.innerWidth, window.innerHeight)\n if (this[_usePost]) {\n this.composer.setSize(window.innerWidth, window.innerHeight)\n }\n this[_updateControls]()\n }", "title": "" }, { "docid": "da6971d216a03c3e15afd75cf8b2d43e", "score": "0.549034", "text": "refreshGraphs() {\n this.containers.forEach((container) => {\n // container.clearChildren(); // hackfix: brute-force this\n container.refreshGraph();\n });\n }", "title": "" }, { "docid": "58572902a420b8a995243cd78be6e56d", "score": "0.5489698", "text": "function ZoomControls (props) {\n const { map } = props\n\n let mouseDownTime\n\n let mouseDownTimeout\n\n let repeatTimeout\n const zoom = direction => {\n const delta = direction === 'ZOOM_IN' ? 0.1 : -0.1\n\n zoomDelta(map, delta, 350)\n }\n const repeatZoom = direction => {\n zoom(direction)\n repeatTimeout = setTimeout(() => repeatZoom(direction), 350)\n }\n const handleMouseDown = direction => {\n mouseDownTime = Date.now()\n zoom(direction)\n mouseDownTimeout = setTimeout(() => {\n repeatZoom(direction)\n }, 200)\n }\n const stopZoom = direction => {\n if (Date.now() - mouseDownTime < 150) {\n zoom(direction)\n clearTimeout(mouseDownTimeout)\n }\n clearTimeout(repeatTimeout)\n }\n\n return (\n <IconsContainer>\n <Icon\n id='_ol_kit_zoom_in'\n onMouseDown={() => handleMouseDown('ZOOM_IN')}\n onMouseOut={() => stopZoom('ZOOM_IN')}\n onMouseUp={() => stopZoom('ZOOM_IN')}>\n <PLUS />\n </Icon>\n <IconSeparator />\n <Icon\n id='_ol_kit_zoom_out'\n onMouseDown={() => handleMouseDown('ZOOM_OUT')}\n onMouseOut={() => stopZoom('ZOOM_OUT')}\n onMouseUp={() => stopZoom('ZOOM_OUT')}>\n <MINUS />\n </Icon>\n </IconsContainer>\n )\n}", "title": "" }, { "docid": "85e6477d76a8e51d838ce741bc4d21dc", "score": "0.5454914", "text": "function resizeChart() {\n var currentHeight;\n var currentWidth;\n // make sure the tick ends before changing the layout\n force.stop();\n\n // for category view, change the horizontal position of the groups and labels\n currentWidth = container.width();\n currentHeight = container.height();\n\n if (currentWidth > initialWidth || currentHeight > initialHeight) {\n if (currentWidth > width) {\n svg.style('width', currentWidth + 'px');\n center.x = currentWidth / 2;\n container[0].scrollLeft = (currentWidth - w) / 2;\n } else {\n svg.style('width', width + 'px');\n center.x = width / 2;\n container[0].scrollLeft = (width - w) / 2;\n }\n\n if (scope.toggleView === 'category') {\n if (currentHeight > newHeight) {\n svg.style('height', currentHeight + 'px');\n center.y = currentHeight / 2;\n container[0].scrollTop = (currentHeight - newHeight) / 2;\n } else {\n svg.style('height', newHeight + 'px');\n center.y = newHeight / 2;\n container[0].scrollTop = (newHeight - h) / 2;\n }\n } else {\n if (currentHeight > height) {\n svg.style('height', currentHeight + 'px');\n center.y = currentHeight / 2;\n container[0].scrollTop = (currentHeight - h) / 2;\n } else {\n svg.style('height', height + 'px');\n center.y = height / 2;\n container[0].scrollTop = (height - h) / 2;\n }\n }\n } else {\n if (scope.toggleView === 'category') {\n if (currentWidth > newWidth) {\n // use container width\n svg.style('width', currentWidth + 'px');\n center.x = currentWidth / 2;\n container[0].scrollLeft = (currentWidth - newWidth) / 2;\n } else {\n // use svg width\n svg.style('width', newWidth + 'px');\n center.x = newWidth / 2;\n container[0].scrollLeft = (newWidth - currentWidth) / 2;\n }\n\n if (currentHeight > newHeight) {\n // use container height\n svg.style('height', currentHeight + 'px');\n center.y = currentHeight / 2;\n container[0].scrollTop = (currentHeight - newHeight) / 2;\n } else {\n // use svg height\n svg.style('height', newHeight + 'px');\n center.y = newHeight / 2;\n container[0].scrollTop = (newHeight - currentHeight) / 2;\n }\n } else {\n if (w > width) {\n // use container width\n svg.style('width', currentWidth + 'px');\n center.x = currentWidth / 2;\n container[0].scrollLeft = (currentWidth - width) / 2;\n } else {\n // use svg width\n svg.style('width', width + 'px');\n center.x = width / 2;\n container[0].scrollLeft = (width - currentWidth) / 2;\n }\n\n if (currentHeight > height) {\n // use container height\n svg.style('height', currentHeight + 'px');\n center.y = currentHeight / 2;\n container[0].scrollTop = (currentHeight - height) / 2;\n } else {\n // use svg height\n svg.style('height', height + 'px');\n center.y = height / 2;\n container[0].scrollTop = (height - currentHeight) / 2;\n }\n }\n }\n\n if (scope.toggleView === 'category') {\n displayByCategory();\n }\n\n if (g.isSkillDetailView === true) {\n svg.style('height', currentHeight + 'px');\n svg.style('width', currentWidth + 'px');\n }\n\n force.start();\n }", "title": "" }, { "docid": "2175ae34b56d240c4509f3cea70e45ae", "score": "0.5454221", "text": "updateView() {\n\n this.chart.update(0);\n this.updateZoomPanLimits();\n }", "title": "" }, { "docid": "224bae6a3f07621f03354e1495a41d15", "score": "0.5443469", "text": "function resizeGraphContainer(){\n let containerHeight = d3.select('#graphContainer').style('height')\n containerHeight = +(containerHeight.split('px')[0])\n let windowHeight = window.innerHeight\n let scaling = (windowHeight / containerHeight)*0.8;\n\n d3.select('#graphContainer').style('transform', `scale(${scaling}) translate(0,-50%)`)\n}", "title": "" }, { "docid": "3751542582be90659f031c8f48b27095", "score": "0.5426926", "text": "function draw_contender_power_graph(){\n\t\t\tchart.setOption('width' , $('#power_graph').width());\n\t\t\tvar dashboard = new google.visualization.Dashboard(document.getElementById('power_graph'));\n\t\t\tdashboard.bind(rank_slider, chart);\n\t\t\tdashboard.draw(data);\n\t\t}", "title": "" }, { "docid": "4ce3174e920723461751d88b78c0e3bd", "score": "0.54016316", "text": "render() {\n\n\t \tconst headerStatus = this.buildHeaderStatus();\n\n\t \tconst bankselection = this.buildBankList()\n\n\t \tconst hoveredArea = this.buildAreaHover();\n\n\t \tconst mapArea = this.buildMap();\n\n\n\t \t// get engine parameter\n\t \tlet engineType = \"\"\n\t \tlet switchTo = \"\"\n\t \tif(this.state.engine === 'cudf'){\n\t \t\tengineType = \"gpu\"\n\t \t\tswitchTo = \"cpu\"\n\t \t} else if(this.state.engine === 'pandas'){\n\t \t\tengineType = \"cpu\"\n\t \t\tswitchTo = \"gpu\"\n\t \t}\n\n\t \t// calculate % of data frame shown\n\t \tlet percentDP = 0;\n\t \tif(this.state.currentDP > 0){\n\t \t\t percentDP = (this.state.currentDP / this.state.totalDP) * 100\n\t \t\tpercentDP = percentDP.toFixed(2)\n\t \t}\n\n\t\treturn (\n\n\t\t\t<main className=\"mapchart\">\n\n\t\t\t <div className=\"mapchart-legend-container\">\n\n\t\t\t \t<div className=\"mapchart-legend-button\" onClick={this.switchMode}>switch to {switchTo} engine</div>\n\n\t \t\t\t <div className=\"mapchart-legend-section\">\n\t\t\t \t\t<div className=\"mapchart-legend-heading\">selected bank</div>\n\t\t\t\t\t\t{bankselection}\n\t\t\t \t</div>\n\n\t\t\t \t<div className=\"mapchart-legend-section-dial\">\n\t\t\t \t\t<div className=\"mapchart-legend-section-2col\">\n\t\t\t\t \t\t<div className=\"mapchart-legend-heading\">opacity</div>\n\t\t\t\t\t \t<CircleSlider value={this.state.mapOpacity} onChange={this.mapOpacitySelection} min={10} max={255} stepSize={5}\n\t \t\t\t \t size={80} circleWidth={5} progressWidth={7} knobRadius={7} circleColor={\"gray\"} progressColor={\"#177be4\"} knobColor={\"#177be4\"} />\n\t \t\t\t \t <div className=\"mapchart-circ-value\">{this.state.mapOpacity}</div>\n\t\t\t \t\t</div>\n\t\t\t \t\t<div className=\"mapchart-legend-section-2col\">\n\t\t\t \t\t<div className=\"mapchart-legend-heading\">scale</div>\n\t\t\t\t\t \t<CircleSlider value={this.state.mapScale} onChange={this.mapScaleSelection} min={1} max={100} stepSize={1}\n\t \t\t\t \t size={80} circleWidth={5} progressWidth={7} knobRadius={7} circleColor={\"gray\"} progressColor={\"#177be4\"} knobColor={\"#177be4\"} />\n\t \t\t\t \t <div className=\"mapchart-circ-value\">{this.state.mapScale}</div>\n\t\t\t \t\t</div>\n\t\t\t \t</div>\n\n\t \t\t\t<div className=\"mapchart-legend-section-dial\">\n\t\t\t \t\t<div className=\"mapchart-legend-section-1col\">\n\t\t\t \t\t\t<div className=\"mapchart-legend-heading\">dti bins</div>\n\t\t\t\t\t \t<CircleSlider value={this.state.chart2Bins} onChange={this.chart2BinSelection} min={1} max={100} stepSize={1}\n\t \t\t\t \t size={80} circleWidth={5} progressWidth={7} knobRadius={7} circleColor={\"gray\"} progressColor={\"#177be4\"} knobColor={\"#177be4\"} />\n\t \t\t\t \t <div className=\"mapchart-circ-value\">{this.state.chart2Bins}</div>\n\t\t\t \t\t</div>\n\t\t\t \t</div>\n\n\t \t\t\t<div className=\"mapchart-legend-section-dial\">\n\t\t\t \t\t<div className=\"mapchart-legend-section-2col\">\n\t\t\t \t\t\t<div className=\"mapchart-legend-heading\">risk bins</div>\n\t\t\t\t\t \t<CircleSlider value={this.state.chart1Bins} onChange={this.chart1BinSelection} min={1} max={100} stepSize={1}\n\t \t\t\t \t size={80} circleWidth={5} progressWidth={7} knobRadius={7} circleColor={\"gray\"} progressColor={\"#177be4\"} knobColor={\"#177be4\"} />\n\t \t\t\t \t <div className=\"mapchart-circ-value\">{this.state.chart1Bins}</div>\n\t\t\t \t\t</div>\n\t\t\t \t\t<div className=\"mapchart-legend-section-2col\">\n\t\t\t\t \t\t<div className=\"mapchart-legend-heading\">credit bins</div>\n\t\t\t\t\t \t<CircleSlider value={this.state.chart3Bins} onChange={this.chart3BinSelection} min={1} max={100} stepSize={1}\n\t\t \t\t\t \t size={80} circleWidth={5} progressWidth={7} knobRadius={7} circleColor={\"gray\"} progressColor={\"#177be4\"} knobColor={\"#177be4\"} />\n\t\t \t\t\t \t <div className=\"mapchart-circ-value\">{this.state.chart3Bins}</div>\n\t\t\t \t\t</div>\n\t\t\t \t</div>\n\n\t\t\t \t<div className=\"mapchart-legend-section\">\n\t\t\t \t\t<div className=\"mapchart-legend-heading\">portfolio risk score</div>\n\t\t\t \t\t<ul className=\"mapchart-key-ul\">\n\t\t\t \t\t\t<li className=\"mapchart-key-li\"><span className=\"mapchart-perf mapchart-sel0\"></span> <span className=\"mapchart-perf-title\">0.000 - 0.196</span></li>\n\t\t\t \t\t\t<li className=\"mapchart-key-li\"><span className=\"mapchart-perf mapchart-sel1\"></span> <span className=\"mapchart-perf-title\">0.196 - 0.198</span></li>\n\t\t\t \t\t\t<li className=\"mapchart-key-li\"><span className=\"mapchart-perf mapchart-sel2\"></span> <span className=\"mapchart-perf-title\">0.198 - 0.200</span></li>\n\t\t\t \t\t\t<li className=\"mapchart-key-li\"><span className=\"mapchart-perf mapchart-sel3\"></span> <span className=\"mapchart-perf-title\">0.200 - 0.202</span></li>\n\t\t\t \t\t\t<li className=\"mapchart-key-li\"><span className=\"mapchart-perf mapchart-sel4\"></span> <span className=\"mapchart-perf-title\">0.202 - 0.2+</span></li>\n\t\t\t \t\t</ul>\n\t\t\t \t\t<br/>\n\t\t\t \t\t<div className=\"mapchart-legend-heading\">total unpaid balance</div>\n\t\t\t \t\t<span className=\"mapchart-perf\"> <img src=\"./img/legend-height.png\" className=\"legend-img\"/> </span> <div className=\"mapchart-perf-cube\">bar height</div>\n\t\t\t \t</div>\n\n\t\t\t \t<div className=\"mapchart-legend-section\">\n\t\t\t \t\t<div className=\"mapchart-legend-heading\">area details</div>\n\t\t\t \t\t{hoveredArea}\n\t\t\t \t</div>\n\n\t\t\t \t<div className=\"mapchart-legend-sink\">\n\t\t\t\t\t\t<div className=\"mapchart-legend-button-small\" onClick={this.resetInit}>reset all</div>\n\t\t\t\t\t</div>\n\n\t\t\t </div>\n\n\t\t \t\t<div className=\"mapchart-heading-body\">\n\t\t \t\t\t<div className=\"mapchart-heading-container\">\n\t\t \t\t\t\t<div className=\"mapchart-header-title\">\t{engineType} aggregated {percentDP}<span className=\"percent\">%</span> of {parseFloat(this.state.totalDP).toLocaleString()} mortgages </div>\n\t\t \t\t\t\t{headerStatus}\n\t\t \t\t\t</div>\n\t\t \t\t</div>\n\n\t\t\t\t<div className=\"mapchart-map-body\">\n\t\t\t\t\t{mapArea}\n\t\t\t\t</div>\n\n\t\t\t\t<div className=\"mapchart-chart-body\">\n\t\t\t\t\t<div className=\"mapchart-col3-container\">\n\t\t\t\t\t\t<BarChart name=\"chart1\" label=\"portfolio risk score histogram\" ratio={0.8} width={700} height={350} tickCount={5} data={this.state.chart1Data} step={0.01} domain={this.state.chart1Domain} active={this.state.active} onSelection={this.filterCharts} />\n\t\t\t\t\t\t<div className=\"mapChart-chart-reset\" onClick={() => {this.resetChartFilter('chart1')}}> reset </div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"mapchart-col3-container\">\n\t\t\t\t\t\t<BarChart name=\"chart2\" label=\"debt to income histogram\" ratio={0.8} width={700} height={350} tickCount={5} data={this.state.chart2Data} step={1} domain={this.state.chart2Domain} active={this.state.active} onSelection={this.filterCharts} />\n\t\t\t\t\t\t<div className=\"mapChart-chart-reset\" onClick={() => {this.resetChartFilter('chart2')}}> reset </div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"mapchart-col3-container\">\n\t\t\t\t\t\t<BarChart name=\"chart3\" label=\"credit score histogram\" ratio={0.8} width={700} height={350} tickCount={5} data={this.state.chart3Data} step={50} domain={this.state.chart3Domain} active={this.state.active} onSelection={this.filterCharts} />\n\t\t\t\t\t\t<div className=\"mapChart-chart-reset\" onClick={() => {this.resetChartFilter('chart3')}}> reset </div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\n\t\t\t</main>\n\t\t)\n\t}", "title": "" }, { "docid": "cabcc3d3eb8879d544381319e222f7b4", "score": "0.5388228", "text": "zoomOut(amount) { this.renderer.zoomOut(amount); }", "title": "" }, { "docid": "56ce1e6fab60db9724a0548b90767117", "score": "0.5386745", "text": "renderControls () {\n\n const {\n activateControls,\n physicsCore,\n showLoader\n } = this.react.getState()\n\n return (\n <div style={{overflow: 'scroll', height: '100%'}}>\n <ReactLoader show={showLoader}/>\n {\n activateControls &&\n <ScriptLoader onLoaded={this.onScriptLoaded}\n url={['/resources/libs/ammo/ammo.js']}\n />\n }\n\n {\n physicsCore &&\n <div className=\"controls\">\n <div className=\"control-element\">\n <label>\n Simulation controls:\n </label>\n <div>\n <Switch\n onChange={this.onEnablePhysics}\n checked={false}\n />\n <label>\n Run\n </label>\n <button className=\"reset\"\n onClick={this.onReset}>\n <span className=\"fa fa-refresh\"/>\n <label>\n Reset\n </label>\n </button>\n </div>\n </div>\n\n <br/><hr/>\n\n <div className=\"control-element\">\n <label>\n Gravity:\n </label>\n\n <Slider\n handle={(props) => this.onGravitySliderChanged(props)}\n defaultValue={physicsCore.gravity}\n step={0.01}\n min={-9.8}\n max={0.0}\n />\n </div>\n\n <br/><hr/>\n\n <div className=\"control-element\">\n <label>\n Time Skew: <br/> (Runs simulation slower > faster)\n </label>\n\n <Slider\n handle={(props) => this.onTimeSkewSliderChanged(props)}\n defaultValue={physicsCore.timeSkew * 500}\n max={1000}\n step={1}\n min={1}\n />\n </div>\n\n <br/><hr/>\n\n <div className=\"control-element\">\n\n <label>\n Component velocity:\n </label>\n\n { this.renderVelocity() }\n </div>\n\n <br/><hr/>\n\n <div className=\"control-element\" style={{height:'120px'}}>\n\n <label>\n Component transform:\n </label>\n\n { this.renderTransformer() }\n </div>\n\n </div>\n }\n\n </div>\n )\n }", "title": "" }, { "docid": "314b03a7b5b4e8b74798e0cd948cc522", "score": "0.53574544", "text": "async internalRender() {\n const getPreviousCenterAndZoom = () => {\n return {\n previousCenter: this.previousCenter,\n previousZoom: this.previousZoom,\n };\n };\n\n const getNextCenterAndZoom = () => {\n const nextCenter = this.map.getCenter();\n const nextZoom = this.map.getZoom();\n\n return {\n nextCenter,\n nextZoom,\n };\n };\n\n const memorisePreviousCenterAndZoom = () => {\n this.previousCenter = this.map.getCenter();\n this.previousZoom = this.map.getZoom();\n };\n\n /**\n * Do not render canvas if map is dragging.\n */\n if (this.isDragging) return;\n\n let canvas = this.canvas;\n /**\n * Keeping visible canvas frozen, while rendering UI elements at background and display\n * daemon canvas as soon as it completes prevents unnecessary UI elements flash.\n * This happens only after map drag. Zoom change does not use daemon canvas.\n */\n const { nextCenter, nextZoom } = getNextCenterAndZoom();\n const { previousCenter, previousZoom } = getPreviousCenterAndZoom();\n if (nextZoom === previousZoom) {\n canvas = this.daemonCanvas;\n /**\n * Map drag difference in pixel.\n */\n const deltaX = this.map.lngLatToContainer(nextCenter).getX() -\n this.map.lngLatToContainer(previousCenter).getX();\n const deltaY = this.map.lngLatToContainer(nextCenter).getY() -\n this.map.lngLatToContainer(previousCenter).getY();\n /**\n * Move visible canvas horizontally and vertically.\n */\n moveCanvas({\n canvas: this.canvas,\n deltaX: -deltaX,\n deltaY: -deltaY,\n dpr: this.dpr,\n });\n }\n\n /**\n * When rendering at background, user could drag map. Visible canvas should move the previously\n * moved canvas, rather than background canvas.\n */\n memorisePreviousCenterAndZoom();\n\n this.canvasLine.config({\n canvas,\n data: this.data,\n /**\n * 2drender understands rendered images are displayed on high DPR devices.\n */\n dpr: this.dpr,\n /**\n * Everytime render function get called, canvas coordinates must get updated to reflect\n * changes.\n * When dataset is large, it takes a considerable time to transform lng lat coordinates to\n * canvas coordinates. getSnapshotBeforeRender takes advantage of none UI blocking skills\n * by invoking transformation function only before each line renders.\n */\n getSnapshotBeforeRender: Line.getSnapshotBeforeRender(this.map),\n /**\n * Canvas CSS height.\n */\n height: this.height,\n /**\n * Canvas CSS width.\n */\n width: this.width,\n });\n /**\n * Call canvas line render function to draw polylines.\n */\n await this.canvasLine.render();\n\n /**\n * Replace visible canvas with completed canvas to prevent UI elements flash.\n */\n if (nextZoom === previousZoom) {\n this.canvas.width = this.daemonCanvas.width;\n this.canvas.height = this.daemonCanvas.height;\n this.ctx.drawImage(this.daemonCanvas, 0, 0);\n }\n }", "title": "" }, { "docid": "b62b4ad4abb56433bc75900d6b804a43", "score": "0.5355377", "text": "function updateVisualizations()\n{\n // update the bulletChart\n parent.gBulletChartPageCompleted = false;\n parent.document.getElementById('BulletChart').contentWindow.transition();\n\n // update the treeMap\n\t\tparent.document.getElementById('TreeMap').contentWindow.reRender();\n}", "title": "" }, { "docid": "12f4ab1050f3d7023fb8a25bd589179c", "score": "0.5338323", "text": "function update() {\n /**\n * Display area.\n */\n width = visWidth - margin.left - margin.right;\n height = visHeight - margin.top - margin.bottom;\n visContainer.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');\n\n axisScale.domain(colorScale.domain())\n .range([0, width]);\n\n /**\n * Draw.\n */\n visContainer.select('linearGradient').selectAll('stop')\n .data(colorScale.ticks().map((t, i, n) => ({ offset: `${100*i/n.length}%`, color: colorScale(t) })))\n .join('stop')\n .attr('offset', d => d.offset)\n .attr('stop-color', d => d.color);\n \n visContainer.selectAll('rect')\n .data([0])\n .join('rect')\n .attr('width', width)\n .attr('height', height / 2)\n .style('fill', 'url(#linear-gradient)');\n \n xAxisContainer.call(xAxis);\n }", "title": "" }, { "docid": "46c8fff6df5669d83637924a7643971f", "score": "0.53355086", "text": "render() {\n const components = this.props.wireframe.components;\n const handleNodeSelected = this.handleNodeSelected;\n const clickedId = this.props.clickedId;\n const updateComponent = this.props.updateComponent\n const wireframe = this.props.wireframe;\n const currentZoom = this.props.currentZoom;\n const update = this.props.update;\n\n if(currentZoom != this.state.prevZoom){\n this.setState({prevZoom: currentZoom});\n //this.props.updateZoom();\n }\n\n console.log(wireframe);\n \n let sandboxStyle = {\n height: wireframe.height > 5000 ? \"5000px\" : wireframe.height + \"px\",\n width: wireframe.width > 5000 ? \"5000px\" : wireframe.width + \"px\",\n transform: \"scale( \"+ this.props.currentZoom + \")\",\n };\n if(wireframe.background_color){\n\n sandboxStyle = {\n backgroundColor: \"rgba(\" + wireframe.background_color.r + \",\" + \n wireframe.background_color.g + \",\" + \n wireframe.background_color.b + \",\" + \n wireframe.background_color.a + \")\",\n height: wireframe.height > 5000 ? \"5000px\" : wireframe.height + \"px\",\n width: wireframe.width > 5000 ? \"5000px\" : wireframe.width + \"px\",\n transform: \"scale( \"+ this.props.currentZoom + \")\",\n };\n }\n\n const zoomStyle = {\n transform: \"scale( \"+ this.props.currentZoom + \")\",\n };\n\n return (\n <div className= \"zoomable\">\n <div style={sandboxStyle} className=\"sandbox\" onClick = {this.handleSandboxSelected}>\n {components && components.map(function(component, i) {\n return(\n <ResizableComponent \n onDrag = {handleNodeSelected} \n component={component} \n type={component.type} \n clickedId={clickedId} \n onClick = {handleNodeSelected}\n id={i} \n key={i}\n updateComponent = {updateComponent}\n currentZoom = {currentZoom}\n update = {update}\n />\n )\n }\n )}\n </div>\n </div>\n \n );\n\n }", "title": "" }, { "docid": "7a94905542ca5f7c936d3da2e3aa5ad2", "score": "0.5332514", "text": "function zoom() {\n let t = svg.transition().duration(750);\n\n // Update axes, circles, and lines\n svg.select(\".axis--x\").transition(t).call(xAxis);\n g.select(\".axis--y\").transition(t).call(yAxis);\n g.selectAll(\".circles\").transition(t)\n .attr(\"cx\", d => xScale(d[0]))\n .attr(\"cy\", d => yScale(d[1]));\n g.selectAll(\".line\").transition(t)\n .attr(\"d\", d => line(d));\n\n // Update voronoi diagram for focus\n voronoi_diagram = d3.voronoi()\n .x(d => xScale(d[0]))\n .y(d => yScale(d[1]))\n .size([container_width, container_height])(relevant_data);\n }", "title": "" }, { "docid": "0f672f09d2e1be5ab499805ab8f1e6e8", "score": "0.531429", "text": "onZoomChanged() {\n if (!this.map) {\n return;\n }\n let zoom = this.map.getZoom();\n if (zoom < MIN_ZOOM_LEVEL) {\n zoom = MIN_ZOOM_LEVEL;\n this.map.setZoom(MIN_ZOOM_LEVEL);\n }\n if (zoom > MAX_ZOOM_LEVEL) {\n zoom = MAX_ZOOM_LEVEL;\n this.map.setZoom(MAX_ZOOM_LEVEL);\n }\n\n this.setState({ zoom });\n this.props.setZoom(zoom);\n if (this.state.overlay) {\n this.state.overlay.resetPlaybackData();\n }\n this.updateTrackLayer();\n }", "title": "" }, { "docid": "b5a9a1d4593f2bec3c3557a7029027d8", "score": "0.53127825", "text": "updateMetrics() {\n this.viewport = {\n width: this.props.viewport.clientWidth,\n height: this.props.viewport.clientHeight,\n };\n this.content = {\n width: getFullWidth(this.props.content),\n height: getFullHeight(this.props.content),\n };\n this.edgeX = {\n from: Math.min(-this.content.width + this.viewport.width, 0),\n to: 0,\n };\n this.edgeY = {\n from: Math.min(-this.content.height + this.viewport.height, 0),\n to: 0,\n };\n\n this.props.onUpdate(this.getState());\n this.startAnimationLoop();\n }", "title": "" }, { "docid": "389f9c2a7735ff453ecdcf1ca1644ed2", "score": "0.5312283", "text": "updatePanZoomBehavior() {\n if (!this._android) {\n return;\n }\n let zoomHorizontal = false;\n let zoomVertical = false;\n let panHorizontal = false;\n let panVertical = false;\n let i = 0;\n if (this.series) {\n while ((i < this.series.length) && !(panHorizontal && panVertical && zoomHorizontal && zoomVertical)) {\n if (this.series.getItem(i).horizontalAxis) {\n panHorizontal = panHorizontal || this.series.getItem(i).horizontalAxis.allowPan;\n zoomHorizontal = zoomHorizontal || this.series.getItem(i).horizontalAxis.allowZoom;\n }\n if (this.series.getItem(i).verticalAxis) {\n panVertical = panVertical || this.series.getItem(i).verticalAxis.allowPan;\n zoomVertical = zoomVertical || this.series.getItem(i).verticalAxis.allowZoom;\n }\n i++;\n }\n }\n if (this.horizontalAxis) {\n panHorizontal = panHorizontal || this.horizontalAxis.allowPan;\n zoomHorizontal = zoomHorizontal || this.horizontalAxis.allowZoom;\n }\n if (this.verticalAxis) {\n panVertical = panVertical || this.verticalAxis.allowPan;\n zoomVertical = zoomVertical || this.verticalAxis.allowZoom;\n }\n if (panHorizontal || panVertical || zoomHorizontal || zoomVertical) {\n if (!this._panZoomBehavior) {\n this._panZoomBehavior = new com.telerik.widget.chart.visualization.behaviors.ChartPanAndZoomBehavior();\n this._android._panZoomListener = new ChartPanZoomListener(this);\n this._panZoomBehavior.addPanZoomListener(this._android._panZoomListener);\n }\n if (panHorizontal || panVertical) {\n let panMode = com.telerik.widget.chart.visualization.behaviors.ChartPanZoomMode.NONE;\n if (panHorizontal && panVertical) {\n panMode = com.telerik.widget.chart.visualization.behaviors.ChartPanZoomMode.BOTH;\n }\n else {\n panMode = panHorizontal ? com.telerik.widget.chart.visualization.behaviors.ChartPanZoomMode.HORIZONTAL : com.telerik.widget.chart.visualization.behaviors.ChartPanZoomMode.VERTICAL;\n }\n this._panZoomBehavior.setPanMode(panMode);\n }\n if (zoomHorizontal || zoomVertical) {\n let zoomMode = com.telerik.widget.chart.visualization.behaviors.ChartPanZoomMode.NONE;\n if (zoomHorizontal && zoomVertical) {\n zoomMode = com.telerik.widget.chart.visualization.behaviors.ChartPanZoomMode.BOTH;\n }\n else {\n zoomMode = zoomHorizontal ? com.telerik.widget.chart.visualization.behaviors.ChartPanZoomMode.HORIZONTAL : com.telerik.widget.chart.visualization.behaviors.ChartPanZoomMode.VERTICAL;\n }\n this._panZoomBehavior.setZoomMode(zoomMode);\n }\n this._android.getBehaviors().add(this._panZoomBehavior);\n }\n else {\n if (this._panZoomBehavior) {\n this._android.getBehaviors().remove(this._panZoomBehavior);\n this._panZoomBehavior = null;\n }\n }\n }", "title": "" }, { "docid": "c615248a347ddb50cf4eab7b93f0ade6", "score": "0.53024906", "text": "function Graph(props) {\n /**\n * Allow onClick events only in setVertices mode\n */\n let handleGraphClick = () => {}\n if (props.controllerMode == 'setVertices') {\n handleGraphClick = props.handleGraphClick\n }\n\n /**\n * Allow node onClick events only in setEdges ode\n */\n let handleNodeClick = (e) => {\n // Prevent graph's click from firing\n e.stopPropagation()\n }\n if (props.controllerMode == 'setEdges') {\n handleNodeClick=props.handleNodeClick\n }\n\n // TODO: Handle resize\n let viewportWidth = '65vw'\n let viewportHeight = '75vh'\n\n return (\n <svg \n xmlns='http://www.w3.org/2000/svg'\n viewport={`0 0 ${viewportWidth} ${viewportHeight}`}\n\n className='graph'\n onClick={handleGraphClick}\n >\n {\n props.edges\n }\n {\n props.nodes.map((node) => {\n return (\n <Node \n key={node.id}\n ref={props.nodeRefs}\n {...node}\n controllerMode={props.controllerMode}\n handleNodeClick={handleNodeClick}\n />\n )\n })\n }\n </svg>\n )\n}", "title": "" }, { "docid": "6d41ba9f950fc6a09870c8b6c3bdbb97", "score": "0.5295166", "text": "handleResize() {\n this.updateScales();\n this.render();\n }", "title": "" }, { "docid": "f4a0c4859af093d0843d6345f0be5598", "score": "0.52655894", "text": "function renderNewGraph() {\n svg = elem.append(\"svg\")\n .attr(\"width\", cx)\n .attr(\"height\", cy)\n .attr(\"class\", \"graph\")\n .style('z-index', 2);\n // .attr(\"tabindex\", tabindex || 0);\n\n vis = svg.append(\"g\")\n .attr(\"transform\", \"translate(\" + padding.left + \",\" + padding.top + \")\");\n\n plot = vis.append(\"rect\")\n .attr(\"class\", \"plot\")\n .attr(\"width\", size.width)\n .attr(\"height\", size.height)\n .attr(\"pointer-events\", \"all\")\n .attr(\"fill\", \"rgba(255,255,255,0)\")\n .on(\"mousemove\", plotMousemove)\n .on(\"mousedown\", plotDrag)\n .on(\"touchstart\", plotDrag);\n\n plot.call(d3.behavior.zoom().x(xScale).y(yScale).on(\"zoom\", redraw));\n\n background = elem.append(\"div\")\n .attr(\"class\", \"background\")\n .style({\n \"width\": size.width + \"px\",\n \"height\": size.height + \"px\",\n \"top\": padding.top + \"px\",\n \"left\": padding.left + \"px\",\n \"z-index\": 0\n });\n\n createGraphCanvas();\n\n viewbox = vis.append(\"svg\")\n .attr(\"class\", \"viewbox\")\n .attr(\"top\", 0)\n .attr(\"left\", 0)\n .attr(\"width\", size.width)\n .attr(\"height\", size.height)\n .attr(\"viewBox\", \"0 0 \"+size.width+\" \"+size.height);\n\n selectedRulerX = viewbox.append(\"line\")\n .attr(\"stroke\", gridStroke)\n .attr(\"stroke-dasharray\", \"2,2\")\n .attr(\"y1\", 0)\n .attr(\"y2\", size.height)\n .attr(\"x1\", function() { return selected === null ? 0 : selected[0]; } )\n .attr(\"x2\", function() { return selected === null ? 0 : selected[0]; } )\n .attr(\"class\", \"ruler hidden\");\n\n selectedRulerY = viewbox.append(\"line\")\n .attr(\"stroke\", gridStroke)\n .attr(\"stroke-dasharray\", \"2,2\")\n .attr(\"x1\", 0)\n .attr(\"x2\", size.width)\n .attr(\"y1\", function() { return selected === null ? 0 : selected[1]; } )\n .attr(\"y2\", function() { return selected === null ? 0 : selected[1]; } )\n .attr(\"class\", \"ruler hidden\");\n\n yAxisDraggable = svg.append(\"rect\")\n .attr(\"class\", \"draggable-axis\")\n .attr(\"x\", padding.left-yAxisDraggableWidth)\n .attr(\"y\", padding.top)\n .attr(\"rx\", yAxisNumberHeight/6)\n .attr(\"width\", yAxisDraggableWidth)\n .attr(\"height\", size.height)\n .attr(\"pointer-events\", \"all\")\n .style(\"cursor\", \"row-resize\")\n .on(\"mousedown\", yAxisDrag)\n .on(\"touchstart\", yAxisDrag);\n\n yAxisDraggableTooltip = yAxisDraggable.append(\"title\");\n\n xAxisDraggable = svg.append(\"rect\")\n .attr(\"class\", \"draggable-axis\")\n .attr(\"x\", padding.left)\n .attr(\"y\", size.height+padding.top)\n .attr(\"rx\", yAxisNumberHeight/6)\n .attr(\"width\", size.width)\n .attr(\"height\", xAxisDraggableHeight)\n .attr(\"pointer-events\", \"all\")\n .style(\"cursor\", \"col-resize\")\n .on(\"mousedown\", xAxisDrag)\n .on(\"touchstart\", xAxisDrag);\n\n xAxisDraggableTooltip = xAxisDraggable.append(\"title\");\n\n if (sizeType.value <= 2 && options.ylabel) {\n xAxisDraggableTooltip.text(options.xlabel);\n }\n\n if (sizeType.catefory && options.ylabel) {\n yAxisDraggableTooltip.text(options.ylabel);\n }\n\n adjustAxisDraggableFill();\n\n brush_element = viewbox.append(\"g\")\n .attr(\"class\", \"brush\");\n\n // add Chart Title\n if (options.title && sizeType.value > 0) {\n title = vis.selectAll(\"text\")\n .data(titles, function(d) { return d; });\n title.enter().append(\"text\")\n .attr(\"class\", \"title\")\n .text(function(d) { return d; })\n .attr(\"x\", function() { return size.width/2 - Math.min(size.width, getComputedTextLength(this))/2; })\n .attr(\"dy\", function(d, i) { return -i * titleFontSizeInPixels - halfFontSizeInPixels + \"px\"; });\n titleTooltip = title.append(\"title\")\n .text(\"\");\n } else if (options.title) {\n titleTooltip = plot.append(\"title\")\n .text(options.title);\n }\n\n // Add the x-axis label\n if (sizeType.value > 2) {\n xlabel = vis.append(\"text\")\n .attr(\"class\", \"axis\")\n .attr(\"class\", \"xlabel\")\n .text(options.xlabel)\n .attr(\"x\", size.width/2)\n .attr(\"y\", size.height)\n .attr(\"dy\", xAxisLabelBaseline + \"px\")\n .style(\"text-anchor\",\"middle\");\n }\n\n // add y-axis label\n if (sizeType.value > 2) {\n ylabel = vis.append(\"g\").append(\"text\")\n .attr(\"class\", \"axis\")\n .attr(\"class\", \"ylabel\")\n .text( options.ylabel)\n .style(\"text-anchor\",\"middle\")\n .attr(\"transform\",\"translate(\" + yAxisLabelBaseline + \" \" + size.height/2+\") rotate(-90)\");\n if (sizeType.category === \"small\") {\n yAxisDraggable.append(\"title\")\n .text(options.ylabel);\n }\n }\n\n d3.select(node)\n .on(\"mousemove.drag\", mousemove)\n .on(\"touchmove.drag\", mousemove)\n .on(\"mouseup.drag\", mouseup)\n .on(\"touchend.drag\", mouseup);\n\n notification = vis.append(\"text\")\n .attr(\"class\", \"graph-notification\")\n .text(message)\n .attr(\"x\", size.width/2)\n .attr(\"y\", size.height/2)\n .style(\"text-anchor\",\"middle\");\n\n updateMarkers();\n updateRulers();\n }", "title": "" }, { "docid": "f4a0c4859af093d0843d6345f0be5598", "score": "0.52655894", "text": "function renderNewGraph() {\n svg = elem.append(\"svg\")\n .attr(\"width\", cx)\n .attr(\"height\", cy)\n .attr(\"class\", \"graph\")\n .style('z-index', 2);\n // .attr(\"tabindex\", tabindex || 0);\n\n vis = svg.append(\"g\")\n .attr(\"transform\", \"translate(\" + padding.left + \",\" + padding.top + \")\");\n\n plot = vis.append(\"rect\")\n .attr(\"class\", \"plot\")\n .attr(\"width\", size.width)\n .attr(\"height\", size.height)\n .attr(\"pointer-events\", \"all\")\n .attr(\"fill\", \"rgba(255,255,255,0)\")\n .on(\"mousemove\", plotMousemove)\n .on(\"mousedown\", plotDrag)\n .on(\"touchstart\", plotDrag);\n\n plot.call(d3.behavior.zoom().x(xScale).y(yScale).on(\"zoom\", redraw));\n\n background = elem.append(\"div\")\n .attr(\"class\", \"background\")\n .style({\n \"width\": size.width + \"px\",\n \"height\": size.height + \"px\",\n \"top\": padding.top + \"px\",\n \"left\": padding.left + \"px\",\n \"z-index\": 0\n });\n\n createGraphCanvas();\n\n viewbox = vis.append(\"svg\")\n .attr(\"class\", \"viewbox\")\n .attr(\"top\", 0)\n .attr(\"left\", 0)\n .attr(\"width\", size.width)\n .attr(\"height\", size.height)\n .attr(\"viewBox\", \"0 0 \"+size.width+\" \"+size.height);\n\n selectedRulerX = viewbox.append(\"line\")\n .attr(\"stroke\", gridStroke)\n .attr(\"stroke-dasharray\", \"2,2\")\n .attr(\"y1\", 0)\n .attr(\"y2\", size.height)\n .attr(\"x1\", function() { return selected === null ? 0 : selected[0]; } )\n .attr(\"x2\", function() { return selected === null ? 0 : selected[0]; } )\n .attr(\"class\", \"ruler hidden\");\n\n selectedRulerY = viewbox.append(\"line\")\n .attr(\"stroke\", gridStroke)\n .attr(\"stroke-dasharray\", \"2,2\")\n .attr(\"x1\", 0)\n .attr(\"x2\", size.width)\n .attr(\"y1\", function() { return selected === null ? 0 : selected[1]; } )\n .attr(\"y2\", function() { return selected === null ? 0 : selected[1]; } )\n .attr(\"class\", \"ruler hidden\");\n\n yAxisDraggable = svg.append(\"rect\")\n .attr(\"class\", \"draggable-axis\")\n .attr(\"x\", padding.left-yAxisDraggableWidth)\n .attr(\"y\", padding.top)\n .attr(\"rx\", yAxisNumberHeight/6)\n .attr(\"width\", yAxisDraggableWidth)\n .attr(\"height\", size.height)\n .attr(\"pointer-events\", \"all\")\n .style(\"cursor\", \"row-resize\")\n .on(\"mousedown\", yAxisDrag)\n .on(\"touchstart\", yAxisDrag);\n\n yAxisDraggableTooltip = yAxisDraggable.append(\"title\");\n\n xAxisDraggable = svg.append(\"rect\")\n .attr(\"class\", \"draggable-axis\")\n .attr(\"x\", padding.left)\n .attr(\"y\", size.height+padding.top)\n .attr(\"rx\", yAxisNumberHeight/6)\n .attr(\"width\", size.width)\n .attr(\"height\", xAxisDraggableHeight)\n .attr(\"pointer-events\", \"all\")\n .style(\"cursor\", \"col-resize\")\n .on(\"mousedown\", xAxisDrag)\n .on(\"touchstart\", xAxisDrag);\n\n xAxisDraggableTooltip = xAxisDraggable.append(\"title\");\n\n if (sizeType.value <= 2 && options.ylabel) {\n xAxisDraggableTooltip.text(options.xlabel);\n }\n\n if (sizeType.catefory && options.ylabel) {\n yAxisDraggableTooltip.text(options.ylabel);\n }\n\n adjustAxisDraggableFill();\n\n brush_element = viewbox.append(\"g\")\n .attr(\"class\", \"brush\");\n\n // add Chart Title\n if (options.title && sizeType.value > 0) {\n title = vis.selectAll(\"text\")\n .data(titles, function(d) { return d; });\n title.enter().append(\"text\")\n .attr(\"class\", \"title\")\n .text(function(d) { return d; })\n .attr(\"x\", function() { return size.width/2 - Math.min(size.width, getComputedTextLength(this))/2; })\n .attr(\"dy\", function(d, i) { return -i * titleFontSizeInPixels - halfFontSizeInPixels + \"px\"; });\n titleTooltip = title.append(\"title\")\n .text(\"\");\n } else if (options.title) {\n titleTooltip = plot.append(\"title\")\n .text(options.title);\n }\n\n // Add the x-axis label\n if (sizeType.value > 2) {\n xlabel = vis.append(\"text\")\n .attr(\"class\", \"axis\")\n .attr(\"class\", \"xlabel\")\n .text(options.xlabel)\n .attr(\"x\", size.width/2)\n .attr(\"y\", size.height)\n .attr(\"dy\", xAxisLabelBaseline + \"px\")\n .style(\"text-anchor\",\"middle\");\n }\n\n // add y-axis label\n if (sizeType.value > 2) {\n ylabel = vis.append(\"g\").append(\"text\")\n .attr(\"class\", \"axis\")\n .attr(\"class\", \"ylabel\")\n .text( options.ylabel)\n .style(\"text-anchor\",\"middle\")\n .attr(\"transform\",\"translate(\" + yAxisLabelBaseline + \" \" + size.height/2+\") rotate(-90)\");\n if (sizeType.category === \"small\") {\n yAxisDraggable.append(\"title\")\n .text(options.ylabel);\n }\n }\n\n d3.select(node)\n .on(\"mousemove.drag\", mousemove)\n .on(\"touchmove.drag\", mousemove)\n .on(\"mouseup.drag\", mouseup)\n .on(\"touchend.drag\", mouseup);\n\n notification = vis.append(\"text\")\n .attr(\"class\", \"graph-notification\")\n .text(message)\n .attr(\"x\", size.width/2)\n .attr(\"y\", size.height/2)\n .style(\"text-anchor\",\"middle\");\n\n updateMarkers();\n updateRulers();\n }", "title": "" }, { "docid": "a4b5a2938f9d75e19b8dd55bff14bdd1", "score": "0.5265009", "text": "repaintViews() {\n for (let viewport of this.viewports) {\n viewport.repaint();\n }\n\n if (this.track.paintAxis) {\n this.track.paintAxis(this.axisCanvasContext, this.axisCanvasContext.canvas.width, this.axisCanvasContext.canvas.height);\n } // Repaint sample names last\n\n\n this.repaintSamples();\n }", "title": "" }, { "docid": "9b484d957d4578bef469f1f6897540c1", "score": "0.5261986", "text": "updateMetrics() {\n this.viewport = {\n width: this.props.viewport.clientWidth,\n height: this.props.viewport.clientHeight\n };\n this.content = {\n width: getFullWidth(this.props.content),\n height: getFullHeight(this.props.content)\n };\n this.edgeX = {\n from: Math.min(-this.content.width + this.viewport.width, 0),\n to: 0\n };\n this.edgeY = {\n from: Math.min(-this.content.height + this.viewport.height, 0),\n to: 0\n };\n\n this.props.onUpdate(this.getState());\n this.startAnimationLoop();\n }", "title": "" }, { "docid": "7e49c7e13224e74ead30a5ca4162e88d", "score": "0.52524596", "text": "setRequiresRedraw() {\n const { _parent, _maskee, _alpha, _scaleX, _scaleY, _visible } = this\n let parent = _parent || _maskee\n const frameID = window.StarlingContextManager.current.frameID\n\n this._lastParentOrSelfChangeFrameID = frameID\n\n this._hasVisibleArea =\n _alpha !== 0.0 &&\n _visible &&\n !_maskee &&\n _scaleX !== 0.0 &&\n _scaleY !== 0.0\n\n while (parent && parent._lastChildChangeFrameID !== frameID) {\n parent._lastChildChangeFrameID = frameID\n parent = parent._parent || parent._maskee\n }\n }", "title": "" }, { "docid": "b37fc8ad1a38d146a77ffe4888c41e30", "score": "0.52467746", "text": "_windowResize() {\n this.forceUpdate()\n }", "title": "" }, { "docid": "1c097ce1bea49062a6dfd0631dd878d1", "score": "0.52337265", "text": "forceMapReRender() {\n // this ensures the map is full setup.\n // we have issues becuase the map height is 100% and is\n // explicitly set\n L.Util.requestAnimFrame(this.map.invalidateSize, this.map, !1, this.map._container);\n }", "title": "" }, { "docid": "9a4c3550aa88ec04f5a297fef6cd800d", "score": "0.5209868", "text": "function repaintExistingGraph() {\n vis\n .attr(\"width\", cx)\n .attr(\"height\", cy)\n .attr(\"transform\", \"translate(\" + padding.left + \",\" + padding.top + \")\");\n\n plot\n .attr(\"width\", size.width)\n .attr(\"height\", size.height);\n\n background\n .style({\n \"width\": size.width + \"px\",\n \"height\": size.height + \"px\",\n \"top\": padding.top + \"px\",\n \"left\": padding.left + \"px\",\n \"z-index\": 0\n });\n\n viewbox\n .attr(\"top\", 0)\n .attr(\"left\", 0)\n .attr(\"width\", size.width)\n .attr(\"height\", size.height)\n .attr(\"viewBox\", \"0 0 \"+size.width+\" \"+size.height);\n\n yAxisDraggable\n .attr(\"x\", padding.left-yAxisDraggableWidth)\n .attr(\"y\", padding.top-yAxisNumberHeight/2)\n .attr(\"width\", yAxisDraggableWidth)\n .attr(\"height\", size.height+yAxisNumberHeight);\n\n xAxisDraggable\n .attr(\"x\", padding.left)\n .attr(\"y\", size.height+padding.top)\n .attr(\"width\", size.width)\n .attr(\"height\", xAxisDraggableHeight);\n\n adjustAxisDraggableFill();\n\n if (options.title && sizeType.value > 0) {\n title\n .attr(\"x\", function() { return size.width/2 - Math.min(size.width, getComputedTextLength(this))/2; })\n .attr(\"dy\", function(d, i) { return -i * titleFontSizeInPixels - halfFontSizeInPixels + \"px\"; });\n titleTooltip\n .text(\"\");\n } else if (options.title) {\n titleTooltip\n .text(options.title);\n }\n\n if (options.xlabel && sizeType.value > 2) {\n xlabel\n .attr(\"x\", size.width/2)\n .attr(\"y\", size.height)\n .attr(\"dy\", xAxisLabelBaseline + \"px\");\n xAxisDraggableTooltip\n .text(\"\");\n } else {\n xAxisDraggableTooltip\n .text(options.xlabel);\n }\n\n if (options.ylabel && sizeType.value > 2) {\n ylabel\n .attr(\"transform\",\"translate(\" + yAxisLabelBaseline + \" \" + size.height/2+\") rotate(-90)\");\n yAxisDraggableTooltip\n .text(\"\");\n } else {\n yAxisDraggableTooltip\n .text(options.ylabel);\n }\n\n notification\n .attr(\"x\", size.width/2)\n .attr(\"y\", size.height/2);\n\n vis.selectAll(\"g.x\").remove();\n vis.selectAll(\"g.y\").remove();\n\n if (has_selection && selection_visible) {\n updateBrushElement();\n }\n\n updateMarkers();\n updateRulers();\n resizeCanvas();\n }", "title": "" }, { "docid": "9a4c3550aa88ec04f5a297fef6cd800d", "score": "0.5209868", "text": "function repaintExistingGraph() {\n vis\n .attr(\"width\", cx)\n .attr(\"height\", cy)\n .attr(\"transform\", \"translate(\" + padding.left + \",\" + padding.top + \")\");\n\n plot\n .attr(\"width\", size.width)\n .attr(\"height\", size.height);\n\n background\n .style({\n \"width\": size.width + \"px\",\n \"height\": size.height + \"px\",\n \"top\": padding.top + \"px\",\n \"left\": padding.left + \"px\",\n \"z-index\": 0\n });\n\n viewbox\n .attr(\"top\", 0)\n .attr(\"left\", 0)\n .attr(\"width\", size.width)\n .attr(\"height\", size.height)\n .attr(\"viewBox\", \"0 0 \"+size.width+\" \"+size.height);\n\n yAxisDraggable\n .attr(\"x\", padding.left-yAxisDraggableWidth)\n .attr(\"y\", padding.top-yAxisNumberHeight/2)\n .attr(\"width\", yAxisDraggableWidth)\n .attr(\"height\", size.height+yAxisNumberHeight);\n\n xAxisDraggable\n .attr(\"x\", padding.left)\n .attr(\"y\", size.height+padding.top)\n .attr(\"width\", size.width)\n .attr(\"height\", xAxisDraggableHeight);\n\n adjustAxisDraggableFill();\n\n if (options.title && sizeType.value > 0) {\n title\n .attr(\"x\", function() { return size.width/2 - Math.min(size.width, getComputedTextLength(this))/2; })\n .attr(\"dy\", function(d, i) { return -i * titleFontSizeInPixels - halfFontSizeInPixels + \"px\"; });\n titleTooltip\n .text(\"\");\n } else if (options.title) {\n titleTooltip\n .text(options.title);\n }\n\n if (options.xlabel && sizeType.value > 2) {\n xlabel\n .attr(\"x\", size.width/2)\n .attr(\"y\", size.height)\n .attr(\"dy\", xAxisLabelBaseline + \"px\");\n xAxisDraggableTooltip\n .text(\"\");\n } else {\n xAxisDraggableTooltip\n .text(options.xlabel);\n }\n\n if (options.ylabel && sizeType.value > 2) {\n ylabel\n .attr(\"transform\",\"translate(\" + yAxisLabelBaseline + \" \" + size.height/2+\") rotate(-90)\");\n yAxisDraggableTooltip\n .text(\"\");\n } else {\n yAxisDraggableTooltip\n .text(options.ylabel);\n }\n\n notification\n .attr(\"x\", size.width/2)\n .attr(\"y\", size.height/2);\n\n vis.selectAll(\"g.x\").remove();\n vis.selectAll(\"g.y\").remove();\n\n if (has_selection && selection_visible) {\n updateBrushElement();\n }\n\n updateMarkers();\n updateRulers();\n resizeCanvas();\n }", "title": "" }, { "docid": "52782b5cbca7b0868dd2f3158b872ff7", "score": "0.5191557", "text": "zoomIn() {\n\t\tif(this.settings && this.settings.zoomIncrement) {\n\t\t\tthis.currentScale += this.settings.zoomIncrement;\n\t\t\tthis.wrap.style.transform = `scale3d(${this.currentScale},${this.currentScale},${this.currentScale})`;\n\t\t\tthis.wrap.style['transform-origin'] = `${this.wrap.parentNode.scrollLeft - window.innerWidth / 2}px ${this.wrap.parentNode.scrollTop + window.innerHeight / 2}px`;\n\t\t}\n\t}", "title": "" }, { "docid": "859d30fbfd65b8fb2689fa2b7aa198e1", "score": "0.519041", "text": "componentDidUpdate() {\n this.renderAxis();\n }", "title": "" }, { "docid": "c435f23f488aba005eb9a8a108fbdc55", "score": "0.5184891", "text": "renderGraph() {\n if (this.isLoading()) {\n return (\n <Container fluid>\n <Spinner size=\"lg\" color=\"danger\" />\n <h2>Loading data...</h2>\n </Container>\n );\n } else {\n return (\n <ResponsiveContainer height=\"90%\">\n <LineChart\n width={600}\n height={300}\n data={this.state.data}\n margin={{ top: 5, right: 30, left: 20, bottom: 5 }}\n >\n <CartesianGrid strokeDasharray=\"3 3\" />\n <XAxis xAxisId={0} dataKey=\"week\" />\n <XAxis xAxisId={1} dataKey=\"year\" />\n <YAxis type=\"number\" domain={[\"auto\", \"auto\"]} />\n <Tooltip />\n <Legend verticalAlign=\"top\" wrapperStyle={{ lineHeight: \"40px\" }} />\n <Brush dataKey=\"year\" height={30} stroke=\"#8884d8\" />\n <Line\n type=\"monotone\"\n dataKey=\"teamScore\"\n stroke=\"green\"\n activeDot={{ r: 8 }}\n />\n <Line\n type=\"monotone\"\n dataKey=\"median\"\n stroke=\"#8884d8\"\n activeDot={{ r: 8 }}\n />\n <Line\n type=\"monotone\"\n dataKey=\"average\"\n stroke=\"red\"\n activeDot={{ r: 8 }}\n />\n </LineChart>\n </ResponsiveContainer>\n );\n }\n }", "title": "" }, { "docid": "8c0aea575a3afba06c772c80c86f95b8", "score": "0.51799494", "text": "function customZoomControl() {\n}", "title": "" }, { "docid": "ed14cc54efe02d0e85aeac451ada3a49", "score": "0.5176359", "text": "function zoomed() {\r\n //call the zoom.translate vector with the array returned from panLimit()\r\n zoom.translate(panLimit());\r\n svg.select(\".x.axis\").call(xAxis);\r\n svg.selectAll(\"image\").attr(\"transform\", \"translate(\" + d3.event.translate[0] + \",\" + 0 + \")scale(\" + d3.event.scale + \")\")\r\n svg.selectAll(\"circle\").attr(\"transform\", \"translate(\" + d3.event.translate[0] + \",\" + 0 + \")scale(\" + d3.event.scale + \")\");\r\n updateViewportFromChart();\r\n}", "title": "" }, { "docid": "505ad35277a58a751c75c912c3b6f4b3", "score": "0.5173704", "text": "function renderChart() {\n //TODO check we need to refresh this AGAIN!\n chart = buildChartObject();\n\n //set isEditor to allow annotations to be moved\n chart.isEditor = true;\n // get device and its corresponding dims\n var device = $('#device').val();\n var chartHeight = parseInt(chart.devices[device].aspectRatio * chart.size);\n var chartWidth = chart.size;\n\n $(\"#chart-size\").html('Size:' + chartWidth + ' x ' + chartHeight);\n renderChartObject('chart', chart, chartHeight, chartWidth);\n }", "title": "" }, { "docid": "2f4ea353d7f56f44f37ed3673e194629", "score": "0.5167593", "text": "update() {\n const { recomputedProps, padding, plotAreaWidth, plotAreaHeight } = this.props;\n\n // only update if we recomputed props that these rely on\n if (recomputedProps) {\n this.g.attr('transform', `translate(${padding.left} ${padding.top})`);\n this.g.select('rect')\n .attr('width', plotAreaWidth)\n .attr('height', plotAreaHeight);\n\n\n this.updateCircles();\n this.updateVoronoi();\n }\n\n this.updateHighlight();\n }", "title": "" }, { "docid": "bd083f60988c8ad6eb89a61417115128", "score": "0.51547664", "text": "renderChart() {\n let dispatcher;\n\n // We try to reuse the current chart instance. If not possible then lets instantiate again\n this.chart = (this.chart && !this.rendering) ? this.chart : nv.models[this.props.type]();\n\n if(isCallable(this.props.renderStart))\n this.props.renderStart(this.chart, RENDER_START);\n\n this.parsedProps = bindFunctions(this.props, this.props.context);\n\n this.chart.x && this.chart.x(getValueFunction(this.parsedProps.x, 'x'));\n this.chart.y && this.chart.y(getValueFunction(this.parsedProps.y, 'y'));\n this.props.margin && this.chart.margin(this.options(MARGIN, pick).margin || propsByPrefix('margin', this.props) || {});\n\n // Configure componentes recursively\n this.configureComponents(this.chart, this.options(SETTINGS.concat(CONTAINER_STYLE), without));\n\n // hook for configuring the chart\n !this.props.configure || this.props.configure(this.chart);\n\n // Render chart using d3\n this.selection = d3.select(this.refs.svg)\n .datum(this.props.datum)\n .call(this.chart);\n\n // Update the chart if the window size change.\n // Save resizeHandle to remove the resize listener later.\n if(!this.resizeHandler)\n this.resizeHandler = nv.utils.windowResize(this.chart.update);\n\n // PieCharts and lineCharts are an special case. Their dispacher is the pie component inside the chart.\n // There are some charts do not feature the renderEnd event\n switch(this.props.type) {\n case 'pieChart':\n dispatcher = this.chart.pie.dispatch;\n break\n case 'lineChart':\n dispatcher = this.chart.lines.dispatch;\n break\n default:\n dispatcher = this.chart.dispatch;\n }\n\n dispatcher.renderEnd && dispatcher.on('renderEnd', this.renderEnd.bind(this));\n this.rendering = true;\n\n return this.chart;\n }", "title": "" }, { "docid": "e51db89853ccf222484ce6ddcd56d836", "score": "0.5147932", "text": "zoomOut() {\n\t\tif(this.settings && this.settings.zoomIncrement) {\n\t\t\tthis.currentScale -= this.settings.zoomIncrement;\n\t\t\tthis.wrap.style.transform = `scale3d(${this.currentScale},${this.currentScale},${this.currentScale})`;\n\t\t\tthis.wrap.style['transform-origin'] = `${this.wrap.parentNode.scrollLeft - window.innerWidth / 2}px ${this.wrap.parentNode.scrollTop + window.innerHeight / 2}px`;\n\t\t}\n\t}", "title": "" }, { "docid": "10134208684e6afa60f020258b84522a", "score": "0.5147272", "text": "function redraw(useScale) {\n\n //store the last event data\n trans = d3.event.translate;\n scale = d3.event.scale;\n\n\n //transform the vis\n vis.attr(\"transform\",\n \"translate(\" + trans + \")\"\n + \" scale(\" + scale + \")\");\n\n //we need to update the zoom slider, set the boolean to false so the slider change does not trigger a zoom change in the vis (from the slider callback function) \n zoomWidgetObjDoZoom = false;\n zoomWidgetObj.setValue(0, (scale / 4));\n\n}", "title": "" }, { "docid": "7f7c839d52cd84528a6a8d0d55c81534", "score": "0.5137865", "text": "initialRender() {\n this.rootSelection = select(this.root);\n const svg = this.svgSelection = select(this.svg);\n \n this.mapArea = svg.append('g').classed('map', 1);\n this.mapPaths = this.mapArea.append('g').classed('paths', 1);\n this.mapAreaPersonalization = this.mapArea.append('g').classed('personalization', 1);\n this.mapAreaOverlay = this.mapArea.append('g').classed('overlay', 1);\n \n this.chartArea = svg.insert('g', '.map').classed('chart', 1);\n this.chartBase = this.chartArea.append('g').classed('base', 1).style('pointer-events', 'none');\n this.chartLabels = this.chartArea.append('g').classed('labels', 1);\n this.chartOverlay = this.chartArea.append('rect').attr('class', css(styles.interactionLayer));\n }", "title": "" }, { "docid": "e0d8ade6536364cc790eb30fd7a24381", "score": "0.5135599", "text": "function zoomed() {\n graph.container.selectAll('.node').selectAll('circle,text').attr('transform', 'scale(' + (((zoomToBin + 2) - d3.event.scale) / (zoomToBin + 1)) + ')')\n graph.container.attr('transform', 'translate(' + d3.event.translate + ')scale(' + d3.event.scale + ')')\n}", "title": "" }, { "docid": "0c69f3b60eb979117d65f53d0b9ce272", "score": "0.51316726", "text": "function unzoom() {\n Plotly.animate('curl_graph',{layout: {\n title: 'Plot of D split up into rotating regions',\n xaxis: {label: 'x', range: [-0.5,1.5]},\n yaxis: {label: 'y', range: [-0.5,1.5]},\n showlegend: false\n }\n }, {\n transition: {\n duration: 1000,\n easing: 'linear'\n }\n })\n}", "title": "" }, { "docid": "eafce68c2ba93523001e6c9ffc7e1766", "score": "0.5125428", "text": "render() {\n log('render()');\n\n var props = this.prepareProps(this.props, this.state);\n\n this.data = props.data;\n this.dataSource = props.dataSource;\n this.graphAdded = this.graphAdded || false;\n\n return (\n <div ref=\"root\" className=\"nv-chart\">\n <svg ref=\"svg\" {...pick(this.props, SIZE)}></svg>\n </div>\n );\n }", "title": "" }, { "docid": "01ee3820186dd0aae6657c5e05a6e349", "score": "0.5123742", "text": "function repaint() {\r\n\r\n\t\tthis.div.style.width = (controller.mapModel.getWidth()) + \"px\";\r\n\t\tthis.div.style.height = (controller.mapModel.getHeight()) + \"px\";\r\n\t\t\r\n\t\tif (this.map != null && this.eventType == -1) {\r\n\t\t\tvar bbox = controller.mapModel.getBoundingBox();\r\n\t\t\tthis.map.zoomToExtent( new OpenLayers.Bounds( bbox.minx, bbox.miny,\r\n\t\t\t\t\t bbox.maxx, bbox.maxy) );\r\n\t\t}\r\n\r\n\t\tif (this.map != null && this.eventType != 0\r\n\t\t\t\t&& controller.mapModel.isChanged()) {\r\n\t\t\tthis.updateLayers();\r\n\t\t}\r\n\t\tthis.eventType = -1;\r\n\t}", "title": "" }, { "docid": "6da2f22e0dd7702ab248dff9f48bcacf", "score": "0.51208663", "text": "zoomOut(e) {\n e.preventDefault();\n e.stopPropagation();\n let canvas = this.state.canvas;\n let zoom_rate = this.state.zoom_rate;\n let zoom = canvas.getZoom()\n\n zoom *= 1 - (zoom_rate/100)\n canvas.setZoom(zoom)\n canvas.renderAll(); \n}", "title": "" }, { "docid": "7918ce1a53d8a73a2febb8843fdd89cf", "score": "0.511158", "text": "updateDiscreteViewport() {\n DvtTimelineRenderer._renderAxis(this, this.getTimeZoomCanvas(), true);\n DvtTimelineRenderer._renderNavigationArrows(this, this.getTimeZoomCanvas());\n if (this._hasOverview) {\n DvtTimelineRenderer._renderOverview(this);\n }\n this.updateSeries();\n DvtTimelineRenderer._renderScrollbars(this);\n }", "title": "" }, { "docid": "cf3d8e11fa8653284ac6c86ba25afa17", "score": "0.5108528", "text": "reRender()\n {\n this.destroy()\n\n this.chart = SVG(this.nuy.container)\n\n var [width, height] = this.getElementDimensions()\n this.resize(width, height)\n\n return this.render()\n }", "title": "" }, { "docid": "2e112a45f8ec1dfde95ed31e24562ba3", "score": "0.50966793", "text": "update() {\n\n // get new positions\n this.layout.layout(this.vertices, this.edges);\n // svg may have changed sizes\n let width,height;\n if(Object.keys(this.settings).indexOf(\"width\")>-1){\n width =this. settings.width;\n }else{\n width = this.svg.getBoundingClientRect().width;\n }\n if(Object.keys(this.settings).indexOf(\"height\")>-1){\n height =this. settings.height;\n }else{\n height = this.svg.getBoundingClientRect().height;\n }\n\n // update the scales' domains\n this.scales.x.domain(this.layout.horizontalRange).range([this.margins.left, width - this.margins.right]);\n this.scales.y.domain(this.layout.verticalRange).range([this.margins.top + 20, height -this. margins.bottom - 20]);\n this.scales.width=width;\n this.scales.height=height;\n\n // updateAxis.call(this);\n const xAxis = axisBottom(this.scales.x)\n .tickArguments(this.settings.xAxisTickArguments);\n\n this.svgSelection.select(\"#x-axis\")\n .transition()\n .duration(this.settings.transitionDuration)\n .call(xAxis);\n\n\n // call the private methods to create the components of the diagram\n\n if (this.settings.backgroundBorder > 0) {\n updateNodeBackgrounds.call(this);\n }\n\n updateNodes.call(this);\n updateBranches.call(this);\n updateBranches.call(this);\n\n }", "title": "" }, { "docid": "de12e16d6d880c61eab05ce58d2b9716", "score": "0.5094022", "text": "onDidChangeOptions() {\n this._lastRenderData = null;\n this._buffers = null;\n this._applyLayout();\n this._domNode.setClassName(this._getMinimapDomNodeClassName());\n }", "title": "" }, { "docid": "52515d553c84929d26c9cb0708d33e7c", "score": "0.5091059", "text": "reset_() {\n if (!this.svg_) { return; }\n this.vis_.call(this.zoom_.transform, d3.zoomIdentity);\n this.set('zoomDepth_', 20);\n }", "title": "" }, { "docid": "fabef837b4650d87856ad73ace73f298", "score": "0.50899434", "text": "render() {\n const isDiscrete = this.step !== 0;\n const hostClassInfo = {\n 'mdc-slider--discrete': isDiscrete,\n 'mdc-slider--display-markers': this.markers && isDiscrete,\n };\n let markersTemplate = '';\n if (isDiscrete && this.markers) {\n markersTemplate = html `\n <div\n class=\"mdc-slider__track-marker-container\"\n style=\"${styleMap(this.trackMarkerContainerStyles)}\">\n </div>`;\n }\n let pin = '';\n if (this.pin) {\n pin = html `\n <div class=\"mdc-slider__pin\">\n <span class=\"mdc-slider__pin-value-marker\">${this.pinMarkerText}</span>\n </div>`;\n }\n return html `\n <div class=\"mdc-slider ${classMap(hostClassInfo)}\"\n tabindex=\"0\" role=\"slider\"\n aria-label=\"${ifDefined(this.ariaLabel)}\"\n aria-labelledby=\"${ifDefined(this.ariaLabelledBy)}\"\n aria-valuemin=\"${this.min}\" aria-valuemax=\"${this.max}\"\n aria-valuenow=\"${this.value}\"\n aria-disabled=\"${this.disabled.toString()}\"\n data-step=\"${this.step}\"\n @mousedown=${this.layout}\n @touchstart=${this.layout}>\n <div class=\"mdc-slider__track-container\">\n <div\n class=\"mdc-slider__track\"\n style=\"${styleMap(this.trackStyles)}\">\n </div>\n ${markersTemplate}\n </div>\n <div\n class=\"mdc-slider__thumb-container\"\n style=\"${styleMap(this.thumbContainerStyles)}\">\n <!-- TODO: use cache() directive -->\n ${pin}\n <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n </svg>\n <div class=\"mdc-slider__focus-ring\"></div>\n </div>\n </div>`;\n }", "title": "" }, { "docid": "50d03a821d61fdcbc37de0cbb2b59239", "score": "0.5080153", "text": "shouldComponentUpdate() { return false }", "title": "" }, { "docid": "660982672fa98a1e5996a8e462248e00", "score": "0.50758183", "text": "addOnControlsChange () {\n\n let onControlsChange = (event) => {\n this.render()\n }\n this.controls.addEventListener( 'change', onControlsChange )\n }", "title": "" }, { "docid": "45b9d546e9d944a3df9d81afb83b08aa", "score": "0.50714594", "text": "updateChart() {\n d3.select('.graph-area').attr('d', this.props.chartData.graphArea(this.props.data));\n d3.select('#bg-grid.verticalGrid').attr(\n {\n \"class\":\"verticalGrid\",\n \"y1\" : chartData.margins.top,\n \"y2\" : chartData.height - chartData.margins.bottom,\n \"x1\" : function(d){ return chartData.xRange(d);},\n \"x2\" : function(d){ return chartData.xRange(d);},\n \"fill\" : \"none\",\n \"shape-rendering\" : \"crispEdges\",\n \"stroke-width\" : \"1px\"\n });\n d3.select('#bg-grid.horizontalGrid').attr(\n {\n \"class\":\"horizontalGrid\",\n \"x1\" : 0,\n \"x2\" : chartData.width - chartData.margins.right - chartData.margins.left,\n \"y1\" : function(d){ return chartData.yRange(d);},\n \"y2\" : function(d){ return chartData.yRange(d);},\n \"fill\" : \"none\",\n \"shape-rendering\" : \"crispEdges\",\n \"stroke-width\" : \"1px\"\n });\n }", "title": "" }, { "docid": "f621d9824c746b953a61203df0ae902b", "score": "0.50692403", "text": "handleLayerRendererChange_() {\n this.map_.render();\n }", "title": "" }, { "docid": "f621d9824c746b953a61203df0ae902b", "score": "0.50692403", "text": "handleLayerRendererChange_() {\n this.map_.render();\n }", "title": "" }, { "docid": "1cd343bd46824126d3238062f65de4e6", "score": "0.50599027", "text": "componentDidUpdate() {\n this.renderChart();\n }", "title": "" }, { "docid": "aea490f72690baa8d78114523d07f9f8", "score": "0.5053636", "text": "function handleRenderSceneControls(controls) {\n // Switching to layer\n if (controls.activeControl === 'blood') {\n // Open brush tools if not already open\n if (!$('#brush-controls').length) {\n canvas.blood.createBrushControls();\n }\n }\n // Switching away from layer\n else {\n const bc = $('#brush-controls');\n if (bc)\n bc.remove();\n const bco = $('#brush-config');\n if (bco)\n bco.remove();\n }\n}", "title": "" }, { "docid": "6396edb43dd50e25535e7a2669969775", "score": "0.5052128", "text": "update_controls() {\n\n // default controls status\n $(this.prev_control).show();\n $(this.next_control).show();\n if (this.disable_type == \"disable\") {\n this.prev_control.classList.remove(\"disabled\");\n this.next_control.classList.remove(\"disabled\");\n }\n $(this.first_control).hide();\n $(this.last_control).hide();\n\n const visible_slides = $(this.slides).not('.shinyglide-hidden');\n const slide = visible_slides[this.glide.index];\n const n_slides = visible_slides.length - 1;\n\n this.update_conditions(slide);\n this.update_labels(slide);\n\n if (this.glide.index == 0) {\n $(this.prev_control).hide();\n $(this.first_control).show();\n }\n if (this.glide.index == n_slides) {\n $(this.next_control).hide();\n $(this.last_control).show();\n }\n\n this.update_loading_screens(slide);\n\n }", "title": "" }, { "docid": "b8b07d9eac0ee03e1aa0cbf8f00483d1", "score": "0.5050911", "text": "updateContainer() {\n // Should be in some update layout\n const renderingContext = this.renderingContext;\n const height = this.height;\n const width = Math.round(renderingContext.visibleWidth);\n const offsetX = -Math.round(renderingContext.timeToPixel(renderingContext.offset));\n\n this.$stage.width(width).height(this.height).offsetX(offsetX);\n this.$interactionsLayer.offsetX(-offsetX);\n this.$backgroundLayer.offsetX(-offsetX);\n this.$backgroundLayer.children[0].x(0).y(0).width(width).height(this.height).opacity(0).moveToBottom();\n this.$backgroundLayer.batchDraw();\n\n /*\n * Change the layer stack order according to Layer.zIndex.\n */\n // var zIndexCounter = 0;\n // var maxZIndex = -Infinity;\n // this.$backgroundLayer.setZIndex(zIndexCounter++);\n // this.layers.forEach((layer) => {\n // layer._contextLayer.setZIndex(layer.zIndex + zIndexCounter++);\n // layer._commonShapeLayer.setZIndex(layer.zIndex + zIndexCounter++);\n // layer.contentLayers.forEach((konvaLayer) => konvaLayer.setZIndex(layer.zIndex + zIndexCounter++));\n // layer._dragLayer.setZIndex(layer.zIndex + zIndexCounter++);\n // maxZIndex = Math.max(maxZIndex, layer.zIndex);\n // })\n // this.$interactionsLayer.setZIndex(maxZIndex + zIndexCounter);\n }", "title": "" }, { "docid": "6535ed215326f78e22d8d585333d0858", "score": "0.50497615", "text": "updateSize() {\n const profiles = {\n small: {\n margin: { top: 10, right: 10, left: 10, bottom: 0 },\n infoElHeight: 16,\n },\n medium: {\n margin: { top: 20, right: 20, left: 20, bottom: 30 },\n infoElHeight: 20,\n },\n large: {\n margin: { top: 30, right: 30, left: 30, bottom: 35 },\n infoElHeight: 22,\n }\n };\n\n const presentationProfileChanges = {\n medium: {\n infoElHeight: 26\n },\n large: {\n infoElHeight: 32\n }\n };\n\n this.activeProfile = this.getActiveProfile(profiles, presentationProfileChanges);\n const { margin } = this.activeProfile;\n const { infoElHeight } = this.activeProfile;\n\n //stage\n const height = this.height = (parseInt(this.element.style(\"height\"), 10) - margin.top - margin.bottom) || 0;\n const width = this.width = (parseInt(this.element.style(\"width\"), 10) - margin.left - margin.right) || 0;\n\n if (this.height <= 0 || this.width <= 0) return utils.warn(\"Bubble map updateSize() abort: vizabi container is too little or has display:none\");\n\n const boundBox = this.boundBox;\n const viewBox = [boundBox[0][0] * this.defaultWidth,\n boundBox[0][1] * this.defaultHeight,\n Math.abs(boundBox[1][0] - boundBox[0][0]) * this.defaultWidth,\n Math.abs(boundBox[1][1] - boundBox[0][1]) * this.defaultHeight];\n\n this.graph\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n this.year.resize(this.width, this.height);\n\n this.mapSvg\n .attr(\"width\", width)\n .attr(\"height\", height)\n .attr(\"viewBox\", viewBox.join(\" \"))\n .attr(\"preserveAspectRatio\", \"xMidYMid\")\n .attr(\"x\", margin.left)\n .attr(\"y\", margin.top)\n .style(\"transform\", \"translate3d(\" + margin.left + \"px,\" + margin.top + \"px,0)\");\n\n this.yTitleEl\n .style(\"font-size\", infoElHeight)\n .attr(\"transform\", \"translate(0,\" + margin.top + \")\");\n\n const yTitleBB = this.yTitleEl.select(\"text\").node().getBBox();\n\n this.sTitleEl.attr(\"transform\", \"translate(\" + 0 + \",\" + (margin.top + yTitleBB.height) + \")\")\n .classed(\"vzb-hidden\", this.model.marker.size.use == \"constant\");\n\n const warnBB = this.dataWarningEl.select(\"text\").node().getBBox();\n this.dataWarningEl.select(\"svg\")\n .attr(\"width\", warnBB.height * 0.75)\n .attr(\"height\", warnBB.height * 0.75)\n .attr(\"x\", -warnBB.width - warnBB.height * 1.2)\n .attr(\"y\", -warnBB.height * 0.65);\n\n this.dataWarningEl\n .attr(\"transform\", \"translate(\" + (this.width) + \",\" + (this.height - warnBB.height * 0.5) + \")\")\n .select(\"text\");\n\n if (this.yInfoEl.select(\"svg\").node()) {\n const titleBBox = this.yTitleEl.node().getBBox();\n const translate = d3.transform(this.yTitleEl.attr(\"transform\")).translate;\n\n this.yInfoEl.select(\"svg\")\n .attr(\"width\", infoElHeight)\n .attr(\"height\", infoElHeight);\n this.yInfoEl.attr(\"transform\", \"translate(\"\n + (titleBBox.x + translate[0] + titleBBox.width + infoElHeight * 0.4) + \",\"\n + (translate[1] - infoElHeight * 0.8) + \")\");\n }\n\n this.sInfoEl.classed(\"vzb-hidden\", this.sTitleEl.classed(\"vzb-hidden\"));\n\n if (!this.sInfoEl.classed(\"vzb-hidden\") && this.sInfoEl.select(\"svg\").node()) {\n const titleBBox = this.sTitleEl.node().getBBox();\n const translate = d3.transform(this.sTitleEl.attr(\"transform\")).translate;\n\n this.sInfoEl.select(\"svg\")\n .attr(\"width\", infoElHeight)\n .attr(\"height\", infoElHeight);\n this.sInfoEl.attr(\"transform\", \"translate(\"\n + (titleBBox.x + translate[0] + titleBBox.width + infoElHeight * 0.4) + \",\"\n + (translate[1] - infoElHeight * 0.8) + \")\");\n }\n }", "title": "" }, { "docid": "c3dbb192e349798abd982886643c5191", "score": "0.50332946", "text": "adjust() {\n this.renderer.adjust();\n }", "title": "" }, { "docid": "d29af8a73c642bff960d7396d972a6ce", "score": "0.50315183", "text": "renderReceptorChartControls() {\n const { receptorColorBy, receptorSortBy } = this.props;\n return (\n <div>\n <div className='chart-controls clearfix'>\n <div className='form-group'>\n <label className='small-label'>Color By</label>\n <div>\n <select className='form-control' value={receptorColorBy}\n onChange={this.onReceptorColorChange}>\n <option value='cellLineReceptorStatus'>Cell Line Receptor Status</option>\n <option value='cellLineMolecularSubtype'>Cell Line Molecular Subtype</option>\n <option value='none'>Nothing</option>\n </select>\n </div>\n </div>\n\n <div className='form-group'>\n <label className='small-label'>Sort By</label>\n <div>\n <select className='form-control' value={receptorSortBy}\n onChange={this.handleReceptorSortByChange}>\n <option value='magnitude'>Magnitude</option>\n <option value='cellLine'>Cell Line</option>\n </select>\n </div>\n </div>\n\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "6e493ed2613dd06c9ea0eb6c78372626", "score": "0.5024318", "text": "function updateGraph(dataContainer, playTransition = false) {\n\t\tconst { data, selectedFactor, selectedCountry, selectedWeek } = dataContainer\n\t\tconst filteredData = filterData(data, selectedFactor.value)\n\t\tplotLineChart(data, filteredData, selectedCountry, selectedFactor, selectedWeek, playTransition)\n\t}", "title": "" }, { "docid": "c65358398185038e05930ffdc36f3a76", "score": "0.50238407", "text": "_handleResizeWindow() {\n\t\tthis.graph.HandleResizeWindow(Math.max(document.getElementById(\"paper\").offsetWidth - 500, -500),\n\t\t\tMath.max(document.documentElement.clientHeight - 199, 0));\n\t}", "title": "" }, { "docid": "2e4249ca456890c7dcb88609d35ebe8b", "score": "0.50220704", "text": "function mapZoomControl() {\n}", "title": "" }, { "docid": "5b1160e366026db7f5b6815226e1397f", "score": "0.50209016", "text": "onResize (/*e*/) {\n let size = this.parentElement.clientWidth;\n this.radviz.config({size:size});\n this.__refresh();\n }", "title": "" }, { "docid": "899c81bbd9228bb51556f1765d6f5f20", "score": "0.5020887", "text": "updateGraph(){\n var that = this;\n var g = ReactDOM.findDOMNode(this).children[0];\n if(g){\n g.remove();\n }\n var inner = this.inner = this.svg.append(\"g\");\n // Create the renderer\n var render = new dagreD3.render();\n render.arrows().arrowPoint = (parent, id, edge, type) => {\n var marker = parent.append(\"marker\")\n .attr(\"id\", id)\n .attr(\"viewBox\", \"0 0 10 10\")\n .attr(\"refX\", 5)\n .attr(\"refY\", 5)\n .attr(\"markerUnits\", \"strokeWidth\")\n .attr(\"markerWidth\", 6)\n .attr(\"markerHeight\", 6.5)\n .attr(\"orient\", \"auto\");\n var path = marker.append(\"path\")\n .attr(\"d\", \"M 0 0 L 10 5 L 0 10 z\")\n .style(\"stroke-width\", 1)\n .style(\"stroke-dasharray\", \"1,0\")\n .style(\"fill\", \"grey\")\n .style(\"stroke\", \"grey\");\n dagreD3.util.applyStyle(path, edge[type + \"Style\"]);\n };\n\n render.shapes().img = (parent, bbox, node) => {\n var shapeSvg;\n if(parent){\n shapeSvg = parent.insert(\"image\")\n .attr(\"class\", \"nodeImage\")\n .attr(\"xlink:href\", function(d) {\n if (node) {\n if(node.type === 'spout'){\n return \"styles/img/icon-spout.png\";\n } else if(node.type === 'bolt'){\n return \"styles/img/icon-bolt.png\";\n }\n }\n }).attr(\"x\", \"-12px\")\n .attr(\"y\", \"-12px\")\n .attr(\"width\", \"30px\")\n .attr(\"height\", \"30px\");\n }\n node.intersect = function(point) {\n return dagreD3.intersect.circle(node, 20, point);\n };\n return shapeSvg;\n };\n this.svg.call(this.zoom).call(this.tooltip);\n // Run the renderer. This is what draws the final graph.\n render(inner, this.g);\n\n inner.selectAll(\"g.nodes image\")\n .on('mouseover', function(d) {\n that.tooltip.show(d, this);\n })\n .on('mouseout', function(d) {\n that.tooltip.hide(this);\n });\n inner.selectAll(\"g.nodes g.label\")\n .attr(\"transform\", \"translate(2,-30)\");\n // Center the graph\n var initialScale = 1;\n var svgWidth = this.svg[0][0].parentNode.clientWidth;\n var svgHeight = this.svg[0][0].parentNode.clientHeight;\n if(this.linkArray.length > 0){\n this.zoom.translate([(svgWidth - this.g.graph().width * initialScale) / 2, (svgHeight - this.g.graph().height * initialScale) / 2])\n .scale(initialScale)\n .event(this.svg);\n }\n }", "title": "" }, { "docid": "c020f6f801a8cdd4cd0fc6658815e95a", "score": "0.5014567", "text": "function onChartAfterUpdate(event) {\n if (!this.navigator && !this.scroller &&\n (this.options.navigator.enabled ||\n this.options.scrollbar.enabled)) {\n this.scroller = this.navigator = new NavigatorConstructor(this);\n if (pick(event.redraw, true)) {\n this.redraw(event.animation); // #7067\n }\n }\n }", "title": "" }, { "docid": "e55a554743f9db0eab2be528c2fcff53", "score": "0.501324", "text": "function renderGraph() {\n // Run the layout a fixed number of times.\n // The ideal number of times scales with graph complexity.\n // Of course, don't run too long—you'll hang the page!\n force.start();\n for (var i = 100; i > 0; --i) force.tick();\n force.stop();\n\n svg.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,\" + (margin.top + (height * 3 / 4)) + \")\")\n .call(xAxis);\n\n var circle = svg.selectAll(\"circle\")\n .data(nodes)\n .enter().append(\"circle\")\n .style(\"fill\", function (d) { return d.color; })\n .attr(\"cx\", function (d) { return d.x })\n .attr(\"cy\", function (d) { return d.y })\n .attr(\"r\", function (d) { return d.radius });\n\n loading.remove();\n }", "title": "" }, { "docid": "0b7df659db342cbf351cd01b36b2c66f", "score": "0.5011139", "text": "function zoomed() {\n //self.svg.select(\".x.axis\").call(xAxis);\n //self.svg.select(\".y.axis\").call(yAxis);\n\n trans=d3.event.translate;\n scale=d3.event.scale;\n\n self.nodeGroup.attr(\"transform\",\n \"translate(\" + trans + \")\"\n + \" scale(\" + scale + \")\");\n\n }", "title": "" }, { "docid": "51c47e6c6fa1423d81337555fe531d95", "score": "0.50092596", "text": "render() {\n const isDiscrete = this.step !== 0;\n const hostClassInfo = {\n 'mdc-slider--discrete': isDiscrete,\n 'mdc-slider--display-markers': this.markers && isDiscrete\n };\n let markersTemplate = '';\n\n if (isDiscrete && this.markers) {\n markersTemplate = html$1`\n <div\n class=\"mdc-slider__track-marker-container\"\n style=\"${styleMap(this.trackMarkerContainerStyles)}\">\n </div>`;\n }\n\n let pin = '';\n\n if (this.pin) {\n pin = html$1`\n <div class=\"mdc-slider__pin\">\n <span class=\"mdc-slider__pin-value-marker\">${this.pinMarkerText}</span>\n </div>`;\n }\n\n return html$1`\n <div class=\"mdc-slider ${classMap(hostClassInfo)}\"\n tabindex=\"0\" role=\"slider\"\n aria-valuemin=\"${this.min}\" aria-valuemax=\"${this.max}\"\n aria-valuenow=\"${this.value}\" aria-disabled=\"${this.disabled}\"\n data-step=\"${this.step}\"\n @mousedown=${this.layout}\n @touchstart=${this.layout}>\n <div class=\"mdc-slider__track-container\">\n <div\n class=\"mdc-slider__track\"\n style=\"${styleMap(this.trackStyles)}\">\n </div>\n ${markersTemplate}\n </div>\n <div\n class=\"mdc-slider__thumb-container\"\n style=\"${styleMap(this.thumbContainerStyles)}\">\n <!-- TODO: use cache() directive -->\n ${pin}\n <svg class=\"mdc-slider__thumb\" width=\"21\" height=\"21\">\n <circle cx=\"10.5\" cy=\"10.5\" r=\"7.875\"></circle>\n </svg>\n <div class=\"mdc-slider__focus-ring\"></div>\n </div>\n </div>`;\n }", "title": "" }, { "docid": "883bd1d3d850c492316c69a7a97bbd7f", "score": "0.5006607", "text": "zoomIn(e) {\n e.preventDefault();\n e.stopPropagation();\n let canvas = this.state.canvas;\n let zoom_rate = Number(this.state.zoom_rate);\n let zoom = canvas.getZoom()\n\n zoom *= 1 + (zoom_rate/100)\n canvas.setZoom(zoom)\n canvas.renderAll();\n}", "title": "" }, { "docid": "d804c26bda6ae752846449bcc855cf68", "score": "0.5000218", "text": "function updateControls(){\n updateControlMeters();\n updateControlButtons();\n}", "title": "" }, { "docid": "5e25a6549f3c0839bedb951b15226e9c", "score": "0.49970427", "text": "updateGraphics() {\n this.updateGraphicsCore();\n }", "title": "" }, { "docid": "c815ab1de707dbe2890bfeed8a08f743", "score": "0.49950022", "text": "_refreshRenderer(){\n this._viewer.impl.invalidate(true, true, false);\n }", "title": "" }, { "docid": "316ae98ae074637b54d813f2ae38f478", "score": "0.49948907", "text": "shouldComponentUpdate() {\n return false;\n }", "title": "" }, { "docid": "316ae98ae074637b54d813f2ae38f478", "score": "0.49948907", "text": "shouldComponentUpdate() {\n return false;\n }", "title": "" }, { "docid": "070f8238b3013d5e30b8c389d9edb1e5", "score": "0.4992056", "text": "function onResetDragZoom() {\n //resets translate and scale values\n window.svg.attr(\"transform\", \"translate(0,0)scale(1)\");\n}", "title": "" }, { "docid": "edf3b717d535a5f1db27569847e0877c", "score": "0.49919513", "text": "renderView() {\n // Update the view w/ new zoom/pan\n this.selectedView.attr('transform', this.state.viewTransform);\n\n clearTimeout(this.renderNodesTimeout);\n this.renderNodesTimeout = setTimeout(this.renderNodes);\n }", "title": "" }, { "docid": "c37311194c4aef266ad6184ebabda79c", "score": "0.49831113", "text": "renderVis() {\n let vis = this;\n\n // Add focus area path\n vis.focusAreas = vis.chart.selectAll('.area-path')\n .data(vis.stackedData)\n .join('path')\n .attr('class', d => 'area-path ' + 'layer-' + d.key)\n .attr('fill', d => vis.colorScale(d.key))\n .style('opacity', 0.9);\n\n // Based on if brushing or other transitions (filtering by crime type or going from absolute to relative levels)\n // Have to draw area paths with transitions or not (brushed doesn't detect transitions in this way)\n if (isBrushed) {\n vis.focusAreas.attr('d', vis.area);\n } else {\n vis.focusAreas.transition().duration(700).attr('d', vis.area);\n }\n\n // Update the axes/grid lines by calling axis functions\n // Second call removes axis lines and shows only grid lines\n vis.xAxisG\n .transition()\n .duration(1000)\n .call(vis.xAxis)\n .call(g => g.select('.domain').remove());\n\n vis.yAxisG\n .transition()\n .duration(1000)\n .call(vis.yAxis)\n .call(g => g.select('.domain').remove());\n }", "title": "" }, { "docid": "eec72071596d2790d068d9ebb7a72644", "score": "0.4982334", "text": "function disableZoom(){\n zoomListener.on(\"zoom\", null).on(\"zoomend\", null);\n rootSvg.on(\"mousedown.zoom\", null).on(\"wheel.zoom\", null)\n .on(\"mousemove.zoom\", null)\n .on(\"dblclick.zoom\", null)\n .on(\"touchstart.zoom\", null);\n}", "title": "" }, { "docid": "3ae308e4688c36a33f54652709cac1a5", "score": "0.49787778", "text": "function onResize() {\n //if (_this.chart) if (_this.chart.container) if (_this.chart.container.parentNode) _this.chart.setSize(_this.chart.container.parentNode.offsetWidth, _this.chart.container.parentNode.offsetHeight, false);\n if (_this.chart) _this.chart.reflow();\n }", "title": "" }, { "docid": "6a507c736677a978d243b70d7e252453", "score": "0.49760443", "text": "update() {\n // Update visibility of children.\n this.children.forEach((child, i) => {\n const anchor = this.anchors[i];\n child.visible = anchor === this.env.sourceId ||\n this.env.getVisible(this.env.sourceId).includes(anchor);\n });\n // Pulsate arrows and halos.\n const time = performance.now();\n this.arrows.forEach((arrow) => {\n if (arrow.pulsate) {\n const scale = 1 + 0.1 * Math.sin(time / 200);\n arrow.scale.set(scale, scale, scale);\n }\n });\n this.halos.forEach((halo) => {\n if (halo.pulsate) {\n const scale = 1.5 + 0.1 * Math.sin(time / 200);\n halo.scale.set(scale, scale, scale);\n }\n });\n }", "title": "" }, { "docid": "2cfecd2eacd1aa4800317a1faa9ce562", "score": "0.4966895", "text": "function resetGraph() {\n isDebug && isDebug && console.log(eventName.shown);\n self.util.applyBindEvent3dChart(target, options);\n // Turn off transitions for instant reset\n $.each(bars, function (i) {\n $(bars[i].bar).stop().css({'height': 0, '-webkit-transition': 'none'});\n });\n graphTransform = 'rotateX(' + initXRotation + 'deg) rotateY(' + initYRotation + 'deg)';\n container.css({'-webkit-transition': 'none', '-webkit-transform': graphTransform});\n\n // Clear timers\n clearTimeout(barTimer);\n clearTimeout(graphTimer);\n\n // Restart timer\n graphTimer = setTimeout(function () {\n // Apply webkit transitions for property changes\n graphTransform = 'rotateX(' + endXRotation + 'deg) rotateY(' + endYRotation + 'deg)';\n container.css({'-webkit-transform': graphTransform, '-webkit-transition': 'all 2.8s ease-out'});\n displayGraph(bars, 0);\n }, 100);\n }", "title": "" }, { "docid": "e08cca7a6d32e01f31b9965b530d69ea", "score": "0.4965941", "text": "_onFormChange() {\n this._removeAll();\n // remove all created labels\n for (var i = 0; i < this._labels.length; i++) {\n this._labels[i].dispose();\n }\n this._labels = [];\n\n this._render();\n }", "title": "" }, { "docid": "1fcbba14ac34063b060436cd002da488", "score": "0.49644583", "text": "shouldComponentUpdate() {\n return false;\n }", "title": "" } ]
6f76b299765ed74eecfcf2337c017616
Constructs a message reader
[ { "docid": "96c2c1b63a83de73081b65cf874829e8", "score": "0.0", "text": "constructor () {\n super()\n this.bytesLeft = 0\n this.data = Buffer.alloc(0)\n }", "title": "" } ]
[ { "docid": "c67cdf1e825f75f9c0d7a477905b3375", "score": "0.6313285", "text": "function createReader(...args) {\n return new Reader(...args)\n}", "title": "" }, { "docid": "6b8f62fc227541b5fb71d6bf8299ff0b", "score": "0.6134317", "text": "function read(controller, message) {\n controller.emit('read', message)\n\n var messageObj\n messageObj = Message.parse(message, controller)\n\n}", "title": "" }, { "docid": "a0d638a054d48c789e4ed8a8c295be1a", "score": "0.5737427", "text": "function WsReader() {\n /*\n * this function will construct <wsReader>\n */\n wsReader = this;\n require(\"util\").inherits(WsReader, require(\"stream\").Transform);\n require(\"stream\").Transform.call(wsReader);\n Object.assign(wsReader.__proto__, {\n _transform: wsReaderTransform\n });\n }", "title": "" }, { "docid": "c9cf1da917941a4fa52faf161c3f3094", "score": "0.5683626", "text": "static create(r, size = DEFAULT_BUF_SIZE) {\n return r instanceof BufReader ? r : new BufReader(r, size);\n }", "title": "" }, { "docid": "52e767781aca491de99429408640d698", "score": "0.55874544", "text": "static fromString(source) {\n RE_MESSAGE_START.lastIndex = 0;\n\n let resource = new this();\n let cursor = 0;\n\n // Iterate over the beginnings of messages and terms to efficiently skip\n // comments and recover from errors.\n while (true) {\n let next = RE_MESSAGE_START.exec(source);\n if (next === null) {\n break;\n }\n\n cursor = RE_MESSAGE_START.lastIndex;\n try {\n resource.set(next[1], parseMessage());\n } catch (err) {\n if (err instanceof FluentError) {\n // Don't report any Fluent syntax errors. Skip directly to the\n // beginning of the next message or term.\n continue;\n }\n throw err;\n }\n }\n\n return resource;\n\n // The parser implementation is inlined below for performance reasons.\n\n // The parser focuses on minimizing the number of false negatives at the\n // expense of increasing the risk of false positives. In other words, it\n // aims at parsing valid Fluent messages with a success rate of 100%, but it\n // may also parse a few invalid messages which the reference parser would\n // reject. The parser doesn't perform any validation and may produce entries\n // which wouldn't make sense in the real world. For best results users are\n // advised to validate translations with the fluent-syntax parser\n // pre-runtime.\n\n // The parser makes an extensive use of sticky regexes which can be anchored\n // to any offset of the source string without slicing it. Errors are thrown\n // to bail out of parsing of ill-formed messages.\n\n function test(re) {\n re.lastIndex = cursor;\n return re.test(source);\n }\n\n // Advance the cursor by the char if it matches. May be used as a predicate\n // (was the match found?) or, if errorClass is passed, as an assertion.\n function consumeChar(char, errorClass) {\n if (source[cursor] === char) {\n cursor++;\n return true;\n }\n if (errorClass) {\n throw new errorClass(`Expected ${char}`);\n }\n return false;\n }\n\n // Advance the cursor by the token if it matches. May be used as a predicate\n // (was the match found?) or, if errorClass is passed, as an assertion.\n function consumeToken(re, errorClass) {\n if (test(re)) {\n cursor = re.lastIndex;\n return true;\n }\n if (errorClass) {\n throw new errorClass(`Expected ${re.toString()}`);\n }\n return false;\n }\n\n // Execute a regex, advance the cursor, and return the capture group.\n function match(re) {\n re.lastIndex = cursor;\n let result = re.exec(source);\n if (result === null) {\n throw new FluentError(`Expected ${re.toString()}`);\n }\n cursor = re.lastIndex;\n return result[1];\n }\n\n function parseMessage() {\n let value = parsePattern();\n let attrs = parseAttributes();\n\n if (attrs === null) {\n if (value === null) {\n throw new FluentError(\"Expected message value or attributes\");\n }\n return value;\n }\n\n return {value, attrs};\n }\n\n function parseAttributes() {\n let attrs = {};\n\n while (test(RE_ATTRIBUTE_START)) {\n let name = match(RE_ATTRIBUTE_START);\n let value = parsePattern();\n if (value === null) {\n throw new FluentError(\"Expected attribute value\");\n }\n attrs[name] = value;\n }\n\n return Object.keys(attrs).length > 0 ? attrs : null;\n }\n\n function parsePattern() {\n // First try to parse any simple text on the same line as the id.\n if (test(RE_TEXT_RUN)) {\n var first = match(RE_TEXT_RUN);\n }\n\n // If there's a backslash escape or a placeable on the first line, fall\n // back to parsing a complex pattern.\n switch (source[cursor]) {\n case \"{\":\n case \"\\\\\":\n return first\n // Re-use the text parsed above, if possible.\n ? parsePatternElements(first)\n : parsePatternElements();\n }\n\n // RE_TEXT_VALUE stops at newlines. Only continue parsing the pattern if\n // what comes after the newline is indented.\n let indent = parseIndent();\n if (indent) {\n return first\n // If there's text on the first line, the blank block is part of the\n // translation content.\n ? parsePatternElements(first, trim(indent))\n // Otherwise, we're dealing with a block pattern. The blank block is\n // the leading whitespace; discard it.\n : parsePatternElements();\n }\n\n if (first) {\n // It was just a simple inline text after all.\n return trim(first);\n }\n\n return null;\n }\n\n // Parse a complex pattern as an array of elements.\n function parsePatternElements(...elements) {\n let placeableCount = 0;\n let needsTrimming = false;\n\n while (true) {\n if (test(RE_TEXT_RUN)) {\n elements.push(match(RE_TEXT_RUN));\n needsTrimming = true;\n continue;\n }\n\n if (source[cursor] === \"{\") {\n if (++placeableCount > MAX_PLACEABLES) {\n throw new FluentError(\"Too many placeables\");\n }\n elements.push(parsePlaceable());\n needsTrimming = false;\n continue;\n }\n\n let indent = parseIndent();\n if (indent) {\n elements.push(trim(indent));\n needsTrimming = false;\n continue;\n }\n\n if (source[cursor] === \"\\\\\") {\n elements.push(parseEscapeSequence(RE_TEXT_ESCAPE));\n needsTrimming = false;\n continue;\n }\n\n break;\n }\n\n if (needsTrimming) {\n // Trim the trailing whitespace of the last element if it's a\n // TextElement. Use a flag rather than a typeof check to tell\n // TextElements and StringLiterals apart (both are strings).\n let lastIndex = elements.length - 1;\n elements[lastIndex] = trim(elements[lastIndex]);\n }\n\n return elements;\n }\n\n function parsePlaceable() {\n consumeToken(TOKEN_BRACE_OPEN, FluentError);\n\n // VariantLists are parsed as selector-less SelectExpressions.\n let onlyVariants = parseVariants();\n if (onlyVariants) {\n consumeToken(TOKEN_BRACE_CLOSE, FluentError);\n return {type: \"select\", selector: null, ...onlyVariants};\n }\n\n let selector = parseInlineExpression();\n if (consumeToken(TOKEN_BRACE_CLOSE)) {\n return selector;\n }\n\n if (consumeToken(TOKEN_ARROW)) {\n let variants = parseVariants();\n consumeToken(TOKEN_BRACE_CLOSE, FluentError);\n return {type: \"select\", selector, ...variants};\n }\n\n throw new FluentError(\"Unclosed placeable\");\n }\n\n function parseInlineExpression() {\n if (source[cursor] === \"{\") {\n // It's a nested placeable.\n return parsePlaceable();\n }\n\n if (consumeChar(\"$\")) {\n return {type: \"var\", name: match(RE_IDENTIFIER)};\n }\n\n if (test(RE_IDENTIFIER)) {\n let ref = {type: \"ref\", name: match(RE_IDENTIFIER)};\n\n if (consumeChar(\".\")) {\n let name = match(RE_IDENTIFIER);\n return {type: \"getattr\", ref, name};\n }\n\n if (source[cursor] === \"[\") {\n return {type: \"getvar\", ref, selector: parseVariantKey()};\n }\n\n if (consumeToken(TOKEN_PAREN_OPEN)) {\n let callee = {...ref, type: \"func\"};\n return {type: \"call\", callee, args: parseArguments()};\n }\n\n return ref;\n }\n\n return parseLiteral();\n }\n\n function parseArguments() {\n let args = [];\n while (true) {\n switch (source[cursor]) {\n case \")\": // End of the argument list.\n cursor++;\n return args;\n case undefined: // EOF\n throw new FluentError(\"Unclosed argument list\");\n }\n\n args.push(parseArgument());\n // Commas between arguments are treated as whitespace.\n consumeToken(TOKEN_COMMA);\n }\n }\n\n function parseArgument() {\n let ref = parseInlineExpression();\n if (ref.type !== \"ref\") {\n return ref;\n }\n\n if (consumeToken(TOKEN_COLON)) {\n // The reference is the beginning of a named argument.\n return {type: \"narg\", name: ref.name, value: parseLiteral()};\n }\n\n // It's a regular message reference.\n return ref;\n }\n\n function parseVariants() {\n let variants = [];\n let count = 0;\n let star;\n\n while (test(RE_VARIANT_START)) {\n if (consumeChar(\"*\")) {\n star = count;\n }\n\n let key = parseVariantKey();\n cursor = RE_VARIANT_START.lastIndex;\n let value = parsePattern();\n if (value === null) {\n throw new FluentError(\"Expected variant value\");\n }\n variants[count++] = {key, value};\n }\n\n return count > 0 ? {variants, star} : null;\n }\n\n function parseVariantKey() {\n consumeToken(TOKEN_BRACKET_OPEN, FluentError);\n let key = test(RE_NUMBER_LITERAL)\n ? parseNumberLiteral()\n : match(RE_IDENTIFIER);\n consumeToken(TOKEN_BRACKET_CLOSE, FluentError);\n return key;\n }\n\n function parseLiteral() {\n if (test(RE_NUMBER_LITERAL)) {\n return parseNumberLiteral();\n }\n\n if (source[cursor] === \"\\\"\") {\n return parseStringLiteral();\n }\n\n throw new FluentError(\"Invalid expression\");\n }\n\n function parseNumberLiteral() {\n return {type: \"num\", value: match(RE_NUMBER_LITERAL)};\n }\n\n function parseStringLiteral() {\n consumeChar(\"\\\"\", FluentError);\n let value = \"\";\n while (true) {\n value += match(RE_STRING_RUN);\n\n if (source[cursor] === \"\\\\\") {\n value += parseEscapeSequence(RE_STRING_ESCAPE);\n continue;\n }\n\n if (consumeChar(\"\\\"\")) {\n return value;\n }\n\n // We've reached an EOL of EOF.\n throw new FluentError(\"Unclosed string literal\");\n }\n }\n\n // Unescape known escape sequences.\n function parseEscapeSequence(reSpecialized) {\n if (test(RE_UNICODE_ESCAPE)) {\n let sequence = match(RE_UNICODE_ESCAPE);\n return String.fromCodePoint(parseInt(sequence, 16));\n }\n\n if (test(reSpecialized)) {\n return match(reSpecialized);\n }\n\n throw new FluentError(\"Unknown escape sequence\");\n }\n\n // Parse blank space. Return it if it looks like indent before a pattern\n // line. Skip it othwerwise.\n function parseIndent() {\n let start = cursor;\n consumeToken(TOKEN_BLANK);\n\n // Check the first non-blank character after the indent.\n switch (source[cursor]) {\n case \".\":\n case \"[\":\n case \"*\":\n case \"}\":\n case undefined: // EOF\n // A special character. End the Pattern.\n return false;\n case \"{\":\n // Placeables don't require indentation (in EBNF: block-placeable).\n // Continue the Pattern.\n return source.slice(start, cursor).replace(RE_CRLF, \"\\n\");\n }\n\n // If the first character on the line is not one of the special characters\n // listed above, it's a regular text character. Check if there's at least\n // one space of indent before it.\n if (source[cursor - 1] === \" \") {\n // It's an indented text character (in EBNF: indented-char). Continue\n // the Pattern.\n return source.slice(start, cursor).replace(RE_CRLF, \"\\n\");\n }\n\n // A not-indented text character is likely the identifier of the next\n // message. End the Pattern.\n return false;\n }\n\n // Trim spaces trailing on every line of text.\n function trim(text) {\n return text.replace(RE_TRAILING_SPACES, \"\");\n }\n }", "title": "" }, { "docid": "f916f3828bf57dea691b461cab32b866", "score": "0.55874544", "text": "static fromString(source) {\n RE_MESSAGE_START.lastIndex = 0;\n\n let resource = new this();\n let cursor = 0;\n\n // Iterate over the beginnings of messages and terms to efficiently skip\n // comments and recover from errors.\n while (true) {\n let next = RE_MESSAGE_START.exec(source);\n if (next === null) {\n break;\n }\n\n cursor = RE_MESSAGE_START.lastIndex;\n try {\n resource.set(next[1], parseMessage());\n } catch (err) {\n if (err instanceof FluentError) {\n // Don't report any Fluent syntax errors. Skip directly to the\n // beginning of the next message or term.\n continue;\n }\n throw err;\n }\n }\n\n return resource;\n\n // The parser implementation is inlined below for performance reasons.\n\n // The parser focuses on minimizing the number of false negatives at the\n // expense of increasing the risk of false positives. In other words, it\n // aims at parsing valid Fluent messages with a success rate of 100%, but it\n // may also parse a few invalid messages which the reference parser would\n // reject. The parser doesn't perform any validation and may produce entries\n // which wouldn't make sense in the real world. For best results users are\n // advised to validate translations with the fluent-syntax parser\n // pre-runtime.\n\n // The parser makes an extensive use of sticky regexes which can be anchored\n // to any offset of the source string without slicing it. Errors are thrown\n // to bail out of parsing of ill-formed messages.\n\n function test(re) {\n re.lastIndex = cursor;\n return re.test(source);\n }\n\n // Advance the cursor by the char if it matches. May be used as a predicate\n // (was the match found?) or, if errorClass is passed, as an assertion.\n function consumeChar(char, errorClass) {\n if (source[cursor] === char) {\n cursor++;\n return true;\n }\n if (errorClass) {\n throw new errorClass(`Expected ${char}`);\n }\n return false;\n }\n\n // Advance the cursor by the token if it matches. May be used as a predicate\n // (was the match found?) or, if errorClass is passed, as an assertion.\n function consumeToken(re, errorClass) {\n if (test(re)) {\n cursor = re.lastIndex;\n return true;\n }\n if (errorClass) {\n throw new errorClass(`Expected ${re.toString()}`);\n }\n return false;\n }\n\n // Execute a regex, advance the cursor, and return all capture groups.\n function match(re) {\n re.lastIndex = cursor;\n let result = re.exec(source);\n if (result === null) {\n throw new FluentError(`Expected ${re.toString()}`);\n }\n cursor = re.lastIndex;\n return result;\n }\n\n // Execute a regex, advance the cursor, and return the capture group.\n function match1(re) {\n return match(re)[1];\n }\n\n function parseMessage() {\n let value = parsePattern();\n let attrs = parseAttributes();\n\n if (attrs === null) {\n if (value === null) {\n throw new FluentError(\"Expected message value or attributes\");\n }\n return value;\n }\n\n return {value, attrs};\n }\n\n function parseAttributes() {\n let attrs = {};\n\n while (test(RE_ATTRIBUTE_START)) {\n let name = match1(RE_ATTRIBUTE_START);\n let value = parsePattern();\n if (value === null) {\n throw new FluentError(\"Expected attribute value\");\n }\n attrs[name] = value;\n }\n\n return Object.keys(attrs).length > 0 ? attrs : null;\n }\n\n function parsePattern() {\n // First try to parse any simple text on the same line as the id.\n if (test(RE_TEXT_RUN)) {\n var first = match1(RE_TEXT_RUN);\n }\n\n // If there's a placeable on the first line, parse a complex pattern.\n if (source[cursor] === \"{\" || source[cursor] === \"}\") {\n // Re-use the text parsed above, if possible.\n return parsePatternElements(first ? [first] : [], Infinity);\n }\n\n // RE_TEXT_VALUE stops at newlines. Only continue parsing the pattern if\n // what comes after the newline is indented.\n let indent = parseIndent();\n if (indent) {\n if (first) {\n // If there's text on the first line, the blank block is part of the\n // translation content in its entirety.\n return parsePatternElements([first, indent], indent.length);\n }\n // Otherwise, we're dealing with a block pattern, i.e. a pattern which\n // starts on a new line. Discrad the leading newlines but keep the\n // inline indent; it will be used by the dedentation logic.\n indent.value = trim(indent.value, RE_LEADING_NEWLINES);\n return parsePatternElements([indent], indent.length);\n }\n\n if (first) {\n // It was just a simple inline text after all.\n return trim(first, RE_TRAILING_SPACES);\n }\n\n return null;\n }\n\n // Parse a complex pattern as an array of elements.\n function parsePatternElements(elements = [], commonIndent) {\n let placeableCount = 0;\n\n while (true) {\n if (test(RE_TEXT_RUN)) {\n elements.push(match1(RE_TEXT_RUN));\n continue;\n }\n\n if (source[cursor] === \"{\") {\n if (++placeableCount > MAX_PLACEABLES) {\n throw new FluentError(\"Too many placeables\");\n }\n elements.push(parsePlaceable());\n continue;\n }\n\n if (source[cursor] === \"}\") {\n throw new FluentError(\"Unbalanced closing brace\");\n }\n\n let indent = parseIndent();\n if (indent) {\n elements.push(indent);\n commonIndent = Math.min(commonIndent, indent.length);\n continue;\n }\n\n break;\n }\n\n let lastIndex = elements.length - 1;\n // Trim the trailing spaces in the last element if it's a TextElement.\n if (typeof elements[lastIndex] === \"string\") {\n elements[lastIndex] = trim(elements[lastIndex], RE_TRAILING_SPACES);\n }\n\n let baked = [];\n for (let element of elements) {\n if (element.type === \"indent\") {\n // Dedent indented lines by the maximum common indent.\n element = element.value.slice(0, element.value.length - commonIndent);\n } else if (element.type === \"str\") {\n // Optimize StringLiterals into their value.\n element = element.value;\n }\n if (element) {\n baked.push(element);\n }\n }\n return baked;\n }\n\n function parsePlaceable() {\n consumeToken(TOKEN_BRACE_OPEN, FluentError);\n\n // VariantLists are parsed as selector-less SelectExpressions.\n let onlyVariants = parseVariants();\n if (onlyVariants) {\n consumeToken(TOKEN_BRACE_CLOSE, FluentError);\n return {type: \"select\", selector: null, ...onlyVariants};\n }\n\n let selector = parseInlineExpression();\n if (consumeToken(TOKEN_BRACE_CLOSE)) {\n return selector;\n }\n\n if (consumeToken(TOKEN_ARROW)) {\n let variants = parseVariants();\n consumeToken(TOKEN_BRACE_CLOSE, FluentError);\n return {type: \"select\", selector, ...variants};\n }\n\n throw new FluentError(\"Unclosed placeable\");\n }\n\n function parseInlineExpression() {\n if (source[cursor] === \"{\") {\n // It's a nested placeable.\n return parsePlaceable();\n }\n\n if (test(RE_REFERENCE)) {\n let [, sigil, name, attr = null] = match(RE_REFERENCE);\n let type = {\"$\": \"var\", \"-\": \"term\"}[sigil] || \"ref\";\n\n if (source[cursor] === \"[\") {\n // DEPRECATED VariantExpressions will be removed before 1.0.\n return {type, name, selector: parseVariantKey()};\n }\n\n if (consumeToken(TOKEN_PAREN_OPEN)) {\n return {type, name, attr, args: parseArguments()};\n }\n\n return {type, name, attr, args: null};\n }\n\n return parseLiteral();\n }\n\n function parseArguments() {\n let args = [];\n while (true) {\n switch (source[cursor]) {\n case \")\": // End of the argument list.\n cursor++;\n return args;\n case undefined: // EOF\n throw new FluentError(\"Unclosed argument list\");\n }\n\n args.push(parseArgument());\n // Commas between arguments are treated as whitespace.\n consumeToken(TOKEN_COMMA);\n }\n }\n\n function parseArgument() {\n let ref = parseInlineExpression();\n if (ref.type !== \"ref\") {\n return ref;\n }\n\n if (consumeToken(TOKEN_COLON)) {\n // The reference is the beginning of a named argument.\n return {type: \"narg\", name: ref.name, value: parseLiteral()};\n }\n\n // It's a regular message reference.\n return ref;\n }\n\n function parseVariants() {\n let variants = [];\n let count = 0;\n let star;\n\n while (test(RE_VARIANT_START)) {\n if (consumeChar(\"*\")) {\n star = count;\n }\n\n let key = parseVariantKey();\n let value = parsePattern();\n if (value === null) {\n throw new FluentError(\"Expected variant value\");\n }\n variants[count++] = {key, value};\n }\n\n if (count === 0) {\n return null;\n }\n\n if (star === undefined) {\n throw new FluentError(\"Expected default variant\");\n }\n\n return {variants, star};\n }\n\n function parseVariantKey() {\n consumeToken(TOKEN_BRACKET_OPEN, FluentError);\n let key = test(RE_NUMBER_LITERAL)\n ? parseNumberLiteral()\n : match1(RE_IDENTIFIER);\n consumeToken(TOKEN_BRACKET_CLOSE, FluentError);\n return key;\n }\n\n function parseLiteral() {\n if (test(RE_NUMBER_LITERAL)) {\n return parseNumberLiteral();\n }\n\n if (source[cursor] === \"\\\"\") {\n return parseStringLiteral();\n }\n\n throw new FluentError(\"Invalid expression\");\n }\n\n function parseNumberLiteral() {\n return {type: \"num\", value: match1(RE_NUMBER_LITERAL)};\n }\n\n function parseStringLiteral() {\n consumeChar(\"\\\"\", FluentError);\n let value = \"\";\n while (true) {\n value += match1(RE_STRING_RUN);\n\n if (source[cursor] === \"\\\\\") {\n value += parseEscapeSequence();\n continue;\n }\n\n if (consumeChar(\"\\\"\")) {\n return {type: \"str\", value};\n }\n\n // We've reached an EOL of EOF.\n throw new FluentError(\"Unclosed string literal\");\n }\n }\n\n // Unescape known escape sequences.\n function parseEscapeSequence() {\n if (test(RE_STRING_ESCAPE)) {\n return match1(RE_STRING_ESCAPE);\n }\n\n if (test(RE_UNICODE_ESCAPE)) {\n let [, codepoint4, codepoint6] = match(RE_UNICODE_ESCAPE);\n let codepoint = parseInt(codepoint4 || codepoint6, 16);\n return codepoint <= 0xD7FF || 0xE000 <= codepoint\n // It's a Unicode scalar value.\n ? String.fromCodePoint(codepoint)\n // Lonely surrogates can cause trouble when the parsing result is\n // saved using UTF-8. Use U+FFFD REPLACEMENT CHARACTER instead.\n : \"�\";\n }\n\n throw new FluentError(\"Unknown escape sequence\");\n }\n\n // Parse blank space. Return it if it looks like indent before a pattern\n // line. Skip it othwerwise.\n function parseIndent() {\n let start = cursor;\n consumeToken(TOKEN_BLANK);\n\n // Check the first non-blank character after the indent.\n switch (source[cursor]) {\n case \".\":\n case \"[\":\n case \"*\":\n case \"}\":\n case undefined: // EOF\n // A special character. End the Pattern.\n return false;\n case \"{\":\n // Placeables don't require indentation (in EBNF: block-placeable).\n // Continue the Pattern.\n return makeIndent(source.slice(start, cursor));\n }\n\n // If the first character on the line is not one of the special characters\n // listed above, it's a regular text character. Check if there's at least\n // one space of indent before it.\n if (source[cursor - 1] === \" \") {\n // It's an indented text character (in EBNF: indented-char). Continue\n // the Pattern.\n return makeIndent(source.slice(start, cursor));\n }\n\n // A not-indented text character is likely the identifier of the next\n // message. End the Pattern.\n return false;\n }\n\n // Trim blanks in text according to the given regex.\n function trim(text, re) {\n return text.replace(re, \"\");\n }\n\n // Normalize a blank block and extract the indent details.\n function makeIndent(blank) {\n let value = blank.replace(RE_BLANK_LINES, \"\\n\");\n let length = RE_INDENT.exec(blank)[1].length;\n return {type: \"indent\", value, length};\n }\n }", "title": "" }, { "docid": "6bb16a6d868427af4c4fd93230ab4332", "score": "0.55453163", "text": "function ReceiveMessageCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }", "title": "" }, { "docid": "fad00f8c183817cc295954b14d5c6933", "score": "0.5540169", "text": "function RetryableMessage(argu) {\n var messageid;\n Message.call(this, argu);\n this.messageLength = function () {\n return 2;\n };\n this.writeMessage = function (Out) {\n var out = binaryHelper.convertStream(Out), id = this.getMessageId(), lsb = id & 0xff, msb = (id & 0xff00) >> 8;\n out.write(msb);\n out.write(lsb);\n return out;\n };\n this.readMessage = function (In, msglength) {\n var _in = binaryHelper.convertStream(In), msgid = _in.read() * 256 + _in.read();\n this.setMessageId(msgid);\n };\n this.setMessageId = function (_messageid) {\n messageid = _messageid;\n };\n this.getMessageId = function () {\n return messageid;\n };\n }", "title": "" }, { "docid": "a2a09c9bb13c97e990d298a72c097fba", "score": "0.55095315", "text": "function createReader(input, at) {\n typ.assertBuffer(input);\n at = typ.isDefined(at) ? at : 0;\n typ.assertUInt(at);\n\n var origAt = at;\n var remaining = input.length - at;\n\n if (remaining < 0) {\n remaining = 0;\n }\n\n function getReadCount() {\n return at - origAt;\n }\n\n function read(buf, offset, length) {\n typ.assertBuffer(buf);\n offset = typ.isDefined(offset) ? offset : 0;\n length = typ.isDefined(length) ? length : buf.length;\n typ.assertUInt(offset);\n typ.assertUInt(length);\n\n var bufLength = buf.length;\n if (offset >= bufLength) {\n throw new Error(\"offset >= bufLength\");\n }\n\n if ((offset + length) > bufLength) {\n throw new Error(\"(offset + length) > bufLength\");\n }\n\n if (remaining < length) {\n throw new Error(\"Insufficient data for read request.\");\n }\n\n input.copy(buf, offset, at, at + length);\n at += length;\n remaining -= length;\n }\n\n return {\n getReadCount: getReadCount,\n read: read\n };\n}", "title": "" }, { "docid": "46cbd3f7a41b04352156d4c5adece6d0", "score": "0.5470033", "text": "constructor() { \n QuotedMessageMessage.initialize(this);QuotedMessageExternalMessageId.initialize(this);\n QuotedMessage.initialize(this);\n }", "title": "" }, { "docid": "4f34eb5261659553f6efe464ae4fd84b", "score": "0.54481316", "text": "function MsgManager() {}", "title": "" }, { "docid": "95d24b3b4f59114c15315870cb45172a", "score": "0.5442185", "text": "function Message(arg) {\n // console.log(\"text in Message object: \" + arg.text);\n this.text = arg.text, this.message_side = arg.message_side;\n let author;\n \n if (this.message_side === 'left') { author = \"bot\";}\n else { author = \"human\"; }\n this.write = function (_this) {\n return function () {\n let $message;\n $message = $($('.message_template').clone().html());\n if (_this.text.message) {\n $message.addClass(_this.message_side).find('.text').html(_this.text.message.replace(/\\s?\\{[^}]+\\}/g, ''));\n } else {\n $message.addClass(_this.message_side).find('.text').html(_this.text.replace(/\\s?\\{[^}]+\\}/g, ''));\n }\n \n $('.messages').append($message);\n return setTimeout(function () {\n return $message.addClass('appeared');\n }, 0);\n };\n }(this);\n return this;\n}", "title": "" }, { "docid": "481058f27e29f9bda1ca9b1861bc0b01", "score": "0.54350156", "text": "function newMessage(m: MessageParts): Message {\n let message: Object = Object.create(messageProto)\n\n message.message_id = uuid()\n message.upload = m.upload\n message.created = Date.now()\n message.recipient = m.recipient\n message.sender = m.sender\n message.handled = null\n message.handled_by = null\n message.outcome = null\n message.read = null\n\n return message\n}", "title": "" }, { "docid": "179d8f07e772807b68439a2cf635043d", "score": "0.5426134", "text": "function createDeserialize(rootDescriptor, messageDescriptor, pbIdentifier) {\n return ts.createMethod(\n undefined,\n [ts.createModifier(ts.SyntaxKind.StaticKeyword)],\n undefined,\n ts.createIdentifier(\"deserialize\"),\n undefined,\n undefined,\n [\n ts.createParameter(\n undefined,\n undefined,\n undefined,\n ts.createIdentifier(\"bytes\"),\n undefined,\n ts.createUnionTypeNode([\n ts.createTypeReferenceNode(\n ts.createIdentifier(\"Uint8Array\"),\n undefined\n ),\n ts.createTypeReferenceNode(\n ts.createQualifiedName(pbIdentifier, \"BinaryReader\"),\n undefined\n ),\n ])\n ),\n ],\n ts.createTypeReferenceNode(messageDescriptor.getName(), undefined),\n ts.createBlock(\n [\n ts.createVariableStatement(\n undefined,\n ts.createVariableDeclarationList(\n [\n ts.createVariableDeclaration(\n \"reader\",\n undefined,\n ts.createConditional(\n ts.createBinary(\n ts.createIdentifier(\"bytes\"),\n ts.SyntaxKind.InstanceOfKeyword,\n ts.createIdentifier(\"Uint8Array\")\n ),\n ts.createNew(\n ts.createPropertyAccess(pbIdentifier, \"BinaryReader\"),\n undefined,\n [ts.createIdentifier(\"bytes\")]\n ),\n ts.createIdentifier(\"bytes\")\n )\n ),\n ts.createVariableDeclaration(\n \"message\",\n undefined,\n ts.createNew(\n ts.createIdentifier(messageDescriptor.getName()),\n undefined,\n []\n )\n ),\n ],\n ts.NodeFlags.Const\n )\n ),\n ts.createWhile(\n ts.createCall(\n ts.createPropertyAccess(ts.createIdentifier(\"reader\"), \"nextField\"),\n undefined,\n []\n ),\n ts.createBlock(\n [\n ts.createIf(\n ts.createCall(\n ts.createPropertyAccess(\n ts.createIdentifier(\"reader\"),\n \"isEndGroup\"\n ),\n undefined,\n undefined\n ),\n ts.createBreak()\n ),\n ts.createSwitch(\n ts.createCall(\n ts.createPropertyAccess(\n ts.createIdentifier(\"reader\"),\n \"getFieldNumber\"\n ),\n undefined,\n []\n ),\n ts.createCaseBlock([\n ...messageDescriptor.getFieldList().map((fd) => {\n let statements = [];\n\n if (\n isRepeated(fd) &&\n !isPackageable(fd) &&\n !isMessage(fd)\n ) {\n statements.push(\n ts.createStatement(\n ts.createCall(\n ts.createPropertyAccess(\n ts.createPropertyAccess(pbIdentifier, \"Message\"),\n \"addToRepeatedField\"\n ),\n undefined,\n [\n ts.createIdentifier(\"message\"),\n ts.createNumericLiteral(\n fd.getNumber().toString()\n ),\n ts.createCall(\n ts.createPropertyAccess(\n ts.createIdentifier(\"reader\"),\n `read${toBinaryMethodName(\n fd,\n rootDescriptor,\n false\n )}`\n ),\n undefined,\n []\n ),\n ]\n )\n )\n );\n } else if (isMessage(fd)) {\n const readCall = ts.createCall(\n ts.createPropertyAccess(\n ts.createIdentifier(\n getTypeName(fd, rootDescriptor.getPackage())\n ),\n \"deserialize\"\n ),\n undefined,\n [ts.createIdentifier(\"reader\")]\n );\n\n statements.push(\n ts.createStatement(\n ts.createCall(\n ts.createPropertyAccess(\n ts.createIdentifier(\"reader\"),\n \"readMessage\"\n ),\n undefined,\n [\n ts.createPropertyAccess(\n ts.createIdentifier(\"message\"),\n fd.getName()\n ),\n ts.createArrowFunction(\n undefined,\n undefined,\n [],\n undefined,\n ts.createToken(\n ts.SyntaxKind.EqualsGreaterThanToken\n ),\n isRepeated(fd)\n ? ts.createCall(\n ts.createPropertyAccess(\n ts.createPropertyAccess(\n pbIdentifier,\n \"Message\"\n ),\n \"addToRepeatedWrapperField\"\n ),\n undefined,\n [\n ts.createIdentifier(\"message\"),\n ts.createNumericLiteral(\n fd.getNumber().toString()\n ),\n readCall,\n ts.createIdentifier(\n getTypeName(\n fd,\n rootDescriptor.getPackage()\n )\n ),\n ]\n )\n : ts.createBinary(\n ts.createPropertyAccess(\n ts.createIdentifier(\"message\"),\n fd.getName()\n ),\n ts.SyntaxKind.EqualsToken,\n readCall\n )\n ),\n ]\n )\n )\n );\n } else {\n statements.push(\n ts.createStatement(\n ts.createBinary(\n ts.createPropertyAccess(\n ts.createIdentifier(\"message\"),\n fd.getName()\n ),\n ts.SyntaxKind.EqualsToken,\n ts.createCall(\n ts.createPropertyAccess(\n ts.createIdentifier(\"reader\"),\n `read${toBinaryMethodName(\n fd,\n rootDescriptor,\n false\n )}`\n ),\n undefined,\n []\n )\n )\n )\n );\n }\n statements.push(ts.createBreak());\n return ts.createCaseClause(\n ts.createNumericLiteral(fd.getNumber().toString()),\n statements\n );\n }),\n ts.createDefaultClause([\n ts.createStatement(\n ts.createCall(\n ts.createPropertyAccess(\n ts.createIdentifier(\"reader\"),\n \"skipField\"\n ),\n undefined,\n []\n )\n ),\n ]),\n ])\n ),\n ],\n true\n )\n ),\n ts.createReturn(ts.createIdentifier(\"message\")),\n ],\n true\n )\n );\n}", "title": "" }, { "docid": "9cfbb95c00d4b59f722ada2facdf9b7f", "score": "0.54196835", "text": "constructor() { \n \n Messages.initialize(this);\n }", "title": "" }, { "docid": "f118972fe674735f1d882c2bc41f5165", "score": "0.541954", "text": "function AbstractMessage() {}", "title": "" }, { "docid": "3a8637b11d0144fb997f9185c2f88e09", "score": "0.54158413", "text": "static from(buffer$1) {\n\t // Slice up wire data\n\t let byteArray = [...buffer$1];\n\t const numRequiredSignatures = byteArray.shift();\n\t const numReadonlySignedAccounts = byteArray.shift();\n\t const numReadonlyUnsignedAccounts = byteArray.shift();\n\t const accountCount = decodeLength(byteArray);\n\t let accountKeys = [];\n\n\t for (let i = 0; i < accountCount; i++) {\n\t const account = byteArray.slice(0, PUBKEY_LENGTH);\n\t byteArray = byteArray.slice(PUBKEY_LENGTH);\n\t accountKeys.push(bs58$1.encode(buffer.Buffer.from(account)));\n\t }\n\n\t const recentBlockhash = byteArray.slice(0, PUBKEY_LENGTH);\n\t byteArray = byteArray.slice(PUBKEY_LENGTH);\n\t const instructionCount = decodeLength(byteArray);\n\t let instructions = [];\n\n\t for (let i = 0; i < instructionCount; i++) {\n\t const programIdIndex = byteArray.shift();\n\t const accountCount = decodeLength(byteArray);\n\t const accounts = byteArray.slice(0, accountCount);\n\t byteArray = byteArray.slice(accountCount);\n\t const dataLength = decodeLength(byteArray);\n\t const dataSlice = byteArray.slice(0, dataLength);\n\t const data = bs58$1.encode(buffer.Buffer.from(dataSlice));\n\t byteArray = byteArray.slice(dataLength);\n\t instructions.push({\n\t programIdIndex,\n\t accounts,\n\t data\n\t });\n\t }\n\n\t const messageArgs = {\n\t header: {\n\t numRequiredSignatures,\n\t numReadonlySignedAccounts,\n\t numReadonlyUnsignedAccounts\n\t },\n\t recentBlockhash: bs58$1.encode(buffer.Buffer.from(recentBlockhash)),\n\t accountKeys,\n\t instructions\n\t };\n\t return new Message(messageArgs);\n\t }", "title": "" }, { "docid": "586933aacec1d21c3f74b10bf697388f", "score": "0.54137146", "text": "static create(state, message) {\r\n return MamCore.create(state, message);\r\n }", "title": "" }, { "docid": "fda196864b147c82d2900e2d9bfb40a4", "score": "0.5389931", "text": "constructor() {\n // Queue containing all messages\n this.msgQueue = [];\n this.queueLen = 0;\n }", "title": "" }, { "docid": "a8c9a2ee42751637213c4f0b4644f521", "score": "0.5389104", "text": "_initRead() {\n this._read = require('readline').createInterface({\n completer: this._readCompleter,\n historySize: 100,\n input: process.stdin,\n output: process.stdout,\n removeHistoryDuplicates: true\n }).on('line', this._readLine.bind(this))\n .on('close', this._readClose.bind(this));\n this._read.setPrompt('');\n }", "title": "" }, { "docid": "2ca713fb0fb4ab778d7095c0147a9a41", "score": "0.5379106", "text": "function initMessages(canvas){\n\n var messageIn = new YDYW_Message();\n messageIn.init(canvas);\n messageIn.set({\n width: doorWidth,\n height: doorHeight,\n left: insideDoorLeft, // * 1.25, //300,\n top: doorTop // 25\n });\n return messageIn;\n }", "title": "" }, { "docid": "a0f1c057a2621321a2a46a50f8426c65", "score": "0.5376819", "text": "constructor(msg) {\n this.msg = msg;\n }", "title": "" }, { "docid": "1a437aa62a8cc052c5287d4ae0712cc0", "score": "0.5347616", "text": "function BinaryReader() {\n this.incoming = [];\n this.incomingCount = 0;\n this.incomingOffset = { chunk: 0, byte: 0 };\n this.partialConsumed = 0;\n\n this.inputKey = null;\n }", "title": "" }, { "docid": "5564553fbed0230171af64d3bda1477a", "score": "0.53331643", "text": "function MessageGenerator(startDate, mode) {\n this._clock = startDate || new Date(2012, 5, 14);\n this._nextNameNumber = 0;\n this._nextSubjectNumber = 0;\n this._nextMessageIdNum = 0;\n\n this._mode = mode || 'info';\n}", "title": "" }, { "docid": "a18f08874739b3ee7ea1f04cf652bad8", "score": "0.5316805", "text": "constructor(props) {\n console.log('Messages::constructor()');\n super(props);\n }", "title": "" }, { "docid": "df3c6a514bbce78f518f2924f53d944b", "score": "0.5316638", "text": "function Reader(props) {\n _classCallCheck(this, Reader);\n\n var _this = _possibleConstructorReturn(this, (Reader.__proto__ || Object.getPrototypeOf(Reader)).call(this, props));\n\n _this.state = {\n noteForQuestion: _this.props.onQuestion,\n noteIsOpened: false,\n noteType: 'no-note'\n //on Click ->toggle noteIsOpened state to render Note OR null. Based on the highlighted text's ID, render a Note with noteType = \"note-color\"\n };_this.openNote = _this.openNote.bind(_this);\n return _this;\n }", "title": "" }, { "docid": "a2b7500a5e259b5636f5741787b70b40", "score": "0.5275794", "text": "constructor(correlationId, messageType, message) {\n this.correlation_id = correlationId;\n this.message_type = messageType;\n if (message instanceof Buffer)\n this.message = message;\n if (_.isString(message))\n this.setMessageAsString(message);\n else\n this.setMessageAsJson(message);\n this.message_id = pip_services3_commons_node_1.IdGenerator.nextLong();\n }", "title": "" }, { "docid": "490964e7b8e0f880b7684fd07ddcaaff", "score": "0.52547103", "text": "constructor(type, message, client) {\n\t\tthis._type = type;\n\t\tthis._message = message;\n\t\tthis._client = client;\n\t}", "title": "" }, { "docid": "cb87329822d3c03662ed97899e36f50a", "score": "0.5243152", "text": "function Message() {\n return Message.__super__.constructor.apply(this, arguments);\n }", "title": "" }, { "docid": "022b6008418b7adb7356f89965c416b0", "score": "0.52227074", "text": "constructor(message, decoded) {\n super(message);\n this.name = this.constructor.name;\n this.meta = decoded.meta;\n if (decoded.data) this.data = decoded.data;\n if (decoded.error) this.error = decoded.error;\n }", "title": "" }, { "docid": "047144d2f50a2adcd9c2c37495f19bc8", "score": "0.51840925", "text": "function MessageDeserializer(PacketManager_lengthInteger__var, PacketManager_lengthString__var, PacketManager_lengthUInt16__var, PacketManager_MAX_PACKET_SIZE__var, PacketManager_START_BYTE__var, PacketManager_STOP_BYTE__var, PacketManager_ESCAPE_BYTE__var, PacketManager_CODE_POSITION__var, PacketManager_LENGTH_POSITION__var, PacketManager_DATA_POSITION__var, PacketManager_buffer__var, PacketManager_index__var) {\n\nthis.ready = false;\n//Attributes\nthis.PacketManager_lengthInteger__var =PacketManager_lengthInteger__var;\nthis.PacketManager_lengthString__var =PacketManager_lengthString__var;\nthis.PacketManager_lengthUInt16__var =PacketManager_lengthUInt16__var;\nthis.PacketManager_MAX_PACKET_SIZE__var =PacketManager_MAX_PACKET_SIZE__var;\nthis.PacketManager_START_BYTE__var =PacketManager_START_BYTE__var;\nthis.PacketManager_STOP_BYTE__var =PacketManager_STOP_BYTE__var;\nthis.PacketManager_ESCAPE_BYTE__var =PacketManager_ESCAPE_BYTE__var;\nthis.PacketManager_CODE_POSITION__var =PacketManager_CODE_POSITION__var;\nthis.PacketManager_LENGTH_POSITION__var =PacketManager_LENGTH_POSITION__var;\nthis.PacketManager_DATA_POSITION__var =PacketManager_DATA_POSITION__var;\nthis.PacketManager_buffer__var =PacketManager_buffer__var;\nthis.PacketManager_index__var =PacketManager_index__var;//bindings\nvar connectors = [];\nthis.getConnectors = function() {\nreturn connectors;\n}\n\n//message queue\nvar queue = [];\nthis.getQueue = function() {\nreturn queue;\n}\n\n//callbacks for third-party listeners\n//ThingML-defined functions\nfunction forward() {\nPacketManager_index__var = PacketManager_DATA_POSITION__var;\nvar code__var = PacketManager_buffer__var[PacketManager_CODE_POSITION__var]\n;\n\nif(code__var === 10) {\ndeserializeRemote_temperature();\n\n}\nif(code__var === 11) {\ndeserializeRemote_light();\n\n}\n}\n\nthis.forward = function() {\nforward();}\n\nfunction deserializeRemote_temperature() {\nvar t__var = deserializeUInt16();\n\nconsole.log(\"t: \" + t__var);\nsendTemperatureOnRemoteControl(t__var);\n}\n\nthis.deserializeRemote_temperature = function() {\ndeserializeRemote_temperature();}\n\nfunction deserializeRemote_light() {\nvar t__var = deserializeUInt16();\n\nconsole.log(\"l: \" + t__var);\nsendLightOnRemoteControl(t__var);\n}\n\nthis.deserializeRemote_light = function() {\ndeserializeRemote_light();}\n\nfunction deserializeInteger() {\n\n var value = 0;\n for ( var i = 1; i >= 0; i--) {\n value = (value * 256) + readByte();\n }\n return value; \n \n}\n\nthis.deserializeInteger = function() {\ndeserializeInteger();}\n\nfunction deserializeUInt16() {\nreturn deserializeInteger();\n}\n\nthis.deserializeUInt16 = function() {\ndeserializeUInt16();}\n\nfunction receive(ArrayDeserializer_receive_bytes__var) {\nPacketManager_index__var = 0;\nvar size__var = PacketManager_DATA_POSITION__var + ArrayDeserializer_receive_bytes__var[PacketManager_LENGTH_POSITION__var + 1]\n + 1;\n\nvar i__var = 0;\n\nvar current__var = ArrayDeserializer_receive_bytes__var[i__var]\n;\n\nif(current__var === PacketManager_START_BYTE__var) {\ni__var = i__var + 1;\nvar next__var = ArrayDeserializer_receive_bytes__var[i__var]\n;\n\nif( !(next__var === PacketManager_STOP_BYTE__var)) {\nvar continue__var = true;\n\nwhile(continue__var && i__var < size__var) {\ncurrent__var = next__var;\ni__var = i__var + 1;\nnext__var = ArrayDeserializer_receive_bytes__var[i__var]\n;\nif(current__var === PacketManager_ESCAPE_BYTE__var) {\ncurrent__var = next__var;\ni__var = i__var + 1;\nsize__var = size__var + 1;\nnext__var = ArrayDeserializer_receive_bytes__var[i__var]\n;\n\n}\nstoreByte(current__var);\ncontinue__var = !(next__var === PacketManager_STOP_BYTE__var && !(current__var === PacketManager_ESCAPE_BYTE__var));\n\n}\nstoreByte(current__var);\nforward();\n\n}\n\n}\n}\n\nthis.receive = function(ArrayDeserializer_receive_bytes__var) {\nreceive(ArrayDeserializer_receive_bytes__var);}\n\nfunction setHeader(PacketManager_setHeader_code__var, PacketManager_setHeader_length__var) {\nPacketManager_index__var = 0;\nstoreByte(1);\nstoreByte(0);\nstoreByte(0);\nPacketManager_CODE_POSITION__var = PacketManager_index__var;\nstoreByte(PacketManager_setHeader_code__var);\nPacketManager_LENGTH_POSITION__var = PacketManager_index__var;\nstoreByte(PacketManager_setHeader_length__var);\nPacketManager_DATA_POSITION__var = PacketManager_index__var;\nPacketManager_index__var = PacketManager_DATA_POSITION__var;\n}\n\nthis.setHeader = function(PacketManager_setHeader_code__var, PacketManager_setHeader_length__var) {\nsetHeader(PacketManager_setHeader_code__var, PacketManager_setHeader_length__var);}\n\nfunction storeByte(PacketManager_storeByte_b__var) {\nif(PacketManager_index__var === PacketManager_MAX_PACKET_SIZE__var) {\nconsole.log(\"ERROR: \" + \"BUFFER OVERFLOW: \" + PacketManager_storeByte_b__var + \" has been ignored. Current index = \" + PacketManager_index__var);\n\n}\nif(PacketManager_index__var < PacketManager_MAX_PACKET_SIZE__var) {\nPacketManager_buffer__var[PacketManager_index__var] = PacketManager_storeByte_b__var;\nPacketManager_index__var = PacketManager_index__var + 1;\n\n}\n}\n\nthis.storeByte = function(PacketManager_storeByte_b__var) {\nstoreByte(PacketManager_storeByte_b__var);}\n\nfunction readByte() {\nvar b__var;\n\nif(PacketManager_index__var < PacketManager_MAX_PACKET_SIZE__var) {\nb__var = PacketManager_buffer__var[PacketManager_index__var]\n;\nPacketManager_index__var = PacketManager_index__var + 1;\n\n}\nif(PacketManager_index__var === PacketManager_MAX_PACKET_SIZE__var) {\nconsole.log(\"ERROR: \" + \"BUFFER OVERFLOW: trying to read out of buffer boundaries\");\nb__var = PacketManager_STOP_BYTE__var;\n\n}\nreturn b__var;\n}\n\nthis.readByte = function() {\nreadByte();}\n\nfunction escape() {\nvar escaped__var = [];\n\nvar stop__var = PacketManager_DATA_POSITION__var + PacketManager_buffer__var[PacketManager_LENGTH_POSITION__var]\n;\n\nvar i__var = 0;\n\nvar j__var = 0;\n\nescaped__var[j__var] = PacketManager_START_BYTE__var;\nj__var = j__var + 1;\nvar current__var;\n\nwhile(i__var < stop__var) {\ncurrent__var = PacketManager_buffer__var[i__var]\n;\nif(current__var === PacketManager_START_BYTE__var || current__var === PacketManager_STOP_BYTE__var || current__var === PacketManager_ESCAPE_BYTE__var) {\nescaped__var[j__var] = PacketManager_ESCAPE_BYTE__var;\nj__var = j__var + 1;\n\n}\nescaped__var[j__var] = current__var;\nj__var = j__var + 1;\ni__var = i__var + 1;\n\n}\nescaped__var[j__var] = PacketManager_STOP_BYTE__var;\nreturn escaped__var;\n}\n\nthis.escape = function() {\nescape();}\n\nfunction send() {\nsendWrite_bytesOnOut(escape());\n}\n\nthis.send = function() {\nsend();}\n\n//Internal functions\nfunction _send(message) {\nvar json = JSON.parse(message);\nvar port = json.port;\nvar arrayLength = connectors.length;\nfor (var i = 0; i < arrayLength; i++) {\nvar c = connectors[i];\nc.forward(message);\n}\n}\n\nfunction sendTemperatureOnRemoteControl(temp) {\nvar msg = '{\"message\":\"temperature\",\"port\":\"RemoteControl_c\", \"temp\":' + temp + '}';\n_send(msg);\n}\n\nfunction sendLightOnRemoteControl(light) {\nvar msg = '{\"message\":\"light\",\"port\":\"RemoteControl_c\", \"light\":' + light + '}';\n_send(msg);\n}\n\nfunction sendWrite_bytesOnOut(b) {\nvar msg = '{\"message\":\"write_bytes\",\"port\":\"out_c\", \"b\":[' + b + ']}';\n_send(msg);\n}\n\n//Init state machine\nthis.MessageDeserializer_receive = buildStateMachine(\"receive\");\nvar MessageDeserializer_receive_default = buildRegion(\"_default\", this.MessageDeserializer_receive);\nthis._initial_MessageDeserializer_receive = buildInitialState(\"_initial\", MessageDeserializer_receive_default);\n//State machine (states and regions)\nvar MessageDeserializer_receive_Idle = buildSimpleState(\"Idle\", MessageDeserializer_receive_default);\nMessageDeserializer_receive_Idle.entry = [MessageDeserializer_receive_Idle_entry];\n//State machine (transitions)\nvar t0 = new buildEmptyTransition(this._initial_MessageDeserializer_receive, MessageDeserializer_receive_Idle);\nvar t1 = buildTransition(MessageDeserializer_receive_Idle, null, function (s, c) {var json = JSON.parse(c); return json.port === \"in_c\" && json.message === \"receive_bytes\"});\nt1.effect = [t1_effect];\n//State machine (actions on states and transitions)\nfunction MessageDeserializer_receive_entry(context, message) {\nconsole.log(\"Decoder ready!\");\n}\n\nfunction MessageDeserializer_receive_Idle_entry(context, message) {\nconsole.log(\"Decoder ready indeed!\");\n}\n\nfunction t1_effect(context, message) {\nvar json = JSON.parse(message);\nconsole.log(\"byte[] received from serial. Will try to decode it!...\");\nreceive(json.b);\n}\n\n}", "title": "" }, { "docid": "067cf4070c41146ecf6e45d71d883bc5", "score": "0.5153917", "text": "function createMessage(rootDescriptor, messageDescriptor, pbIdentifier) {\n const members = [];\n\n // Create constructor\n members.push(\n createConstructor(rootDescriptor, messageDescriptor, pbIdentifier)\n );\n\n // Create getter and setters\n for (const fieldDescriptor of messageDescriptor.getFieldList()) {\n members.push(createGetter(rootDescriptor, fieldDescriptor, pbIdentifier));\n members.push(createSetter(rootDescriptor, fieldDescriptor, pbIdentifier));\n }\n\n // Create toObject method\n members.push(createToObject(rootDescriptor, messageDescriptor));\n\n // Create serialize method\n members.push(\n createSerialize(\n rootDescriptor,\n messageDescriptor.getFieldList(),\n pbIdentifier\n )\n );\n\n // Create deserialize method\n members.push(\n createDeserialize(rootDescriptor, messageDescriptor, pbIdentifier)\n );\n\n // Create message class\n return ts.createClassDeclaration(\n undefined,\n [ts.createModifier(ts.SyntaxKind.ExportKeyword)],\n ts.createIdentifier(messageDescriptor.getName()),\n undefined,\n [\n ts.createHeritageClause(ts.SyntaxKind.ExtendsKeyword, [\n ts.createExpressionWithTypeArguments(\n undefined,\n ts.createPropertyAccess(pbIdentifier, ts.createIdentifier(\"Message\"))\n ),\n ]),\n ],\n members\n );\n}", "title": "" }, { "docid": "6ff1e0149eefc7b64ef8ab937e4919c9", "score": "0.5149705", "text": "chunk() {\n do {\n const message = this.reader.readCString();\n if (!message) break;\n\n this.push(message);\n } while (this.reader.length);\n\n if (!this.reader.length) this.reader.reset();\n else if (this.reader.capacity / 2 < this.reader.offset) this.reader.drain();\n }", "title": "" }, { "docid": "6a147f04610cdcb5ca31bd212f2a1bb2", "score": "0.5147281", "text": "function Client() {\n var timeoutMillis = 100000, lastReadTimer, task, self = this, _enum, _obj;\n this.timeout_ = null;\n this.appId = \"\";\n this.sdkVer = \"1.0.0\";\n this.apiVer = \"1.0.0\";\n this.channel = null;\n this.messageId = 0;\n this.appToken = \"\";\n this.group = null;\n this.handler = null;\n this.userId = \"\";\n this.userInfo = null;\n this.ConversationList = [];\n this.oldestConversation = [];\n this.ReceiveMessageListener = null;\n\n function timeout(x) {\n try {\n x.channel.disconnect();\n } catch (e) {\n\n }\n clearTimeout(x.timeout_);\n x.timeout_ = null;\n x.channel.socket.fire(\"statuschanged\", 4);\n x.channel.reconnect();\n }\n\n function myTask(x) {\n var m = x;\n this.run = function () {\n if (!m.timeout_) {\n return;\n }\n timeout(m);\n }\n }\n\n function Channel(main, address, cb) {\n var socketurl = address.host + address.port + \"?appId=\" + main.appId + \"&token=\" + encodeURIComponent(main.appToken) + \"&sdkVer=\" + main.sdkVer + \"&apiVer=\" + main.apiVer;\n this.socket = io.connect(socketurl, cb);\n this.writeAndFlush = function (val) {\n var stream = new RongIMStream([]);\n var msg = new MessageOutputStream(stream);\n msg.writeMessag(val);\n this.socket.send(stream.getBytesArray(true));\n };\n this.reconnect = function () {\n this.socket = this.socket.reconnect();\n };\n this.disconnect = function (x) {\n var code = 4;\n if (x) {\n code = x;\n }\n this.socket.disconnect(code);\n };\n this.isWriteable = function () {\n return io.getInstance().connected || io.getInstance().connecting;\n };\n this.setConnectStatusListener = function (_enum, func) {\n if (typeof func == \"object\" && \"onChanged\" in func) {\n this.socket.on(\"statuschanged\", function (code) {\n if (code instanceof DisconnectionStatus) {\n func.onChanged(code);\n return;\n }\n func.onChanged(_enum.setValue(code));\n });\n } else {\n throw new Error(\"setConnectStatusListener:参数格式不正确\");\n }\n };\n this.socket.on(\"message\", main.handler.handleMessage, main.handler)\n this.socket.on(\"disconnect\", function () {\n this.channel.socket.fire(\"statuschanged\", 6);\n }, main);\n }\n\n function callbackMapping(entity, tag) {\n switch (tag) {\n case \"GetUserInfoOutput\":\n var userinfo = new RongIMClient.UserInfo();\n userinfo.setUserId(entity.getUserId());\n userinfo.setUserName(entity.getUserName());\n userinfo.setPortraitUri(entity.getUserPortrait());\n return userinfo;\n case \"GetQNupTokenOutput\":\n return {deadline: io.util.int64ToTimestamp(entity.getDeadline()), token: entity.getToken()};\n case \"GetQNdownloadUrlOutput\":\n return {downloadUrl: entity.getDownloadUrl()};\n default:\n return {};\n }\n }\n\n this.removeConversationListCache = function () {\n var val = this.ConversationList.splice(10);\n this.oldestConversation.splice(10 - val.length), _str = \"\";\n this.oldestConversation = val.concat(this.oldestConversation);\n };\n\n this.resumeTimer = function () {\n if (!this.timeout_) {\n task = new myTask(this);\n this.timeout_ = setTimeout(task.run, timeoutMillis);\n }\n lastReadTimer = Date.now();\n };\n\n this.pauseTimer = function () {\n if (this.timeout_) {\n clearTimeout(this.timeout_);\n this.timeout_ = null;\n }\n };\n\n this.setReceiveMessageListener = function (listener) {\n if ((listener instanceof Client.ReceivePublishMessageListener || typeof listener == \"object\") && \"onReceived\" in listener)\n this.ReceiveMessageListener = listener;\n };\n\n this.connect = function (_token, _callback) {\n this.appToken = _token;\n Client.getServerEndpoint(_token, this.appId);\n var count = 0;\n window.getEndpoint = setInterval(function () {\n count++;\n if (Client.Endpoint.port && Client.Endpoint.host) {\n clearInterval(window.getEndpoint);\n delete window.getEndpoint;\n self.handler = new MessageHandler(self);\n self.handler.setReceiveMessageListener(self.ReceiveMessageListener);\n self.channel = new Channel(self, Client.Endpoint, function () {\n self.handler.setConnectCallback(_callback);\n self.keeplive();\n });\n if (_enum && _obj)\n self.channel.setConnectStatusListener(_enum, _obj);\n self.channel.socket.fire(\"statuschanged\", 1);\n }\n if (count >= 10) {\n clearInterval(window.getEndpoint);\n throw new Error(\"token is vaild\");\n }\n }, 500);\n return false;\n };\n\n this.close = function () {\n this.channel.disconnect(4);\n };\n\n this.setConnectionStatusListener = function (enums, obj) {\n _enum = enums;\n _obj = obj;\n };\n\n this.keeplive = function () {\n var appid = this.appId,\n self = this;\n var heartbeat = setInterval(function () {\n if (!self.channel.isWriteable()) {\n //console.log(\"dis\");\n //clearInterval(heartbeat);\n // self.channel.reconnect();\n } else {\n self.resumeTimer();\n self.channel.writeAndFlush(new PingReqMessage());\n console.log(\"keep live pingReqMessage sending appId \" + appid);\n }\n }, 180000); //240000\n };\n\n this.publishMessage = function (_topic, _data, _targetId, _callback, _msg) {\n this.messageId++;\n if (this.messageId > 60000) {\n console.log(\"publish message is over limited\");\n this.channel.reconnect();\n }\n var msg = new PublishMessage(_topic, _data, _targetId);\n msg.setMessageId(this.messageId);\n if (_callback) {\n msg.setQos(new Qos(1));\n this.channel.writeAndFlush(msg);\n this.handler.putPublishCallback(_callback, msg.getMessageId(), _msg)\n } else {\n msg.setQos(new Qos(0));\n this.channel.writeAndFlush(msg);\n }\n };\n\n this.queryMessage = function (_topic, _data, _targetId, _qos, _callback, pbtype) {\n this.messageId++;\n if (this.messageId > 60000) {\n this.channel.reconnect();\n }\n var msg = new QueryMessage(_topic, _data, _targetId);\n msg.setMessageId(this.messageId);\n msg.setQos(_qos);\n this.handler.putQueryCallback(_callback, msg.getMessageId(), pbtype);\n if (this.channel.isWriteable()) {\n this.channel.writeAndFlush(msg);\n }\n };\n\n this.PublishCallback = function (cb, _timeout) {\n MessageCallback.call(this, _timeout);\n this.process = function (_staus, _serverTime, _msg) {\n this.readTimeOut();\n if (_staus == 0) {\n if (_msg) {\n _msg.setSentStatus(RongIMClient.SentStatus.RECEIVED);\n }\n cb();\n } else {\n _timeout(RongIMClient.callback.ErrorCode.UNKNOW);\n }\n };\n var arg = arguments.callee;\n this.readTimeOut = function () {\n arg.prototype.readTimeOut.call(this);\n };\n };\n this.PublishCallback.prototype = new MessageCallback();\n this.PublishCallback.prototype.constructor = this.PublishCallback;\n\n this.QueryCallback = function (cb, _timeout) {\n MessageCallback.call(this, _timeout);\n this.process = function (status, data, serverTime, pbtype) {\n this.readTimeOut();\n if (status == 0) {\n if (pbtype && data) {\n var entity = Modules[pbtype].decode(data);\n cb(callbackMapping(entity, pbtype));\n } else {\n cb(status, data, serverTime);\n }\n } else {\n _timeout(RongIMClient.callback.ErrorCode.UNKNOW);\n }\n };\n var arg = arguments.callee;\n this.readTimeOut = function () {\n arg.prototype.readTimeOut.call(this);\n };\n };\n this.QueryCallback.prototype = new MessageCallback();\n this.QueryCallback.prototype.constructor = this.QueryCallback;\n\n this.ConnectAck = function (cb, _timeout) {\n MessageCallback.call(this, _timeout);\n this.process = function (status, userId) {\n this.readTimeOut();\n if (status.getValue() == 0) {\n if (self.userId != userId)\n RongIMClient.getInstance().getUserInfo(userId, {\n onSuccess: function (data) {\n self.userInfo = data;\n },\n onError: function () {\n console.warn(\"拉取用户资料失败\");\n }\n });\n self.userId = userId;\n self.syncTime(self.appId, self.userId, self, self.handler.listener);\n cb(userId);\n io.getInstance().fire(\"statuschanged\", 0);\n io.getInstance()._doQueue();\n } else {\n _timeout(RongIMClient.ConnectCallback.ErrorCode.setValue(status.getValue()));\n }\n };\n var arg = arguments.callee;\n this.readTimeOut = function () {\n arg.prototype.readTimeOut.call(this);\n };\n };\n this.ConnectAck.prototype = new MessageCallback();\n this.ConnectAck.prototype.constructor = this.ConnectAck;\n\n this.syncTimeStorage = function (id, time) {\n if (arguments.length == 1) {\n return io.util.cookieHelper.getCookie(\"SyncTime\") || 0;\n } else {\n io.util.cookieHelper.setCookie(\"SyncTime\", time);\n }\n };\n\n this.syncTime = function (_appId, _currentUserId, _client, _listener) {\n var time = self.syncTimeStorage(_currentUserId), modules = new Modules.SyncRequestMsg();\n modules.setSyncTime(time);\n modules.setIspolling(false);\n _client.queryMessage(\"pullMsg\", io.util.arrayFrom(modules.toArrayBuffer()), _currentUserId, Qos.valueOf(1), {\n onSuccess: function (status, data, servertime) {\n if (status == 0) {\n var collection = Modules.DownStreamMessages.decode(data);\n self.syncTimeStorage(_currentUserId, io.util.int64ToTimestamp(collection.getSyncTime()));\n var list = collection.getList();\n if (_listener) {\n for (var i = 0; i < list.length; i++) {\n _listener.onReceived(list[i]);\n }\n }\n }\n },\n onError: function () {\n\n }\n });\n }\n }", "title": "" }, { "docid": "8dfe614a16d4fa9b912eebe9902e98f2", "score": "0.5144923", "text": "function Reader() {\n this.content = listingContent; \n this.currentFeed = false;\n this.currentFeedUnread = 0;\n this.scrollbar = new CustomScrollbar(this);\n \n commandsClose.onclick = this.showFeed.bind(this);\n commandsFeeds.onclick = this.showListing.bind(this);\n reload.onclick = this.reload.bind(this); \n markRead.onclick = this.markRead.bind(this);\n \n \n}", "title": "" }, { "docid": "5682e629980bea955261c3abb7011cc0", "score": "0.5140044", "text": "function constructMessage(msg, data){\n return {\"Msg\" : msg, \"Data\": data};\n}", "title": "" }, { "docid": "74d0114fb6a8aa27a03ea443e7b4e2d3", "score": "0.5136448", "text": "function createMessage(options, content, metadata, buffers) {\n\t if (content === void 0) { content = {}; }\n\t if (metadata === void 0) { metadata = {}; }\n\t if (buffers === void 0) { buffers = []; }\n\t return {\n\t header: {\n\t username: options.username || '',\n\t version: '5.0',\n\t session: options.session,\n\t msg_id: options.msgId || utils.uuid(),\n\t msg_type: options.msgType\n\t },\n\t parent_header: {},\n\t channel: options.channel,\n\t content: content,\n\t metadata: metadata,\n\t buffers: buffers\n\t };\n\t }", "title": "" }, { "docid": "feb3bd768d7ab52bcf39654a90e0634b", "score": "0.51257014", "text": "function ConnectMessage() {\n var CONNECT_HEADER_SIZE = 12, protocolId = \"RCloud\", protocolVersion = 3, clientId, keepAlive, appId, token, cleanSession, willTopic, will, willQos, retainWill, hasAppId, hasToken, hasWill;\n\n switch (arguments.length) {\n case 0:\n Message.call(this, new type(1));\n break;\n case 1:\n Message.call(this, arguments[0]);\n break;\n case 3:\n Message.call(this, new type(1));\n if (!arguments[0] || arguments.length > 64)\n throw new Error(\"Client id cannot be null and must be at most 64 characters long: \" + arguments[0]);\n clientId = arguments[0];\n cleanSession = arguments[1];\n keepAlive = arguments[2];\n break;\n }\n //override\n this.messageLength = function () {\n var payloadSize = binaryHelper.toMQttString(clientId).length;\n payloadSize += binaryHelper.toMQttString(willTopic).length;\n payloadSize += binaryHelper.toMQttString(will).length;\n payloadSize += binaryHelper.toMQttString(appId).length;\n payloadSize += binaryHelper.toMQttString(token).length;\n return payloadSize + CONNECT_HEADER_SIZE;\n };\n this.readMessage = function (In, length) {\n var stream = binaryHelper.convertStream(In);\n protocolId = stream.readUTF();\n protocolVersion = stream.readByte();//readByte()\n var cFlags = stream.readByte();\n hasAppId = (cFlags & 0x80) > 0;\n hasToken = (cFlags & 0x40) > 0;\n retainWill = (cFlags & 0x20) > 0;\n willQos = Qos.valueOf(cFlags >> 3 & 0x03).currentValue();\n hasWill = (cFlags & 0x04) > 0;\n cleanSession = (cFlags & 0x20) > 0;\n keepAlive = stream.read() * 256 + stream.read();\n clientId = stream.readUTF();\n if (hasWill) {\n willTopic = stream.readUTF();\n will = stream.readUTF();\n }\n if (hasAppId) {\n try {\n appId = stream.readUTF();\n } catch (ex) {\n\n }\n }\n if (hasToken) {\n try {\n token = stream.readUTF();\n } catch (ex) {\n\n }\n }\n return stream;\n };\n this.writeMessage = function (out) {\n var stream = binaryHelper.convertStream(out);\n stream.writeUTF(protocolId);\n stream.write(protocolVersion);\n var flags = cleanSession ? 2 : 0;\n flags |= hasWill ? 0x04 : 0;\n flags |= willQos ? willQos >> 3 : 0;\n flags |= retainWill ? 0x20 : 0;\n flags |= hasToken ? 0x40 : 0;\n flags |= hasAppId ? 0x80 : 0;\n stream.write(flags);\n stream.writeChar(keepAlive);\n stream.writeUTF(clientId);\n if (hasWill) {\n stream.writeUTF(willTopic);\n stream.writeUTF(will);\n }\n if (hasAppId) {\n stream.writeUTF(appId);\n }\n if (hasToken) {\n stream.writeUTF(token);\n }\n return stream;\n };\n\n this.setCredentials = function (appid, _token) {\n if ((!appid && appid == \"\") && (_token)) {\n throw new Error(\"It is not valid to supply a token without supplying a appId.\");\n }\n appId = appid;\n token = _token;\n hasAppId = appId != null;\n hasToken = token != null;\n };\n\n this.setWil = function (wt, w, wq, rw) {\n if ((!wt ? 1 : 0 ^ !w ? 1 : 0) || (!w ? 1 : 0 ^ !wq ? 1 : 0)) {\n throw new Error(\"Can't set willTopic, will or willQoS value independently\");\n }\n willTopic = wt;\n will = w;\n willQos = wq;\n retainWill = rw;\n hasWill = !!willTopic;\n };\n\n this.setDup = function (dup) {\n throw new Error(\n \"CONNECT messages don't use the DUP flag.\");\n };\n\n this.setRetained = function (retain) {\n throw new Error(\n \"CONNECT messages don't use the RETAIN flag.\");\n };\n\n this.setQos = function (qos) {\n throw new Error(\n \"CONNECT messages don't use the QoS flags.\");\n };\n\n this.getProtocolId = function () {\n return protocolId;\n };\n\n this.getProtocolVersion = function () {\n return protocolVersion;\n };\n\n this.getClientId = function () {\n return clientId;\n };\n\n this.getKeepAlive = function () {\n return keepAlive;\n };\n\n this.getappId = function () {\n return appId;\n };\n\n this.gettoken = function () {\n return token;\n };\n\n this.isCleanSession = function () {\n return cleanSession;\n };\n\n this.setWillTopic = function (_willTopic) {\n willTopic = _willTopic;\n };\n\n this.getWillTopic = function () {\n return willTopic;\n };\n\n this.getWill = function () {\n return will;\n };\n\n this.getWillQoS = function () {\n return willQoS;\n };\n\n this.isWillRetained = function () {\n return retainWill;\n };\n\n this.hasAppId = function () {\n return hasAppId;\n };\n\n this.hasToken = function () {\n return hasToken;\n };\n\n this.hasWill = function () {\n return hasWill;\n };\n }", "title": "" }, { "docid": "9be009acc48346cb204102f92aa5ee8a", "score": "0.51211715", "text": "constructor( message, self, parent ){\n\n\t\tthis.parent = parent;\n\t\tthis.message = message;\n\t\tthis.time = Date.now();\n\t\tthis.self = self;\n\t\tthis.id = String(++this.parent.chatIndex);\n\n\t}", "title": "" }, { "docid": "750524dc493c0ae8a0318e3616636808", "score": "0.5119868", "text": "function packet_reader(buffer, length) {\n this.buffer = new Buffer(length);\n buffer.copy(this.buffer, 0, 0, length);\n this.offset = 0;\n}", "title": "" }, { "docid": "d06628ce24b8d7197d4ed2b6525c4f2e", "score": "0.51106095", "text": "function Message(receiver) {\n this.receiver = receiver;\n}", "title": "" }, { "docid": "0d0f7fa78173eb8827335636a4b7d0fb", "score": "0.5110285", "text": "constructor(socket) {\n this.receivedMessageQueue = [];\n this.readJsonCallback = null;\n this.bufferedInput = \"\";\n this.socket = socket;\n this.socketOpen = true;\n // for testing purposes, don't set the callback if a Socket is not given\n if (socket) {\n socket.on('data', (data) => { this.receiveData(data) });\n socket.on('close', () => { this.socketOpen = false });\n }\n }", "title": "" }, { "docid": "106f7e1f8cd28d841eb91ab6d94b51c5", "score": "0.5105212", "text": "static from(event) {\n if (isTextMessageEvent(event)) {\n return new MatrixMessage(event.content.msgtype, event.sender, event.content.body, event.origin_server_ts);\n }\n // for now only text messages are supported\n return undefined;\n }", "title": "" }, { "docid": "fc8d7f6f8846d8249784d09e7d2cef92", "score": "0.51035947", "text": "function createMessage(params) {\n var newMessage = new Message();\n newMessage.fullname = params.fullname;\n newMessage.email = params.email;\n newMessage.phoneNumber = params.phoneNumber;\n newMessage.text = params.text;\n newMessage.viewed = false;\n return newMessage;\n}", "title": "" }, { "docid": "8a2530b50cfad88dc561e5cef747e244", "score": "0.50928134", "text": "function createReader (src, options) {\n // create a reader for the DXF\n let reader = dxf.reader(options)\n \n // setup event handling from the reader\n reader.on('error', handleError)\n reader.on('start', handleStart)\n reader.on('end', handleEnd)\n \n // setup group handling\n reader.absorb(0, handleEntity)\n reader.absorb(1, handleString)\n reader.absorb(2, handleName)\n reader.absorb(3, handleName)\n reader.absorb(6, handleString)\n reader.absorb(7, handleString)\n reader.absorb(8, handleString)\n reader.absorb(9, handleVariable)\n reader.absorb(10, handleXcoord)\n reader.absorb(11, handleDouble)\n reader.absorb(12, handleDouble)\n reader.absorb(13, handleDouble)\n reader.absorb(20, handleYcoord)\n reader.absorb(21, handleDouble)\n reader.absorb(22, handleDouble)\n reader.absorb(23, handleDouble)\n reader.absorb(30, handleZcoord)\n reader.absorb(31, handleDouble)\n reader.absorb(32, handleDouble)\n reader.absorb(33, handleDouble)\n reader.absorb(39, handleDouble)\n reader.absorb(40, handleDouble)\n reader.absorb(41, handleDouble)\n reader.absorb(42, handleBulge)\n reader.absorb(50, handleDouble)\n reader.absorb(51, handleDouble)\n reader.absorb(62, handleInt)\n reader.absorb(70, handleInt)\n reader.absorb(71, handleInt)\n reader.absorb(72, handleInt)\n reader.absorb(73, handleInt)\n reader.absorb(74, handleInt)\n reader.absorb(75, handleInt)\n reader.absorb(90, handleValue)\n reader.absorb(91, handleLen) // MESH\n reader.absorb(92, handleLen) // MESH\n reader.absorb(93, handleLen) // MESH\n reader.absorb(94, handleLen) // MESH\n reader.absorb(95, handleLen) // MESH\n reader.absorb(210, handleInt)\n reader.absorb(220, handleInt)\n reader.absorb(230, handleInt)\n \n // initial state\n reader.objstack = []\n reader.objstack.push({type: 'dxf'})\n \n // start the reader\n reader.write(src).close()\n return reader\n }", "title": "" }, { "docid": "920e3edf840c442b105f4865e28662bf", "score": "0.5088637", "text": "SOCKET_ONMESSAGE (state, message) {\n state.socket.message = message\n console.log('Got response')\n var fileReader = new FileReader()\n fileReader.onload = function (event) {\n var arrayBuffer = event.target.result\n console.log(arrayBuffer)\n var buffer = messages.TechDebt.deserializeBinary(arrayBuffer)\n var pbObject = buffer.toObject()\n console.log(pbObject)\n state.techDebt = pbObject.techdebt\n }\n fileReader.readAsArrayBuffer(message.data)\n }", "title": "" }, { "docid": "3dac6ffbce78df965329cefafc8e432a", "score": "0.5086523", "text": "fromBuffer(tBuffer){\n // Set defaults.\n this.reset();\n\n // Convert the buffer to a string array.\n let tArgs = tBuffer.toString('utf8').split(',');\n\n // Guard.\n if (tArgs.length < 3){\n return;\n } \n\n // Set member variables from the string array.\n this.mValid = true;\n this.mCommand = tArgs[1];\n this.mCode = tArgs[2];\n if (tArgs.length >= 4){\n this.mMessage = tArgs[3];\n } else {\n this.mMessage = \"none\";\n }\n\n }", "title": "" }, { "docid": "16bec6f2d77ad9d2d62773972005e4d3", "score": "0.5081481", "text": "start(readerHandler) {\n // Bind 'this' to handler\n readerHandler = readerHandler.bind(this);\n this.nfc.on('reader', readerHandler);\n\n // Handle NFC driver error\n this.nfc.on('error', (err) => {\n this.emit('nfc-error', err);\n });\n\n return this;\n }", "title": "" }, { "docid": "d284eda79df0cfa07a344501f29e79da", "score": "0.50739837", "text": "function MessageQueue(opts){\n var opts = opts || {};\n var redishost = opts.redishost || null;\n var redisopts = opts.redisopts || null; \n var redisdb = opts.redisdb || null;\n var self = this;\n this.queueName = opts.queueName || '';\n this.requestTimers = {};\n this.jobs = {};\n this.timeout = opts.timeout || 5000;\n this.requesterId = uuid.v1();\n this.publisher = createClient(redishost, redisopts);\n this.subscriber = createClient(redishost, redisopts);\n //Replies come over a redis PUB/SUB\n this.subscriber.on('message', function(channel, message){\n var res = null; \n try{\n res = JSON.parse(message);\n }catch(e){\n console.log('parsing error, do you even stringify?');\n }\n if(self.requestTimers[res.id]){\n clearTimeout(self.requestTimers[res.requestId]);\n delete self.requestTimers[res.requestId];\n }\n //Do some generic time reporting for computing performance averages later\n if(res.time){\n var end = new Date().getTime();\n var delta = ( end - res.time );\n util.log('request took ' + delta + ' ms');\n }\n //remove redis request/reply/event wrapper and emit\n if(self.jobs[res.id]){\n self.jobs[res.id].reply(res.reply);\n delete self.jobs[res.id];\n }else{\n console.log('unknown job id'); \n }\n\n });\n //Replies come back over the requesterId channel of the instance of mq\n //This is a less reliable interface than BRPOPLPUSH but its just a message and shouldn't blow up anything.\n this.subscriber.subscribe(this.requesterId);\n}", "title": "" }, { "docid": "5c978ec0bcfc85c7d7bb6ce1e09e334f", "score": "0.50665164", "text": "init() {\r\n\t\t// read state\r\n\t\tthis.readAll();\r\n\t}", "title": "" }, { "docid": "1b0e451294d2d77ac13c14916bf394fb", "score": "0.5056743", "text": "static from(event) {\n if (Object(_utils_events__WEBPACK_IMPORTED_MODULE_0__[\"isTextMessageEvent\"])(event)) {\n return new MatrixMessage(event.content.msgtype, event.sender, event.content.body, event.origin_server_ts);\n }\n // for now only text messages are supported\n return undefined;\n }", "title": "" }, { "docid": "2bcb3540d8a55bef6e5e054c7387ae5b", "score": "0.50433975", "text": "function createGenerator() {\n let client = redisClient();\n let generator = new Push('messages', redisClient());\n\n (function next() {\n let message = Message.getMessage();\n generator.write(message);\n client.llen('messages', ( _, length) => {\n if (length > 1000){\n return Notifier.publish('idleTimeout', true);\n } \n next();\n });\n })();\n return generator;\n}", "title": "" }, { "docid": "06f33ae659d70144b35e053ebae2eefc", "score": "0.503727", "text": "function CardReader() {\n var id = null;\n this.getId = function () {return id;};\n\n if (1 == arguments.length && arguments[0][rhoUtil.rhoIdParam()]) {\n if (moduleNS != arguments[0][rhoUtil.rhoClassParam()]) {\n throw \"Wrong class instantiation!\";\n }\n id = arguments[0][rhoUtil.rhoIdParam()];\n } else {\n id = rhoUtil.nextId();\n // constructor methods are following:\n \n }\n }", "title": "" }, { "docid": "c7ce69382b36e7f2b774616fa7697e6b", "score": "0.50254536", "text": "function Message(message) {\n this.message = message;\n}", "title": "" }, { "docid": "af790fe37e5db58c49b700b0bf535e30", "score": "0.5012156", "text": "function readMessage(data) {\n var result = JSON.parse(data); // it'll be JSON, so parse it\n if (result.hasOwnProperty('clientName')) { // if there's a clientName property,\n newClient.clientName = result.clientName; // use it to name the client\n }\n if (result.hasOwnProperty('playing') || // if it has a playing property\n result.hasOwnProperty('position')) { // or a position property\n broadcast(newClient, result); // broadcast it for other clients\n }\n if (result.exit === 1) { // or an exit property\n console.log(\"client \" + result.clientName + \" logging out\");\n newClient.close(); // close the websocket\n }\n console.log(result); // print the message\n}", "title": "" }, { "docid": "b4c6c3117b1692dcf105e4a384fb0f2a", "score": "0.49937302", "text": "readMessage(i) {\n this.inbox[i].seen = true\n this.inbox[i].seenAt = new Date()\n return this.inbox[i].content\n }", "title": "" }, { "docid": "202fe19322a775693812d1b42e97614f", "score": "0.49913406", "text": "constructor(readable, bufferSize, maxBuffers, outgoingHandler, concurrency, encoding) {\n this.emitter = new events.EventEmitter();\n this.offset = 0;\n this.isStreamEnd = false;\n this.isError = false;\n this.executingOutgoingHandlers = 0;\n this.numBuffers = 0;\n this.unresolvedDataArray = [];\n this.unresolvedLength = 0;\n this.incoming = [];\n this.outgoing = [];\n if (bufferSize <= 0) {\n throw new RangeError(`bufferSize must be larger than 0, current is ${bufferSize}`);\n }\n if (maxBuffers <= 0) {\n throw new RangeError(`maxBuffers must be larger than 0, current is ${maxBuffers}`);\n }\n if (concurrency <= 0) {\n throw new RangeError(`concurrency must be larger than 0, current is ${concurrency}`);\n }\n this.bufferSize = bufferSize;\n this.maxBuffers = maxBuffers;\n this.readable = readable;\n this.outgoingHandler = outgoingHandler;\n this.concurrency = concurrency;\n this.encoding = encoding;\n }", "title": "" }, { "docid": "89b803077774861e41bd738b8e9f26f8", "score": "0.49779555", "text": "constructor() {\n super();\n this.__clazz__ = 'org.arl.fjage.GenericMessage';\n }", "title": "" }, { "docid": "04dddfe12428d14a24c392fa102bdffc", "score": "0.49724856", "text": "function init(){\n let visitedUser = UserService.getInstance().getVisitedUser();\n\n let mockedMessage = new Message({\n id: Utils.guid(),\n text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',\n user: visitedUser,\n isIncoming: true\n });\n MessageService.getInstance().addMessages([mockedMessage]);\n\n let messages = MessageService.getInstance().getMessages();\n\n let messagesToRender = [];\n if(messages.length <= 20){\n messagesToRender = messages;\n }else{\n messagesToRender = messages.slice((messages.length-20), messages.length);\n }\n\n for(let i = 0 ; i < messagesToRender.length ; i++){\n renderMessage(messagesToRender[i]);\n }\n }", "title": "" }, { "docid": "133dddee5ebf0f9161c6fe6a4fef30bc", "score": "0.49719784", "text": "function baseMessage() {\n this.binaryPackage = null;\n\n this.header = 0;\n this.TXsender = 0;\n this.data = new Buffer(0);\n\n this.isExtracted = false;\n}", "title": "" }, { "docid": "66418eeeea389cc966203b090842d2d9", "score": "0.4962281", "text": "constructor() {\n\t\t// these are instance variables\n\t\t// note that self is the JavaScript equivalent of this\n\t\tthis.msgIndex = 0\n\t\tthis.username = \"\"\n\t}", "title": "" }, { "docid": "566b7d2a9ee545ef341427469ff72040", "score": "0.49434528", "text": "constructor(message)\n {\n super(message)\n super.name = this.constructor.name\n }", "title": "" }, { "docid": "2ae805bdf25136fa823c2ed042ace290", "score": "0.49361444", "text": "function CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm) {\n if (highWaterMark === void 0) { highWaterMark = 1; }\n if (sizeAlgorithm === void 0) { sizeAlgorithm = function () { return 1; }; }\n var stream = Object.create(ReadableStream.prototype);\n InitializeReadableStream(stream);\n var controller = Object.create(ReadableStreamDefaultController.prototype);\n SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm);\n return stream;\n }", "title": "" }, { "docid": "632fae2b7f7218d59350a6e015b28748", "score": "0.4930421", "text": "constructor(flux) {\n\n // Don't forget to call the super constructor\n super();\n\n const messageActions = flux.getActions('messages');\n this.register(messageActions.newMessage, this.handleNewMessage);\n this.messageCounter = 0;\n\n this.state = {};\n }", "title": "" }, { "docid": "2b608721baa2baed598aaac8b444b2b1", "score": "0.49303484", "text": "function MessageSerializer(PacketManager_lengthInteger__var, PacketManager_lengthString__var, PacketManager_lengthUInt16__var, PacketManager_MAX_PACKET_SIZE__var, PacketManager_START_BYTE__var, PacketManager_STOP_BYTE__var, PacketManager_ESCAPE_BYTE__var, PacketManager_CODE_POSITION__var, PacketManager_LENGTH_POSITION__var, PacketManager_DATA_POSITION__var, PacketManager_buffer__var, PacketManager_index__var) {\n\nthis.ready = false;\n//Attributes\nthis.PacketManager_lengthInteger__var =PacketManager_lengthInteger__var;\nthis.PacketManager_lengthString__var =PacketManager_lengthString__var;\nthis.PacketManager_lengthUInt16__var =PacketManager_lengthUInt16__var;\nthis.PacketManager_MAX_PACKET_SIZE__var =PacketManager_MAX_PACKET_SIZE__var;\nthis.PacketManager_START_BYTE__var =PacketManager_START_BYTE__var;\nthis.PacketManager_STOP_BYTE__var =PacketManager_STOP_BYTE__var;\nthis.PacketManager_ESCAPE_BYTE__var =PacketManager_ESCAPE_BYTE__var;\nthis.PacketManager_CODE_POSITION__var =PacketManager_CODE_POSITION__var;\nthis.PacketManager_LENGTH_POSITION__var =PacketManager_LENGTH_POSITION__var;\nthis.PacketManager_DATA_POSITION__var =PacketManager_DATA_POSITION__var;\nthis.PacketManager_buffer__var =PacketManager_buffer__var;\nthis.PacketManager_index__var =PacketManager_index__var;//bindings\nvar connectors = [];\nthis.getConnectors = function() {\nreturn connectors;\n}\n\n//message queue\nvar queue = [];\nthis.getQueue = function() {\nreturn queue;\n}\n\n//callbacks for third-party listeners\n//ThingML-defined functions\nfunction serializeInteger(SerializerJS_serializeInteger_d__var) {\n\n var l = SerializerJS_serializeInteger_d__var;\n for ( var index = 0; index < 2; index ++ ) {\n var b = l & 0xff;\n storeByte(b)\n l = (l - b) / 256 ;\n }\n \n}\n\nthis.serializeInteger = function(SerializerJS_serializeInteger_d__var) {\nserializeInteger(SerializerJS_serializeInteger_d__var);}\n\nfunction serializeUInt16(SerializerJS_serializeUInt16_d__var) {\nserializeInteger(SerializerJS_serializeUInt16_d__var);\n}\n\nthis.serializeUInt16 = function(SerializerJS_serializeUInt16_d__var) {\nserializeUInt16(SerializerJS_serializeUInt16_d__var);}\n\nfunction escape() {\nvar escaped__var = [];\n\nvar stop__var = PacketManager_DATA_POSITION__var + PacketManager_buffer__var[PacketManager_LENGTH_POSITION__var]\n;\n\nvar i__var = 0;\n\nvar j__var = 0;\n\nescaped__var[j__var] = PacketManager_START_BYTE__var;\nj__var = j__var + 1;\nvar current__var;\n\nwhile(i__var < stop__var) {\ncurrent__var = PacketManager_buffer__var[i__var]\n;\nif(current__var === PacketManager_START_BYTE__var || current__var === PacketManager_STOP_BYTE__var || current__var === PacketManager_ESCAPE_BYTE__var) {\nescaped__var[j__var] = PacketManager_ESCAPE_BYTE__var;\nj__var = j__var + 1;\n\n}\nescaped__var[j__var] = current__var;\nj__var = j__var + 1;\ni__var = i__var + 1;\n\n}\nescaped__var[j__var] = PacketManager_STOP_BYTE__var;\nreturn escaped__var;\n}\n\nthis.escape = function() {\nescape();}\n\nfunction send() {\nsendWrite_bytesOnOut(escape());\n}\n\nthis.send = function() {\nsend();}\n\nfunction setHeader(PacketManager_setHeader_code__var, PacketManager_setHeader_length__var) {\nPacketManager_index__var = 0;\nstoreByte(1);\nstoreByte(0);\nstoreByte(0);\nPacketManager_CODE_POSITION__var = PacketManager_index__var;\nstoreByte(PacketManager_setHeader_code__var);\nPacketManager_LENGTH_POSITION__var = PacketManager_index__var;\nstoreByte(PacketManager_setHeader_length__var);\nPacketManager_DATA_POSITION__var = PacketManager_index__var;\nPacketManager_index__var = PacketManager_DATA_POSITION__var;\n}\n\nthis.setHeader = function(PacketManager_setHeader_code__var, PacketManager_setHeader_length__var) {\nsetHeader(PacketManager_setHeader_code__var, PacketManager_setHeader_length__var);}\n\nfunction storeByte(PacketManager_storeByte_b__var) {\nif(PacketManager_index__var === PacketManager_MAX_PACKET_SIZE__var) {\nconsole.log(\"ERROR: \" + \"BUFFER OVERFLOW: \" + PacketManager_storeByte_b__var + \" has been ignored. Current index = \" + PacketManager_index__var);\n\n}\nif(PacketManager_index__var < PacketManager_MAX_PACKET_SIZE__var) {\nPacketManager_buffer__var[PacketManager_index__var] = PacketManager_storeByte_b__var;\nPacketManager_index__var = PacketManager_index__var + 1;\n\n}\n}\n\nthis.storeByte = function(PacketManager_storeByte_b__var) {\nstoreByte(PacketManager_storeByte_b__var);}\n\nfunction readByte() {\nvar b__var;\n\nif(PacketManager_index__var < PacketManager_MAX_PACKET_SIZE__var) {\nb__var = PacketManager_buffer__var[PacketManager_index__var]\n;\nPacketManager_index__var = PacketManager_index__var + 1;\n\n}\nif(PacketManager_index__var === PacketManager_MAX_PACKET_SIZE__var) {\nconsole.log(\"ERROR: \" + \"BUFFER OVERFLOW: trying to read out of buffer boundaries\");\nb__var = PacketManager_STOP_BYTE__var;\n\n}\nreturn b__var;\n}\n\nthis.readByte = function() {\nreadByte();}\n\n//Internal functions\nfunction _send(message) {\nvar json = JSON.parse(message);\nvar port = json.port;\nvar arrayLength = connectors.length;\nfor (var i = 0; i < arrayLength; i++) {\nvar c = connectors[i];\nc.forward(message);\n}\n}\n\nfunction sendWrite_bytesOnOut(b) {\nvar msg = '{\"message\":\"write_bytes\",\"port\":\"out_c\", \"b\":[' + b + ']}';\n_send(msg);\n}\n\n//Init state machine\nthis.MessageSerializer_SerializerBehavior = buildStateMachine(\"SerializerBehavior\");\nvar MessageSerializer_SerializerBehavior_default = buildRegion(\"_default\", this.MessageSerializer_SerializerBehavior);\nthis._initial_MessageSerializer_SerializerBehavior = buildInitialState(\"_initial\", MessageSerializer_SerializerBehavior_default);\n//State machine (states and regions)\nvar MessageSerializer_SerializerBehavior_Serialize = buildSimpleState(\"Serialize\", MessageSerializer_SerializerBehavior_default);\nMessageSerializer_SerializerBehavior_Serialize.entry = [MessageSerializer_SerializerBehavior_Serialize_entry];\n//State machine (transitions)\nvar t0 = new buildEmptyTransition(this._initial_MessageSerializer_SerializerBehavior, MessageSerializer_SerializerBehavior_Serialize);\nvar t1 = buildTransition(MessageSerializer_SerializerBehavior_Serialize, null, function (s, c) {var json = JSON.parse(c); return json.port === \"RemoteControl_c\" && json.message === \"changeDisplay\"});\nt1.effect = [t1_effect];\n//State machine (actions on states and transitions)\nfunction MessageSerializer_SerializerBehavior_entry(context, message) {\nconsole.log(\"Coder ready!\");\n}\n\nfunction MessageSerializer_SerializerBehavior_Serialize_entry(context, message) {\nconsole.log(\"Coder ready indeed!\");\n}\n\nfunction t1_effect(context, message) {\nvar json = JSON.parse(message);\nconsole.log(\"Serializing changeDisplay message\");\nsetHeader(20, 0);\nsend();\n}\n\n}", "title": "" }, { "docid": "91db24f46cbb4b54030a89e0b6c9cdde", "score": "0.49184832", "text": "function createMessage(data, userid){\r\n const { cid, msg, timestamp } = data\r\n return { id: uuid.v4(), message: msg, sender: userid, cid: cid, timestamp, read: false }\r\n}", "title": "" }, { "docid": "8571ea7a6594c1c07486e8158bf384fa", "score": "0.49090382", "text": "_read() {}", "title": "" }, { "docid": "7a24e657322a2a0e96892e34a2b9b7c9", "score": "0.49077046", "text": "function CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark = 1, sizeAlgorithm = () => 1) {\n\t\t const stream = Object.create(ReadableStream.prototype);\n\t\t InitializeReadableStream(stream);\n\t\t const controller = Object.create(ReadableStreamDefaultController.prototype);\n\t\t SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm);\n\t\t return stream;\n\t\t }", "title": "" }, { "docid": "7a24e657322a2a0e96892e34a2b9b7c9", "score": "0.49077046", "text": "function CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark = 1, sizeAlgorithm = () => 1) {\n\t\t const stream = Object.create(ReadableStream.prototype);\n\t\t InitializeReadableStream(stream);\n\t\t const controller = Object.create(ReadableStreamDefaultController.prototype);\n\t\t SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm);\n\t\t return stream;\n\t\t }", "title": "" }, { "docid": "06b9a6dc7aaf023d431c2c4fbba488d1", "score": "0.49000937", "text": "function Parser () {\n this.buffer = \"\";\n this.part = this;\n this.state = S.NEW_PART;\n // handy for debugging bad input\n this.position = this.column = this.line = 0;\n this.parent = this;\n this.type = this.headers = this.isMultiPart = this.boundary = null;\n}", "title": "" }, { "docid": "7b77887d9893824adc997b3111760644", "score": "0.4897782", "text": "createPublicMsg() {\n\n return {message: this.state.inputContent} \n }", "title": "" }, { "docid": "ed3af9d7473072fbe860d9d1d7142fbe", "score": "0.4886794", "text": "function loadMessage () {\n return function * (next) {\n this.validateParam('message_id');\n const message = yield db.getMessageById(this.vals.message_id);\n this.assert(message, 404);\n pre.presentMessage(message);\n this.state.message = message;\n yield * next;\n };\n}", "title": "" }, { "docid": "380c75aa02c7c8ecbbe2670b01fafe8f", "score": "0.48863187", "text": "function MessageDeserializer_receive_entry(context, message) {\nconsole.log(\"Decoder ready!\");\n}", "title": "" }, { "docid": "ed11c927cb8f591e600b2801ab2e6cf9", "score": "0.48788086", "text": "constructor() { \n \n ContactMessage.initialize(this);\n }", "title": "" }, { "docid": "afb80db8ed241319d86d98fa0f21f072", "score": "0.4878095", "text": "function $msg(attrs) { return new Strophe.Builder(\"message\", attrs); }", "title": "" }, { "docid": "afb80db8ed241319d86d98fa0f21f072", "score": "0.4878095", "text": "function $msg(attrs) { return new Strophe.Builder(\"message\", attrs); }", "title": "" }, { "docid": "a091e6c68e4328f40589989d05df23b1", "score": "0.48755464", "text": "constructor(props) {\n super(props);\n this.state = {\n messages: [],\n chatInput: ''\n };\n\n this.setChatInput = this.setChatInput.bind(this);\n this.sendMessage = this.sendMessage.bind(this);\n this._handleKeyPress = this._handleKeyPress.bind(this);\n\n }", "title": "" }, { "docid": "6064b42524cf7a01bb629cae3512d3b4", "score": "0.4869317", "text": "constructor(props) {\n super(props);\n this.state = {\n input: '',\n messages: []\n };\n }", "title": "" }, { "docid": "68e4501bd35a14633ebcba564c457cff", "score": "0.48646152", "text": "function Client(state) {\n\n this.state = state;\n\n ++Client.count;\n this.id = Client.count;\n this.name = config.name || `Client ${this.id}`;\n this.hostName = config.hostName;\n this.port = config.port;\n\n this.interval = config.interval || (10 * 1000); // 10 seeconds in millis between message sends\n this.initMessageSize = config.initMessageSize || 100; // initial size\n this.messageSizeIncrement = config.messageSizeIncrement || 100; // each size increment\n this.maxMessageSize = config.maxMessageSize || 500; // max size before wrapping\n this.maxMessages = config.maxMessages || state.maxMessages; // 0 means no limit BE CAREFUL!\n this.seed = config.seed || 'x';\n\n this.messageSize = this.initMessageSize;\n this.message = '';\n this.messageCount = 0;\n this.totalCharactersSent = 0; // accumulated size of messages\n\n // if not passed truthy, must perform client.connect() which return promise\n // config.connect is by default falsey\n if (config.connect) {\n this.connect();\n }\n}", "title": "" }, { "docid": "c393559f22f57160a3e25d27f46b17c5", "score": "0.485932", "text": "function CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark = 1, sizeAlgorithm = () => 1) {\n const stream = Object.create(ReadableStream$1.prototype);\n InitializeReadableStream(stream);\n const controller = Object.create(ReadableStreamDefaultController.prototype);\n SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm);\n return stream;\n}", "title": "" }, { "docid": "49541cdada52f83c1ba411c6db77377b", "score": "0.485648", "text": "function constructModels(msg, argv) {\n return {\n gettingoverit: new Gettingoverit(msg, argv),\n };\n}", "title": "" }, { "docid": "4fc7d6eee46d77aff422280f439ee423", "score": "0.48554382", "text": "function CreateReadableByteStream(startAlgorithm, pullAlgorithm, cancelAlgorithm) {\n var stream = Object.create(ReadableStream.prototype);\n InitializeReadableStream(stream);\n var controller = Object.create(ReadableByteStreamController.prototype);\n SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, 0, undefined);\n return stream;\n }", "title": "" }, { "docid": "b6047f889986cc39684d1843f8cd6a46", "score": "0.48543054", "text": "function Message()\n{\n this.id = undefined;\n this.sender = undefined;\n this.recipient = undefined;\n this.body = undefined;\n this.timestamp = undefined;\n this.read = undefined;\n}", "title": "" }, { "docid": "3372fc67e42336b437fe24baf9bece9d", "score": "0.48522747", "text": "startDefault() {\n this.start(this.readerHandler);\n\n return this;\n }", "title": "" }, { "docid": "c8cef1145f1375ae75839b1cbd78eee6", "score": "0.4852038", "text": "_init() {\n this.consumer.on('error', (err) => {\n this._handleError(err);\n });\n\n this.consumer.on('offsetOutOfRange', (err) => {\n ; // abstract\n });\n\n this.consumer.on('message', (msg) => {\n this._handleMessage(msg);\n });\n }", "title": "" }, { "docid": "b0bbef198d563f224f49595bfd9b87a1", "score": "0.48401222", "text": "function MessageTemplate(messageTemplate) {\r\n if (messageTemplate === null || !messageTemplate.length) {\r\n throw new Error('Argument \"messageTemplate\" is required.');\r\n }\r\n this.raw = messageTemplate;\r\n this.tokens = this.tokenize(messageTemplate);\r\n }", "title": "" }, { "docid": "c345f4cbc0842a8a9dd0cc49f59149a1", "score": "0.48373657", "text": "function QueryMessage(one, two, three) {\n var topic, data, targetId, signature;\n if (one instanceof Header) {\n RetryableMessage.call(this, one);\n } else if (arguments.length == 3) {\n RetryableMessage.call(this, new type(5));\n if (typeof two == \"string\")\n data = binaryHelper.toMQttString(two);\n else\n data = two;\n topic = one;\n targetId = three;\n signature = 0xff;\n }\n\n this.messageLength = function () {\n var length = 0;\n length += binaryHelper.toMQttString(topic).length;\n length += binaryHelper.toMQttString(targetId).length;\n length += 2;\n length += data.length;\n return length;\n };\n\n this.writeMessage = function (Out) {\n var out = binaryHelper.convertStream(Out);\n //out.writeLong(signature);\n out.writeUTF(topic);\n out.writeUTF(targetId);\n QueryMessage.prototype.writeMessage.call(this, out);\n out.write(data);\n };\n\n this.readMessage = function (In, msgLength) {\n var pos = 0, _in = binaryHelper.convertStream(In);\n //signature=_in.readLong();\n topic = _in.readUTF();\n targetId = _in.readUTF();\n // pos+=8;\n pos += binaryHelper.toMQttString(topic).length;\n pos += binaryHelper.toMQttString(targetId).length;\n QueryMessage.prototype.readMessage.call(this, _in, msgLength);\n pos += 2;\n data = new Array(msgLength - pos);\n _in.read(data);\n };\n\n this.getTopic = function () {\n return topic;\n };\n this.getData = function () {\n return data;\n };\n this.getTargetId = function () {\n return targetId;\n };\n this.getDataAsString = function () {\n\n };\n }", "title": "" }, { "docid": "780ec19d9c72fefcfed8ce937eabb225", "score": "0.48277992", "text": "read() {\n\t\t if (!IsReadableStreamDefaultReader(this)) {\n\t\t return promiseRejectedWith(defaultReaderBrandCheckException('read'));\n\t\t }\n\t\t if (this._ownerReadableStream === undefined) {\n\t\t return promiseRejectedWith(readerLockException('read from'));\n\t\t }\n\t\t let resolvePromise;\n\t\t let rejectPromise;\n\t\t const promise = newPromise((resolve, reject) => {\n\t\t resolvePromise = resolve;\n\t\t rejectPromise = reject;\n\t\t });\n\t\t const readRequest = {\n\t\t _chunkSteps: chunk => resolvePromise({ value: chunk, done: false }),\n\t\t _closeSteps: () => resolvePromise({ value: undefined, done: true }),\n\t\t _errorSteps: e => rejectPromise(e)\n\t\t };\n\t\t ReadableStreamDefaultReaderRead(this, readRequest);\n\t\t return promise;\n\t\t }", "title": "" }, { "docid": "780ec19d9c72fefcfed8ce937eabb225", "score": "0.48277992", "text": "read() {\n\t\t if (!IsReadableStreamDefaultReader(this)) {\n\t\t return promiseRejectedWith(defaultReaderBrandCheckException('read'));\n\t\t }\n\t\t if (this._ownerReadableStream === undefined) {\n\t\t return promiseRejectedWith(readerLockException('read from'));\n\t\t }\n\t\t let resolvePromise;\n\t\t let rejectPromise;\n\t\t const promise = newPromise((resolve, reject) => {\n\t\t resolvePromise = resolve;\n\t\t rejectPromise = reject;\n\t\t });\n\t\t const readRequest = {\n\t\t _chunkSteps: chunk => resolvePromise({ value: chunk, done: false }),\n\t\t _closeSteps: () => resolvePromise({ value: undefined, done: true }),\n\t\t _errorSteps: e => rejectPromise(e)\n\t\t };\n\t\t ReadableStreamDefaultReaderRead(this, readRequest);\n\t\t return promise;\n\t\t }", "title": "" }, { "docid": "a229bd3cfe66410ddcd86d8a089d8aaa", "score": "0.4827616", "text": "decodeMessage(name, buffer) {\n const model = this.getModel(name);\n return model.decode(buffer);\n }", "title": "" }, { "docid": "a9fd1fe6600a926433dadeb5556c32bd", "score": "0.48170218", "text": "function IncomingMessage(socket) {\n stream.Stream.call(this);\n\n // TODO Remove one of these eventually.\n this.socket = socket;\n this.connection = socket;\n\n this.httpVersion = null;\n this.complete = false;\n this.headers = {};\n this.trailers = {};\n\n this.readable = true;\n\n this._paused = false;\n this._pendings = [];\n\n this._endEmitted = false;\n\n // request (server) only\n this.url = '';\n\n this.method = null;\n\n // response (client) only\n this.statusCode = null;\n this.client = this.socket;\n}", "title": "" }, { "docid": "0a693b8f3943c946663106e1e9b74420", "score": "0.48126644", "text": "constructor(sessionName, io) {\n // this.sessionId = sessionId;\n this.messages = [];\n this.io = io;\n this.sessionName = sessionName;\n this.namespace = io.of(\"/\" + sessionName);\n this.listen();\n }", "title": "" }, { "docid": "e12d87717f60207b13602198118582c0", "score": "0.4810403", "text": "function UnixSocketReader (config, eventEmitter) {\n this.config = config\n this.config.maxInputRate = (config.maxInputRateMBs || 100) * 1024 * 1024\n this.eventEmitter = eventEmitter\n}", "title": "" }, { "docid": "c7e6fd9becf1bc4d99e54dd39c72f793", "score": "0.4806163", "text": "function Receiver() {\n var content = [];\n\n function receive(data, onreceived) {\n if (data.type !== 'chunk') {\n onreceived(data.body);\n return;\n }\n \n var chunkInfo = data.body;\n content.push(chunkInfo.chunk);\n // if it's a regular message (not chunked), data.chunk should be undefined\n if (chunkInfo.last) { \n onreceived(content.join(''));\n content = [];\n }\n }\n\n return {\n receive: receive\n };\n }", "title": "" }, { "docid": "dd4a58fe36fe71ac593f2d8facc69450", "score": "0.48027778", "text": "newMessage(message, currentInputName){\n this.currentInputName = currentInputName;\n // Construct a msg object containing the data the server needs to process the message from the chat client.\n var msg = {\n type: \"message\",\n text: message,\n user: this.state.currentUser,\n date: Date.now()\n };\n // Send the msg object as a JSON-formatted string.\n this.wsc.send(JSON.stringify(msg));\n }", "title": "" }, { "docid": "fe7a0d955157748f468fed00a454c81b", "score": "0.4802609", "text": "function TwrReader(options){\n\t\tvar twrReader = Object.create(TwrReader.prototype);\n\t\t//TwrReader.injectClassMethods(twrReader);\n\t\t\n\t\toptions = options || {};\n\t\tif(options.onProgress)\n\t\t\ttwrReader.onProgress = options.onProgress;\n\t\tif(options.onLoaded)\n\t\t\ttwrReader.onLoaded = options.onLoaded;\n\t\ttwrReader.clear();\n\t\treturn( twrReader );\n\t}", "title": "" }, { "docid": "c47a55b85423f5c951bda935221b9bb0", "score": "0.48021165", "text": "function ProduceRequest(){\n //super constructor\n RequestMessage.call(this); \n}", "title": "" }, { "docid": "3cd9b6e5ebb9e4f9ae977ff1464a1ab5", "score": "0.47982654", "text": "function QueuedReader(options, logger, itemsTransform) {\n if (!(this instanceof QueuedReader)) {\n return new QueuedReader(options, logger, itemsTransform);\n }\n stream.Readable.call(this, options);\n\n var self = this;\n\n this.itemsTransform = itemsTransform;\n this.logger = logger;\n\n this.minWriters = 5;\n this.maxItems = 10;\n\n this.readerQueue = new FifoQueue(10);\n this.writerQueue = new FifoQueue(this.minWriters);\n this.itemQueue = new FifoQueue(this.maxItems);\n\n this.isReading = true;\n this.queueDone = false;\n\n this.addItems = function queuedReaderAddItems(data) {\n self.writerQueue.removeFirst();\n\n self.logger.debug('concatenated item');\n\n var isLast = (self.queueDone && self.readerQueue.length() === 0 &&\n self.writerQueue.length() === 0);\n\n var itemQueue = self.itemQueue;\n var beforeLength = itemQueue.length();\n\n self.itemsTransform(isLast, data, itemQueue);\n\n if (beforeLength < itemQueue.length()) {\n if (beforeLength === 0) {\n self.emit('readable');\n }\n if (self.isReading || isLast) {\n logger.debug('writing first item');\n self.isReading = self.push(itemQueue.pollFirst());\n }\n }\n\n self.nextReader();\n };\n}", "title": "" }, { "docid": "f39af7a3f9b33dd6608527a53a705bab", "score": "0.47950265", "text": "function Message(header, body) {\n /**\n * The header of the message that contains meta data\n * Fields: \n * _t -> message type\n * _id -> unique message id\n * from -> the sender's id\n * to -> the receiver's id\n * _origid -> present in a reply message and represents the id of the message to which the current\n * message replies to\n * \n */\n this.header = header;\n /**\n * The actual content of the message\n */\n this.body = body;\n\n}", "title": "" }, { "docid": "e31f91dcdea144650ca8a5a09cad2320", "score": "0.47870985", "text": "function Message() {\n Message.super_.call(this);\n}", "title": "" }, { "docid": "69450e36629ffb3a5df0b1d7aae2b55f", "score": "0.4778101", "text": "function CreateReadableByteStream(startAlgorithm, pullAlgorithm, cancelAlgorithm) {\n\t\t const stream = Object.create(ReadableStream.prototype);\n\t\t InitializeReadableStream(stream);\n\t\t const controller = Object.create(ReadableByteStreamController.prototype);\n\t\t SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, 0, undefined);\n\t\t return stream;\n\t\t }", "title": "" } ]
b65e8fcd714f506a620c657da94727b8
class Ruler Helper class, used by [[MarkdownItcore]], [[MarkdownItblock]] and [[MarkdownItinline]] to manage sequences of functions (rules): keep rules in defined order assign the name to each rule enable/disable rules add/replace rules allow assign rules to additional named chains (in the same) cacheing lists of active rules You will not need use this class directly until write plugins. For simple rules control use [[MarkdownIt.disable]], [[MarkdownIt.enable]] and [[MarkdownIt.use]]. new Ruler()
[ { "docid": "963ebe96324e7634ba5351dbc57bc92d", "score": "0.81656045", "text": "function Ruler() {\n // List of added rules. Each element is:\n //\n // {\n // name: XXX,\n // enabled: Boolean,\n // fn: Function(),\n // alt: [ name2, name3 ]\n // }\n //\n this.__rules__ = [];\n\n // Cached rule chains.\n //\n // First level - chain name, '' for default.\n // Second level - diginal anchor for fast filtering by charcodes.\n //\n this.__cache__ = null;\n}", "title": "" } ]
[ { "docid": "df820d5b9c6dd7438131fa3065a57539", "score": "0.82308453", "text": "function Ruler() {\n // List of added rules. Each element is:\n //\n // { name: XXX,\n // enabled: Boolean,\n // fn: Function(),\n // alt: [ name2, name3 ] }\n //\n this.__rules__ = [];\n \n // Cached rule chains.\n //\n // First level - chain name, '' for default.\n // Second level - digital anchor for fast filtering by charcodes.\n //\n this.__cache__ = null;\n }", "title": "" }, { "docid": "3a63e7a378946ddba6622a9c5e47cf91", "score": "0.8168838", "text": "function Ruler() {\n // List of added rules. Each element is:\n //\n // { name: XXX,\n // enabled: Boolean,\n // fn: Function(),\n // alt: [ name2, name3 ] }\n //\n this.__rules__ = [];\n\n // Cached rule chains.\n //\n // First level - chain name, '' for default.\n // Second level - digital anchor for fast filtering by charcodes.\n //\n this.__cache__ = null;\n}", "title": "" }, { "docid": "3a63e7a378946ddba6622a9c5e47cf91", "score": "0.8168838", "text": "function Ruler() {\n // List of added rules. Each element is:\n //\n // { name: XXX,\n // enabled: Boolean,\n // fn: Function(),\n // alt: [ name2, name3 ] }\n //\n this.__rules__ = [];\n\n // Cached rule chains.\n //\n // First level - chain name, '' for default.\n // Second level - digital anchor for fast filtering by charcodes.\n //\n this.__cache__ = null;\n}", "title": "" }, { "docid": "3a63e7a378946ddba6622a9c5e47cf91", "score": "0.8168838", "text": "function Ruler() {\n // List of added rules. Each element is:\n //\n // { name: XXX,\n // enabled: Boolean,\n // fn: Function(),\n // alt: [ name2, name3 ] }\n //\n this.__rules__ = [];\n\n // Cached rule chains.\n //\n // First level - chain name, '' for default.\n // Second level - digital anchor for fast filtering by charcodes.\n //\n this.__cache__ = null;\n}", "title": "" }, { "docid": "cf1459a39c88391fc4fc1d8de893ee5d", "score": "0.81655085", "text": "function Ruler() {\n // List of added rules. Each element is:\n //\n // { name: XXX,\n // enabled: Boolean,\n // fn: Function(),\n // alt: [ name2, name3 ] }\n //\n this.__rules__ = [];\n\n // Cached rule chains.\n //\n // First level - chain name, '' for default.\n // Second level - digital anchor for fast filtering by charcodes.\n //\n this.__cache__ = null;\n }", "title": "" }, { "docid": "deec25b38a2f8a6f6908f9c3374ddd31", "score": "0.8154048", "text": "function Ruler() {\n\t // List of added rules. Each element is:\n\t //\n\t // { name: XXX,\n\t // enabled: Boolean,\n\t // fn: Function(),\n\t // alt: [ name2, name3 ] }\n\t //\n\t this.__rules__ = [];\n\t\n\t // Cached rule chains.\n\t //\n\t // First level - chain name, '' for default.\n\t // Second level - digital anchor for fast filtering by charcodes.\n\t //\n\t this.__cache__ = null;\n\t}", "title": "" }, { "docid": "83bd660717025349a3f62e7e9ef3333a", "score": "0.8132335", "text": "function Ruler() {\n\t // List of added rules. Each element is:\n\t //\n\t // { name: XXX,\n\t // enabled: Boolean,\n\t // fn: Function(),\n\t // alt: [ name2, name3 ] }\n\t //\n\t this.__rules__ = [];\n\n\t // Cached rule chains.\n\t //\n\t // First level - chain name, '' for default.\n\t // Second level - digital anchor for fast filtering by charcodes.\n\t //\n\t this.__cache__ = null;\n\t}", "title": "" }, { "docid": "4a543793f964d2e3021ae00d41468c4f", "score": "0.808122", "text": "function Ruler(){// List of added rules. Each element is:\n//\n// { name: XXX,\n// enabled: Boolean,\n// fn: Function(),\n// alt: [ name2, name3 ] }\n//\n// Cached rule chains.\n//\n// First level - chain name, '' for default.\n// Second level - digital anchor for fast filtering by charcodes.\n//\nthis.__rules__=[],this.__cache__=null}", "title": "" }, { "docid": "e5b282dde4d21c4b3f07d8de20d560a1", "score": "0.6989013", "text": "function Core(){this.options={},this.ruler=new Ruler;for(var e=0;e<_rules.length;e++)this.ruler.push(_rules[e][0],_rules[e][1])}", "title": "" }, { "docid": "e20c0a1a5fb675eb6727b371b836b588", "score": "0.66051877", "text": "function Core() {\n this.options = {};\n this.ruler = new Ruler();\n for (var i = 0; i < _rules.length; i++) {\n this.ruler.push(_rules[i][0], _rules[i][1]);\n }\n }", "title": "" }, { "docid": "ba8b74636e82f86bfe8853932aa5d9a7", "score": "0.658775", "text": "function Core() {\n this.options = {};\n this.ruler = new Ruler();\n for (var i = 0; i < _rules.length; i++) {\n this.ruler.push(_rules[i][0], _rules[i][1]);\n }\n }", "title": "" }, { "docid": "0aa7695c4ddacc8023966d2689a299cd", "score": "0.65489167", "text": "function Core() {\n this.options = {};\n this.ruler = new Ruler();\n for (var i = 0; i < _rules.length; i++) {\n this.ruler.push(_rules[i][0], _rules[i][1]);\n }\n}", "title": "" }, { "docid": "0aa7695c4ddacc8023966d2689a299cd", "score": "0.65489167", "text": "function Core() {\n this.options = {};\n this.ruler = new Ruler();\n for (var i = 0; i < _rules.length; i++) {\n this.ruler.push(_rules[i][0], _rules[i][1]);\n }\n}", "title": "" }, { "docid": "0aa7695c4ddacc8023966d2689a299cd", "score": "0.65489167", "text": "function Core() {\n this.options = {};\n this.ruler = new Ruler();\n for (var i = 0; i < _rules.length; i++) {\n this.ruler.push(_rules[i][0], _rules[i][1]);\n }\n}", "title": "" }, { "docid": "2baa0cdd7eabecc7f19c29342424af46", "score": "0.6370675", "text": "function Core() {\n\t this.options = {};\n\t this.ruler = new Ruler();\n\t for (var i = 0; i < _rules.length; i++) {\n\t this.ruler.push(_rules[i][0], _rules[i][1]);\n\t }\n\t}", "title": "" }, { "docid": "2baa0cdd7eabecc7f19c29342424af46", "score": "0.6370675", "text": "function Core() {\n\t this.options = {};\n\t this.ruler = new Ruler();\n\t for (var i = 0; i < _rules.length; i++) {\n\t this.ruler.push(_rules[i][0], _rules[i][1]);\n\t }\n\t}", "title": "" }, { "docid": "c6308495608b0cd899f4a13a6d8075b7", "score": "0.61584383", "text": "function Renderer(){// exported helper, for custom rules only\nthis.rules=assign({},rules),this.getBreak=rules.getBreak}", "title": "" }, { "docid": "bd0a2f587716a954500d43dec05e21ae", "score": "0.5561842", "text": "function setRules() {\n\n rules.push(\"A plexiunit is made up of one or more plexiblocks.\");\n rules.push(\"You can \\\"block\\\" (grey) or \\\"mark\\\" (red) a plexiblock by clicking it. Use the buttons below to designate mark or block action. Click a marked/blocked plexiblock again to remove mark/block.\");\n rules.push(\"The amount of numbers next to the rows and columns are hints to how many plexiunits are in the row/column. The actual numbers represent how many plexiblocks make up the plexiunit.\");\n rules.push(\"Look at row-2, it says \\\"0\\\". This means there are NO plexiunits in this row. Go ahead and block the entire row.\");\n rules.push(\"Now look at row-5, it says \\\"5\\\". This means there is ONE plexiunit made up of FIVE plexiblocks. Mark all 5 plexiblocks.\");\n rules.push(\"The row hints are read from left-to-right and the column hints are read top-to-bottom. Plexiunits are laid out in the same format.\");\n rules.push(\"Look at the 1st column, it says \\\"1\\\" & \\\"2\\\". This means there are TWO plexiunits. One is made up of ONE plexiblock and the other is made up of TWO plexiblocks.\");\n rules.push(\"In the last step, you marked row-5 entirely. Because of that, we can now see where the 2-plexiunit is. Mark the plexiblock in row-4, column-1 to complete the plexiunit.\");\n rules.push(\"Plexiunits cannot touch other plexiunits within the same row/column. That is why blocking is useful. Block row-3, column-1. Now you can see where the 1-plexiunit is located in column-1.\")\n rules.push(\"Finish the puzzle on your own. When you have successfully marked all plexiunits, the \\\"next level\\\" button will turn green. Click on it to proceed. :-)\");\n\n }", "title": "" }, { "docid": "ff2d5e84c11e2d53bcd1d9c6eb8816a7", "score": "0.55438244", "text": "function Renderer() {\n\t this.rules = utils.assign({}, rules);\n\t\n\t // exported helper, for custom rules only\n\t this.getBreak = rules.getBreak;\n\t}", "title": "" }, { "docid": "8de551cb57ebf66c9138c2e9b8ae295d", "score": "0.5531663", "text": "function Renderer() {\n this.rules = utils.assign({}, rules);\n \n // exported helper, for custom rules only\n this.getBreak = rules.getBreak;\n }", "title": "" }, { "docid": "5e2953b9cfa0ce0e3b8b982babb17bcf", "score": "0.5524636", "text": "add(name, decl, ruleOptions) {\n const {parent, sheet, jss, Renderer, generateId, scoped} = this.options\n const options = {\n classes: this.classes,\n parent,\n sheet,\n jss,\n Renderer,\n generateId,\n scoped,\n name,\n keyframes: this.keyframes,\n selector: undefined,\n ...ruleOptions\n }\n\n // When user uses .createStyleSheet(), duplicate names are not possible, but\n // `sheet.addRule()` opens the door for any duplicate rule name. When this happens\n // we need to make the key unique within this RuleList instance scope.\n let key = name\n if (name in this.raw) {\n key = `${name}-d${this.counter++}`\n }\n\n // We need to save the original decl before creating the rule\n // because cache plugin needs to use it as a key to return a cached rule.\n this.raw[key] = decl\n\n if (key in this.classes) {\n // E.g. rules inside of @media container\n options.selector = `.${escape(this.classes[key])}`\n }\n\n const rule = createRule(key, decl, options)\n\n if (!rule) return null\n\n this.register(rule)\n\n const index = options.index === undefined ? this.index.length : options.index\n this.index.splice(index, 0, rule)\n\n return rule\n }", "title": "" }, { "docid": "517891806d1185ece03e920bdbbe90a2", "score": "0.551596", "text": "function Renderer() {\n\t this.rules = utils.assign({}, rules);\n\n\t // exported helper, for custom rules only\n\t this.getBreak = rules.getBreak;\n\t}", "title": "" }, { "docid": "5057fbbaefd880eeb55b8ae40d91a360", "score": "0.5483073", "text": "function Renderer() {\n this.rules = utils.assign({}, rules);\n\n // exported helper, for custom rules only\n this.getBreak = rules.getBreak;\n}", "title": "" }, { "docid": "5057fbbaefd880eeb55b8ae40d91a360", "score": "0.5483073", "text": "function Renderer() {\n this.rules = utils.assign({}, rules);\n\n // exported helper, for custom rules only\n this.getBreak = rules.getBreak;\n}", "title": "" }, { "docid": "5057fbbaefd880eeb55b8ae40d91a360", "score": "0.5483073", "text": "function Renderer() {\n this.rules = utils.assign({}, rules);\n\n // exported helper, for custom rules only\n this.getBreak = rules.getBreak;\n}", "title": "" }, { "docid": "c6aee68f7433511e3c4ae284d2c5ff75", "score": "0.5441312", "text": "function Renderer() {\n this.rules = assign$1({}, rules);\n\n // exported helper, for custom rules only\n this.getBreak = rules.getBreak;\n }", "title": "" }, { "docid": "fbfb7f3c7dd6a1ed57c3c517495885e0", "score": "0.5431434", "text": "function Renderer() {\n\n /**\n * Renderer#rules -> Object\n *\n * Contains render rules for tokens. Can be updated and extended.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.renderer.rules.strong_open = function () { return '<b>'; };\n * md.renderer.rules.strong_close = function () { return '</b>'; };\n *\n * var result = md.renderInline(...);\n * ```\n *\n * Each rule is called as independent static function with fixed signature:\n *\n * ```javascript\n * function my_token_render(tokens, idx, options, env, renderer) {\n * // ...\n * return renderedHTML;\n * }\n * ```\n *\n * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)\n * for more details and examples.\n **/\n this.rules = assign({}, default_rules);\n}", "title": "" }, { "docid": "fbfb7f3c7dd6a1ed57c3c517495885e0", "score": "0.5431434", "text": "function Renderer() {\n\n /**\n * Renderer#rules -> Object\n *\n * Contains render rules for tokens. Can be updated and extended.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.renderer.rules.strong_open = function () { return '<b>'; };\n * md.renderer.rules.strong_close = function () { return '</b>'; };\n *\n * var result = md.renderInline(...);\n * ```\n *\n * Each rule is called as independent static function with fixed signature:\n *\n * ```javascript\n * function my_token_render(tokens, idx, options, env, renderer) {\n * // ...\n * return renderedHTML;\n * }\n * ```\n *\n * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)\n * for more details and examples.\n **/\n this.rules = assign({}, default_rules);\n}", "title": "" }, { "docid": "fbfb7f3c7dd6a1ed57c3c517495885e0", "score": "0.5431434", "text": "function Renderer() {\n\n /**\n * Renderer#rules -> Object\n *\n * Contains render rules for tokens. Can be updated and extended.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.renderer.rules.strong_open = function () { return '<b>'; };\n * md.renderer.rules.strong_close = function () { return '</b>'; };\n *\n * var result = md.renderInline(...);\n * ```\n *\n * Each rule is called as independent static function with fixed signature:\n *\n * ```javascript\n * function my_token_render(tokens, idx, options, env, renderer) {\n * // ...\n * return renderedHTML;\n * }\n * ```\n *\n * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)\n * for more details and examples.\n **/\n this.rules = assign({}, default_rules);\n}", "title": "" }, { "docid": "fbfb7f3c7dd6a1ed57c3c517495885e0", "score": "0.5431434", "text": "function Renderer() {\n\n /**\n * Renderer#rules -> Object\n *\n * Contains render rules for tokens. Can be updated and extended.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.renderer.rules.strong_open = function () { return '<b>'; };\n * md.renderer.rules.strong_close = function () { return '</b>'; };\n *\n * var result = md.renderInline(...);\n * ```\n *\n * Each rule is called as independent static function with fixed signature:\n *\n * ```javascript\n * function my_token_render(tokens, idx, options, env, renderer) {\n * // ...\n * return renderedHTML;\n * }\n * ```\n *\n * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)\n * for more details and examples.\n **/\n this.rules = assign({}, default_rules);\n}", "title": "" }, { "docid": "fbfb7f3c7dd6a1ed57c3c517495885e0", "score": "0.5431434", "text": "function Renderer() {\n\n /**\n * Renderer#rules -> Object\n *\n * Contains render rules for tokens. Can be updated and extended.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.renderer.rules.strong_open = function () { return '<b>'; };\n * md.renderer.rules.strong_close = function () { return '</b>'; };\n *\n * var result = md.renderInline(...);\n * ```\n *\n * Each rule is called as independent static function with fixed signature:\n *\n * ```javascript\n * function my_token_render(tokens, idx, options, env, renderer) {\n * // ...\n * return renderedHTML;\n * }\n * ```\n *\n * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)\n * for more details and examples.\n **/\n this.rules = assign({}, default_rules);\n}", "title": "" }, { "docid": "fbfb7f3c7dd6a1ed57c3c517495885e0", "score": "0.5431434", "text": "function Renderer() {\n\n /**\n * Renderer#rules -> Object\n *\n * Contains render rules for tokens. Can be updated and extended.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.renderer.rules.strong_open = function () { return '<b>'; };\n * md.renderer.rules.strong_close = function () { return '</b>'; };\n *\n * var result = md.renderInline(...);\n * ```\n *\n * Each rule is called as independent static function with fixed signature:\n *\n * ```javascript\n * function my_token_render(tokens, idx, options, env, renderer) {\n * // ...\n * return renderedHTML;\n * }\n * ```\n *\n * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)\n * for more details and examples.\n **/\n this.rules = assign({}, default_rules);\n}", "title": "" }, { "docid": "fbfb7f3c7dd6a1ed57c3c517495885e0", "score": "0.5431434", "text": "function Renderer() {\n\n /**\n * Renderer#rules -> Object\n *\n * Contains render rules for tokens. Can be updated and extended.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.renderer.rules.strong_open = function () { return '<b>'; };\n * md.renderer.rules.strong_close = function () { return '</b>'; };\n *\n * var result = md.renderInline(...);\n * ```\n *\n * Each rule is called as independent static function with fixed signature:\n *\n * ```javascript\n * function my_token_render(tokens, idx, options, env, renderer) {\n * // ...\n * return renderedHTML;\n * }\n * ```\n *\n * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)\n * for more details and examples.\n **/\n this.rules = assign({}, default_rules);\n}", "title": "" }, { "docid": "fbfb7f3c7dd6a1ed57c3c517495885e0", "score": "0.5431434", "text": "function Renderer() {\n\n /**\n * Renderer#rules -> Object\n *\n * Contains render rules for tokens. Can be updated and extended.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.renderer.rules.strong_open = function () { return '<b>'; };\n * md.renderer.rules.strong_close = function () { return '</b>'; };\n *\n * var result = md.renderInline(...);\n * ```\n *\n * Each rule is called as independent static function with fixed signature:\n *\n * ```javascript\n * function my_token_render(tokens, idx, options, env, renderer) {\n * // ...\n * return renderedHTML;\n * }\n * ```\n *\n * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)\n * for more details and examples.\n **/\n this.rules = assign({}, default_rules);\n}", "title": "" }, { "docid": "fbfb7f3c7dd6a1ed57c3c517495885e0", "score": "0.5431434", "text": "function Renderer() {\n\n /**\n * Renderer#rules -> Object\n *\n * Contains render rules for tokens. Can be updated and extended.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.renderer.rules.strong_open = function () { return '<b>'; };\n * md.renderer.rules.strong_close = function () { return '</b>'; };\n *\n * var result = md.renderInline(...);\n * ```\n *\n * Each rule is called as independent static function with fixed signature:\n *\n * ```javascript\n * function my_token_render(tokens, idx, options, env, renderer) {\n * // ...\n * return renderedHTML;\n * }\n * ```\n *\n * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)\n * for more details and examples.\n **/\n this.rules = assign({}, default_rules);\n}", "title": "" }, { "docid": "766294ee6c6eee2dd7f37f0e2ec9402e", "score": "0.54306185", "text": "function ParserInline(){this.ruler=new Ruler;for(var e=0;e<_rules$2.length;e++)this.ruler.push(_rules$2[e][0],_rules$2[e][1]);// Can be overridden with a custom validator\nthis.validateLink=validateLink}", "title": "" }, { "docid": "9da75f1a768948c86ba66607ca756d09", "score": "0.54253185", "text": "function Renderer() {\n\n /**\n * Renderer#rules -> Object\n *\n * Contains render rules for tokens. Can be updated and extended.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.renderer.rules.strong_open = function () { return '<b>'; };\n * md.renderer.rules.strong_close = function () { return '</b>'; };\n *\n * var result = md.renderInline(...);\n * ```\n *\n * Each rule is called as independed static function with fixed signature:\n *\n * ```javascript\n * function my_token_render(tokens, idx, options, env, renderer) {\n * // ...\n * return renderedHTML;\n * }\n * ```\n *\n * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)\n * for more details and examples.\n **/\n this.rules = assign({}, default_rules);\n}", "title": "" }, { "docid": "9da75f1a768948c86ba66607ca756d09", "score": "0.54253185", "text": "function Renderer() {\n\n /**\n * Renderer#rules -> Object\n *\n * Contains render rules for tokens. Can be updated and extended.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.renderer.rules.strong_open = function () { return '<b>'; };\n * md.renderer.rules.strong_close = function () { return '</b>'; };\n *\n * var result = md.renderInline(...);\n * ```\n *\n * Each rule is called as independed static function with fixed signature:\n *\n * ```javascript\n * function my_token_render(tokens, idx, options, env, renderer) {\n * // ...\n * return renderedHTML;\n * }\n * ```\n *\n * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)\n * for more details and examples.\n **/\n this.rules = assign({}, default_rules);\n}", "title": "" }, { "docid": "9da75f1a768948c86ba66607ca756d09", "score": "0.54253185", "text": "function Renderer() {\n\n /**\n * Renderer#rules -> Object\n *\n * Contains render rules for tokens. Can be updated and extended.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.renderer.rules.strong_open = function () { return '<b>'; };\n * md.renderer.rules.strong_close = function () { return '</b>'; };\n *\n * var result = md.renderInline(...);\n * ```\n *\n * Each rule is called as independed static function with fixed signature:\n *\n * ```javascript\n * function my_token_render(tokens, idx, options, env, renderer) {\n * // ...\n * return renderedHTML;\n * }\n * ```\n *\n * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)\n * for more details and examples.\n **/\n this.rules = assign({}, default_rules);\n}", "title": "" }, { "docid": "9da75f1a768948c86ba66607ca756d09", "score": "0.54253185", "text": "function Renderer() {\n\n /**\n * Renderer#rules -> Object\n *\n * Contains render rules for tokens. Can be updated and extended.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.renderer.rules.strong_open = function () { return '<b>'; };\n * md.renderer.rules.strong_close = function () { return '</b>'; };\n *\n * var result = md.renderInline(...);\n * ```\n *\n * Each rule is called as independed static function with fixed signature:\n *\n * ```javascript\n * function my_token_render(tokens, idx, options, env, renderer) {\n * // ...\n * return renderedHTML;\n * }\n * ```\n *\n * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)\n * for more details and examples.\n **/\n this.rules = assign({}, default_rules);\n}", "title": "" }, { "docid": "d446e9e728a6a1367aeb11151eb67685", "score": "0.53646743", "text": "function ParserInline() {\n this.ruler = new Ruler();\n for (var i = 0; i < _rules.length; i++) {\n this.ruler.push(_rules[i][0], _rules[i][1]);\n }\n \n // Can be overridden with a custom validator\n this.validateLink = validateLink;\n }", "title": "" }, { "docid": "479eb31dec8c04a77a8a9a185c5a4c10", "score": "0.53346705", "text": "function Rules (options) {\n this.options = options;\n this._keep = [];\n this._remove = [];\n\n this.blankRule = {\n replacement: options.blankReplacement\n };\n\n this.keepReplacement = options.keepReplacement;\n\n this.defaultRule = {\n replacement: options.defaultReplacement\n };\n\n this.array = [];\n for (var key in options.rules) this.array.push(options.rules[key]);\n}", "title": "" }, { "docid": "5bc1b720fde002ff1d56a5a47bfe9d8f", "score": "0.5291743", "text": "function ParserInline() {\n this.ruler = new Ruler();\n for (var i = 0; i < _rules.length; i++) {\n this.ruler.push(_rules[i][0], _rules[i][1]);\n }\n\n // Can be overridden with a custom validator\n this.validateLink = validateLink;\n}", "title": "" }, { "docid": "5bc1b720fde002ff1d56a5a47bfe9d8f", "score": "0.5291743", "text": "function ParserInline() {\n this.ruler = new Ruler();\n for (var i = 0; i < _rules.length; i++) {\n this.ruler.push(_rules[i][0], _rules[i][1]);\n }\n\n // Can be overridden with a custom validator\n this.validateLink = validateLink;\n}", "title": "" }, { "docid": "5bc1b720fde002ff1d56a5a47bfe9d8f", "score": "0.5291743", "text": "function ParserInline() {\n this.ruler = new Ruler();\n for (var i = 0; i < _rules.length; i++) {\n this.ruler.push(_rules[i][0], _rules[i][1]);\n }\n\n // Can be overridden with a custom validator\n this.validateLink = validateLink;\n}", "title": "" }, { "docid": "329bca58b88c266b42e8b359760d5450", "score": "0.5244053", "text": "function RuleList(options) {\n this.map = {};\n this.raw = {};\n this.index = [];\n this.counter = 0;\n this.options = options;\n this.classes = options.classes;\n this.keyframes = options.keyframes;\n }", "title": "" }, { "docid": "329bca58b88c266b42e8b359760d5450", "score": "0.5244053", "text": "function RuleList(options) {\n this.map = {};\n this.raw = {};\n this.index = [];\n this.counter = 0;\n this.options = options;\n this.classes = options.classes;\n this.keyframes = options.keyframes;\n }", "title": "" }, { "docid": "61c0ce2c70168ff92c005e9dbf186b9e", "score": "0.5224052", "text": "function RuleList(options) {\n\t this.map = {};\n\t this.raw = {};\n\t this.index = [];\n\t this.counter = 0;\n\t this.options = options;\n\t this.classes = options.classes;\n\t this.keyframes = options.keyframes;\n\t }", "title": "" }, { "docid": "7a24e0ce9c47c2f60b1f5b53af30ac79", "score": "0.5211669", "text": "function ParserInline() {\n\t this.ruler = new Ruler();\n\t for (var i = 0; i < _rules.length; i++) {\n\t this.ruler.push(_rules[i][0], _rules[i][1]);\n\t }\n\t\n\t // Can be overridden with a custom validator\n\t this.validateLink = validateLink;\n\t}", "title": "" }, { "docid": "41d49f9bf83dc055812748ec11dbc46a", "score": "0.5208924", "text": "function ParserInline() {\n\t this.ruler = new Ruler();\n\t for (var i = 0; i < _rules.length; i++) {\n\t this.ruler.push(_rules[i][0], _rules[i][1]);\n\t }\n\n\t // Can be overridden with a custom validator\n\t this.validateLink = validateLink;\n\t}", "title": "" }, { "docid": "69033a50859beb06346cfe7a948a7123", "score": "0.52019876", "text": "function RuleList(options) {\n this.map = {};\n this.raw = {};\n this.index = [];\n this.counter = 0;\n this.options = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.options = options;\n this.classes = options.classes;\n this.keyframes = options.keyframes;\n }", "title": "" }, { "docid": "0782b08fdffc85531bcb83432a223db0", "score": "0.51982427", "text": "function ParserInline() {\n this.ruler = new Ruler();\n for (var i = 0; i < _rules$2.length; i++) {\n this.ruler.push(_rules$2[i][0], _rules$2[i][1]);\n }\n\n // Can be overridden with a custom validator\n this.validateLink = validateLink;\n }", "title": "" }, { "docid": "2d7ebf67a858f5909b03388267966a61", "score": "0.5188964", "text": "function RuleList(options) {\n this.map = {};\n this.raw = {};\n this.index = [];\n this.counter = 0;\n this.options = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.options = options;\n this.classes = options.classes;\n this.keyframes = options.keyframes;\n }", "title": "" }, { "docid": "2d7ebf67a858f5909b03388267966a61", "score": "0.5188964", "text": "function RuleList(options) {\n this.map = {};\n this.raw = {};\n this.index = [];\n this.counter = 0;\n this.options = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.options = options;\n this.classes = options.classes;\n this.keyframes = options.keyframes;\n }", "title": "" }, { "docid": "2d7ebf67a858f5909b03388267966a61", "score": "0.5188964", "text": "function RuleList(options) {\n this.map = {};\n this.raw = {};\n this.index = [];\n this.counter = 0;\n this.options = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.options = options;\n this.classes = options.classes;\n this.keyframes = options.keyframes;\n }", "title": "" }, { "docid": "2d7ebf67a858f5909b03388267966a61", "score": "0.5188964", "text": "function RuleList(options) {\n this.map = {};\n this.raw = {};\n this.index = [];\n this.counter = 0;\n this.options = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.options = options;\n this.classes = options.classes;\n this.keyframes = options.keyframes;\n }", "title": "" }, { "docid": "2d7ebf67a858f5909b03388267966a61", "score": "0.5188964", "text": "function RuleList(options) {\n this.map = {};\n this.raw = {};\n this.index = [];\n this.counter = 0;\n this.options = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.options = options;\n this.classes = options.classes;\n this.keyframes = options.keyframes;\n }", "title": "" }, { "docid": "2d7ebf67a858f5909b03388267966a61", "score": "0.5188964", "text": "function RuleList(options) {\n this.map = {};\n this.raw = {};\n this.index = [];\n this.counter = 0;\n this.options = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.options = options;\n this.classes = options.classes;\n this.keyframes = options.keyframes;\n }", "title": "" }, { "docid": "2d7ebf67a858f5909b03388267966a61", "score": "0.5188964", "text": "function RuleList(options) {\n this.map = {};\n this.raw = {};\n this.index = [];\n this.counter = 0;\n this.options = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.options = options;\n this.classes = options.classes;\n this.keyframes = options.keyframes;\n }", "title": "" }, { "docid": "2d7ebf67a858f5909b03388267966a61", "score": "0.5188964", "text": "function RuleList(options) {\n this.map = {};\n this.raw = {};\n this.index = [];\n this.counter = 0;\n this.options = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.options = options;\n this.classes = options.classes;\n this.keyframes = options.keyframes;\n }", "title": "" }, { "docid": "2d7ebf67a858f5909b03388267966a61", "score": "0.5188964", "text": "function RuleList(options) {\n this.map = {};\n this.raw = {};\n this.index = [];\n this.counter = 0;\n this.options = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.options = options;\n this.classes = options.classes;\n this.keyframes = options.keyframes;\n }", "title": "" }, { "docid": "2d7ebf67a858f5909b03388267966a61", "score": "0.5188964", "text": "function RuleList(options) {\n this.map = {};\n this.raw = {};\n this.index = [];\n this.counter = 0;\n this.options = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.options = options;\n this.classes = options.classes;\n this.keyframes = options.keyframes;\n }", "title": "" }, { "docid": "2d7ebf67a858f5909b03388267966a61", "score": "0.5188964", "text": "function RuleList(options) {\n this.map = {};\n this.raw = {};\n this.index = [];\n this.counter = 0;\n this.options = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.options = options;\n this.classes = options.classes;\n this.keyframes = options.keyframes;\n }", "title": "" }, { "docid": "2d7ebf67a858f5909b03388267966a61", "score": "0.5188964", "text": "function RuleList(options) {\n this.map = {};\n this.raw = {};\n this.index = [];\n this.counter = 0;\n this.options = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.options = options;\n this.classes = options.classes;\n this.keyframes = options.keyframes;\n }", "title": "" }, { "docid": "2d7ebf67a858f5909b03388267966a61", "score": "0.5188964", "text": "function RuleList(options) {\n this.map = {};\n this.raw = {};\n this.index = [];\n this.counter = 0;\n this.options = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.options = options;\n this.classes = options.classes;\n this.keyframes = options.keyframes;\n }", "title": "" }, { "docid": "2d7ebf67a858f5909b03388267966a61", "score": "0.5188964", "text": "function RuleList(options) {\n this.map = {};\n this.raw = {};\n this.index = [];\n this.counter = 0;\n this.options = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.options = options;\n this.classes = options.classes;\n this.keyframes = options.keyframes;\n }", "title": "" }, { "docid": "0ea063cfae007a9a71a1b0ed77ffcf8a", "score": "0.51532835", "text": "setupLines() {\n\t\tthis.rules['opening'] = [ 'I often wonder,', 'Have you ever thought,',\n\t\t\t\t\t\t\t\t 'A great man once asked,', 'I have a question:',\n\t\t\t\t\t\t\t\t 'Ask yourself but this:'\n\t\t\t\t\t\t\t ];\n\t\tthis.rules['question'] = [ 'Why is the earth globular?', 'Who invented stringy cheese?',\n\t\t\t\t\t\t\t\t\t'How does one commit tax fraud?', 'What is the meaning of art?',\n\t\t\t\t\t\t\t\t\t'Should we allow dogs to vote?'\n\t\t\t\t\t\t\t ]; \n\n\t\tthis.rules['ending'] = [ 'Tasty food for thought.', \"Aren't you curious?\",\n\t\t\t\t\t\t\t\t 'Something to chew on.', 'A musing for you.',\n\t\t\t\t\t\t\t\t 'Oh, how intriguing!'\n\t\t\t\t\t\t\t ]; \n\t\tthis.probability['opening'] = \n\t\tthis.probability['question'] = \n\t\tthis.probability['ending'] = [0.2, 0.2, 0.2, 0.2, 0.2];\n\n\t}", "title": "" }, { "docid": "94fdc52a9842513b075677cea1f80779", "score": "0.5090835", "text": "function RuleList(options) {\n this.map = {};\n this.raw = {};\n this.index = [];\n this.options = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.options = options;\n this.classes = options.classes;\n this.keyframes = options.keyframes;\n }", "title": "" }, { "docid": "a9b820c30a50586648b0692af10d16e8", "score": "0.5082314", "text": "function RuleList(options) {\n this.map = {};\n this.raw = {};\n this.index = [];\n this.options = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.options = options;\n this.classes = options.classes;\n this.keyframes = options.keyframes;\n }", "title": "" }, { "docid": "a9b820c30a50586648b0692af10d16e8", "score": "0.5082314", "text": "function RuleList(options) {\n this.map = {};\n this.raw = {};\n this.index = [];\n this.options = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.options = options;\n this.classes = options.classes;\n this.keyframes = options.keyframes;\n }", "title": "" }, { "docid": "a9b820c30a50586648b0692af10d16e8", "score": "0.5082314", "text": "function RuleList(options) {\n this.map = {};\n this.raw = {};\n this.index = [];\n this.options = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.options = options;\n this.classes = options.classes;\n this.keyframes = options.keyframes;\n }", "title": "" }, { "docid": "a9b820c30a50586648b0692af10d16e8", "score": "0.5082314", "text": "function RuleList(options) {\n this.map = {};\n this.raw = {};\n this.index = [];\n this.options = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.options = options;\n this.classes = options.classes;\n this.keyframes = options.keyframes;\n }", "title": "" }, { "docid": "a9b820c30a50586648b0692af10d16e8", "score": "0.5082314", "text": "function RuleList(options) {\n this.map = {};\n this.raw = {};\n this.index = [];\n this.options = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.options = options;\n this.classes = options.classes;\n this.keyframes = options.keyframes;\n }", "title": "" }, { "docid": "a9b820c30a50586648b0692af10d16e8", "score": "0.5082314", "text": "function RuleList(options) {\n this.map = {};\n this.raw = {};\n this.index = [];\n this.options = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.options = options;\n this.classes = options.classes;\n this.keyframes = options.keyframes;\n }", "title": "" }, { "docid": "a9b820c30a50586648b0692af10d16e8", "score": "0.5082314", "text": "function RuleList(options) {\n this.map = {};\n this.raw = {};\n this.index = [];\n this.options = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.options = options;\n this.classes = options.classes;\n this.keyframes = options.keyframes;\n }", "title": "" }, { "docid": "a9b820c30a50586648b0692af10d16e8", "score": "0.5082314", "text": "function RuleList(options) {\n this.map = {};\n this.raw = {};\n this.index = [];\n this.options = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.options = options;\n this.classes = options.classes;\n this.keyframes = options.keyframes;\n }", "title": "" }, { "docid": "21f32e6046cca9a3e2050d3e94c8567b", "score": "0.50703233", "text": "function RuleFixer(){Object.freeze(this);}", "title": "" }, { "docid": "dde2a20850b106926c493eea6a60e214", "score": "0.50190693", "text": "static _rules(validator) {\n }", "title": "" }, { "docid": "53981192d52a5a51146f5de8551abc8a", "score": "0.50000286", "text": "function RuleManager(ruleSet) {\r\n let _definedRules = ruleSet || defaultRules;\r\n this.setDefinedRules(_definedRules);\r\n }", "title": "" }, { "docid": "7d6fd4999fdef880e5247bac41bca888", "score": "0.49942195", "text": "function addRuler(x1, y1, x2, y2) {\n const cx = rn((x1 + x2) / 2, 2), cy = rn((y1 + y2) / 2, 2);\n const size = rn(1 / scale ** .3 * 2, 1);\n const dash = rn(30 / distanceScaleInput.value, 2);\n\n // body\n const rulerNew = ruler.append(\"g\").attr(\"class\", \"ruler\").call(d3.drag().on(\"start\", dragRuler));\n rulerNew.append(\"line\").attr(\"x1\", x1).attr(\"y1\", y1).attr(\"x2\", x2).attr(\"y2\", y2).attr(\"class\", \"white\").attr(\"stroke-width\", size);\n rulerNew.append(\"line\").attr(\"x1\", x1).attr(\"y1\", y1).attr(\"x2\", x2).attr(\"y2\", y2).attr(\"class\", \"gray\").attr(\"stroke-width\", size).attr(\"stroke-dasharray\", dash);\n rulerNew.append(\"circle\").attr(\"r\", 2 * size).attr(\"stroke-width\", .5 * size).attr(\"cx\", x1).attr(\"cy\", y1).attr(\"data-edge\", \"left\").call(d3.drag().on(\"drag\", dragRulerEdge));\n rulerNew.append(\"circle\").attr(\"r\", 2 * size).attr(\"stroke-width\", .5 * size).attr(\"cx\", x2).attr(\"cy\", y2).attr(\"data-edge\", \"right\").call(d3.drag().on(\"drag\", dragRulerEdge));\n\n // label and center\n const angle = Math.atan2(y2 - y1, x2 - x1) * 180 / Math.PI;\n const rotate = `rotate(${angle} ${cx} ${cy})`;\n const dist = rn(Math.hypot(x1 - x2, y1 - y2));\n const label = rn(dist * distanceScaleInput.value) + \" \" + distanceUnitInput.value;\n rulerNew.append(\"rect\").attr(\"x\", cx - size * 1.5).attr(\"y\", cy - size * 1.5).attr(\"width\", size * 3).attr(\"height\", size * 3).attr(\"transform\", rotate).attr(\"stroke-width\", .5 * size).call(d3.drag().on(\"start\", rulerCenterDrag));\n rulerNew.append(\"text\").attr(\"x\", cx).attr(\"y\", cy).attr(\"dx\", \".3em\").attr(\"dy\", \"-.3em\").attr(\"transform\", rotate).attr(\"font-size\", 10 * size).text(label).on(\"click\", removeParent);\n}", "title": "" }, { "docid": "efe7bf6bd2a246cd72c0ce12fd50193b", "score": "0.49806944", "text": "generateLexRules() {\n const lexRulesArray = [];\n\n const lexRules = this._grammar.getLexGrammar().getRules().map((rule, i) => {\n const rawHandler = rule.getRawHandler();\n const action = !rawHandler\n ? 'return null;'\n : this._actionFromHandler(rule.getRawHandler());\n\n this._lexHandlers.push(action);\n\n let flags = [];\n\n if (rule.isCaseInsensitive()) {\n flags.push('i');\n }\n\n if (flags.length > 0) {\n flags = `(?${flags.join('')})`\n } else {\n flags = '';\n }\n\n lexRulesArray.push(\n `mLexHandlerMethods[${i}] = `+\n `Tokenizer.class.getDeclaredMethod(\"_lexRule${i}\");`\n );\n\n const re = encodeRE(`${flags}${rule.getRawMatcher()}`);\n return `Pattern.compile(\"${re}\")`;\n });\n\n this.writeData('LEX_RULE_METHODS_COUNT', lexRules.length);\n this.writeData('LEX_RULE_HANDLER_METHODS', lexRulesArray.join('\\n '));\n this.writeData('LEX_RULES', lexRules.join(',\\n '));\n }", "title": "" }, { "docid": "f758ffda51795de5da22609b59edd5d8", "score": "0.49747586", "text": "_parseStyleRules() {\n if (__WEBPACK_IMPORTED_MODULE_0__AutoNumericHelper__[\"a\" /* default */].isUndefinedOrNullOrEmpty(this.settings.styleRules) || this.rawValue === '') {\n return;\n }\n\n // 'positive' attribute\n if (!__WEBPACK_IMPORTED_MODULE_0__AutoNumericHelper__[\"a\" /* default */].isUndefinedOrNullOrEmpty(this.settings.styleRules.positive)) {\n if (this.rawValue >= 0) {\n this._addCSSClass(this.settings.styleRules.positive);\n } else {\n this._removeCSSClass(this.settings.styleRules.positive);\n }\n }\n\n // 'negative' attribute\n if (!__WEBPACK_IMPORTED_MODULE_0__AutoNumericHelper__[\"a\" /* default */].isUndefinedOrNullOrEmpty(this.settings.styleRules.negative)) {\n if (this.rawValue < 0) {\n this._addCSSClass(this.settings.styleRules.negative);\n } else {\n this._removeCSSClass(this.settings.styleRules.negative);\n }\n }\n\n // 'ranges' attribute\n if (!__WEBPACK_IMPORTED_MODULE_0__AutoNumericHelper__[\"a\" /* default */].isUndefinedOrNullOrEmpty(this.settings.styleRules.ranges) && this.settings.styleRules.ranges.length !== 0) {\n this.settings.styleRules.ranges.forEach(range => {\n if (this.rawValue >= range.min && this.rawValue < range.max) {\n this._addCSSClass(range.class);\n } else {\n this._removeCSSClass(range.class);\n }\n });\n }\n\n // 'userDefined' attribute\n //TODO Also pass the old raw value as a parameter, and not only the new raw value\n if (!__WEBPACK_IMPORTED_MODULE_0__AutoNumericHelper__[\"a\" /* default */].isUndefinedOrNullOrEmpty(this.settings.styleRules.userDefined) && this.settings.styleRules.userDefined.length !== 0) {\n this.settings.styleRules.userDefined.forEach(userObject => {\n if (__WEBPACK_IMPORTED_MODULE_0__AutoNumericHelper__[\"a\" /* default */].isFunction(userObject.callback)) {\n // Test for the type of the `classes` attribute, which changes the function behavior\n if (__WEBPACK_IMPORTED_MODULE_0__AutoNumericHelper__[\"a\" /* default */].isString(userObject.classes)) {\n // If 'classes' is a string, set it if `true`, remove it if `false`\n if (userObject.callback(this.rawValue)) {\n this._addCSSClass(userObject.classes);\n } else {\n this._removeCSSClass(userObject.classes);\n }\n } else if (__WEBPACK_IMPORTED_MODULE_0__AutoNumericHelper__[\"a\" /* default */].isArray(userObject.classes)) {\n if (userObject.classes.length === 2) {\n // If 'classes' is an array with only 2 elements, set the first class if `true`, the second if `false`\n if (userObject.callback(this.rawValue)) {\n this._addCSSClass(userObject.classes[0]);\n this._removeCSSClass(userObject.classes[1]);\n } else {\n this._removeCSSClass(userObject.classes[0]);\n this._addCSSClass(userObject.classes[1]);\n }\n } else if (userObject.classes.length > 2) {\n // The callback returns an array of indexes to use on the `classes` array\n const callbackResult = userObject.callback(this.rawValue);\n if (__WEBPACK_IMPORTED_MODULE_0__AutoNumericHelper__[\"a\" /* default */].isArray(callbackResult)) {\n // If multiple indexes are returned\n userObject.classes.forEach((userClass, index) => {\n if (__WEBPACK_IMPORTED_MODULE_0__AutoNumericHelper__[\"a\" /* default */].isInArray(index, callbackResult)) {\n this._addCSSClass(userClass);\n } else {\n this._removeCSSClass(userClass);\n }\n });\n } else if (__WEBPACK_IMPORTED_MODULE_0__AutoNumericHelper__[\"a\" /* default */].isInt(callbackResult)) {\n // If only one index is returned\n userObject.classes.forEach((userClass, index) => {\n if (index === callbackResult) {\n this._addCSSClass(userClass);\n } else {\n this._removeCSSClass(userClass);\n }\n });\n } else if (__WEBPACK_IMPORTED_MODULE_0__AutoNumericHelper__[\"a\" /* default */].isNull(callbackResult)) {\n // Remove all the classes\n userObject.classes.forEach(userClass => {\n this._removeCSSClass(userClass);\n });\n } else {\n __WEBPACK_IMPORTED_MODULE_0__AutoNumericHelper__[\"a\" /* default */].throwError(`The callback result is not an array nor a valid array index, ${typeof callbackResult} given.`);\n }\n } else {\n __WEBPACK_IMPORTED_MODULE_0__AutoNumericHelper__[\"a\" /* default */].throwError('The classes attribute is not valid for the `styleRules` option.');\n }\n } else if (__WEBPACK_IMPORTED_MODULE_0__AutoNumericHelper__[\"a\" /* default */].isUndefinedOrNullOrEmpty(userObject.classes)) {\n // If 'classes' is `undefined` or `null`, then the callback is called with the AutoNumeric object passed as a parameter\n userObject.callback(this);\n } else {\n __WEBPACK_IMPORTED_MODULE_0__AutoNumericHelper__[\"a\" /* default */].throwError('The callback/classes structure is not valid for the `styleRules` option.');\n }\n } else {\n __WEBPACK_IMPORTED_MODULE_0__AutoNumericHelper__[\"a\" /* default */].warning(`The given \\`styleRules\\` callback is not a function, ${typeof callback} given.`, this.settings.showWarnings);\n }\n });\n }\n }", "title": "" }, { "docid": "f1aa0616eb7b52755a46692df4b09102", "score": "0.4945486", "text": "constructor() {\n\n /**\n * A collection of compiled validators for rules that have already\n * been validated.\n * @type {WeakMap}\n */\n this.validators = new WeakMap();\n }", "title": "" }, { "docid": "db8f5fffb39733084e15e913d8d4c269", "score": "0.4933389", "text": "_generateLexRules() {\n let lexRules = this._grammar.getLexRules().map(lexRule => {\n return `[${lexRule.getMatcher()}, () => { ${lexRule.getRawHandler()} }]`;\n });\n\n this._resultData = this._resultData.replace(\n '<<LEX_RULES>>',\n () => `[${lexRules.join(',\\n')}]`,\n );\n }", "title": "" }, { "docid": "2042b440bbaf8ba0e94063fa25032ebb", "score": "0.4921775", "text": "static get RULE() { return 'Rule'; }", "title": "" }, { "docid": "f0c2c47bd477319daf1d72b8de00ec82", "score": "0.48886028", "text": "constructor(rules) {\n this.requiredRules = [];\n this.regexRules = [];\n // Caching required rules to check when matching objects.\n _.each(rules, function(config, name) {\n if(config.required)\n this.requiredRules.push(name);\n\n // The key is a regexp\n if(name.indexOf('@regex ') === 0) {\n // Flag it to check in the matches method.\n config.__hasRegexpKey = true;\n // Cache the regexp definition in config.\n config.__regexpDef = name;\n // And then compile it.\n config.__keyRegexp = new RegExp(name.replace('@regex ', ''));\n this.regexRules.push(config);\n }\n }, this);\n this.rules = rules;\n }", "title": "" }, { "docid": "061caa833c2f39c0d0bcc988f762585a", "score": "0.48825747", "text": "addRule(rule) {\n this.rules.push(rule);\n }", "title": "" }, { "docid": "e38c2f48c9db75830ff94441ca51f623", "score": "0.48615244", "text": "async addNewRule() {\n await this.pageStyle.addNewRule(this.element, this.element.pseudoClassLocks);\n }", "title": "" }, { "docid": "9ea1c680e6572135960ec063f51244b0", "score": "0.48392838", "text": "generateLexRules() {\n const lexRules = this._grammar.getLexGrammar().getRules().map(lexRule => {\n let handler = lexRule.getRawHandler();\n\n if (!handler.includes('return')) {\n handler = `return ${handler}`;\n }\n\n let action = this._actionFromHandler(handler);\n\n this._lexHandlers.push({\n args: 'const Tokenizer& tokenizer, const std::string& yytext',\n action,\n });\n\n return `{std::regex(R\"(${lexRule.getRawMatcher()})\"), ` +\n `&_lexRule${this._lexHandlers.length}}`;\n });\n\n this.writeData('LEX_RULES_COUNT', lexRules.length);\n\n this.writeData('LEX_RULES', `{{\\n ${lexRules.join(',\\n ')}\\n}}`);\n }", "title": "" }, { "docid": "ef6bddf2db27665be008a82b770a09b5", "score": "0.48124164", "text": "constructor(options) {\n if (options == null) {\n options = {};\n }\n this.options = options;\n if (this.options.shouldOpenLinkInNewTab == null) {\n this.options.shouldOpenLinkInNewTab = (url) => true;\n }\n\n this.lexerBlockRules = this.options.inlineOnly\n ? [TrelloMarkdown.lexerBlockRules.error]\n : this._expandRules(\n TrelloMarkdown.lexerBlockRules,\n this.options.restrict != null\n ? this.options.restrict.block\n : undefined,\n );\n\n this.lexerInlineRules = this._expandRules(\n TrelloMarkdown.lexerInlineRules,\n this.options.restrict != null\n ? this.options.restrict.inline\n : undefined,\n );\n }", "title": "" }, { "docid": "47047f28ff75d42644599e5910de5ff6", "score": "0.47623262", "text": "static rtl(){\n\n }", "title": "" }, { "docid": "5041cbd2a75c5d201719732af33922b3", "score": "0.4725927", "text": "function Helper() {\n /**\n * Precompile regex operations\n *\n * @member {object}\n */\n this.RX = {\n letters: /[^a-zA-Z]/g,\n numbers: /[^0-9]/g\n };\n }", "title": "" }, { "docid": "1962c923cd7b0d6580efa7d13bb12f1b", "score": "0.4682364", "text": "constructor(rules) {\n super();\n\n this._rules = rules || {};\n }", "title": "" }, { "docid": "afcf762a26f728c837e227f1cd7e33b9", "score": "0.4679947", "text": "function prepareRuleList() {\n //Extend rule list with further functions\n for (let i = 0; i < ruleList.length; i++) {\n //Get current rule\n let rule = ruleList[i];\n\n //Extend rule for toggle function\n rule.onToggle = createOnToggleFunction(rule.id);\n }\n }", "title": "" }, { "docid": "40a55407d020d455932be6325289b772", "score": "0.46665293", "text": "constructor(){\n super();\n\n this.rules = []; //this.childNodes gives all descendants, while this.rules gives all child rules\n }", "title": "" } ]
00cb2438478b4ef2098eae26fb799050
send event to a list of users
[ { "docid": "10b48b99204b23159093763a89251bfb", "score": "0.59713477", "text": "sendToUserList(message, receiverList) {\n\t\t// check if receivers were given\n\t\tif (receiverList.length < 1) {\n\t\t\treturn false;\n\t\t}\n\t\n\t\t// send message to all participants\n\t\tfor (let i = 0, len = receiverList.length; i < len; i++) {\n\t\t\tlet userSession = storageHandler.getByProperty('user', receiverList[i]);\n\t\t\tthis.sendToSession(message, userSession[0]);\n\t\t}\n\n\t\t// done\n\t\treturn true;\n\t}", "title": "" } ]
[ { "docid": "5ea73f54676df86f431ceff6febfb97e", "score": "0.7376479", "text": "function broadcastUserList(){\n var userList = [];\n var user;\n for(var sesID in sessions) {\n user = {};\n user.sessionID = sesID;\n user.name = sessions[sesID].username;\n userList.push(user);\n }\n\n io.emit('newUser', userList);\n }", "title": "" }, { "docid": "f66ef9ef935cbdb3f217f4df6b7169f2", "score": "0.73071474", "text": "function emit(event) {\n console.log(event);\n for (var key in users) if (users.hasOwnProperty(key))\n if (users[key].send) users[key].send(event);\n }", "title": "" }, { "docid": "7406a108aace7096f9bd65e9f923c13f", "score": "0.7144195", "text": "function sendUserList(list) {\n io.emit('update users', list); //update the users list of the client\n}", "title": "" }, { "docid": "6a8d9b62c6e4341d4ac839193e802148", "score": "0.6667369", "text": "function sendUsers () {\n const usersData = users.map((user)=>{\n return{\n username: user.username,\n isActive: user === currentPlayer\n }\n });\n //envoyer ce qu'on vient de créer\n io.emit ('users', usersData);\n}", "title": "" }, { "docid": "c9178086622a08fb9c07cf7787a2a240", "score": "0.66489565", "text": "function broadcast(some_users, msg) {\n for (i in some_users) {\n some_users[i].sendMsg(msg); // catch send failure and delete user!\n }\n}", "title": "" }, { "docid": "05ebe92ed10ee17d876a12b2ad20db84", "score": "0.6637103", "text": "function sendUsernameList() {\n var id;\n var usernameList = { msg: \"username_list\", data: client_usernames };\n for (id in clients) {\n if (clients.hasOwnProperty(id)) {\n clients[id].send(JSON.stringify(usernameList));\n }\n }\n}", "title": "" }, { "docid": "503349b961f50efdf8430981d7e804b3", "score": "0.6632612", "text": "function updateUsernames(){\n\tio.sockets.emit('get userlist',{\"userlist\":UserList})\n}", "title": "" }, { "docid": "86ed60eeb06da0875ad41ed97fbb205e", "score": "0.6607914", "text": "function updateUserNames(){\n io.emit(\"usersToClients\",users);\n }", "title": "" }, { "docid": "b3a6e195935e9dc0157456a61a30542a", "score": "0.6593443", "text": "function updateCurrUsers(list){\n io.emit('userList', list);\n}", "title": "" }, { "docid": "60ce90a6cf7387b26722bf47f4fcc9a2", "score": "0.65731966", "text": "function flushUsers(users) {\n $(\"#list\").empty().append('<li title=\"doubleClick\" alt=\"all\" class=\"sayingto\" onselectstart=\"return false\">everyone</li>');\n \n for (var i in users) {\n $(\"#list\").append('<li alt=\"' + users[i] + '\" title=\"doubleClick\" onselectstart=\"return false\">' + users[i] + '</li>');\n }\n // double click to talk to one person\n $(\"#list > li\").dblclick(function() {\n // can only talk to others so cannot click self, which is from\n if ($(this).attr('alt') != from) {\n //change the double clicked user as talking \"to\"\n to = $(this).attr('alt');\n \n $(\"#list > li\").removeClass('sayingto');\n \n $(this).addClass('sayingto');\n //refresh who is talking to who\n showSayTo();\n }\n });\n }", "title": "" }, { "docid": "0c8f9c40925fe63b57b62ca9466bf2e7", "score": "0.65506476", "text": "function updateUsernames(){\n\t\tio.sockets.emit('get users', users)\n\t}", "title": "" }, { "docid": "a0d180eb046e2ae83a61cd58975e0059", "score": "0.6543267", "text": "function updateUsernames() {\n //broadcast the username to all\n io.emit('get users', users);\n }", "title": "" }, { "docid": "136d34128fd93233ac10ec63b0d4c2bd", "score": "0.6447584", "text": "sendUsersNotification({ from, users, message }) {\n return Promise.all(users.map((user) => this.sendUserNotification({\n from,\n user,\n message\n })));\n }", "title": "" }, { "docid": "1c9ffdec61bc981f5222e4a880f7a285", "score": "0.64243245", "text": "function outputUsers(users) {\n\n\tfor (var i = 0; i < users.length; i++) {\n\t\tvar el = document.createElement('li'),\n\t\tuser = users[i];\n\n\t\tel.setAttribute('id', user.id);\n\t\tel.innerHTML = user.username;\n\t\tel.addEventListener('click', function () {\n\t\t\t// TODO: We will create this method\n\t\t\tcreateOffer(user.id);\n\t\t});\n\t\tuserList.appendChild(el);\n\t}\n\n\t// userList.innerHTML = `\n\t// ${users.map(user => `<li>${user.username}</li>`).join('')}\n\t// `;\n}", "title": "" }, { "docid": "08bfcc6f1de8a06c279a909f20599d97", "score": "0.6413618", "text": "function send(seat) {\n var usersList = new Array(); \n var counter = 0;\n var eventUserRef = ref.child('NotificationByEventID').child(seat.event.id);\n eventUserRef.once(\"value\", function (snapshot) {\n var numOfChild = snapshot.numChildren();\n snapshot.forEach(function (childSnapshot) {\n ref.child(\"users\").child(childSnapshot.key).once(\"value\").then(function (snap) {\n counter++;\n if (snap.val())\n usersList.push(snap.val());\n if (counter == numOfChild) {\n var data = {\n userList: usersList,\n message: \" התפנה מקום למשחק\" + seat.event.homeTeam.Name + \" נגד \" +\n seat.event.awayTeam.Name + \" שער \" + seat.gateNum + \" מספר כיסא - \"\n + seat.seatNumber + \" שורה - \" + seat.row,\n imageUrl: seat.imageUrl\n }\n Notifications.send(data); // send push on $http\n }\n });\n });\n });\n }", "title": "" }, { "docid": "4ded518692a25a39ea1a3986b13725eb", "score": "0.63900644", "text": "function onUsersOfChat (users) {\n var allUsers = users.users_info;\n\n for(i=0;i<allUsers.length;i++){\n user = allUsers[i];\n if(user.social_type == \"facebook\"){\n addFacebookUserToConnectedList(user.social_id);\n }\n }\n}", "title": "" }, { "docid": "ae0cf62daa90e3de17c656d1475419f2", "score": "0.6372366", "text": "function broadcastToAllValidUsers(key, value) {\n for (let username in users) {\n users[username].emit(key, value);\n }\n }", "title": "" }, { "docid": "8e65570a947ef02e466d38f951c7a3c1", "score": "0.63524944", "text": "function updateUsers(){\n io.sockets.emit('update users', Object.keys(users));\n }", "title": "" }, { "docid": "57aa2dfa679aee29859e17d14efcaade", "score": "0.6350903", "text": "function emit_to_all( ) {\r\n\t// Build a func params array without the userid/passhash arguments\r\n\tvar funcparams = [];\r\n\tfor( var i = 0; i < arguments.length; ++i ) {\r\n\t\tfuncparams[i] = arguments[i];\r\n\t}\r\n\r\n\t// Loop each client and send it to those who are authorized\r\n\tclients.forEach(function ( oclient ) {\r\n\t\tif( !oclient.authed ) return;\r\n\t\toclient.emit.apply( oclient, funcparams );\r\n\t});\r\n}", "title": "" }, { "docid": "f0391bc9974dd3f1f55d0f85c0fc850e", "score": "0.63402325", "text": "function userJoined(user) {\n users.push(user)\n}", "title": "" }, { "docid": "4cdc1a07d3aeeec871aded1127576a19", "score": "0.6338047", "text": "function userList(p) {\n var msg = {\n \"type\": \"userList\"\n };\n this.socket.send(msg);\n }", "title": "" }, { "docid": "1410b4b920fd0138b65984c4edd6aff2", "score": "0.6292476", "text": "function sendAllOnlineUsers() {\n\n\t\tio.sockets.emit('online users', Object.keys(onlineUsers));\t\n\n\t}", "title": "" }, { "docid": "90b787910765342c609a4058059c2d2c", "score": "0.62414235", "text": "function addUsersToEvent(eventid, userids, cb){\n var query = {};\n query['_id'] = eventid;\n\n addToArrayField(collEvents, query, 'followers', userids, cb);\n }", "title": "" }, { "docid": "3c945ed6e0578538f767a5f4aa479592", "score": "0.6205162", "text": "async publishUserToTeams () {\n\t\tconst teamIds = this.user.get('teamIds') || [];\n\t\tawait Promise.all(teamIds.map(async teamId => {\n\t\t\tawait this.publishUserToTeam(teamId);\n\t\t}));\n\t}", "title": "" }, { "docid": "c7bf3951055e2630f74ce40f0fc73611", "score": "0.62023944", "text": "function updateOnlineUsersList() {\n io.emit('addOnlineUsers', users);\n }", "title": "" }, { "docid": "ec5539f3b79a609d1d360ef7063cc037", "score": "0.6146281", "text": "function emit_to( userid, passhash ) {\r\n\t// Build a func params array without the userid/passhash arguments\r\n\tvar funcparams = [];\r\n\tfor( var i = 2; i < arguments.length; ++i ) {\r\n\t\tfuncparams[i-2] = arguments[i];\r\n\t}\r\n\t\t\r\n\t// Loop each client and send it to those authed as the requested user\r\n\tclients.forEach(function ( oclient ) {\r\n\t\tif( oclient.userid != userid || oclient.passhash != passhash ) return;\r\n\t\toclient.emit.apply( oclient, funcparams );\r\n\t});\r\n}", "title": "" }, { "docid": "e00fe40f1ce618dc3429690ddeceea6b", "score": "0.6139303", "text": "function sendServerMessageGlobal(message){\n\tfor(var i = 0; i < userList.length; i++){\n\t\tsendServerMessage(userList[i].id, message);\n\t}\n}", "title": "" }, { "docid": "ee6a2db0fefd613aa0a4a57c6b9d5fcb", "score": "0.613236", "text": "function sendUsers(sid) {\n const userDB = db.get(\"users\");\n const userlist = {};\n\n Object.keys(userDB).forEach(user => {\n userlist[user] = userDB[user].privileged || false;\n });\n sendObj(sid, {type: \"USER_LIST\", users: userlist});\n}", "title": "" }, { "docid": "25fd786a1c535777f94edb248d362db9", "score": "0.611961", "text": "function sendToSubscribers(robot, stats) {\n var subscribers = stats._subscribers;\n for (var subscriber in subscribers) {\n var user = {id: subscriber};\n var subscriptions = Array.from(subscribers[subscriber]);\n var message = `Here are your weekly subscriptions to \\`${subscriptions.join(', ')}\\`!`;\n robot.send({room: subscriber}, message)[0].then(() => {\n subscriptions.forEach(subscription => {\n switch (subscription) {\n case 'rooms': printRoomStat(robot, user, stats.rooms); break;\n case 'commands': printCommandStat(robot, user, stats.commands); break;\n default: printStat(robot, user, stats, subscription);\n }\n });\n });\n }\n}", "title": "" }, { "docid": "dbe57a90b818fad61d38aa0314c27708", "score": "0.6090289", "text": "function emitUpdatedUsers(socket) {\n Participant.find({}, null, {sort: {nameLower: 1}}, function (err, participants) {\n socket.emit('userlist', participants);\n });\n}", "title": "" }, { "docid": "446417431532d86e34b57ad2208fc230", "score": "0.60817206", "text": "sendToAllPlayers(event,data){\n gameEngineLog(\"Game \"+this.name+\" sending event \"+event+\" with data \"+JSON.stringify(data)+\" to all players.\");\n // MDH@25FEB2020 BUG FIX: if the game is over stop sending\n if(event==\"GAMEOVER\")if(this._eventToSend){this._eventToSend=null;this._promptEventResponseReceived();}\n // MDH@15JAN2020: I believe now it's best to simply send it to all players directly\n // so the event will be acknowledged!!!!\n this._players.forEach((player)=>{player._sendNewEvent(event,data,5);});\n /* replacing sending the given event to all players through the 'room' they are in\n socket_io_server.to(this._tableId).emit(...logEvent(this._tableId,\"to all players\",event,data));\n */\n }", "title": "" }, { "docid": "6f1841ac68b319dd6e029e189fc35533", "score": "0.6078711", "text": "function deleteEventfromAllUsers(json){\n //deleting deleted event from all users\n for(i=0; i<json.length; i++){//looping through all the array of users containing the event\n deleteEventFromUser(json[i].name, eventId);//delete or \"updating\" user's array\n };\n }", "title": "" }, { "docid": "c150e70a2207f03ecb9312f8c90a9bf0", "score": "0.60769653", "text": "function updateUsernames(){\n io.sockets.emit('usernames',Object.keys(users));\n }", "title": "" }, { "docid": "1ad0ec3b545a01bbc35acb39cb2298f5", "score": "0.6064734", "text": "function sendUsersActive(){\n\t\tsocket.emit('updateAvailable');\n }", "title": "" }, { "docid": "9826f7db5539bd37040f50c2ddf7a13f", "score": "0.60597616", "text": "function broadcast(name, data){\r\n var key, _socket;\r\n for(key in _users)\r\n {\r\n _socket = _users[key];\r\n _socket.emit(name, data);\r\n }\r\n }", "title": "" }, { "docid": "c8065958f0da6ac0ecabf20bc037b86a", "score": "0.60452545", "text": "sendNotification () {\n for (let i = 0; i < this.state.userIds.length; i++) {\n monday.api(`mutation {create_notification(text: \"${document.getElementById(\"NotificationTextField\").value}\", user_id: ${this.state.userIds[i]}, target_id: ${this.state.firstItemId}, target_type: Project) { id }}`);\n this.sendFirstValueWebhook();\n monday.execute(\"notice\", { \n message: \"Your notification was sent successfully. You will see it soon!\",\n type: \"success\", \n timeout: 5000,\n });\n }\n }", "title": "" }, { "docid": "23782192ecb6ec2ad29fba8d402fd5fb", "score": "0.6024865", "text": "function emid(ind,tag,info){\n var count=g(users,ind);\n for(i=0;i<count.length;i++)\n {sokt[count[i]].emit(tag,info);\n }\n console.log(ind+\" \"+tag);\n }", "title": "" }, { "docid": "d5b3e8247eb973828ac0bfd51d142d44", "score": "0.60020757", "text": "function updateUsernames(){\n\t\tio.sockets.emit('usernames', Object.keys(users));\n\t}", "title": "" }, { "docid": "98cdd5b9ef947494061534d5ae5586b5", "score": "0.5976689", "text": "function updateUsernames() {\n io.sockets.emit('usernames', usernames);\n }", "title": "" }, { "docid": "561d8bf28175565d22573523120efff9", "score": "0.5962797", "text": "function BroadcastPlayersList(){\n var playersList = [];\n Players.forEach(function(player){\n if (player.name !== ''){\n playersList.push(player.getId());\n }\n });\n\n var message = JSON.stringify({\n 'action': 'players_list',\n 'data': playersList\n });\n\n Players.forEach(function(player){\n player.connection.sendUTF(message);\n });\n}", "title": "" }, { "docid": "9d2a986706345d9eeb513692cbef1fa5", "score": "0.5958058", "text": "function renewUserList() {\n // console.log('loop start');\n for (var i = 0; i < currentUser.length; ++i) {\n io.sockets.emit('update userList', currentUser[i], currentUser_room[i]);\n console.log('update ' + currentUser[i] + ' in ' + currentUser_room[i]);\n // console.log(\"currentUser.length = \" + currentUser.length);\n // console.log('the ' + i + ' th; ');\n // console.log(currentUser[i] + ' ... ' + currentUser_room[i] + ' ... ' + currentSocket.room);\n }\n }", "title": "" }, { "docid": "1511f24223c32feaeda0c9685a5fe13d", "score": "0.5947395", "text": "function listAllEvents (req, res) {\n Event.find({ user_id: req.params.user_id }, function (err, events) {\n if (err) { res.send(err); }\n res.status(200)\n .json({\n status: 'success',\n data: events,\n message: 'Retrieved all events for user'\n });\n });\n}", "title": "" }, { "docid": "ffcf68de1cb9190b8467bb98456ed813", "score": "0.5945135", "text": "function onOnlineUsersChanged(users) {\n if (!isStartingUp()) { // Skip user notifications at startup.\n for (user in users) {\n if (last_users.indexOf(users[user]) == -1.0) {\n createNotification(users[user] + \" has joined\");\t\t\n }\n }\n for (user in last_users) {\n if (users.indexOf(last_users[user]) == -1.0) {\n createNotification(last_users[user] + \" has left\");\t\t\t\t\t\n }\n }\n }\n last_users = users;\n}", "title": "" }, { "docid": "e9a4908851ef390687ad8df4734f132c", "score": "0.5934791", "text": "function deleteEventfromAllUsers(json){\n //deleting deleted event from all users\n console.log(json);\n if(json.length !==0){\n for(let i=0; i<json.length; i++){//looping through all the array of users containing the event\n let timesRun = i+1;\n generalFunc.deleteEventFromUser(json[i].name, eventId, timesRun, json.length);//delete or \"updating\" user's array\n };\n }else{\n // window.location.reload();\n }\n }", "title": "" }, { "docid": "9b4240661b8305ca487a3089adefc431", "score": "0.5924895", "text": "function updateUserList() {\n let message = {\n type: 'countUsers',\n content: wss.clients.size\n };\n console.log(`Connected users: ${message.content}`)\n wss.broadcast(message);\n}", "title": "" }, { "docid": "05a6cc383f5aeaeb3a9ff399f68a1e5f", "score": "0.59119105", "text": "function fetchUsers() {\n\tfor (let i=0; i<users.length; i++) {\n\t\tvar user = fetchUser(users[i]);\n\t\tuserHTML += `<div class=\"user\" onclick=\"fetchPlaylists(${user.id})\">${user.display_name}</div>`;\n\t}\n}", "title": "" }, { "docid": "085048e4de06097ed457afbc92081fc6", "score": "0.5907133", "text": "sendToPlayer(){ \n //this.players[playerIndex].emit('message',msg);\n\n this.players.forEach((player,indx)=>{\n player.on('chats',(text)=>{\n if(text){\n if(indx==0){\n this.players[indx+1].emit('chats',text)\n }\n else if(indx==1){\n this.players[indx-1].emit('chats',text)\n }\n }\n })\n })\n }", "title": "" }, { "docid": "0973fa73ba3f5b5bb3a2492227df48a9", "score": "0.5872778", "text": "static list_users() {\n const users = Store.getUsers();\n users.forEach((user) => UI.addUserToList(user));\n }", "title": "" }, { "docid": "56b32b7971b4558ce31e90921cff2dcc", "score": "0.5852918", "text": "function updateOnlineUsers() {\n const message = {type: 'onlineusers', users: []};\n\n // Create a list of all users.\n wss.clients.forEach(client => {\n if (client.readyState === WebSocket.OPEN) {\n message.users.push({id: client.id, text: client.username, date: client.date});\n }\n });\n\n // Send the list to all users.\n wss.clients.forEach(client => {\n if (client.readyState === WebSocket.OPEN) {\n client.send(JSON.stringify(message));\n }\n });\n}", "title": "" }, { "docid": "d08bfcca74045871a4c9437cad52feb9", "score": "0.58435774", "text": "function addUsers(socket){\n socket.on('username',(username) => {\n var checkIfUsernameExist = users.checkUser(username,socket.id);\n if(!checkIfUsernameExist) {\n socket.broadcast.emit('return_username',username);\n } else {\n socket.emit('usernameNotFound',username);\n }\n });\n}", "title": "" }, { "docid": "fa44f6fa4137bedddd603c5908e8731a", "score": "0.58311886", "text": "display() {\n const description = this.list.map(user => createUserEmbededDescription(user)).join('\\n')\n const embbed = createEmbededReport(true, description, 'Users triggered')\n discord.send(embbed)\n }", "title": "" }, { "docid": "4edccad604f2b5cca9b19aef39ad8f89", "score": "0.5819139", "text": "function handleTheMainBtn(user){\n var currentUser = user.email.split('@')[0];\n var userListRef = firebase.database().ref(`userList`)\n userListRef.on(`value`,function(snapshot){\n console.log(Object.values(snapshot.val()));\n data = Object.values(snapshot.val())\n data.forEach(function (data){\n var databaseUsername = data.userName;\n if(currentUser != databaseUsername){\n $(document).on('click',`#allOtherUser-${databaseUsername}`, function () {\n console.log('123456777fdsgfdg')\n handleUserNameBtnClick(currentUser, databaseUsername);\n }) \n }\n\n })\n })\n}", "title": "" }, { "docid": "34b3ce0494a3e7991348afb4f0c03057", "score": "0.5816222", "text": "function displayUsers(){\n for (var i = 0; i < users.length; i++){\n user = users[i];\n user_colour = userColours[i];\n name_coloured = user.fontcolor(user_colour);\n name_coloured_msg = \"<p>\" + name_coloured + \"</p>\";\n console.log(name_coloured_msg);\n io.emit('dispUser', name_coloured_msg);\n }\n}", "title": "" }, { "docid": "d78038482f1475b1e6db4e48cfe29d7b", "score": "0.58055323", "text": "function emitToUser(user, event, data, token, sender) {\r\n\r\n if (user && sender && user.id == sender.id) {\r\n sender.emitToAllSockets(event, data, function () {\r\n logger.info('Emit to sender other devices : ' + stringify(data));\r\n });\r\n } else {\r\n user.emitToAllSockets(event, data, function () {\r\n logger.info('Emit to User : ' + stringify(data));\r\n });\r\n }\r\n\r\n}", "title": "" }, { "docid": "994b5a7bded0c9a5a64ede4f2c999229", "score": "0.5797225", "text": "function reportUsers() {\n var numUsers = GlobalServices.onlineUsers.length;\n var welcome = \"Welcome! There are \" + numUsers + \" users online now.\";\n createNotification(welcome);\n}", "title": "" }, { "docid": "038c485ce097275fe1a75c9993c446df", "score": "0.5794392", "text": "function emitAddCommentEventForUsernames (params) {\n console.log(\"PARAMS IS \");\n console.dir(params);\n for (var key in params.usernames)\n {\n var username = params.usernames[key];\n var updateName = username + 'CommentUpdate';\n console.log(\"EMITTING UPDATE: \" + updateName);\n geddy.io.sockets.emit(updateName, {eventId: params.eventId, comment: params.commentModel});\n\n //Update user's notification number\n // geddy.model.User.first({username: username}, function (err, userModel){\n // // console.log(\"About to increment mynotifications\");\n // if (!err && userModel){\n // // console.log(\"userModel exists and no err so incrementing mynotifications\");\n // if (userModel.mynotifications){\n // userModel.mynotifications += 1;\n // } else {\n // userModel.mynotifications = 1;\n // }\n // // console.log(\"mynotifications = \" + userModel.mynotifications);\n // userModel.errors = null;\n // userModel.save(function (err, result){\n // //do nothing\n // if (err){\n // console.log(\"Got error when saving user after updating notification number: \");\n // console.dir(err);\n // }\n // });\n // }\n // });\n }\n}", "title": "" }, { "docid": "89d245f7e13deb4114846843a3074fb4", "score": "0.5774407", "text": "function subscribe(user, subscribersList) {\n channel.push(\"subscribe\", {user_name: user, user_to_subscribe: subscribersList})\n .receive(\"subscribed\", resp => console.log(\"subscribed\", user))\n console.log({username: user, usersToSub: subscribersList})\n}", "title": "" }, { "docid": "c555d87478392ee40aabbf6e03759f8d", "score": "0.5766992", "text": "function onUsersRefresh(users) {\n\t$(\"#userList\").empty();\n\tusers.sort();\n\tfor (var i = 0; i < users.length; i++) {\n\t\t$(\"#userList\")\n\t\t\t.append($(\"<tr>\")\n\t\t\t\t.append($(\"<td>\")\n\t\t\t\t\t.append(document.createTextNode(users[i]))\n\t\t\t\t)\n\t\t\t);\n\t}\n\t$(\"#userList > tr\").click(function (e) {\n\t\te.preventDefault();\n\t\tvar targetUser = e.target.innerHTML;\n\t\tload(\"modalTwoB.html\", $(\"body\"), function () {\n\t\t\tvar modal = $(\"#modalTwoB\").attr(\"id\", \"#modal\" + modalIndex++);\n\t\t\tmodal.find(\".modal-title\").text(\"Select action\");\n\t\t\tmodal.find(\".modal-body\").text(\"Do you want to call or message this user?\");\n\t\t\tmodal.find(\".btn-secondary\").text(\"Call\");\n\t\t\tmodal.find(\".btn-secondary\").click(function (e) {\n\t\t\t\tif (targetUser.length > 0) {\n\t\t\t\t\tsend({\n\t\t\t\t\t\ttype: \"permission\",\n\t\t\t\t\t\tname: targetUser\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tmodal.modal(\"hide\");\n\t\t\t});\n\t\t\tmodal.find(\".btn-primary\").text(\"Message\");\n\t\t\tmodal.find(\".btn-primary\").click(function (e) {\n\t\t\t\tchangeChannel(targetUser);\n\t\t\t\tmodal.modal(\"hide\");\n\t\t\t});\n\t\t\tmodal.on(\"hidden.bs.modal\", function (e) {\n\t\t\t\tmodal.remove();\n\t\t\t})\n\t\t\tmodal.modal(\"show\");\n\t\t});\n\t});\n}", "title": "" }, { "docid": "df946a8dca7f8391a9c9bf7eccd8c566", "score": "0.5763562", "text": "function updateUsersNames() {\n io.sockets.emit('usernames', Object.keys(usersNames));\n }", "title": "" }, { "docid": "5798bb559eb61cadbf325b578dedaa45", "score": "0.57591987", "text": "function updateUsernames(){\n io.emit('usernames', usernames);\n }", "title": "" }, { "docid": "22378e974672e258c025ed3c639e423e", "score": "0.5758649", "text": "function sendMemberList(memberList, io) {\n let toSend = [];\n\n for (let member in memberList) {\n toSend.push(memberList[member]);\n }\n\n io.sockets.emit('login', toSend);\n}", "title": "" }, { "docid": "7f4af14efdfdeedea6dfb046a1c68e9b", "score": "0.5756589", "text": "sendEventData(){\n var user = sessionStorage.getItem('account');\n user = JSON.parse(user);\n\n console.log(user);\n\n var data = {\n name: this.state.event_name,\n park_id: this.state.parkInfo._id,\n start: this.state.start,\n end: this.state.end,\n sport: this.state.sport,\n description: this.state.description,\n host: String(user.id),\n max_people: this.state.max_people\n }\n\n fetch('http://localhost:8080/events/addEvent', {\n method: 'POST',\n dataType: 'json',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'Authorization': sessionStorage.getItem('token')\n },\n body: JSON.stringify(data)\n })\n .then(response => response.json())\n .then(response => {\n console.log(response);\n // after the event has been added to db, the event should be added to user list\n if (response.status == 'failed') {\n //cannot add event to database\n }\n else {\n //update the user attending event list\n this.updateUserEvents(response.newEvent._id);\n // update the park event list\n this.updateParkEvents(response.newEvent._id);\n }\n })\n .catch(error => console.log('parsing failed', error))\n }", "title": "" }, { "docid": "be992baef28ad3b643da39a8864b66f9", "score": "0.57442605", "text": "function notifyChat(message) {\n users.forEach(user => {\n user.write(message);\n });\n}", "title": "" }, { "docid": "7051f471fa5659fd0b90ab02764d3125", "score": "0.57159257", "text": "function getActivities(usernames){\n\t\tvar LIMIT = 50;\n\t\tdb.limittedFind('UserActivity',{username: { $in: usernames }},LIMIT,function(err,docs){\n\t\t\tif(!err){\n\t\t\t\tdocs = docs.map(function(doc){\n\t\t\t\t\treturn doc._id;\n\t\t\t\t});\n\t\t\t\tresult = result.concat(docs);\n\t\t\t\tgettingNewsfeedNotificationsDone = true;\n\t\t\t\tsendResult();\n\t\t\t}else{\n\t\t\t\tconsole.log(\"UserActivity!!! \" + err);\n\t\t\t\tres.send(\"9\");\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "25630cd4f205b5257712a2eafe0ad155", "score": "0.56939715", "text": "function _ajUser(evt){\n ajUser(evt);\n }", "title": "" }, { "docid": "0030e43bebc77db508d22b91dc36d2cc", "score": "0.5683117", "text": "function broadcast(message) {\n for (var i in users) {\n if (i != nickname) {\n users[i].write(message + '\\r\\n');\n }\n }\n }", "title": "" }, { "docid": "82fb9f5e89ee902dd2d0b9da6ad72ef4", "score": "0.5681218", "text": "function each(f) {\n for (uuid in users) {\n f(users[uuid]);\n }\n }", "title": "" }, { "docid": "e49a271892ef8cc3937fa5a0f4b30de3", "score": "0.5678681", "text": "function subscribe(user, subscribersList) {\n channel.push(\"subscribe\", {username: user, usersToSub: subscribersList})\n .receive(\"subscribed\", resp => console.log(\"subscribed\", user))\n console.log({username: user, usersToSub: subscribersList})\n}", "title": "" }, { "docid": "a694f1c3ff35f30c95290af7dc1f3fab", "score": "0.5677664", "text": "function listUsers() {\n var list = 'Users: ';\n var clients = rooms[room].users;\n for (var i = 0; i < clients.length; i++) {\n list += clients[i] + ' ';\n }\n console.log(list);\n }", "title": "" }, { "docid": "8c55a2f296b6b409c56166af220ac7e8", "score": "0.5674229", "text": "function sendDataToAllTechs()\n {\n var speakers;\n var fires;\n io.sockets.in(\"techClients\").emit(\"updateThreshold\", fireThreshold, speakerThreshold);\n models.Speaker.findAll().success(function(s) {\n speakers = s;\n models.Fire.findAll().success(function(f) {\n fires = f;\n var data = {'speakers' : speakers, 'fires' : fires};\n io.sockets.in(\"techClients\").emit('data', data);\n });\n });\n }", "title": "" }, { "docid": "9034173c1290bcbd060b576edffe8c42", "score": "0.5669212", "text": "emitToAll(message, data) {\n var activePlayers = this.getActivePlayerList();\n\n for (var i = 0; i < activePlayers.length; i++) {\n activePlayers[i].socket.emit(message, data);\n }\n }", "title": "" }, { "docid": "22a666727f48f32c637ec0ef4e2257f6", "score": "0.56675994", "text": "function listPlayers() {\n console.log(playerList);\n io.sockets.emit('playerList', playerList);\n}", "title": "" }, { "docid": "e2d74e1f464066940c2536f5cfea4a8f", "score": "0.566515", "text": "function userListUpdate() {\n console.log(\"User list updated begins.\")\n uList = [];\n users.forEach(function(user) {\n var player = {name:user.name, score:user.score, state:user.state};\n uList.push(player);\n });\n uList.sort(compareByScore);\n io.emit('user update', uList);\n console.log(\"User list update complete.\")\n }", "title": "" }, { "docid": "9fd82abd33c6b2c37b018596c9d9a287", "score": "0.5663539", "text": "function addEventsToUser(userid, eventids, cb){\n var query = {};\n query['_id'] = userid;\n\n addToArrayField(collUsers, query, 'savedEvents', eventids, cb);\n }", "title": "" }, { "docid": "10f2330b112aec5efa0745cd735b23b3", "score": "0.5649538", "text": "sendMultiple(users, notification) {\n // Note that async functions return a promise\n const promises = users.map(async (user) => {\n const cNotification = lodash.cloneDeep(notification);\n cNotification.user = user;\n const result = await Notification.create(cNotification);\n await EmailService.sendNotification(cNotification);\n return result;\n });\n return Promise.all(promises);\n }", "title": "" }, { "docid": "f2bdea4e6200b95b3be2187050e95722", "score": "0.56489927", "text": "function updateUserList() {\n chat.getConnectedUsers()\n .done(function (result) {\n $chatUsers.empty();\n $.each(result, function (index, username) {\n $chatUsers.append('<p><span class=\"label label-info\"><i class=\"icon-user icon-white\"></i> ' + username + '</i></span></p>');\n });\n });\n }", "title": "" }, { "docid": "4d7ea1a1f1394b09e96118eba63a794f", "score": "0.563801", "text": "broadcast(data) {\n for (let member of this.members) {\n member.send(JSON.stringify(data));\n }\n }", "title": "" }, { "docid": "dd83b54d10d9d543326b19596abf80d6", "score": "0.5635689", "text": "queryUsers(callback) {\n this.socket.emit('getUsers');\n this.callback = callback;\n }", "title": "" }, { "docid": "2d9ae1163690987170bf0857fa970b74", "score": "0.5625518", "text": "async function notifyUsers() {\n const users = await getUsers();\n console.log(users, users.length)\n for (var i = 0; i < users.length; i++) {\n let user = users[i];\n let userLocationInfo = await getForecastResponse(user);\n if (userLocationInfo != \"Bad Location\") {\n let parsedUserDangerInfo = parseUserDangerInfo(userLocationInfo, user.risk); //reformat data to usable state\n textUser(parsedUserDangerInfo, user.phone);\n }\n }\n console.log(\"done\")\n}", "title": "" }, { "docid": "193fea6227a781ed83d44ff0077e9863", "score": "0.56253904", "text": "function setUsersList(info){\n\tusersList = info;\n}", "title": "" }, { "docid": "c693aaa3109736e6b49064cb0d1bc4e6", "score": "0.5622997", "text": "function sendEvent(eventName, contents)\r\n{\r\n\tfor\t(index = 0; index < connections.length; index++)\r\n\t{\r\n\t\tif(connections[index] != null)\r\n\t\t{\r\n\t\t\tif(connections[index].user != null)\r\n\t\t\t{\r\n\t\t\t\tif(connections[index].user.currentChannel == this.name)\r\n\t\t\t\t{\r\n\t\t\t\t\tconnections[index].con.emit(eventName, contents);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "3c0908cbe9f59beb7c75a2e1328c758a", "score": "0.5621465", "text": "function sendInitialChannelUsers()\r\n{\r\n\tvar usersArr = [];\r\n\t\r\n\tfor\t(var index = 0; index < connections.length; index++)\r\n\t{\r\n\t\tif(connections[index] != null && connections[index].con != null)\r\n\t\t{\r\n\t\t\tif(connections[index].user != null)\r\n\t\t\t{\r\n\t\t\t\tif(connections[index].user.currentChannel == this.currentChannel)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(connections[index].user.xcdrvesl == false)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tusersArr.push(connections[index].user);\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\t\r\n\tfindConnectionFromUser(this).con.emit('channel users list', JSON.stringify(usersArr));\r\n}", "title": "" }, { "docid": "d89a70267d756f39bcc8feb0e50ce7a3", "score": "0.56205374", "text": "function updateAllUsers() {\n for(var cUser = 0; cUser < USER_IDS.length; cUser++) {\n var user = USER_IDS[cUser];\n queryHexoskinUser(user, function(err, user, hr, br) {\n if(err) {\n console.log('User ' + user + ': ' + err);\n }\n else {\n users[user].hr = hr;\n users[user].br = br;\n }\n });\n }\n}", "title": "" }, { "docid": "cbabe9070d11d87dc90686554285eba2", "score": "0.56177044", "text": "function sendCurrentUsers (socket) { \t\t//user socket id to find which room\n\tvar info = clientInfo[socket.id];\n\tvar users = []; \t\t\t\t\t\t// push elements as we find them \n\n\tif (typeof info === 'undefined') {\t\t// if room exists \n\t\treturn; \n\t}\n\n\tObject.keys(clientInfo).forEach(function (socketId) {\t\t//loop thru till find match room \n\t\tvar userInfo = clientInfo[socketId];\n\n\t\tif(info.room === userInfo.room) {\t\t// compare with users in room\n\t\t\tusers.push(userInfo.name);\n\n\t\t}\n\t});\n\n\tsocket.emit('message', {\n\t\t\tname: 'System',\n\t\t\ttext: 'Current users: ' + users.join(', '), \t\t// takes every element, converts to string & pushes together\n\t\t\ttimestamp: moment().valueOf()\n\t});\n\n}", "title": "" }, { "docid": "3d8e94343e72cd5964962bd25587a562", "score": "0.56160516", "text": "function joinEvent() {\n let user = firebase.auth().currentUser.displayName;\n let document = db.collection(\"events\").doc(docReference.toString());\n\n if (!memberArr.includes(user) &&\n memberArr.length < maxMembers) {\n document.update({\n Members: firebase.firestore.FieldValue.arrayUnion(user)\n });\n while (memberList.firstChild) {\n memberList.removeChild(memberList.firstChild);\n }\n getEvent();\n window.alert('Succesfully joined the event!');\n //Stops the user from joining the event if it is full or if the user has joined the event\n } else if (memberArr.length == maxMembers) {\n window.alert(\"Event is full!\");\n } else {\n window.alert('Already joined the event!');\n }\n joinButton.disabled = true;\n}", "title": "" }, { "docid": "297962b0ea247c4c2d005d78f44adfbd", "score": "0.5613588", "text": "function outputUsers(users) {\n //sets the list of online users to the current entries og the array. It wraps the usernames in <li> tags, because its a list that is \"appended to an ul (userList)\n userList.innerHTML = `\n ${users.map((user) => `<li>${user.username}</li>`).join(\"\")}\n `;\n}", "title": "" }, { "docid": "9c9de8ce1371e0478246837b22423a55", "score": "0.5613317", "text": "emitUserBroadcast(...args) {\n // Step 1: Bubble up the event\n this.handleUserBroadcastEvent('userBroadcast', args);\n }", "title": "" }, { "docid": "f4baec89fe1c99cc6003ecc27cac1257", "score": "0.56074226", "text": "function check_all_user_status() {\n console.log('User.adapter.rooms[]',User.adapter.rooms['default_room']);\n var socket_ids = Object.keys(User.adapter.rooms['default_room'] || {}),\n online_users = [],\n __current_users_arr = obj_to_array(chatuser.get());\n console.log('__current_users',__current_users);\n //check the socket_ids from users\n socket_ids.forEach(function(sid) {\n online_users.push(chatuser.get_by_socket(sid));\n console.log('online_users', online_users.length);\n });\n console.log('send event \\'current online\\': ' + __current_users_arr.length);\n //send to all sockets\n io.of('/default_user').in('default_room').emit('get_current_users', online_users);\n}", "title": "" }, { "docid": "c914e8a0db9a28f21f6ebc0452b89c15", "score": "0.56040025", "text": "function set_On_Fetch_Online_Users_Event(socket, setOnlineUsers) {\n socket.on('fetch-online-users', (users)=> {\n setOnlineUsers(JSON.parse(users));\n });\n}", "title": "" }, { "docid": "e3e609835378e734b035a63a90032c50", "score": "0.55971664", "text": "@action.bound\n addUsers(usersData) {\n this.allUsers = usersData\n }", "title": "" }, { "docid": "22b092e756730dd8ba589739f0285111", "score": "0.5580023", "text": "function emitMessage() {\n var\n message;\n\n message = {\n onlineList: onlineList,\n online: online\n };\n\n Y.doccirrus.communication.isPucOnline( function( yes ) {\n if( yes ) {\n // trigger update for global (remote) presence list\n Y.doccirrus.communication.emitPUC( {\n event: UPDATE_PRESENCE_LIST,\n message: message\n } );\n } else {\n notifyUsers( message );\n }\n } );\n }", "title": "" }, { "docid": "8ed2d736c25ca7ecf137ad966d0a9b66", "score": "0.5577883", "text": "broadcast(data) {\n players.forEach((_, i) => handle.send(data, i));\n }", "title": "" }, { "docid": "22f08fd2d5951d335f1d6e77cfc21a5b", "score": "0.556133", "text": "function userListWorker() {\n $.ajax({\n url: '/users?channel='+getChannelName(), \n success: updateUserList,\n complete: function() {\n setTimeout(userListWorker, 5000);\n }\n });\n}", "title": "" }, { "docid": "bc4ef6549105bc4bf3d3992f644c37fe", "score": "0.5559238", "text": "function set_On_Joined_Event(socket, setOnlineUsers, setConnectionMessages) {\n socket.on('joined', (username)=> {\n setOnlineUsers((prev)=> [...prev, username]);\n setConnectionMessages((prev=> [...prev, {\n timestamp: new Date().getTime(),\n type: 'joined',\n payload: username\n }]));\n });\n}", "title": "" }, { "docid": "25eb5ff3bddd3265053a4b2d23da212b", "score": "0.555762", "text": "function outputUsers(users) {\n // userList.innerHTML = \"\";\n // users.forEach((user) => {\n // const li = document.createElement(\"li\");\n // li.innerText = user.username;\n // userList.appendChild(li);\n // });\n}", "title": "" }, { "docid": "99c51c312467add3ceb032ebe37e6630", "score": "0.5551775", "text": "function updateUser(userIn) {\n\n\t\tfor(var i = 0; i < users.length; i++) {\n\t\t\n\t\t\tif(users[i].partner_id == userIn.session_id) {\n\t\t\n\t\t\t\tconsole.log(\"found partner\");\n\n\t\t\t\tio.sockets.socket(users[i].session_id).emit('watch-code', userIn); \n\t\t\t\n\t\t\t} \n\t\t}\n\t}", "title": "" }, { "docid": "b3b235040ef4449814f36a0da97a78e0", "score": "0.5544319", "text": "function waitListUpdated (users) {\n if (users.length >= 7) {\n log(\"@\" + users[1].username + \", your set begins in ~\" + getETA(users[1].username)+ \" minutes\", log.info);\n }\n}", "title": "" }, { "docid": "45b480059ee5863c965d2899cd591a3f", "score": "0.5536265", "text": "static async toAll(announcement) {\n const users = await User.find({ role: \"student\" });\n for (const user of users) {\n const an = new AnnouncementNotification(user, announcement);\n await an.send();\n }\n return users.map(e => e._id);\n }", "title": "" }, { "docid": "2345358cd5295f60141764c23bf2a38a", "score": "0.5535351", "text": "function handleUsers(users) {\n moreOnServer = false;\n var us = users.split(\";\");\n for(i = 0; i < us.length-1; i++) {\n if(availablePeers.indexOf(us[i]) == -1 && us[i] != name) {\n availablePeers.push(us[i]);\n moreOnServer = true;\n }\n }\n}", "title": "" }, { "docid": "4e49ad044bf658fa38167036e04a03e7", "score": "0.5533083", "text": "function sendSyncInvitation(syncID, users) {\n var usersJson = Array.from(users);\n $.ajax({\n url: url_to_send_sync_invitation,\n type: 'GET',\n data: {\n syncID: syncID,\n users: usersJson\n },\n success: function (response) {\n },\n error: function (xhr, errmsg, err) {\n }\n }\n )\n}", "title": "" } ]
076319de10df51e22f186801cf70c685
convert an array to a date. the array should mirror the parameters below note: all values past the year are optional and will default to the lowest possible value. [year, month, day , hour, minute, second, millisecond]
[ { "docid": "e1b9658db4902940e4464208f5311b1e", "score": "0.0", "text": "function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n expectedWeekday,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (\n config._dayOfYear > daysInYear(yearToUse) ||\n config._dayOfYear === 0\n ) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] =\n config._a[i] == null ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (\n config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0\n ) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(\n null,\n input\n );\n expectedWeekday = config._useUTC\n ? config._d.getUTCDay()\n : config._d.getDay();\n\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n\n // check for mismatching day of week\n if (\n config._w &&\n typeof config._w.d !== 'undefined' &&\n config._w.d !== expectedWeekday\n ) {\n getParsingFlags(config).weekdayMismatch = true;\n }\n }", "title": "" } ]
[ { "docid": "122c08243790f88b2ef3c60a79bb6810", "score": "0.727762", "text": "function ArrayToDate(inp) {\n\tvar yr = inp[0];\n\tvar mo = inp[1] - 1; // js month is 0 - 11\n\tvar da = inp[2];\n\tvar hr = inp[3];\n\tvar min = inp[4];\n\tvar sec = inp[5];\n\treturn new Date(yr, mo, da, hr, min, sec, 0);\n}", "title": "" }, { "docid": "8a43c30d1c500d17ac19ae322663dc25", "score": "0.7056393", "text": "function dateFromArray(input) {\n return new Date(input[0], input[1] || 0, input[2] || 1, input[3] || 0, input[4] || 0, input[5] || 0, input[6] || 0);\n }", "title": "" }, { "docid": "8a43c30d1c500d17ac19ae322663dc25", "score": "0.7056393", "text": "function dateFromArray(input) {\n return new Date(input[0], input[1] || 0, input[2] || 1, input[3] || 0, input[4] || 0, input[5] || 0, input[6] || 0);\n }", "title": "" }, { "docid": "8a43c30d1c500d17ac19ae322663dc25", "score": "0.7056393", "text": "function dateFromArray(input) {\n return new Date(input[0], input[1] || 0, input[2] || 1, input[3] || 0, input[4] || 0, input[5] || 0, input[6] || 0);\n }", "title": "" }, { "docid": "8a43c30d1c500d17ac19ae322663dc25", "score": "0.7056393", "text": "function dateFromArray(input) {\n return new Date(input[0], input[1] || 0, input[2] || 1, input[3] || 0, input[4] || 0, input[5] || 0, input[6] || 0);\n }", "title": "" }, { "docid": "03ba9809a13f8b35c6c4d6551a39f018", "score": "0.70529586", "text": "function dateFromArray(input) {\n return new Date(input[0], input[1] || 0, input[2] || 1, input[3] || 0, input[4] || 0, input[5] || 0, input[6] || 0);\n}", "title": "" }, { "docid": "af6c8c38071666779ef972af552ee41c", "score": "0.69695306", "text": "function datearray(num)\n{\n var ret = []\n var day = Math.floor(num/1000000)\n ret.push(day)\n num = num-(day*1000000)\n var month = Math.floor(num/10000)\n ret.push(month)\n num = num-(month*10000)\n var year = Math.floor(num)\n ret.push(year)\n return ret\n}", "title": "" }, { "docid": "bf1dedc2b5c972b48e1a2871d97966a9", "score": "0.68741965", "text": "function arrayToDates(arr) {\n var date_list = []\n for (var n = 0; n < arr.length; n++) {\n var dt = new Date(arr[n])\n // console.log(dt)\n date_list.push(dt)\n }\n return date_list\n}", "title": "" }, { "docid": "2fc8d5c809be1c3243d1fe5b30bae386", "score": "0.67516327", "text": "function createDate(date_array) {\n let year = date_array[0];\n let month = appendZero(date_array[1]);\n let day = appendZero(date_array[2]);\n return `${year}/${month}/${day}`\n\n}", "title": "" }, { "docid": "716c7d5ad9b8d5f296681edbbc5406f2", "score": "0.66413176", "text": "function toDate(arr, month, year, page) {\n let tempArr = [];\n if (!allDatesArr[year]) allDatesArr[year] = [];\n if (!allDatesArr[year][month]) allDatesArr[year][month] = [];\n arr.forEach((item, index) => {\n tempArr.push({ id: item.date, dayOfWk: item.dayofwk, 'month': month, 'year': year, date: new Date(year, month, item.date).toISOString().slice(0,10), page: page });\n allDatesArr[year][month].push({ id: item.date, dayOfWk: item.dayofwk, 'month': month, 'year': year, date: new Date(year, month, item.date).toISOString().slice(0,10), page: page });\n });\n}", "title": "" }, { "docid": "49869db637710551c50202d9c459e62d", "score": "0.6151602", "text": "function makeDate(digits) {\t\t\t\n\t\t\tvar datex = dateArray_to_date(digits), newdate = makeDate_(\n\t\t\t\t\tdatex.day, datex.month, datex.yearTwoDigits);\n\t\t\tconsole.log(datex.day+\" \"+datex.month+\" \"+datex.yearTwoDigits);\n\t\t\tconsole.log(newdate.day+\" \"+newdate.month+\" \"+newdate.yearTwoDigits);\t\t\t\n\t\t\treturn date_to_dateArray(newdate.day,newdate.month,newdate.yearTwoDigits);\n\t\t\t\n\t\t\t \n\n\t\t}", "title": "" }, { "docid": "22259a038544af005417828e09de62b2", "score": "0.6014711", "text": "function dateFromArray(config) {\n var i, date, input = [];\n\n if (config._d) {\n return;\n }\n\n for (i = 0; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += config._tzh || 0;\n input[4] += config._tzm || 0;\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "title": "" }, { "docid": "22259a038544af005417828e09de62b2", "score": "0.6014711", "text": "function dateFromArray(config) {\n var i, date, input = [];\n\n if (config._d) {\n return;\n }\n\n for (i = 0; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += config._tzh || 0;\n input[4] += config._tzm || 0;\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "title": "" }, { "docid": "cc2b0f761bc1176f72e0d084e34124f7", "score": "0.5961244", "text": "function dateFromArray(config) {\n var i, date, input = [];\n\n if (config._d) {\n return;\n }\n\n for (i = 0; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += ~~((config._tzm || 0) / 60);\n input[4] += ~~((config._tzm || 0) % 60);\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "title": "" }, { "docid": "cc2b0f761bc1176f72e0d084e34124f7", "score": "0.5961244", "text": "function dateFromArray(config) {\n var i, date, input = [];\n\n if (config._d) {\n return;\n }\n\n for (i = 0; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += ~~((config._tzm || 0) / 60);\n input[4] += ~~((config._tzm || 0) % 60);\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "title": "" }, { "docid": "87d7681dcaf7d4ebdd430e830f9e5c1f", "score": "0.59383196", "text": "function generateDateArr(){\n var dates = [];\n var aYearAgo = addYears(-1);\n for(var i = 0; i < 30; i ++ ){\n var newDate = addDays( i, aYearAgo );\n // put it in iso format, as that is what the forecast api takes\n dates.push( newDate.toISOString().split('.')[0] );\n }\n return dates;\n}", "title": "" }, { "docid": "a9739c24bb316c989753ab7fa4719f17", "score": "0.5922868", "text": "function getFormatedDate(arr) {\n eventArray = [];\n for (let item = 0; item < arr.length; item++) {\n eventArray.push(arr[item].initialDate.slice(0, 10));\n }\n}", "title": "" }, { "docid": "4f2d9d159ca3492f6ae6affe749ee76e", "score": "0.5922613", "text": "function friendly(arrDate) {\n var i;\n var arr = arrDate;\n arr.forEach(transform);\n //return arr;\n var n = arr.length;\n var result = [];\n var monthName = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"Novement\", \"December\"];\n var today = new Date();\n var currentYear = today.getFullYear();\n\n if ((arr[0][2] == currentYear) && (arr[1][2] == currentYear)){ //same current year\n arr[0][2] = \"\";\n arr[1][2] = \"\";\n }else if(arr[0][2] == arr[1][2]){ //same year\n arr[0][2] = \"\";\n }\n\n if(arr[0][0] == arr[1][0]){ //same month\n arr[1][1] = \"\";\n }\n //return arr;\n\n formatDate();\n return result;\n\n function transform(a){\n\n a = a.split(\"-\");\n a[1] = parseInt(a[1]);\n a[2] = parseInt(a[2]);\n a.push(a[i].shift());\n\n return a;\n }\n\n function formatDate(){\n var temp;\n for(var i=0; i<n; i++){\n temp = \"\";\n if (arr[i][0]){\n temp += monthName[arr[i][0]] + \" \" + formatDate(arr[i][1]);\n }\n if (arr[i][2]) {\n temp += \", \" + arr[i][2];\n }\n result.push(temp);\n }\n\n }\n\n function formatDay(num){\n var date = \"\";\n switch (num) {\n case 1:\n date = \"1st\";\n break;\n case 2:\n date = \"2nd\";\n break;\n case 3:\n date = \"3rd\";\n break;\n case 21:\n date = \"21st\";\n break;\n case 22:\n date = \"22nd\";\n break;\n case 23:\n date = \"23rd\";\n break;\n default:\n date = num + \"th\";\n }\n return date;\n }\n}", "title": "" }, { "docid": "48c77d1e610fcc4589f806770e7e554d", "score": "0.58090293", "text": "function onlyYear(array){\n let newarray=array.map(function(elem){\n return elem.year;\n })\n return newarray;\n }", "title": "" }, { "docid": "177413ba4ccbc59384cb2c0b6f65b146", "score": "0.5780258", "text": "function get_date(array) {\n\n var today = new Date();\n\n for(var i = 0; i < array.length; i++)\n {\n var date = new Date(array[i][0], array[i][1], array[i][2]);\n\n if (today.getTime() < date.getTime())\n {\n return array[i];\n break;\n }\n }\n}", "title": "" }, { "docid": "8d061b162bd22a8e690039ea1665cb1a", "score": "0.5771994", "text": "static datesToChart(array,period) {\n let chartData = [];\n let chartPoint = {date: '0'};\n //Checks that atmospheres have values\n\n if(array && array.length > 0) {\n //Iterate through the atmospheres\n for (let dateIndex = 0; dateIndex < array.length; dateIndex++) {\n switch(period){\n case 'year':\n\n chartPoint.date = getMonthAsShortStr(array[dateIndex].date) ;\n break;\n case 'month':\n\n chartPoint.date = getDayAsStr(array[dateIndex].date) ;\n break;\n default :\n console.log(\"day\");\n chartPoint.date = parseInt(array[dateIndex].date)+\"h\" ;\n break;\n }\n //chartPoint.date = array[dateIndex].date;\n chartData.push(chartPoint.date);\n }\n }\n console.log(chartData);\n return chartData;\n }", "title": "" }, { "docid": "5dc42e2805e201c6480f4b34d065b7bc", "score": "0.5746854", "text": "function covertToReadableDate(arr) {\n arr.forEach(data => {\n data.checkOutTime = new Date(data.checkOutTime).toLocaleString()\n data.incomingTime = new Date(data.incomingTime).toLocaleString()\n })\n return arr\n }", "title": "" }, { "docid": "5afed5ee655549ca9132ae93e03401d7", "score": "0.56863815", "text": "function dateFromArray(input, asUTC, hoursOffset, minutesOffset) {\n var i, date, forValid = [];\n for (i = 0; i < 7; i++) {\n forValid[i] = input[i] = (input[i] == null) ? (i === 2 ? 1 : 0) : input[i];\n }\n // we store whether we used utc or not in the input array\n input[7] = forValid[7] = asUTC;\n // if the parser flagged the input as invalid, we pass the value along\n if (input[8] != null) {\n forValid[8] = input[8];\n }\n // add the offsets to the time to be parsed so that we can have a clean array\n // for checking isValid\n input[3] += hoursOffset || 0;\n input[4] += minutesOffset || 0;\n date = new Date(0);\n if (asUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n date._a = forValid;\n return date;\n }", "title": "" }, { "docid": "26fc380a0227dc4c6ab530ab1040c20c", "score": "0.55946404", "text": "function la(a,b){a.year(b[0]||0).month(b[1]||0).date(b[2]||0).hours(b[3]||0).minutes(b[4]||0).seconds(b[5]||0).milliseconds(b[6]||0)}", "title": "" }, { "docid": "fea7629dd9536662b74b830f4cb0aad6", "score": "0.54251033", "text": "function getDateArray(strDate)\n{\n\tvar arr = new Array();\n\tvar curDate = new Date();\n\tvar month = curDate.getMonth()+ 1;\n\tvar day\t = curDate.getDate();\n\tvar year = curDate.getFullYear();\n\tarr['year']\t\t=\tyear;\n\tarr['month']\t=\tmonth;\n\tarr['day']\t\t=\tday;\n\tif(strDate != null || strDate != \"\"){\n\t\t//strDateSeparator and arrDateShortPattern are defined in\n\t\t//locale.js\n\t\tstrDateSeparator = GetDateSeparator(strDateShortPattern);\n\t\tvar temp_arr = new Array();\n\t\t//strDateSeparator: \"/| |, |.|-\"\n\t\ttemp_arr = strDate.split(strDateSeparator);\n\t\tif(temp_arr != null && temp_arr.length==3){\n\t\t\tfor(var i=0; i<temp_arr.length; i++){\n\t\t\t\t//arrDateShortPattern looks like {'yyyy','mm','dd'}\n\t\t\t\t//up to browser's date preference stting????\n\t\t\t\tvar temp = arrDateShortPattern[i];\n\t\t\t\tif(temp.indexOf('y')>=0 || temp.indexOf('Y')>=0)\n\t\t\t\t\tarr['year']\t =\ttemp_arr[i];\n\t\t\t\telse if(temp.indexOf('m')>=0 || temp.indexOf('M')>=0)\n\t\t\t\t\tarr['month'] =\ttemp_arr[i];\n\t\t\t\telse\n\t\t\t\t\tarr['day']\t =\ttemp_arr[i];\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\treturn arr;\n}", "title": "" }, { "docid": "feea075c7f8b270f99ff037a8b681639", "score": "0.5349773", "text": "function fromObjectToArray(object) {\n\tvar result = [];\n\t\n\tvar tempObject;\n\tfor(var index = 0; index < object['period'].length; index++) {\n\t\ttempObject = {};\n\t\tfor(var prop in object) {\n\t\t\tif(prop === 'period') {\n\t\t\t\tvar time = object[prop][index];\n\t\t\t\ttempObject[prop] = \tnew Date(time, 0, 0, 0, 0, 0, 0);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\ttempObject[prop] = \tobject[prop][index];\t\n\t\t}\n\n\t\tresult.push(tempObject);\n\t}\n\n\treturn result;\n}", "title": "" }, { "docid": "2360bbf003423a514e9b9821f25994bc", "score": "0.53466004", "text": "convert(date){\n var d = new Date(date),\n month = (d.getMonth() + 1),\n day = d.getDate(),\n year = d.getFullYear();\n\n if (month < 10) \n month = '0' + month;\n if (day < 10) \n day = '0' + day;\n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "c6e7a9a82c776eca857ac4bc54bc20b0", "score": "0.53256416", "text": "function ts_convert_date(a)\n{\n var aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]);\n var re = 'RegExp.$1+RegExp.'+DATE_ORDER_ARRAY['M']+'+\\'/\\'+RegExp.'+DATE_ORDER_ARRAY['D']+'+\\'/\\'+ts_process_year(RegExp.'+DATE_ORDER_ARRAY['Y']+')+RegExp.$5';\n var code = 'if(aa.match(/'+REPLACE_PATTERN+'/)) (' + re + ')';\n return Date.parse(eval(code));\n}", "title": "" }, { "docid": "681f86a4ad2e39cdf3ac65c37ead80fa", "score": "0.53251183", "text": "function getArrayWithDate() {\n var dates = Array(2);\n dates[0] = new Date();\n dates[1] = new Date('12.08.2018');\n dates[1].setHours(21, 0, 0);\n return dates;\n}", "title": "" }, { "docid": "f3394221bf5074ea9811f2ec854b84cf", "score": "0.53120995", "text": "function makeDateFromStringAndArray(config) {\nvar tempConfig,\nbestMoment,\nscoreToBeat,\ni,\ncurrentScore;\nif (config._f.length === 0) {\nconfig._pf.invalidFormat = true;\nconfig._d = new Date(NaN);\nreturn;\n}\nfor (i = 0; i < config._f.length; i++) {\ncurrentScore = 0;\ntempConfig = copyConfig({}, config);\ntempConfig._pf = defaultParsingFlags();\ntempConfig._f = config._f[i];\nmakeDateFromStringAndFormat(tempConfig);\nif (!isValid(tempConfig)) {\ncontinue;\n}\n// if there is any input that was not parsed add a penalty for that format\ncurrentScore += tempConfig._pf.charsLeftOver;\n//or tokens\ncurrentScore += tempConfig._pf.unusedTokens.length * 10;\ntempConfig._pf.score = currentScore;\nif (scoreToBeat == null || currentScore < scoreToBeat) {\nscoreToBeat = currentScore;\nbestMoment = tempConfig;\n}\n}\nextend(config, bestMoment || tempConfig);\n}", "title": "" }, { "docid": "32848021292f06c0a90c920dfa9c2dd2", "score": "0.5300632", "text": "function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "32848021292f06c0a90c920dfa9c2dd2", "score": "0.5300632", "text": "function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9634ea4416e383a14d71d03848177150", "score": "0.52960855", "text": "yearToDate(year) {\n if(!!year) {\n return year+\"-01-01\";\n }\n return null;\n }", "title": "" }, { "docid": "1a9dfa9b8a4c0865aca922794b640cd7", "score": "0.52959913", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "83cc91d58bf5857ca49c3dbfb39febf4", "score": "0.52927345", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "732c5fda2212c54b9d9b93058ebd00e8", "score": "0.52865374", "text": "function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "732c5fda2212c54b9d9b93058ebd00e8", "score": "0.52865374", "text": "function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "c55c6e9b14ee68d338d14c1b7f9348e0", "score": "0.52865374", "text": "function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n\n // check for mismatching day of week\n if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== config._d.getDay()) {\n getParsingFlags(config).weekdayMismatch = true;\n }\n }", "title": "" }, { "docid": "732c5fda2212c54b9d9b93058ebd00e8", "score": "0.52865374", "text": "function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "c55c6e9b14ee68d338d14c1b7f9348e0", "score": "0.52865374", "text": "function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n\n // check for mismatching day of week\n if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== config._d.getDay()) {\n getParsingFlags(config).weekdayMismatch = true;\n }\n }", "title": "" }, { "docid": "5c653fffcfa2b531fff06b45bfe95736", "score": "0.52773607", "text": "function ts_set_date_array(f)\n{\n var tmp = [['D', f.indexOf('D')], ['M', f.indexOf('M')], ['Y', f.indexOf('Y')]];\n tmp.sort(function(a,b){ return a[1] - b[1]});\n DATE_ORDER_ARRAY = new Array(3);\n for(var i = 0; i < 3; i++) DATE_ORDER_ARRAY[tmp[i][0]] = '$' + (i + 2);\n REPLACE_PATTERN = f.replace(/[DMY]([^DMY]+)[DMY]([^DMY]+)[DMY]/, '^(.*?)(\\\\d+)\\\\$1(\\\\d+)\\\\$2(\\\\d+)(.*)$');\n}", "title": "" }, { "docid": "6ed54b244276e3f6f6d69ff06e8c2c8c", "score": "0.5262108", "text": "function createDateObject([month, date, year]) {\n return new Date(year, month - 1, date);\n}", "title": "" }, { "docid": "7035ff528419ade4dcf0f66dee6b192b", "score": "0.5258907", "text": "function orderByYear(arr) {}", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.52481765", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" } ]
521f88b8780d3c283cb98923b423b8ce
Mixin common methods to axis model, Inlcude methods `getFormattedLabels() => Array.` `getCategories() => Array.` `getMin(origin: boolean) => number` `getMax(origin: boolean) => number` `getNeedCrossZero() => boolean` `setRange(start: number, end: number)` `resetRange()`
[ { "docid": "bb0cb402bc030a7609c34e3a16465be7", "score": "0.645951", "text": "function mixinAxisModelCommonMethods(Model) {\n zrUtil.mixin(Model, axisModelCommonMixin);\n}", "title": "" } ]
[ { "docid": "10858568e1286d6eca11f85f31063449", "score": "0.6738311", "text": "function _mixinAxisModelCommonMethods(Model) {\n zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_7__.mixin(Model, _coord_axisModelCommonMixin__WEBPACK_IMPORTED_MODULE_8__.AxisModelCommonMixin);\n }", "title": "" }, { "docid": "00f28878efc54724c91335cbb6fe7de7", "score": "0.6342332", "text": "function mixinAxisModelCommonMethods(Model) {\n util.mixin(Model, axisModelCommonMixin);\n}", "title": "" }, { "docid": "bbe74bb1f0677b821de1b3c7f1d1aba3", "score": "0.6270889", "text": "function axis$1 () {\n\n var decorate = noop,\n orient = 'bottom',\n tickFormat = null,\n outerTickSize = 6,\n innerTickSize = 6,\n tickPadding = 3,\n svgDomainLine = d3.svg.line(),\n ticks = _ticks();\n\n var dataJoin$$ = dataJoin().selector('g.tick').element('g').key(identity).attr('class', 'tick');\n\n var domainPathDataJoin = dataJoin().selector('path.domain').element('path').attr('class', 'domain');\n\n // returns a function that creates a translation based on\n // the bound data\n function containerTranslate(s, trans) {\n return function (d) {\n return trans(s(d), 0);\n };\n }\n\n function translate(x, y) {\n if (isVertical()) {\n return 'translate(' + y + ', ' + x + ')';\n } else {\n return 'translate(' + x + ', ' + y + ')';\n }\n }\n\n function pathTranspose(arr) {\n if (isVertical()) {\n return arr.map(function (d) {\n return [d[1], d[0]];\n });\n } else {\n return arr;\n }\n }\n\n function isVertical() {\n return orient === 'left' || orient === 'right';\n }\n\n function tryApply(fn, defaultVal) {\n var scale = ticks.scale();\n return scale[fn] ? scale[fn].apply(scale, ticks.ticks()) : defaultVal;\n }\n\n var axis = function axis(selection) {\n\n selection.each(function (data, index) {\n\n var scale = ticks.scale();\n\n // Stash a snapshot of the new scale, and retrieve the old snapshot.\n var scaleOld = this.__chart__ || scale;\n this.__chart__ = scale.copy();\n\n var ticksArray = ticks();\n var tickFormatter = tickFormat == null ? tryApply('tickFormat', identity) : tickFormat;\n var sign = orient === 'bottom' || orient === 'right' ? 1 : -1;\n var container = d3.select(this);\n\n // add the domain line\n var range$$ = range(scale);\n var domainPathData = pathTranspose([[range$$[0], sign * outerTickSize], [range$$[0], 0], [range$$[1], 0], [range$$[1], sign * outerTickSize]]);\n\n var domainLine = domainPathDataJoin(container, [data]);\n domainLine.attr('d', svgDomainLine(domainPathData));\n\n // datajoin and construct the ticks / label\n dataJoin$$.attr({\n // set the initial tick position based on the previous scale\n // in order to get the correct enter transition - however, for ordinal\n // scales the tick will not exist on the old scale, so use the current position\n 'transform': containerTranslate(isOrdinal(scale) ? scale : scaleOld, translate)\n });\n\n var g = dataJoin$$(container, ticksArray);\n\n // enter\n g.enter().append('path');\n\n var labelOffset = sign * (innerTickSize + tickPadding);\n g.enter().append('text').attr('transform', translate(0, labelOffset));\n\n // update\n g.attr('class', 'tick orient-' + orient);\n\n g.attr('transform', containerTranslate(scale, translate));\n\n g.select('path').attr('d', function (d) {\n return svgDomainLine(pathTranspose([[0, 0], [0, sign * innerTickSize]]));\n });\n\n g.select('text').attr('transform', translate(0, labelOffset)).attr('dy', function () {\n var offset = '0em';\n if (isVertical()) {\n offset = '0.32em';\n } else if (orient === 'bottom') {\n offset = '0.71em';\n }\n return offset;\n }).text(tickFormatter);\n\n // exit - for non ordinal scales, exit by animating the tick to its new location\n if (!isOrdinal(scale)) {\n g.exit().attr('transform', containerTranslate(scale, translate));\n }\n\n decorate(g, data, index);\n });\n };\n\n axis.tickFormat = function (x) {\n if (!arguments.length) {\n return tickFormat;\n }\n tickFormat = x;\n return axis;\n };\n\n axis.tickSize = function (x) {\n var n = arguments.length;\n if (!n) {\n return innerTickSize;\n }\n innerTickSize = Number(x);\n outerTickSize = Number(arguments[n - 1]);\n return axis;\n };\n\n axis.innerTickSize = function (x) {\n if (!arguments.length) {\n return innerTickSize;\n }\n innerTickSize = Number(x);\n return axis;\n };\n\n axis.outerTickSize = function (x) {\n if (!arguments.length) {\n return outerTickSize;\n }\n outerTickSize = Number(x);\n return axis;\n };\n\n axis.tickPadding = function (x) {\n if (!arguments.length) {\n return tickPadding;\n }\n tickPadding = x;\n return axis;\n };\n\n axis.orient = function (x) {\n if (!arguments.length) {\n return orient;\n }\n orient = x;\n return axis;\n };\n\n axis.decorate = function (x) {\n if (!arguments.length) {\n return decorate;\n }\n decorate = x;\n return axis;\n };\n\n rebindAll(axis, ticks);\n\n return axis;\n }", "title": "" }, { "docid": "cb7155f44fb9c9d0fb501b4460659c1c", "score": "0.6236043", "text": "function mixinAxisModelCommonMethods(Model$$1){\nmixin(Model$$1,axisModelCommonMixin);\n}", "title": "" }, { "docid": "4add1b50f539c1f7e7d9836917f4903d", "score": "0.6221488", "text": "function mixinAxisModelCommonMethods(Model$$1) {\n mixin(Model$$1, axisModelCommonMixin);\n }", "title": "" }, { "docid": "dc33bf1347f1d5b7e2b2dbb22a2516f6", "score": "0.62084466", "text": "function axis () {\n\n var axis = axis$1(),\n baseline = d3.functor(0),\n decorate = noop,\n xScale = d3.time.scale(),\n yScale = d3.scale.linear();\n\n var dataJoin$$ = dataJoin().selector('g.axis-adapter').element('g').attr({ 'class': 'axis axis-adapter' });\n\n var axisAdapter = function axisAdapter(selection) {\n\n selection.each(function (data, index) {\n\n var g = dataJoin$$(this, [data]);\n\n var translation;\n switch (axisAdapter.orient()) {\n case 'top':\n case 'bottom':\n translation = 'translate(0,' + yScale(baseline(data)) + ')';\n axis.scale(xScale);\n break;\n\n case 'left':\n case 'right':\n translation = 'translate(' + xScale(baseline(data)) + ',0)';\n axis.scale(yScale);\n break;\n\n default:\n throw new Error('Invalid orientation');\n }\n\n g.enter().attr('transform', translation);\n g.attr('transform', translation);\n\n g.call(axis);\n\n decorate(g, data, index);\n });\n };\n\n axisAdapter.baseline = function (x) {\n if (!arguments.length) {\n return baseline;\n }\n baseline = d3.functor(x);\n return axisAdapter;\n };\n axisAdapter.decorate = function (x) {\n if (!arguments.length) {\n return decorate;\n }\n decorate = x;\n return axisAdapter;\n };\n axisAdapter.xScale = function (x) {\n if (!arguments.length) {\n return xScale;\n }\n xScale = x;\n return axisAdapter;\n };\n axisAdapter.yScale = function (x) {\n if (!arguments.length) {\n return yScale;\n }\n yScale = x;\n return axisAdapter;\n };\n\n return d3.rebind(axisAdapter, axis, 'orient', 'ticks', 'tickValues', 'tickSize', 'innerTickSize', 'outerTickSize', 'tickPadding', 'tickFormat');\n }", "title": "" }, { "docid": "d3a28fe21955590aa17559789db3093b", "score": "0.6150699", "text": "function mixinAxisModelCommonMethods(Model$$1) {\n mixin(Model$$1, axisModelCommonMixin);\n}", "title": "" }, { "docid": "d3a28fe21955590aa17559789db3093b", "score": "0.6150699", "text": "function mixinAxisModelCommonMethods(Model$$1) {\n mixin(Model$$1, axisModelCommonMixin);\n}", "title": "" }, { "docid": "d3a28fe21955590aa17559789db3093b", "score": "0.6150699", "text": "function mixinAxisModelCommonMethods(Model$$1) {\n mixin(Model$$1, axisModelCommonMixin);\n}", "title": "" }, { "docid": "6fb4010476f36e416bc3b8c1f384d3f9", "score": "0.603978", "text": "function ApexXAxis() { }", "title": "" }, { "docid": "6fb4010476f36e416bc3b8c1f384d3f9", "score": "0.603978", "text": "function ApexXAxis() { }", "title": "" }, { "docid": "ac0085f86d60733ca1d1a30a2e6098cb", "score": "0.588384", "text": "function NumericAxis() {\n _classCallCheck(this, NumericAxis);\n\n var _this = _possibleConstructorReturn(this, _CartesianLabelManage.call(this));\n\n _this.config.scale = new _linear2['default']();\n return _this;\n }", "title": "" }, { "docid": "38b0736c4d7f446f9bc895ab95a8cc28", "score": "0.58626395", "text": "function Axis() {\n // Please eslint no-empty-function.\n }", "title": "" }, { "docid": "cc6c547569eef8e75ca9fe4d3f93b4f2", "score": "0.58420384", "text": "function Axis(name) {\n $.jqplot.ElemContainer.call(this);\n // Group: Properties\n \n // prop: name\n // Axis name (identifier). One of 'xaxis', 'yaxis', 'x2axis' or 'y2axis'.\n this.name = name;\n this._series = [];\n // prop: show\n // Wether to display the axis on the graph.\n this.show = false;\n // prop: min\n // minimum value of the axis (in data units, not pixels).\n this.min=null;\n // prop: max\n // maximum value of the axis (in data units, not pixels).\n this.max=null;\n // prop: pad\n // Padding to extend the range above and below the data bounds.\n // Factor to multiply by the data range when setting the axis bounds\n this.pad = 1.2;\n // prop: numberTicks\n // Desired number of ticks. Computed automatically by default\n this.numberTicks;\n // prop: tickInterval\n // number of units between ticks. Mutually exclusive with numberTicks.\n this.tickInterval;\n // prop: renderer\n // A class of a rendering engine that handles tick generation, \n // data to plot scaling and drawing the axis element.\n this.renderer = $.jqplot.LinearAxisRenderer;\n // prop: rendererOptions\n // renderer specific options.\n this.rendererOptions = {};\n // prop: tickRenderer\n // A class of a rendering engine for creating the ticks labels displayed on the plot.\n this.tickRenderer = $.jqplot.AxisTickRenderer;\n // prop: tickOptions\n // Options that will be passed to the tickRenderer.\n // \n // Properties:\n // mark - tick markings. One of 'inside', 'outside', 'cross', '' or null.\n // The latter 2 options will hide the tick marks.\n // markSize - length of the tick marks in pixels. For 'cross' style, length\n // will be stoked above and below axis, so total length will be twice this.\n // size - uhhhh, hmmm.\n // formatter - a class of a formatter which formats the value of the tick for display.\n // showLabel - Wether to show labels or not.\n // formatString - formatting string passed to the tick formatter.\n // fontFamily - css font-family spec.\n // fontSize -css font-size spec.\n // textColor - css color spec.\n this.tickOptions = {mark:'outside', markSize:4, size:4, showLabel:true, formatter:$.jqplot.sprintf, formatString:'%.1f', fontFamily:'', fontSize:'0.75em', textColor:''};\n // prop: showTicks\n // wether to show the ticks (marks and labels) or not.\n this.showTicks = true;\n // prop: showTickMarks\n // wether to show the tick marks or not.\n this.showTickMarks = true;\n // prop: showMinorTicks\n // Wether or not to show minor ticks. THis is renderer dependent.\n // The default LinearAxisRenderer does not have minor ticks.\n this.showMinorTicks = true;\n\n this._dataBounds = {min:null, max:null};\n\n this._offsets = {min:null, max:null};\n\n this._plotWidth;\n this._plotHeight;\n this._ticks=[];\n }", "title": "" }, { "docid": "3f1034d5a3e53d687bd3df14f636a3da", "score": "0.58324194", "text": "yLeftAxisScale(min, max) {\n return { min: `${min}`, max: `${max}` };\n }", "title": "" }, { "docid": "ae0be1d377fd4f5c5c8484ec9b7b924e", "score": "0.5829894", "text": "constructor(props) {\n super(props);\n const { intl } = this.props\n this.formatMessage = intl.formatMessage\n // this.updateScale(this.props)\n this.outerRadius=0\n this.axes = [\n { 'label': '非常相似', 'value': 15 },\n { 'label': '相似', 'value': 30 },\n { 'label': '不同', 'value': 45 },\n { 'label': '非常不同', 'value': 60 },\n { 'label': '差异极大', 'value': 75} \n ];\n }", "title": "" }, { "docid": "a2cad379e62216f99637a1d9b5e065e7", "score": "0.5781485", "text": "function customXAxis_067(g) {\ng.select(\".domain\").remove();\ng.selectAll(\".tick line\").attr(\"stroke\", data_set_067.color_area_layout_axis)\ng.selectAll(\"text\").attr(\"transform\", \"translate(-10,0)rotate(-45)\")\n.style(\"text-anchor\", \"end\").attr(\"fill\", data_set_067.color_area_layout_axis);\n// highlight stuff\ng.selectAll(\".tick\")\n.attr(\"class\", function(d,i){\nif(data_area_067[i].year == 2010){ return \"tick_marker\"}\nelse if(data_area_067[i].year == 1995){ return \"tick_marker\"}\nelse if(data_area_067[i].year == 2016){ return \"tick_marker\"}\nelse if(data_area_067[i].year == 2019){ return \"tick_marker\"}\nelse{ return \"tick\"}\n});\n// fix position \"2019\"\ng.selectAll(\".tick_marker:last-of-type\").attr(\"transform\", \"translate(459,0)\");\n// change styles\nd3.selectAll(\".Xaxis\").selectAll(\".tick\").attr(\"opacity\", 0);\nd3.selectAll(\".tick_marker text\").attr(\"fill\", \"#a5a7af\").attr(\"font-weight\", \"400\");\n}", "title": "" }, { "docid": "2f744c8b11578eddb8ba34ee51ca5092", "score": "0.57189363", "text": "_appendScales() {\n const shortDist = Boolean(this._profile.totalDistance <= 10)\n const yHeightMin = this._profile.yElevationMin\n const yHeightMax = this._profile.yElevationMax\n const margin = this._margin, width = this._width - this._margin.left - this._margin.right,\n height = this._height - this._margin.top - this._margin.bottom\n this._x = scaleLinear()\n .range([0, width]);\n this._y = scaleLinear()\n .range([height, 0]);\n this._x.domain([0, this._profile.totalDistance]);\n this._y.domain([yHeightMin, yHeightMax]);\n if (shortDist === true) {\n this._xAxis = axisBottom()\n .scale(this._x)\n .tickFormat(d => format(\".2f\")(d) + \" km\");\n } else {\n this._xAxis = axisBottom()\n .scale(this._x)\n .tickFormat(d => format(\".0f\")(d) + \" km\");\n }\n if(this.options.xTicks !== undefined){\n this._xAxis.ticks(Math.pow(2, this.options.xTicks));\n }\n this._yAxis = axisLeft()\n .scale(this._y)\n .tickFormat(d => d + \" m\");\n if(this.options.yTicks !== undefined){\n this._yAxis.ticks(Math.pow(2, this.options.yTicks));\n }\n this._yEndAxis = axisRight()\n .scale(this._yEnd)\n .ticks(0);\n }", "title": "" }, { "docid": "93265dbcf248a86b6a660561fd756a34", "score": "0.57176006", "text": "function renderAxis() {\n dom.axis.x0\n .call(drag);\n\n dom.axis.x1\n .call(drag);\n\n dom.axis.x0\n .transition()\n .duration(transitionDuration)\n .call(axis.x0);\n\n dom.axis.x1\n .transition()\n .duration(transitionDuration)\n .call(axis.x1);\n\n axis.y.tickSize(WIDTH - mg.l);\n\n dom.axis.y\n .call(axis.y)\n .call(drag);\n\n dom.axis.boundaries\n .attr('x1', (d, i) => scale.x.range()[i])\n .attr('x2', (d, i) => scale.x.range()[i])\n .attr('y1', 10)\n .attr('y2', 20);\n\n dom.axis.label1\n .attr('x', scale.x.range()[1] - 5);\n }", "title": "" }, { "docid": "db77a5a50301bc60ab0ab1575c2cd005", "score": "0.5700043", "text": "function calculateBase(groupItem){\nvar extent;\nvar baseAxis=groupItem.axis;\nvar seriesModels=groupItem.seriesModels;\nvar seriesCount=seriesModels.length;\n\nvar boxWidthList=groupItem.boxWidthList=[];\nvar boxOffsetList=groupItem.boxOffsetList=[];\nvar boundList=[];\n\nvar bandWidth;\nif(baseAxis.type==='category'){\nbandWidth=baseAxis.getBandWidth();\n}else\n{\nvar maxDataCount=0;\neach$13(seriesModels,function(seriesModel){\nmaxDataCount=Math.max(maxDataCount,seriesModel.getData().count());\n});\nextent=baseAxis.getExtent(),\nMath.abs(extent[1]-extent[0])/maxDataCount;\n}\n\neach$13(seriesModels,function(seriesModel){\nvar boxWidthBound=seriesModel.get('boxWidth');\nif(!isArray(boxWidthBound)){\nboxWidthBound=[boxWidthBound,boxWidthBound];\n}\nboundList.push([\nparsePercent$1(boxWidthBound[0],bandWidth)||0,\nparsePercent$1(boxWidthBound[1],bandWidth)||0]);\n\n});\n\nvar availableWidth=bandWidth*0.8-2;\nvar boxGap=availableWidth/seriesCount*0.3;\nvar boxWidth=(availableWidth-boxGap*(seriesCount-1))/seriesCount;\nvar base=boxWidth/2-availableWidth/2;\n\neach$13(seriesModels,function(seriesModel,idx){\nboxOffsetList.push(base);\nbase+=boxGap+boxWidth;\n\nboxWidthList.push(\nMath.min(Math.max(boxWidth,boundList[idx][0]),boundList[idx][1]));\n\n});\n}", "title": "" }, { "docid": "683c3f822a47a811e9bc8cf148a79063", "score": "0.5698846", "text": "function LeftAxisAdaptor() {\n\tthis.className = \"LeftAxis\";\n\tthis.plotOffset = 1.0;\n\tthis.plotScale = -1.0;\n\tthis.lengthLabel = \"height\";\t\n\tthis.tickLabelAlignment = \"right\";\n}", "title": "" }, { "docid": "676e8bb5819dc359eae691f8cf0f4627", "score": "0.5693959", "text": "function ticksAndAnnotations() {\n var activeAxIds = [];\n var i;\n\n function pushActiveAxIds(axList) {\n for(i = 0; i < axList.length; i++) {\n if(!axList[i].fixedrange) activeAxIds.push(axList[i]._id);\n }\n }\n\n if(editX) {\n pushActiveAxIds(xaxes);\n pushActiveAxIds(links.xaxes);\n pushActiveAxIds(matches.xaxes);\n }\n if(editY) {\n pushActiveAxIds(yaxes);\n pushActiveAxIds(links.yaxes);\n pushActiveAxIds(matches.yaxes);\n }\n\n updates = {};\n for(i = 0; i < activeAxIds.length; i++) {\n var axId = activeAxIds[i];\n var ax = getFromId(gd, axId);\n Axes.drawOne(gd, ax, {skipTitle: true});\n updates[ax._name + '.range[0]'] = ax.range[0];\n updates[ax._name + '.range[1]'] = ax.range[1];\n }\n\n Axes.redrawComponents(gd, activeAxIds);\n }", "title": "" }, { "docid": "1c620f34bfe3ec5ae1112dca2600e447", "score": "0.5682967", "text": "function buildAxis() {\n xAxis = d3Axis.axisBottom(xScale)\n .ticks(xTicks, valueLabelFormat);\n yAxis = d3Axis.axisLeft(yScale)\n }", "title": "" }, { "docid": "60074d89ca6c7b26c816876a60fc394f", "score": "0.5674814", "text": "function Axis( name, title ){\n this.name = name;\n this.title = title;\n\n this.fNdivisions;\n this.fAxisColor;\n this.fLabelColor;\n this.fLabelFont;\n this.fLabelOffset;\n this.fLabelOffset;\n this.fLabelSize;\n this.fTitleOffset;\n this.d3Axis = d3.svg.axis();\n\n\n // ****************************************************\n // * Functions coming from ROOT mother class TAxisAtt *\n // ****************************************************\n\n // \n /*SaveAttributes: function( out, name, subname ){\n \n return this;\n },\n\n // Set color of the line axis and tick marks.\n SetAxisColor: function( color ){\n this.d3Axis.style( \"stroke\", color ); \n\n return this;\n },\n\n // Set color of labels.\n SetLabelColor: function( color ){\n\n return this;\n },\n\n // Set labels' font.\n SetLabelFont: function( font ){\n\n return this;\n },\n\n // Set distance between the axis and the labels.\n // In ROOT: The distance is expressed in per cent of the pad width.\n SetLabelOffset: function( offset ){\n\n return this;\n },\n\n // Set size of axis labels.\n // In ROOT: The size is expressed in per cent of the pad width.\n SetLabelSize: function( size ){\n\n return this;\n },\n\n /* Set the number of divisions for this axis.\n\n if optim = kTRUE (default), the number of divisions will be\n optimized around the specified value.\n if optim = kFALSE, or n < 0, the axis will be forced to use\n exactly n divisions.\n\n n = n1 + 100*n2 + 10000*n3\n\n Where n1 is the number of primary divisions,\n n2 is the number of second order divisions and\n n3 is the number of third order divisions.\n\n e.g. 512 means 12 primary and 5 secondary divisions.\n\n If the number of divisions is \"optimized\" (see above) n1, n2, n3 are\n maximum values. \n SetNdivisions: function( n, optim ){\n \n return this;\n },\n SetNdivisions: function( n1, n2, n3, optim){\n \n return this;\n },\n\n // Set tick mark length\n // The length is expressed in per cent of the pad width\n SetTickLength: function( lenght ){\n \n return this;\n },\n\n /* Set distance between the axis and the axis title\n Offset is a correction factor with respect to the \"standard\" value.\n offset = 1 uses the default position that is computed in function\n of the label offset and size.\n offset = 1.2 will add 20 per cent more to the default offset. \n SetTitleOffset: function( offset ){\n \n return this;\n },\n \n // Set size of axis title.\n // The size is expressed in per cent of the pad width.\n SetTitleSize: function( size ){\n \n return this;\n },\n\n // Set color of axis title\n SetTitleColor: function( color ){\n\n return this;\n },\n\n // Set the title font.\n SetTitleFont: function( font ){\n \n return this;\n },\n\n GetNdivisions: function(){\n return this.fNdivisions;\n },\n\n GetAxisColor: function(){\n return this.fAxisColor;\n },\n\n GetLabelColor: function(){\n return this.fLabelColor;\n },\n\n GetLabelFont: function(){\n return this.fLabelFont;\n },\n\n GetLabelOffset: function(){\n return this.fLabelOffset;\n },\n\n GetLabelSize: function(){\n return this.fLabelSize;\n },\n\n GetTitleOffset: function(){\n return this.fTitleOffset;\n },\n\n GetTitleSize: function(){\n return this.fTitleSize;\n },\n\n GetTitleColor: function(){\n return this.fTitleColor;\n },\n\n GetTitleFont: function(){\n return this.fTitleFont;\n },\n*/\n }", "title": "" }, { "docid": "7b462cd11287cbe8a0ecdc2f4eec64ea", "score": "0.5668852", "text": "make_x_axis() {\n\t\tlet start_at, height, text_start_at, label_class = '';\n\t\tif(this.x_axis_mode === 'span') {\t\t// long spanning lines\n\t\t\tstart_at = -7;\n\t\t\theight = this.height + 15;\n\t\t\ttext_start_at = this.height + 25;\n\t\t} else if(this.x_axis_mode === 'tick'){\t// short label lines\n\t\t\tstart_at = this.height;\n\t\t\theight = 6;\n\t\t\ttext_start_at = 9;\n\t\t\tlabel_class = 'x-axis-label';\n\t\t}\n\n\t\tthis.x_axis_group.attr({\n\t\t\ttransform: `translate(0,${start_at})`\n\t\t});\n\t\tthis.x.values.map((point, i) => {\n\t\t\tthis.x_axis_group.add(this.snap.g(\n\t\t\t\tthis.snap.line(0, 0, 0, height),\n\t\t\t\tthis.snap.text(0, text_start_at, point).attr({\n\t\t\t\t\tdy: \".71em\",\n\t\t\t\t\tclass: \"x-value-text\"\n\t\t\t\t})\n\t\t\t).attr({\n\t\t\t\tclass: `tick ${label_class}`,\n\t\t\t\ttransform: `translate(${ this.x_axis_values[i] }, 0)`\n\t\t\t}));\n\t\t});\n\t}", "title": "" }, { "docid": "f73c9cbe5606faa4674bab80d42fff7f", "score": "0.5641633", "text": "function updateLabels() {\n var optShowMaximum = _value.options.showMaximum;\n if (typeof optShowMaximum == 'undefined') {\n optShowMaximum = _representation.options.showMaximum;\n }\n var optOrientation = _value.options['orientation'];\n var texts = svg.select('.knime-x').selectAll('text');\n texts.each(function (d, i) {\n if (typeof wrapedPlotData[0].values[i] !== 'undefined') {\n var self = d3.select(this);\n self.text(wrapedPlotData[0].values[i].x);\n self.append('title').classed('knime-tooltip', true);\n }\n });\n var stacked = _value.options['chartType'];\n var extremValues = [];\n \tif(stacked == \"Grouped\") {\n \t\textremValues = getRoundedMaxValue(false);\t\n \t} else {\n \t\textremValues = getRoundedMaxValue(true);\n \t}\n \tvar minValue = extremValues[0];\n \tvar maxValue = extremValues[1];\n \t\n var tickAmount = chart.yAxis.ticks();\n if (tickAmount < 2) {\n tickAmount = 2;\n }\n\n var scale = d3.scale.linear().domain([minValue, maxValue]);\n\n var textsYMin, textsYMax;\n if (optShowMaximum) {\n if (optOrientation) {\n textsYMin = svg.select('.nv-axisMin-x').selectAll('text');\n textsYMax = svg.select('.nv-axisMax-x').selectAll('text');\n } else {\n textsYMin = svg.select('.nv-axisMin-y').selectAll('text');\n textsYMax = svg.select('.nv-axisMax-y').selectAll('text');\n }\n textsYMin.text(minValue);\n textsYMax.text(maxValue);\n }\n\n var labelTooltip = texts.selectAll('.knime-tooltip');\n var counter = 0;\n labelTooltip.each(function (d, i) {\n var self = d3.select(this);\n if (typeof plotData[0].values[counter] !== 'undefined') {\n self.text(plotData[0].values[counter].x);\n }\n counter++;\n });\n\n // Create titles for the Axis-Tooltips\n svg.select('.knime-y text.knime-axis-label').append('title').classed('knime-tooltip', true).text(\n _value.options['freqLabel']);\n svg.select('.knime-x text.knime-axis-label').append('title').classed('knime-tooltip', true).text(\n _value.options['catLabel']);\n }", "title": "" }, { "docid": "c633957860583a7788b5d3b5f6622bf0", "score": "0.56373715", "text": "canUseAsXAxis(axis) {\n let iv = this.i.ml(axis);\n return (iv);\n }", "title": "" }, { "docid": "fc4efcbd7582041c2384f74b38f4706b", "score": "0.56050634", "text": "initAxis() { this.axis = new CGFaxis(this, this.graph.axisLength); }", "title": "" }, { "docid": "264ad6c5ea3556b00d9446440af6ee5f", "score": "0.55991256", "text": "function ChartAxes(){var t=function(t,e,n,i){var r=n.valuesX;r&&i.addXAxisValues(r);var a=n.valuesXs,o={};if(a){xsItems=a.split(\",\");for(var s in xsItems)xsItem=xsItems[s].split(\":\"),o[xsItem[0]]=xsItem[1];i.addXSValues(o)}var u=n.y,l=n.y2,c={};if(l){var h=l.split(\",\");for(var d in h)c[h[d]]=\"y2\";if(u){var f=u.split(\",\");for(var p in f)c[f[p]]=\"y\"}i.addYAxis(c)}};return{require:\"^c3chart\",restrict:\"E\",scope:{},replace:!0,link:t}}", "title": "" }, { "docid": "6329aa1c81d6ded0d2e50288349a138a", "score": "0.55959487", "text": "initXAxis(){\n\t\t/* The bottom axis will map to a series of discrete pixel values, evenly\n\t\t * distributed along the drawing area, for this, we use the scaleBand scale\n\t\t * provided by D3 */\n\t\tlet scale = d3.scaleBand()\n\t\t\t.domain(this._xLabels)\n\t\t\t.range( [0, this._width-this._margin.left-this._margin.right] )\n\t\t\t.padding(0.05)\n\t\t;\n\t\t/* create the corresponding axis */\n\t\treturn d3.axisBottom(scale);\n\t}", "title": "" }, { "docid": "c673cafce940a0830951f842be15c647", "score": "0.5574847", "text": "static get properties() {\n return {\n ...super.properties,\n ...super.lineBarProperties,\n /**\n * Use only integer values (whole numbers) for the scale steps\n */\n axisXOnlyInteger: {\n attribute: \"axis-x-only-integer\",\n type: Boolean,\n },\n /**\n * TODO\n */\n axisXScaleMinSpace: {\n attribute: \"axis-x-min-space\",\n type: Number,\n },\n /**\n * If set to true then each bar will represent a series and\n * the data array is expected to be a one dimensional array\n * of data values rather than a series array of series.\n * This is useful if the bar chart should represent\n * a profile rather than some data over time.\n */\n distributeSeries: {\n attribute: \"distribute-series\",\n type: Boolean,\n },\n /**\n * Inverts the axes of the bar chart in order to draw\n * a horizontal bar chart. Be aware that you also need\n * to invert your axis settings as the Y Axis will now display\n * the labels and the X Axis the values.\n */\n horizontalBars: {\n attribute: \"horizontal-bars\",\n type: Boolean,\n },\n /**\n * Unless low/high are explicitly set, bar chart will be\n * centered at zero by default. Set referenceValue to null to auto scale.\n */\n referenceValue: {\n attribute: \"reference-value\",\n type: Number,\n },\n /**\n * Specify the distance in pixel of bars in a group.\n */\n seriesBarDistance: {\n attribute: \"series-bar-distance\",\n type: Number,\n },\n /**\n * If set to true this property will cause the series bars\n * to be stacked. Check the \"stackMode\" option\n * for further stacking options.\n */\n stackBars: {\n attribute: \"stack-bars\",\n type: Boolean,\n },\n /**\n * If set to \"true\" this property will form a total\n * for each series point. This will also influence\n * the y-axis and the overall bounds of the chart.\n * If set to \"false\" this property will force\n * the stacked bars to draw from the zero line.\n * In stacked mode the \"seriesBarDistance\" property will have no effect.\n */\n stackMode: {\n attribute: \"stack-mode\",\n type: Boolean,\n },\n };\n }", "title": "" }, { "docid": "7ddc27f0e3ddb91a7265c45c1bbff718", "score": "0.5564406", "text": "function axisModelCreator(registers, axisName, BaseAxisModelClass, extraDefaultOption) {\n (0, zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_0__.each)(_axisCommonTypes__WEBPACK_IMPORTED_MODULE_1__.AXIS_TYPES, function (v, axisType) {\n var defaultOption = (0, zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_0__.merge)((0, zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_0__.merge)({}, _axisDefault__WEBPACK_IMPORTED_MODULE_2__[\"default\"][axisType], true), extraDefaultOption, true);\n\n var AxisModel =\n /** @class */\n function (_super) {\n (0, tslib__WEBPACK_IMPORTED_MODULE_3__.__extends)(AxisModel, _super);\n\n function AxisModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = axisName + 'Axis.' + axisType;\n return _this;\n }\n\n AxisModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\n var layoutMode = (0, _util_layout__WEBPACK_IMPORTED_MODULE_4__.fetchLayoutMode)(this);\n var inputPositionParams = layoutMode ? (0, _util_layout__WEBPACK_IMPORTED_MODULE_4__.getLayoutParams)(option) : {};\n var themeModel = ecModel.getTheme();\n (0, zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_0__.merge)(option, themeModel.get(axisType + 'Axis'));\n (0, zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_0__.merge)(option, this.getDefaultOption());\n option.type = getAxisType(option);\n\n if (layoutMode) {\n (0, _util_layout__WEBPACK_IMPORTED_MODULE_4__.mergeLayoutParam)(option, inputPositionParams, layoutMode);\n }\n };\n\n AxisModel.prototype.optionUpdated = function () {\n var thisOption = this.option;\n\n if (thisOption.type === 'category') {\n this.__ordinalMeta = _data_OrdinalMeta__WEBPACK_IMPORTED_MODULE_5__[\"default\"].createByAxisModel(this);\n }\n };\n /**\n * Should not be called before all of 'getInitailData' finished.\n * Because categories are collected during initializing data.\n */\n\n\n AxisModel.prototype.getCategories = function (rawData) {\n var option = this.option; // FIXME\n // warning if called before all of 'getInitailData' finished.\n\n if (option.type === 'category') {\n if (rawData) {\n return option.data;\n }\n\n return this.__ordinalMeta.categories;\n }\n };\n\n AxisModel.prototype.getOrdinalMeta = function () {\n return this.__ordinalMeta;\n };\n\n AxisModel.type = axisName + 'Axis.' + axisType;\n AxisModel.defaultOption = defaultOption;\n return AxisModel;\n }(BaseAxisModelClass);\n\n registers.registerComponentModel(AxisModel);\n });\n registers.registerSubTypeDefaulter(axisName + 'Axis', getAxisType);\n }", "title": "" }, { "docid": "977860581b6014679d61458ef2c489b6", "score": "0.555731", "text": "function setLinearTickPositions() {\r\n\t\t\t\r\n\t\t\tvar i,\r\n\t\t\t\troundedMin = mathFloor(min / tickInterval) * tickInterval,\r\n\t\t\t\troundedMax = math.ceil(max / tickInterval) * tickInterval;\r\n\t\t\t\t\r\n\t\t\ttickPositions = [];\r\n\t\t\t\r\n\t\t\t// populate the intermediate values\r\n\t\t\ti = correctFloat(roundedMin);\r\n\t\t\twhile (i <= roundedMax) {\r\n\t\t\t\ttickPositions.push(i);\r\n\t\t\t\ti = correctFloat(i + tickInterval);\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t// pad categorised axis to nearest half unit\r\n\t\t\tif (categories) {\r\n\t\t\t\t min -= 0.5;\r\n\t\t\t\t max += 0.5;\r\n\t\t\t}\r\n\r\n\t\t\t// dynamic label formatter \r\n\t\t\t/*if (!labelFormatter) { \r\n\t\t\t\tlabelFormatter = function() {\r\n\t\t\t\t\treturn this.value;\r\n\t\t\t\t};\r\n\t\t\t}*/\r\n\t\t\t\r\n\t\t}", "title": "" }, { "docid": "4478c469012f1ebcdf1857d47d5f678c", "score": "0.55361885", "text": "function Point (axisValues) {\n\t\n\t// AxisValue is meant to be passed in as an\n\t// array of doubles (just called \"numbers\" in javascript)\n\tthis.position = axisValues;\n\tif (this.position != null) {\n\t\tthis.dimensions = this.position.length;\n\t}\n\t\n\t// Returns the value of the provided axis. \n\t// If the axis is not defined, 0 is still returned!!!!\n\tthis.getAxisValue = function getAxisValue (axis) {\n\t\tif (axis >= this.dimensions || axis < 0) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn this.position[axis];\n\t}\n\t\n\t// Sets the provided axis to the provided value.\n\tthis.setAxis = function setAxis (axis, value) {\n\t\tthis.position[axis] = value;\n\t\tthis.dimensions = this.position.length;\n\t}\n\t\n\t// Adds the provided point to this one\n\tthis.add = function add (positionToAdd) {\n\t\tfor (var i = 0; i < this.dimensions; i++) {\n\t\t\tthis.position[i] += positionToAdd.getAxisValue(i);\n\t\t}\n\t}\n\t\n\t// Subtracts the provided point\n\tthis.subtract = function subtract (positionToSub) {\n\t\tfor (var i = 0; i < this.dimensions; i++) {\n\t\t\tthis.position[i] -= positionToSub.getAxisValue(i);\n\t\t}\n\t}\n\t\n\t// Returns the index of the greatest defined axis\n\t// (which is the number of dimensions the point is defined in)\n\tthis.getDimensions = function getDimensions () {\n\t\treturn this.dimensions;\n\t}\n\t\n\t// Returns the values of each axis surrounded by brackets\n\tthis.toString = function toString () {\n\t\tvar result = \"[\";\n\t\tif (this.position[0] >= 0) {\n\t\t\tresult += \" \";\n\t\t}\n\t\tresult += this.position[0];\n\t\tfor (var t = 1; t < this.position.length; t++) {\n\t\t\tresult += \", \";\n\t\t\tif (this.position[t] >= 0) {\n\t\t\t\tresult += \" \";\n\t\t\t}\n\t\t\tresult += this.position[t];\n\t\t}\n\t\tresult += \"]\";\n\t\treturn result;\n\t}\n}", "title": "" }, { "docid": "56e0fecba3df3c1d810aff769563ce7d", "score": "0.55348885", "text": "function customYAxis_067(g) {\ng.select(\".domain\").remove();\ng.selectAll(\".tick:not(:first-of-type) line\").attr(\"stroke\", data_set_067.color_area_layout_axis)\n.attr(\"stroke-dasharray\", \"3,3\").style(\"stroke-width\", 1);\ng.selectAll(\".tick:first-of-type line\").remove();\ng.selectAll(\".tick text\").attr(\"text-anchor\", \"end\").attr(\"x\", -6).attr(\"dy\", -2)\n.style(\"fill\", data_set_067.color_area_layout_axis);\n}", "title": "" }, { "docid": "3917ed7135903a9335c9ddd3aab8d027", "score": "0.5525027", "text": "createAxis_() {\n const yAxis = this.elementChart_.property(\n Property.CLIENT_HEIGHT);\n const yAxisOffset = 14;\n\n const axisChart = d3.axisBottom(this.timeScale_)\n .tickFormat(d3.timeFormat('%b \\'%y'))\n .tickSize(yAxis)\n ;\n\n this.elementAxis_.style(Style.LEFT,\n Dimension.WIDTH_CATEGORY_LABEL +\n Dimension.WIDTH_TIMELINE_LEFT_BORDER + UnitType.PX)\n ;\n\n const svgAxis = this.elementAxis_.append(Tag.SVG)\n .attr(Attribute.HEIGHT, yAxis + yAxisOffset * 2)\n .attr(Attribute.WIDTH, this.currentChartSize)\n .append(Tag.G)\n .attr(Attribute.TRANSFORM, this.getTranslate_(0, 0))\n .call(axisChart)\n ;\n\n // Adjust axis labels position.\n svgAxis.selectAll('.tick text')\n .attr(Attribute.Y, yAxis + yAxisOffset)\n ;\n\n // const timeRange = this.timeline_.getTimeRange();\n // const utcMonths = d3.utcMonths(timeRange.min, timeRange.max);\n }", "title": "" }, { "docid": "64d67eec413615c6807249c4357c015a", "score": "0.5520199", "text": "init(){\n if (this.mode == 'manual' ){\n this.number = this.labels.length ;\n if (this.ticks.length != this.labels.length ){\n warn('Number of ticks and tick labels are not equal') ;\n }\n }\n \n if (this.mode == 'auto'){\n var delta = this.delta ;\n var dl = 1./(this.number+1) ;\n this._ticks = [] ;\n this._labels = [] ;\n for(var i=0 ; i<this.number ;i++){\n var num = delta*(i)+this.min ;\n if ( this.precision != undefined ){\n num = num.toFixed(this.precision) ;\n }\n this._ticks.push( this._min+(i)*delta );\n this._labels.push(num+this.unit) ;\n }\n }\n\n }", "title": "" }, { "docid": "e0e9faac4e006fd9505116dd62c57bfb", "score": "0.5509283", "text": "function setTickPositions() {\r\n\t\t\tif (isDatetimeAxis)\t{\r\n\t\t\t\tsetDateTimeTickPositions();\r\n\t\t\t} else {\r\n\t\t\t\tsetLinearTickPositions();\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\t// reset min/max or remove extremes based on start/end on tick\r\n\t\t\tvar roundedMin = tickPositions[0],\r\n\t\t\t\troundedMax = tickPositions[tickPositions.length - 1];\r\n\t\t\t\t\t\r\n\t\t\t\r\n\t\t\tif (options.startOnTick) {\r\n\t\t\t\tmin = roundedMin;\r\n\t\t\t} else if (min > roundedMin) {\r\n\t\t\t\ttickPositions.shift();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (options.endOnTick) {\r\n\t\t\t\tmax = roundedMax;\r\n\t\t\t} else if (max < roundedMax) {\r\n\t\t\t\ttickPositions.pop();\r\n\t\t\t}\r\n\t\t\t\t\t\r\n\t\t}", "title": "" }, { "docid": "28e7a54f19d3b3219e798168e77f6654", "score": "0.54804564", "text": "addYAxis(yMin, yMax, width) {\n yMin = Math.min(yMin, -3) || -3;\n yMax = Math.max(yMax, 3) || 3;\n\n let stepSize = this.findAxisStepSize(yMin, yMax);\n\n yMin = Utils.roundTo(yMin, stepSize);\n yMax = Utils.roundTo(yMax, stepSize);\n\n this.yMin = yMin;\n this.yMax = yMax;\n\n let xMin = 0 - (width / 2);\n let xMax = 0 + (width / 2);\n\n // Add the background for the axis labels.\n this.options.options.annotation.annotations.push({\n type: 'box',\n xScaleID: 'x',\n yScaleID: 'y',\n backgroundColor: 'rgba(255, 255, 255, 1)',\n yMax: yMax,\n yMin: yMin,\n xMin: xMin,\n xMax: xMax,\n borderWidth: 0,\n borderColor: '#fff',\n // Draw the axis labels.\n callback: (ctx) => {\n ctx.save();\n\n // Set up fonts.\n ctx.font = '14px Roboto, sans-serif';\n ctx.fillStyle = '#757575';\n ctx.textBaseline = 'middle';\n ctx.textAlign = 'center';\n\n const ticks = Utils.generateRange(yMin, yMax, stepSize);\n \n for (let i = 0; i < ticks.length; i++) {\n // Draw each label in the centre.\n this.drawAt(ctx, {\n text: ticks[i],\n x: 0,\n y: ticks[i]\n });\n }\n\n ctx.textAlign = 'right';\n ctx.font = '15px Roboto, sans-serif';\n ctx.fillStyle = '#424242';\n ctx.textBaseline = 'bottom';\n // Draw the hard/easy signs.\n this.drawAt(ctx, {\n text: 'Difficulty',\n x: xMin,\n y: yMax,\n // Offset from the canvas coordinate in pixels.\n offsetX: 0,\n offsetY: -30\n });\n this.drawAt(ctx, {\n text: 'Hard',\n x: xMin,\n y: yMax,\n offsetX: 0,\n offsetY: -15\n });\n ctx.textBaseline = 'top';\n this.drawAt(ctx, {\n text: 'Easy',\n x: xMin,\n y: yMin,\n offsetX: 0,\n offsetY: 0\n });\n\n ctx.textAlign = 'left';\n ctx.textBaseline = 'bottom';\n // Draw the high/low performance signs.\n this.drawAt(ctx, {\n text: 'Performance',\n x: xMax,\n y: yMax,\n offsetX: 0,\n offsetY: -30\n });\n this.drawAt(ctx, {\n text: 'High',\n x: xMax,\n y: yMax,\n offsetX: 0,\n offsetY: -15\n });\n ctx.textBaseline = 'top';\n this.drawAt(ctx, {\n text: 'Low',\n x: xMax,\n y: yMin,\n offsetX: 0,\n offsetY: 0\n });\n\n ctx.restore();\n }\n });\n }", "title": "" }, { "docid": "2aa359550a1f6facd40ca393a33144a5", "score": "0.54626846", "text": "get axis() {\r\n if (this.i.l1 == null) {\r\n return null;\r\n }\r\n if (!this.i.l1.externalObject) {\r\n let e = IgxAxisComponent._createFromInternal(this.i.l1);\r\n if (e) {\r\n e._implementation = this.i.l1;\r\n }\r\n this.i.l1.externalObject = e;\r\n }\r\n return this.i.l1.externalObject;\r\n }", "title": "" }, { "docid": "1e49bc15729a650412137d051512f2c3", "score": "0.5438928", "text": "constructor(chartModel, containerDimensions, shouldShowXAxisLabels, shouldShowYAxisLabels, disableTransformations) {\n this._chartModel = chartModel;\n this._containerDimensions = containerDimensions;\n this._shouldShowXAxisLabels = shouldShowXAxisLabels;\n this._shouldShowYAxisLabels = shouldShowYAxisLabels;\n this._configOptions = configOptions(chartModel.getChartType(), chartModel);\n this._highchartConfig = {\n chart: {\n type: getHighchartChartType(chartModel.getChartType())\n },\n legend: {},\n navigator: {},\n plotOptions: {},\n rangeSelector: {},\n scrollbar: {},\n series: {},\n title: false,\n tooltip: {},\n xAxis: {},\n yAxis: {},\n shouldShowXAxisLabels: shouldShowXAxisLabels,\n shouldShowYAxisLabels: shouldShowYAxisLabels,\n dataLabelsEnabledByDefault: !!this._configOptions.dataLabelsEnabledByDefault,\n shouldRenderInStackedLabelFormat: this.shouldRenderInStackedLabelFormat()\n };\n this._disableTransformations = disableTransformations;\n }", "title": "" }, { "docid": "6c90cca7f2d25b7275c76cec50ac4e49", "score": "0.5410999", "text": "generateXAxis(xAxisData, ticks) {\r\n //declare variables\r\n var chart = this,\r\n xAxis,\r\n //Need to getXAxisScale each time so that axis updates on resize\r\n xAxisScale = jvCharts.getAxisScale('x', xAxisData, chart.config.container, chart._vars),\r\n containerHeight = chart.config.container.height,\r\n containerWidth = chart.config.container.width,\r\n xAxisClass = 'xAxisLabels editable editable-xAxis editable-text';\r\n\r\n //assign css class for edit mode\r\n //if the axis is numbers add editable-num\r\n if (xAxisData.dataType === 'NUMBER') {\r\n xAxisClass += ' editable-num';\r\n }\r\n\r\n //remove previous xAxis container if its there\r\n chart.svg.selectAll('.xAxisContainer').remove();\r\n\r\n //Save the axis scale to chart object\r\n chart.currentData.xAxisScale = xAxisScale;\r\n\r\n var tickSize = 0;\r\n if (chart.currentData.xAxisData.dataType === 'NUMBER') {\r\n tickSize = 5;\r\n }\r\n\r\n //create xAxis drawing function\r\n if (chart.config.type === 'singleaxis') {\r\n xAxis = d3.axisTop(xAxisScale)\r\n .tickSize(tickSize);\r\n } else {\r\n xAxis = d3.axisBottom(xAxisScale)\r\n .tickSize(tickSize);\r\n }\r\n\r\n if (ticks) {\r\n xAxis.ticks(ticks);\r\n }\r\n\r\n\r\n var axisHeight = containerHeight;\r\n if (chart.config.type === 'singleaxis') {//For any axes that are on top of the data\r\n axisHeight = 0;\r\n }\r\n\r\n var xContent = chart.svg.append('g')\r\n .attr('class', 'xAxisContainer')\r\n .attr('transform', 'translate(0,' + (axisHeight) + ')');\r\n\r\n var xAxisGroup = xContent.append('g')\r\n .attr('class', 'xAxis')\r\n .transition()\r\n .duration(0)\r\n .call(xAxis);\r\n\r\n var formatValueType = jvFormatValueType(xAxisData.values);\r\n\r\n //Styling the axis\r\n xAxisGroup.select('path')\r\n .attr('stroke', chart._vars.axisColor)\r\n .attr('stroke-width', chart._vars.strokeWidth);\r\n\r\n //Styling for ticks\r\n xAxisGroup.selectAll('line')\r\n .attr('stroke', chart._vars.axisColor)\r\n .attr('stroke-width', chart._vars.stroke);\r\n\r\n //Styling the labels for each piece of data\r\n xAxisGroup.selectAll('text')\r\n .attr('fill', chart._vars.fontColor)//Customize the color of axis labels\r\n .attr('class', xAxisClass)\r\n .style('text-anchor', 'middle')\r\n .attr('font-size', chart._vars.fontSize)\r\n .attr('transform', 'translate(0, 3)')\r\n .text(function (d) {\r\n if (xAxisData.dataType === 'NUMBER' || chart._vars.rotateAxis) {\r\n return jvFormatValue(d, formatValueType);\r\n }\r\n return d;\r\n });\r\n\r\n //Styling the label for the entire axis\r\n xContent.append('g')\r\n .attr('class', 'xLabel')\r\n .append('text')\r\n .attr('class', 'xLabel editable editable-text editable-content')\r\n .attr('text-anchor', 'middle')\r\n .attr('font-size', chart._vars.fontSize)\r\n .text(function () {\r\n if (xAxisData.dataType === 'DATE') {\r\n return '';\r\n }\r\n return xAxisData.label;\r\n })\r\n .attr('transform', 'translate(' + containerWidth / 2 + ', 33)');\r\n }", "title": "" }, { "docid": "d590a777e0aac73864e17fa0258dc624", "score": "0.53969103", "text": "function add_axes(xscale, yscale, x_label,y_label,stringticks , _types) {\n\t\t//xscale = d3.scale.linear().domain(xscale.domain()).range([this.px, this.w-this.px]);\n\t\t//yscale = d3.scale.linear().domain(yscale.domain()).range([this.h-this.py, this.py]);\n\t\tvar self = this;\n\t\tvar xticks;\n\t\tif(_types[x_label] === \"datetime\") {\n\t\t\tvar df = d3.time.format(\"%Y-%m-%d\");\n\t\t\txticks = xscale.ticks(d3.time.days,1);\n\t\t} else if(_types[x_label] === 'string') {\n\t\t\txticks = stringticks;\n\t\t} else {\n\t\t\txticks = xscale.ticks(10);\n\t\t}\n\t\tconsole.log(xticks);\n\t\tvar xrules = this.svg.append('g').selectAll('.xlabel')\n\t\t\t\t.data(xticks)\n\t\t\t.enter().append('g')\n\t\t\t\t.attr('class', 'xlabel')\n\t\t\t\t.attr('transform', function(d) {return 'translate('+xscale(d)+' 0)'});\n\t\tif(_types[x_label] === \"datetime\") {\n\t\t\txrules.append('text')\n\t\t\t\t\t.attr('y', this.h)\n\t\t\t\t\t.text(function(d) {return df(d);})\t\n\t\t} else {\n\t\t\txrules.append('text')\n\t\t\t\t\t.attr('y', this.h)\n\t\t\t\t\t.text(String)\t\n\t\t}\n\t\txrules.append('line')\n\t\t\t\t.attr('y1', this.h-this.py)\n\t\t\t\t.attr('y2', this.py)\n\t\t\t\t.attr('stroke', '#ccc');\n\n\t\tvar yrules = this.svg.append('g').selectAll('.ylabel')\n\t\t\t\t.data(yscale.ticks(6))\n\t\t\t.enter().append('g')\n\t\t\t\t.attr('class', 'ylabel')\n\t\t\t\t.attr('transform', function(d) {return 'translate(0 '+yscale(d)+')'})\n\t\tyrules.append('text')\n\t\t\t\t.attr('x', 0)\n\t\t\t\t.text(String);\n\t\tyrules.append('line')\n\t\t\t\t.attr('x1', this.px)\n\t\t\t\t.attr('x2', this.w-this.px)\n\t\t\t\t.attr('stroke', '#ccc');\t\t\n\t\t\n\n\t}", "title": "" }, { "docid": "26aca2929fe9568a3d572b0232ab0a03", "score": "0.53935593", "text": "function fixOnBandTicksCoords(axis,ticksCoords,alignWithLabel,clamp){\nvar ticksLen=ticksCoords.length;\n\nif(!axis.onBand||alignWithLabel||!ticksLen){\nreturn;\n}\n\nvar axisExtent=axis.getExtent();\nvar last;\nvar diffSize;\nif(ticksLen===1){\nticksCoords[0].coord=axisExtent[0];\nlast=ticksCoords[1]={coord:axisExtent[0]};\n}else\n{\nvar crossLen=ticksCoords[ticksLen-1].tickValue-ticksCoords[0].tickValue;\nvar shift=(ticksCoords[ticksLen-1].coord-ticksCoords[0].coord)/crossLen;\n\neach$1(ticksCoords,function(ticksItem){\nticksItem.coord-=shift/2;\n});\n\nvar dataExtent=axis.scale.getExtent();\ndiffSize=1+dataExtent[1]-ticksCoords[ticksLen-1].tickValue;\n\nlast={coord:ticksCoords[ticksLen-1].coord+shift*diffSize};\n\nticksCoords.push(last);\n}\n\nvar inverse=axisExtent[0]>axisExtent[1];\n\n// Handling clamp.\nif(littleThan(ticksCoords[0].coord,axisExtent[0])){\nclamp?ticksCoords[0].coord=axisExtent[0]:ticksCoords.shift();\n}\nif(clamp&&littleThan(axisExtent[0],ticksCoords[0].coord)){\nticksCoords.unshift({coord:axisExtent[0]});\n}\nif(littleThan(axisExtent[1],last.coord)){\nclamp?last.coord=axisExtent[1]:ticksCoords.pop();\n}\nif(clamp&&littleThan(last.coord,axisExtent[1])){\nticksCoords.push({coord:axisExtent[1]});\n}\n\nfunction littleThan(a,b){\n// Avoid rounding error cause calculated tick coord different with extent.\n// It may cause an extra unecessary tick added.\na=round$1(a);\nb=round$1(b);\nreturn inverse?a>b:a<b;\n}\n}", "title": "" }, { "docid": "47221bc5d7edeecda413ff64fa808c84", "score": "0.5382504", "text": "canUseAsXAxis(axis) {\r\n let iv = this.i.nk(axis);\r\n return (iv);\r\n }", "title": "" }, { "docid": "95d4546b9b08eb14f479cfd993974899", "score": "0.5381505", "text": "calculateParameters() {\n this.axisMinX = 0;\n this.axisMaxX = this.data.x.length - 1;\n if (this.properties && this.properties.x_axis) {\n if (this.properties.x_axis.min) { this.axisMinX = this.properties.x_axis.min; }\n if (this.properties.x_axis.max) { this.axisMaxX = this.properties.x_axis.max; }\n }\n this.axisMinY = 0;\n this.axisMaxY = this.calculateAxisMaxY();\n if (this.properties && this.properties.y_axis) {\n if (this.properties.y_axis.min) { this.axisMinY = this.properties.y_axis.min; }\n if (this.properties.y_axis.max) { this.axisMaxY = this.properties.y_axis.max; }\n }\n this.axisRangeY = this.axisMaxY - this.axisMinY;\n\n if (this.data.u) {\n var axisMaxU = this.calculateAxisMaxU();\n this.graphScaleU = axisMaxU != 0 ? this.axisMaxY / axisMaxU : 1;\n }\n\n var greatestRadius = 0;\n if (this.highLightEnabled) {\n var dataHighlightIndicatorRadius = (parseFloat(this.radiiDataHighlightIndicator) / 2) + parseFloat(this.widthsDataHighlightIndicator);\n var highlightIndicatorRadius = (parseFloat(this.radiiHighlightIndicator) / 2) + parseFloat(this.widthsHighlightIndicator);\n greatestRadius = Math.max(dataHighlightIndicatorRadius, highlightIndicatorRadius);\n }\n var greatestExtent = Math.max(parseFloat(this.widthsData) / 2, greatestRadius);\n\n this.bottomMargin = greatestExtent;\n this.graphStartY = greatestExtent;\n var maxLabelWidthX = 0;\n var maxLabelWidthY = 0;\n var maxLabelWidthU = 0;\n if (this.hideHorizontalAxis && this.hideVerticalAxes) {\n this.graphEndY = this.canvasHeight - this.bottomMargin;\n this.graphHeight = this.graphEndY - this.graphStartY;\n } else {\n this.backgroundContext.font = this.fontsAxesLabelsWeight + \" \" + this.fontsAxesLabelsSize + \"px \" + this.fontsAxesLabelsFamily;\n var labelHeightApproximation = this.backgroundContext.measureText(\"M\").width;\n\n if (!this.hideHorizontalAxis) {\n this.bottomMargin = Math.max(labelHeightApproximation * 3, greatestExtent);\n }\n if (!this.hideVerticalAxes) {\n this.bottomMargin = Math.max(labelHeightApproximation, this.bottomMargin);\n this.graphStartY = Math.max(labelHeightApproximation * this.calculateLabelHeightMultiplier(), this.graphStartY);\n }\n\n this.graphEndY = this.canvasHeight - this.bottomMargin;\n this.graphHeight = this.graphEndY - this.graphStartY;\n\n if (!this.hideHorizontalAxis) {\n maxLabelWidthX = this.caclulateMaxLabelWidthX();\n }\n if (!this.hideVerticalAxes) {\n var maxLabelsY = Math.round(this.graphHeight / (labelHeightApproximation * 4));\n var factors = this.grapheneHelper.calculateFactors(this.axisMaxY);\n\n var factorIndex = 0;\n var workingInterval = factors[factorIndex];\n var proposedLabelsY = this.axisRangeY / workingInterval;\n\n while (proposedLabelsY > maxLabelsY) {\n factorIndex++;\n workingInterval = factors[factorIndex];\n proposedLabelsY = this.axisRangeY / workingInterval;\n }\n\n this.labelIntervalY = workingInterval;\n\n for (var i = this.axisMinY; i <= this.axisMaxY; i += this.labelIntervalY) {\n var labelComponentsY = this.getLabelComponentsY(i);\n var labelWidthY = this.backgroundContext.measureText(this.grapheneHelper.applyAffix(labelComponentsY.value, this.getLabelPrefixY(), labelComponentsY.suffix)).width;\n if (labelWidthY > maxLabelWidthY) {\n maxLabelWidthY = labelWidthY;\n }\n\n if (this.data.u) {\n var labelComponentsU = this.getLabelComponentsU(i / this.graphScaleU);\n var labelWidthU = this.backgroundContext.measureText(this.grapheneHelper.applyAffix(labelComponentsU.value, this.getLabelPrefixU(), labelComponentsU.suffix)).width;\n if (labelWidthU > maxLabelWidthU) {\n maxLabelWidthU = labelWidthU;\n }\n }\n }\n }\n }\n\n var minMargin = Math.max(maxLabelWidthX / 1.5, greatestExtent);\n this.leftMargin = Math.max(maxLabelWidthY + (2 * this.fontsAxesLabelsSize), minMargin);\n this.rightMargin = Math.max(maxLabelWidthU + (2 * this.fontsAxesLabelsSize), minMargin);\n this.graphStartX = this.leftMargin;\n this.graphEndX = this.canvasWidth - this.rightMargin;\n this.graphWidth = this.graphEndX - this.graphStartX;\n this.graphScaleX = this.calculateGraphScaleX();\n this.graphScaleY = this.graphHeight / this.axisRangeY;\n }", "title": "" }, { "docid": "73525e445fc4f2bcba779d267eadf149", "score": "0.5380358", "text": "make_x_gridlines() { \n return d3.axisBottom(this.xScale);\n }", "title": "" }, { "docid": "fbed29c4d215c4817cd233a0e33c6b3d", "score": "0.53763205", "text": "axis(val) {\n this._axis = val;\n return this;\n }", "title": "" }, { "docid": "a0632d4b1d09dbd879da6434ad8aa681", "score": "0.53753674", "text": "defaultSettings() {\n this.calculateDomain();\n this.margin = {top: 20, right: 20, bottom: 40, left: 40};\n \n this.maxX = this._width-this.margin.right-this.margin.left;\n this.maxY = this._height-this.margin.top-this.margin.bottom;\n\n this.xScale = d3.scaleLinear()\n .range([0, this.maxX])\n .domain([0, this.maxX]);\n this.yScale = d3.scaleLinear()\n .range([this.maxY,0])\n .domain([0, this.maxY]);\n\n this.xAxis = d3.axisBottom()\n .scale(this.xScale);\n this.yAxis = d3.axisLeft()\n .scale(this.yScale);\n }", "title": "" }, { "docid": "3e8876d68ef4ec926dd7a68e55b7217f", "score": "0.5374548", "text": "get format() {\n return (\n scaleLinear()\n // Tick formatters don’t work well without a domain, so we define it. We don’t need a range because we never use the scale itself.\n // extent => return min and max simulteanously\n .domain(d3extent(this.props.data, (d) => d.base_salary))\n .tickFormat()\n );\n }", "title": "" }, { "docid": "6556cf88fbf055fe58de4bf8b83f954c", "score": "0.5374159", "text": "plotXAxis(){\n\t\t// remove previous axis components\n\t\td3.select('#geneExpressionGraph #bottom-axis').remove();\n\n\t\t// add the axis to the display\n\t\td3.select('#geneExpressionGraph g#graph')\n\t\t\t.append('g')\n\t\t\t.attr('id', 'bottom-axis')\n\t\t\t.attr('transform', 'translate('+this._margin.left+', '+(this._height-this._margin.bottom)+')')\n\t\t\t.call(this._xAxis);\n\n\t\t// assign an id to all text used for ticks in the axis \n\t\td3.selectAll('#geneExpressionGraph g#bottom-axis > g.tick')\n\t\t\t.attr('id', d => d);\n\n\t\t// change the text for the display value associated to it \n\t\tthis._xLabels.forEach((item,i) => {\n\t\t\td3.select('#geneExpressionGraph g.tick#'+item+' text')\n\t\t\t\t.text('')\n\t\t\t\t.selectAll('tspan')\n\t\t\t\t\t.data(this._displayTree.get(this._levels[this._xLevels[i]]).get(item).display)\n\t\t\t\t\t.join('tspan')\n\t\t\t\t\t\t.text(d => d)\n\t\t\t\t\t\t.classed('clear-link',true)\n\t\t\t\t\t\t.attr('dy', '1em')\n\t\t\t\t\t\t.attr('x', '0');\n\t\t},this);\n\n\t\t/* assign click function to axis labels if required */\n\t\tlet self = this;\n\t\td3.selectAll('#geneExpressionGraph g#bottom-axis g.tick')\n\t\t\t.on('click', (ev,d) => self.expandXLabels(d) )\n\t\t\t.on('contextmenu', (ev,d) => {\n\t\t\t\tev.preventDefault();\n\t\t\t\tself.collapseXLabels(d);\n\t\t\t})\n\t\t\t.append('svg:title')\n\t\t\t\t.text(d => {\n\t\t\t\t\tlet i = self._xLevels[self._xLabels.indexOf(d)];\n\t\t\t\t\tswitch(i){\n\t\t\t\t\tcase 0: \n\t\t\t\t\t\treturn 'Click to expand';\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\treturn 'Click to expand\\nRight-click to contract';\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\treturn 'Right-click to contract';\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t;\n\t\t\t\n\t}", "title": "" }, { "docid": "39d7d7e3325d7e74035bd9f7084e4e12", "score": "0.535363", "text": "function AxisOrientationAdaptor() {\n\tthis.plotOffset = 0.0;\n\tthis.plotScale = 0.0;\n\tthis.lengthLabel = null;\n\tthis.tickLabelAlignment = \"center\";\n}", "title": "" }, { "docid": "40ac1f78f27b3698dc77cb539d96666c", "score": "0.5351502", "text": "function setScale() {\r\n\t\t\tvar length, \r\n\t\t\t\ttype, \r\n\t\t\t\ti,\r\n\t\t\t\t//total,\r\n\t\t\t\toldMin = min,\r\n\t\t\t\toldMax = max,\r\n\t\t\t\tmaxZoom = options.maxZoom,\r\n\t\t\t\tzoomOffset;\r\n\t\t\t\t\r\n\t\t\t// get data extremes if needed\r\n\t\t\tgetSeriesExtremes();\r\n\t\t\t\r\n\t\t\t// initial min and max from the extreme data values\r\n\t\t\tmin = pick(userSetMin, options.min, dataMin);\r\n\t\t\tmax = pick(userSetMax, options.max, dataMax);\r\n\t\t\t\r\n\t\t\t// linked axis gets the extremes from the parent axis\r\n\t\t\tif (isLinked) {\r\n\t\t\t\tvar linkedParent = chart[isXAxis ? 'xAxis' : 'yAxis'][options.linkedTo],\r\n\t\t\t\t\tlinkedParentExtremes = linkedParent.getExtremes();\r\n\t\t\t\tmin = pick(linkedParentExtremes.min, linkedParentExtremes.dataMin);\r\n\t\t\t\tmax = pick(linkedParentExtremes.max, linkedParentExtremes.dataMax);\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// maxZoom exceeded, just center the selection\r\n\t\t\tif (max - min < maxZoom) { \r\n\t\t\t\tzoomOffset = (maxZoom - max + min) / 2;\r\n\t\t\t\t// if min and max options have been set, don't go beyond it\r\n\t\t\t\tmin = mathMax(min - zoomOffset, pick(options.min, min - zoomOffset));\r\n\t\t\t\tmax = mathMin(min + maxZoom, pick(options.max, min + maxZoom));\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t// pad the values to get clear of the chart's edges\r\n\t\t\tif (!categories && !usePercentage && !isLinked && defined(min) && defined(max)) {\r\n\t\t\t\tlength = (max - min) || 1;\r\n\t\t\t\tif (!defined(options.min) && !defined(userSetMin) && minPadding && (dataMin < 0 || !ignoreMinPadding)) { \r\n\t\t\t\t\tmin -= length * minPadding; \r\n\t\t\t\t}\r\n\t\t\t\tif (!defined(options.max) && !defined(userSetMax) && maxPadding && (dataMax > 0 || !ignoreMaxPadding)) { \r\n\t\t\t\t\tmax += length * maxPadding;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// tickInterval\r\n\t\t\tif (categories || min == max) {\r\n\t\t\t\ttickInterval = 1;\r\n\t\t\t} else {\r\n\t\t\t\ttickInterval = pick(\r\n\t\t\t\t\t\toptions.tickInterval,\r\n\t\t\t\t\t\t(max - min) * options.tickPixelInterval / axisLength\r\n\t\t\t\t\t);\r\n\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\tif (!isDatetimeAxis && !defined(options.tickInterval)) { // linear\r\n\t\t\t\ttickInterval = normalizeTickInterval(tickInterval);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// minorTickInterval\r\n\t\t\tminorTickInterval = options.minorTickInterval === 'auto' && tickInterval ?\r\n\t\t\t\t\ttickInterval / 5 : options.minorTickInterval;\r\n\t\t\t\t\t\r\n\t\t\t// get fixed positions based on tickInterval\r\n\t\t\tsetTickPositions();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t// the translation factor used in translate function\t\t\t\r\n\t\t\ttransA = axisLength / ((max - min) || 1);\r\n\t\t\t\r\n\t\t\t// record the greatest number of ticks for multi axis\r\n\t\t\tif (!maxTicks) { // first call, or maxTicks have been reset after a zoom operation\r\n\t\t\t\tmaxTicks = {\r\n\t\t\t\t\tx: 0,\r\n\t\t\t\t\ty: 0\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\tif (!isDatetimeAxis && tickPositions.length > maxTicks[xOrY]) {\r\n\t\t\t\tmaxTicks[xOrY] = tickPositions.length;\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t// reset stacks\r\n\t\t\tif (!isXAxis) {\r\n\t\t\t\tfor (type in stacks) {\r\n\t\t\t\t\tfor (i in stacks[type]) {\r\n\t\t\t\t\t\tstacks[type][i].cum = stacks[type][i].total;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// mark as dirty if it is not already set to dirty and extremes have changed\r\n\t\t\tif (!axis.isDirty) {\r\n\t\t\t\taxis.isDirty = (min != oldMin || max != oldMax);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}", "title": "" }, { "docid": "a94c5b3d3e764d5343c951bf79fc2462", "score": "0.53440636", "text": "function AbstractChartSeries() {\n}", "title": "" }, { "docid": "2c27c5d4c8e0872e9eaded687286172b", "score": "0.53409714", "text": "function axisBox() {\n return { x: { min: 0, max: 1 }, y: { min: 0, max: 1 } };\n}", "title": "" }, { "docid": "2369a791caa14689d34978ceeb53bb50", "score": "0.5329765", "text": "function ApexYAxis() { }", "title": "" }, { "docid": "2369a791caa14689d34978ceeb53bb50", "score": "0.5329765", "text": "function ApexYAxis() { }", "title": "" }, { "docid": "bb6d72392193e671873fc8e1eb4619e9", "score": "0.5326227", "text": "function generate_axis()\n{\n canvas\n .append(\"g\")\n .attr(\"id\",\"x-axis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(d3.axisBottom(xScale).ticks(5));\n\n\n canvas\n .append(\"g\")\n .attr(\"id\",\"y-axis\")\n .call(d3.axisLeft(yScale).ticks(15))\n .attr(\"transform\", \"translate(0,0)\");\n}", "title": "" }, { "docid": "086f8c81a01b9770ab102f1a69f0e29c", "score": "0.53248036", "text": "refreshYAxes() {\n this.yLeftAxis.tickFormat(this.yAxisTimeFormatter);\n this.yRightAxis.tickFormat(this.yAxisTimeFormatter);\n this.yLeftAxisG.call(this.yLeftAxis.scale(this.yScale));\n this.yRightAxisG.call(this.yRightAxis.scale(this.yScale));\n }", "title": "" }, { "docid": "418b01eca46298d963a16a71b6eed879", "score": "0.5316461", "text": "_makeup() {\n var c = this.canvas.container;\n c.selectAll(`.${defaultClasses.AXIS_Y} .tick text`)\n .attr(\"x\", 0)\n .attr(\"y\", 12)\n .first()\n .attr(\"y\", -10);\n\n c.selectAll(`.${defaultClasses.AXIS_Y} .tick`).first().classed(\"dark\", true);\n c.selectAll(`.${defaultClasses.AXIS_Y} .tick`).last().classed(\"dark\", true);\n\n if (this.axes.axis(\"y\").scale().domain()[0] < 0) {\n c.selectAll(`.${defaultClasses.GRID} line`).first().classed(\"dark\", true);\n } else {\n c.selectAll(`.${defaultClasses.GRID} line`).first().remove();\n }\n c.selectAll(`.${defaultClasses.GRID} line`).last().classed(\"dark\", true);\n }", "title": "" }, { "docid": "dc462433a0762588981e36d9d4bca225", "score": "0.5314268", "text": "function contourPlotAxisDescription(minTick, maxTick, delta) {\n this.minTick = minTick;\n this.maxTick = maxTick;\n this.delta = delta;\n}", "title": "" }, { "docid": "e9e3544485e242eb3693a28f5f87ee64", "score": "0.5314122", "text": "function AbstractChartPainter() {\n\n}", "title": "" }, { "docid": "5c8a3999edb6d53869bfb38cab7e27aa", "score": "0.5310013", "text": "addRangeModel() {\n var _this = this;\n _this.get('values').forEach(function(item) {\n _this.rangeBar.addRange(item.get('range').map(_this.rangeBar.abnormalise, _this.rangeBar), { model: item }, item.get('id'));\n });\n }", "title": "" }, { "docid": "9cc7a700f0a25833ce8117cba5e98639", "score": "0.5266967", "text": "function applyScaleRange() {\n\n // x-axis goes from 0 (left) to max (right)\n // y-axis goes from max (top) to 0 (bottom)\n var rangeBounds = (self.isHorizontal()) ? [0, self.bounds[0]] : [self.bounds[1], 0];\n\n if (self.scale.rangeRoundBands) {\n\n // ordinal, so use rangeRoundBands, passing the axis bounds and bar padding\n self.scale.rangeRoundBands(rangeBounds, self.barPadding());\n\n } else {\n\n // linear/date so use rangeBands, passing the axis bounds only\n self.scale.rangeRound(rangeBounds);\n\n }\n\n }", "title": "" }, { "docid": "2effe99809f2f59f1703136f2b4da971", "score": "0.5265631", "text": "function GantCommonAxis() {\n _classCallCheck(this, GantCommonAxis);\n\n var _this = _possibleConstructorReturn(this, _GanttAxis.call(this));\n\n _this.components = {};\n return _this;\n }", "title": "" }, { "docid": "4c82d578aaa99e51b6344452cda8be07", "score": "0.52601737", "text": "function setXAxis(data) {\n\t// var maxVal = Math.max.apply( Math, data );\n\tglobalChartPlotted.xAxis[0].setCategories(data);\n\t// console.log(globalChartPlotted);\n\t// globalChartPlotted.xAxis[0]['min'] = 0;\n\t// globalChartPlotted.xAxis[0]['max'] = maxVal;\n\t// globalChartPlotted.xAxis[0]['dataMin'] = 0;\n\t// globalChartPlotted.xAxis[0]['dataMax'] = maxVal;\n\t// globalChartPlotted.xAxis[0]['tickPositions'] = [0, 20,40,60,80,00,120,140,160,180];\t\n}", "title": "" }, { "docid": "14d5b46077a78471e3d9daec4326adff", "score": "0.52585214", "text": "function redrawAxis() {\n // Update the x-axis based on the updated xScale range\n this.select(\".x.axis\")\n .attr(\"transform\", function() {\n if(y.domain()[0] >= 0) {\n return \"translate(0, \" + y(y.domain()[0]) + \")\";\n } else if (y.domain()[0] < 0 && y.domain()[1] < 0) {\n return \"translate(0, \" + y(y.domain()[1]) + \")\";\n } else {\n return \"translate(0, \" + y(0) + \")\";\n }\n })\n .call(xAxis);\n\n // Update the y-axis based on the updated yScale range\n this.select(\".y.axis\")\n .attr(\"transform\", function() {\n if(x.domain()[0] >= 0) {\n return \"translate(\" + x(x.domain()[0]) + \", 0)\";\n } else if (x.domain()[0] < 0 && x.domain()[1] < 0) {\n return \"translate(\" + x(x.domain()[1]) + \", 0)\";\n } else {\n return \"translate(\" + x(0) + \", 0)\";\n }\n })\n .call(yAxis);\n \n var ticks = this.selectAll(\".x.axis > g.tick\");\n var lastTick = ticks[0][ticks[0].length - 1];\n d3.select(lastTick).select(\"text\").style(\"text-anchor\", \"end\");\n }", "title": "" }, { "docid": "fd642e773eca7e930e7da4ee87bdd0bc", "score": "0.52528477", "text": "function getScaleExtent(scale,model){\nvar scaleType=scale.type;\n\nvar min=model.getMin();\nvar max=model.getMax();\nvar originalExtent=scale.getExtent();\n\nvar axisDataLen;\nvar boundaryGap;\nvar span;\nif(scaleType==='ordinal'){\naxisDataLen=model.getCategories().length;\n}else\n{\nboundaryGap=model.get('boundaryGap');\nif(!isArray(boundaryGap)){\nboundaryGap=[boundaryGap||0,boundaryGap||0];\n}\nif(typeof boundaryGap[0]==='boolean'){\nif(__DEV__){\nconsole.warn('Boolean type for boundaryGap is only '+\n'allowed for ordinal axis. Please use string in '+\n'percentage instead, e.g., \"20%\". Currently, '+\n'boundaryGap is set to be 0.');\n}\nboundaryGap=[0,0];\n}\nboundaryGap[0]=parsePercent$1(boundaryGap[0],1);\nboundaryGap[1]=parsePercent$1(boundaryGap[1],1);\nspan=originalExtent[1]-originalExtent[0]||\nMath.abs(originalExtent[0]);\n}\n\n// Notice: When min/max is not set (that is, when there are null/undefined,\n// which is the most common case), these cases should be ensured:\n// (1) For 'ordinal', show all axis.data.\n// (2) For others:\n// + `boundaryGap` is applied (if min/max set, boundaryGap is\n// disabled).\n// + If `needCrossZero`, min/max should be zero, otherwise, min/max should\n// be the result that originalExtent enlarged by boundaryGap.\n// (3) If no data, it should be ensured that `scale.setBlank` is set.\n\n// FIXME\n// (1) When min/max is 'dataMin' or 'dataMax', should boundaryGap be able to used?\n// (2) When `needCrossZero` and all data is positive/negative, should it be ensured\n// that the results processed by boundaryGap are positive/negative?\n\nif(min==='dataMin'){\nmin=originalExtent[0];\n}else\nif(typeof min==='function'){\nmin=min({\nmin:originalExtent[0],\nmax:originalExtent[1]});\n\n}\n\nif(max==='dataMax'){\nmax=originalExtent[1];\n}else\nif(typeof max==='function'){\nmax=max({\nmin:originalExtent[0],\nmax:originalExtent[1]});\n\n}\n\nvar fixMin=min!=null;\nvar fixMax=max!=null;\n\nif(min==null){\nmin=scaleType==='ordinal'?\naxisDataLen?0:NaN:\noriginalExtent[0]-boundaryGap[0]*span;\n}\nif(max==null){\nmax=scaleType==='ordinal'?\naxisDataLen?axisDataLen-1:NaN:\noriginalExtent[1]+boundaryGap[1]*span;\n}\n\n(min==null||!isFinite(min))&&(min=NaN);\n(max==null||!isFinite(max))&&(max=NaN);\n\nscale.setBlank(\neqNaN(min)||\neqNaN(max)||\nscaleType==='ordinal'&&!scale.getOrdinalMeta().categories.length);\n\n\n// Evaluate if axis needs cross zero\nif(model.getNeedCrossZero()){\n// Axis is over zero and min is not set\nif(min>0&&max>0&&!fixMin){\nmin=0;\n}\n// Axis is under zero and max is not set\nif(min<0&&max<0&&!fixMax){\nmax=0;\n}\n}\n\n// If bars are placed on a base axis of type time or interval account for axis boundary overflow and current axis\n// is base axis\n// FIXME\n// (1) Consider support value axis, where below zero and axis `onZero` should be handled properly.\n// (2) Refactor the logic with `barGrid`. Is it not need to `makeBarWidthAndOffsetInfo` twice with different extent?\n// Should not depend on series type `bar`?\n// (3) Fix that might overlap when using dataZoom.\n// (4) Consider other chart types using `barGrid`?\n// See #6728, #4862, `test/bar-overflow-time-plot.html`\nvar ecModel=model.ecModel;\nif(ecModel&&scaleType==='time'/*|| scaleType === 'interval' */){\nvar barSeriesModels=prepareLayoutBarSeries('bar',ecModel);\nvar isBaseAxisAndHasBarSeries;\n\neach$1(barSeriesModels,function(seriesModel){\nisBaseAxisAndHasBarSeries|=seriesModel.getBaseAxis()===model.axis;\n});\n\nif(isBaseAxisAndHasBarSeries){\n// Calculate placement of bars on axis\nvar barWidthAndOffset=makeColumnLayout(barSeriesModels);\n\n// Adjust axis min and max to account for overflow\nvar adjustedScale=adjustScaleForOverflow(min,max,model,barWidthAndOffset);\nmin=adjustedScale.min;\nmax=adjustedScale.max;\n}\n}\n\nreturn{\nextent:[min,max],\n// \"fix\" means \"fixed\", the value should not be\n// changed in the subsequent steps.\nfixMin:fixMin,\nfixMax:fixMax};\n\n}", "title": "" }, { "docid": "22ffc5cff51937c595d141c2621f8d78", "score": "0.52442664", "text": "formatter() {\n return this.axis.defaultLabelFormatter.call(this);\n }", "title": "" }, { "docid": "3a00c0b7b880427b287ee15d5c49d37b", "score": "0.52366024", "text": "function calculateBase(groupItem){var extent,bandWidth,baseAxis=groupItem.axis,seriesModels=groupItem.seriesModels,seriesCount=seriesModels.length,boxWidthList=groupItem.boxWidthList=[],boxOffsetList=groupItem.boxOffsetList=[],boundList=[];if(\"category\"===baseAxis.type)bandWidth=baseAxis.getBandWidth();else{var maxDataCount=0;each(seriesModels,function(seriesModel){maxDataCount=Math.max(maxDataCount,seriesModel.getData().count())}),extent=baseAxis.getExtent(),Math.abs(extent[1]-extent[0])/maxDataCount}each(seriesModels,function(seriesModel){var boxWidthBound=seriesModel.get(\"boxWidth\");zrUtil.isArray(boxWidthBound)||(boxWidthBound=[boxWidthBound,boxWidthBound]),boundList.push([parsePercent(boxWidthBound[0],bandWidth)||0,parsePercent(boxWidthBound[1],bandWidth)||0])});var availableWidth=.8*bandWidth-2,boxGap=availableWidth/seriesCount*.3,boxWidth=(availableWidth-boxGap*(seriesCount-1))/seriesCount,base=boxWidth/2-availableWidth/2;each(seriesModels,function(seriesModel,idx){boxOffsetList.push(base),base+=boxGap+boxWidth,boxWidthList.push(Math.min(Math.max(boxWidth,boundList[idx][0]),boundList[idx][1]))})}", "title": "" }, { "docid": "fc5190e04104aed5fc2c134f0313ec2e", "score": "0.52338654", "text": "function axisBox() {\n\t return { x: { min: 0, max: 1 }, y: { min: 0, max: 1 } };\n\t}", "title": "" }, { "docid": "e43899774d70b31d3dfb7318c745a822", "score": "0.523287", "text": "initAxisX(){\n this.xAxisGroup = this.chartGroup.append(\"g\")\n .attr(\"transform\", `translate(0, ${this.chartHeight})`);\n }", "title": "" }, { "docid": "1017e7e4fe94527b24d62b54bd5fc152", "score": "0.5228808", "text": "initYAxis(){\n\t\tlet scale = d3.scaleLinear().domain([0, this._max])\n\t\t\t.range( [this._height-this._margin.bottom, this._margin.top] )\n\t\t\t.nice();\n\t\t/* create the corresponding axis */\n\t\treturn d3.axisLeft(scale);\n\t}", "title": "" }, { "docid": "a680e7d79c01d112d394db01604d6ec1", "score": "0.52255267", "text": "function Chart() {\r\n\r\n 'use strict';\r\n \r\n this.chartTitle = undefined; // Define título do Chart (default: sem nome).\r\n \r\n this.chartType = \"AreaChart\"; // Define o tipo do gráfico. Tipos:\r\n // \"LineChart\", \"AreaChart\", \"BarChart\", \"ColumnChart\", \"PieChart\" (default: \"AreaChart\").\r\n // O tipo \"PieChart\" só é possivel com o gráfico de eixo horizontal (X) como label\r\n \r\n this.curveType = false; // Define se a linha será curva ou reta. \r\n // Se esse atributo for true o atributo charType passa a ser \"LineChart\" (default: false).\r\n \r\n this.htmlElement = undefined; // Define qual elemento html o Chart será colocado.\r\n \r\n this.pieChartIs3D = false; // Define se o Chart do tipo \"PieChart\" é 3D (default: false).\r\n \r\n this.pointSize = undefined; // Define o tamanho dos pontos das linhas (default: sem ponto).\r\n \r\n this.hAxisFormat = undefined; // Define o formato dos valores do eixo horizontal (X).\r\n this.vAxisFormat = undefined; // Define o formato dos valores do eixo vertical (Y).\r\n // Formatos: \r\n // \"decimal\", \"scientific\", \"currency\", \"percent\", \"short\", \"long\", \"MMM d, y\", \"#,###%\"\r\n \r\n this.hValuePointFormat = undefined; // Define o formato dos valores dos pontos do eixo horizontal (X). Formatos:\r\n this.vValuePointFormat = undefined; // Define o formato dos valores dos pontos do eixo vertical (Y).\r\n // Formatos: \"0,0.00\", \"R$ 0,0.00\". \r\n // Está sendo usado a biblioteca Numeral.js. Documentação de outros formatos: http://numeraljs.com/\r\n \r\n this.hAxisIsLabel = false; // Define se o eixo horizontal (X) será um label ou númerico (padrão: false).\r\n \r\n this.hAxisTitle = undefined; // Define título do eixo horizontal (X) (default: sem nome).\r\n this.vAxisTitle = undefined; // Define título do eixo vertical (Y) (default: sem nome).\r\n \r\n this.hGridlinesCount = undefined; // Define quantidade de linhas horizontal (X) da grid (default: calculado automático).\r\n this.vGridlinesCount = undefined; // Define quantidade de linhas vertical (Y) da grid (default: calculado automático).\r\n \r\n this.hMaxValue = undefined; // Define o valor máximo do eixo horizontal (X) (default: calculado automático).\r\n this.hMinValue = undefined; // Define o valor mínimo do eixo horizontal (X) (default: calculado automático).\r\n \r\n this.vMaxValue = undefined; // Define o valor máximo do eixo vertical (Y) (default: calculado automático).\r\n this.vMinValue = undefined; // Define o valor mínimo do eixo vertical (Y) (default: calculado automático).\r\n \r\n this.height = undefined; // Define altura do Chart (default: estende no tamanho do elemento html).\r\n this.width = undefined; // Define largura do Chart (default: estende no tamanho do elemento html).\r\n \r\n this.lineList = []; // Lista de linhas do chart.\r\n \r\n this.addLine = function (line) {\r\n this.lineList.push(line);\r\n };\r\n \r\n this.getLineList = function () {\r\n return this.lineList;\r\n };\r\n \r\n this.labelList = []; // Lista de labes para Chart com eixo horizontal (X) com labels.\r\n \r\n this.addLabel = function (label) {\r\n this.labelList.push(label);\r\n };\r\n \r\n this.getLabelList = function () {\r\n return this.labelList;\r\n };\r\n}", "title": "" }, { "docid": "53bf1e95e69c3d53396e9ab6967b7aa8", "score": "0.52195674", "text": "getXAxisLabelAt(x, allXValuesOnLabels, options) {\n let xAxis = this.getXAxes()[0];\n let firstXAxisColumn = this.getXAxisColumns()[0];\n let useMeasureAsOrdinal = useMeasureOnXAxisAsOrdinal(this.getChartType());\n if (this.isXAxisMeasure()) {\n // for measure x-axis we pass on real x-values to highcharts\n // iff the column is sorted, we use index-in-array approach otherwise.\n // we want to, however, format the real value as number in both the cases\n if (!useMeasureAsOrdinal) {\n return this.getLabelForNumericAxis(x, xAxis.id, allXValuesOnLabels, { noShorten: !this.isRoundedNumbersEnabled() });\n }\n else {\n // highcharts can send an index value that is 1 more than\n // the number of values we have.\n // Note(sunny): this check is redundant after the fix for SCAL-4695\n if (!this._hasXAxisValuesAt(x)) {\n return '';\n }\n // mapping all labels on the x-axis for each label makes this\n // a quadratic cost call but it is okay because the number of labels\n // on the x-axis is never too high.\n let self = this, realXValues = allXValuesOnLabels && _.compact(allXValuesOnLabels.map(function (index) {\n if (!self._hasXAxisValuesAt(index)) {\n return null;\n }\n return self._getXAxisValuesAt(index)[0].value;\n }));\n return this.getLabelForNumericAxis(this._getXAxisValuesAt(x)[0].value, xAxis.id, realXValues, { noShorten: !this.isRoundedNumbersEnabled() });\n }\n }\n // on zooming in too much highcharts can try to generate intermediate points\n // for everything but ascending timeseries we are going to look up this value\n // in our array of raw values and don't allow generated intermediate values\n if (!_.isInteger(x) && !this.isTimeSeries()) {\n return '';\n }\n // highcharts doesn't like x-axis in descending order so we can't use raw timestamp values\n // for timeseries (so we use index-in-data-array approach).\n // However we still want to use formatting for descending timeseries\n // so we handle that case specially in the same code branch\n if (this.isTimeSeries()) {\n // NOTE(vibhor): If the data is not primarily sorted on the date column,\n // then we can't really show a bucketed timeseries axis.\n // This is because 2 labels such as \"Q2 1992\" and \"Q1 1993\" gives an impression\n // that the data point between the 2 labels fit in that timeframe.\n // However, if the data is sorted on some other key, then this is not necessarily true.\n let timestampValue, isXAxisOrdinalBased = this.isXAxisOrdinalBased();\n if (!isXAxisOrdinalBased) {\n timestampValue = x;\n }\n else {\n if (!this._hasXAxisValuesAt(x)) {\n return '';\n }\n timestampValue = this._getXAxisValuesAt(x)[0].value;\n }\n if (flags.getValue(flags.BLINK_FLAGS.enableChartConfigV2.name)) {\n let axis = this.getXAxes()[0];\n let format = this.getFormattingForAxis(axis.id);\n if (format) {\n let formattedValue = dateUtil_43(timestampValue, format);\n return formattedValue;\n }\n }\n return firstXAxisColumn.getDataFormatter()(timestampValue, options);\n }\n // TODO(vibhor): This function should look for any overlapping labels\n // and use a different format if possible.\n // Today, we simply use formattingConstants.MAX_LABEL_LENGTH to truncate.\n // The biggest date format should be under that limit.\n let xValues = this._getXAxisValuesAt(x);\n if (_.isUndefined(xValues)) {\n this._logger.everyN(logger_1.WARN, 10, 'invalid x-axis value', x);\n return '';\n }\n return formatCompositeAxisValue(this, xValues);\n }", "title": "" }, { "docid": "b772bffa3bdf41688be0919e75060256", "score": "0.5205315", "text": "function Axis(chart, options, type, position) {\r\n\t\tAxis.parent.constructor.call(this, \"Axis\", options, chart.theme);\r\n\r\n\t\tthis.chart = chart;\r\n\t\tthis.canvas = chart.canvas;\r\n\t\tthis.ctx = chart.ctx;\r\n\t\tthis.maxWidth = 0;\r\n\t\tthis.maxHeight = 0;\r\n\t\tthis.intervalStartPosition = 0;\r\n\t\tthis.labels = [];\r\n\t\tthis._labels = null;\r\n\r\n\t\t//Processed information about the data that gets plotted against this axis\r\n\t\tthis.dataInfo = {\r\n\t\t\tmin: Infinity,\r\n\t\t\tmax: -Infinity,\r\n\t\t\tviewPortMin: Infinity,\r\n\t\t\tviewPortMax: -Infinity,\r\n\t\t\tminDiff: Infinity // Used only in case of axisX\r\n\t\t};\r\n\r\n\t\tif (type === \"axisX\") {\r\n\t\t\tthis.sessionVariables = this.chart.sessionVariables[type];\r\n\r\n\t\t\tif (!this._options.interval)\r\n\t\t\t\tthis.intervalType = null;\r\n\t\t} else {\r\n\t\t\tif (position === \"left\" || position === \"top\")\r\n\t\t\t\tthis.sessionVariables = this.chart.sessionVariables[\"axisY\"];\r\n\t\t\telse {\r\n\t\t\t\tthis.sessionVariables = this.chart.sessionVariables[\"axisY2\"];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\r\n\t\tif (typeof (this._options.titleFontSize) === \"undefined\") {\r\n\r\n\t\t\tthis.titleFontSize = this.chart.getAutoFontSize(this.titleFontSize);\r\n\r\n\t\t\t//window.console.log(\"titleFontSize: \" + this.titleFontSize);\r\n\t\t}\r\n\r\n\t\tif (typeof (this._options.labelFontSize) === \"undefined\") {\r\n\r\n\t\t\tthis.labelFontSize = this.chart.getAutoFontSize(this.labelFontSize);\r\n\r\n\t\t\t//window.console.log(\"labelFontSize: \" + this.labelFontSize);\r\n\r\n\t\t}\r\n\r\n\t\t//Axis Type : axisX, axisY\r\n\t\tthis.type = type;\r\n\t\tif (!options || typeof (options.gridThickness) === \"undefined\")\r\n\t\t\tthis.gridThickness = type === \"axisX\" ? 0 : 1;\r\n\r\n\t\tthis._position = position;\r\n\r\n\t\tthis.lineCoordinates = { x1: null, y1: null, x2: null, y2: null, width: null };//{x1:, y1:, x2:, y2:, width:}\r\n\t\t//\r\n\t\t{\r\n\t\t\tthis.labelAngle = ((this.labelAngle % 360) + 360) % 360;\r\n\r\n\t\t\tif (this.labelAngle > 90 && this.labelAngle <= 270)\r\n\t\t\t\tthis.labelAngle -= 180;\r\n\t\t\telse if (this.labelAngle > 180 && this.labelAngle <= 270)\r\n\t\t\t\tthis.labelAngle -= 180\r\n\t\t\telse if (this.labelAngle > 270 && this.labelAngle <= 360)\r\n\t\t\t\tthis.labelAngle -= 360\r\n\t\t}\r\n\r\n\t\tthis._titleTextBlock = null;\r\n\t\tthis._absoluteMinimum = null;// Used to determine boundaries while Zooming/Panning\r\n\t\tthis._absoluteMaximum = null;// Used to determine boundaries while Zooming/Panning\r\n\r\n\t\tif (this.hasOptionChanged(\"minimum\"))\r\n\t\t\tthis.sessionVariables.internalMinimum = this.minimum;\r\n\r\n\t\tif (this.hasOptionChanged(\"maximum\"))\r\n\t\t\tthis.sessionVariables.internalMaximum = this.maximum;\r\n\r\n\t\tthis.trackChanges(\"minimum\");\r\n\t\tthis.trackChanges(\"maximum\");\r\n\t}", "title": "" }, { "docid": "ffd819b449d0869cd36f6a8d874556eb", "score": "0.5201343", "text": "function QuantitativeScale() {\n var _this = _super.call(this) || this;\n _this._tickGenerator = function (scale) { return scale.defaultTicks(); };\n _this._padProportion = 0.05;\n _this._snappingDomainEnabled = true;\n _this._paddingExceptionsProviders = new Utils.Set();\n return _this;\n }", "title": "" }, { "docid": "2beabef23e3f713ffc634a107eae4cf5", "score": "0.52012026", "text": "get valueAxis() {\n if (this.i.m6 == null) {\n return null;\n }\n if (!this.i.m6.externalObject) {\n let e = IgrNumericRadiusAxis._createFromInternal(this.i.m6);\n if (e) {\n e._implementation = this.i.m6;\n }\n this.i.m6.externalObject = e;\n }\n return this.i.m6.externalObject;\n }", "title": "" }, { "docid": "ae20739d06ddcf4095adea9556bb95e9", "score": "0.5195758", "text": "function generate_axis(canvas,x_ticks,y_ticks)\n{\n canvas\n .append(\"g\")\n .attr(\"id\",\"x-axis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(d3.axisBottom(xScale).ticks(x_ticks));\n\n\n canvas\n .append(\"g\")\n .attr(\"id\",\"y-axis\")\n .call(d3.axisLeft(yScale).ticks(y_ticks))\n .attr(\"transform\", \"translate(0,0)\");\n}", "title": "" }, { "docid": "22927301f13a3d99387f2fd66b87d61e", "score": "0.51902145", "text": "function resetAxis(axis, originAxis) {\n axis.min = originAxis.min;\n axis.max = originAxis.max;\n}", "title": "" }, { "docid": "1eed48b73316ff99f60d8a4e4a548ef4", "score": "0.51816684", "text": "_setAxes() {\n var canvas = this.canvas,\n xScales = d3.scale.ordinal()\n .rangeRoundBands([0, canvas.dimensions.width - this.tickSize - this.tickSpace], 0.05) // TODO: Parametrized\n .domain(this.xDomain),\n yScales = d3.scale.linear()\n .domain([0, 1])\n .range([this.canvas.dimensions.height, 0]);\n\n this.axes.axis(\"x\", d3.svg.axis()\n .scale(xScales)\n .tickSize(0));\n\n this.axes.axis(\"y\", d3.svg.axis()\n .scale(yScales)\n .tickSize(this.tickSize)\n .orient(\"left\"));\n }", "title": "" }, { "docid": "7babf8b1f4e2a8322ae3998a7d3e9fe4", "score": "0.5174705", "text": "function makeLabelsByCustomizedCategoryInterval(axis,categoryInterval,onlyTick){\nvar ordinalScale=axis.scale;\nvar labelFormatter=makeLabelFormatter(axis);\nvar result=[];\n\neach$1(ordinalScale.getTicks(),function(tickValue){\nvar rawLabel=ordinalScale.getLabel(tickValue);\nif(categoryInterval(tickValue,rawLabel)){\nresult.push(onlyTick?\ntickValue:\n{\nformattedLabel:labelFormatter(tickValue),\nrawLabel:rawLabel,\ntickValue:tickValue});\n\n\n}\n});\n\nreturn result;\n}", "title": "" }, { "docid": "ac95a27db68d57f25d8b0e619e8854e2", "score": "0.5170113", "text": "function graphFormat(viewModel, xAxis, yAxis, xAxisUnit, xAxisFormat) {\n viewModel.set('graphXAxisInterval', xAxis);\n viewModel.set('graphYAxisInterval', yAxis);\n viewModel.set('graphXAxisUnit', xAxisUnit);\n viewModel.set('graphFormat', xAxisFormat);\n}", "title": "" }, { "docid": "7b7641abefb73722fc3254a420369621", "score": "0.51663774", "text": "drawYAxes() {\n this.yLeftAxis = d3.axisLeft(this.yScale)\n .ticks(20)\n .tickFormat(this.yAxisTimeFormatter);\n\n this.yRightAxis = d3.axisRight(this.yScale)\n .ticks(20)\n .tickFormat(this.yAxisTimeFormatter);\n\n this.yScrollAxis = d3.axisRight(this.yScrollScale)\n .ticks(20)\n .tickFormat(this.yAxisTimeFormatter);\n\n this.yStopSelAxis = d3.axisRight(this.yStopSelScale)\n .tickValues(this.journeyPatternMix.referenceJP.distances)\n .tickFormat((_, index) => {\n // Truncate the tick label if longer than maxChars chars\n const maxChars = 25;\n const stop = this.journeyPatternMix.referenceJP.stops[index];\n let label = `${stop.code} ${stop.name}`;\n if (label.length > maxChars) label = `${label.substr(0, maxChars - 3)}...`;\n return label;\n });\n\n this.yLeftAxisG.call(this.yLeftAxis);\n this.yRightAxisG.call(this.yRightAxis);\n this.yScrollAxisG.call(this.yScrollAxis);\n this.yStopSelAxisG.call(this.yStopSelAxis);\n\n // Add circle to represent the stop in the stop selection brush\n this.yStopSelAxisG.selectAll('.tick').append('circle').attr('r', 3);\n }", "title": "" }, { "docid": "b001f4e5c277238fee89228fb3e37653", "score": "0.5165722", "text": "function getAxisTicks(data, config, type) {\n var ticks = [];\n if (data[0]) {\n angular.forEach(data[0].datapoints, function (datapoint) {\n ticks.push(datapoint.x);\n //ticks.push('test');\n });\n }\n return {\n type: 'category',\n //boundaryGap: type === 'bar',\n boundaryGap: type === 'bar' || _.includes(_.map(data, 'type'),'bar'),\n\n //splitNumber: 10,\n data: ticks\n };\n }", "title": "" }, { "docid": "cd3f5556991ed53b36fbd262a86fa826", "score": "0.51573235", "text": "function generateTicks(axis) {\n\n\t// estimate number of possible ticks between start and end\n\tvar noTicks = Math.floor((axis.max - axis.min) / viewComp) - 1;\n\tvar mag = Math.ceil(noTicks / 10);\n\n\tvar ticks = [],\n\t\tv = dateStandardizeFunc(new Date(axis.max));\n\n\tdo {\n\t\tswitch (viewComp) {\n\t\t\tcase viewsEnum.day:\n\t\t\t\tv.setDate(v.getDate() - mag);\n\t\t\t\tbreak;\n\t\t\tcase viewsEnum.month:\n\t\t\t\tv.setMonth(v.getMonth() - mag);\n\t\t\t\tbreak;\n\t\t\tcase viewsEnum.year:\n\t\t\t\tv.setFullYear(v.getFullYear() - mag);\n\t\t\t\tbreak;\n\t\t}\n\t\tticks.push(v.valueOf());\n\t} while (v.valueOf() > axis.min);\n\n\tticks.pop();\n\n\tif (ticks.length == 0) {\n\t\tticks.push(axis.min);\n\t\tticks.push(axis.max);\n\t}\n\n\treturn ticks;\n}", "title": "" }, { "docid": "a687cfe079cd66dfb9f7b92b0c53f6a5", "score": "0.51563275", "text": "createScales () {\n const c = this\n let yAxisCall\n let xAxisCall\n let x\n let y\n\n yAxisCall = d3.axisLeft()\n xAxisCall = d3.axisBottom()\n x = c.getElement('.titleX').text(c.tX)\n y = c.getElement('.titleY').text(c.tY)\n\n c.setScales('time')\n c.setDomains()\n\n // Update X axis\n c.tickNumber ? xAxisCall.scale(c.x).ticks(c.tickNumber) : xAxisCall.scale(c.x)\n c.xAxis.transition(c.t()).call(xAxisCall)\n\n // Update Y axis\n c.ySF ? yAxisCall.scale(c.y).tickFormat(c.formatValue(c.ySF)) : yAxisCall.scale(c.y)\n c.yAxis.transition(c.t()).call(yAxisCall)\n }", "title": "" }, { "docid": "d529db198bf3eb3af6c50e6bd0693a1a", "score": "0.51547104", "text": "function reset_axis() {\n svgContainer\n .transition().duration(500)\n .select(\".x.axis\")\n .call(xAxis);\n }", "title": "" }, { "docid": "d529db198bf3eb3af6c50e6bd0693a1a", "score": "0.51547104", "text": "function reset_axis() {\n svgContainer\n .transition().duration(500)\n .select(\".x.axis\")\n .call(xAxis);\n }", "title": "" }, { "docid": "94ac49934e8505b4d070b78212449481", "score": "0.51544887", "text": "canUseAsXAxis(axis) {\n let iv = this.i.ph(axis);\n return (iv);\n }", "title": "" }, { "docid": "d7b6602305d939648b4eca666906237f", "score": "0.51524436", "text": "redraw(data) {\n if(!data || !data.length) return;\n\n this.axisElement = this.axisElement || this.chart.getChart().append(\"g\")\n .attr(\"class\", `axis-${this.orientation} axis-${this.name}`)\n .attr(\"transform\", this.translation())\n ;\n if (this.label) {\n this.labelElement = this.labelElement || this.axisElement.append(\"text\").attr(\"class\", \"axis-label\").text(this.label);\n }\n\n let axis = this.getAxis();\n\n if (this.labelElement) {\n this.positionLabel(this.labelElement)\n }\n\n this.axisElement\n .attr(\"transform\", this.translation())\n .call(axis);\n\n if(this.tickFit === \"rotate\") {\n// var my = this;\n this.chart.chart.selectAll(`.axis-${this.name} text`)\n\n .attr(\"transform\", d => {\n console.log(\"Rotating\");\n return `translate(-10, ${this.chart.margin.bottom / 2 - 10})rotate(-30)`;\n //return `translate(${this.chart.innerChartHeight * -2}, ${this.chart.innerChartHeight})rotate(-45)`;\n })\n } else if (this.tickFit === \"stagger\") {\n\n var shortTickLength = 4;\n var longTickLength = 18;\n var tickFlag = false;\n setTimeout(function(){\n this.axisElement.selectAll(`.tick line`)\n .filter(function(d, i){\n\n return i % 2;\n })\n .attr(\"y2\", longTickLength)\n\n this.axisElement.selectAll('.tick text')\n .filter(function(d, i){\n return i % 2;\n })\n .attr(\"y\", function(){\n return longTickLength + 1;\n })\n }.bind(this), 100);\n \n }\n\n\n }", "title": "" }, { "docid": "d4ca7e27a442b64c69e01f645422ca8b", "score": "0.5151585", "text": "constructor (options) {\n options.resources = (options.resources || []).concat(...[\n { type: 'less', url: 'views/IntervalHistogramView/style.less' },\n { type: 'text', url: 'views/IntervalHistogramView/template.svg', name: 'template' },\n { type: 'placeholder', value: null, name: 'total' },\n ]);\n super(options);\n\n this.margin = {\n top: 20,\n right: 20,\n bottom: 100,\n left: 40\n };\n\n this.xScale = d3.scaleLinear(); // log scale in x-axis doesnt make sense for every type of dataset\n this.yScale = d3.scaleSymlog();\n this.binScale = d3.scaleLinear();\n this.binScale.domain([0, 1]);\n\n this.currentPrimitive = 'all_primitives';\n }", "title": "" }, { "docid": "52179c87d0c05f267212d02e4973ec9c", "score": "0.51433736", "text": "function make_x_gridlines() {return d3.axisBottom(xScale)}", "title": "" }, { "docid": "741249fc72e0b27de204c5aabe984e3c", "score": "0.51396084", "text": "function calculateBase(groupItem) {\n var extent;\n var baseAxis = groupItem.axis;\n var seriesModels = groupItem.seriesModels;\n var seriesCount = seriesModels.length;\n\n var boxWidthList = groupItem.boxWidthList = [];\n var boxOffsetList = groupItem.boxOffsetList = [];\n var boundList = [];\n\n var bandWidth;\n if (baseAxis.type === 'category') {\n bandWidth = baseAxis.getBandWidth();\n }\n else {\n var maxDataCount = 0;\n each$13(seriesModels, function (seriesModel) {\n maxDataCount = Math.max(maxDataCount, seriesModel.getData().count());\n });\n extent = baseAxis.getExtent(),\n Math.abs(extent[1] - extent[0]) / maxDataCount;\n }\n\n each$13(seriesModels, function (seriesModel) {\n var boxWidthBound = seriesModel.get('boxWidth');\n if (!isArray(boxWidthBound)) {\n boxWidthBound = [boxWidthBound, boxWidthBound];\n }\n boundList.push([\n parsePercent$1(boxWidthBound[0], bandWidth) || 0,\n parsePercent$1(boxWidthBound[1], bandWidth) || 0\n ]);\n });\n\n var availableWidth = bandWidth * 0.8 - 2;\n var boxGap = availableWidth / seriesCount * 0.3;\n var boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount;\n var base = boxWidth / 2 - availableWidth / 2;\n\n each$13(seriesModels, function (seriesModel, idx) {\n boxOffsetList.push(base);\n base += boxGap + boxWidth;\n\n boxWidthList.push(\n Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1])\n );\n });\n}", "title": "" }, { "docid": "741249fc72e0b27de204c5aabe984e3c", "score": "0.51396084", "text": "function calculateBase(groupItem) {\n var extent;\n var baseAxis = groupItem.axis;\n var seriesModels = groupItem.seriesModels;\n var seriesCount = seriesModels.length;\n\n var boxWidthList = groupItem.boxWidthList = [];\n var boxOffsetList = groupItem.boxOffsetList = [];\n var boundList = [];\n\n var bandWidth;\n if (baseAxis.type === 'category') {\n bandWidth = baseAxis.getBandWidth();\n }\n else {\n var maxDataCount = 0;\n each$13(seriesModels, function (seriesModel) {\n maxDataCount = Math.max(maxDataCount, seriesModel.getData().count());\n });\n extent = baseAxis.getExtent(),\n Math.abs(extent[1] - extent[0]) / maxDataCount;\n }\n\n each$13(seriesModels, function (seriesModel) {\n var boxWidthBound = seriesModel.get('boxWidth');\n if (!isArray(boxWidthBound)) {\n boxWidthBound = [boxWidthBound, boxWidthBound];\n }\n boundList.push([\n parsePercent$1(boxWidthBound[0], bandWidth) || 0,\n parsePercent$1(boxWidthBound[1], bandWidth) || 0\n ]);\n });\n\n var availableWidth = bandWidth * 0.8 - 2;\n var boxGap = availableWidth / seriesCount * 0.3;\n var boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount;\n var base = boxWidth / 2 - availableWidth / 2;\n\n each$13(seriesModels, function (seriesModel, idx) {\n boxOffsetList.push(base);\n base += boxGap + boxWidth;\n\n boxWidthList.push(\n Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1])\n );\n });\n}", "title": "" }, { "docid": "741249fc72e0b27de204c5aabe984e3c", "score": "0.51396084", "text": "function calculateBase(groupItem) {\n var extent;\n var baseAxis = groupItem.axis;\n var seriesModels = groupItem.seriesModels;\n var seriesCount = seriesModels.length;\n\n var boxWidthList = groupItem.boxWidthList = [];\n var boxOffsetList = groupItem.boxOffsetList = [];\n var boundList = [];\n\n var bandWidth;\n if (baseAxis.type === 'category') {\n bandWidth = baseAxis.getBandWidth();\n }\n else {\n var maxDataCount = 0;\n each$13(seriesModels, function (seriesModel) {\n maxDataCount = Math.max(maxDataCount, seriesModel.getData().count());\n });\n extent = baseAxis.getExtent(),\n Math.abs(extent[1] - extent[0]) / maxDataCount;\n }\n\n each$13(seriesModels, function (seriesModel) {\n var boxWidthBound = seriesModel.get('boxWidth');\n if (!isArray(boxWidthBound)) {\n boxWidthBound = [boxWidthBound, boxWidthBound];\n }\n boundList.push([\n parsePercent$1(boxWidthBound[0], bandWidth) || 0,\n parsePercent$1(boxWidthBound[1], bandWidth) || 0\n ]);\n });\n\n var availableWidth = bandWidth * 0.8 - 2;\n var boxGap = availableWidth / seriesCount * 0.3;\n var boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount;\n var base = boxWidth / 2 - availableWidth / 2;\n\n each$13(seriesModels, function (seriesModel, idx) {\n boxOffsetList.push(base);\n base += boxGap + boxWidth;\n\n boxWidthList.push(\n Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1])\n );\n });\n}", "title": "" }, { "docid": "9bf4d5ab89e442d3414aa021be2ecd9b", "score": "0.51309174", "text": "function resetAxis(axis, originAxis) {\n\t axis.min = originAxis.min;\n\t axis.max = originAxis.max;\n\t}", "title": "" }, { "docid": "6304f6787a59a0846e9083f94dc6c122", "score": "0.5130752", "text": "function _setAxisScale2() {\n var iapi = this,\n config = iapi.config,\n xAxis = iapi.getChildren('xAxis')[0],\n catCount = xAxis.getTicksLen(),\n jsonData = iapi.getFromEnv('dataSource'),\n chartAttr = jsonData.chart,\n chartWidth = config.width,\n xAxisMin,\n xAxisMax,\n minVisiblePlots = 2,\n // at the least a scroll chart must show 2 plots\n numOfColumnSeries = 0,\n totalNumPoint,\n visibleRange,\n scrollToEnd = config.scrollToEnd,\n\n // number of columns to be drawn.\n numVisiblePlot = (0, _lib.pluckNumber)(chartAttr.numvisibleplot, mathFloor(chartWidth / iapi.avgScrollPointWidth));\n\n iapi.iterateComponents(function (child) {\n if (child.getType && child.getType() === 'dataset') {\n if (child.getName && child.getName() === 'column') {\n !child.getState('removed') && numOfColumnSeries++;\n }\n }\n });\n\n if (iapi.config.isstacked) {\n numOfColumnSeries = 1;\n }\n\n numOfColumnSeries = numOfColumnSeries || 1;\n\n totalNumPoint = catCount * numOfColumnSeries;\n\n if (xAxis.tempAxis) {\n xAxisMin = xAxis.tempAxis.visibleRange.min;\n xAxisMax = xAxis.tempAxis.visibleRange.max;\n } else {\n var _xAxis$getVisibleConf = xAxis.getVisibleConfig();\n\n xAxisMax = _xAxis$getVisibleConf.maxValue;\n xAxisMin = _xAxis$getVisibleConf.minValue;\n }\n\n if (numVisiblePlot >= minVisiblePlots && numVisiblePlot < totalNumPoint) {\n visibleRange = numVisiblePlot / numOfColumnSeries;\n xAxis.setScrollType('always');\n if (scrollToEnd) {\n xAxisMin = xAxisMax - visibleRange;\n } else {\n xAxisMax = xAxisMin + visibleRange;\n }\n\n xAxis.setVisibleConfig(xAxisMin, xAxisMax);\n } else {\n xAxis.setScrollType('none');\n }\n}", "title": "" } ]
da00dfd7edf010ad3bed9e4d0113f99e
Scale for indirect lighting.
[ { "docid": "e526c857530b2faaefc1f252042b165d", "score": "0.6492916", "text": "static set indirectOutputScale(value) {}", "title": "" } ]
[ { "docid": "27793cfbef77398e86fdb206770f3e95", "score": "0.72710675", "text": "function setScale()\n{\n\tif(electrons < 10)\n\t{\n\t \trelScal = 0.1;\n\t}\n\telse if(electrons > 10 && electrons < 30)\n\t{\n\t\trelScal = 0.3;\n\t}\n\telse if(electrons > 30 && electrons < 50)\n\t{\n\t\trelScal = 0.5;\n\t}\n\telse if(electrons > 50 && electrons < 70)\n\t{\n\t\trelScal = 0.7;\n\t}\n\telse if(electrons > 70 && electrons < 90)\n\t{\n\t\trelScal = 0.8;\n\t}\n\telse if(electrons > 90 && electrons < 110)\n\t{\n\t\trelScal = 0.9;\n\t}\n\telse if(electrons > 110)\n\t{\n\t\trelScal = 1.0;\n\t}\n\t\n\tMyCamera.orthographicSize -= relScal;\n\n}", "title": "" }, { "docid": "6f1f14159ddea029aa4965f954b09bf8", "score": "0.68560565", "text": "function changeScale() {\r\nclock.value += 0.01;\r\nscale.value = speed.value * clock.value * 100.0 % 8.0;\r\nremoteMaterial.needsUpdate = true; // Tells three.js that some uniforms might have changed\r\nracoonMaterial.needsUpdate = true; // Tells three.js that some uniforms might have changed\r\n\r\n}", "title": "" }, { "docid": "51c4a5284a891e48954a6708430cb1ac", "score": "0.6770231", "text": "scale(scale){}", "title": "" }, { "docid": "295d7a65b34708746b99230b1252b290", "score": "0.67697126", "text": "setBaseScale(val) {\n if (this.options.perspective) {\n this.material.uniforms.rendererScale.value = val;\n }\n }", "title": "" }, { "docid": "feb8b0e86d94caf20521d5ae8ffff888", "score": "0.67595136", "text": "function setScale() {\n\t\t$target.css({\n\t\t\t'transform': 'scale(' + factor + ')'\n\t\t});\n\t}", "title": "" }, { "docid": "fc3a6b0e9d3476c1ff0197e91f769530", "score": "0.6752984", "text": "scale() {\n this.p.scale(this._scaleFactor);\n }", "title": "" }, { "docid": "5afd61534b6fa91013ebdac8680ce70d", "score": "0.66775554", "text": "scale(factor) {\n\t\t}", "title": "" }, { "docid": "95c4f5190613c804afe0fcc7ff9adc48", "score": "0.65871483", "text": "updateScale () {\n let newScale = this.scale\n if (this.cursor.up.isDown) {\n newScale += 0.01\n }\n\n if (this.cursor.down.isDown) {\n newScale -= 0.01\n }\n\n let cameraFocusX = this.roadMap.width / 2\n let cameraFocusY = this.roadMap.height / 2\n\n if (newScale !== this.scale) {\n // Don't zoom further than 0.7\n if (newScale < 0.6) {\n newScale = 0.6\n }\n this.scale = newScale\n this.game.world.scale.setTo(newScale)\n this.camera.focusOnXY(cameraFocusX * this.scale, cameraFocusY * this.scale)\n }\n }", "title": "" }, { "docid": "b849bb6687b4ba66bb862bd088173f7a", "score": "0.63835156", "text": "set Scale(value) {}", "title": "" }, { "docid": "cf92b70d0fa2223b3e4b781c25ef3c1d", "score": "0.6340018", "text": "updateScale() {\n this.setScaleMagnitude( this.numberPiece.scaleProperty.value );\n }", "title": "" }, { "docid": "18ae5c98fbc67015f82b80f4619cb568", "score": "0.63175803", "text": "setScale(scale) {\n this.scale = new THREE.Vector3(scale, scale, scale);\n this.updateScales();\n }", "title": "" }, { "docid": "ccdb6903ecd71631ca3bdfd57a779185", "score": "0.6287918", "text": "makeScale(_scale){\r\n Matter.Body.scale(this.bod, _scale, _scale);\r\n this.dia *= _scale;\r\n }", "title": "" }, { "docid": "7032b4b531d1b7080e1a5554f0a53a7d", "score": "0.62832445", "text": "scale(scale) {\n this._height *= scale;\n this._width += scale;\n }", "title": "" }, { "docid": "44d48f5d09c0708220a6ba70a9c48f5f", "score": "0.6263954", "text": "scaleInPlace(scale) { this.x *= scale; this.y *= scale; this.z *= scale; }", "title": "" }, { "docid": "44d48f5d09c0708220a6ba70a9c48f5f", "score": "0.6263954", "text": "scaleInPlace(scale) { this.x *= scale; this.y *= scale; this.z *= scale; }", "title": "" }, { "docid": "1ce7db761151f2240bda14c342f7fc35", "score": "0.6257333", "text": "function setScale () {\n\tscale = window.innerWidth / Match3.REAL_WIDTH;\n\n\t//make sure it's not bigger than the height\n\tif (scale * Match3.REAL_HEIGHT > window.innerHeight) {\n\t\tscale = window.innerHeight / Match3.REAL_HEIGHT;\n\t}\n\n\tvar stageStyle = stage.canvas.style;\n\tstageStyle.transformOrigin = stageStyle.webkitTransformOrigin = stageStyle.mozTransformOrigin = \"0 0\";\n\tstageStyle.transform = stageStyle.webkitTransform = stageStyle.mozTransform = \"scale(\"+scale+\")\";\n}", "title": "" }, { "docid": "87f77a4656053f19f2492c18f2ef88bd", "score": "0.6257247", "text": "set oldScale(scale) {\n this.body.oldScale = scale;\n }", "title": "" }, { "docid": "0301b69e242a8c78314cc4cb25007582", "score": "0.6251393", "text": "rescale() {\n if (this.scale < 1.5 && this.scaleUp == true) {\n this.scale += 0.01;\n }\n else {\n this.scale -= 0.01;\n }\n if (this.scale >= 1.5) {\n this.scaleUp = false;\n }\n if (this.scale <= 1) {\n this.scaleUp = true;\n }\n }", "title": "" }, { "docid": "9761caa4a00a391ba02493ce359e2c63", "score": "0.62480694", "text": "onScaleFactorChanged(v) {\r\n\t\tthis.testShaders[this.selectedExampleShader].setUniformsValues({ normScale: this.scaleFactor });\r\n\t}", "title": "" }, { "docid": "013c1db0acfca21c0f746b58c2257658", "score": "0.6202632", "text": "function gScale(sx,sy,sz) {\n modelMatrix = mult(modelMatrix,scale(sx,sy,sz)) ;\n}", "title": "" }, { "docid": "b478ca166b2eadd5142dbcb1fbb78cb3", "score": "0.6196645", "text": "increaseScale() {\n\t\tconst scale = this.props.scale >= 3 ? 1 : this.props.scale + 1;\n\n\t\tthis.props.increaseScale( scale );\n\t}", "title": "" }, { "docid": "1008f3dea7d94f04c96e9951fdf6f9e5", "score": "0.6188619", "text": "get Scale() {}", "title": "" }, { "docid": "e7f510c2dbeb54a52cb875b632f1082b", "score": "0.6172211", "text": "scale() {\n const offset = this.bb.__offset(this.bb_pos, 6);\n return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;\n }", "title": "" }, { "docid": "b4ff2ffcc4402c8c340c6dac5f7ac6fe", "score": "0.61705863", "text": "function zoom(amount) {\n var pt = isMobile() ? new Vector2(background.rect.width / 2, background.rect.height / 2) : ctx.transformedPoint(lastMousePosition.x, lastMousePosition.y);\n var factor = Math.pow(scaleFactor, amount);\n currentScale *= factor;\n if (currentScale <= maxScale && currentScale >= minScale) {\n ctx.translate(pt.x, pt.y);\n ctx.scale(factor, factor);\n ctx.translate(-pt.x, -pt.y);\n return;\n }\n currentScale /= factor;\n }", "title": "" }, { "docid": "b3682184cb7f02c9cd9ceb32e707a0e1", "score": "0.61445636", "text": "scale(delta) {\n this.x *= delta;\n this.y *= delta;\n this.z *= delta;\n }", "title": "" }, { "docid": "8c4f2a980d4d1d932673539eb12989ce", "score": "0.6133389", "text": "function getScale() {\n return point(viewport.X / baseSize.X, viewport.Y / baseSize.Y);\n}", "title": "" }, { "docid": "4d2cb274bcc89605e434dbca2d80fb1f", "score": "0.60809916", "text": "function scale () {\n var multiplier = Number(document.getElementById('scale-multiplier').value) || 2;\n reset()\n drawsBresenhamsLine(x0 * multiplier, y0 * multiplier, x1 * multiplier, y1 * multiplier)\n drawsBresenhamsLine(x1 * multiplier, y1 * multiplier, x2 * multiplier, y2 * multiplier)\n drawsBresenhamsLine(x2 * multiplier, y2 * multiplier, x0 * multiplier, y0 * multiplier)\n}", "title": "" }, { "docid": "ef61b20c39f75854d8d9680b02508e7f", "score": "0.60777354", "text": "linScale(knobPosition, amp){\n\t\treturn this.scaleRound(amp*(knobPosition + 150)/300, amp);\n\t}", "title": "" }, { "docid": "260146cf4a5ee9ae45f29c3e0c82a598", "score": "0.6070411", "text": "get scale() {\n const matrix = this.transformMatrix;\n return [matrix[0][0], matrix[1][1]];\n }", "title": "" }, { "docid": "4c666b8d2f622c96f6564f23b1b513b0", "score": "0.6064089", "text": "function setUpNewScale(){\n\n var values = $scope.data.wellValues.map(function(well) {\n return well.value;\n });\n\n var scale = v.colorScale({\n data: values,\n colorOne: $scope.coloring.colorOption.colorOne,\n colorTwo: $scope.coloring.colorOption.colorTwo\n });\n\n $scope.coloring.colorScale = scale.scale;\n $scope.coloring.min = scale.min;\n $scope.coloring.max = scale.max;\n }", "title": "" }, { "docid": "4d7dd81ff1015253fe5789837b837a53", "score": "0.6058938", "text": "get scaled() { return this._scaled; }", "title": "" }, { "docid": "4d7dd81ff1015253fe5789837b837a53", "score": "0.6058938", "text": "get scaled() { return this._scaled; }", "title": "" }, { "docid": "7045d24091bfffc54af199ecfe622532", "score": "0.6035125", "text": "get scale() {\n const matrix = this.transformMatrix;\n return [matrix[0][0], matrix[1][1]];\n }", "title": "" }, { "docid": "bf9f0c2faa819de3df46630ce0e6cad3", "score": "0.60208243", "text": "static get indirectOutputScale() {}", "title": "" }, { "docid": "d8008c9c69eaa006e5cc3a061e3b120f", "score": "0.6013157", "text": "setScale(newScale) {\n this.iconPath.scale(newScale / this.scale, this.iconPath.position);\n this.applyIcon();\n this.iconShadow.scale(newScale / this.scale);\n this.scale = newScale;\n }", "title": "" }, { "docid": "ac719a1f967b7eb0ed3755d829f8cbff", "score": "0.6012855", "text": "scaleAboutCenterInPlace(scaleFactor) {\n if (!this.isNull) {\n scaleFactor = Math.abs(scaleFactor);\n // do the scalar stuff to avoid making a temporary object ....\n const xMid = 0.5 * (this.low + this.high);\n this.high = Geometry_1.Geometry.interpolate(xMid, scaleFactor, this.high);\n this.low = Geometry_1.Geometry.interpolate(xMid, scaleFactor, this.low);\n }\n }", "title": "" }, { "docid": "a288a25e63cf0882dd345b33dcceeeb6", "score": "0.6010104", "text": "scaleX(_by) {\n let vector = FudgeCore.Recycler.borrow(FudgeCore.Vector2);\n vector.set(_by, 1);\n this.scale(vector);\n }", "title": "" }, { "docid": "04c64ca9b52c842c24aed9aaa6cfaa5c", "score": "0.60042846", "text": "applyScale(){\n \n // For use with main body and pods.\n let goldenRatio = 0.618;\n \n this.hopForce = this.scale*22;\n \n // Main body.\n this.width = this.dm*this.scale;\n this.height = this.dm*this.scale*goldenRatio;\n \n // Eye dimensions.\n this.eyePos = this.scale * (this.radius/2);\n this.eyeSizeX = this.scale * ((this.radius)-2) * this.eyeSize;\n this.eyeSizeY = this.eyeSizeX;\n this.pupSizeX = this.eyeSizeX * this.pupilSize;\n \n // Pod dimensions.\n this.podSize = (this.scale * this.dm)/5;\n }", "title": "" }, { "docid": "e03b8c2f8fc475a3a31469f3c19d36cd", "score": "0.5999135", "text": "function setScale() {\n var iconCenterAdjust = iconWidth / 2;\n for ( var i = 0; i < totalIcons; i++ ) {\n var rect = iconContainers[ i ].getBoundingClientRect();\n\n var xDiff = Math.abs( viewPortCenterX - ( rect.left + iconCenterAdjust ) ) / viewportWidth;\n var yDiff = Math.abs( viewPortCenterY - ( rect.top + iconCenterAdjust ) ) / viewportHeight;\n\n var scale = Math.max( 1 - ( ( xDiff + yDiff ) ), 0.1 );\n\n $( icons[ i ] ).css( {\n transform: 'scale( ' + scale + ' ) translate3d( 0, 0, 0 )'\n } );\n }\n\n }", "title": "" }, { "docid": "6a344ff0949ebaf2a1d100783f98989a", "score": "0.59196895", "text": "function setZoomProperty() {\n\tlet el = getShadowRoot().host || document.documentElement;\n\tel.style.setProperty('--cs-zoom', window.devicePixelRatio);\n\tel.style.setProperty('--cs-scale', 'calc( 1 / var(--cs-zoom,1) * var(--cs-custom-scale,1))');\n}", "title": "" }, { "docid": "f51f84e76f96316c301bc65b87637eac", "score": "0.59165496", "text": "function scale(s) {\r\n curLayer.resize( s, s, AnchorPosition.MIDDLECENTER );\r\n}", "title": "" }, { "docid": "c4c99f84f8302f38af7c12bf208ec66f", "score": "0.59070283", "text": "function scale(temperature) {\n return (temperature - LOW) / (HIGH - LOW);\n}", "title": "" }, { "docid": "c87f15de6e84480d9385a8226ac2ad4e", "score": "0.5906292", "text": "function paper_scale(amount, x, y) {\n var scale = V(paper.viewport).scale().sx;\n var newScale = scale*amount;\n paper.scale(newScale, newScale);\n\n var ox = paper.options.origin.x;\n var oy = paper.options.origin.y;\n var dx = (newScale - scale)/scale * (x - ox);\n var dy = (newScale - scale)/scale * (y - oy);\n paper.setOrigin(ox - dx, oy - dy);\n}", "title": "" }, { "docid": "c33b892ecad45a2e58fbb6831ae73eb7", "score": "0.5896179", "text": "getScale() {\n return new Vector(this.radiusX, this.radiusY);\n }", "title": "" }, { "docid": "2fe2865ffed3462727b707dd93e6fffb", "score": "0.58751965", "text": "scale(val) {\n this._scale = val;\n return this;\n }", "title": "" }, { "docid": "f6578b3d6a1875569a3636c4f4d491cb", "score": "0.586753", "text": "function updatezoomScale(){\r\n\t\tif(animatingScale == true){\r\n\t\t\tif(zoomScale > targetzoomScale){\r\n\t\t\t\tzoomScale = zoomScale - 0.02;\t\t\t\t\r\n\t\t\t\tif( zoomScale - targetzoomScale < 0.03){\r\n\t\t\t\t\tanimatingScale = false;\r\n\t\t\t\t\tzoomScale = targetzoomScale;\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if ( zoomScale < targetzoomScale)\r\n\t\t\t{\r\n\t\t\t\tzoomScale = zoomScale + 0.02;\t\t\t\t\r\n\t\t\t\tif(targetzoomScale- zoomScale < 0.03){\r\n\t\t\t\t\tanimatingScale = false;\r\n\t\t\t\t\tzoomScale = targetzoomScale;\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "474d7011d65ce57ef6c9b3877232707e", "score": "0.5859595", "text": "function updateScale() {\n // set the outer container to the size the user specified\n circle.css({\n width: (100 * getDiameterRatio()) + 'px',\n height: (100 * getDiameterRatio()) + 'px'\n });\n // the internal element is still 100px, so we have to scale it down to match the size\n circle.children().eq(0).css(toVendorCSS({\n transform : $mdUtil.supplant('translate(-50%, -50%) scale( {0} )',[getDiameterRatio()])\n }));\n }", "title": "" }, { "docid": "474d7011d65ce57ef6c9b3877232707e", "score": "0.5859595", "text": "function updateScale() {\n // set the outer container to the size the user specified\n circle.css({\n width: (100 * getDiameterRatio()) + 'px',\n height: (100 * getDiameterRatio()) + 'px'\n });\n // the internal element is still 100px, so we have to scale it down to match the size\n circle.children().eq(0).css(toVendorCSS({\n transform : $mdUtil.supplant('translate(-50%, -50%) scale( {0} )',[getDiameterRatio()])\n }));\n }", "title": "" }, { "docid": "da9a932e716db3ff4796c9b9fb82c1bc", "score": "0.58177555", "text": "get scale() {\n return this.scaleX\n }", "title": "" }, { "docid": "c1c2d9a0a7fc9ce4740980b9b1b73126", "score": "0.5817169", "text": "get shininess() { return this._lightingSurface.getTexture(1); }", "title": "" }, { "docid": "5750cef7796c1879f99d9087f4fb3017", "score": "0.58069855", "text": "getAdjustedScale() {\r\n const { scale } = this.props;\r\n if (scale.bandwidth) {\r\n let offset = scale.bandwidth() / 2;\r\n if (scale.round()) {\r\n offset = Math.round(offset);\r\n }\r\n return d => +scale(d) + offset;\r\n }\r\n else {\r\n return d => +scale(d);\r\n }\r\n }", "title": "" }, { "docid": "1ec9821da20895ad3ae1b29e68a54663", "score": "0.58050865", "text": "function zoom(event) {\n event.preventDefault();\n\n scale += event.deltaY * -0.01;\n scale = Math.min(Math.max(.125, scale), 4);\n busImg[1].style.transform = `scale(${scale})`;\n}", "title": "" }, { "docid": "001c8bc9a4a473253e8a8eb149af00b8", "score": "0.5804319", "text": "get scale() {\n\t return this._scale;\n\t }", "title": "" }, { "docid": "cf1689afb84489a409f5fad707f8300f", "score": "0.5801212", "text": "function scale(v)\n{\n isGlMatNew = true;\n glMat[0] *= v[0];\n glMat[1] *= v[0];\n glMat[2] *= v[0];\n\n glMat[4] *= v[1];\n glMat[5] *= v[1];\n glMat[6] *= v[1];\n\n glMat[8] *= v[2];\n glMat[9] *= v[2];\n glMat[10] *= v[2];\n}", "title": "" }, { "docid": "fb9e198408247eab97a1174a82572889", "score": "0.5799348", "text": "scaleAboutCenterInPlace(scaleFactor) {\n if (!this.isNull) {\n scaleFactor = Math.abs(scaleFactor);\n // do the scalar stuff to avoid making a temporary object ....\n const xMid = 0.5 * (this.low.x + this.high.x);\n const yMid = 0.5 * (this.low.y + this.high.y);\n this.high.x = Geometry_1.Geometry.interpolate(xMid, scaleFactor, this.high.x);\n this.high.y = Geometry_1.Geometry.interpolate(yMid, scaleFactor, this.high.y);\n this.low.x = Geometry_1.Geometry.interpolate(xMid, scaleFactor, this.low.x);\n this.low.y = Geometry_1.Geometry.interpolate(yMid, scaleFactor, this.low.y);\n }\n }", "title": "" }, { "docid": "401809e8384f89aeb989e8be57fcde4f", "score": "0.57952785", "text": "function Start () {\n originalIntensity = GetComponent(Light).intensity;\n}", "title": "" }, { "docid": "950d5c210277f11a7c6292187150067c", "score": "0.5793006", "text": "getFractionToDistanceScale() {\n const radius = this.circularRadius();\n if (radius !== undefined)\n return Math.abs(radius * this._sweep.sweepRadians);\n return undefined;\n }", "title": "" }, { "docid": "f9c5125cff09fc6777b8201e98880fd5", "score": "0.57916814", "text": "function linearScale(factor, minInput, maxInput, minOutput, maxOutput) {\r\n return minOutput + (maxOutput - minOutput) *\r\n (factor - minInput) / (maxInput - minInput);\r\n }", "title": "" }, { "docid": "66c989b9bafb1b524f8eef96f9ea7892", "score": "0.5784617", "text": "scaleAboutCenterInPlace(scaleFactor) {\n if (!this.isNull) {\n scaleFactor = Math.abs(scaleFactor);\n // do the scalar stuff to avoid making a temporary object ....\n const xMid = 0.5 * (this.low.x + this.high.x);\n const yMid = 0.5 * (this.low.y + this.high.y);\n const zMid = 0.5 * (this.low.z + this.high.z);\n this.high.x = Geometry_1.Geometry.interpolate(xMid, scaleFactor, this.high.x);\n this.high.y = Geometry_1.Geometry.interpolate(yMid, scaleFactor, this.high.y);\n this.high.z = Geometry_1.Geometry.interpolate(zMid, scaleFactor, this.high.z);\n this.low.x = Geometry_1.Geometry.interpolate(xMid, scaleFactor, this.low.x);\n this.low.y = Geometry_1.Geometry.interpolate(yMid, scaleFactor, this.low.y);\n this.low.z = Geometry_1.Geometry.interpolate(zMid, scaleFactor, this.low.z);\n }\n }", "title": "" }, { "docid": "4171a01e6e2ccc0286d657c8770a227c", "score": "0.57756466", "text": "function calcScale(end) {\n\t\tvar cir = scene.getObjectByName(\"circuit\");\n\t\tvar scalenum = new THREE.Vector3();\n\t\tcir.getWorldScale(scalenum);\n\t\tif(round(scalenum.getComponent(0),2) < end) {\n\t\t\tcir.scale.set(round(scalenum.getComponent(0) + 0.006, 2), round(scalenum.getComponent(1) + 0.006, 2), round(scalenum.getComponent(2) + 0.006, 2));\n\t\t} else if (round(scalenum.getComponent(0),2) > end) {\n\t\t\tcir.scale.set(round(scalenum.getComponent(0) - 0.006, 2), round(scalenum.getComponent(1) - 0.006, 2), round(scalenum.getComponent(2) - 0.006, 2));\n\t\t}\n\t}", "title": "" }, { "docid": "99d4afcd014c5dff9e7dfae75502cc8c", "score": "0.5775337", "text": "_scale () {\n return api.scale.apply(this, arguments);\n }", "title": "" }, { "docid": "a6dff1362c9e54c4ab72ad2b6f55a6fd", "score": "0.57701623", "text": "function tryRealScale() {\n V.forceheight = false;\n V.recentre();\n renderVR.near = camera.near = 0.01; // note, VERY different from standard value, maybe too small ??\n G._rot4_ele = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n renderVR.scale = 1;\n basescale = 1;\n centrescalenow();\n G.shrinkradiusA = G.shrinkradiusB = 0;\n}", "title": "" }, { "docid": "c1b5ddd9c4345b93743d27e1190012f8", "score": "0.57637906", "text": "function updateLightIntensity()\n{\n currentLight.intensity = lightIntensity;\n}", "title": "" }, { "docid": "85370412cf60bc7626afe66091e4c608", "score": "0.5745763", "text": "scaleTo(factor) {\n this.animate('scaleX', factor)\n this.animate('scaleY', factor)\n }", "title": "" }, { "docid": "747723a9a0226edd61022c210d9e2ae7", "score": "0.5742009", "text": "function changeColorScale(){\n\tactualizeTiff();\n}", "title": "" }, { "docid": "cead9e1e7f31dd66c3101c995a5f17cd", "score": "0.57396746", "text": "getScale() {\n return this.scale;\n }", "title": "" }, { "docid": "081e64ffe8202adae95bf89041cee4c5", "score": "0.57325184", "text": "get scaling () {\n return this._scl;\n }", "title": "" }, { "docid": "101ef6377071609630380682d90a96d3", "score": "0.572026", "text": "function scale(s) {\r\n doc.activeLayer.resize( s, s, AnchorPosition.MIDDLECENTER );\r\n}", "title": "" }, { "docid": "93aff20327c68b06c1af5faa5cf713ae", "score": "0.5713236", "text": "function normalizeAndRescale(obj, newScale)\n{\n var scale = getMaxSize(obj); // Available in 'utils.js'\n obj.scale.set(newScale * (1.0/scale),\n newScale * (1.0/scale),\n newScale * (1.0/scale));\n return obj;\n}", "title": "" }, { "docid": "cc40401c24cc8d6e5fa40266f038c329", "score": "0.5706387", "text": "function rescalePoint(point, inputMin, inputMax, outputMin = 0.0, outputMax = 10.0) {\n return (point - inputMin + outputMin) * outputMax / (inputMax - inputMin)\n}", "title": "" }, { "docid": "6d421f70b269184a4fb03f97552a58e4", "score": "0.56938684", "text": "getBlockScale() {\n return (this.getBlockSize() / this.spriteSize);\n }", "title": "" }, { "docid": "b1c66dee981ec89973dea05a38561742", "score": "0.5687467", "text": "set zoomLevel(value) {\n const { app: { stage, renderer } = {} } = this;\n value = Math.round(value / (100 / 5000)) * (100 / 5000);\n if (stage) {\n const oldScale = stage.scale.x;\n stage.scale.x = value;\n stage.scale.y = value;\n if (value !== oldScale) {\n renderer.emit('_resized');\n }\n }\n }", "title": "" }, { "docid": "2881265e5a5a663d28855130bcec9bef", "score": "0.5685279", "text": "function changeScaleExpmnt(scope){\n\t/** Setting the slider value to the label variable */\n\tdegreeVal = scope.scaleMeasure;\n\tradian = degreeVal * (Math.PI / 180);\n\tintensity = 10 * Math.cos(degreeVal * (Math.PI / 180)) * Math.cos(degreeVal * (Math.PI / 180));\n\t/** Rotate knob corresponding to the slider */\n\tmain_stage.getChildByName(\"zoom_rotator\").rotation = 90 + degreeVal;\n\tmain_stage.getChildByName(\"display_text\").text = intensity.toFixed(2) +\"mA\";\n\n\t/** Change opacity of the laser */\n\talphaVal = intensity / 10;\n\tmain_stage.getChildByName(\"laser_line_two\").alpha = alphaVal;\n\tmain_stage.getChildByName(\"laser\").alpha = alphaVal;\n\t\n\tcalculateIntensity(degreeVal);\n\tmain_stage.update();\n}", "title": "" }, { "docid": "7ee358d6706f3bc9ac75db7ffa0f920c", "score": "0.5685188", "text": "function zoom() {\n const z = zoomScale;\n const r1 = s0 * d3.event.transform.k;\n if (r1>=z[0] && r1<=z[1]) {\n __.scale(r1);\n _.sync.forEach(g=>g._.scale(r1));\n }\n }", "title": "" }, { "docid": "39bd4708ca7dd5e38518a53f74a82016", "score": "0.56844205", "text": "function resizeScale() {\n getScaleDimensions();\n drawScale();\n}", "title": "" }, { "docid": "cf86c0df2ea5b401cb4643f77bbdb0eb", "score": "0.5680231", "text": "normalize() {\n const MA = this.getMagnitude();\n this.x = this.x / MA;\n this.y = this.y / MA;\n this.z = this.z / MA;\n this.w = this.w / MA;\n }", "title": "" }, { "docid": "9eddbc325b2e353d55dddcce73e8da64", "score": "0.56795704", "text": "scale(field, value, intensity = 5, scale = 10) {\n value = random.bound(value, -1 * scale, scale)\n //Normalizes value between 0-2. Anything less than half will decrease, more will increase\n value = (value / scale) + 1\n intensity = (intensity / 10) + 1\n\n let newValue = this[field] * value * intensity\n\n this.set(field, newValue)\n }", "title": "" }, { "docid": "b6c80914e4a712afcf9753180a0fe2d5", "score": "0.56609875", "text": "function updateLightIntensity() {\n lightArray[activeLight].intensity = lightIntensity;\n }", "title": "" }, { "docid": "8c790117d7c968737264c1b40f0b16dc", "score": "0.5660932", "text": "set scale(scale) {\n this.body.scale = scale;\n }", "title": "" }, { "docid": "616b9bf2ea20419e50ea23c161e8246d", "score": "0.56527746", "text": "ip_scale(s) {\n this.x *= s;\n this.y *= s;\n this.z *= s;\n }", "title": "" }, { "docid": "07ffe315d2e0610246eb575df586d8fb", "score": "0.5650326", "text": "shineIntensity(value) {\n this._shiny.material.uniforms.var_lips_shine_intensity_bleeding_scale.x(value);\n }", "title": "" }, { "docid": "0382d5910953231aefb510899d6c2b1b", "score": "0.56199867", "text": "enableMouseScale() {\n let scaleBy = 1.1\n this.stage.on('wheel', (e) => {\n e.evt.preventDefault();\n let oldScale = this.stage.scaleX();\n let pointer = this.stage.getPointerPosition();\n\n let mousePointTo = {\n x: (pointer.x - this.stage.x()) / oldScale,\n y: (pointer.y - this.stage.y()) / oldScale,\n };\n\n let newScale = e.evt.deltaY > 0 ? oldScale * scaleBy : oldScale / scaleBy;\n this.stage.scale({ x: newScale, y: newScale });\n\n let newPos = {\n x: pointer.x - mousePointTo.x * newScale,\n y: pointer.y - mousePointTo.y * newScale,\n };\n this.stage.position(newPos);\n })\n }", "title": "" }, { "docid": "1ed37aed30753298e1ced1a07c939490", "score": "0.5616255", "text": "getScale() {\n return new Vector(this.sizeX, this.sizeY);\n }", "title": "" }, { "docid": "8bf2880d77220c011b8807a06514948a", "score": "0.5612437", "text": "_computeScale(scale) {\n if (!scale) {\n return 16;\n } else if (scale < 5) {\n return 5;\n } else if (scale > 18) {\n return 18;\n } else {\n return scale;\n }\n }", "title": "" }, { "docid": "b2f57da20ee157c315284b38b6fbccbb", "score": "0.5610645", "text": "getFractionToDistanceScale() { return undefined; }", "title": "" }, { "docid": "b2f57da20ee157c315284b38b6fbccbb", "score": "0.5610645", "text": "getFractionToDistanceScale() { return undefined; }", "title": "" }, { "docid": "17d32b230fea9773c342c5bd08a12111", "score": "0.5610057", "text": "updateScales() {\n for (var i = 0; i < this.items.length; i++) {\n this.items[i].setWorldScale(this.scale);\n }\n }", "title": "" }, { "docid": "2a5bfeb8b79de0916fdbda81144d5383", "score": "0.55957514", "text": "normalize() {\n const MA = this.getMagnitude();\n this.x = this.x / MA;\n this.y = this.y / MA;\n this.z = this.z / MA;\n }", "title": "" }, { "docid": "d4d47d3460809ab85a30391022f542ad", "score": "0.5584227", "text": "get scale() { return this._.size; }", "title": "" }, { "docid": "51692e2278e73d5960e1d279b173dfff", "score": "0.55800587", "text": "function toggleScale() {\n if (fretArt.scaleButtonStatus) {\n styleScaleButtonOff();\n fretArt.scaleButtonStatus = false;\n } else {\n styleScaleButtonOn();\n fretArt.scaleButtonStatus = true;\n }\n}", "title": "" }, { "docid": "11a8f88bf3b75c515f56ea531cd7e3f5", "score": "0.55769515", "text": "static createUniformScale(scaleFactor) {\n return Matrix3d.createScale(scaleFactor, scaleFactor, scaleFactor);\n }", "title": "" }, { "docid": "318a55bcf3ca056ee06f4aac09a8af33", "score": "0.55707276", "text": "onScaleFactorChange(scaleFactor){\n\t\tthis.scaleFactor = scaleFactor;\n\t}", "title": "" }, { "docid": "d605f5e74ac5ca5055685753a6f57248", "score": "0.55680144", "text": "currentScale(p) {\n if (this.scale.start !== this.scale.end) {\n return (\n this.r +\n this.r *\n ((this.scale.start + (this.scale.end - this.scale.start)) *\n this.animations[this.animation].easing(p) -\n this.animations[this.animation].easing(p))\n )\n }\n\n return this.r * this.scale.start\n }", "title": "" }, { "docid": "c66c74ad985aea560c984f10c20becec", "score": "0.5561132", "text": "function fix_scale(params){\n var thisProj = ortho(params.left, params.right, params.bottom, params.top, -1, 1);\n var projMatrix = gl.getUniformLocation(program, 'projectionMatrix');\n gl.uniformMatrix4fv(projMatrix, false, flatten(thisProj));\n}", "title": "" }, { "docid": "bb85046c28073577c757b7458234b291", "score": "0.5558763", "text": "saturate(factor = 0.1) {\n this.addEffect(new _SpriteEffects__WEBPACK_IMPORTED_MODULE_0__[\"Saturate\"](factor));\n }", "title": "" }, { "docid": "bb85046c28073577c757b7458234b291", "score": "0.5558763", "text": "saturate(factor = 0.1) {\n this.addEffect(new _SpriteEffects__WEBPACK_IMPORTED_MODULE_0__[\"Saturate\"](factor));\n }", "title": "" }, { "docid": "ed8e11cbbf1da83ff10c98d4a1ca78eb", "score": "0.5555321", "text": "mmToPixelsScale() {\n var machine_x = this.props.max_x - this.props.min_x;\n var machine_y = this.props.max_y - this.props.min_y;\n var scale_x = this.props.canvas_width / machine_x;\n var scale_y = this.props.canvas_height / machine_y;\n // Keep it square.\n return Math.min(scale_x, scale_y) * 0.95;\n }", "title": "" }, { "docid": "dd02387492a485219ee0232a7f6ee7e0", "score": "0.5552221", "text": "mult(scale) {\n this.x *= scale;\n this.y *= scale;\n return this;\n }", "title": "" }, { "docid": "6603688f0bc60163e7c8e69852f100e7", "score": "0.5545053", "text": "function scale(x,y){\n matrix[0] *= x;\n matrix[1] *= x;\n matrix[2] *= y;\n matrix[3] *= y; \n}", "title": "" }, { "docid": "dd8c4aa7074a0341ca4a6131bdd5f7d4", "score": "0.5543678", "text": "function scale(l, v) {\n return v.scale(l);\n}", "title": "" } ]
1593494f733f397599db4898cb0fd99f
This creates an HTML element from a string
[ { "docid": "7c4d695a6575310d832d516d9da2dfd5", "score": "0.6870951", "text": "function stringToHTML (str) {\n const div = document.createElement(\"div\");\n div.innerHTML = str;\n return div.firstChild;\n }", "title": "" } ]
[ { "docid": "89b0cf99062a0c73313947cb87efec04", "score": "0.73734677", "text": "static CreateElementFromHTML(htmlString) {\n let html = htmlString;\n const template = document.createElement('template');\n html = html.trim(); // Never return a text node of whitespace as the result\n template.innerHTML = html;\n return template.content.firstChild;\n }", "title": "" }, { "docid": "fa8c12fc01aa045a7ae48cddf6785671", "score": "0.69591206", "text": "function getelementfromstring(string){\r\n let div = document.createElement('div');\r\n div.innerHTML = string;\r\n return div.firstElementChild;\r\n}", "title": "" }, { "docid": "09446ecd6ec878c8758c328205e96241", "score": "0.6936713", "text": "function getElementFromString(stringTo) {\n let div = document.createElement(\"div\");\n div.innerHTML = stringTo;\n return div;\n}", "title": "" }, { "docid": "5088f412147ac05113ccfc9302161dd9", "score": "0.68325466", "text": "function makeEl(s) {\n var a = s.split('.');\n var tag = a.shift();\n var el = document.createElement(tag);\n el[className] = a.join(' ');\n return el;\n }", "title": "" }, { "docid": "f7e3993de2d7129f62284783cb319b2e", "score": "0.6826971", "text": "function createTagFromStrLiteral(htmlElem) {\n console.info('%sINFO %s createTagFromStrLiteral(%s)', \n getTimeAndDate(), currentScriptName, htmlElem);\n \n var frag = document.createDocumentFragment();\n var temp = document.createElement('div');\n\n temp.innerHTML = htmlElem; \n \n while (temp.firstChild) {\n frag.appendChild(temp.firstChild);\n }\n\n console.log('%sDEBUG %s createTagFromStrLiteral(param) returns %O', \n getTimeAndDate(), currentScriptName, frag);\n return frag;\n}", "title": "" }, { "docid": "5625cdd015f7e8bf29a0587cff00e5ca", "score": "0.68243957", "text": "html(str) {\r\n\t\tvar template = document.createElement('template')\r\n\t\ttemplate.innerHTML = str.trim()\r\n\t\treturn template.content.firstChild\r\n\t}", "title": "" }, { "docid": "23cbe79a29c9f83b0a8673c0cf182fe7", "score": "0.6774421", "text": "function createHTML(tagname, text) {return create(tagname).html(text)}", "title": "" }, { "docid": "b889bd82fe0ff2e0346ae0f025c34f55", "score": "0.6712222", "text": "function createElementFromHTML(htmlString) {\r\n var div = document.createElement('div');\r\n div.innerHTML = htmlString.trim();\r\n\r\n // Change this to div.childNodes to support multiple top-level nodes\r\n return div.firstChild;\r\n}", "title": "" }, { "docid": "bedc34d0fc6a627da0366276fac287cd", "score": "0.6705398", "text": "function createElementFromHTML(htmlString) {\n var div = document.createElement('div');\n div.innerHTML = htmlString.trim();\n\n // Change this to div.childNodes to support multiple top-level nodes\n return div.firstChild;\n}", "title": "" }, { "docid": "694a461a3962d0a1f70340971c5102be", "score": "0.6702079", "text": "function getElementfromstring(string) {\r\n let div = document.createElement('div');\r\n div.innerHTML = string;\r\n return div.firstElementChild;\r\n}", "title": "" }, { "docid": "294d224713a33517e0f74d93db44a5da", "score": "0.6689052", "text": "function getElementFromString(string) {\n let div = document.createElement('div');\n div.innerHTML = string;\n return div.firstElementChild;\n}", "title": "" }, { "docid": "294d224713a33517e0f74d93db44a5da", "score": "0.6689052", "text": "function getElementFromString(string) {\n let div = document.createElement('div');\n div.innerHTML = string;\n return div.firstElementChild;\n}", "title": "" }, { "docid": "294d224713a33517e0f74d93db44a5da", "score": "0.6689052", "text": "function getElementFromString(string) {\n let div = document.createElement('div');\n div.innerHTML = string;\n return div.firstElementChild;\n}", "title": "" }, { "docid": "892b0e23ebb0ca73034d2e1dbc613e87", "score": "0.66884977", "text": "createElementFromHTML(htmlString) {\t//createElementFromHTML\n let div = document.createElement('div');\n div.innerHTML = htmlString.trim();\n\n // Change this to div.childNodes to support multiple top-level nodes\n return div.firstChild;\n }", "title": "" }, { "docid": "a6a1283559cdf803c71f54ed6d50db1c", "score": "0.6627198", "text": "function createElementFromHTML(htmlString) {\r\n var div = document.createElement('div');\r\n div.innerHTML = htmlString.trim();\r\n\r\n // Change this to div.childNodes to support multiple top-level nodes\r\n return div.firstChild;\r\n }", "title": "" }, { "docid": "e34ada1a007521816119244de60b1d21", "score": "0.6616198", "text": "function elementFromString(str) {\n return str.element || ( str.element = HTMLParser.create().parseString(str).children[0] );\n}", "title": "" }, { "docid": "d4713495f411004c6b57847e6b62c7ad", "score": "0.6547939", "text": "function createMarkup(stringHTML) {\n const placeholder = document.createElement(\"div\");\n placeholder.insertAdjacentHTML(\"afterbegin\", stringHTML);\n // const summary = placeholder.firstElementChild;\n return { __html: stringHTML };\n }", "title": "" }, { "docid": "7c81db97a2f3f186412704b6e21fe665", "score": "0.6534481", "text": "function createTemplate(HTMLString){\n\n //Aquí se indica que se va a implementar un elemento html en el DOM\n const html = document.implementation.createHTMLDocument()\n\n //Aquí se le indica específicamente en que lugar se va a agregar ese elemento creado, que va a ser en el body \n html.body.innerHTML = HTMLString;\n\n return html.body.children[0];\n}", "title": "" }, { "docid": "65caf069acd0d0bbde8aa4da1dcccd66", "score": "0.65157264", "text": "function gerElementFromString(addParamsHtml){\n let div = document.createElement('div');\n div.innerHTML = addParamsHtml;\n return div.firstElementChild;\n}", "title": "" }, { "docid": "56ca9d88f3e70dd264717b1d6b40eb3c", "score": "0.645465", "text": "function createDOM (htmlString){\n\tlet template = document.createElement('template');\n\ttemplate.innerHTML = htmlString.trim();\n\treturn template.content.firstChild;\n}", "title": "" }, { "docid": "05a555603a4149afb71f78ea0e2f0fa6", "score": "0.6412736", "text": "function createHtml(html) {\n var div = document.createElement(\"div\");\n div.innerHTML = html;\n return div.children[0];\n}", "title": "" }, { "docid": "69fd1e5dfabc97eb41c8a0aa6be54efa", "score": "0.641161", "text": "function makeElement(elem,text){\n const newElement = document.createElement(elem)\n newElement.textContent = text;\n return newElement;\n}", "title": "" }, { "docid": "6dbab8baf96a02bfdf7606923d1e9b98", "score": "0.6409415", "text": "function createHtmlElement(element) {\n return document.createElement(element); \n}", "title": "" }, { "docid": "cc8a4a336079717dc57dc89092e9c9c3", "score": "0.63971186", "text": "function createHTMLTemplate(HTMLString) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tconst $html = document.implementation.createHTMLDocument();\n\t\t\t\t\t\t//creando un documento html\n\n\t\t\t\t\t\t$html.body.innerHTML = HTMLString;\n\n\t\t\t\t\t\treturn $html.body.children[0];\n\t\t\t\t\t\t//Donde el hijo O es el elemento que creamos con videoItemTemplate()\n\t\t\t\t\t}", "title": "" }, { "docid": "93f4fd55cdc6f9bb8d5cf48a1db6d102", "score": "0.63305414", "text": "function CreateHTML(string, tag, attribute, value) {\n Internal.RequireObjectCoercible(string);\n var S = Internal.ToString(string);\n var p1 = \"<\" + tag;\n if (attribute !== \"\") {\n p1 += \" \" + attribute + '=\"' + Internal.StringReplace(Internal.ToString(value), '\"', \"&quot;\") + '\"';\n }\n return p1 + \">\" + S + \"</\" + tag + \">\";\n}", "title": "" }, { "docid": "f05fe232921f83729cdf2e3e35f5a8bf", "score": "0.630939", "text": "function htmlToElement(html) {\n\tvar template = document.createElement( \"template\" );\n\thtml = html.trim();\n\ttemplate.innerHTML = html;\n\treturn template.content.firstChild;\n}", "title": "" }, { "docid": "01fcd396c8bc0edc602fc310a942dda5", "score": "0.6285822", "text": "function htmlToElement(html) {\n\tvar template = document.createElement('template');\n\thtml = html.trim();\n\ttemplate.innerHTML = html;\n\treturn template.content.firstChild;\n}", "title": "" }, { "docid": "f551a7366d223eb5e90b152bb9498f61", "score": "0.6261307", "text": "function createLIElement(element){\r\n const code = `\r\n <li class=\"task-item\">\r\n <p class=\"item-text\">${element}</p>\r\n <span class=\"icons\">\r\n <i class=\"far fa-check-circle toggle-done\"></i>\r\n <i class=\"far fa-edit edit\"></i>\r\n <i class=\"far fa-times-circle delete\"></i>\r\n </span>\r\n </li> \r\n `;\r\n /* give me back whatever inside code variable */\r\n return code;\r\n}", "title": "" }, { "docid": "82ca0dc62552dd6990f9fabe5b03d47f", "score": "0.62525654", "text": "buildElement() {\n const templateString = fs.readFileSync(this.__template, {encoding: 'utf-8'});\n const parser = new DOMParser();\n const doc = parser.parseFromString(templateString, 'text/html');\n return doc.querySelector('.blynk-ide').cloneNode(true);\n }", "title": "" }, { "docid": "4100f621488a93a3883fcd1f0b0a4c78", "score": "0.6250166", "text": "function createTag(string, tagAttr, attrValue) {\n const tag = document.createElement(string);\n if (string === 'img') {\n tag.style.display = attrValue;\n } else {\n tag.setAttribute(tagAttr, attrValue);\n }\n return tag;\n}", "title": "" }, { "docid": "8b51a7c6dc6c2d92106bd655d130c243", "score": "0.62378615", "text": "function elem(tag, content){ \r\n\t\tvar ret = document.createElement(tag); \r\n\t\tret.innerHTML = content; \r\n\t\treturn ret;\r\n\t}", "title": "" }, { "docid": "a704428d128060d458755021427dd7ae", "score": "0.62356013", "text": "function CreateElementWithText(tagname, content){\n var tag = document.createElement(tagname);\n return tag.appendChild(document.createTextNode(content));\n}", "title": "" }, { "docid": "7fbff67c6cbc61c6627cb1fface0bead", "score": "0.6222963", "text": "function getElementFromSring(string){\n let div = document.createElement('div');\n div.innerHTML = string;\n return div.firstElementChild;\n}", "title": "" }, { "docid": "dc91a431ee54cda8d79d53b066a31349", "score": "0.6188471", "text": "function createHTMLElement(element=null,className=null,html=null) {\n let htmlElement = document.createElement(element);\n htmlElement.className = className;\n htmlElement.innerHTML = html;\n return htmlElement;\n}", "title": "" }, { "docid": "ff3904926cdc9ddc01a80a05f63eef3e", "score": "0.61839926", "text": "function htmlToElement(html) {\n var template = document.createElement('template');\n html = html.trim();\n template.innerHTML = html;\n return template.content.firstChild;\n }", "title": "" }, { "docid": "76f88d4b30c04aba9f25f7ba4d51b6fc", "score": "0.61662924", "text": "function appendHtml(el, str) {\r\n\t\tlet div = document.createElement('div');\r\n\t\tdiv.innerHTML = str;\r\n\t\twhile (div.children.length > 0) {\r\n\t\t\tel.appendChild(div.children[0]);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "d040115653996de228ffd6e49910989a", "score": "0.6152212", "text": "function renderContent(element, string) {\r\n var result = md.render(string);\r\n element.innerHTML = result;\r\n}", "title": "" }, { "docid": "4b38a34814a5a8de6de5d69b68f2e308", "score": "0.61363643", "text": "htmlToElement(html) {\n var template = document.createElement('template');\n html = html.trim(); // Never return a text node of whitespace as the result\n // html may contain multiple siblings and children, so add wrapping element\n template.innerHTML = '<div>' + html + '</div>';\n return template.content.firstChild;\n }", "title": "" }, { "docid": "4125e32a056333ca2d766c5da6889278", "score": "0.6132202", "text": "function htmlToElement(html) {\n var template = document.createElement(\"template\");\n html = html.trim(); // Never return a text node with whitespace as the result\n template.innerHTML = html;\n return template.content.firstChild;\n}", "title": "" }, { "docid": "52fc840bbaf5a88f48e130fec5b982e5", "score": "0.6114827", "text": "function buildElement(tag, innerText, attributes){\n var newEl = document.createElement(tag);\n var newText = document.createTextNode(innerText);\n for (var i = 0; i < attributes.length; i++) {\n newEl[attributes[i][0]] = attributes[i][1]; \n };\n newEl.appendChild(newText);\n return newEl; \n}", "title": "" }, { "docid": "ffe6c0ee903a6c73fe57b0424dab6c4c", "score": "0.61110365", "text": "function htmlToElement(html) {\n var template = document.createElement('template');\n html = html.trim(); // Never return a text node of whitespace as the result\n template.innerHTML = html;\n return template.content.firstChild;\n}", "title": "" }, { "docid": "2b8ff2dca7bde401308ddd528c7c5739", "score": "0.6098884", "text": "function appendHtml(el, str) {\n var div = document.createElement('div');\n div.innerHTML = str;\n while (div.children.length > 0) {\n el.appendChild(div.children[0]);\n }\n}", "title": "" }, { "docid": "34e1cfaa122a2fde3ee6736c9157de1e", "score": "0.60969245", "text": "function createHTML( html ) {\n var div = document.createElement(\"c\");\n div.innerHTML = html;\n return div.firstChild;\n }", "title": "" }, { "docid": "8e0285c08179976a22c6a149a6da44bc", "score": "0.60789686", "text": "function mockElementFromString( str ) {\n\t\tvar element = parseRulesString( str ).$1,\n\t\t\tstyles = element.styles,\n\t\t\tclasses = element.classes;\n\n\t\telement.name = element.elements;\n\t\telement.classes = classes = ( classes ? classes.split( /\\s*,\\s*/ ) : [] );\n\t\telement.styles = mockHash( styles );\n\t\telement.attributes = mockHash( element.attributes );\n\t\telement.children = [];\n\n\t\tif ( classes.length )\n\t\t\telement.attributes[ 'class' ] = classes.join( ' ' );\n\t\tif ( styles )\n\t\t\telement.attributes.style = CKEDITOR.tools.writeCssText( element.styles );\n\n\t\treturn element;\n\t}", "title": "" }, { "docid": "736371ac60c6c6efb68ddc79ee164ef3", "score": "0.6078098", "text": "html(str) {\n if (typeof str === 'string') {\n this.each(node => node.innerHTML = str);\n } else {\n return this.nodes[0].innerHTML;\n }\n }", "title": "" }, { "docid": "316f76bdc4c7860dd9fcdb6592cf674c", "score": "0.6068038", "text": "function createTemplate(HTMLstring) {\n const html = document.implementation.createHTMLDocument();\n html.body.innerHTML = HTMLstring;\n return html.body.children[0];\n}", "title": "" }, { "docid": "f0e4ce72a5176b078a138c2b3ad091e5", "score": "0.60657996", "text": "function mkE(element) {\n return document.createElement(element);\n}", "title": "" }, { "docid": "6d8e2e291d3700f99f0db2cb5ce1a42c", "score": "0.6054235", "text": "function createElementFromHTML(htmlString) {\r\n console.log(htmlString)\r\n var tbody = document.createElement('tbody');\r\n tbody.innerHTML = htmlString.trim();\r\n\r\n // Change this to div.childNodes to support multiple top-level nodes\r\n console.log( tbody.firstChild)\r\n return tbody.firstChild;\r\n }", "title": "" }, { "docid": "c2aa2d55dd048fe7cd60a87eb42d460e", "score": "0.6045671", "text": "function createHTML(html) {\n var div = document.createElement(\"c\");\n div.innerHTML = html;\n return div.firstChild;\n }", "title": "" }, { "docid": "3c0cfe2fcd65b65a02d2a49affcc8499", "score": "0.601559", "text": "function $e(aType, iHTML){var ret = document.createElement(aType); if (iHTML) ret.innerHTML = iHTML; return ret;}", "title": "" }, { "docid": "f50c2a1587a0c17369c967cf4be406b1", "score": "0.600998", "text": "function buildHTMLString(string) {\n return `<!doctype html>\n<html lang=\"en\">\n\n<head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n\n <link href=\"https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/css/bootstrap.min.css\" rel=\"stylesheet\"\n integrity=\"sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl\" crossorigin=\"anonymous\">\n <link rel=\"stylesheet\" href=\"https://pro.fontawesome.com/releases/v5.10.0/css/all.css\"\n integrity=\"sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p\" crossorigin=\"anonymous\" />\n <link rel=\"preconnect\" href=\"https://fonts.gstatic.com\">\n <link href=\"https://fonts.googleapis.com/css2?family=Roboto:wght@900&display=swap\" rel=\"stylesheet\">\n <link href=\"./style.css\" rel=\"stylesheet\">\n\n <title>Team Profile Generator</title>\n</head>\n<body>\n <div class=\"container-fluid\">\n <div class=\"row\">\n <div class=\"col-12 pt-3 pb-3 team-heading\">\n <h1 class=\"text-center\">${team.teamName}</h1>\n </div>\n </div>\n </div>\n\n <div class=\"container\">\n <div class=\"row\">\n ${string}\n </div>\n </div>\n </div>\n\n <script src=\"https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/js/bootstrap.bundle.min.js\"\n integrity=\"sha384-b5kHyXgcpbZJO/tY9Ul7kGkf1S0CWuKcCD38l8YkeH8z8QjE0GmW1gYU5S9FOnJ0\"\n crossorigin=\"anonymous\"></script>\n <script src=\"./teamprofile.js\"></script>\n</body>\n</html>`\n}", "title": "" }, { "docid": "694327e0ab76972f4b6d818e47227795", "score": "0.6000295", "text": "function renderHTML(div, htmlString){\n var parser = new DOMParser();\n var parsedHtml = parser.parseFromString(htmlString, \"text/html\");\n div.innerHTML += parsedHtml.body.innerHTML;\n}", "title": "" }, { "docid": "a10d420c70c253e68768899ac95544d1", "score": "0.5997805", "text": "function repeatElement(str, count) {\n\t\tvar $el;\n\t\t// This method avoids nesting if string is an unclosed HTML tag\n\t\tfor (var i = 0; i < count; i++) {\n\t\t\tif (!$el) $el = $(str);\n\t\t\telse $el = $el.add(' '+str);\n\t\t}\n\t\treturn $el;\n\t}", "title": "" }, { "docid": "a2f6ea14951839817b266308bbe47ac5", "score": "0.5991828", "text": "function makeEl(html) {\n throwAway.innerHTML = html;\n return throwAway.content.firstChild;\n}", "title": "" }, { "docid": "e6d69127f8b7153d888dfb652e05979d", "score": "0.5979737", "text": "function parseHTML(string) {\n return parse('html', string);\n}", "title": "" }, { "docid": "3d688ff631921d6ee7795fd5e3ff6e75", "score": "0.59590733", "text": "function el(str) {\n\treturn document.getElementById(str);\n}", "title": "" }, { "docid": "9e714e2e1d33c90f28d2c376816f73fa", "score": "0.59354633", "text": "function convertToElement(html) {\n // Create a temportary div\n var temp = document.createElement('div');\n // Place the html in the div's innerhtml\n temp.innerHTML = html;\n // Then return the first node\n return temp.childNodes[0];\n}", "title": "" }, { "docid": "e590515c0ce6a27c223f3ad9029bb955", "score": "0.5932607", "text": "function createHtml(txt, id) {\n const div = document.createElement(\"div\");\n div.classList.add(\"task-item\");\n div.dataset.id = id;\n const template = `<button class=\"check btn\">\n <img src=\"${checkImg}\" alt=\"check\">\n</button>\n\n<p class=\"title\">${txt}</p>\n\n<button class=\"edit btn\">\n <img src=\"${editImg}\" alt=\"edit\">\n</button>\n\n<button class=\"delete btn\">\n <img src=\"${binImg}\" alt=\"delete\">\n</button>`;\n div.innerHTML = template;\n return div;\n}", "title": "" }, { "docid": "75282475aa3ed754f82b7e01039c9bf0", "score": "0.5924672", "text": "function createElement(elementName,className,innerHtml){\n let tag = document.createElement(elementName);\n tag.className= className || '';\n tag.innerHTML = innerHtml || '';\n return tag;\n}", "title": "" }, { "docid": "dff4ec4dacc2dc39748c6ebffc008fc2", "score": "0.5920981", "text": "function createHTMLElement(tag) {\n switch(tag) {\n case 'div':\n const div = document.createElement('div');\n div.classList.add('catch');\n div.setAttribute('data-id', arguments[1]);\n return div;\n case 'label':\n const label = document.createElement('label');\n label.textContent = arguments[1];\n return label;\n case 'input':\n const input = document.createElement('input');\n input.type = arguments[1];\n input.classList.add(arguments[2]);\n input.value = arguments[3];\n return input;\n case 'hr':\n const hr = document.createElement('hr');\n return hr;\n case 'button':\n const button = document.createElement('button');\n button.classList.add(arguments[1]);\n button.textContent = arguments[2];\n\n switch(arguments[1]){\n case 'update':\n button.addEventListener('click', onUpdateBtnClick);\n break;\n case 'delete':\n button.addEventListener('click', onDeleteBtnClick);\n break;\n }\n\n return button;\n };\n}", "title": "" }, { "docid": "4f68313316ba66d679a0271b0b1a5a23", "score": "0.59204155", "text": "function createEl(el) {\n return document.createElement(el);\n }", "title": "" }, { "docid": "aa220e99dc5221c18cea854390f24f7c", "score": "0.59190476", "text": "function elem(tag, aContent){\r\n\t\tvar ret = document.createElement(tag);\r\n\t\tif (aContent != undefined)\r\n\t\t\tret.innerHTML = aContent;\r\n\t\treturn ret;\r\n\t}", "title": "" }, { "docid": "d27084b9e602fbc543feadf344f8f64d", "score": "0.5885967", "text": "function createTemplate(HTMLString) {\n\t\tconst html = document.implementation.createHTMLDocument()\n\t\thtml.body.innerHTML = HTMLString\n\t\treturn html.body.children[0]\n\t}", "title": "" }, { "docid": "f39d8b5cbfb0be2ac65fd70b24523385", "score": "0.58858925", "text": "function createElementFromTemplate(templateHTMLString, templateData, attrExtractor) {\n var div = document.createElement('div');\n var fullHTMLString = replaceAttributesInTemplate(\n templateHTMLString,\n attrExtractor === undefined ? templateData : attrExtractor(templateData)\n )\n // TODO: Handle IE edge cases for use of innerHTML with tables\n div.innerHTML = fullHTMLString;\n return div.firstChild;\n }", "title": "" }, { "docid": "8efcbdfbcda028bf85adfcb22034935c", "score": "0.5884912", "text": "function newElement(type, text, options) {\r\n\tvar e = document.createElement(type);\r\n\tif(text != null) {\r\n\t\te.innerHTML = text;\r\n\t}\r\n\tfor(var key in options) {\r\n\t\te.setAttribute(key, options[key]);\r\n\t}\r\n\treturn e;\r\n}", "title": "" }, { "docid": "6209744f253a4aeda14e4638b307c706", "score": "0.5875545", "text": "function $el(type, attribs, sub_elements) {\n\tvar el = document.createElement(type);\n\tvar i;\n\tif (Array.isArray(attribs)) {\n\t\tsub_elements = attribs;\n\t\tattribs = null;\n\t}\n\tif (sub_elements) {\n\t\tfor (i = 0; i < attribs.length; i++) {\n\t\t\tif (typeof(attribs[i]) == \"string\") {\n\t\t\t\tvar el2 = document.createElement(\"span\");\n\t\t\t\tel2.textContent = attribs[i];\n\t\t\t\tel.appendChild(el2);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tel.appendChild(attribs[i]);\n\t\t\t}\n\t\t}\n\t}\n\tif (typeof(attribs) == \"string\") {\n\t\tel.textContent = attribs;\n\t}\n\telse if (attribs) {\n\t\tfor (i in attribs) {\n\t\t\tif (i == \"textContent\") el.textContent = attribs[i];\n\t\t\telse el.setAttribute(i.replace(/_/g, \"-\"), attribs[i]);\n\t\t}\n\t}\n\treturn el;\n}", "title": "" }, { "docid": "601bc6eb4b1e9274d2652029a5e0fd50", "score": "0.5864164", "text": "function parseHTML(str) {\r\n str = str.replace(/^[\\s\\S]*?<html(?:\\s[^>]+?)?>|<\\/html\\s*>[\\S\\s]*$/ig, '');\r\n var res = document.implementation.createDocument(null, 'html', null);\r\n var range = document.createRange();\r\n range.setStartAfter(document.body);\r\n var fragment = range.createContextualFragment(str);\r\n try {\r\n fragment = res.adoptNode(fragment); //for Firefox3 beta4\r\n } catch (e) {\r\n fragment = res.importNode(fragment, true);\r\n }\r\n res.documentElement.appendChild(fragment);\r\n return res;\r\n}", "title": "" }, { "docid": "820e3c4e52339e7cec7a4a689a15c127", "score": "0.58637446", "text": "function createString(str, args){\n var regexp = new RegExp(\"(<.+?>)\"); \n var strings = str.split(regexp);\n $.each(strings, function(i, val){\n \tif(val[0] == \"<\"){\n\t\tstrings[i] = args[val.substr(1,val.length-2)];\n\t}\n });\n return strings.join(\"\");\n}", "title": "" }, { "docid": "fa4e5a96c99faa71af62a58a8a10c907", "score": "0.5856383", "text": "_buildPanelCreateAnnot(){\n var htmlStr = `\n <div>\n <i id=\"newAnnotUndo\" class=\"fa fa-undo small-icon\" aria-hidden=\"true\"></i>\n <i id=\"newAnnotPaintColorPicker\" class=\"fa fa-paint-brush small-icon\" aria-hidden=\"true\"></i>\n <i id=\"newAnnotDelete\" class=\"fa fa-trash small-icon\" aria-hidden=\"true\"></i>\n </div>\n `;\n\n return htmlStr;\n }", "title": "" }, { "docid": "fa4e5a96c99faa71af62a58a8a10c907", "score": "0.5856383", "text": "_buildPanelCreateAnnot(){\n var htmlStr = `\n <div>\n <i id=\"newAnnotUndo\" class=\"fa fa-undo small-icon\" aria-hidden=\"true\"></i>\n <i id=\"newAnnotPaintColorPicker\" class=\"fa fa-paint-brush small-icon\" aria-hidden=\"true\"></i>\n <i id=\"newAnnotDelete\" class=\"fa fa-trash small-icon\" aria-hidden=\"true\"></i>\n </div>\n `;\n\n return htmlStr;\n }", "title": "" }, { "docid": "5769552c976484a4fa8af739bd067856", "score": "0.58329314", "text": "function createEl(tagName) {\n return document.createElement(tagName);\n}", "title": "" }, { "docid": "e39215258c4652acb576b035f1bd94f6", "score": "0.5826955", "text": "static createElement(html, _options) {\n const el = d.createElement('template');\n el.innerHTML = html;\n return el;\n }", "title": "" }, { "docid": "9b3564247224e26f29c29e1f163aaf5a", "score": "0.5814858", "text": "function parseHTML(string) {\n return parse$1('html', string);\n}", "title": "" }, { "docid": "78428d723926bd0308f76f680b6fa03d", "score": "0.5809759", "text": "function getElementById(string){\n let div=document.createElement('div');\n div.innerHTML=string;\n return div.firstElementChild;\n}", "title": "" }, { "docid": "2494135c046a7e1b102c8b9a9d1bbd6b", "score": "0.5806914", "text": "static createElement(html, _options) {\n const el = d.createElement('template');\n el.innerHTML = html;\n return el;\n }", "title": "" }, { "docid": "f9598fd1d45401470a2b6d13b2d6933b", "score": "0.58010983", "text": "function stringToNodes(str) {\n\t\t\tvar r = [],\n\t\t\t\ttagName = (/^\\s*<([^\\s>]+)/.exec(str) || [,'div'])[1],\n\t\t\t\t// This matches str content with potential elements that cannot\n\t\t\t\t// be a child of <div>. elmFilter declared at top of page.\n\t\t\t\telmWrap = elmWraps[tagName] || emptyArray, \n\t\t\t\tnodeDepth,\n\t\t\t\tchildElm,\n\t\t\t\trLen = 0;\n\t\t\t\n\t\t\t// Create the new element using the node tree contents available in filteredElm.\n\t\t\ttmpDiv.innerHTML = (elmWrap[1] + str + elmWrap[2]);\n\t\t\t\n\t\t\tchildElm = tmpDiv;\n\t\t\t\n\t\t\t// Strip newElement down to just the required element and its parent\n\t\t\tnodeDepth = elmWrap[0];\n\t\t\twhile(nodeDepth--) {\n\t\t\t\tchildElm = childElm.lastChild;\n\t\t\t}\n\n\t\t\t// pull nodes out of child\n\t\t\twhile (childElm.firstChild) {\n\t\t\t\tr[rLen++] = childElm.removeChild(childElm.firstChild);\n\t\t\t}\n\t\t\t\n\t\t\tchildElm = null;\n\t\t\t\n\t\t\treturn r;\n\t\t}", "title": "" }, { "docid": "55d2606abc3db032c696ee3a45429b69", "score": "0.57964635", "text": "createElementFromHTML(s)\n\t{\n\t\tvar res = [];\n\t\tvar e = document.createElement('div');\n\t\te.innerHTML = s.trim();\n\t\tfor (var i = 0; i < e.childNodes.length; i++) res.push( e.childNodes[i] );\n\t\treturn res;\n\t}", "title": "" }, { "docid": "05af604f4a74039fbc73b079472abc94", "score": "0.57909876", "text": "function create_element(element_type,\n parent_node,\n class_name=false,\n id=false,\n text= undefined) {\n let DOM_node;\n\n if(element_type === 'text'){\n\n DOM_node = document.createTextNode(text)\n\n }else{\n\n DOM_node = document.createElement(element_type);\n if (class_name){\n DOM_node.className = class_name\n }\n if(id){\n DOM_node.id = id\n }\n }\n\n parent_node.appendChild(DOM_node);\n\n return DOM_node\n}", "title": "" }, { "docid": "304d4220da1cbd6df84b6a828ace45c5", "score": "0.57831603", "text": "function createTag(loc, tag, id = '', el_class = '', text = '', style = '') {\n var element = document.createElement(tag);\n if (id != '') {\n element.setAttribute('id', id);\n }\n if (el_class != '') {\n element.setAttribute('class', el_class);\n }\n if (text != '') {\n element.innerText = text;\n }\n if (style != '') {\n element.setAttribute('style', style);\n }\n loc.prepend(element);\n return element;\n}", "title": "" }, { "docid": "926d62260cb354dfc4708a89076902b5", "score": "0.5781565", "text": "function parseHTML(str){\r\n str = str.replace(/^[\\s\\S]*?<html(?:\\s[^>]+?)?>|<\\/html\\s*>[\\S\\s]*$/ig, '');\r\n var res = document.implementation.createDocument(null, 'html', null);\r\n var range = document.createRange();\r\n range.setStartAfter(window.content.document.body);\r\n res.documentElement.appendChild(res.importNode(range.createContextualFragment(str), true));\r\n return res;\r\n }", "title": "" }, { "docid": "ca898d358d249c006f0b79060bdf4326", "score": "0.57801783", "text": "constructor(str) {\n let tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan');\n tspan.innerHTML = str;\n super(tspan);\n }", "title": "" }, { "docid": "ab595212c028182d697b4f8234c61027", "score": "0.57770586", "text": "function elem (type) {\n return document.createElement(type);\n }", "title": "" }, { "docid": "b1ef04d9e44e596e6b886227de69ba95", "score": "0.5774699", "text": "function createHtmlByElements( strHTML )\r\n{\r\n\tarrArguments = createHtmlByElements.arguments;\r\n\tif (arrArguments.length == 0)\r\n\t{\r\n\t\treturn strHTML;\r\n\t}\r\n\r\n\tif (arrArguments.length % 2 == 0)\r\n\t{\r\n\t\tdebuggerAlert( 'invalid paramaters numbers ' );\r\n\t\treturn strHTML;\r\n\t}\r\n\r\n\tfor (var i = 1; i < arrArguments.length; i += 2)\r\n\t{\r\n\t\tstrSearch = arrArguments[ i ];\r\n\t\tmixReplace = arrArguments[ i + 1 ];\r\n\t\tif ( !isString(mixReplace) && !isNumber(mixReplace) )\r\n\t\t{\r\n\t\t\tmixReplace = getHtmlString( mixReplace );\r\n\t\t}\r\n\r\n\t\tstrHTML = replaceAll( strHTML, strSearch, mixReplace );\r\n\t}\r\n\r\n\treturn strHTML;\r\n}", "title": "" }, { "docid": "24daa8324dbf18b0593237b7d8e5c81b", "score": "0.5772433", "text": "static createNode(elementName, props = {}) { \n const element = document.createElement(elementName);\n Object.entries(props).map(([prop, value]) => {\n if (prop === 'innerHTML') {\n element.innerHTML = value;\n } else {\n element.setAttribute(prop, value);\n }\n });\n return element;\n }", "title": "" }, { "docid": "7f3c9c01f7bed91a5e89054119de018d", "score": "0.5770508", "text": "function e(elementType, text, attributes, styles) {\n var newElement = document.createElement(elementType);\n newElement.textContent = text;\n\n //set the attributes on the tag\n if(attributes){\n for (var i = 0; i < attributes.length; i++) {\n var attr = attributes[i];\n newElement.setAttribute(attr[0], attr[1]);\n }\n}\n // set the styles\n if(styles){\n for (var j = 0; j < styles.length; j++) {\n var style = styles[j];\n newElement.style[style[0]] = style[1];\n }\n}\n return newElement;\n }", "title": "" }, { "docid": "65b8790c16afa29ff61bc72fe462d2ff", "score": "0.5755234", "text": "_svgElementFromString(str) {\n const div = this._document.createElement('DIV');\n div.innerHTML = str;\n const svg = div.querySelector('svg');\n if (!svg) {\n throw Error('<svg> tag not found');\n }\n return svg;\n }", "title": "" }, { "docid": "9288635df3b7dab7f6a9127209a1a8d6", "score": "0.5743066", "text": "function create (tagName, value) {\n var tag = document.createElement(tagName)\n tag.innerHTML = value\n\n return tag\n}", "title": "" }, { "docid": "0879d31687bd1d63ea6cce6bf41b698d", "score": "0.57428855", "text": "function createElementWithText(tag,text){\n var elem = document.createElement(tag);\n elem.textContent = text;\n return elem;\n}", "title": "" }, { "docid": "08c86a241cc6341f271ca314d28c8cb4", "score": "0.57395756", "text": "function htmlEntity(str)\n {\n return $( '<div />' ).text( str ).html();\n }", "title": "" }, { "docid": "f1845410d2a35319947922ce33bf0223", "score": "0.5725887", "text": "function createElement(html) {\n let dummy = document.createElement('div');\n dummy.insertAdjacentHTML('beforeEnd', html);\n return dummy.children[0];\n}", "title": "" }, { "docid": "0129913fb1b4adcd80cfae591747a924", "score": "0.57220864", "text": "get htmlString() {\n return `<div class=\"amiibo\" id=\"amiibo${this.data.tail}\"><img src=${\n this.data.image\n } />\n <div id=\"amiiboInfo\" class=\"amiiboInfo\">\n ${this.data.name}</br>\n Series: ${this.data.gameSeries}</br>\n ${this.data.release.eu ?? \"N/A\"}</br>\n </div>\n <div class=\"buttons\">\n ${this.getActions()}\n </div>\n </div>`;\n }", "title": "" }, { "docid": "01fd23365c95bc2954175c7bc6484757", "score": "0.5718621", "text": "function parseHTML(str) {\r\n str = str.replace(/^[\\s\\S]*?<html(?:\\s[^>]+?)?>|<\\/html\\s*>[\\S\\s]*$/ig, '');\r\n var res = document.implementation.createDocument(null, 'html', null);\r\n var range = document.createRange();\r\n range.setStartAfter(window.content.document.body);\r\n res.documentElement.appendChild(res.importNode(range.createContextualFragment(str), true));\r\n return res;\r\n }", "title": "" }, { "docid": "82d1f46ab6981c4c5c4550a610d012e5", "score": "0.5714828", "text": "function htmlToDomNode(html) {\r\n var container = document.createElement('div');\r\n container.innerHTML = html;\r\n return container.firstChild;\r\n}", "title": "" }, { "docid": "8c6f5d835046909d5d7a4423abc775e9", "score": "0.571126", "text": "function makeElem(tagName, className) {\n toRet = document.createElement(tagName);\n toRet.className = className;\n return toRet;\n}", "title": "" }, { "docid": "4ab9e8122ff8fefae17f4f80869b07f7", "score": "0.57099634", "text": "function generateNYUElement(paragraphString) {\n //console.log(paragraphString);\n var hrefMatch = paragraphString.match(/href=\".*\" r|href=\".*\">/)[0];\n var textMatch = paragraphString.match(/resource=\".*\" data-size/)[0];\n hrefMatch = hrefMatch.replace(/href=\"|\" r/g, \"\");\n hrefMatch = hrefMatch.replace(/\">/, \"\");\n textMatch = textMatch.replace(/resource=\"|\" data-size/g, \"\");\n textMatch = fixUpText(textMatch);\n var returnObject = {text: textMatch, link: hrefMatch, style: \"linkBody\"};\n return returnObject;\n}", "title": "" }, { "docid": "035875303506db3f0339a4ac9bfbcd7d", "score": "0.5702407", "text": "function elt(type) {\r\n var node = document.createElement(type);\r\n for (var i = 1; i < arguments.length; i++) {\r\n var child = arguments[i];\r\n if (typeof child == \"string\")\r\n child = document.createTextNode(child);\r\n node.appendChild(child);\r\n }\r\n return node;\r\n}", "title": "" }, { "docid": "3afd55f43c874a4dffaa4aee1febe01a", "score": "0.5700839", "text": "function createElement(type, content) { // => create element factory pattern\r\n const element = document.createElement(type);\r\n element.textContent = content;\r\n return element;\r\n }", "title": "" }, { "docid": "25cf5920e47a546c8c7799d5b22ac975", "score": "0.5686796", "text": "function createul()\n{\n inputStr = \"<p>OL group</p>\" +\n \"<ol>\" +\n \"<li>Text li 1</li>\" +\n \"<li>Text li 2</li>\" +\n \"<li>Text li 3</li>\" +\n \"</ol>\" +\n \"<p>UL group</p>\" +\n \"<ul id=\" + IDControl + \" name=\" + IDControl + \" title=\" + IDControl + \">\" +\n \"<li>Text li 1</li>\" +\n \"<li>Text li 2</li>\" +\n \"<li>Text li 3</li>\" +\n \"</ul>\";\n}", "title": "" }, { "docid": "79ed9f416bb72c9a317bded9432e786f", "score": "0.5684378", "text": "function createList(string) {\n\tlet ol = document.getElementById('cabinList');\n\tlet li = document.createElement('li');\n\tli.innerHTML = string;\n\tli.className = 'listTags';\n\n\tol.appendChild(li);\n}", "title": "" }, { "docid": "7b24acf849caafc077ed5e87e93471b1", "score": "0.5683361", "text": "function newElem(_strType, _strId, _strClass, _strStyle) {\r\n var eElem = document.createElement(_strType);\r\n if (_strId) eElem.id = _strId;\r\n if (_strClass) eElem.setAttribute('class', _strClass);\r\n if (_strStyle) eElem.setAttribute('style', _strStyle);\r\n return eElem;\r\n }", "title": "" } ]
980d311ef9d7dc865b2af9c1c0222b59
Adds a page event handler to emit uncaught exception to process if one of the observed console logging types is encountered.
[ { "docid": "28cbad88992bf3a514c3fe13b4148dd7", "score": "0.61849517", "text": "function observeConsoleLogging() {\n\tpage.on( 'console', ( message ) => {\n\t\tconst type = message.type();\n\t\tif ( ! OBSERVED_CONSOLE_MESSAGE_TYPES.hasOwnProperty( type ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet text = message.text();\n\n\t\t// An exception is made for _blanket_ deprecation warnings: Those\n\t\t// which log regardless of whether a deprecated feature is in use.\n\t\tif ( text.includes( 'This is a global warning' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Viewing posts on the front end can result in this error, which\n\t\t// has nothing to do with Gutenberg.\n\t\tif ( text.includes( 'net::ERR_UNKNOWN_URL_SCHEME' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// We log this separately now in a way which includes the URL\n\t\t// which is much more useful than this message.\n\t\tif (\n\t\t\ttext.startsWith(\n\t\t\t\t'Failed to load resource: the server responded with a status of'\n\t\t\t)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// A bug present in WordPress 5.2 will produce console warnings when\n\t\t// loading the Dashicons font. These can be safely ignored, as they do\n\t\t// not otherwise regress on application behavior. This logic should be\n\t\t// removed once the associated ticket has been closed.\n\t\t//\n\t\t// See: https://core.trac.wordpress.org/ticket/47183\n\t\tif (\n\t\t\ttext.startsWith( 'Failed to decode downloaded font:' ) ||\n\t\t\ttext.startsWith( 'OTS parsing error:' ) ||\n\t\t\ttext.includes(\n\t\t\t\t'Download the React DevTools for a better development experience'\n\t\t\t) ||\n\t\t\ttext.includes(\n\t\t\t\t\"Can't perform a React state update on an unmounted component\"\n\t\t\t) ||\n\t\t\ttext.includes(\n\t\t\t\t'https://fb.me/react-unsafe-component-lifecycles'\n\t\t\t) ||\n\t\t\ttext.includes( 'https://fb.me/react-strict-mode-' )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Some error messages which don't impact test results can\n\t\t// be safely ignored.\n\t\tif (\n\t\t\ttext.startsWith( 'Powered by AMP' ) ||\n\t\t\ttext.startsWith( 'data_error unknown response key' ) ||\n\t\t\ttext.includes(\n\t\t\t\t'No triggers were found in the config. No analytics data will be sent.'\n\t\t\t)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Ignore errors thrown by `@wordpress/api-fetch`. These are actual,\n\t\t// legimate request failures, but they can happen during a navigation\n\t\t// (or when actually offline).\n\t\t//\n\t\t// We ignore them as they are not indicative of a problem with the\n\t\t// test and usually make E2E tests fail erroneously.\n\t\tif ( text.includes( 'You are probably offline.' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// WordPress 5.3 logs when a block is saved and causes console logs\n\t\t// that should not cause failures.\n\t\tif ( text.startsWith( 'Block successfully updated for' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// As of WordPress 5.3.2 in Chrome 79, navigating to the block editor\n\t\t// (Posts > Add New) will display a console warning about\n\t\t// non - unique IDs.\n\t\t// See: https://core.trac.wordpress.org/ticket/23165\n\t\tif ( text.includes( 'elements with non-unique id #_wpnonce' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// WordPress 6.3 moved the editor into an iframe and warns when\n\t\t// when styles are added incorrectly.\n\t\t// See https://github.com/WordPress/gutenberg/blob/5977e3d60b7aea6e22d4a452f7525d3f140c37b6/packages/block-editor/src/components/iframe/index.js#L170\n\t\t// Here we ignore core those from core themes in case we add our own styles\n\t\t// here in the future.\n\t\tif (\n\t\t\ttext.match( /^twenty[a-z-]+ was added to the iframe incorrectly/ )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet logFunction = OBSERVED_CONSOLE_MESSAGE_TYPES[ type ];\n\n\t\t// At this point, any unexpected message will result in a test failure.\n\n\t\t// Check if it's raised by the AMP plugin.\n\t\tif ( isPluginConsoleMessage( 'amp', message ) ) {\n\t\t\t// Convert console messages originating from AMP to debug statements.\n\t\t\t// This avoids failing tests from console errors we don't have control of.\n\t\t\tlogFunction = 'debug';\n\t\t}\n\n\t\t// As of Puppeteer 1.6.1, `message.text()` wrongly returns an object of\n\t\t// type JSHandle for error logging, instead of the expected string.\n\t\t//\n\t\t// See: https://github.com/GoogleChrome/puppeteer/issues/3397\n\t\t//\n\t\t// The recommendation there to asynchronously resolve the error value\n\t\t// upon a console event may be prone to a race condition with the test\n\t\t// completion, leaving a possibility of an error not being surfaced\n\t\t// correctly. Instead, the logic here synchronously inspects the\n\t\t// internal object shape of the JSHandle to find the error text. If it\n\t\t// cannot be found, the default text value is used instead.\n\t\ttext = get(\n\t\t\tmessage.args(),\n\t\t\t[ 0, '_remoteObject', 'description' ],\n\t\t\ttext\n\t\t);\n\n\t\t// Disable reason: We intentionally bubble up the console message\n\t\t// which, unless the test explicitly anticipates the logging via\n\t\t// @wordpress/jest-console matchers, will cause the intended test\n\t\t// failure.\n\n\t\t// eslint-disable-next-line no-console\n\t\tconsole[ logFunction ]( text );\n\t} );\n}", "title": "" } ]
[ { "docid": "3c49c054a0243ab0e650e2a1445eb72b", "score": "0.66597325", "text": "function setupOnUncaughtExceptions() { // eslint-disable-line no-unused-vars\n window.addEventListener('error', (e) => {\n e.preventDefault();\n const error = e.error;\n console.error( // eslint-disable-line no-console\n 'onUncaughtExceptions caught error:\\n', error\n );\n\n const message = error.message || ''; // eslint-disable-line no-unused-vars\n const stack = (error.stack || '').split('\\n'); // eslint-disable-line no-unused-vars\n\n // We cannot depend on the logger running properly. Try to log to server directly.\n if (store && store.dispatch && feathersServices && feathersServices.logs) {\n store.dispatch(feathersServices.logs.create({\n level: 'error',\n msg: 'Uncaught exception',\n error: { message, stack, deviceId: localStorage.deviceId },\n }))\n .catch(err => console.log( // eslint-disable-line no-console\n 'onUncaughtExceptions error while logging:\\n', err\n ));\n }\n });\n}", "title": "" }, { "docid": "a1677bb8ce6172089d49aa4c516b0826", "score": "0.64233685", "text": "function observeConsoleLogging() {\n page.on('console', (message) => {\n const type = message.type();\n if (!Object.hasOwnProperty.call(OBSERVED_CONSOLE_MESSAGE_TYPES, type)) {\n return;\n }\n\n let text = message.text();\n\n // Short-circuit abort if any known \"allowed\" message fails\n if (ALLOWED_ERROR_MESSAGES.some((msg) => text.includes(msg))) {\n return;\n }\n\n // Special case: ignore 403 errors on logout page.\n // See https://github.com/google/web-stories-wp/pull/7889\n if (\n text.includes(\n 'Failed to load resource: the server responded with a status of 403 (Forbidden)'\n ) &&\n message.stackTrace()?.[0]?.url?.endsWith('wp-login.php?action=logout')\n ) {\n return;\n }\n\n //eslint-disable-next-line security/detect-object-injection\n const logFunction = OBSERVED_CONSOLE_MESSAGE_TYPES[type];\n\n // As of Puppeteer 1.6.1, `message.text()` wrongly returns an object of\n // type JSHandle for error logging, instead of the expected string.\n //\n // See: https://github.com/GoogleChrome/puppeteer/issues/3397\n //\n // The recommendation there to asynchronously resolve the error value\n // upon a console event may be prone to a race condition with the test\n // completion, leaving a possibility of an error not being surfaced\n // correctly. Instead, the logic here synchronously inspects the\n // internal object shape of the JSHandle to find the error text. If it\n // cannot be found, the default text value is used instead.\n text = message.args()?.[0]?._remoteObject?.description || text;\n\n // Disable reason: We intentionally bubble up the console message\n // which, unless the test explicitly anticipates the logging via\n // @wordpress/jest-console matchers, will cause the intended test\n // failure.\n\n // eslint-disable-next-line no-console, security/detect-object-injection\n console[logFunction](text);\n });\n}", "title": "" }, { "docid": "ba54e67297a5498bb5941d2b945fd056", "score": "0.6254203", "text": "_initFatalErrorHandler() {\n this._page.on('error', (error) => {\n let msg =\n error.stack +\n '\\n' +\n 'Because of the error above the browser instance ' +\n 'has been cleared and may cause an additional error ' +\n 'in current test run. You can ignore it, since QApe ' +\n 'tester should recover by itself.';\n\n report('browser:error', { error: msg });\n\n this._handleUnknownExecutionErrors(error);\n\n this.clear();\n });\n }", "title": "" }, { "docid": "ba74088bea7154668d5af78a2111b71d", "score": "0.6152037", "text": "catchUncaughtExceptions() {\n this.uncaughtExceptionHandler = this.uncaughtExceptionHandler.bind(this);\n process.on('uncaughtException', this.emitErrorAndLogIt.bind(this));\n process.on('uncaughtException', this.uncaughtExceptionHandler);\n }", "title": "" }, { "docid": "aa3961ccf25be8101f4591e3b86f559d", "score": "0.6105521", "text": "_startErrorHandling() {\n window.addEventListener('error', this._boundErrorHandler);\n window.addEventListener('unhandledrejection', this._boundErrorHandler);\n }", "title": "" }, { "docid": "b15ef2ce8a6d430321777b5c28c90ccc", "score": "0.60913277", "text": "function listenToUncaughtErrors() {\n\tconst SEC = getRootSEC()\n\t\t.createChild()\n\t\t.setLogicalStack({operation: '(node/uncaught)'})\n\n\tprocess.on('uncaughtException', err => {\n\t\tSEC._handleError({\n\t\t\tSEC,\n\t\t\tdebugId: 'node/uncaught',\n\t\t\tshouldRethrow: false,\n\t\t}, err)\n\t})\n}", "title": "" }, { "docid": "8a8742f24ee7e8f694a78352c2ed7594", "score": "0.6052223", "text": "catchAllError() {\n if (typeof window === \"undefined\" || window === null) {\n return;\n }\n window.console = {\n log: function (msg) {},\n info: function (msg) {},\n warn: function (msg) {},\n error: msg => {\n let data = {\n UUID: uuidv4(),\n timestamp: this.getTimeStamp(),\n event: \"Console_Error\",\n data: msg,\n level: \"error\",\n host_url: window.location.host\n };\n\n this.appender(data);\n return;\n }\n };\n }", "title": "" }, { "docid": "c49251cde61a27a94b5ef3bd03fe671e", "score": "0.59952223", "text": "_startErrorHandling() {\n\t\twindow.addEventListener( 'error', this._boundErrorHandler );\n\t\twindow.addEventListener( 'unhandledrejection', this._boundErrorHandler );\n\t}", "title": "" }, { "docid": "bce5fbeed0e23ecaa13f91bcac804b57", "score": "0.5952115", "text": "function listenForErrors() {\n window.addEventListener('error', function(event) {\n globalErrors.push(event.error);\n });\n\n // Also, we treat `console.error` as a test failure. Unless you prefer not.\n var origConsole = console;\n var origError = console.error;\n console.error = function wctShimmedError() {\n origError.apply(origConsole, arguments);\n if (get('trackConsoleError')) {\n throw 'console.error: ' + Array.prototype.join.call(arguments, ' ');\n }\n };\n}", "title": "" }, { "docid": "2c812c40e53d6f793a65d81b6e2d9888", "score": "0.5803898", "text": "function installGlobalHandler() {\r\n if (_onErrorHandlerInstalled === true) {\r\n return;\r\n }\r\n _oldOnerrorHandler = window$1.onerror;\r\n window$1.onerror = traceKitWindowOnError;\r\n _onErrorHandlerInstalled = true;\r\n }", "title": "" }, { "docid": "ab18ea5e7013ec86e53fc28a26925b85", "score": "0.5775469", "text": "function _installGlobalHandler() {\n if (_onErrorHandlerInstalled === true) {\n return;\n }\n _oldOnerrorHandler = window.onerror;\n window.onerror = _traceKitWindowOnError;\n _onErrorHandlerInstalled = true;\n }", "title": "" }, { "docid": "ce7126d666863152a2ebbb95a2df87e5", "score": "0.57567644", "text": "function ExceptionHandler () {\n this.logger = console;\n\n this.dontReport = [];\n}", "title": "" }, { "docid": "b0f38c8e004edf524f0fb32af36fec02", "score": "0.55914986", "text": "function bootstrapEntrypoint() {\n process.on(\"uncaughtException\", uncaughtException);\n process.on(\"unhandledRejection\", unhandledRejection);\n}", "title": "" }, { "docid": "c094413c959cd3c011d34d356cfb9973", "score": "0.55197537", "text": "function attachErrorHandlerIfApplicable() {\n if (window.onerror !== exceptionHandler) {\n previousErrorHandler = window.onerror;\n window.onerror = exceptionHandler;\n }\n }", "title": "" }, { "docid": "9fbc7635a91da92bdfc8623ff8d2d779", "score": "0.54228514", "text": "function registerPromiseErrorHandler() {\n window.addEventListener('unhandledrejection', function (event) {\n const errorLogStore = useErrorLogStoreWithOut();\n errorLogStore.addErrorLogInfo({\n type: ErrorTypeEnum.PROMISE,\n name: 'Promise Error!',\n file: 'none',\n detail: 'promise error!',\n url: window.location.href,\n stack: 'promise error!',\n message: event.reason,\n });\n }, true);\n}", "title": "" }, { "docid": "10850ebde39b9421017220761a698586", "score": "0.5417131", "text": "removeUncaughtExceptionListener() {\n process.removeListener('uncaughtException', this.uncaughtExceptionHandler);\n }", "title": "" }, { "docid": "7088771cde83bddd95b609ebe8db1fa2", "score": "0.5404972", "text": "function _installGlobalUnhandledRejectionHandler() {\n window.onunhandledrejection = _traceKitWindowOnUnhandledRejection;\n }", "title": "" }, { "docid": "c7f659d2ade6e5a94efb0182f219af20", "score": "0.53951925", "text": "function pushErrorHandler (error) {\n console.log('error = ' + error);\n}", "title": "" }, { "docid": "cfbd735b1a49f68237967070d7cd5220", "score": "0.5390184", "text": "function logUncaughtError (procName, e) {\n // Not initialized yet? Ignore.\n // Hopefully uncaught errors immediately on startup are fixed in dev\n if (!telemetry) return\n\n let message\n let stack = ''\n if (e == null) {\n message = 'Unexpected undefined error'\n } else if (e.error) {\n // Uncaught Javascript errors (window.onerror), err is an ErrorEvent\n if (!e.error.message) {\n message = 'Unexpected ErrorEvent.error: ' + Object.keys(e.error).join(' ')\n } else {\n message = e.error.message\n stack = e.error.stack\n }\n } else if (e.message) {\n // err is either an Error or a plain object {message, stack}\n message = e.message\n stack = e.stack\n } else {\n // Resource errors (captured element.onerror), err is an Event\n if (!e.target) {\n message = 'Unexpected unknown error'\n } else if (!e.target.error) {\n message = 'Unexpected resource loading error: ' + getElemString(e.target)\n } else {\n message = 'Resource error ' + getElemString(e.target) + ': ' + e.target.error.code\n }\n }\n\n if (typeof stack !== 'string') stack = 'Unexpected stack: ' + stack\n if (typeof message !== 'string') message = 'Unexpected message: ' + message\n\n // Remove the first part of each file path in the stack trace.\n // - Privacy: remove personal info like C:\\Users\\<full name>\n // - Aggregation: this lets us find which stacktraces occur often\n stack = stack.replace(/\\(.*app.asar/g, '(...')\n stack = stack.replace(/at .*app.asar/g, 'at ...')\n\n // We need to POST the telemetry object, make sure it stays < 100kb\n if (telemetry.uncaughtErrors.length > 20) return\n if (message.length > 1000) message = message.substring(0, 1000)\n if (stack.length > 1000) stack = stack.substring(0, 1000)\n\n // Log the app version *at the time of the error*\n const version = config.APP_VERSION\n\n telemetry.uncaughtErrors.push({process: procName, message, stack, version})\n}", "title": "" }, { "docid": "1e149c9bb63bfec94110526a7dbf31ed", "score": "0.5384986", "text": "function get_default_error_handler( error ) {\n console.error(error);\n}", "title": "" }, { "docid": "4a507a2dacfe33e5ead92fe6001fcfb1", "score": "0.5378533", "text": "function uninstallGlobalHandler() {\r\n if (_onErrorHandlerInstalled) {\r\n window$1.onerror = _oldOnerrorHandler;\r\n _onErrorHandlerInstalled = false;\r\n }\r\n }", "title": "" }, { "docid": "33d817c05343171376f98f734c4e4b76", "score": "0.53325605", "text": "function register_eventhandlers() {\n window.onbeforeunload = dispose;\n AppDebug.print(\"Page events registered...\");\n }", "title": "" }, { "docid": "0eb07ea763c37b77bc0d1f2cb85ed787", "score": "0.5316323", "text": "function onError(e) {\n console.error(e);\n}", "title": "" }, { "docid": "bb114cf3757b817950d2e4429eb29abd", "score": "0.53079766", "text": "function earlyBailHandler() {\n console.error(\"IMMINENT EVENT LOOP TERMINATION IMPLYING BAD TEST, \" +\n \"DUMPING LOG.\");\n self.dumpLogResultsToConsole(errorTrapper.reliableOutput);\n }", "title": "" }, { "docid": "43479c427eeecffb127ecdc7379d19ae", "score": "0.52803075", "text": "_runOnError() {\n this.onErrorFns.forEach(fn => {\n try {\n fn.call(this.context);\n } catch(error) {\n this._logEntry(error);\n if (this.throw) {\n throw error;\n }\n }\n });\n }", "title": "" }, { "docid": "282a2c2e9a5b2b189d317a0ebc948d79", "score": "0.5278453", "text": "function codeToInject() {\n\n function handleCustomError(message, stack) {\n if (!stack) {\n stack = (new Error()).stack.split(\"\\n\").splice(2, 4).join(\"\\n\");\n }\n\n var stackLines = stack.split(\"\\n\");\n var callSrc = (stackLines.length > 1 && (/^.*?\\((.*?):(\\d+):(\\d+)/.exec(stackLines[1]) || /(\\w+:\\/\\/.*?):(\\d+):(\\d+)/.exec(stackLines[1]))) || [null, null, null, null];\n\n document.dispatchEvent(new CustomEvent('ErrorToExtension', {\n detail: {\n stack: stackLines.join(\"\\n\"),\n url: callSrc[1],\n line: callSrc[2],\n col: callSrc[3],\n text: message\n }\n }));\n }\n\n // handle uncaught promises errors\n window.addEventListener('unhandledrejection', function (e) {\n if (typeof e.reason === 'undefined') {\n e.reason = e.detail;\n }\n handleCustomError(e.reason.message, e.reason.stack);\n });\n\n // handle console.error()\n var consoleErrorFunc = window.console.error;\n window.console.error = function () {\n var argsArray = [];\n for (var i in arguments) { // because arguments.join() not working! oO\n argsArray.push(arguments[i]);\n }\n consoleErrorFunc.apply(console, argsArray);\n\n handleCustomError(argsArray.length == 1 && typeof argsArray[0] == 'string' ? argsArray[0] : JSON.stringify(argsArray.length == 1 ? argsArray[0] : argsArray));\n };\n\n // handle uncaught errors\n window.addEventListener('error', function (e) {\n // if (e.filename) {\n document.dispatchEvent(new CustomEvent('ErrorToExtension', {\n detail: {\n stack: e.error ? e.error.stack : null,\n url: e.filename,\n line: e.lineno,\n col: e.colno,\n text: e.message\n }\n }));\n // }\n });\n\n // handle 404 errors\n window.addEventListener('error', function (e) {\n var src = e.target.src || e.target.href;\n var baseUrl = e.target.baseURI;\n if (src && baseUrl && src != baseUrl) {\n document.dispatchEvent(new CustomEvent('ErrorToExtension', {\n detail: {\n is404: true,\n url: src\n }\n }));\n }\n }, true);\n}", "title": "" }, { "docid": "104a43877346899ccc52a727bfedf397", "score": "0.5258403", "text": "function installGlobalUnhandledRejectionHandler() {\r\n if (_onUnhandledRejectionHandlerInstalled === true) {\r\n return;\r\n }\r\n _oldOnunhandledrejectionHandler = window$1.onunhandledrejection;\r\n window$1.onunhandledrejection = traceKitWindowOnUnhandledRejection;\r\n _onUnhandledRejectionHandlerInstalled = true;\r\n }", "title": "" }, { "docid": "bea1c0782a00afc69915f8ed0d394770", "score": "0.5212382", "text": "function eventHandler(e) {\n if (e.page.path === _loader2.default.getPage(pathname).path) {\n _emitter2.default.off(\"onPostLoadPageResources\", eventHandler);\n clearTimeout(timeoutId);\n window.___history.push(pathname);\n }\n }", "title": "" }, { "docid": "dcdc7468a5143d5476de23ad600ff98c", "score": "0.5191392", "text": "function hookEventsToLog() {\n // Set up low-level event capturing. This intercepts all\n // native events before they bubble, so we log the state\n // *before* normal event processing.\n for (var event_type in EVENT_TYPES_TO_LOG) {\n document.addEventListener(event_type, logEvent, true);\n }\n\n // Once the page is loaded, show our own unique id.\n $(function() {\n console.log('Your unique id is', uid);\n });\n\n // Listen to 'log' events which are triggered anywhere in the document.\n $(document).on('log', logEvent);\n}", "title": "" }, { "docid": "8333e25409ee32935dd5e9461e5b36cd", "score": "0.51773447", "text": "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(location);\n\t }\n\t }", "title": "" }, { "docid": "431d1a1af0849bd0ba41bc4e04068125", "score": "0.51771635", "text": "function ex_log( message )\n{\n\ttry\n\t{\n\t\tif (console && console.log) console.log(message);\n\t}\n\tcatch (err)\n\t{\n\t\t//window.alert(message);\n\t}\n}", "title": "" }, { "docid": "f6a6ebe423af8d20bcf251485ecbda9e", "score": "0.51761377", "text": "function logEventHandler(msg) {\n console.log('logEventHandler Handler Called ' + msg);\n}", "title": "" }, { "docid": "a8069c123d2c250a441a5ece6379e6d4", "score": "0.51753616", "text": "function uncaughtExceptionHandler(ex) {\n if (self._logBadThingsToLogger)\n self._logBadThingsToLogger.uncaughtException(ex);\n }", "title": "" }, { "docid": "6582ed253e894a31d65954adf27670dc", "score": "0.5174893", "text": "static _logError() {\n // XXX implement this\n console.error.apply(console, arguments);\n }", "title": "" }, { "docid": "5b9c0c32d5983de368840475bd1ff884", "score": "0.5163139", "text": "function AttachEventHandlers() {\n\n //If the event handlers have already been attached, get outta here.\n if (mbEventHandlersAttached) return;\n \n //Attach standard event handlers for input fields. \n try {\n AttachEventHandlersToFields();\n }\n catch(e) {\n //ignore error\n }\n \n //Page-specific event handlers go here.\n //AddEvt($(\"XXXXXX\"), \"mouseover\", functionXXXXX);\n \n //AddEvt($(\"New\"), \"mouseover\", functionXXXXX);\n \n \n \n //Set flag to indicate event handlers have been attached.\n mbEventHandlersAttached = true;\n}", "title": "" }, { "docid": "6d60010090b26889f03904ba165d8a7b", "score": "0.5118179", "text": "function exceptionHandler(event) {\n alert(\"Exception: \" + event.code + \"::\" + event.message);\n}", "title": "" }, { "docid": "9897241df7ba124f1d32e74b7a3bc3a2", "score": "0.5100165", "text": "_stopErrorHandling() {\n window.removeEventListener('error', this._boundErrorHandler);\n window.removeEventListener('unhandledrejection', this._boundErrorHandler);\n }", "title": "" }, { "docid": "82e6e3b321c6f45e391fb816409f8b08", "score": "0.50913554", "text": "function takeOverConsole () {\n var console = window.console\n if (!console) return\n\n function intercept (method) {\n var original = console[method]\n console[method] = function () {\n for (i = 0; i < arguments.length; i++) {\n if (typeof arguments[i] === 'string' &&\n arguments[i].indexOf('Error 404 means that Python module') === -1 &&\n arguments[i].indexOf('using indexedDB for stdlib modules cache') === -1) {\n PrintConsole(arguments[i])\n }\n }\n if (original.apply) {\n // Do this for normal browsers\n original.apply(console, arguments)\n } else {\n // Do this for IE\n var message = Array.prototype.slice.apply(arguments).join(' ')\n original(message)\n }\n }\n }\n var methods = ['log', 'warn', 'error']\n for (var i = 0; i < methods.length; i++) { intercept(methods[i]) }\n }", "title": "" }, { "docid": "d2853806692eaf03a21de28e23954f4b", "score": "0.50857246", "text": "function log(msg) {\n\ttry {\n\t\tconsole.log(msg);\n\t} catch (error) {\n\t\ttry {\n\t\t\twindow.opera.postError(msg)\n\t\t} catch (error) {\n\t\t\t// no console available\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a5f4e2386e41cf0d4f684d8c6d6baaaa", "score": "0.5076004", "text": "function _error_handler(err) {\n if (err) {\n if (Array.isArray(err) && err.length === 0) {\n return;\n }\n console.error('An error occured: ', err);\n }\n }", "title": "" }, { "docid": "6924c60f049cba9f038ca21a562a3122", "score": "0.5075262", "text": "function log(message){if(console){console.log(message)}else{alert(message)}}", "title": "" }, { "docid": "f821b0ddf8f7383d41fe165ba3c39ac3", "score": "0.50701994", "text": "errorHandler() { }", "title": "" }, { "docid": "5871ee1a1f449dc85c41e49e549e5190", "score": "0.5066252", "text": "function exceptionHandler(event) {\r\n\t\t\t\t\talert('Exception: ' + event.code + '::' + event.message);\r\n\t\t\t\t}", "title": "" }, { "docid": "c5f01ad29f31b58d3f8ce6171a7f263f", "score": "0.506339", "text": "_logEntry(error) {\n Logger.info(`We can't do anything about this! An error occurred: [${error}]`);\n }", "title": "" }, { "docid": "56b1e54c351214bcf2da8b28ea17777d", "score": "0.5054907", "text": "function registerResourceErrorHandler() {\n // Monitoring resource loading error(img,script,css,and jsonp)\n window.addEventListener('error', function (e) {\n const target = e.target ? e.target : e.srcElement;\n const errorLogStore = useErrorLogStoreWithOut();\n errorLogStore.addErrorLogInfo({\n type: ErrorTypeEnum.RESOURCE,\n name: 'Resource Error!',\n file: (e.target || {}).currentSrc,\n detail: JSON.stringify({\n tagName: target.localName,\n html: target.outerHTML,\n type: e.type,\n }),\n url: window.location.href,\n stack: 'resource is not found',\n message: (e.target || {}).localName + ' is load error',\n });\n }, true);\n}", "title": "" }, { "docid": "7bea0472d6ae362365ec3c91f2891a26", "score": "0.5048148", "text": "function capturePageEventsForTearDown() {\n page.on('newListener', (eventName, listener) => {\n pageEvents.push([eventName, listener]);\n });\n}", "title": "" }, { "docid": "b07511c6dd91a5716539d51ea540aa77", "score": "0.50224465", "text": "errorHandler() {\n this.handleMissing();\n }", "title": "" }, { "docid": "c1e0f521abf66c0f490b6967d274a6e4", "score": "0.5021788", "text": "function register_event_handlers()\n {\n \n /* listitem #btnConsole */\n $(document).on(\"click\", \"#btnConsole\", function(evt)\n {\n /* your code goes here */ \n console.log(\"Clicou no botão 'console'\");\n console.log(\"Posso manipular qualquer mensagem no log, muito útil para debugarmos o código...\");\n \n });\n \n /* listitem #btnAlerta */\n $(document).on(\"click\", \"#btnAlertaCorreto\", function(evt)\n {\n /* your code goes here */ \n alert(\"Teste de mensagem do botão 'alerta sem erro'...\");\n });\n \n /* listitem #btnAlertaErrado */\n $(document).on(\"click\", \"#btnAlertaErrado\", function(evt)\n {\n /* your code goes here */ \n aler(\"Teste de mensagem do botão 'alerta com erro'...\");\n });\n \n }", "title": "" }, { "docid": "a0fbc198525597fc7b78f2193f8d51f6", "score": "0.50159854", "text": "static error() {\n log.on('error', function error() {\n /* eslint-disable no-console */\n const args = Array.prototype.slice.call(arguments);\n args.unshift(Log.color[Log.levelColor('error')]('[error]:'));\n args.unshift(Log.color.cyan('mrchange'));\n console.log.apply(console, args.map(i => Log.color.red(i)));\n /* eslint-enable no-console */\n });\n }", "title": "" }, { "docid": "f6716101c3a3d3778dcf9e7fd3946ec9", "score": "0.50073355", "text": "function errorHandler(e)\n\t\t{\n\t\t\t// TODO -> _instance.dispatchEvent({type:_instance.LOAD_ERROR});\n\t\t}", "title": "" }, { "docid": "b56ac49110d70ddaf053283f24d8676d", "score": "0.5004444", "text": "function register_event_handlers()\n {\n\n\n }", "title": "" }, { "docid": "cd45f358d3455ed538f9fb18bc5d13aa", "score": "0.5002061", "text": "_catchAllErrors() {\n if (typeof window === 'undefined') return;\n window.onerror = (message, fileName, lineNumber, columnNumber) => {\n var errorInfo = {\n message,\n fileName,\n lineNumber,\n columnNumber,\n location: location.href,\n userAgent: navigator.userAgent\n };\n this.log(JSON.stringify(errorInfo));\n };\n }", "title": "" }, { "docid": "680ff2d4160b180cc46551d8de83cd1c", "score": "0.49975008", "text": "function browserLogEvent(level, event, $log) {\n switch (level) {\n case 'error':\n $log.error(event);\n break;\n case 'warn':\n $log.warn(event);\n break;\n case 'info':\n $log.info(event);\n break;\n case 'debug':\n $log.debug(event);\n break;\n default:\n $log.log(event);\n }\n}", "title": "" }, { "docid": "4582a2d107e88af97714e0d784c703f5", "score": "0.49953938", "text": "registerEventHandlers () {}", "title": "" }, { "docid": "2ee8bc7d9c40a5b661e582aaf8f3fe38", "score": "0.49841753", "text": "function listenError() {\n\t\twindow.addEventListener('error', function (e) {\n\t\t\tVITest.reportError(e);\n\t\t});\n\t}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.49838138", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.49838138", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.49838138", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.49838138", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.49838138", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.49838138", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.49838138", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.49838138", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.49838138", "text": "function EventHandlers() {}", "title": "" }, { "docid": "0779d40b0d07f9c88142fe6c98c2745f", "score": "0.49833325", "text": "addHandlerRender(handler) {\n ['hashchange', 'load'].forEach(ev => window.addEventListener(ev, handler));\n }", "title": "" }, { "docid": "4d2701715322c522726636256ba73a6d", "score": "0.49797264", "text": "function log(msg, type) {\r\n\t\tvar types = {e: \"error\", w: \"warn\", i: \"info\", l: \"log\"};\r\n\t\tif (types[type] in console) {\r\n\t\t\tconsole[types[type]](msg);\r\n\t\t} else {\r\n\t\t\tconsole.log(msg);\r\n\t\t}\r\n\t\treturn;\r\n\t}", "title": "" }, { "docid": "92dc5dc0c657d9d7ece369fbf876b105", "score": "0.4979251", "text": "function handleError(event) {\n log(\"Error:\" + event.data);\n}", "title": "" }, { "docid": "aca139c7abb17ff5c1e08e2c9a8c7ed0", "score": "0.4973715", "text": "function removePageEvents() {\n pageEvents.forEach(([eventName, handler]) => {\n page.removeListener(eventName, handler);\n });\n}", "title": "" }, { "docid": "c4cb4725795ddb8c97a67d111cc74b0b", "score": "0.49709928", "text": "function capturePageEventsForTearDown() {\n\tpage.on( 'newListener', ( eventName, listener ) => {\n\t\tpageEvents.push( [ eventName, listener ] );\n\t} );\n}", "title": "" }, { "docid": "940954ba8b776749e126e7ae0e891c50", "score": "0.49648455", "text": "handleError( tab, error ) {\n const msg = `${tab.type}Error: ${error}.`;\n this.errors.push( msg );\n console.warn( msg );\n }", "title": "" }, { "docid": "1e71c9857a28d3c8fe2c9755d738a809", "score": "0.4947583", "text": "function puxHandleError(e) {\n\t\tconsole.log('Error loading import: ' + e.target.href);\n\t}", "title": "" }, { "docid": "edaf0b0ae03181540aacf1d26042add3", "score": "0.4944831", "text": "function addGlobalErrorHandler(useAlert = false) {\n window.onerror = (msg, url, line, col, error) => {\n const colTxt = col ? `\\ncolumn: ${col}` : ''\n const errTxt = error ? `\\nerror: ${error}` : ''\n const extra = `${colTxt} ${errTxt}`\n\n const message = `Error: ${msg}\\nurl: ${url}\\nline: ${line} ${extra}`\n if (useAlert) {\n alert(message)\n } else {\n console.log(message)\n }\n\n const suppressErrorAlert = true\n return suppressErrorAlert\n }\n}", "title": "" }, { "docid": "16bc65cd92cf379289c8111a206cb4dc", "score": "0.49281165", "text": "function defaultPossiblyUnhandledRejectionHandler(promise) {\n var log = true;\n // First try to emit Node event\n if (typeof process !== \"undefined\" && typeof process.emit === \"function\") {\n if (process.emit(\"unhandledRejection\", promise.reason(), promise)) {\n // A handler was called\n log = false;\n }\n }\n else if (typeof PromiseRejectionEvent === \"function\") {\n // Then fire a browser event if supported by the browser\n if (emitRejectionEvent(\"unhandledrejection\", promise.reason(), promise)) {\n log = false;\n }\n }\n // Fallback to log to console\n if (log) {\n var possiblyUnhandledRejection = new PossiblyUnhandledRejection(promise);\n // tslint:disable-next-line:no-console\n console.warn(possiblyUnhandledRejection.stack);\n }\n}", "title": "" }, { "docid": "55c873d263611133111f66f74f16a014", "score": "0.49277484", "text": "log(type, message) {\n if (process.env.NODE_ENV !== \"development\") {\n return;\n }\n\n switch (type) {\n case \"warn\":\n console.warn(message);\n break;\n\n case \"error\":\n throw new Error(message);\n break;\n }\n }", "title": "" }, { "docid": "07126de74e9174915301b8f5f98b5e32", "score": "0.4916037", "text": "function onError(e) {\n\t\tconsole.log(e);\n\t}", "title": "" }, { "docid": "dbcac24f65347a4c731f11751fccb80d", "score": "0.49134105", "text": "function handleError(err) {\n console.error(err);\n}", "title": "" }, { "docid": "e5802848733c91bfb7a568356252e5f6", "score": "0.49082372", "text": "_stopErrorHandling() {\n\t\twindow.removeEventListener( 'error', this._boundErrorHandler );\n\t\twindow.removeEventListener( 'unhandledrejection', this._boundErrorHandler );\n\t}", "title": "" }, { "docid": "df527f0a974bc9b77be24f5808e7cc52", "score": "0.4898039", "text": "function handleError(err, vm, info) {\n if (config.errorHandler) {\n config.errorHandler.call(null, err, vm, info);\n } else {\n if (inBrowser && typeof console !== \"undefined\") {\n console.error(err);\n } else {\n throw err;\n }\n }\n }", "title": "" }, { "docid": "baf13d2af79b1f1cf966518e5a47edeb", "score": "0.4894447", "text": "function handleError(err, vm, info) {\n if (config.errorHandler) {\n config.errorHandler.call(null, err, vm, info)\n } else {\n if (inBrowser && typeof console !== \"undefined\") {\n console.error(err)\n } else {\n throw err\n }\n }\n }", "title": "" }, { "docid": "681ffb96132cc410826b14f284445b10", "score": "0.48885524", "text": "function errorHandler(error) {\n console.log('errorHandler error = ' + error);\n}", "title": "" }, { "docid": "181f3c7e6cfbea687e507aff15721abf", "score": "0.48857066", "text": "function installUnhandledPromiseErrorHandler() {\n window.addEventListener('unhandledrejection', function (event) {\n if (event.reason) {\n report(event.reason, 'Unhandled Promise rejection');\n }\n });\n}", "title": "" }, { "docid": "a69db575cced11d795c52e7f271e4b3a", "score": "0.48826668", "text": "function setupTerminationHandlers(){\n // Process on exit and signals.\n process.on('exit', function() { zapp.terminator(); });\n\n // Removed 'SIGPIPE' from the list - bugz 852598.\n ['SIGHUP', 'SIGINT', 'SIGQUIT', 'SIGILL', 'SIGTRAP', 'SIGABRT',\n 'SIGBUS', 'SIGFPE', 'SIGUSR1', 'SIGSEGV', 'SIGUSR2', 'SIGTERM'\n ].forEach(function(element, index, array) {\n process.on(element, function() { zapp.terminator(element); });\n });\n}", "title": "" }, { "docid": "c4c19155b0ae9330faa821925c46f21e", "score": "0.4879653", "text": "function removePageEvents() {\n\twhile ( pageEvents.length ) {\n\t\tconst [ eventName, handler ] = pageEvents.pop();\n\t\tpage.removeListener( eventName, handler );\n\t}\n}", "title": "" }, { "docid": "eaac4581c1adab00d3f17d81964c8533", "score": "0.48771095", "text": "function enableConsoleProtection() {\n if (!console || !console.log) { console = { log: function () {} }; }\n if (!console.debug || !console.error || !console.info || !console.warn) {\n var log = console.log;\n console.debug = console.error = console.info = console.warn = log;\n }\n }", "title": "" }, { "docid": "60cc0045d39a748a22ed8faa4cae3c3d", "score": "0.4875305", "text": "function onErrorHandler (error) {\n // throw error if system call is not listen \n if (error.sysCall != 'listen') {\n logger.error(error.code + \" not equal listen\", \"serverOnErrorHandler\", 10);\n throw error;\n }\n\n //check the various possible error code and log the info on the console\n switch (error.code) {\n case 'EACCES' :\n logger.error(error.code + \" evaluated access is required\", \"serverOnErrorHandler\", 10);\n process.exit(1);\n break;\n case 'EADDRINUSE' :\n logger.error(error.code + \" port is already in use\", \"serverOnErrorHandler\", 10);\n process.exit(1);\n break;\n default : \n logger.error(error.code + \" Some unknown errro occured\", \"serverOnErrorHandler\", 10);\n throw error;\n }\n}", "title": "" }, { "docid": "576b1b8acc4204a72f1fc0b1e46e6c39", "score": "0.48703888", "text": "function defaultErrorHandler(e) {\n console.warn('Uncaught Promise: ' + messageAndStack(e));\n }", "title": "" }, { "docid": "c7856f55d32460c7540c64f4d8a20d90", "score": "0.48669022", "text": "attachPageDBEvents(){\n log.debug('[Editor] attaching Page events')\n\n this.pageDB.on('saved', (response) => this.statusMessage.update(\"Your changes have been saved.\"))\n this.pageDB.on('error', (error) => {\n this.statusMessage.update(\"We are currently unable to save your changes.\")\n log.error(error)\n Raven.captureException(error)\n this.disableEditor();\n })\n }", "title": "" }, { "docid": "231b0e9bda30576987cfe692b9c5d9cd", "score": "0.48628876", "text": "_addServerEventHandlers() {}", "title": "" }, { "docid": "c9d7d4817838ea71e5564c491c0eba4a", "score": "0.48603433", "text": "function handleError (err, vm, info) {\n if (config.errorHandler) {\n config.errorHandler.call(null, err, vm, info);\n } else {\n if (inBrowser && typeof console !== 'undefined') {\n console.error(err);\n } else {\n throw err\n }\n }\n}", "title": "" }, { "docid": "c9d7d4817838ea71e5564c491c0eba4a", "score": "0.48603433", "text": "function handleError (err, vm, info) {\n if (config.errorHandler) {\n config.errorHandler.call(null, err, vm, info);\n } else {\n if (inBrowser && typeof console !== 'undefined') {\n console.error(err);\n } else {\n throw err\n }\n }\n}", "title": "" }, { "docid": "c9d7d4817838ea71e5564c491c0eba4a", "score": "0.48603433", "text": "function handleError (err, vm, info) {\n if (config.errorHandler) {\n config.errorHandler.call(null, err, vm, info);\n } else {\n if (inBrowser && typeof console !== 'undefined') {\n console.error(err);\n } else {\n throw err\n }\n }\n}", "title": "" }, { "docid": "4de1ebab46fede91b1f3c2b2af27756d", "score": "0.4859686", "text": "function handlePageLoad() {\n\n // set default log/trace settings.\n wl_app._logEnabled = true;\n wl_app._traceEnabled = false;\n\n checkDocumentReady(function () {\n // Invoke wlAsyncInit, if it is defined.\n var appInit = window.wlAsyncInit;\n if (appInit && (typeof (appInit) === TYPE_FUNCTION)) {\n appInit.call();\n }\n });\n}", "title": "" }, { "docid": "f81012c2873fbc269cc8bb7a215b99fe", "score": "0.48570698", "text": "bindEvents_() {\n process.on('uncaughtException', this.onUncaughtException_.bind(this));\n process.on('SIGTERM', this.onSigTerm_.bind(this));\n process.on('SIGINT', this.onSigInt_.bind(this));\n }", "title": "" }, { "docid": "98d8afcf6d265ad048ab6835fca160dc", "score": "0.48454478", "text": "function errhandler(msg, mode){\n switch(mode){\n case 'append':\n if(debug == '@flashDebug@' || debug == 1){\n c.log(msg);\n }\n break;\n case 'show':\n if(debug == '@flashDebug@' || debug == 1){\n c.log(msg);\n }\n break;\n case 'force':\n c.log(msg);\n }\n}", "title": "" }, { "docid": "1170ef4801402c563a485287d174f81d", "score": "0.4845343", "text": "function registerQuitHandler() {\n app.on('quit', () => {\n process.exit();\n });\n}", "title": "" }, { "docid": "053a17262e1a40899c00dfa65a54fc7c", "score": "0.4836175", "text": "function errorHandler(error) {\n console.log(error);\n}", "title": "" }, { "docid": "209267a592a7f06888b6b6258627e761", "score": "0.4828545", "text": "function defaultHandleError(err) {\n\tconsole.log(err)\n}", "title": "" }, { "docid": "7ed126d6f89fefbae85096e26c4cd11d", "score": "0.4825747", "text": "function setupTerminationHandlers (){\n // Process on exit and signals.\n process.on('exit', function() { terminator(); });\n\n // Removed 'SIGPIPE' from the list - bugz 852598.\n ['SIGHUP', 'SIGINT', 'SIGQUIT', 'SIGILL', 'SIGTRAP', 'SIGABRT',\n 'SIGBUS', 'SIGFPE', 'SIGUSR1', 'SIGSEGV', 'SIGUSR2', 'SIGTERM'\n ].forEach(function(element, index, array) {\n process.on(element, function() { terminator(element); });\n });\n }", "title": "" }, { "docid": "5e0d80186da87fb51061036cd7e4f644", "score": "0.48186558", "text": "function onError(e) {\n\tconsole.log(e);\n}", "title": "" }, { "docid": "6d19cccc6dacb335855b4d5a3d50a29f", "score": "0.48154166", "text": "function registerErrorInstrumentation() {\n utils_1.addInstrumentationHandler({\n callback: errorCallback,\n type: 'error',\n });\n utils_1.addInstrumentationHandler({\n callback: errorCallback,\n type: 'unhandledrejection',\n });\n}", "title": "" } ]
43c513904ca4dbbab67e9e4d1aff4efa
The Service namespace is an accessor function ...
[ { "docid": "a10191fbaec64fa86b35b6f1e7e2fedf", "score": "0.6523555", "text": "function serviceNamespace(appArg) {\n if (appArg === void 0) {\n appArg = app();\n } // @ts-ignore\n\n\n if (typeof appArg[name] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n throw ERROR_FACTORY.create(\"invalid-app-argument\"\n /* INVALID_APP_ARGUMENT */\n , {\n name: name\n });\n } // Forward service instance lookup to the FirebaseApp.\n // @ts-ignore\n\n\n return appArg[name]();\n } // ... and a container for service-level properties.", "title": "" } ]
[ { "docid": "bc9a9b40cdb6a91b5e5b2cc8c0e36838", "score": "0.7590112", "text": "get service() {\n\t\treturn this.__service;\n\t}", "title": "" }, { "docid": "741eb9b1e2f1e1907233ec6ce192f4eb", "score": "0.75225276", "text": "function Service() {}", "title": "" }, { "docid": "620d4155ad1c9be32045a36aff30f3ba", "score": "0.7452917", "text": "get service() { return this.get('service'); }", "title": "" }, { "docid": "7a9f8210421b1cb0a01275bbb6c505ed", "score": "0.71301895", "text": "getService(){\n\n }", "title": "" }, { "docid": "fc33dfa944c27f7e5f9e92fe00070725", "score": "0.7087295", "text": "function Service() {\n}", "title": "" }, { "docid": "1d7c2b5387647ed0254a73b254dcb6ad", "score": "0.69642365", "text": "getService() {\n return this.service;\n }", "title": "" }, { "docid": "704ff0408220baa81f1a66b30bb5f0a8", "score": "0.6871247", "text": "function getService(domain) { return servicePointer[domain]; }", "title": "" }, { "docid": "5e43696ab7f7f56ff1b9ea41293efc5b", "score": "0.68667626", "text": "service(name) { return this.services[name.name || name]; }", "title": "" }, { "docid": "98ea630ff62c78b401000011549a3b94", "score": "0.6772125", "text": "function _getService() {\n return \"\";\n}", "title": "" }, { "docid": "d5a71200940fac31dda818c3950dd75c", "score": "0.6579104", "text": "function Service() {\n return {\n emailAddress: null,\n isDefault: null,\n name: null,\n type: null\n };\n }", "title": "" }, { "docid": "57f66b5a6d9ac9e83b002c034dfafe01", "score": "0.65409815", "text": "setService() {\n this.service = Service;\n }", "title": "" }, { "docid": "67eb64767d503f0a52c025a0f0b903fe", "score": "0.6518496", "text": "function ClientService() {\n\n}", "title": "" }, { "docid": "a90f8b059331bb6f439cd6467082b834", "score": "0.6504032", "text": "function serviceNamespace(appArg) {\n if (appArg === void 0) {\n appArg = app();\n } // @ts-ignore\n\n\n if (typeof appArg[name] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n throw ERROR_FACTORY.create(\"invalid-app-argument\"\n /* INVALID_APP_ARGUMENT */\n , {\n appName: name\n });\n } // Forward service instance lookup to the FirebaseApp.\n // @ts-ignore\n\n\n return appArg[name]();\n } // ... and a container for service-level properties.", "title": "" }, { "docid": "3d147f034f3834ac2221c5edf9709605", "score": "0.6396234", "text": "function Service() {\n\t// do nothing\n}", "title": "" }, { "docid": "96ec670baad7ec771fcee201a4fb5325", "score": "0.63764954", "text": "get services() {\n return this._services;\n }", "title": "" }, { "docid": "a991336697b9990144bd8d38af756313", "score": "0.63757807", "text": "function AnotherService () {\n\n var _AnotherService = {};\n \n _AnotherService.someValue = '';\n\n _AnotherService.someMethod = function () {\n\n };\n \n return _AnotherService;\n}", "title": "" }, { "docid": "03ff7a9931fb4f9fe950579b355f3ee7", "score": "0.6353441", "text": "function SomeService() {\n this.someValue = 1;\n\n this.someMethod = function() {\n return this.someValue + 10;\n }\n }", "title": "" }, { "docid": "470c8b72b71ef12f654fcf88f9d78af5", "score": "0.63513273", "text": "getServices () {\n return this._services;\n }", "title": "" }, { "docid": "8a76133fe943b6023e94bbe271ac4425", "score": "0.6310857", "text": "getAllServices(){\n this.getBtcCost();\n this.getTrades();\n this.getGraphic();\n this.getOrderBook();\n this.getBooks();\n }", "title": "" }, { "docid": "20a17a5d915533468dce6a57ac070bf2", "score": "0.6267083", "text": "constructor(service, key) {\n this.service = service;\n this._key = key;\n }", "title": "" }, { "docid": "6ba71d4f43158a0df54781dd5cd46c75", "score": "0.62454605", "text": "function ServiceConfiguration () {} // 626", "title": "" }, { "docid": "40e4c24ee8e0da3881eb288df4947e9d", "score": "0.6222553", "text": "function SubscriptionService() {\n\n}", "title": "" }, { "docid": "4ca6a716ca46ad282790f9eeeda28cc4", "score": "0.6214174", "text": "function SomeService(){\n var api = {};\n api.dataMessage = 'test 123 service data'; \n return api;\n }", "title": "" }, { "docid": "c82becd6316fe79598816eff4ea74271", "score": "0.6202351", "text": "getServices () {\n return this.services\n }", "title": "" }, { "docid": "401f69380165af7c0872067aa0bcebe5", "score": "0.6125887", "text": "getService(mount) {\n return this.request({\n path: \"/_api/foxx/service\",\n qs: { mount },\n }, (res) => res.body);\n }", "title": "" }, { "docid": "d0934113d0df3f03f586689200673c6f", "score": "0.6106334", "text": "getService(clientId, serviceName) {\n return this._clients[clientId] ? this._clients[clientId].$services[serviceName] : null\n }", "title": "" }, { "docid": "6eeb9c833ec5e378eabcc0122aecd700", "score": "0.60888326", "text": "getService(serviceName) {\n if (this._services[serviceName]) return { [serviceName]: this._services[serviceName] }\n else {\n const rxServices = new RegExp(`${serviceName}`, 'i')\n for (let service in this._services) {\n if (this._services[service].constructor && rxServices.test(this._services[service].constructor.name)) return this._services[service];\n }\n }\n }", "title": "" }, { "docid": "25925c8d2f6c507cf27966c7d31d24f5", "score": "0.6085525", "text": "function getServiceName() {\n return \"Local\";\n}", "title": "" }, { "docid": "f03ebaf6bf25d9e1c82807b7ebb295be", "score": "0.6044558", "text": "function WeaveSvc() {\n this._notify = Utils.notify(\"weave:service:\");\n}", "title": "" }, { "docid": "c488288dc71591b2e1c0a1aa10f7bbc4", "score": "0.60240996", "text": "function serviceNamespace(appArg) {\r\n if (appArg === void 0) { appArg = app(); }\r\n // @ts-ignore\r\n if (typeof appArg[name] !== 'function') {\r\n // Invalid argument.\r\n // This happens in the following case: firebase.storage('gs:/')\r\n throw ERROR_FACTORY.create(\"invalid-app-argument\" /* INVALID_APP_ARGUMENT */, {\r\n appName: name\r\n });\r\n }\r\n // Forward service instance lookup to the FirebaseApp.\r\n // @ts-ignore\r\n return appArg[name]();\r\n }", "title": "" }, { "docid": "113abe460e790811626a6db2062e88cc", "score": "0.5991173", "text": "getServices() {\n return [\n this.informationService,\n this.lightbulbService,\n ];\n }", "title": "" }, { "docid": "4d346ee334ffb30b9c8f5842c383eaee", "score": "0.5982676", "text": "function <%= _.classify(name) %>() {\n\n //always bind to an object.property\n var model = {\n data: null\n };\n\n /**\n * doSomething() - Private function\n */\n function doSomething() {\n // add logic here...\n }\n\n var service = {\n doSomething: doSomething,\n get data() {\n return model.data;\n },\n set data(val) {\n model.data = val;\n }\n };\n\n return service;\n }", "title": "" }, { "docid": "815f1a9d0a4d3d51e79d89f101260c27", "score": "0.59784245", "text": "get serviceDate() {\n\t\treturn this.__serviceDate;\n\t}", "title": "" }, { "docid": "87293d8375c6b9e18e30f2710dcb89d3", "score": "0.5966058", "text": "function serviceNamespace(appArg) {\n if (appArg === void 0) { appArg = app(); }\n // @ts-ignore\n if (typeof appArg[name] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n throw ERROR_FACTORY.create(\"invalid-app-argument\" /* INVALID_APP_ARGUMENT */, {\n appName: name\n });\n }\n // Forward service instance lookup to the FirebaseApp.\n // @ts-ignore\n return appArg[name]();\n }", "title": "" }, { "docid": "506f9dfd3074b344f472a4be15d4f8d1", "score": "0.5953518", "text": "static _field () {\n throw new Error(\"Extending service must implement '_field()'\")\n }", "title": "" }, { "docid": "26170a1bf7fdb99e9fd7e9661cfb146b", "score": "0.5946216", "text": "function StartupService() { \r\n}", "title": "" }, { "docid": "8b27b38e028dcb85605081f60670a0be", "score": "0.5910066", "text": "service ( string ) { return chalk.magenta.bold( string ); }", "title": "" }, { "docid": "3b02b3a79ef151c3f8f4f96acf1c3cb6", "score": "0.5909277", "text": "function inspectService(serviceName) {\r\n\t\t$.getService(serviceName, function (module) {\r\n\t\t\t//log(\"module.__mobj:\");\r\n\t\t\t//log(module.__mobj);\r\n\t\t\t// I could print methods, but there are usually a quadrillion\r\n\t\t\tvar signals = module.__mobj[1][1];\r\n\t\t\tlog(\"signals in \" + serviceName + \":\");\r\n\t\t\tfor (var i in signals)\r\n\t\t\t{\r\n\t\t\t var signalName = signals[i][1];\r\n\t\t\t log(\" \" + i + \": \" + signalName);\r\n\t\t\t}\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "cf772ac26b44ce2168b72761a56276dd", "score": "0.5875195", "text": "static myServiceMask() {\n if (!Services._myServiceMask) throw new Error('ServiceMask is not configured');\n return Services._myServiceMask;\n }", "title": "" }, { "docid": "8935b89088ec49eb1e466c7c718a744b", "score": "0.5861583", "text": "function instanceModelService() {\n\n var service = {\n serviceId: \"instanceModelService\"\n };\n\n //\n // constrained values\n //\n\n service.hasConstrainedValue = function (model) {\n return model['@id'];\n };\n\n service.getConstrainedTermId = function (model) {\n return model['@id'];\n };\n\n service.getConstrainedLabel = function (model) {\n return model['rdfs:label'];\n };\n\n service.getConstrainedNotation = function (model) {\n return model['skos:notation'];\n };\n\n service.setConstrainedValue = function (model, termId, label, notation) {\n if (termId) model['@id'] = termId;\n if (label) model['rdfs:label'] = label;\n if (notation) model['skos:notation'] = notation;\n return model;\n };\n\n service.removeConstrainedValue = function(model) {\n delete model['@id'];\n delete model['rdfs:label'];\n delete model['skos:notation'];\n };\n\n\n\n return service;\n }", "title": "" }, { "docid": "b1375e083776ee63586c16b3c9802dff", "score": "0.58613986", "text": "function ServiceFunc() {\n console.log('ServiceFunc run.');\n\n this.sayHello = function(text) {\n return 'Service says \"Hello ' + text + '\"';\n };\n}", "title": "" }, { "docid": "df5c3ac648bcf521834641225eaf1189", "score": "0.5848127", "text": "function OfferService() {\n\n}", "title": "" }, { "docid": "61c8c35b2ee3c90bb006529a8b417c65", "score": "0.5843616", "text": "constructor(slService) {\n this.slService = slService;\n }", "title": "" }, { "docid": "8ca0d335513bcb9dc8918931a95e3245", "score": "0.57850206", "text": "getServices() {\n return [this.informationService, this.temperatureService]\n }", "title": "" }, { "docid": "7bad168b23367be528f68771bb7fcedf", "score": "0.57761914", "text": "withService(service) {\n this.service = service;\n\n return this;\n }", "title": "" }, { "docid": "e7285980a112f1496dd9d5148da47dd4", "score": "0.5765017", "text": "function ServiceRegister(m){\n this.m = m;\n}", "title": "" }, { "docid": "675d8d6367586bfd53119420f69a32f1", "score": "0.5756327", "text": "get ioService() {\n return Services.io;\n }", "title": "" }, { "docid": "9750e0c13541e12c59e36d30f1892c37", "score": "0.5734469", "text": "function MucProxy(service) {\n this.service = service;\n this.helpers = new Helpers;\n}", "title": "" }, { "docid": "2defbe07b5eacc2a9371c28278c4486a", "score": "0.57303804", "text": "constructor() {\n\n /**\n * List of enabled services.\n * @type {Array}\n */\n Object.defineProperty(this, '$enabledServices', {value: [], writable: true});\n\n /**\n * List of settings\n * @type {Object}\n */\n Object.defineProperty(this, '$settings', {value: {}, writable: true});\n\n }", "title": "" }, { "docid": "ac49d6f2d7dcc678740d4ca0f480a3ee", "score": "0.57297033", "text": "function Service(name) {\n /**\n * A list of all nodes that are inside this service\n * @type {Array}\n */\n this.nodeList = [];\n /**\n * A list of all edges that are inside this service\n * @type {Array}\n */\n this.edgeList = [];\n this.name = name;\n }", "title": "" }, { "docid": "ff218817212864cc7afa758043f9e8ed", "score": "0.57199115", "text": "function testService() {\n // Taking service from module 'my-module'\n angular.injector(['my-module']).get(serviceName); // don't change this.\n }", "title": "" }, { "docid": "eb1cf40ddc68e9c0d7185671fb788a54", "score": "0.5700926", "text": "GetThisObjectProperties(serviceName) {\n let url = `/vps/${serviceName}`;\n return this.client.request('GET', url);\n }", "title": "" }, { "docid": "5382c1792b753de013d46ed5daa326dd", "score": "0.5695253", "text": "function GenericService() {\n this.id = null; // (app level) unique id, e.g. for use in html user interface\n this.owner = null; // person that owns the device the service is running on\n this.device = null; // (addressable) id of device the service is running on\n this.name = \"(you shouldn't see this!)\"; // friendly name, to be overridden\n this.ns = null; // name space that (globally) uniquely defines the service type\n \n this.onRemove = null; // callback function for 'on removal'\n this.remove = genericRemove; // function called by WebinosImpl\n this.isLocal = genericIsLocal; // returns true is the service is running on the local device\n this.isMine = genericIsMine; // returns true if the service runs on a device of same owner\n this.invoke = function(){alert('oops!');};// execute the service, needs be overridden\n}", "title": "" }, { "docid": "8f5b544e8e5d1bd1a14ac1e19dc383d2", "score": "0.5694388", "text": "function ContactService(){\r\n\t\t// ... Nothing to do here ...\r\n\t}", "title": "" }, { "docid": "941078b5b36f4d7dbc6dd8dcb3b06386", "score": "0.56831765", "text": "GetThisObjectProperties(serviceName) {\n let url = `/freefax/${serviceName}`;\n return this.client.request('GET', url);\n }", "title": "" }, { "docid": "621607762ff926a2c38da2af7a5342d5", "score": "0.5674567", "text": "GetThisObjectProperties(serviceName) {\n let url = `/license/windows/${serviceName}`;\n return this.client.request('GET', url);\n }", "title": "" }, { "docid": "10188fb6d8afe1017ae1188d0febcaf1", "score": "0.5674415", "text": "getServiceFromCode( serviceCode ){\n\tlet serviceObj = null;\n\tfor ( let service in this.serviceRequestCodes ){\n\t if ( this.serviceRequestCodes[ service ].code === serviceCode.trim().toUpperCase() ){\n\t\tserviceObj = service;\n\t }\n\t}\n\treturn serviceObj;\n }", "title": "" }, { "docid": "c286cf7db2d5f011899d53ee504d9ded", "score": "0.56653875", "text": "function PaymentService() {\n\n}", "title": "" }, { "docid": "ee321fff9f4fccc7b4bff44a94513234", "score": "0.5655832", "text": "static get service() {\n return 'states';\n }", "title": "" }, { "docid": "2805e74a8a0620f34e352feff4d4d434", "score": "0.56515294", "text": "initService() {\n\t\tthis.service = new Service({\n\t\t\tonDisconnect: (hadError) => {\n\t\t\t\tthis.stopCancellableQueues(!!hadError, !!hadError);\n\t\t\t},\n\t\t\tonServiceFileUpdate: (uri) => {\n\t\t\t\tthis.event('onServiceFileUpdate', uri);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "9c3e9f99102c62d33797bef1085a8691", "score": "0.5639093", "text": "static get service() {\n return 'subscriptions';\n }", "title": "" }, { "docid": "f3e3e61b470e9df39b1e99df58151471", "score": "0.5635103", "text": "get namespaceQualifiedName() {\n return `Edm.${this.name}`;\n }", "title": "" }, { "docid": "46ebadb00d8a36e07082d145cb7867e5", "score": "0.56284857", "text": "constructor() {\n this.accountService = new RestService(\"core\", \"accounts\");\n this.iterationService = new RestService(\"core\", \"iterations\");\n this.taskService = new RestService(\"core\", \"tasks\");\n this.projectService = new RestService(\"core\", \"projects\");\n this.backlogService = new RestService(\"core\", \"backlogs\");\n }", "title": "" }, { "docid": "052a22ee0272d7b0325b3bd6a1d4e8a2", "score": "0.5628039", "text": "function CLineService()\n{}", "title": "" }, { "docid": "1b122a10ebb3ebb3f5d9c38d219619b1", "score": "0.56129664", "text": "function webServiceInfo(name){\n\t\tvar that = this;\n\t\tthat.name = name;\n\t\tthat.operations = [];\n\t}", "title": "" }, { "docid": "a773a72a1a9c5f26239dff05736997a7", "score": "0.56061816", "text": "services(id) {\n if (this.type !== 'root') throw new Error(`Cannot get services from permissions, you're already working on a user service!`);\n const cacheId = `service:${(id || '[all]')}`;\n\n if (!this.instanceCache.has(cacheId)) {\n const instance = new PermissionInstance(this.permissions.filter((p) => {\n return p.subject.type === 'service' && (type.undefined(id) || p.id == id);\n }), 'service');\n\n\n // pass requests to the paretn\n instance.onRequest = (request, response) => {this.sendRequest(request, response)};\n\n this.instanceCache.set(cacheId, instance);\n }\n\n return this.instanceCache.get(cacheId);\n }", "title": "" }, { "docid": "1fa22fdf807b8fe94ecd42bc7e2a39e4", "score": "0.5591423", "text": "function Namespace() {\n }", "title": "" }, { "docid": "4f88e5822f4c5861aee3a06fd745e6c4", "score": "0.55588436", "text": "function AccountService() {\n\tBaseService.apply(this, arguments);\n}", "title": "" }, { "docid": "0fc8ad78ecb49ad0236443e1c8ad3493", "score": "0.5555096", "text": "function KalturaXInternalService(client){\r\n\tthis.init(client);\r\n}", "title": "" }, { "docid": "0915241811d81747edb1885fe9add271", "score": "0.55549264", "text": "function named(name) {\n return new Service({ metadata: { name } });\n }", "title": "" }, { "docid": "5b8510539f08eaaf4b7039bfff9746a1", "score": "0.5525968", "text": "get docs() {\n const { docsVersion = this.serviceVersion('docs') } = this.settings\n return this.service('docs', {\n version: docsVersion,\n })\n }", "title": "" }, { "docid": "6cc2dd60723c725567421547159c2394", "score": "0.55193824", "text": "function Service(serviceDef, clock, requester) {\n this._clock = clock;\n this._deadline = serviceDef.deadline;\n this._sequence = serviceDef.sequence;\n this._requester = requester;\n this._p0 = serviceDef.p0;\n this._p100 = serviceDef.p100;\n}", "title": "" }, { "docid": "b4e61b2ad5ae157c93fd4f3a1694e58e", "score": "0.55086076", "text": "function decorateService (rawService) {\n var service = {\n properName: getServiceName(rawService),\n groupName: getServiceGroupName(rawService),\n lastIncidentTime: Date.parse(rawService.last_incident_timestamp),\n description: '', // PagerDuty will not always return a description key\n link: 'https://' + subdomain + '.pagerduty.com' + rawService.service_url\n };\n service.isSiteOrServer = service.properName === 'Site' || service.properName === 'Server';\n\n // attach status related properties like status code/number\n injectStatusProperties(service, rawService.status);\n\n // copy over all the original properties of rawService\n objectForEach(rawService, function (keyName, value) {\n service[keyName] = value;\n });\n\n return service;\n}", "title": "" }, { "docid": "f5a9265a8f24a46be53188d586da4b7f", "score": "0.5506651", "text": "function ServiceDirectory() {\n if (exports.myaddresses.length === 0)\n setMyAddresses();\n\n /**\n * Service cache of found service records. Used to eliminate duplicate advertisements.\n */\n this.serviceCache = {};\n\n /**\n * mDNS service browser instance\n */\n this.browser = null;\n\n /**\n * mDNS service advertiser instance\n */\n this.advertiser = null;\n}", "title": "" }, { "docid": "310b7a51c3764eafca4e7ae1a8919145", "score": "0.5496656", "text": "function getQualifiedMethod(service, method) {\n return service + '.' + method;\n }", "title": "" }, { "docid": "9bf408c7d3935fbb3aac58795aff8cd6", "score": "0.5495043", "text": "function ObraService(_http) {\n this._http = _http;\n }", "title": "" }, { "docid": "7c0bfee71e5afc96003793b83f846014", "score": "0.54856807", "text": "function SetorService(http) {\n this.http = http;\n this.OrgUrl = 'http://EMB641C6765D718:8080/consulta/setor';\n }", "title": "" }, { "docid": "1191d8f9344b980dd9efb4c9bece61ba", "score": "0.5483325", "text": "function RefundService() {\n\n}", "title": "" }, { "docid": "bbfda951d6b6861c13a412b7a95fd1bf", "score": "0.5482556", "text": "function Requestor(service, obj) {\n this.ServicePath = service;\n this.obj = obj;\n}", "title": "" }, { "docid": "0b895e8c61e3d9c6495ae0002edf2279", "score": "0.54818135", "text": "function SeoService(titleService) {\n this.titleService = titleService;\n this.DOM = dom_adapter_1.getDOM();\n /**\n * get the <head> Element\n * @type {any}\n */\n this.headElement = this.DOM.query('head');\n this.metaDescription = this.getOrCreateMetaElement('description');\n this.robots = this.getOrCreateMetaElement('robots');\n }", "title": "" }, { "docid": "f445dd62ea1c51701b36ca284d410fc2", "score": "0.54779226", "text": "function getService(servicename, callback){\n\tvar targetservice = apiserviceService.getServiceloader().getService(servicename);\n\t\n\tif(targetservice)\n\t\tcallback(null, targetservice.getServiceConfig());\n\telse\n\t\tapiserviceService.details(servicename, callback);\n}", "title": "" }, { "docid": "04ed5cb58b055812e60d8f16d333b28f", "score": "0.54762834", "text": "function getDataService() {\n // set the data service endpoint\n return new breeze.DataService({\n serviceName: window.location.protocol + '//' + window.location.host + '/odata/'\n });\n }", "title": "" }, { "docid": "3373d13834c5aa18218744d233e74726", "score": "0.5473594", "text": "get service() {\n // Return an async function to make the client instance.\n // This is done to allow the _initServer arg list to be exposed\n // as a property of the make function.\n const self = this;\n async function make() {\n if( !self._service ) {\n // Note that 'self' refers to the IPCService instance, whilst 'this'\n // will refer to the app backbone when invoked by the backbone.\n self._service = await self._makeServer('local', self._id, this, arguments );\n }\n return self._service;\n }\n make[ArgListToken] = readArgNames('_initServer', this._initServer );\n return make;\n }", "title": "" }, { "docid": "d6cbe17ea3a86c05ef72f612687db8ad", "score": "0.5460981", "text": "function EndpointDAO() {}", "title": "" }, { "docid": "9834658b4ae0aa80a2f57ba6e6445594", "score": "0.54601663", "text": "onNamespaceChange() {}", "title": "" }, { "docid": "7c8867fde09062f839d7a72e3d3d89f3", "score": "0.54552346", "text": "function ShoppingListService() {\n // rename 'this' to something more readable and that will not have issues with\n // inner functions when we expose it to the outside world. This is used in function\n // constructors, not just any function.\n var service = this;\n\n // list of items; we don't expose this to the external components, but we\n // provide an api to it for the outside world to access.\n var items = [];\n\n // and now, the api\n service.addItem = function(itemName, itemQuantity) {\n var item = {\n name: itemName,\n quantity: itemQuantity\n };\n items.push(item);\n };\n\n service.removeItem = function(itemIndex) {\n items.splice(itemIndex, 1);\n }\n\n service.getItems = function() {\n return items;\n };\n }", "title": "" }, { "docid": "31c01a49e92a4fd2a6e61dc752116aa9", "score": "0.5445232", "text": "function updateService(service) {\r\n\t\t\t\tself.service = service;\r\n\t\t\t\t$scope.nameWrong=false;\r\n\t\t\t\tself.UpdateNotCheckServiceName = self.service.service_name;\r\n\t\t\t\t\r\n\t\t\t\tself.heading = self.service.service_name;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t \t(self.service.service_name).length> 15?\r\n\t\t\t\t\t\tself.heading=\"- \"+(self.service.service_name).substr(0,14)+\"...\"\r\n\t\t\t\t\t\t:self.heading=\"- \"+self.service.service_name;\r\n\t\t\t\tdrawerOpen('.drawer');\r\n\t\t\t\t\r\n\t\t\t}", "title": "" }, { "docid": "0ba861236f0611b6bb039490c86e7174", "score": "0.5440041", "text": "function DashboardService() {\n }", "title": "" }, { "docid": "90bcfb3dab8628851d2bf915da5c33cc", "score": "0.54341555", "text": "function ClientService(_http) {\n this._http = _http;\n }", "title": "" }, { "docid": "6fcced228d3cd0b1ffc7c83884ca55a1", "score": "0.5424843", "text": "getServiceTypeString() {\n return this.getParam(WPConst.SERVICE);\n }", "title": "" }, { "docid": "d49d6bc0e7663308b5b7688a8c283fa3", "score": "0.54168737", "text": "get cloudMapService() {\n return this.cloudmapService;\n }", "title": "" }, { "docid": "845d6a139de56cb274ab1fc71c88aab4", "score": "0.5415485", "text": "get ObserverService() { return this._observerService; }", "title": "" }, { "docid": "5e406a70750b5ee6844f806ea506b965", "score": "0.54143935", "text": "constructor() {\r\n let self = this;\r\n self._store = {};\r\n self._store.services = new Map();\r\n }", "title": "" }, { "docid": "3cb38523443c3229fecfee0c3ebf4f5f", "score": "0.54017484", "text": "function serviceCall(serviceName,callMethod){ \t\t\n /*jshint validthis: true */\t\n \t\t\tthis.url = {\n \t\t\t\t\n \t\t\t\tmethod : callMethod,\n \t\t\t\tname : serviceName \n \t\t\t}; \t\t\t\n \t\t}", "title": "" }, { "docid": "d67ee8436a503bac6c7863636912bf97", "score": "0.53853655", "text": "function ServiceUrl() {\n this.baseUrl = \"http://13.234.59.147:4000/\";\n }", "title": "" }, { "docid": "2132008e07adc8ece7fc691730792d3d", "score": "0.5376978", "text": "get json() {\n // TODO return each service as something that can be parsed on the other side\n }", "title": "" }, { "docid": "6d31edcbd2b36110d0d94246530ea36d", "score": "0.537634", "text": "function KalturaDocumentService(client){\r\n\tthis.init(client);\r\n}", "title": "" }, { "docid": "d1b4bfe1d0a55de896a29911d85ad272", "score": "0.53670603", "text": "function TransactionService() {\n\n}", "title": "" }, { "docid": "ee930ae6fdf4e25102a4cda8e418bd5b", "score": "0.53612506", "text": "function WelcomeService() {\n\t\t}", "title": "" }, { "docid": "e5e9198977efd38deb7487eea3bb7990", "score": "0.53454155", "text": "function Service($http, $q) {\n var service = {}; // the returned element\n\n service.GetAll = GetAll;\n service.GetById = GetById;\n service.getUser = getUser;\n service.createUser = createUser;\n service.Update = Update;\n service.Delete = Delete;\n\n return service;\n\n // all function are a-sync , because that we use \"promise\" functions\n // testing on github api\n\n function GetAll() {\n return $http.get('https://api.github.com/users').then(handleSuccess, handleError);\n }\n\n function GetById(_id) {\n return $http.get('/api/users/' + _id).then(handleSuccess, handleError);\n }\n\n function getUser(username) {\n return $http.get('https://api.github.com/users/' + username).then(handleSuccess, handleError);\n }\n\n function createUser(username) {\n return $http.post('https://api.github.com/users/' + username).then(handleSuccess, handleError);\n }\n\n function Update(user) {\n return $http.put('/api/users/' + user._id, user).then(handleSuccess, handleError);\n }\n\n function Delete(_id) {\n return $http.delete('/api/users/' + _id).then(handleSuccess, handleError);\n }\n\n // private functions\n\n function handleSuccess(res) {\n return res.data;\n }\n\n function handleError(res) {\n return $q.reject(res.data);\n }\n }", "title": "" } ]
28abc85fa59afa0eb8e89ab1c10b5fe2
Initializes the fields of this object. This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mixins). Only for internal use.
[ { "docid": "7ad6e13d6155d7596fb625c08ab4d279", "score": "0.0", "text": "static initialize(obj, type, startTime, endTime, voucherLifetime, timeZone) {\n obj['type'] = type;\n obj['start_time'] = startTime;\n obj['end_time'] = endTime;\n obj['voucher_lifetime'] = voucherLifetime;\n obj['time_zone'] = timeZone;\n }", "title": "" } ]
[ { "docid": "d708bf5688f0294c920e0f82153057aa", "score": "0.7797113", "text": "constructor() {\n this.__initializeFields();\n this.initialize();\n }", "title": "" }, { "docid": "102663ba7a8d638e660dd9735a207092", "score": "0.71367425", "text": "constructor(){\n // In order too Inherit the properties, the child class has to call super() method in its consturctor()\n\t\tsuper();\n\t}", "title": "" }, { "docid": "391a0e74106f023a918bf20204d79b4d", "score": "0.69770086", "text": "constructor() {\n // declare our class properties\n\n // call init\n this.init();\n }", "title": "" }, { "docid": "bfc7b82dd51aedb1ff3fe3910d88c0ac", "score": "0.6777333", "text": "function _init () {\n self.labelId = labelId;\n self.label_type = labelType;\n self.canvasX = canvasX;\n self.canvasY = canvasY;\n self.originalCanvasWidth = originalCanvasWidth;\n self.originalCanvasHeight = originalCanvasHeight;\n self.heading = heading;\n self.pitch = pitch;\n self.zoom = zoom;\n self.streetEdgeId = streetEdgeId;\n return this;\n }", "title": "" }, { "docid": "c52e7c1330870f9d8c5e8d5271f20510", "score": "0.674014", "text": "function constructor(){\n if( !initializing && this.init ){\n // All construction is done in the init method\n this.init.apply( this, arguments );\n }\n }", "title": "" }, { "docid": "6b147dc815460cf6dde555c86c6b14d7", "score": "0.6535465", "text": "init() {\n this._super();\n }", "title": "" }, { "docid": "faa71a10cf698bfe384f379826ec6dd0", "score": "0.6505232", "text": "init() {\n\t\tdebug = this.debug;\n\t\tlog = this.log;\n\n\t\tthis.initPresets();\n\t\tthis.init_tcp();\n\t}", "title": "" }, { "docid": "67824b797ef0bd288fbd2a943f35d7ec", "score": "0.6488669", "text": "initialize () {\n this.createHelper();\n this.createModel();\n this.useLanguage();\n this.addListeners();\n }", "title": "" }, { "docid": "90801bf8d5ddb30175a603e43450d633", "score": "0.641519", "text": "__initializeFields() {\n throw new TypeError('Abstract class \"Extension\" cannot be instantiated directly. \"__initializeFields\" method should be overwritten.');\n }", "title": "" }, { "docid": "bafc7c8a2b7a19577cf8321ca252b6f4", "score": "0.6408217", "text": "init() {\n this._super(...arguments);\n }", "title": "" }, { "docid": "bafc7c8a2b7a19577cf8321ca252b6f4", "score": "0.6408217", "text": "init() {\n this._super(...arguments);\n }", "title": "" }, { "docid": "00cc1779d1f46ce57e2def3af5907be3", "score": "0.6404669", "text": "initialize() {\n if (this.initialized) {\n return;\n }\n if (this.draggable) {\n this.initDraggable();\n }\n if (this.droppable) {\n this.initDroppable();\n }\n this.initialized = true;\n }", "title": "" }, { "docid": "40f590174e1958fa4a8d3c3b726569ad", "score": "0.6396539", "text": "constructor(...fields) { super(fields); }", "title": "" }, { "docid": "40f590174e1958fa4a8d3c3b726569ad", "score": "0.6396539", "text": "constructor(...fields) { super(fields); }", "title": "" }, { "docid": "b974273f3c5811ee472f37273040890a", "score": "0.63857317", "text": "initialize() {\n // Initialize matrix renderables\n this._initMatrixRenderables();\n \n // Initialize action double array\n this._initActionArray();\n \n // Initialize Camera\n this._initCamera();\n \n // Initialize TurnSystem\n this._initTurnSystem();\n \n // Initialize the Current Player Status renderable\n this._initCurrentPlayerRenderable();\n \n // Initialize the Instruction font renderable\n this._initInstructionRenderable();\n \n // Initialize the Winner font renderable\n this._initWinnerRenderable();\n }", "title": "" }, { "docid": "e5d56ea4e2c5efd2c8a50e88999a13e5", "score": "0.6373392", "text": "constructor() {\n super();\n\n this.init();\n }", "title": "" }, { "docid": "ae8b3715a9f89333f3a171fb545cc526", "score": "0.6347208", "text": "constructor(init) {\n super(init);\n }", "title": "" }, { "docid": "03fae275af30bbca02ac807d6b50a6b7", "score": "0.6342315", "text": "initialize () {\n this.propsData = {\n levelName: null,\n levelType: null,\n narrative: null,\n learningGoals: null,\n characterPortrait: null,\n onStart: function () {}\n }\n }", "title": "" }, { "docid": "999dac647694525a3c2d164c452ef61f", "score": "0.6295643", "text": "init() {\n this.setPre();\n this.initSeqAndInc();\n this.fillSeq();\n }", "title": "" }, { "docid": "56d584c68778cd675ed89f58cd3388b3", "score": "0.62848645", "text": "init() {\n // Override (optional)\n }", "title": "" }, { "docid": "17d94da6d4c7117a4173c1e9213aeb7e", "score": "0.62650406", "text": "constructor(...args) {\n this._init(...args);\n }", "title": "" }, { "docid": "e42a076294ad8dcfec862d3eb0c98458", "score": "0.6259817", "text": "init() {\n\t\t\t_initialize();\n\t\t}", "title": "" }, { "docid": "63810ab52f488cb7f182199b41f529c4", "score": "0.6222825", "text": "function _init() {\n var self = this\n ;\n\n\n }", "title": "" }, { "docid": "85efe2777a835226263a423828301d9f", "score": "0.6217709", "text": "_initialize() {\n var _a;\n this.__updatePromise = new Promise((res) => (this.enableUpdating = res));\n this._$changedProperties = new Map();\n this.__saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this.requestUpdate();\n (_a = this.constructor._initializers) === null || _a === void 0 ? void 0 : _a.forEach((i) => i(this));\n }", "title": "" }, { "docid": "e38e1d10ec51b3892bf126e2e64f443e", "score": "0.6216119", "text": "function _init() {\n var self = this\n ;\n\n }", "title": "" }, { "docid": "61ff12eafaa4666bbb1954af6d6465ba", "score": "0.6214107", "text": "function _init () {\n self.label_type = label_type;\n self.canvasX = canvasX;\n self.canvasY = canvasY;\n self.originalCanvasWidth = originalCanvasWidth;\n self.originalCanvasHeight = originalCanvasHeight;\n return this;\n }", "title": "" }, { "docid": "e1a739edf35d295dd9b0829b01611fb1", "score": "0.61996037", "text": "constructor() {\n\n\t\t\tsuper();\n\n\t\t}", "title": "" }, { "docid": "e1a739edf35d295dd9b0829b01611fb1", "score": "0.61996037", "text": "constructor() {\n\n\t\t\tsuper();\n\n\t\t}", "title": "" }, { "docid": "4a4d0ef823753269e449a9408c03014d", "score": "0.6199138", "text": "init() {\n }", "title": "" }, { "docid": "054a97083f55be14e49a196ecac2733a", "score": "0.6194051", "text": "function Class() {\n\t\t\t\t// All construction is actually done in the init method\n\t\t\t\tif (!initializing && this.init) {\n\t\t\t\t\tthis.init.apply(this, arguments);\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "44dd5cd2177b38a16a0f40616d9145d7", "score": "0.61889833", "text": "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "title": "" }, { "docid": "f8bd6bad92cb462552524745574ea7fc", "score": "0.61851156", "text": "initialize() {\n this.listenTo(this.owner, {\n [converter_1.Converter.EVENT_END]: this.onEnd,\n [converter_1.Converter.EVENT_CREATE_DECLARATION]: this.onDeclaration,\n [converter_1.Converter.EVENT_CREATE_SIGNATURE]: this.onSignature,\n [converter_1.Converter.EVENT_RESOLVE_BEGIN]: this.onBeginResolve,\n });\n }", "title": "" }, { "docid": "0d00020e5fb5a4f801cc4fcd99d4592c", "score": "0.61814976", "text": "setupFields() {\n\t\tthis.CHANNELS_FIELD = {\n\t\t\ttype: 'dropdown',\n\t\t\tlabel: 'Channel',\n\t\t\tid: 'channel',\n\t\t\tdefault: '1',\n\t\t\tchoices: this.CHOICES_CHANNELS,\n\t\t}\n\t\tthis.CHANNELS_A_FIELD = {\n\t\t\ttype: 'dropdown',\n\t\t\tlabel: 'Channel',\n\t\t\tid: 'channel',\n\t\t\tdefault: '1',\n\t\t\tchoices: this.CHOICES_CHANNELS_A,\n\t\t}\n\t\tthis.SLOTS_FIELD = {\n\t\t\ttype: 'dropdown',\n\t\t\tlabel: 'Slot Number',\n\t\t\tid: 'slot',\n\t\t\tdefault: '1:1',\n\t\t\tchoices: this.CHOICES_SLOTS,\n\t\t}\n\t\tthis.SLOTS_A_FIELD = {\n\t\t\ttype: 'dropdown',\n\t\t\tlabel: 'Slot Number',\n\t\t\tid: 'slot',\n\t\t\tdefault: '1:1',\n\t\t\tchoices: this.CHOICES_SLOTS_A,\n\t\t}\n\t}", "title": "" }, { "docid": "766175b709ccfda2ac163b8dd9f6fa22", "score": "0.6172505", "text": "function init() {\n\t\tdefineMode();\n\t\tdefineMime();\n\t\tdefineLanguage();\n\t}", "title": "" }, { "docid": "f95671bb79dde96433e815b51a5e22c0", "score": "0.61695755", "text": "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "title": "" }, { "docid": "f95671bb79dde96433e815b51a5e22c0", "score": "0.61695755", "text": "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "title": "" }, { "docid": "f95671bb79dde96433e815b51a5e22c0", "score": "0.61695755", "text": "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "title": "" }, { "docid": "f95671bb79dde96433e815b51a5e22c0", "score": "0.61695755", "text": "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "title": "" }, { "docid": "f95671bb79dde96433e815b51a5e22c0", "score": "0.61695755", "text": "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "title": "" }, { "docid": "f95671bb79dde96433e815b51a5e22c0", "score": "0.61695755", "text": "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "title": "" }, { "docid": "f95671bb79dde96433e815b51a5e22c0", "score": "0.61695755", "text": "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "title": "" }, { "docid": "f95671bb79dde96433e815b51a5e22c0", "score": "0.61695755", "text": "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "title": "" }, { "docid": "f95671bb79dde96433e815b51a5e22c0", "score": "0.61695755", "text": "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "title": "" }, { "docid": "f95671bb79dde96433e815b51a5e22c0", "score": "0.61695755", "text": "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "title": "" }, { "docid": "f95671bb79dde96433e815b51a5e22c0", "score": "0.61695755", "text": "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "title": "" }, { "docid": "f95671bb79dde96433e815b51a5e22c0", "score": "0.61695755", "text": "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "title": "" }, { "docid": "f95671bb79dde96433e815b51a5e22c0", "score": "0.61695755", "text": "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "title": "" }, { "docid": "f95671bb79dde96433e815b51a5e22c0", "score": "0.61695755", "text": "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "title": "" }, { "docid": "f95671bb79dde96433e815b51a5e22c0", "score": "0.61695755", "text": "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "title": "" }, { "docid": "f95671bb79dde96433e815b51a5e22c0", "score": "0.61695755", "text": "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "title": "" }, { "docid": "f95671bb79dde96433e815b51a5e22c0", "score": "0.61695755", "text": "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "title": "" }, { "docid": "f95671bb79dde96433e815b51a5e22c0", "score": "0.61695755", "text": "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "title": "" }, { "docid": "f95671bb79dde96433e815b51a5e22c0", "score": "0.61695755", "text": "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "title": "" }, { "docid": "f95671bb79dde96433e815b51a5e22c0", "score": "0.61695755", "text": "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "title": "" }, { "docid": "f95671bb79dde96433e815b51a5e22c0", "score": "0.61695755", "text": "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "title": "" }, { "docid": "f95671bb79dde96433e815b51a5e22c0", "score": "0.61695755", "text": "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "title": "" }, { "docid": "f95671bb79dde96433e815b51a5e22c0", "score": "0.61695755", "text": "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "title": "" }, { "docid": "f95671bb79dde96433e815b51a5e22c0", "score": "0.61695755", "text": "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "title": "" }, { "docid": "f95671bb79dde96433e815b51a5e22c0", "score": "0.61695755", "text": "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "title": "" }, { "docid": "f95671bb79dde96433e815b51a5e22c0", "score": "0.61695755", "text": "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "title": "" }, { "docid": "f95671bb79dde96433e815b51a5e22c0", "score": "0.61695755", "text": "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "title": "" }, { "docid": "049a812af1a6238284dc1eacbf73c569", "score": "0.6161053", "text": "init() {\n\t\tthis.agentManager.init();\n\t\tthis.cardManager.init();\n\t\tthis.mapManager.init();\n\t\tthis.positionManager.init();\n\t\tthis.battleManager.init();\n\t}", "title": "" }, { "docid": "12d691eaad2b519fc2a956a85d7475b1", "score": "0.6159159", "text": "function initialize () {\n setupVariables();\n populateCache();\n setupTerminationHandlers();\n\t\t\t\t\n }", "title": "" }, { "docid": "620f6608031dfe082a437da384995ef8", "score": "0.6157526", "text": "initialize() {\n this.renderHeader();\n this.createPrevDays();\n this.createCurrentDays();\n this.createNextDays();\n this.insertCreatedDays();\n this.reCreateWholeCalendarForPreviousMonth();\n this.reCreateWholeCalendarForNextMonth();\n }", "title": "" }, { "docid": "6888b900c3c4dfc5f92a0d95df954917", "score": "0.6149194", "text": "function init() {\n }", "title": "" }, { "docid": "88460acb1703fcc09a0eadf1e5238dab", "score": "0.61402726", "text": "initProperties () {\n this.apiUsername = ''\n this.apiPassword = ''\n this.oAuthRequestId = ''\n this.oAuthIdentifier = ''\n this.apiToken = ''\n this.apiDatabase = ''\n this.ClientRequest = ''\n this.version = this.LASTVERSION\n }", "title": "" }, { "docid": "4ce2729a078a0393e6e2faf4a04ce326", "score": "0.6135499", "text": "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of `updateComplete`\n this._requestUpdate();\n }", "title": "" }, { "docid": "d3bc5c2dc697e20f2769f7e887e0ea90", "score": "0.6129819", "text": "function Class() {\n // All construction is actually done in the init method\n if ( !initializing && this.init )\n this.init.apply(this, arguments);\n }", "title": "" }, { "docid": "d3bc5c2dc697e20f2769f7e887e0ea90", "score": "0.6129819", "text": "function Class() {\n // All construction is actually done in the init method\n if ( !initializing && this.init )\n this.init.apply(this, arguments);\n }", "title": "" }, { "docid": "54b81a3211b2349e06548269c2db14e1", "score": "0.612937", "text": "constructor() { \n \n BaseOrganizationItemFields.initialize(this);\n }", "title": "" }, { "docid": "076e16322110606926d7138f2582781f", "score": "0.61233675", "text": "init() {\n this._requiredFields = [\n 'elmId',\n 'type',\n ];\n this.addButton = false;\n this.firstColumnCheckboxes = false;\n }", "title": "" }, { "docid": "287787dd3156fe92ac4622080ba46eed", "score": "0.6106237", "text": "initialize(){ /** todo */ }", "title": "" }, { "docid": "baa22c39921e083beda1c6c2afc303e5", "score": "0.61060977", "text": "init () {\n\t\t// If branch is an inheritance, we copy certain value from the parent\n\t\tthis.noiseCoord = this.inheritance ? this.parent.noiseCoord : new THREE.Vector2(Math.random(), Math.random());\t\n\n\t\tvar prop = Probability.between(config.branch.w.transfer.min, config.branch.w.transfer.max);\n\t\tthis.weight = prop * this.parent.weight;\n\n\t\t// Calculate the length from the weight\n\t\tvar ratWL = Probability.between(config.branch.l.wRat.min, config.branch.l.wRat.max);\n\t\tthis.length = Math.min(this.weight * ratWL, config.branch.l.max);\n\n\t\tthis.refreshBoundaries();\n\t\tif( this.canHaveChild ) this.genRamification(); \n\t}", "title": "" }, { "docid": "585a0f1144b7c3ec685fd36a13fcafda", "score": "0.60963494", "text": "init() {\n let activeState = get(this, 'activeState');\n let enterState = get(this, 'enterState');\n let exitState = get(this, 'exitState');\n let animationState = get(this, 'animationState');\n\n // If there is an enter state, merge its properties with the active state.\n set(this, 'enterState', enterState ? copy(enterState) : copy(activeState));\n set(this, 'exitState', exitState ? copy(exitState) : copy(get(this, 'enterState')));\n\n // Also, make sure we create a copy so these can be overwritten.\n set(this, 'activeState', copy(activeState));\n if(animationState) {\n set(this, 'animationState', copy(animationState));\n }\n\n this._super();\n }", "title": "" }, { "docid": "2343a7a22f95a88c13cadadb13933d99", "score": "0.60906786", "text": "function Class() {\n\t\t\t // All construction is actually done in the init method\n\t\t\t if ( !initializing && this.init )\n\t\t\t\t this.init.apply(this, arguments);\n\t\t }", "title": "" }, { "docid": "b9a0248b9a1e4a24a94d7b6a6fa9989d", "score": "0.6071594", "text": "constructor(props) {\n // Pass props to the parent component\n super(props);\n // Set initial state\n this.state = {\n // State needed\n fields: [],\n };\n }", "title": "" }, { "docid": "0ab9f99e0b3fbf314b5694ee09240cb3", "score": "0.6046847", "text": "constructor() {\n this._initTypes();\n }", "title": "" }, { "docid": "0d6ae191c34a13448736100b048585b0", "score": "0.6041762", "text": "initialize()\n {\n this.set('statusText', this._getStatusText(this.get('status')));\n this.set('available', this.available());\n }", "title": "" }, { "docid": "72376ee9f8c10d966260252c70b9269f", "score": "0.6040728", "text": "function Class() {\n\t\t // All construction is actually done in the init method\n\t\t if ( !initializing && this.init )\n\t\t\tthis.init.apply(this, arguments);\n\t\t}", "title": "" }, { "docid": "792c3f02d370305dcd6b1b31d42de045", "score": "0.60370284", "text": "function Class() {\n\t\t\t// All construction is actually done in the init method\n\t\t\tif ( !initializing && this.init )\n\t\t\t\tthis.init.apply(this, arguments);\n\t\t}", "title": "" }, { "docid": "792c3f02d370305dcd6b1b31d42de045", "score": "0.60370284", "text": "function Class() {\n\t\t\t// All construction is actually done in the init method\n\t\t\tif ( !initializing && this.init )\n\t\t\t\tthis.init.apply(this, arguments);\n\t\t}", "title": "" }, { "docid": "da14a352d0e248dd4b99969993d24b78", "score": "0.60361534", "text": "function Class() {\n // All construction is actually done in the init method\n if (!initializing && this.init) {\n this.init.apply(this, arguments);\n }\n }", "title": "" }, { "docid": "fe3daf227de6417b04ba5a9ecc06d280", "score": "0.60254365", "text": "_initializeProperties() {\n this.__serializing = false;\n this.__dataCounter = 0;\n this.__dataEnabled = false;\n this.__dataReady = false;\n this.__dataInvalid = false;\n this.__data = {};\n this.__dataPending = null;\n this.__dataOld = null;\n if (this.__dataProto) {\n this._initializeProtoProperties(this.__dataProto);\n this.__dataProto = null;\n }\n // Capture instance properties; these will be set into accessors\n // during first flush. Don't set them here, since we want\n // these to overwrite defaults/constructor assignments\n for (let p in this.__dataHasAccessor) {\n if (this.hasOwnProperty(p)) {\n this.__dataInstanceProps = this.__dataInstanceProps || {};\n this.__dataInstanceProps[p] = this[p];\n delete this[p];\n }\n }\n }", "title": "" }, { "docid": "62ea9427a795e4ad45e7a6ceb516bc7e", "score": "0.6021269", "text": "constructor(props) {\n super(props);\n // Operations usually carried out in componentWillMount go here\n }", "title": "" }, { "docid": "11e5a93c9dd1cc05bbfcb7a2ddb8c03d", "score": "0.60143435", "text": "constructor () {\n //loop constructors\n for (let c=0; c<that._constructorMethods.length; c++) {\n //get arguments for this constructor\n let args = arguments[c] || [],\n //call constructor, pass args, store result\n instance = new that._constructorMethods[c](...args),\n //get own enumerable properties\n props = Object.keys(instance);\n //extend this with result \n for (let k=0; k<props.length; k++) {\n let prop = props[k];\n this[prop] = instance[prop];\n }\n }\n }", "title": "" }, { "docid": "ce69daa4a22b9763730c2a1e1307b01d", "score": "0.60073847", "text": "_init() {\n\n this._events();\n\n // Typing animation for headline\n this.startTypedHeadline();\n\n // Logo\n this.paintLogos();\n\n // Create skills dots for resume\n this.resumeSkillDots();\n\n // Initialize print function\n this.bindPrint();\n\n }", "title": "" }, { "docid": "15078c1d11efa455047e257fdbc74944", "score": "0.600341", "text": "constructor() {\n\n // Don't forget to call super for the inherited properties\n super(firstName, lastName, age, emotion);\n\n // set the new 'adminLevel' and 'role' properties\n this.adminLevel = adminLevel;\n this.role = role;\n }", "title": "" }, { "docid": "4e63a52db0161e41564c7d2499467d3b", "score": "0.59954554", "text": "function Class() {\n\n // All construction is actually done in the init method\n if (!initializing && this.__init)\n this.__init.apply(this, arguments);\n }", "title": "" }, { "docid": "5935f7d820b602acd5671bd80d4e8357", "score": "0.5990006", "text": "function Class() {\n // All construction is actually done in the init method\n if ( !initializing && this.init )\n this.init.apply(this, arguments);\n }", "title": "" }, { "docid": "6e76e04bae0559a0be8898490594390b", "score": "0.59860206", "text": "function Class() {\n // All construction is actually done in the init method\n if (!initializing && this.init) {\n this.init.apply(this, arguments);\n }\n }", "title": "" }, { "docid": "4a34269da556a153226a6e6149181afb", "score": "0.5983557", "text": "init() {\n\t\tthis.initVariables();\n\t\tthis.initFeedbacks();\n\t\tthis.initActions();\n\t\tthis.initPresets();\n\n\t\tthis.status(this.STATE_UNKNOWN);\n\n\t\t// Force config update.\n\t\tthis.updateConfig();\n\t}", "title": "" }, { "docid": "d9d004abadfe35882806bb30e8e296c6", "score": "0.5970804", "text": "function Class() {\n // All construction is actually done in the init method\n if (!initializing && this.init)\n this.init.apply(this, arguments);\n }", "title": "" }, { "docid": "d9d004abadfe35882806bb30e8e296c6", "score": "0.5970804", "text": "function Class() {\n // All construction is actually done in the init method\n if (!initializing && this.init)\n this.init.apply(this, arguments);\n }", "title": "" }, { "docid": "d9d004abadfe35882806bb30e8e296c6", "score": "0.5970804", "text": "function Class() {\n // All construction is actually done in the init method\n if (!initializing && this.init)\n this.init.apply(this, arguments);\n }", "title": "" }, { "docid": "d9d004abadfe35882806bb30e8e296c6", "score": "0.5970804", "text": "function Class() {\n // All construction is actually done in the init method\n if (!initializing && this.init)\n this.init.apply(this, arguments);\n }", "title": "" }, { "docid": "7d9842daf6b48efec734a21da65f52a6", "score": "0.5959011", "text": "initialize(props = {}) {\n super.initialize(props);\n\n // Attributes and buffers\n\n // Model manages auto Buffer creation from typed arrays\n this._attributes = {}; // All attributes\n this.attributes = {}; // User defined attributes\n\n // geometry might have set drawMode and vertexCount\n this.isInstanced = props.isInstanced || props.instanced;\n\n // assert(program || program instanceof Program);\n assert(this.drawMode !== undefined && Number.isFinite(this.vertexCount), ERR_MODEL_PARAMS);\n }", "title": "" }, { "docid": "4304d14f534230d947e01e6969e37d4e", "score": "0.5956629", "text": "function Class() {\n // All construction is actually done in the init method\n if(!initializing && this.init) {\n this.init.apply(this, arguments);\n }\n }", "title": "" }, { "docid": "c7ed626373034bd33e14cc2d7c1258d8", "score": "0.59530735", "text": "function Class() {\n // All construction is actually done in the init method\n if ( !initializing && this.init )\n this.init.apply(this, arguments);\n }", "title": "" }, { "docid": "c7ed626373034bd33e14cc2d7c1258d8", "score": "0.59530735", "text": "function Class() {\n // All construction is actually done in the init method\n if ( !initializing && this.init )\n this.init.apply(this, arguments);\n }", "title": "" }, { "docid": "c7ed626373034bd33e14cc2d7c1258d8", "score": "0.59530735", "text": "function Class() {\n // All construction is actually done in the init method\n if ( !initializing && this.init )\n this.init.apply(this, arguments);\n }", "title": "" }, { "docid": "3ff54ef0ebc08922e4debd26e8e54634", "score": "0.5945967", "text": "constructor() { \n CreateDocumentUploadRequestOneOf.initialize(this);CreateDocumentUploadRequestOneOf1.initialize(this);CreateDocumentUploadRequestOneOf2.initialize(this);\n CreateDocumentUploadRequest.initialize(this);\n }", "title": "" } ]
e534a37e5347c80483fe675cc9bbfda5
When the socket is upgraded while we're probing
[ { "docid": "3d78e5ea9d42e601bb9591592eef7026", "score": "0.0", "text": "function onupgrade (to) {\n if (transport && to.name !== transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "title": "" } ]
[ { "docid": "35be0ad6651541dbc7c52615aa367a1b", "score": "0.6573796", "text": "onConnectionUpgrade ( request, socket, head ) {\n\t\tthis.wss.handleUpgrade( request, socket, head, this.onConnect.bind( this ) );\n\t}", "title": "" }, { "docid": "743e9dedaef2f43f4c00c91cd9124d02", "score": "0.6243038", "text": "onOpen() {\n debug(\"socket open\");\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emit(\"open\");\n this.flush(); // we check for `readyState` in case an `open`\n // listener already closed the socket\n\n if (\"open\" === this.readyState && this.opts.upgrade && this.transport.pause) {\n debug(\"starting upgrade probes\");\n let i = 0;\n const l = this.upgrades.length;\n\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }", "title": "" }, { "docid": "4a4a7d453838947247a13f98ff688d55", "score": "0.61526513", "text": "onOpen() {\n debug(\"socket open\");\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emitReserved(\"open\");\n this.flush();\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\"open\" === this.readyState &&\n this.opts.upgrade &&\n this.transport.pause) {\n debug(\"starting upgrade probes\");\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }", "title": "" }, { "docid": "23b47f02a8030af9c0f1b3d5038f1728", "score": "0.6122434", "text": "onOpen() {\n debug(\"socket open\");\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emit(\"open\");\n this.flush();\n\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\n \"open\" === this.readyState &&\n this.opts.upgrade &&\n this.transport.pause\n ) {\n debug(\"starting upgrade probes\");\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }", "title": "" }, { "docid": "23b47f02a8030af9c0f1b3d5038f1728", "score": "0.6122434", "text": "onOpen() {\n debug(\"socket open\");\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emit(\"open\");\n this.flush();\n\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\n \"open\" === this.readyState &&\n this.opts.upgrade &&\n this.transport.pause\n ) {\n debug(\"starting upgrade probes\");\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }", "title": "" }, { "docid": "c5c49d3e49722bed4f67176c987bd9b5", "score": "0.61006683", "text": "#upgrade(req, socket) {\n\t\tif(is_banned(req.client.remoteAddress)) {\n\t\t\t// TODO: Log this?\n\t\t\tsocket.destroy(); // Immediately close the connection\n\t\t\treturn;\n\t\t}\n\n\t\tif(req.headers.upgrade.toLowerCase() !== 'websocket' || !ServerAuth.is_authorized(req)) {\n\t\t\tsocket.destroy();\n\t\t\treturn;\n\t\t}\n\n\t\tconst ws_accept = generate_ws_accept(req.headers);\n\n\t\tsocket.write([\n\t\t\t'HTTP/1.1 101 Switching Protocols',\n\t\t\t'Upgrade: WebSocket',\n\t\t\t'Connection: Upgrade',\n\t\t\t`Sec-WebSocket-Accept: ${ws_accept}`\n\t\t].join('\\r\\n') + '\\r\\n\\r\\n');\n\n\t\t// Clean up the connection list\n\t\tlet end_index = this.#connections.length;\n\t\twhile(--end_index >= 0 && this.#connections[end_index] === null) this.#connections.pop();\n\n\t\tlet index = this.#connections.push(socket) - 1;\n\n\t\tsocket.on('data', this.#data.bind(this, index));\n\t\tsocket.on('error', (err) => {\n\t\t\tthis.#emitter.emit(\"error\", {\n\t\t\t\tmessage: err.message,\n\t\t\t\tindex,\n\t\t\t\tsocket\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "0fe6fed471683cca08f9366566ca4f06", "score": "0.6099565", "text": "processUpdateConn(event) {\n trace(`ICE state changed to: ${event.target.iceConnectionState}.`);\n\n if (event.target.iceConnectionState === 'disconnected') { \n this.disconnect();\n }\n }", "title": "" }, { "docid": "d3c79bf6de88c2b45e14cbd0abb9b304", "score": "0.6079832", "text": "handleUpgrade(req, socket, head) {\n if (req.headers.host) {\n const { host } = req.headers\n const { id, port } = this.parseHost(host)\n const item = this.find(id)\n\n if (item) {\n let target\n if (port && port !== '80') {\n target = `ws://127.0.0.1:${port}`\n } else if (item.start) {\n target = `ws://127.0.0.1:${item.env.PORT}`\n } else if (item.target) {\n target = item.target.replace('http', 'ws')\n } else {\n const { hostname } = url.parse(item.target)\n target = `ws://${hostname}`\n }\n log(`WebSocket - ${host} → ${target}`)\n this._proxy.ws(req, socket, head, { target }, err => {\n log('WebSocket - Error', err.message)\n })\n } else {\n log(`WebSocket - No server matching ${id}`)\n }\n } else {\n log('WebSocket - No host header found')\n }\n }", "title": "" }, { "docid": "da681c310a20283896f76b8ec077f098", "score": "0.6014447", "text": "onOpen() {\n debug$3(\"socket open\");\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emit(\"open\");\n this.flush();\n\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\n \"open\" === this.readyState &&\n this.opts.upgrade &&\n this.transport.pause\n ) {\n debug$3(\"starting upgrade probes\");\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }", "title": "" }, { "docid": "32b460b5fdeaa7e6f98511cf097c12c5", "score": "0.6008332", "text": "onSocketFullyConnected() {\n this.debugOut('socketFullyConnected()');\n this.last_socket_error = null;\n this.emit('open');\n }", "title": "" }, { "docid": "98581fd943980a6966c97024c2abf699", "score": "0.60082525", "text": "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "02837ad6e893f34d16dccbfd89dc7c66", "score": "0.60035515", "text": "upgrade() {}", "title": "" }, { "docid": "ab947501a84b7a3463461c6ccf0f31e3", "score": "0.59670156", "text": "onOpen() {\n this.readyState = \"open\";\n Socket$1.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emitReserved(\"open\");\n this.flush();\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\"open\" === this.readyState &&\n this.opts.upgrade &&\n this.transport.pause) {\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }", "title": "" }, { "docid": "0aa4676e898e0f5bf2ad88c9d60a5d8d", "score": "0.59037375", "text": "function onUpgrade(request, socket, head) {\n const { room } = querystring.parse(url.parse(request.url).query);\n\n if (!Rooms.getRoom(room)) {\n socket.on(\"error\", (err) => console.log(JSON.stringify(err)));\n socket.destroy({ error: `Room ${room} not found` });\n return;\n }\n\n if (!socketServers[room]) {\n socketServers[room] = makeRoomSocket(room);\n console.log(`Created socket for room ${room}`);\n } else {\n console.log(`Using socket for room ${room}`);\n }\n\n const currentSocket = socketServers[room];\n\n currentSocket.handleUpgrade(request, socket, head, (ws) => {\n currentSocket.emit(\"connection\", ws, request);\n });\n}", "title": "" }, { "docid": "42d37560b29d24ae78b7e7d3949900c4", "score": "0.586029", "text": "static onClientUpgrade (http, server, response, socket, upgradeHead) {\n\n socket.setKeepAlive(true);\n\n PtthUtils.connectSocketToServer(server, socket);\n\n }", "title": "" }, { "docid": "bb23107a168ead6766d36ff164b1363f", "score": "0.58264995", "text": "function onupgrade(to){\n\t if (transport && to.name != transport.name) {\n\t debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n\t freezeTransport();\n\t }\n\t }", "title": "" }, { "docid": "bb23107a168ead6766d36ff164b1363f", "score": "0.58264995", "text": "function onupgrade(to){\n\t if (transport && to.name != transport.name) {\n\t debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n\t freezeTransport();\n\t }\n\t }", "title": "" }, { "docid": "bb23107a168ead6766d36ff164b1363f", "score": "0.58264995", "text": "function onupgrade(to){\n\t if (transport && to.name != transport.name) {\n\t debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n\t freezeTransport();\n\t }\n\t }", "title": "" }, { "docid": "bb23107a168ead6766d36ff164b1363f", "score": "0.58264995", "text": "function onupgrade(to){\n\t if (transport && to.name != transport.name) {\n\t debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n\t freezeTransport();\n\t }\n\t }", "title": "" }, { "docid": "bb23107a168ead6766d36ff164b1363f", "score": "0.58264995", "text": "function onupgrade(to){\n\t if (transport && to.name != transport.name) {\n\t debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n\t freezeTransport();\n\t }\n\t }", "title": "" }, { "docid": "bb23107a168ead6766d36ff164b1363f", "score": "0.58264995", "text": "function onupgrade(to){\n\t if (transport && to.name != transport.name) {\n\t debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n\t freezeTransport();\n\t }\n\t }", "title": "" }, { "docid": "bb23107a168ead6766d36ff164b1363f", "score": "0.58264995", "text": "function onupgrade(to){\n\t if (transport && to.name != transport.name) {\n\t debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n\t freezeTransport();\n\t }\n\t }", "title": "" }, { "docid": "bb23107a168ead6766d36ff164b1363f", "score": "0.58264995", "text": "function onupgrade(to){\n\t if (transport && to.name != transport.name) {\n\t debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n\t freezeTransport();\n\t }\n\t }", "title": "" }, { "docid": "ae84e86573efe0d3d5bae42027016f7d", "score": "0.58026206", "text": "async function onUpgrade(req, socket, head) {\n const startTime = Date.now()\n const reqURL = getURL(req)\n\n try {\n\n logger.info(logger.cyan(req.method), reqURL)\n\n let hostname = null\n let port = null\n\n if (req.url[0] === '/') {\n\n const [parsedHostname, parsedPort] = req.headers.host.split(' ')\n hostname = parsedHostname\n port = parsedPort || 443\n\n } else {\n\n const parsedURL = url.parse(req.url)\n hostname = parsedURL.hostname\n port = parsedURL.port || 80\n\n }\n\n socket.once('error', error => {\n logger.error(logger.red(`${req.method}:socket`), reqURL, '\\n', error.stack)\n })\n\n let remoteSocket = await upstream.connect(port, hostname, { ua: req.headers['user-agent'] })\n if (req.socket instanceof tls.TLSSocket) {\n remoteSocket = new tls.TLSSocket(remoteSocket)\n }\n\n socket.once('error', error => {\n remoteSocket.destroy()\n })\n\n remoteSocket.once('error', error => {\n logger.error(logger.red(`${req.method}:remote`), reqURL, '\\n', error.stack)\n socket.destroy()\n })\n\n remoteSocket.pipe(socket)\n\n remoteSocket.write(`${req.method} ${req.url} HTTP/${req.httpVersion}\\r\\n`)\n for (let i = 0, ii = req.rawHeaders.length; i < ii; i += 2) {\n remoteSocket.write(`${req.rawHeaders[i]}: ${req.rawHeaders[i + 1]}\\r\\n`)\n }\n remoteSocket.write('\\r\\n')\n remoteSocket.write(head)\n\n socket.pipe(remoteSocket)\n\n logger.info(logger.green(req.method), reqURL, logger.green(`[${Date.now() - startTime}ms]`))\n\n } catch (error) {\n\n logger.error(logger.red(req.method), reqURL, logger.red(`[${Date.now() - startTime}ms]`), '\\n', error.stack)\n socket.destroy()\n }\n }", "title": "" }, { "docid": "ef1d45a216fc3b8c0f0250cf04889ba1", "score": "0.57833123", "text": "function socketAlive() {\n setTimeout(function() {\n socket.emit('socket_alive');\n socketAlive();\n }, 3200);\n }", "title": "" }, { "docid": "4335dcaea5e41ed982ddf893bf32857f", "score": "0.57699084", "text": "function on_socket_get(message) {\"use strict\"; }", "title": "" }, { "docid": "42e7a05363a9a92562cf455293236c4b", "score": "0.5721342", "text": "function onerror (err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\t\n\t freezeTransport();\n\t\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\t\n\t self.emit('upgradeError', error);\n\t }", "title": "" }, { "docid": "42e7a05363a9a92562cf455293236c4b", "score": "0.5721342", "text": "function onerror (err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\t\n\t freezeTransport();\n\t\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\t\n\t self.emit('upgradeError', error);\n\t }", "title": "" }, { "docid": "55ec599a3e579d91b11c4b1b67d74fd1", "score": "0.57026625", "text": "function onerror(err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\t\n\t freezeTransport();\n\t\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\t\n\t self.emit('upgradeError', error);\n\t }", "title": "" }, { "docid": "55ec599a3e579d91b11c4b1b67d74fd1", "score": "0.57026625", "text": "function onerror(err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\t\n\t freezeTransport();\n\t\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\t\n\t self.emit('upgradeError', error);\n\t }", "title": "" }, { "docid": "55ec599a3e579d91b11c4b1b67d74fd1", "score": "0.57026625", "text": "function onerror(err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\t\n\t freezeTransport();\n\t\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\t\n\t self.emit('upgradeError', error);\n\t }", "title": "" }, { "docid": "c75fc183edc85a84201a23230eed97b5", "score": "0.56923413", "text": "function on_socket_get(message){}", "title": "" }, { "docid": "a82f8c12ba3b6a2a46e1250c1e2efab4", "score": "0.56805366", "text": "function onupgrade (to) {\n\t if (transport && to.name !== transport.name) {\n\t debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n\t freezeTransport();\n\t }\n\t }", "title": "" }, { "docid": "a82f8c12ba3b6a2a46e1250c1e2efab4", "score": "0.56805366", "text": "function onupgrade (to) {\n\t if (transport && to.name !== transport.name) {\n\t debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n\t freezeTransport();\n\t }\n\t }", "title": "" }, { "docid": "a82f8c12ba3b6a2a46e1250c1e2efab4", "score": "0.56805366", "text": "function onupgrade (to) {\n\t if (transport && to.name !== transport.name) {\n\t debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n\t freezeTransport();\n\t }\n\t }", "title": "" }, { "docid": "a82f8c12ba3b6a2a46e1250c1e2efab4", "score": "0.56805366", "text": "function onupgrade (to) {\n\t if (transport && to.name !== transport.name) {\n\t debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n\t freezeTransport();\n\t }\n\t }", "title": "" }, { "docid": "a82f8c12ba3b6a2a46e1250c1e2efab4", "score": "0.56805366", "text": "function onupgrade (to) {\n\t if (transport && to.name !== transport.name) {\n\t debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n\t freezeTransport();\n\t }\n\t }", "title": "" }, { "docid": "aa6729f6af3f57a1447a7e321bd3bd00", "score": "0.5675973", "text": "function onerror (err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\n\t freezeTransport();\n\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n\t self.emit('upgradeError', error);\n\t }", "title": "" }, { "docid": "aa6729f6af3f57a1447a7e321bd3bd00", "score": "0.5675973", "text": "function onerror (err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\n\t freezeTransport();\n\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n\t self.emit('upgradeError', error);\n\t }", "title": "" }, { "docid": "aa6729f6af3f57a1447a7e321bd3bd00", "score": "0.5675973", "text": "function onerror (err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\n\t freezeTransport();\n\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n\t self.emit('upgradeError', error);\n\t }", "title": "" }, { "docid": "3238a787e1af434bcb96370802de5a8f", "score": "0.565519", "text": "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "title": "" }, { "docid": "3238a787e1af434bcb96370802de5a8f", "score": "0.565519", "text": "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "title": "" }, { "docid": "3238a787e1af434bcb96370802de5a8f", "score": "0.565519", "text": "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "title": "" }, { "docid": "3238a787e1af434bcb96370802de5a8f", "score": "0.565519", "text": "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "title": "" }, { "docid": "3238a787e1af434bcb96370802de5a8f", "score": "0.565519", "text": "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "title": "" }, { "docid": "3238a787e1af434bcb96370802de5a8f", "score": "0.565519", "text": "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "title": "" }, { "docid": "3238a787e1af434bcb96370802de5a8f", "score": "0.565519", "text": "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "title": "" }, { "docid": "3238a787e1af434bcb96370802de5a8f", "score": "0.565519", "text": "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "title": "" }, { "docid": "3238a787e1af434bcb96370802de5a8f", "score": "0.565519", "text": "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "title": "" }, { "docid": "3238a787e1af434bcb96370802de5a8f", "score": "0.565519", "text": "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "title": "" }, { "docid": "3238a787e1af434bcb96370802de5a8f", "score": "0.565519", "text": "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "title": "" }, { "docid": "3238a787e1af434bcb96370802de5a8f", "score": "0.565519", "text": "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "title": "" }, { "docid": "3238a787e1af434bcb96370802de5a8f", "score": "0.565519", "text": "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "title": "" }, { "docid": "3238a787e1af434bcb96370802de5a8f", "score": "0.565519", "text": "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "title": "" }, { "docid": "3238a787e1af434bcb96370802de5a8f", "score": "0.565519", "text": "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "title": "" }, { "docid": "3238a787e1af434bcb96370802de5a8f", "score": "0.565519", "text": "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "title": "" }, { "docid": "3238a787e1af434bcb96370802de5a8f", "score": "0.565519", "text": "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "title": "" }, { "docid": "3238a787e1af434bcb96370802de5a8f", "score": "0.565519", "text": "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "title": "" }, { "docid": "3238a787e1af434bcb96370802de5a8f", "score": "0.565519", "text": "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "title": "" }, { "docid": "f95f33a8af42f4f163489e23c4778049", "score": "0.5653729", "text": "function onerror(err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\n\t freezeTransport();\n\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n\t self.emit('upgradeError', error);\n\t }", "title": "" }, { "docid": "f95f33a8af42f4f163489e23c4778049", "score": "0.5653729", "text": "function onerror(err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\n\t freezeTransport();\n\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n\t self.emit('upgradeError', error);\n\t }", "title": "" }, { "docid": "f95f33a8af42f4f163489e23c4778049", "score": "0.5653729", "text": "function onerror(err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\n\t freezeTransport();\n\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n\t self.emit('upgradeError', error);\n\t }", "title": "" }, { "docid": "f95f33a8af42f4f163489e23c4778049", "score": "0.5653729", "text": "function onerror(err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\n\t freezeTransport();\n\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n\t self.emit('upgradeError', error);\n\t }", "title": "" }, { "docid": "f95f33a8af42f4f163489e23c4778049", "score": "0.5653729", "text": "function onerror(err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\n\t freezeTransport();\n\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n\t self.emit('upgradeError', error);\n\t }", "title": "" }, { "docid": "1f4277c9cea8091752769b6c46391bc6", "score": "0.56494206", "text": "function onupgrade(to) {\n if (transport && to.name !== transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "title": "" }, { "docid": "05805f1aa105db2e61d1616e0e297263", "score": "0.5645073", "text": "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "5ef52107b07e2fe683e12c51c98a5308", "score": "0.56252867", "text": "onConnect() {\n this.socket && this.socket.write(this.handshake);\n this.healthCheck = setInterval(() => {\n if (new Date() - this.lastRead > 35000) {\n this.close(false);\n }\n }, 5 * 1000);\n }", "title": "" }, { "docid": "8c31b2e654998dd0690303a6dd856273", "score": "0.56189406", "text": "function handleHybiUpgrade (req, socket, upgradeHead, cb) {\n // handle premature socket errors\n var errorHandler = () => {\n try { socket.destroy(); } catch (e) {}\n };\n socket.on('error', errorHandler);\n\n // verify key presence\n if (!req.headers['sec-websocket-key']) {\n return abortConnection(socket, 400);\n }\n\n // verify version\n var version = +req.headers['sec-websocket-version'];\n if (version !== 8 && version !== 13) {\n return abortConnection(socket, 400);\n }\n\n // verify protocol\n var protocols = req.headers['sec-websocket-protocol'];\n\n // verify client\n var origin = version !== 13\n ? req.headers['sec-websocket-origin']\n : req.headers['origin'];\n\n // handle extensions offer\n var extensionsOffer = Extensions.parse(req.headers['sec-websocket-extensions']);\n\n // handler to call when the connection sequence completes\n var completeHybiUpgrade2 = (protocol) => {\n // calc key\n var key = crypto.createHash('sha1')\n .update(`${req.headers['sec-websocket-key']}258EAFA5-E914-47DA-95CA-C5AB0DC85B11`, 'latin1')\n .digest('base64');\n\n var headers = [\n 'HTTP/1.1 101 Switching Protocols',\n 'Upgrade: websocket',\n 'Connection: Upgrade',\n `Sec-WebSocket-Accept: ${key}`\n ];\n\n if (protocol) {\n headers.push(`Sec-WebSocket-Protocol: ${protocol}`);\n }\n\n var extensions = {};\n try {\n extensions = acceptExtensions.call(this, extensionsOffer);\n } catch (err) {\n return abortConnection(socket, 400);\n }\n\n if (Object.keys(extensions).length) {\n var serverExtensions = {};\n Object.keys(extensions).forEach((token) => {\n serverExtensions[token] = [extensions[token].params];\n });\n headers.push(`Sec-WebSocket-Extensions: ${Extensions.format(serverExtensions)}`);\n }\n\n // allows external modification/inspection of handshake headers\n this.emit('headers', headers);\n\n socket.setTimeout(0);\n socket.setNoDelay(true);\n\n try {\n socket.write(headers.concat('', '').join('\\r\\n'));\n } catch (e) {\n // if the upgrade write fails, shut the connection down hard\n try { socket.destroy(); } catch (e) {}\n return;\n }\n\n var client = new WebSocket([req, socket, upgradeHead], {\n protocolVersion: version,\n protocol: protocol,\n extensions: extensions,\n maxPayload: this.options.maxPayload\n });\n\n if (this.clients) {\n this.clients.add(client);\n client.on('close', () => this.clients.delete(client));\n }\n\n // signal upgrade complete\n socket.removeListener('error', errorHandler);\n cb(client);\n };\n\n // optionally call external protocol selection handler before\n // calling completeHybiUpgrade2\n var completeHybiUpgrade1 = () => {\n // choose from the sub-protocols\n if (typeof this.options.handleProtocols === 'function') {\n var protList = (protocols || '').split(/, */);\n var callbackCalled = false;\n this.options.handleProtocols(protList, (result, protocol) => {\n callbackCalled = true;\n if (!result) return abortConnection(socket, 401);\n\n completeHybiUpgrade2(protocol);\n });\n if (!callbackCalled) {\n // the handleProtocols handler never called our callback\n abortConnection(socket, 501, 'Could not process protocols');\n }\n } else {\n completeHybiUpgrade2(protocols && protocols.split(/, */)[0]);\n }\n };\n\n // optionally call external client verification handler\n if (typeof this.options.verifyClient === 'function') {\n var info = {\n secure: req.connection.authorized !== undefined || req.connection.encrypted !== undefined,\n origin: origin,\n req: req\n };\n if (this.options.verifyClient.length === 2) {\n this.options.verifyClient(info, (result, code, message) => {\n if (!result) return abortConnection(socket, code || 401, message);\n\n completeHybiUpgrade1();\n });\n return;\n } else if (!this.options.verifyClient(info)) {\n return abortConnection(socket, 401);\n }\n }\n\n completeHybiUpgrade1();\n}", "title": "" }, { "docid": "d377a77d64e44a15e4925f1863fd4bd6", "score": "0.56111205", "text": "function handleHybiUpgrade(req, socket, upgradeHead, cb) {\n // handle premature socket errors\n var errorHandler = function() {\n try { socket.destroy(); } catch (e) {}\n }\n socket.on('error', errorHandler);\n\n // verify key presence\n if (!req.headers['sec-websocket-key']) {\n abortConnection(socket, 400, 'Bad Request');\n return;\n }\n\n // verify version\n var version = parseInt(req.headers['sec-websocket-version']);\n if ([8, 13].indexOf(version) === -1) {\n abortConnection(socket, 400, 'Bad Request');\n return;\n }\n\n // verify protocol\n var protocols = req.headers['sec-websocket-protocol'];\n\n // verify client\n var origin = version < 13 ?\n req.headers['sec-websocket-origin'] :\n req.headers['origin'];\n\n // handle extensions offer\n var extensionsOffer = Extensions.parse(req.headers['sec-websocket-extensions']);\n\n // handler to call when the connection sequence completes\n var self = this;\n var completeHybiUpgrade2 = function(protocol) {\n\n // calc key\n var key = req.headers['sec-websocket-key'];\n var shasum = crypto.createHash('sha1');\n shasum.update(key + \"258EAFA5-E914-47DA-95CA-C5AB0DC85B11\");\n key = shasum.digest('base64');\n\n var headers = [\n 'HTTP/1.1 101 Switching Protocols'\n , 'Upgrade: websocket'\n , 'Connection: Upgrade'\n , 'Sec-WebSocket-Accept: ' + key\n ];\n\n if (typeof protocol != 'undefined') {\n headers.push('Sec-WebSocket-Protocol: ' + protocol);\n }\n\n var extensions = {};\n try {\n extensions = acceptExtensions.call(self, extensionsOffer);\n } catch (err) {\n abortConnection(socket, 400, 'Bad Request');\n return;\n }\n\n if (Object.keys(extensions).length) {\n var serverExtensions = {};\n Object.keys(extensions).forEach(function(token) {\n serverExtensions[token] = [extensions[token].params]\n });\n headers.push('Sec-WebSocket-Extensions: ' + Extensions.format(serverExtensions));\n }\n\n // allows external modification/inspection of handshake headers\n self.emit('headers', headers);\n\n socket.setTimeout(0);\n socket.setNoDelay(true);\n try {\n socket.write(headers.concat('', '').join('\\r\\n'));\n }\n catch (e) {\n // if the upgrade write fails, shut the connection down hard\n try { socket.destroy(); } catch (e) {}\n return;\n }\n\n var client = new WebSocket([req, socket, upgradeHead], {\n protocolVersion: version,\n protocol: protocol,\n extensions: extensions,\n maxPayload: self.options.maxPayload\n });\n\n if (self.options.clientTracking) {\n self.clients.push(client);\n client.on('close', function() {\n var index = self.clients.indexOf(client);\n if (index != -1) {\n self.clients.splice(index, 1);\n }\n });\n }\n\n // signal upgrade complete\n socket.removeListener('error', errorHandler);\n cb(client);\n }\n\n // optionally call external protocol selection handler before\n // calling completeHybiUpgrade2\n var completeHybiUpgrade1 = function() {\n // choose from the sub-protocols\n if (typeof self.options.handleProtocols == 'function') {\n var protList = (protocols || \"\").split(/, */);\n var callbackCalled = false;\n var res = self.options.handleProtocols(protList, function(result, protocol) {\n callbackCalled = true;\n if (!result) abortConnection(socket, 401, 'Unauthorized');\n else completeHybiUpgrade2(protocol);\n });\n if (!callbackCalled) {\n // the handleProtocols handler never called our callback\n abortConnection(socket, 501, 'Could not process protocols');\n }\n return;\n } else {\n if (typeof protocols !== 'undefined') {\n completeHybiUpgrade2(protocols.split(/, */)[0]);\n }\n else {\n completeHybiUpgrade2();\n }\n }\n }\n\n // optionally call external client verification handler\n if (typeof this.options.verifyClient == 'function') {\n var info = {\n origin: origin,\n secure: typeof req.connection.authorized !== 'undefined' || typeof req.connection.encrypted !== 'undefined',\n req: req\n };\n if (this.options.verifyClient.length == 2) {\n this.options.verifyClient(info, function(result, code, name) {\n if (typeof code === 'undefined') code = 401;\n if (typeof name === 'undefined') name = http.STATUS_CODES[code];\n\n if (!result) abortConnection(socket, code, name);\n else completeHybiUpgrade1();\n });\n return;\n }\n else if (!this.options.verifyClient(info)) {\n abortConnection(socket, 401, 'Unauthorized');\n return;\n }\n }\n\n completeHybiUpgrade1();\n}", "title": "" }, { "docid": "d377a77d64e44a15e4925f1863fd4bd6", "score": "0.56111205", "text": "function handleHybiUpgrade(req, socket, upgradeHead, cb) {\n // handle premature socket errors\n var errorHandler = function() {\n try { socket.destroy(); } catch (e) {}\n }\n socket.on('error', errorHandler);\n\n // verify key presence\n if (!req.headers['sec-websocket-key']) {\n abortConnection(socket, 400, 'Bad Request');\n return;\n }\n\n // verify version\n var version = parseInt(req.headers['sec-websocket-version']);\n if ([8, 13].indexOf(version) === -1) {\n abortConnection(socket, 400, 'Bad Request');\n return;\n }\n\n // verify protocol\n var protocols = req.headers['sec-websocket-protocol'];\n\n // verify client\n var origin = version < 13 ?\n req.headers['sec-websocket-origin'] :\n req.headers['origin'];\n\n // handle extensions offer\n var extensionsOffer = Extensions.parse(req.headers['sec-websocket-extensions']);\n\n // handler to call when the connection sequence completes\n var self = this;\n var completeHybiUpgrade2 = function(protocol) {\n\n // calc key\n var key = req.headers['sec-websocket-key'];\n var shasum = crypto.createHash('sha1');\n shasum.update(key + \"258EAFA5-E914-47DA-95CA-C5AB0DC85B11\");\n key = shasum.digest('base64');\n\n var headers = [\n 'HTTP/1.1 101 Switching Protocols'\n , 'Upgrade: websocket'\n , 'Connection: Upgrade'\n , 'Sec-WebSocket-Accept: ' + key\n ];\n\n if (typeof protocol != 'undefined') {\n headers.push('Sec-WebSocket-Protocol: ' + protocol);\n }\n\n var extensions = {};\n try {\n extensions = acceptExtensions.call(self, extensionsOffer);\n } catch (err) {\n abortConnection(socket, 400, 'Bad Request');\n return;\n }\n\n if (Object.keys(extensions).length) {\n var serverExtensions = {};\n Object.keys(extensions).forEach(function(token) {\n serverExtensions[token] = [extensions[token].params]\n });\n headers.push('Sec-WebSocket-Extensions: ' + Extensions.format(serverExtensions));\n }\n\n // allows external modification/inspection of handshake headers\n self.emit('headers', headers);\n\n socket.setTimeout(0);\n socket.setNoDelay(true);\n try {\n socket.write(headers.concat('', '').join('\\r\\n'));\n }\n catch (e) {\n // if the upgrade write fails, shut the connection down hard\n try { socket.destroy(); } catch (e) {}\n return;\n }\n\n var client = new WebSocket([req, socket, upgradeHead], {\n protocolVersion: version,\n protocol: protocol,\n extensions: extensions,\n maxPayload: self.options.maxPayload\n });\n\n if (self.options.clientTracking) {\n self.clients.push(client);\n client.on('close', function() {\n var index = self.clients.indexOf(client);\n if (index != -1) {\n self.clients.splice(index, 1);\n }\n });\n }\n\n // signal upgrade complete\n socket.removeListener('error', errorHandler);\n cb(client);\n }\n\n // optionally call external protocol selection handler before\n // calling completeHybiUpgrade2\n var completeHybiUpgrade1 = function() {\n // choose from the sub-protocols\n if (typeof self.options.handleProtocols == 'function') {\n var protList = (protocols || \"\").split(/, */);\n var callbackCalled = false;\n var res = self.options.handleProtocols(protList, function(result, protocol) {\n callbackCalled = true;\n if (!result) abortConnection(socket, 401, 'Unauthorized');\n else completeHybiUpgrade2(protocol);\n });\n if (!callbackCalled) {\n // the handleProtocols handler never called our callback\n abortConnection(socket, 501, 'Could not process protocols');\n }\n return;\n } else {\n if (typeof protocols !== 'undefined') {\n completeHybiUpgrade2(protocols.split(/, */)[0]);\n }\n else {\n completeHybiUpgrade2();\n }\n }\n }\n\n // optionally call external client verification handler\n if (typeof this.options.verifyClient == 'function') {\n var info = {\n origin: origin,\n secure: typeof req.connection.authorized !== 'undefined' || typeof req.connection.encrypted !== 'undefined',\n req: req\n };\n if (this.options.verifyClient.length == 2) {\n this.options.verifyClient(info, function(result, code, name) {\n if (typeof code === 'undefined') code = 401;\n if (typeof name === 'undefined') name = http.STATUS_CODES[code];\n\n if (!result) abortConnection(socket, code, name);\n else completeHybiUpgrade1();\n });\n return;\n }\n else if (!this.options.verifyClient(info)) {\n abortConnection(socket, 401, 'Unauthorized');\n return;\n }\n }\n\n completeHybiUpgrade1();\n}", "title": "" }, { "docid": "c3333e24d6346f14c2e5fc8cf7af4a57", "score": "0.56111205", "text": "function handleHybiUpgrade(req, socket, upgradeHead, cb) {\n // handle premature socket errors\n var errorHandler = function() {\n try { socket.destroy(); } catch (e) {}\n }\n socket.on('error', errorHandler);\n\n // verify key presence\n if (!req.headers['sec-websocket-key']) {\n abortConnection(socket, 400, 'Bad Request');\n return;\n }\n\n // verify version\n var version = parseInt(req.headers['sec-websocket-version']);\n if ([8, 13].indexOf(version) === -1) {\n abortConnection(socket, 400, 'Bad Request');\n return;\n }\n\n // verify protocol\n var protocols = req.headers['sec-websocket-protocol'];\n\n // verify client\n var origin = version < 13 ?\n req.headers['sec-websocket-origin'] :\n req.headers['origin'];\n\n // handle extensions offer\n var extensionsOffer = Extensions.parse(req.headers['sec-websocket-extensions']);\n\n // handler to call when the connection sequence completes\n var self = this;\n var completeHybiUpgrade2 = function(protocol) {\n\n // calc key\n var key = req.headers['sec-websocket-key'];\n var shasum = crypto.createHash('sha1');\n shasum.update(key + \"258EAFA5-E914-47DA-95CA-C5AB0DC85B11\");\n key = shasum.digest('base64');\n\n var headers = [\n 'HTTP/1.1 101 Switching Protocols'\n , 'Upgrade: websocket'\n , 'Connection: Upgrade'\n , 'Sec-WebSocket-Accept: ' + key\n ];\n\n if (typeof protocol != 'undefined') {\n headers.push('Sec-WebSocket-Protocol: ' + protocol);\n }\n\n var extensions = {};\n try {\n extensions = acceptExtensions.call(self, extensionsOffer);\n } catch (err) {\n abortConnection(socket, 400, 'Bad Request');\n return;\n }\n\n if (Object.keys(extensions).length) {\n var serverExtensions = {};\n Object.keys(extensions).forEach(function(token) {\n serverExtensions[token] = [extensions[token].params]\n });\n headers.push('Sec-WebSocket-Extensions: ' + Extensions.format(serverExtensions));\n }\n\n // allows external modification/inspection of handshake headers\n self.emit('headers', headers);\n\n socket.setTimeout(0);\n socket.setNoDelay(true);\n try {\n socket.write(headers.concat('', '').join('\\r\\n'));\n }\n catch (e) {\n // if the upgrade write fails, shut the connection down hard\n try { socket.destroy(); } catch (e) {}\n return;\n }\n\n var client = new WebSocket([req, socket, upgradeHead], {\n protocolVersion: version,\n protocol: protocol,\n extensions: extensions\n });\n\n if (self.options.clientTracking) {\n self.clients.push(client);\n client.on('close', function() {\n var index = self.clients.indexOf(client);\n if (index != -1) {\n self.clients.splice(index, 1);\n }\n });\n }\n\n // signal upgrade complete\n socket.removeListener('error', errorHandler);\n cb(client);\n }\n\n // optionally call external protocol selection handler before\n // calling completeHybiUpgrade2\n var completeHybiUpgrade1 = function() {\n // choose from the sub-protocols\n if (typeof self.options.handleProtocols == 'function') {\n var protList = (protocols || \"\").split(/, */);\n var callbackCalled = false;\n var res = self.options.handleProtocols(protList, function(result, protocol) {\n callbackCalled = true;\n if (!result) abortConnection(socket, 401, 'Unauthorized');\n else completeHybiUpgrade2(protocol);\n });\n if (!callbackCalled) {\n // the handleProtocols handler never called our callback\n abortConnection(socket, 501, 'Could not process protocols');\n }\n return;\n } else {\n if (typeof protocols !== 'undefined') {\n completeHybiUpgrade2(protocols.split(/, */)[0]);\n }\n else {\n completeHybiUpgrade2();\n }\n }\n }\n\n // optionally call external client verification handler\n if (typeof this.options.verifyClient == 'function') {\n var info = {\n origin: origin,\n secure: typeof req.connection.authorized !== 'undefined' || typeof req.connection.encrypted !== 'undefined',\n req: req\n };\n if (this.options.verifyClient.length == 2) {\n this.options.verifyClient(info, function(result, code, name) {\n if (typeof code === 'undefined') code = 401;\n if (typeof name === 'undefined') name = http.STATUS_CODES[code];\n\n if (!result) abortConnection(socket, code, name);\n else completeHybiUpgrade1();\n });\n return;\n }\n else if (!this.options.verifyClient(info)) {\n abortConnection(socket, 401, 'Unauthorized');\n return;\n }\n }\n\n completeHybiUpgrade1();\n}", "title": "" }, { "docid": "f876fd8432b4e226ecdf481e2e5d3d5a", "score": "0.5610627", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug$7('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "2cf390a1f8804f172573456fa387d936", "score": "0.5594688", "text": "function onerror(err) {\n const error = new Error(\"probe error: \" + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit(\"upgradeError\", error);\n }", "title": "" }, { "docid": "2cf390a1f8804f172573456fa387d936", "score": "0.5594688", "text": "function onerror(err) {\n const error = new Error(\"probe error: \" + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit(\"upgradeError\", error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.55736434", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.55736434", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.55736434", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.55736434", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.55736434", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.55736434", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.55736434", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.55736434", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.55736434", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.55736434", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.55736434", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.55736434", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.55736434", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.55736434", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.55736434", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.55736434", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.55736434", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.55736434", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.55736434", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.55736434", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.55736434", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.55736434", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.55736434", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.55736434", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.55736434", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.55736434", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.55736434", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" } ]
726bfc9dacd2ff17f22d2d1765cc0b6c
tags each word of sentence with part of speech
[ { "docid": "1618aa8f3ff2be16870576e921aab6f6", "score": "0.6548417", "text": "function tagSentences(sentences) {\n let tagged = [];\n let tagger = new pos.Tagger();\n for(let i = 0; i < sentences.length; i++) {\n let sentence = sentences[i];\n let taggedSentence = [];\n for(let j = 0; j < sentence.length; j++) {\n let word = sentence[j].trim();\n let lexer = new pos.Lexer().lex(word);\n let tag = tagger.tag(lexer)[0];\n if(tag)\n taggedSentence.push([word,tag[1]]);\n }\n tagged.push(taggedSentence);\n }\n return tagged;\n}", "title": "" } ]
[ { "docid": "530e86af56e65e0dc4b0a1ae129e86b7", "score": "0.672946", "text": "function parseSentencs(t){\n let doc = nlp(t);\n let pos = {};\n let p = [\"he\", \"she\", \"it\", \"my\", \"\", \"i\", \"me\", \"her\", \"him\", \"we\", \"our\", \"ours\", \"their\", \"its\", \"the\", \"this\", \"that\", \"but\"];\n\n var nouns = doc.sentences().match('#Noun').out('text').toLowerCase().replace(/\\s+/g, ',').split(',');\n nouns = nouns.filter((v, i, a) => a.indexOf(v) === i);\n for(var i = 0; i < p.length; i++){\n var index = nouns.indexOf(p[i]);\n if (index !== -1) nouns.splice(index, 1);\n }\n\n var verbs = doc.sentences().match('#Verb').out('text').toLowerCase().replace(/\\s+/g, ',').split(',');\n verbs = verbs.filter((v, i, a) => a.indexOf(v) === i);\n for(var i = 0; i < p.length; i++){\n var index = verbs.indexOf(p[i]);\n if (index !== -1) verbs.splice(index, 1);\n }\n\n var adjectives = doc.sentences().match('#Adjective').out('text').toLowerCase().replace(/\\s+/g, ',').split(',');\n adjectives = adjectives.filter((v, i, a) => a.indexOf(v) === i);\n for(var i = 0; i < p.length; i++){\n var index = adjectives.indexOf(p[i]);\n if (index !== -1) adjectives.splice(index, 1);\n }\n\n // var adverbs = doc.sentences().match('#Adverb').out('text').replace(/\\s+/g, ',').split(',');\n // adverbs = adverbs.filter((v, i, a) => a.indexOf(v) === i);\n //\n // var prepositions = doc.sentences().match('#Preposition').out('text').replace(/\\s+/g, ',').split(',');\n // prepositions = prepositions.filter((v, i, a) => a.indexOf(v) === i);\n\n pos = {\n 'noun': nouns,\n 'verb': verbs,\n 'adjective': adjectives\n }\n\n return pos;\n}", "title": "" }, { "docid": "d3f407757a30726e3ef731bf2a72e8ff", "score": "0.626917", "text": "function removeOtherPhrases(tagged,textObject) {\n for(let i = 0; i < tagged.length; i++) {\n let sentence = tagged[i];\n\n // find various punctuation in sentence\n let commas = [], otherSeparators = [], k;\n for(k = 0; k < sentence.length; k++) {\n let test = sentence[k][0].trim();\n if (test === \",\")\n commas.push(k);\n else if(test === \"-\")\n otherSeparators.push(k);\n }\n\n if(commas.length === 1) {\n let pos = commas[0]/sentence.length;\n // console.log(\"comma at\",pos);\n if(pos >= 0.8) {\n sentence.splice(commas[0]);\n sentence.push([\".\",\".\"]);\n } else if(pos <= 0.2) {\n sentence.splice(0,commas[0]+1);\n }\n }\n\n if(otherSeparators.length === 2) {\n sentence.splice(otherSeparators[0], otherSeparators[1]-otherSeparators[0]+1);\n }\n }\n}", "title": "" }, { "docid": "51f8b4879f4fc7503c2a37c971018b54", "score": "0.6036456", "text": "function putsentence_s() {\n\tlet out = \"\";\n\tfor (let i = 0; i < sentence.length; i++) {\n\t\tlet d = sentence[i];\n\n\t\tout += d.word.pronounce;\n\n\t var condition1 = d.isConjugatedNext;\n\t var condition2 = (i+1 < sentence.length) && sentence[i+1].isConjugatedPrev;\n\n\t if (condition1 || condition2)\n\t\t\t{}\n\t\telse {\n\t\t out += \" \";\t\t\t\n\t\t}\n\t}\n\treturn out;\n}", "title": "" }, { "docid": "81070a2ff5c4f501d2e045a7181f5d0a", "score": "0.5987562", "text": "function add_custom_html_tags( text , dizionario ) {\n var raw_split = text.split(/([ '\\.])/);\n\tvar got_words = text.split(/\\b/);\n\tvar out = \"\";\n\tfor (i in raw_split) {\n\t\t// deletes tags and punctuation for comparison\n\t\tvar epurated = raw_split[i].replace(/(<\\/{0,1}\\w*>)/g, \"\").replace(/[\\.,;!\\?]/g,\"\").trim();\n\t\tvar epuratedLowercased = epurated.toLowerCase();\n\t debug_out(raw_split[i]+\" // \"+epuratedLowercased+\" /?/ \"+isNullOrEmpty(epurated),3);\n\t\t// it's not a word, copy as it is\n\t\tif ( isNullOrEmpty(epurated) ) {\n\t\t\tout += raw_split[i];\n\t\t}\n\t\telse {\n\t\t\t// if it's included in the dictionary, adds the <wd> tag\n\t\t\tif ( dizionario.indexOf(epuratedLowercased) >= 0 ) {\n if (UI_settings.wordhighlight) {\n\t\t\t out += \"<wdh onClick=\\'pick_a_word(\\\"\"+ epuratedLowercased +\"\\\");\\'>\"+ raw_split[i] +\"</wdh>\";\n }\n else {\n\t\t\t out += \"<wd onClick=\\'pick_a_word(\\\"\"+ epuratedLowercased +\"\\\");\\'>\"+ raw_split[i] +\"</wd>\";\n }\n\t\t\t}\n\t\t\telse {\n\t\t\t\tout += raw_split[i];\n\t\t\t}\n\t\t}\n\t}\n return out;\n}", "title": "" }, { "docid": "3bb51bc2238b147e98e2541cbacf1c66", "score": "0.5957443", "text": "function keywords(text){\n var anlyzed = nlp.pos(text)\n var nouns = anlyzed.nouns();\n var verbs = anlyzed.verbs();\n return nouns.concat(verbs).map(function (wobj) {\n return wobj.normalised;\n })\n}", "title": "" }, { "docid": "3cf9e38e9ecf811bb397a338bc9bb3f7", "score": "0.5955245", "text": "function add_custom_html_tags( text , dizionario ) {\n var raw_split = text.split(/([ '\\.])/);\n var got_words = text.split(/\\b/);\n var out = \"\";\n for (i in raw_split) {\n // deletes tags and punctuation for comparison\n var epurated = raw_split[i].replace(/(<\\/{0,1}\\w*>)/g, \"\").replace(/[\\.,;!\\?]/g,\"\").trim();\n var epuratedLowercased = epurated.toLowerCase();\n debug_out(raw_split[i]+\" // \"+epuratedLowercased+\" /?/ \"+isNullOrEmpty(epurated),3);\n // it's not a word, copy as it is\n if ( isNullOrEmpty(epurated) ) {\n out += raw_split[i];\n }\n else {\n // if it's included in the dictionary, adds the <wd> tag\n if ( dizionario.indexOf(epuratedLowercased) >= 0 ) {\n if (FIN_framework.UI_settings.wordhighlight) {\n out += \"<wdh onClick=\\'pick_a_word(\\\"\"+ epuratedLowercased +\"\\\");\\'>\"+ raw_split[i] +\"</wdh>\";\n }\n else {\n out += \"<wd onClick=\\'pick_a_word(\\\"\"+ epuratedLowercased +\"\\\");\\'>\"+ raw_split[i] +\"</wd>\";\n }\n }\n else {\n out += raw_split[i];\n }\n }\n }\n return out;\n}", "title": "" }, { "docid": "c0e8e4efce02ea9ebfa9b63503054565", "score": "0.5929448", "text": "function wordYeller(sentence){\r\n const punctuation = ['.', ',', '!', '?', ';', ':']\r\n let array = sentence.split(' ')\r\n let result = []\r\n for (let i = 0; i < array.length; i++){\r\n word = array[i]\r\n lastIndex = word.length - 1 \r\n if (!punctuation.includes(word[lastIndex])){\r\n result.push(word.concat('!'))\r\n }\r\n else{\r\n result.push(word)\r\n }\r\n }\r\n return result.join(' ')\r\n}", "title": "" }, { "docid": "bc1b78d20d35f02f80d71af49e6dd614", "score": "0.58621186", "text": "function POSTAG(StringTeste){\n\n\n\tvar shortTestString = \"This is some sample text. This text can contain multiple sentences.\";\n\tvar testWords = [\"yellow\"];\n\n\tvar lexer = new Lexer();\n\tvar tagger = new POSTagger();\n\tvar start = new Date().getTime();\n\tvar words = lexer.lex(StringTeste);\n\tvar tags = tagger.tag(words);\n\tvar end = new Date().getTime();\n\tdifference = (end - start);\n\tvar phrasePosTAGGED = \"\";\n\tfor (j in tags) {\n\t\tvar tag = tags[j];\n\t\treturn (tag[1]);\n\t}\n\n\n}", "title": "" }, { "docid": "4853cc39042fbf5ccc079e22f05494f5", "score": "0.585492", "text": "function removePossessives(tagged) {\n for(let i = 0; i < tagged.length; i++) {\n let sentence = tagged[i];\n for(let j = 0; j < sentence.length; j++) {\n let pair = sentence[j];\n let word = pair[0];\n let tag = pair[1];\n if(tag === \"PP$\" || tag === \"PRP$\") {\n if(j - 1 >= 0) {\n let prevWord = sentence[j-1];\n let prevTag = prevWord[1];\n if(prevTag === \"VBN\" || prevTag === \"VBD\")\n continue;\n }\n sentence.splice(j,1);\n j--;\n }\n }\n tagged[i] = sentence;\n }\n return tagged;\n}", "title": "" }, { "docid": "bebfe9790c734e243ce24b766c9ea8b7", "score": "0.5838756", "text": "function fixFormat(tagged) {\n for(let i = 0; i < tagged.length; i++) {\n let sentence = tagged[i];\n let firstWord = sentence[0][0];\n firstWord = firstWord[0].toUpperCase() + firstWord.substring(1);\n sentence[0][0] = firstWord;\n tagged[i] = sentence;\n }\n\n return tagged;\n}", "title": "" }, { "docid": "b0426738ebd57cb445c85eb2bb74df99", "score": "0.5801655", "text": "function wordInSentence(sentence,word){\n if(sentence.length===0)\n return `---->The word ${word} appears ${i} times in this sentence ${sentence}`;\n else{\n if (sentence[0]===word)\n i++;\n \n }\n\n return sentence[0] + wordInSentence(sentence.slice(1,sentence.length),word);\n \n}", "title": "" }, { "docid": "ada53c828f14fcb1b317010d23f1bd02", "score": "0.5772419", "text": "function tokenize(sentence) {\n tokenizer = new natural.WordPunctTokenizer();\n return toAdd = tokenizer.tokenize(sentence);\n}", "title": "" }, { "docid": "08330ea12cc2001e2eb204039764410f", "score": "0.5759539", "text": "function tagcloudHelper(tags,words) {\n console(tags)\n if ((!tags || !tags.hasOwnProperty('length'))) {\n tags = this.site.tags;\n }\n\n if (!tags || !tags.length) return '';\n var result = [];\n tags = tags.sort('name', 1);\n // Ignore tags with zero posts\n tags = tags.filter(function (tag) {\n return tag.length;\n });\n var maxsize = 1;\n tags.sort('length').forEach(function (tag) {\n var length = tag.length;\n if (length > maxsize)\n maxsize = length;\n });\n var arr = [], words;\n tags.forEach(function (tag) {\n arr.push({\"name\": tag.name, \"num\": tag.length});\n });\n words = arr.map(function (d) {\n var text = d.name.replace(/[^\\x00-\\xff]/g, \"ab\");\n return {name: d.name, text: text, size: Math.log(d.num) / (Math.log(maxsize) - Math.log(1)) * 15 + 30};\n });\n\n layout.words(words);\n layout.start();\n result.push('<svg width=\"600\" height=\"400\"><g transform=\"translate(300,200)\">');\n words.forEach(function (word, i) {\n result.push(\n '<text text-anchor=\"middle\" fill=\"' + fill(i) + '\" transform=\"translate(' + word.x + ',' + word.y + ')rotate(' +\n word.rotate + ')\" style=\"font-size:' + word.size + 'px;font-family:Impact\">' + word.name + '</text>'\n );\n });\n result.push('</g></svg>');\n return result.join('');\n}", "title": "" }, { "docid": "791e34316582f7be36c781bbb2f9c896", "score": "0.5758373", "text": "function current_word_is_tag(sentence, i, parameter) {\n return sentence.taggedWords[i].tag === parameter;\n}", "title": "" }, { "docid": "cf033cc7bb2c62c0d5e05354ed3a0b70", "score": "0.57461816", "text": "function convertSentenceToLeetSpeak(sentence) {\n var originalWords = _.words(sentence);\n var leetWords = _.map(originalWords, convertWordToLeetSpeak);\n return _.join(leetWords, ' ');\n}", "title": "" }, { "docid": "06565919e10aa5b71c4d0a1eb15de731", "score": "0.57309794", "text": "function tokenizeEnglish(inText)\n{\n\tflag = false; // flag will be set true if the inText text will end with pMarks\n\tlen = inText.length; \n\t\n\t// the input should end with a punctuation mark\n\tfor(x = 0; x < englishpMarks.length; x++) {\n\t\t// check if last character of the sentence is pMarks or not\n\t\tif(inText[len - 1] == englishpMarks[x]) {\n\t\t\tflag = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\t// if no puntuation in the end then put a puntuation mark in the sentence\n\tif(flag == false)\n\t\tinputText = inText + \".\";\n\telse\n\t\tinputText = inText;\n\t\n\t// convert the given paragraph into sentences \n\t// result is an array holding each sentence own its own\n\n\tresult = inputText.match( /[^\\.!\\?]+[\\.!\\?]+/g );\n\tconsole.log(\"tokenize into sentences : \" + result);\n\t\n\t// convert each sentence into words and also add the pause \n\t// identifier to make the animation pause after each word\n\t\n\t// loop over the result array and replace space and end of sentence \n\t// and store it newString\n\tnewString=\"\";\n\tfor(y = 0; y < result.length; y++) {\n\t\tline = result[y];\n\t\tfor(x = 0; x < line.length; x++) {\n\t\t\tif(isSpace(line[x]))\n\t\t\t\tnewString = newString + \",\";\n\t\t\telse \n\t\t\t\tnewString = newString + line[x];\n\t\t}\n\n\t}\n\t\n\t// create array of tokens\n\tconsole.log(\"Processed sting : \" + newString);\n\treturn newString;\n}", "title": "" }, { "docid": "0c655b3258bdf4b09d2ae20fbc14bcb3", "score": "0.57193816", "text": "function updateWord(sentence) {\n var start = sentence.indexOf('['),\n end = sentence.indexOf(']'),\n goodBad = sentence.substring(start+1, end).split(delimiter),\n\n startStr = sentence.substr(0, start),\n endStr = sentence.substr(end + 1),\n goodStr = goodBad[0] ? ' <span class=\"stress\">' + goodBad[0] + '</span> ' : ' ',\n badStr = goodBad[1] ? ' <span class=\"stress\">' + goodBad[1] + '</span> ' : ' '\n ;\n\n // extract good/bad sentences\n var good = startStr + goodStr + endStr;\n var bad = startStr + badStr + endStr;\n\n // update html\n $('.good-sentence').html(good);\n $('.bad-sentence').html(bad);\n\n}", "title": "" }, { "docid": "8aafd18aee7147bed56a7513c8f2a4b5", "score": "0.5712309", "text": "function tokenizeEnglish(inText)\n{\n\tflag = false; // flag will be set true if the inText text will end with pMarks\n\tlen = inText.length; \n\t\n\t// the input should end with a punctuation mark\n\tfor(x = 0; x < englishpMarks.length; x++) {\n\t\t// check if last character of the sentence is pMarks or not\n\t\tif(inText[len - 1] == englishpMarks[x]) {\n\t\t\tflag = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\t// if no puntuation in the end then put a puntuation mark in the sentence\n\tif(flag == false)\n\t\tinputText = inText + \".\";\n\telse\n\t\tinputText = inText;\n\t\n\t// convert the given paragraph into sentences \n\t// result is an array holding each sentence own its own\n\tresult = inputText.match( /[^\\.!\\?]+[\\.!\\?]+/g );\n\tconsole.log(\"tokenize into sentences : \" + result);\n\t\n\t// convert each sentence into words and also add the pause \n\t// identifier to make the animation pause after each word\n\t\n\t// loop over the result array and replace space and end of sentence \n\t// and store it newString\n\tnewString=\"\";\n\tfor(y = 0; y < result.length; y++) {\n\t\tline = result[y];\n\t\tfor(x = 0; x < line.length; x++) {\n\t\t\tif(isSpace(line[x]))\n\t\t\t\tnewString = newString + \",\";\n\t\t\telse \n\t\t\t\tnewString = newString + line[x];\n\t\t}\n\t\tnewString = newString + \",EOL,\"; // EOL - end of line\t\t\n\t}\n\t\n\t// create array of tokens\n\tconsole.log(\"Processed sting : \" + newString);\n\treturn newString;\n}", "title": "" }, { "docid": "c25a91dfa446f4c63cae0c9b38f39bfa", "score": "0.5705135", "text": "function rearangeSentence(words){\r\n var array = words.split(' ');\r\n var sortedArray = [];\r\n for(var i = 0; i <= array.length; i++) {\r\n for(var j = 0; j < array.length; j++) {\r\n if(array[j].indexOf(i) >= 0) {\r\n sortedArray.push(array[j]);\r\n }\r\n }\r\n }\r\n return sortedArray.join(' ');\r\n}", "title": "" }, { "docid": "bd9aa25b8f87bb9070e9bb5512ee9c33", "score": "0.5702578", "text": "function tokenizeEnglish(inText)\n{\n\tflag = false; // flag will be set true if the inText text will end with pMarks\n\tlen = inText.length; \n\t\n\t// the input should end with a punctuation mark\n\tfor(x = 0; x < englishpMarks.length; x++) {\n\t\t// check if last character of the sentence is pMarks or not\n\t\tif(inText[len - 1] == englishpMarks[x]) {\n\t\t\tflag = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\t// if no puntuation in the end then put a puntuation mark in the sentence\n\tif(flag == false)\n\t\tinputText = inText + \".\";\n\telse\n\t\tinputText = inText;\n\t\n\t// convert the given paragraph into sentences \n\t// result is an array holding each sentence own its own\n\n\tresult = inputText.match( /[^\\.!\\?]+[\\.!\\?]+/g );\n\tconsole.log(\"tokenize into sentences : \" + result);\n\t\n\t// convert each sentence into words and also add the pause \n\t// identifier to make the animation pause after each word\n\t\n\t// loop over the result array and replace space and end of sentence \n\t// and store it newString\n\tnewString=\"\";\n\tfor(y = 0; y < result.length; y++) {\n\t\tline = result[y];\n\t\tfor(x = 0; x < line.length; x++) {\n\t\t\tif(isSpace(line[x]))\n\t\t\t\tnewString = newString + \",\";\n\t\t\telse \n\t\t\t\tnewString = newString + line[x];\n\t\t}\n\t\tnewString = newString + \",EOL,\"; // EOL - end of line\n\t}\n\t\n\t// create array of tokens\n\tconsole.log(\"Processed sting : \" + newString);\n\treturn newString;\n}", "title": "" }, { "docid": "3ff1afb4abdfbfdf10855882ef8f714a", "score": "0.56888175", "text": "function removeAdjectives(tagged, textObject) {\n let importanceValues = textObject.importanceValues;\n let avg = textObject.importanceAvg;\n for(let i = 0; i < tagged.length; i++) {\n let sentence = tagged[i];\n for(let j = 0; j < sentence.length; j++) {\n let pair = sentence[j];\n let word = pair[0];\n let tag = pair[1];\n if((tag === \"JJ\" || tag === \"JJR\" || tag === \"JJS\") && !util.isProperNoun(word)) {\n // perform various tests first because maybe it should not be removed\n if(j-1 >= 0) {\n let prevWord = sentence[j-1][0];\n if(prevWord === \"not\" || prevWord === \"is\" ||\n prevWord === \"are\" || prevWord === \"was\" || prevWord === \"were\") continue;\n }\n if(j+1 < sentence.length) {\n let nextWord = sentence[j+1][0];\n let nextTag = sentence[j+1][1];\n if(nextTag === \"MD\" || nextTag === \"VBN\") continue;\n }\n if(importanceValues[word] > avg*1.5) {\n continue;\n }\n\n sentence.splice(j,1);\n j--;\n }\n }\n tagged[i] = sentence;\n }\n return tagged;\n}", "title": "" }, { "docid": "f465d78e4c18f7ac26b13acb3f58482e", "score": "0.5682016", "text": "function add_custom_html_tagsOLD( text , dizionario ) {\n// es: add_custom_html_tags ( \"#placeholder\" , DICTIONARY )\n // cleans up the text to be checked and splits it word by word\n/// var words = text.replace(/[\\.,;!\\?]/g,\" \").split(\" \");\n var words = text.split(\" \");\n var words_testable = text.replace(/(<\\/{0,1}\\w*>)/g, \"\").replace(/[\\.,;!\\?]/g,\" \").split(\" \");\n// var words_testable = text.replace(/(<\\/{0,1}\\w*>)/g, \"\").replace(/\\'.,;!\\?/g, \" \").split(\" \");\n// var words_testable = text.replace(/(<\\/{0,1}\\w*>)/g, \"\").split(/\\b/);\n var new_all = \"\";\n var new_wd;\n // for each word:\n for (var i=0; i < words_testable.length ; i+=1) {\n\t\tconsole.log(\">>>>\"+words[i]+\">>\"+words_testable[i]+\">>\");\n if (!isNullOrEmpty(words_testable[i])) {\n new_wd = words_testable[i].toLowerCase().replace(/[\\W]+/g,\"\");\n // if the (lower-cased) word is in dictionary adds the specific tag, otherwise...\n if ( dizionario.indexOf(new_wd) >= 0 ) {\n new_all += \"<wd onClick=\\'pick_a_word(\\\"\"+new_wd+\"\\\");\\'>\"+words[i]+\"</wd> \";\n// new_all += \"<wd onClick=\\'pick_a_word(\\\"\"+new_wd+\"\\\");\\'>\"+words_testable[i]+\"</wd> \";\n\t\t\t}\n // ... does not add any tag\n else {\n if (!isNullOrEmpty(words[i])) {\n new_all += words[i]+\" \";\n// new_all += words_testable[i]+\" \";\n }\n }\n\t }\n }\n return new_all;\n}", "title": "" }, { "docid": "873115d7156700ddfa1c87f51513beaf", "score": "0.56721646", "text": "function wordCount(sentence) {}", "title": "" }, { "docid": "b4a608bc37e1bbb53ecb69f84922ecad", "score": "0.56720406", "text": "function adjustSentences(signatures,textObject) {\n let tagged = signatures.taggedSentences;\n\n // tagged = removeAdjectives(tagged,textObject);\n // tagged = removeBlacklistWords(tagged);\n tagged = removePastParticiples(tagged);\n // tagged = removePossessives(tagged);\n removeOtherPhrases(tagged,textObject);\n tagged = fixFormat(tagged);\n\n return tagged;\n}", "title": "" }, { "docid": "ba6b0c57f22df2f64529920fad778436", "score": "0.56713307", "text": "function boldPassage(word, text) {\n let htmlString = \"<p>\";\n let textArray = text.split(\" \");\n textArray.forEach(function(element, index) {\n if (word === element) {\n htmlString = htmlString.concat(\"<b>\" + element + \"</b>\");\n } else {\n htmlString = htmlString.concat(element);\n }\n if (index !== (textArray.length - 1)) {\n htmlString = htmlString.concat(\" \");\n }\n });\n return htmlString + \"</p>\";\n}", "title": "" }, { "docid": "d6dda65d4c4e086881a2ad39b795a1e0", "score": "0.5638678", "text": "function varietyOfWords(sentence){\n let ar1=sentence.split(' ')\n let temp=[]\n for(let word of ar1){\n if(word[word.length-1] == '.'||word[word.length-1] == '?'){\n word = word.substr(0,word.length-1)\n }\n if(temp.includes(word) == false){\n temp.push(word)\n }\n }\n // console.log(temp)\n return temp.length\n}", "title": "" }, { "docid": "abeec2f8b2d2b958ed0acaa96569334f", "score": "0.56327766", "text": "function highlightKeywords() {\n let words = [\"for\", \"while\", \"var\", \"and\", \"is\"],\n wordsLastElementIndex = words.length - 1;\n let preList = document.getElementsByTagName(\"PRE\"),\n preListLastIndexElement = preList.length - 1;\n\n for (let i = 0; i <= preListLastIndexElement; i++) {\n let pre = preList[i];\n\n for (let j = 0; j <= wordsLastElementIndex; j++) {\n let word = words[j],\n regExp = new RegExp(\"\\\\b\" + word + \"\\\\b\", \"gi\"),\n replacing = \"<span class=pre-keyword>\" + word + \"</span>\";\n replacedInner = pre.innerHTML.replace(regExp, replacing);\n pre.innerHTML = replacedInner;\n }\n }\n}", "title": "" }, { "docid": "6d2e951062b4b3e86e509a07c34564b4", "score": "0.56145287", "text": "function wordYeller(sentence) {\n let newSentence = sentence.split(\" \");\n let result = [];\n\n\n for (let i = 0; i < newSentence.length; i++) {\n let word = newSentence[i];\n let lastLetter = word[word.length - 1];\n\n if(lastLetter === \".\" || lastLetter === \",\" || lastLetter === \"!\" || lastLetter === \"?\" || lastLetter === \";\") {\n result.push(word + \" \");\n } else {\n result.push(word + \"! \");\n }\n }\n let finalSentence = result.join(\"\");\n return finalSentence;\n}", "title": "" }, { "docid": "74eac8883df21f2c458445d4020cf759", "score": "0.55887085", "text": "function pigItRef(str) {\n let list = [];\n str.split(\" \").map((word) => {\n word.match(/^[.,:!?]/)\n ? list.push(word)\n : list.push(word.slice(1).concat(word[0] + \"ay\"));\n });\n return list.join(\" \");\n}", "title": "" }, { "docid": "ca885b8c4e985caaffa93546929d3e54", "score": "0.5570067", "text": "function findNamedEntities(txt, completePhrase) {\n if (!completePhrase) return;\n txt = txt.trim();\n if (txt == '') return;\n// if (g_chunks.hasOwnProperty(txt)) {\n// return;\n// }\n// g_chunks[txt] = 1;\n\n // Add a period after each pause.\n txt += \". \";\n txt = txt.charAt(0).toUpperCase() + txt.slice(1);\n \n\n console.log(\"findNamedEntities (really, translate): \" + txt);\n\n // Display source text in log area below.\n Source_log.innerHTML += \" \" + txt;\n\n// translate(txt, \"RBMT\");\n// translate(txt, \"G\");\n translate(txt, \"B\");\n}", "title": "" }, { "docid": "dd94b61024842364d4f22b5eef68cd3e", "score": "0.55696833", "text": "async function fetchKeywordsOfAllSentences(content){\n for(const sentence of content.sentences){\n //Passa o texto das sentenças para o watson e ele retorna as sentenças\n sentence.keywords = await fetcWatsonAndReturnKeywords(sentence.text)\n }\n }", "title": "" }, { "docid": "2cc1dd56df948653fe3f5011dd1efc41", "score": "0.5563885", "text": "function splitSentences(text) {\n\treturn text.replace(/([!?]|\\.\\.\\.)\\s+/g, \"$1. \").split(/[.;]\\s/);\n}", "title": "" }, { "docid": "09569f6cdff6f9322fdc8550ac66be40", "score": "0.5544567", "text": "function injectTags( text ) {\n // If the text is empty, or not text, just pass it through.\n if ( ! text || ! angular.isString( text ) ) {\n return( text );\n }\n // Search for and replace emoticon markers with HTML tags.\n var emotionalText = text.replace(\n compoundSearchPattern,\n function replaceMatch( $0, token, alias ) {\n // The first part of this pattern is looking for\n // normal tokens. This is so that we don't accidentally\n // find alias values inside of other tokens; the tokens\n // take precedence, like a boss.\n if ( token ) {\n return(\n tokenMap.hasOwnProperty( token )\n ? tokenMap[ token ]\n : $0\n );\n }\n // If we didn't find a token, then by factor of\n // elimination, we must have found an alias. Replace it\n // with the appropriate HTML tag.\n // --\n // NOTE: Since we only allow alias values that map onto\n // known tokens, we don't have to check to see if the\n // alias maps onto a valid token.\n return( tokenMap[ aliasMap[ alias ] ] );\n }\n );\n return( emotionalText );\n }", "title": "" }, { "docid": "638fb8c6dad80e69a4a9d0000fcb4b63", "score": "0.55441195", "text": "function findPotentialAdjectives( inputArray ) {\n\tlet certainAdjective = [],\n\t\tambiguousAdjective = [];\n\tfor ( let i = 0; i < inputArray.length + 2; i++ ) {\n\t\tlet word = inputArray[ i - 1 ],\n\t\t\ttags = lexicon.lexicon[ inputArray[ i - 1 ] ],\n\t\t\tbefore = lexicon.lexicon[ inputArray[ i - 2 ] ],\n\t\t\tafter = lexicon.lexicon[ inputArray[ i ] ],\n\t\t\tposition = i - 1,\n\t\t\tfrequency = 1;\n\t\tif ( tags && before ) {\n\t\t\tif ( tags.indexOf( \"JJ\" ) > -1 || tags.indexOf( \"JJR\" ) > -1 || tags.indexOf( \"JJS\" ) > -1 ) { // if JJ tag found\n\t\t\t\tif ( tags.length > 1 ) { // If the JJ tag is not the only tag\n\t\t\t\t\tif ( before[ 0 ] !== \"XX\" && before[ 0 ] !== undefined ) {\n\t\t\t\t\t\tlet bigrams = [],\n\t\t\t\t\t\t\ttagProbability = 0.66;\n\t\t\t\t\t\tfor ( let j = 0; j < tags.length; j++ ) { // storing the potential bigrams in an array\n\t\t\t\t\t\t\tif ( before[ 0 ].indexOf( \"DT\" ) > -1 ) { before[ 0 ] = \"DT\" }\n\t\t\t\t\t\t\tif ( before[ 0 ].indexOf( \"JJ\" ) > -1 ) { before[ 0 ] = \"JJ\" }\n\t\t\t\t\t\t\tif ( before[ 0 ].indexOf( \"NNP\" ) > -1 ) { before[ 0 ] = \"NNP\" }\n\t\t\t\t\t\t\tif ( before[ 0 ].indexOf( \"PRP\" ) > -1 ) { before[ 0 ] = \"NNP\" }\n\t\t\t\t\t\t\tif ( before[ 0 ].indexOf( \"RB\" ) > -1 ) { before[ 0 ] = \"RB\" }\n\t\t\t\t\t\t\tif ( before[ 0 ].indexOf( \"VB\" ) > -1 ) { before[ 0 ] = \"VB\" }\n\t\t\t\t\t\t\tif ( tags[ j ].indexOf( \"DT\" ) > -1 ) { tags[ j ] = \"DT\" }\n\t\t\t\t\t\t\tif ( tags[ j ].indexOf( \"JJ\" ) > -1 ) { tags[ j ] = \"JJ\" }\n\t\t\t\t\t\t\tif ( tags[ j ].indexOf( \"NNP\" ) > -1 ) { tags[ j ] = \"NNP\" }\n\t\t\t\t\t\t\tif ( tags[ j ].indexOf( \"PRP\" ) > -1 ) { tags[ j ] = \"NNP\" }\n\t\t\t\t\t\t\tif ( tags[ j ].indexOf( \"RB\" ) > -1 ) { tags[ j ] = \"RB\" }\n\t\t\t\t\t\t\tif ( tags[ j ].indexOf( \"VB\" ) > -1 ) { tags[ j ] = \"VB\" }\n\t\t\t\t\t\t\tlet lexiconBigram = before[ 0 ] + \"_\" + tags[ j ];\n\t\t\t\t\t\t\ttagProbability = tagProbability / ( Math.pow( 3, j + 1 ) );\n\t\t\t\t\t\t\tlet probability = bigramProbabilities.bigramProbabilities[ lexiconBigram ] * tagProbability,\n\t\t\t\t\t\t\t\tbigram = [];\n\t\t\t\t\t\t\tbigram.push( before[ 0 ], tags[ j ], \"XX\" ) // \"XX\" Signifying the ambiguous adjective position\n\t\t\t\t\t\t\tbigramObj = new prototype.bigramObject( bigram, probability );\n\t\t\t\t\t\t\tbigrams.push( bigramObj );\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t[ bigramObject {\n\t\t\t\t\t\t\t tagseq: [ 'DT', 'NNP', 'XX' ],\n\t\t\t\t\t\t\t probability: 0.00010384362139917695 },\n\t\t\t\t\t\t\t \tbigramObject {\n\t\t\t\t\t\t\t tagseq: [ 'DT', 'JJ', 'XX' ],\n\t\t\t\t\t\t\t probability: 0.0000024109129705837526 },\n\t\t\t\t\t\t\t \tbigramObject {\n\t\t\t\t\t\t\t tagseq: [ 'DT', 'NN', 'XX' ],\n\t\t\t\t\t\t\t probability: 2.1820756103583357e-8 } ]\n\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t}\n\t\t\t\t\t\tambiguous = new prototype.potentialAdjective( `flare.unsure.${inputArray[i-1]}`, tags, bigrams, position, frequency );\n\t\t\t\t\t\tambiguousAdjective.push( ambiguous );\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t\tpotentialAdjective {\n\t\t\t\t\t\t word: 'flare.unsure.great',\n\t\t\t\t\t\t tags: [ 'JJ', 'RB' ],\n\t\t\t\t\t\t bigrams:\n\t\t\t\t\t\t [ bigramObject { tagseq: [Object], probability: 0.011000000000000001 },\n\t\t\t\t\t\t bigramObject { tagseq: [Object], probability: 0.003177777777777778 } ],\n\t\t\t\t\t\t position: 2789,\n\t\t\t\t\t\t frequency: 1 }\n\t\t\t\t\t\t */\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ( after ) {\n\t\t\t\t\t\t\tlet bigrams = [],\n\t\t\t\t\t\t\t\ttagProbability = 0.66;\n\t\t\t\t\t\t\tfor ( let j = 0; j < tags.length; j++ ) { // storing the potential bigrams in an array\n\t\t\t\t\t\t\t\tif ( after[ 0 ].indexOf( \"DT\" ) > -1 ) { after[ 0 ] = \"DT\" }\n\t\t\t\t\t\t\t\tif ( after[ 0 ].indexOf( \"JJ\" ) > -1 ) { after[ 0 ] = \"JJ\" }\n\t\t\t\t\t\t\t\tif ( after[ 0 ].indexOf( \"NNP\" ) > -1 ) { after[ 0 ] = \"NNP\" }\n\t\t\t\t\t\t\t\tif ( after[ 0 ].indexOf( \"PRP\" ) > -1 ) { after[ 0 ] = \"NNP\" }\n\t\t\t\t\t\t\t\tif ( after[ 0 ].indexOf( \"RB\" ) > -1 ) { after[ 0 ] = \"RB\" }\n\t\t\t\t\t\t\t\tif ( after[ 0 ].indexOf( \"VB\" ) > -1 ) { after[ 0 ] = \"VB\" }\n\t\t\t\t\t\t\t\tif ( tags[ j ].indexOf( \"DT\" ) > -1 ) { tags[ j ] = \"DT\" }\n\t\t\t\t\t\t\t\tif ( tags[ j ].indexOf( \"JJ\" ) > -1 ) { tags[ j ] = \"JJ\" }\n\t\t\t\t\t\t\t\tif ( tags[ j ].indexOf( \"NNP\" ) > -1 ) { tags[ j ] = \"NNP\" }\n\t\t\t\t\t\t\t\tif ( tags[ j ].indexOf( \"PRP\" ) > -1 ) { tags[ j ] = \"NNP\" }\n\t\t\t\t\t\t\t\tif ( tags[ j ].indexOf( \"VB\" ) > -1 ) { tags[ j ] = \"VB\" }\n\t\t\t\t\t\t\t\tif ( tags[ j ].indexOf( \"RB\" ) > -1 ) { tags[ j ] = \"RB\" }\n\t\t\t\t\t\t\t\tlet lexiconBigram = tags[ j ] + \"_\" + after[ 0 ];\n\t\t\t\t\t\t\t\ttagProbability = tagProbability / ( Math.pow( 3, j + 1 ) )\n\t\t\t\t\t\t\t\tlet probability = bigramProbabilities.bigramProbabilities[ lexiconBigram ] * tagProbability,\n\t\t\t\t\t\t\t\t\tbigram = [];\n\t\t\t\t\t\t\t\tbigram.push( \"XX\", tags[ j ], after[ 0 ] ); // \"XX\" Signifying the ambiguous adjective position\n\t\t\t\t\t\t\t\tbigramObj = new prototype.bigramObject( bigram, probability );\n\t\t\t\t\t\t\t\tbigrams.push( bigramObj );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tambiguous = new prototype.potentialAdjective( `flare.unsure.${inputArray[i-1]}`, tags, bigrams, position, frequency );\n\t\t\t\t\t\t\tambiguousAdjective.push( ambiguous );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else { // if JJ is the only tag\n\t\t\t\t\tcertain = new prototype.trueAdjective( `flare.sure.${inputArray[i-1]}`, tags, position, frequency );\n\t\t\t\t\tcertainAdjective.push( certain );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tdistinguishCertainAdjective( ambiguousAdjective, certainAdjective );\n}", "title": "" }, { "docid": "95832ec69d07c225be6e2184e57094d6", "score": "0.5540105", "text": "getSentencesFromDocument(string) {\n if (string === undefined || string === \"\") { return; }\n\n string = string.replace(/:|,|\\(|\\)|\\s-|-\\s/g, \"\");\n\n // split string into array on sentence ending punctuation, (! . ; ?)\n let sentenceArray = string.split(/!\\s*|;\\s*|\\?\\s*|\\.\\s*/g);\n if (sentenceArray[sentenceArray.length - 1].length === 0) {\n sentenceArray.pop();\n };\n\n return sentenceArray;\n }", "title": "" }, { "docid": "3d98a8e37b8bae31d57d506473365832", "score": "0.55371445", "text": "function findAndReplaceTerms(i){\n term = sndictionary[i][\"term\"]\n definition = sndictionary[i][\"definition\"]\n findAndReplace(\n \"\\\\b\\(\" + term + \"[s]{0,1}\\)\\\\b\",\n '<span style=\"border-bottom: 1px dotted #ba0000;\" title=\"' + definition + '\">$1</span>'\n );\n console.log(\"replacing\" + i)\n}", "title": "" }, { "docid": "15b38286c9cdfea9293d8e13a00f7140", "score": "0.5532252", "text": "function translate(sentence) {\n // split sentence on spaces into new array\n // create helper function to change word into pig latin\n // call helper function on each element in new string array\n // join and return split array\n var sentArr = sentence.split(' ');\n var pigArr = sentArr.map(pigWord);\n return pigArr.join(' ')\n}", "title": "" }, { "docid": "dea31dc1deefb6f4f768d74e841518d7", "score": "0.55309", "text": "function splitWords(sentence) {\n var wordArray = sentence.split(' ');\n $('.container').empty();\n for (var i=0; i < wordArray.length;i++) {\n var textToAppend = '';\n // handles existing commas differently slightly\n if (wordArray[i].charAt(wordArray[i].length-1) == ',' ) {\n\n textToAppend = wordArray[i].substring(0, wordArray[i].length - 1) + \"<span class='space comma'>, </span>\";\n }\n else {\n textToAppend = wordArray[i];\n if (i != wordArray.length - 1)\n textToAppend = textToAppend + \"<span class='space'> </span>\"\n }\n $('.container').append(textToAppend);\n \n }\n}", "title": "" }, { "docid": "86ae8a9c14aa1a31bb92077a3acb0025", "score": "0.55286574", "text": "function removeBlacklistWords(tagged) {\n for(let i = 0; i < tagged.length; i++) {\n let sentence = tagged[i];\n for(let j = 0; j < sentence.length; j++) {\n if(isOnBlacklist(sentence[j][0])) {\n sentence.splice(j,1);\n j--;\n }\n }\n tagged[i] = sentence;\n }\n return tagged;\n}", "title": "" }, { "docid": "dab0730f0c945f5970c5ef6e76191c4e", "score": "0.5512875", "text": "addTagSynonyms(){\n\n\t\t\n\t\tconst tags = this.getTags();\n\t\tconst hasSynonymTag = ending => {\n\t\t\t\n\t\t\tfor( let tag of tags ){\n\t\t\t\t\n\t\t\t\tif( tag.startsWith('pl_') && tag.endsWith('_'+ending) )\n\t\t\t\t\treturn true;\n\n\t\t\t}\n\n\t\t};\n\t\tlet synonyms = [\n\t\t\t'penis',\n\t\t\t'breasts'\n\t\t];\n\t\tfor( let synonym of synonyms ){\n\n\t\t\tif( hasSynonymTag(synonym) ){\n\n\t\t\t\tconst tn = 'pl_'+synonym;\n\t\t\t\tif( !this.tags.includes(tn) )\n\t\t\t\t\tthis.tags.push(tn);\n\n\t\t\t}\n\t\t}\n\n\t}", "title": "" }, { "docid": "8939042c11c804fb7227ded095822060", "score": "0.55101544", "text": "function numberOfSentences(story){\n let number = 0;\n storyWords.forEach(word =>{\n if (word.includes('.') || word.includes('!')){number +=1; }\n })\n console.log(`Sentence Count: ${number}`);\n}", "title": "" }, { "docid": "c32550ad32df583762b8bde78e119277", "score": "0.5508707", "text": "function toPigLatinSentence(sentence) {\n\t\n\t//Declare an new variable called sentenceArray.\n\t\n\t//Use .split() to transfrom sentence string into and array of words and assign it to sentenceArray\n\t\n\t//Declare an new variable called newArray.\n\t\n\t//Create a for loop that loops over each item in the sentenceArray\n\tfor(i=0; i>sentenceArray.length; i=i+1){\n\t\t\n\t}\n\t\t//For each word call pigLatinizeWord and push it into you new array\n\t\n\t//Join the array back into a string and return the result.\n\n}", "title": "" }, { "docid": "0c8ecfdb245b73212b6a8b1dc79377ac", "score": "0.5505537", "text": "function findProperNoun(sentence) {\n var result = [];\n for (chunk in nlp.chunks(sentence)) {\n if (chunk.type == ['NP']) {\n for (w in chunk.words) {\n if (w.type == 'NNP') {\n return w;\n }\n }\n }\n result.push(w);\n return result;\n }\n}", "title": "" }, { "docid": "93e00cf2a62474c6054548310a08d99f", "score": "0.54833907", "text": "function styleFirstWord() {\r\n if(!document.getElementsByTagName || !document.getElementsByTagName('body') ||\r\n !document.createElement || \r\n !document.getElementsByTagName('body')[0].childNodes) {\r\n styleFirstWord2(); //for IE4\r\n return;\r\n }\r\n var el,pel,str,str2,idx,j,k,m,r=/^\\s+$/;\r\n var paras = document.getElementsByTagName(tagname);\r\n for(var i=0;i<paras.length;i++) {\r\n if(!paras[i].hasChildNodes()) continue;\r\n if(firstWordClassName != '')\r\n if(paras[i].className.indexOf(firstWordClassName) == -1) continue;\r\n if(paras[i].normalize) paras[i].normalize();\r\n pel = paras[i].childNodes[0];\r\n j=0;\r\n m=(pel.nodeType != 3)?1:(pel.nodeValue.match(r)?1:0);\r\n while(m) {\r\n if(!pel.hasChildNodes()) {\r\n if(pel.nextSibling) pel = pel.nextSibling;\r\n } else if(pel.nodeType == 1) {\r\n pel = pel.childNodes[0];\r\n }\r\n j++;\r\n m=(pel.nodeType!=3)?1:(pel.nodeValue===null)?1:pel.nodeValue.match(r)?1:0;\r\n m=(j<16)?m:0;\r\n }\r\n str = pel.data;\r\n if(!str.length) continue;\r\n k=0;\r\n while(str.charAt(k).match(/\\s/)) { k++; }\r\n idx = str.replace(/^\\s+/,'').indexOf(' ');\r\n if(idx==-1) idx=0;\r\n if(idx > 0) {\r\n idx+=k;\r\n pel.data = str.substring(idx,str.length);\r\n str = str.substring(0,idx);\r\n } else {\r\n pel.data = '';\r\n }\r\n el = document.createElement('span');\r\n pel.parentNode.insertBefore(el,pel);\r\n el.className=classname;\r\n str2 = document.createTextNode(str);\r\n el.appendChild(str2);\r\n if(pel.data == '') pel.parentNode.removeChild(pel);\r\n }\r\n}", "title": "" }, { "docid": "5eb0b0a13ce2c6ca84464f89fde7308d", "score": "0.5472928", "text": "function findVerb(sentence) {\n var result = [];\n for (chunk in nlp.chunks(sentence)) {\n if (chunk.type == ['VP']) {\n for (w in chunk.words) {\n if (w.type == 'VB') {\n return w;\n }\n }\n }\n result.push(w);\n return result;\n }\n}", "title": "" }, { "docid": "c05143d47eff79dd27b51f83c6853907", "score": "0.5470503", "text": "function arrange_word_step()\n {\n let found = false;\n let segment;\n for(let i = 0; i < segmented_sentence.length; i++)\n {\n segment = segmented_sentence[i];\n let first_word = new RegExp(`^${segment}`);\n if(sentence_copy.match(first_word))\n {\n arranged_sentence.push(segment);\n\n sentence_copy = sentence_copy.replace(first_word, \"\");\n \n segmented_sentence.splice(i, 1);\n \n found = true;\n break;\n } \n }\n\n // if(!found)\n // {\n // console.log(sentence_copy);\n // console.log(\"===\")\n // }\n \n }", "title": "" }, { "docid": "a05bb85ad27eb78c3db774c39d1bac15", "score": "0.5457834", "text": "function styleFirstWord2() {\r\n if(!document.getElementsByTagName||!document.body||!document.body.innerHTML)\r\n return;\r\n var str,str2='',str3,idx,idx2,idx3,k=0;\r\n var paras = document.getElementsByTagName(tagname);\r\n for(var i=0;i<paras.length;i++) {\r\n if(firstWordClassName != '')\r\n if(paras[i].className.indexOf(firstWordClassName) == -1) continue;\r\n str2 = '';\r\n k=0;\r\n str = paras[i].innerHTML;\r\n idx = str.indexOf(' ');\r\n idx2 = str.indexOf('<');\r\n while(idx>idx2) {\r\n idx3 = str.indexOf('>');\r\n if(idx3>idx2 && idx3>idx) {\r\n str2 += str.substring(0,idx3+1);\r\n str = str.substring(idx3+1,str.length);\r\n idx = str.indexOf(' ');\r\n idx2 = str.indexOf('<');\r\n } else { break; }\r\n }\r\n while(str.charAt(k).match(/\\s/)) { k++; }\r\n idx = k+str.replace(/^\\s+/,'').indexOf(' ');\r\n if(idx<1) idx=str.length;\r\n str3='<span class=\"'+classname+'\">'+str.substring(k,idx)+'<\\/span>';\r\n paras[i].innerHTML = str2+str3+str.substring(idx,str.length);\r\n }\r\n}", "title": "" }, { "docid": "216e93e9855f4ff58905f61ad205f0a0", "score": "0.54503024", "text": "function germanWords(input) {\n\tinput = input.replace(/\\bbis\\b/gi, \"-\");\n\tinput = input.replace(/(\\bund\\b|\\b\\&\\b|\\s?\\/)/gi, \",\");\n\tinput = input.replace(/\\bgeschlossen\\b|ruhetag/gi, \"#;\");\n\treturn input.replace(/\\btäglich\\b/gi, \"Mo-Su\");\n}", "title": "" }, { "docid": "84cd493385bad5a83ceb463854a4d86b", "score": "0.5448963", "text": "function originalSentence(words, string) {\n // Your code here\n}", "title": "" }, { "docid": "087449b6ee78b01ef2bf6775be55689a", "score": "0.5438788", "text": "function createSentence(string) {\n //splits by word\n wordsInString = string.split(\" \").length\n //creates array of individual chars\n sentenceArray = string.split('')\n for (var i = 0; i < sentenceArray.length; i++) {\n var newChar = document.createElement(\"span\")\n newChar.textContent = sentenceArray[i]\n typingString.append(newChar)\n }\n}", "title": "" }, { "docid": "b5daa14db2e07807878d3d41f738a672", "score": "0.542197", "text": "function pigIt(str){\n return str.split(' ').map(word => { if (word !== '!' && word !== '?' && word !== '.') { return word.slice(1) + word.slice(0,1) + 'ay'; } return word;}).join(' ');\n }", "title": "" }, { "docid": "77ef554587610465bcf2ecd7ee8bb802", "score": "0.54166365", "text": "function addExcitement (theWordArray, punctuation) {\n let fnSentence=\"\";\n\n // loop through theWordArray\n for (let i=0; i<theWordArray.length; i++) {\n let frSentence=(theWordArray[i]);\n let n=(i/3);\n \n // add 1 to the index (which begins at 0) and divid by 3. If the remainder (%) = 0 and index is not the first one (0)\n if ((i+1) % 3 == 0 && i>0) {\n\n // since this will occur only on 3rd words, loop through the multiples of 3 in the index to add that number of punctuations\n for (let j=0; j<n; j++) {\n\n // add the punctuation to the word\n frSentence += punctuation;\n } \n\n // add a space after the word\n frSentence += \" \";\n\n // otherwise just add a space after the word \n } else {\n frSentence += \" \";\n }\n \n // add the word including any added punctuation and space to the current sentence\n fnSentence += frSentence;\n\n // diplay the current sentance in the console\n console.log(fnSentence);\n }\n }", "title": "" }, { "docid": "6ee695efc5b9ae609a644c249fc7c557", "score": "0.54093176", "text": "function _splitHtmlWords(contents) {\n\t\tvar words = [];\n\t\tvar splitContent;\n\t\tfor (var c=0; c<contents.length; c++) {\n\t\t\tif (contents[c].nodeType == 3) {\n\t\t\t\tsplitContent = _splitWords(contents[c].textContent || contents[c].toString());\n\t\t\t} else {\n\t\t\t\tvar tag = $(contents[c]).clone();\n\t\t\t\tsplitContent = _splitHtmlWords(tag.contents());\n\t\t\t\tfor (var t=0; t<splitContent.length; t++) {\n\t\t\t\t\ttag.empty();\n\t\t\t\t\tsplitContent[t] = tag.html(splitContent[t]).wrap('<p></p>').parent().html();\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (var w=0; w<splitContent.length; w++) {\n\t\t\t\twords.push(splitContent[w]);\n\t\t\t}\n\t\t}\n\t\treturn words;\n\t}", "title": "" }, { "docid": "6e657806f38bdd186a8569254c03c0c8", "score": "0.53914195", "text": "function wordAnalysis()\n{\n // store array of tokenized words from passage\n tokenizedText = RiTa.tokenize(RiTa.stripPunctuation(textToAnalyze));\n\n // console.log(tokenizedText[2]);\n\n // get parts of speech for each word\n arrPOS = RiTa.getPosTags(tokenizedText);\n arrPOSSimple = RiTa.getPosTags(tokenizedText, true);\n\n // console.log(arrPOS[2]);\n // console.log(arrPOSSimple[2]);\n\n // double check if dictPOS is initialized\n if (dictPOS === null)\n dictPOS = {};\n\n if (dictPOSSimple === null)\n dictPOSSimple = {};\n\n for(var i = 0; i < arrPOS.length; i++)\n {\n var wordPOS = arrPOS[i];\n var wordPOSSimple = arrPOSSimple[i];\n\n // console.log(wordPOS + \" : \" + dictPOS[wordPOS]);\n // store into dictionaries\n if(dictPOS[wordPOS] === undefined)\n {\n dictPOS[wordPOS] = 1;\n keysTotal.push(wordPOS);\n }\n else\n {\n dictPOS[wordPOS]++;\n }\n\n if(!dictPOSSimple[wordPOSSimple])\n {\n dictPOSSimple[wordPOSSimple] = 1;\n keysSimple.push(wordPOSSimple);\n }\n else\n {\n dictPOSSimple[wordPOSSimple]++;\n }\n\n // console.log(\"num keys: \" + keysTotal.length);\n \n }\n\n for(var j = 0; j < keysTotal.length; j++)\n {\n // console.log(keysTotal[j] + \" \" + dictPOS[keysTotal[j]]);\n arrPOSCount[j] = dictPOS[keysTotal[j]];\n }\n\n for (var k = 0; k < keysSimple.length; k++)\n {\n arrPOSCountSimple[k] = dictPOSSimple[keysSimple[k]];\n }\n\n}", "title": "" }, { "docid": "163c60b9cf26550a1bcf3354c20800cb", "score": "0.5368992", "text": "function constructSentence(words) {\n return toSentenceCase(lodash.compact(words).join(' ')).replace(/ , /g, ', ') + '.'\n}", "title": "" }, { "docid": "09404a4a1e8a56cd4bc4131e6b4cba1e", "score": "0.5357158", "text": "function pigIt(str){\n str = str.split(\" \");\n str.forEach((word, index) => {\n if (word === \".\" || word === \",\" || word === \"!\" || word === \"?\") {\n return;\n }\n str[index] = word.substring(1) + word.charAt(0) + \"ay\";\n });\n return str.join(' ');\n}", "title": "" }, { "docid": "07189621e8e5f42d8c53473b771cd73b", "score": "0.534754", "text": "function findWord(sentance, word) {\n var count = 0;\n sentance += ' ';\n var pom = '';\n for (var i = 0; i < sentance.length; i++) {\n if (sentance[i] !== ' ') {\n pom += sentance[i];\n } else {\n if (pom === word) {\n count++;\n } else {\n pom = '';\n }\n }\n }\n return count;\n}", "title": "" }, { "docid": "444699383bbddf28228ff71b0c22a296", "score": "0.53448033", "text": "function properSentences(outsideSentence){\n \n var startOfWord = 0\n var newSentence = \"\"\n var i = 0\n \n for (i=0; i < outsideSentence.length; i++){\n \n if (outsideSentence[i-2] === \".\" || i == 0){\n \t\n newSentence = newSentence + outsideSentence[i].toUpperCase() \n }\n \n else{\n \t\n \tnewSentence = newSentence + outsideSentence[i] \n } \n }\n \n console.log(newSentence)\n return newSentence \n}", "title": "" }, { "docid": "180e50c6bbf2016e02552eb1dc922295", "score": "0.53401905", "text": "function pigLatinify(sentence) {\n const words = sentence.split(' ');\n const translateWord = (word) => {\n const vowels = 'aeiou'.split('');\n if (vowels.indexOf(word[0]) != -1) {\n return `${word}ay`;\n } else {\n let phonemeEnd = 0;\n while(!(vowels.indexOf(word[phonemeEnd]) != -1)) {\n phonemeEnd += 1;\n }\n\n if (word[phonemeEnd - 1] === 'q') phonemeEnd += 1;\n return `${word.slice(phonemeEnd)}${word.slice(0, phonemeEnd)}ay`;\n }\n };\n\n return words.map( word => translateWord(word) ).join(' ');\n}", "title": "" }, { "docid": "88af36a259cc9b3f45599e2247860b6e", "score": "0.5320738", "text": "arrayStrToTags(str){\n\t\tvar listArray = str.split(\", \");\n\t\tvar listTags = [];\n\n\t\tfor (var k = 0; k < listArray.length; k++) {\n\t\t\tvar punctuation;\n\n\t\t\tif (k !== listArray.length - 1) { \n\t\t\t\tpunctuation = <Punct id={ \"punct_\" + k } punct=\", \" />;\n\t\t\t}\n\t\t\telse { \n\t\t\t\tpunctuation = <Punct id={ \"punct_\" + k } punct=\".\"/>;\n\t\t\t}\n\n\t\t\tvar html = \t<Link \tlKey={ k } wordClicked={ listArray[k] } punct={ punctuation }\n\t\t\t\t\t\t\t\tonClick={ this.handleLinkClick } />;\n\n\t\t\tlistTags[k] = html;\n\t\t}\n\t\treturn listTags;\n\t}", "title": "" }, { "docid": "66f6a3e32eb738a27b8390f88dd1e506", "score": "0.53196836", "text": "function tokenize(sentence) { \r\n\tsentence = sentence.toLowerCase();\r\n\tsentence = sentence.replace(/[^a-z ]/g, \"\");\r\n\tsentence = sentence.replace(/\\s+/g,\" \").trim();\r\n\tvar word_arr = sentence.split(\" \");\r\n\t/*--------------don't remove stop words-------------*/\r\n\t//word_arr = remove_stopwords(word_arr);\r\n\tword_arr = stem_arr(word_arr);\r\n\treturn word_arr;\r\n}", "title": "" }, { "docid": "84101943b525151a62a44b7c9b6831f7", "score": "0.5316154", "text": "function makeTags(tags) {\n var output = \"\";\n var tag;\n if (!tags) return \"\";\n for (var index in tags) {\n tag = tags[index];\n output +=\n ' <span class=\"tag small bg_' +\n tag +\n '\">' +\n tag.replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\").toUpperCase() +\n \"</span>\";\n }\n return output;\n }", "title": "" }, { "docid": "6a64937fbf5ffbff33512bed0fc8cdae", "score": "0.52897716", "text": "function pos(sentence){\n\n let words = new postag.Lexer().lex(sentence);\n let taggedWords = new postag.Tagger().tag(words);\n let objects = [];\n let actions = [];\n let subjects = [];\n for (let i in taggedWords) {\n var taggedWord = taggedWords[i];\n var word = taggedWord[0];\n var tag = taggedWord[1];\n\n if(isActionPOS(tag))\n {\n actions.push(word)\n }\n if(isObjectPOS(tag))\n {\n objects.push(word)\n }\n if(isSubjectPOS(tag))\n {\n subjects.push(word)\n }\n }\n\n return {\n sentence: sentence,\n subject: subjects,\n object: objects,\n action: actions\n };\n}", "title": "" }, { "docid": "2a333428b5dc4826adf127974808dc9f", "score": "0.52754384", "text": "function show_num_words() {\n\n // YOUR CODE GOES HERE\n var pTag = document.getElementById('book_chapter').getElementsByTagName('p');\n var spanTag = document.getElementById('book_chapter').getElementsByTagName('span');\n var spanCounter = 0;\n\n for ( var paragraph of pTag) {\n if (spanTag[spanCounter].innerText.indexOf('words') > 0) {\n spanTag[spanCounter].innerHTML = '';\n spanCounter++;\n continue;\n }\n var counter = paragraph.innerText.split(\" \").length;\n spanTag[spanCounter].innerHTML = `<b>(${counter} words)</b>`;\n spanCounter++;\n }\n}", "title": "" }, { "docid": "ec1447e656b8e1fad95f36dffdb71d86", "score": "0.52742946", "text": "function whisper_words(words) {\n return words.map(function(ele){\n return ele.toLowerCase() + \"...\";\n });\n}", "title": "" }, { "docid": "f0b094b35a3dc6bf45f8789bdf4ee6af", "score": "0.5262791", "text": "function HTMLtagger() {\n\n\tthis.walk = function(node){\n\n\t\tlet child, next;\n\t\tlet tag = (node.tagName) ? node.tagName.toLowerCase() : \"\";\n\n\t\t/* Just going to leave this out for now. Copied from 'cloud-to-butt' extension source code.\n\t\tif (tag == 'input' || tag == 'textarea') {\n\t\t\treturn;\n\t\t}\n\t\tif (node.classList && node.classList.contains('ace_editor')) {\n\t\t\treturn;\n\t\t} \n\t\t*/\n\n\t\tswitch (node.nodeType) {\n\t\t\tcase 1:\n\t\t\tcase 9:\n\t\t\tcase 11:\n\t\t\t\tchild = node.firstChild;\n\t\t\t\twhile (child) \n\t\t\t\t{\n\t\t\t\t\tnext = child.nextSibling;\n\t\t\t\t\tthis.walk(child);\n\t\t\t\t\tchild = next;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tthis.wrapText(node);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tthis.wrapText = function(textNode){\n\t\t// Wrap word in span\n\t\t// Based on https://stackoverflow.com/questions/16662393/insert-html-into-text-node-with-javascript\n\t\ttarget = /quick/g;\n\t\t\n\t\t//translation = this.translate(target)\n\n\t\tinnerHTML = textNode.data.replace(target, `<span title=\"English\" class=\"chinglish\"></span>`)\n\t\t\n\t\tlet div = document.createElement('div');\n\t\ttextNode.parentNode.insertBefore(div, textNode);\n\n\t\tdiv.insertAdjacentHTML('afterend', innerHTML);\n\t\t\n\t\tdiv.remove();\n\t\ttextNode.remove();\n\t}\n\n\t/* One way to change the content is to replace() nodeValue. But replace() data allows the creation of span elements\n\t// I could use this approach + JS onmouseover script, but I think CSS is faster.\n\tthis.coverText = function(textNode) {\n\t\tlet content = textNode.nodeValue;\n\t\tcontent = content.replace(/\\bEnglish\\b/g, \"中文\");\n\t\ttextNode.nodeValue = content;\n\t}\n\t*/\n\n}", "title": "" }, { "docid": "200e696362bcd66f35e4b9e41b797a97", "score": "0.52612716", "text": "function countWords() {\n var str = (document.getElementById(\"texto-entrada\").innerHTML).toString().trim().replace(/ /g,\",\").toLowerCase().split(\",\");\n var words = [];\n for (const p of str) {\n findWords(p, words);\n };\n //Construyendo HTML\n var resultados = document.getElementById(\"resultados\");\n for (const i in words) {\n var p = document.createElement(\"p\");\n var strong = document.createElement(\"strong\");\n var span = document.createElement(\"span\");\n strong.appendChild(document.createTextNode(\"Palabra \"+words[i].word+\": \"));\n span.appendChild(document.createTextNode(words[i].quantity));\n p.appendChild(strong);\n p.appendChild(span);\n resultados.appendChild(p);\n };\n}", "title": "" }, { "docid": "518410d0f2fa3d5ca8957200aa5d2fa7", "score": "0.52528083", "text": "function rearangeSentence(str) {\r\n var arr = str.split(' ');\r\n var newArr = [];\r\n for(var i = 1; i <= arr.length; i++) {\r\n var ii = i.toString();\r\n for(var j = 0; j < arr.length; j++) {\r\n var a = arr[j].split('');\r\n if(a.includes(ii)) {\r\n newArr.push(arr[j]);\r\n }\r\n }\r\n }\r\n return newArr.join(' ');\r\n}", "title": "" }, { "docid": "7c0caff86f637b69cf3363b316c6487d", "score": "0.524562", "text": "constructor(text) {\n let words = text.split(/[ \\r\\n]+/);\n this.words = words.filter(c => c !== '');\n this.makeChains();\n this.sentenceStarters = words\n .map(function(word, i, arr) {\n if (i === 0 || (i > 0 && words[i - 1].endsWith('.'))) {\n return word + ' ' + arr[i + 1];\n }\n })\n .filter(word => word);\n }", "title": "" }, { "docid": "d54ae30965c8181d861986356a3c23ec", "score": "0.5243615", "text": "function highlightSentences(sentenceRefs) {\n for (ref of sentenceRefs) {\n $('#' + ref).addClass('highlight')\n }\n}", "title": "" }, { "docid": "7d55674f7165e4620875c8b4b379dc36", "score": "0.52431893", "text": "function createPhrases() {\n console.log('frase 1')\n console.log('frase 2')\n console.log('frase 3')\n}", "title": "" }, { "docid": "a1861683ebb4e59d35c6a2d71a8c7adc", "score": "0.5239337", "text": "function foldString(sentence) {\n return sentence.split(\" \").map(str => foldWord(str)).join(\" \")\n}", "title": "" }, { "docid": "bcf93dbab9b547a737b2c211b08d2437", "score": "0.5237784", "text": "function getSentence(callback) {\n let results = '';\n getFirstWord((word) => {\n results += word;\n getSecondWord((word) => {\n results += word;\n getThirdWord((word) => {\n results += word;\n callback(results);\n })\n })\n });\n}", "title": "" }, { "docid": "ab40ce3126b8a21072e7195d8fb74c6d", "score": "0.5237724", "text": "function randomizeSentences(paragraph){\n if(typeof paragraph != 'string') throw 'unexpected input data type';\n \n let arr = paragraph.match(/[^\\.!\\?]+[\\.!\\?]+/g);\n arr[arr.length - 1] += \" \";\n for(let i = arr.length - 1; i >= 0; i-- ){\n let j = Math.floor(Math.random() * (i));\n let temp = arr[i];\n arr[i] = arr[j];\n arr[j] = temp;\n }\n return arr.join('');\n}", "title": "" }, { "docid": "ab19a9f8a8f7c7db4d8d1c7ba837c01e", "score": "0.52311164", "text": "function extractTags (text) {\n\n\tvar keepSearching = true;\n var index = 0;\n var tags = []\n\n //Searching for peopleTags\n while (keepSearching) {\n if (text.indexOf('@', index) > -1) {\n var currentIndex = text.indexOf('@', index);\n var EndIndex = text.length;\n var indexOfWhitespace = text.indexOf(' ', currentIndex);\n if(indexOfWhitespace > -1) EndIndex = indexOfWhitespace;\n var tagText = text.slice(currentIndex + 1, EndIndex);\n tags.push({text: tagText, startIndex: currentIndex, endIndex: EndIndex, type: 'person'});\n index = EndIndex;\n }\n else {\n keepSearching = false;\n }\n }\n\n //Reinitializing search\n index = 0;\n keepSearching = true;\n\n //Searching for hashtags\n while (keepSearching) {\n if (text.indexOf('#', index) > -1) {\n var Index = text.indexOf('#', index);\n var NextWhiteSpace = text.indexOf(' ', Index);\n var endIndex = text.length;\n if (NextWhiteSpace > -1) endIndex = NextWhiteSpace;\n var tag = text.slice(Index + 1, endIndex);\n tags.push({text: tag, startIndex: Index, endIndex: endIndex, type: 'hashtag'});\n index = endIndex;\n }\n else {\n keepSearching = false;\n }\n }\n\n return tags;\n}", "title": "" }, { "docid": "58e8077f12a8661b7bbace73c0271690", "score": "0.52203155", "text": "function removeClausePhrases(tagged,textObject,top3words) {\n let importanceValues = textObject.importanceValues;\n let avg = textObject.importanceAvg;\n for(let i = 0; i < tagged.length; i++) {\n let sentence = tagged[i];\n let clause = false;\n let startIndex = -1, endIndex = -1;\n let sentenceClauses = [];\n for(let j = 0; j < sentence.length; j++) {\n let word = sentence[j][0].trim();\n let tag = sentence[j][1];\n if(tag === \"IN\" && !clause) {\n if(j-1 >= 0) {\n let prev = sentence[j-1];\n let prevTag = prev[1];\n if(prevTag === \"VBN\") continue;\n }\n startIndex = j;\n clause = true;\n } else if(clause && (tag === \"NN\" || tag === \"NNS\")) {\n if(j+1 < sentence.length) {\n let nextTag = sentence[j+1][1];\n if(nextTag === \"NN\" || nextTag === \"NNS\") { /* continue */ }\n else {\n endIndex = j;\n sentenceClauses.push([startIndex,endIndex]);\n clause = false;\n }\n } else {\n endIndex = j;\n sentenceClauses.push([startIndex,endIndex]);\n clause = false;\n }\n } else if(clause && (word === \",\" )) {\n endIndex = j-1;\n sentenceClauses.push([startIndex,endIndex]);\n clause = false;\n }\n }\n tagged[i] = removeSentenceClauses(sentence,sentenceClauses,importanceValues,avg,top3words);\n }\n return tagged;\n}", "title": "" }, { "docid": "28dc266d51fc0ed2463e3d7a8ffa0b98", "score": "0.52179307", "text": "function madlib(word1, word2, word3, word4) {\n sentence = 'I have a degree in '+word1+', but my real specialty is '+word2+' with some minor experience in '+word3+'. Do not even ask me to fix your '+word4+'.';\n return sentence;\n}", "title": "" }, { "docid": "4fe5bdab7754533a4ec124261d5eefaf", "score": "0.5215894", "text": "function remix(sentences, callback) {\n\n\tswitch (typeof(sentences)){\n\n\t\tcase \"string\":\n\t\t\tvar words = new pos.Lexer().lex(sentences)\n\t\t\tvar taggedWords = new pos.Tagger().tag(words)\n\t\t\tbucketplace(taggedWords)\n\t\t\t//first construct a verb phrase and a noun phrase\n\t\t\tvar nounPhrase = formNounPhrase()\n\t\t\tvar verbPhrase = formVerbPhrase()\n\t\t\tcallback(nounPhrase.capitalizeFirstLetter()+' '+verbPhrase)\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tvar sentence_string = \"\"\n\t\t\tfor (var i = 0, sentence; sentence=sentences[i]; i++)\n\t\t\t\tsentence_string+=sentence+' '\n\t\t\t\n\t\t\tvar words = new pos.Lexer().lex(sentence_string)\n\t\t\tvar taggedWords = new pos.Tagger().tag(words)\n\t\t\tbucketplace(taggedWords)\n\t\t\tvar nounPhrase = formNounPhrase()\n\t\t\tvar verbPhrase = formVerbPhrase()\n\t\t\tcallback(nounPhrase+' '+verbPhrase)\n\t\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "7652f9a5d364bcb3a4e4c21ba3d158cc", "score": "0.5210258", "text": "function removePastParticiples(tagged) {\n // thanks to list on all 4 pages of http://www.linguasorb.com/english/verbs/most-common-verbs/\n let pastParticiples = {rejected:\"rejected\",removed:\"removed\",had:\"had\",done:\"did\",said:\"said\",gone:\"go\",got:\"got\",gotten:\"got\",made:\"made\",known:\"knew\", thought:\"thought\",taken:\"took\",seen:\"saw\",come:\"came\",wanted:\"wanted\",used:\"used\",found:\"found\",given:\"gave\",told:\"told\", worked:\"worked\",called:\"called\",tried:\"tried\",asked:\"asked\",needed:\"needed\",felt:\"felt\",become:\"became\",left:\"left\",voted:\"voted\",managed:\"managed\",put:\"put\",meant:\"meant\",kept:\"kept\",let:\"let\",begun:\"began\",seemed:\"seemed\",helped:\"helped\",shown:\"showed\",heard:\"heard\",played:\"played\",run:\"ran\",moved:\"moved\",lived:\"lived\",believed:\"believed\",brought:\"brought\",happened:\"happened\",written:\"wrote\",sat:\"sat\",stood:\"stood\",lost:\"lost\",paid:\"paid\",met:\"met\",included:\"included\",continued:\"continued\",set:\"set\",learnt:\"learnt\",learned:\"learned\",changed:\"changed\",led:\"led\",understood:\"understood\",watched:\"watched\",followed:\"followed\",stopped:\"stopped\",created:\"created\",spoken:\"spoke\",read:\"read\",spent:\"spent\",grown:\"grew\",opened:\"opened\",walked:\"walked\",won:\"won\",taught:\"taught\",offered:\"offered\",remembered:\"remembered\",considered:\"considered\",appeared:\"appeared\",bought:\"bought\",served:\"served\",died:\"died\",sent:\"sent\",built:\"built\",stayed:\"stayed\",fallen:\"fell\",cut:\"cut\",reached:\"reached\",killed:\"killed\",raised:\"raised\",passed:\"passed\",sold:\"sold\",decided:\"decided\",returned:\"returned\",explained:\"explained\",hoped:\"hoped\",developed:\"developed\",carried:\"carried\",broken:\"broke\",received:\"received\",agreed:\"agreed\",supported:\"supported\",hit:\"hit\",produced:\"produced\",eaten:\"ate\",covered:\"covered\",caught:\"caught\",drawn:\"drew\",chosen:\"chose\"};\n for(let i = 0; i < tagged.length; i++) {\n let sentence = tagged[i];\n for(let j = 0; j < sentence.length; j++) {\n let word = sentence[j][0];\n if(word === \"have\" || word === \"has\" && (j + 1) < sentence.length) {\n // test if in past participle tense, eg \"have broken\"\n let nextWord = sentence[j+1][0];\n if(nextWord in pastParticiples) {\n sentence[j][0] = pastParticiples[nextWord];\n sentence.splice(j+1,1);\n }\n }\n }\n tagged[i] = sentence;\n }\n return tagged;\n}", "title": "" }, { "docid": "4fdd1533883eb533a03fb0dfc8ae317e", "score": "0.52021784", "text": "function addTokensToRelation(relation) {\n\tsend_new_relation({'relation': relation, 'domain': [words_pos[0], words[0]], 'range': [words_pos[1],words[1]]})\n\twords = [];\n\twords_pos = [];\n\tmark(words, $contentArea, \"\");\n\t\n}", "title": "" }, { "docid": "c4e3d102664799fe6ee55329e95e0ae1", "score": "0.52017516", "text": "function processSentence(nama, umur, alamat, hobi) {\n return `Nama saya ${nama}, umur saya ${umur} tahun, alamat saya di ${alamat}, dan saya punya hobby yaitu ${hobi}!`;\n}", "title": "" }, { "docid": "18e19be8eda86edec917580fe8cd145e", "score": "0.520146", "text": "function tagToHashtag(tag) {\n let words = tag.replace(/[-\\.]/, ' ').split(' ');\n return (\n words[0] +\n words\n .slice(1)\n .map((word) => word.charAt(0).toUpperCase() + word.substr(1))\n .join('')\n );\n}", "title": "" }, { "docid": "dee510a9be11ea30c91fb20158dcfb60", "score": "0.52002853", "text": "function markSentence(words){\n var finishedMatchers = [];\n var openMatchers = patterns.map(createMatcher);\n for (var i = 0; i < words.length; i++){\n var word = words[i];\n var remaining = openMatchers;\n openMatchers = [];\n for (var j = 0; j < remaining.length; j++){\n var matcher = remaining[j];\n var pile = openMatchers;\n if (shouldAccept(matcher, word)){\n matcher = pushWord(matcher, word);\n if (matcher.state === STATE_DONE){\n pile = finishedMatchers;\n }\n }\n pile.push(matcher);\n }\n if (openMatchers.length === 0) break; // all matchers finished successfully!\n }\n var matches = finishedMatchers.map(m => m.words);\n var matchedWords = matches.length > 0 ? randNth(matches) : [];\n for (i = 0; i < matchedWords.length; i++){\n matchedWords[i].marked = true;\n }\n return words;\n}", "title": "" }, { "docid": "f08b733db69be345f3c956eee2cf9735", "score": "0.5200148", "text": "function adjustGysSentences(guysSentences) {\n var adjustedSentences = [];\n for (i = 0; i < guysSentences.length; i++) {\n adjustedSentences[i] = [0, guysSentences[i]];\n for (j = 0; j < 10; j++) {\n if(guysSentences[i].indexOf('{' + j.toString() + '}') >= 0) {\n// console.log(j);\n adjustedSentences[i] = [j+1, guysSentences[i]]\n }\n }\n }\n return adjustedSentences;\n}", "title": "" }, { "docid": "a0b345ea74bf48a58f14479527a0acae", "score": "0.518868", "text": "function parseTags(text) {\n var inTag = false,\n afterOpenTag = false,\n afterClosingTag,\n inUpperCase = false,\n inLowerCase = false,\n inMixCase = false,\n i,\n len,\n trueOrFalse,\n result = '',\n activeUpperCase = 0,\n activeLowerCase = 0,\n activeMixedCase = 0,\n upperCount = 0,\n lowerCount = 0,\n mixedCount = 0;\n\n for (i = 0, len = text.length; i < len; i += 1) {\n if (text[i] === '<') {\n inTag = true;\n afterOpenTag = true;\n }\n\n if (inTag && afterOpenTag && text[i] === '/') {\n afterClosingTag = true;\n afterOpenTag = false;\n }\n\n if (inTag && afterOpenTag && text[i] === 'u') {\n inUpperCase = true;\n afterOpenTag = false;\n activeUpperCase += 1;\n upperCount += 1;\n if (inLowerCase) {\n activeLowerCase -= 1;\n }\n if (inMixCase) {\n activeMixedCase -= 1;\n }\n }\n\n if (inTag && afterOpenTag && text[i] === 'l') {\n inLowerCase = true;\n afterOpenTag = false;\n activeLowerCase += 1;\n lowerCount += 1;\n if (inUpperCase) {\n activeUpperCase -= 1;\n }\n if (inMixCase) {\n activeMixedCase -= 1;\n }\n }\n if (inTag && afterOpenTag && text[i] === 'm') {\n inMixCase = true;\n afterOpenTag = false;\n activeMixedCase += 1;\n mixedCount += 1;\n if (inUpperCase) {\n activeUpperCase -= 1;\n }\n if (inLowerCase) {\n activeLowerCase -= 1;\n }\n }\n\n if (inTag && afterClosingTag && text[i] === 'u') {\n afterClosingTag = false;\n activeUpperCase -= 1;\n upperCount -= 1;\n if (!upperCount) {\n inUpperCase = false;\n }\n if (inLowerCase) {\n activeLowerCase += 1;\n }\n if (inMixCase) {\n activeMixedCase += 1;\n }\n }\n if (inTag && afterClosingTag && text[i] === 'l') {\n afterClosingTag = false;\n activeLowerCase -= 1;\n lowerCount -= 1;\n if (!lowerCount) {\n inLowerCase = false;\n }\n if (inUpperCase) {\n activeUpperCase += 1;\n }\n if (inMixCase) {\n activeMixedCase += 1;\n }\n }\n if (inTag && afterClosingTag && text[i] === 'm') {\n afterClosingTag = false;\n console.log('-m' + inMixCase);\n activeMixedCase -= 1;\n mixedCount -= 1;\n console.log('-active - m ' + activeMixedCase);\n if (!mixedCount) {\n inMixCase = false;\n console.log('- m' + inMixCase)\n }\n if (inUpperCase) {\n activeUpperCase += 1;\n }\n if (inLowerCase) {\n activeLowerCase += 1;\n }\n }\n\n if (!inTag && inUpperCase && (activeUpperCase > activeLowerCase && activeUpperCase > activeMixedCase)) {\n result += text[i].toUpperCase();\n }\n if (!inTag && inLowerCase && (activeLowerCase > activeUpperCase && activeLowerCase > activeMixedCase)) {\n result += text[i].toLowerCase();\n }\n if (!inTag && inMixCase && (activeMixedCase > activeLowerCase && activeMixedCase > activeUpperCase)) {\n trueOrFalse = Math.round(Math.random());\n if (trueOrFalse) {\n result += text[i].toUpperCase();\n } else {\n result += text[i].toLowerCase();\n }\n }\n\n if (!inTag && !inLowerCase && !inUpperCase && !inMixCase) {\n result += text[i];\n }\n\n if (text[i] === '>') {\n inTag = false;\n }\n }\n return result;\n }", "title": "" }, { "docid": "14b66f3da955bf96a06aadfef5354f91", "score": "0.51852894", "text": "function piglatinize() {\n wordIn = document.getElementById(\"pigWordIn\").value;\n console.log(wordIn);\n plWord = document.getElementById(\"pigWordOut\");\n let words = wordIn.split(\" \"),\n newWords = [];\n\n for (var i = 0; i < words.length; i++) {\n newWords.push(this.translate(words[i]));\n }\n\n plWord.textContent = newWords.join(\" \");\n}", "title": "" }, { "docid": "d817f854df13cee902b3cbf3ab933e06", "score": "0.5185167", "text": "function getwordpairs(text) {\n return text.match(/[a-zA-Z1-9,;':]+ [a-zA-Z1-9,;':]+/g);\n}", "title": "" }, { "docid": "6d704aaccf51039d5015fe198bb56ab3", "score": "0.5182607", "text": "function leetSpeak (word) {\n var word = word.replace(/a/g, \"4\");\n var word = word.replace(/e/g, \"3\");\n return word\n}", "title": "" }, { "docid": "b78636ecd3ff30122dff9acd718e6cf9", "score": "0.5173209", "text": "function firstSentence () {\n for (var i = 0; i < array1.length; i++) { //adds \"chirp\" to the empty array\n ray1.push(\"chirp\"); //for each element in the array1\n }\n sentence1 = ray1.join() + \".\"; //cnvrts ray1 to str, asgns it to sentence1, adds '.'\n sentence1 = sentence1.replace (/,/g, \" \"); //replaces commas with spaces\n}", "title": "" }, { "docid": "78b75d405d515dfa864c32cf87e6b2f7", "score": "0.5170815", "text": "function addSegment(word)\n {\n // make sure it REALLY is still in the sentence\n if(sentence_copy.includes(word))\n {\n segmented_sentence.push(word);\n // remove word from the sentence copy\n // so it won't confuse the algorithm\n sentence_copy = sentence_copy.replace(word, \"\");\n }\n \n }", "title": "" }, { "docid": "c3d2226718b5349ea84de6b1957c316f", "score": "0.5168939", "text": "function replaceNounPhrases(sentence, pronouns, dictionary) {\n const aux = [];\n const adj = [];\n const nouns = [];\n\n for (key in dictionary) {\n if (dictionary[key] === 'aux') aux.push(key);\n else if (dictionary[key] === 'adj') adj.push(key);\n else nouns.push(key);\n }\n\n const regex = new RegExp(`(?:${aux.join('|')}) (?:(?:${adj.join('|')}) )*(${nouns.join('|')})`, 'g');\n\n return sentence.replace(regex, () => pronouns.shift());\n}", "title": "" }, { "docid": "b87bc9af25c2ea126210d83506c7de81", "score": "0.5164247", "text": "function getWord()\n{\n var a = new Array('abate','aberrant','abscond','accolade','acerbic','acumen','adulation','adulterate','aesthetic','aggrandize','alacrity','alchemy','amalgamate','ameliorate','amenable','anachronism','anomaly','approbation','archaic','arduous','ascetic','assuage','astringent','audacious','austere','avarice','aver','axiom','bolster','bombast','bombastic','bucolic','burgeon','cacophony','canon','canonical','capricious','castigation','catalyst','caustic','censure','chary','chicanery','cogent','complaisance','connoisseur','contentious','contrite','convention','convoluted','credulous','culpable','cynicism','dearth','decorum','demur','derision','desiccate','diatribe','didactic','dilettante','disabuse','discordant','discretion','disinterested','disparage','disparate','dissemble','divulge','dogmatic','ebullience','eccentric','eclectic','effrontery','elegy','eloquent','emollient','empirical','endemic','enervate','enigmatic','ennui','ephemeral','equivocate','erudite','esoteric','eulogy','evanescent','exacerbate','exculpate','exigent','exonerate','extemporaneous','facetious','fallacy','fawn','fervent','filibuster','flout','fortuitous','fulminate','furtive','garrulous','germane','glib','grandiloquence','gregarious','hackneyed','halcyon','harangue','hedonism','hegemony','heretical','hubris','hyperbole','iconoclast','idolatrous','imminent','immutable','impassive','impecunious','imperturbable','impetuous','implacable','impunity','inchoate','incipient','indifferent','inert','infelicitous','ingenuous','inimical','innocuous','insipid','intractable','intransigent','intrepid','inured','inveigle','irascible','laconic','laud','loquacious','lucid','luminous','magnanimity','malevolent','malleable','martial','maverick','mendacity','mercurial','meticulous','misanthrope','mitigate','mollify','morose','mundane','nebulous','neologism','neophyte','noxious','obdurate','obfuscate','obsequious','obstinate','obtuse','obviate','occlude','odious','onerous','opaque','opprobrium','oscillation','ostentatious','paean','parody','pedagogy','pedantic','penurious','penury','perennial','perfidy','perfunctory','pernicious','perspicacious','peruse','pervade','pervasive','phlegmatic','pine','pious','pirate','pith','pithy','placate','platitude','plethora','plummet','polemical','pragmatic','prattle','precipitate','precursor','predilection','preen','prescience','presumptuous','prevaricate','pristine','probity','proclivity','prodigal','prodigious','profligate','profuse','proliferate','prolific','propensity','prosaic','pungent','putrefy','quaff','qualm','querulous','query','quiescence','quixotic','quotidian','rancorous','rarefy','recalcitrant','recant','recondite','redoubtable','refulgent','refute','relegate','renege','repudiate','rescind','reticent','reverent','rhetoric','salubrious','sanction','satire','sedulous','shard','solicitous','solvent','soporific','sordid','sparse','specious','spendthrift','sporadic','spurious','squalid','squander','static','stoic','stupefy','stymie','subpoena','subtle','succinct','superfluous','supplant','surfeit','synthesis','tacit','tenacity','terse','tirade','torpid','torque','tortuous','tout','transient','trenchant','truculent','ubiquitous','unfeigned','untenable','urbane','vacillate','variegated','veracity','vexation','vigilant','vilify','virulent','viscous','vituperate','volatile','voracious','waver','zealous');\n return a[parseInt(Math.random()* a.length)];\n}", "title": "" }, { "docid": "4f19a2c774a2d879f85686200f9d60c7", "score": "0.5160302", "text": "function compileSpeech (text) {\n return text.replace(\n /([\\s]*)\\(\\([\\s]*([a-zA-Z0-9_-]+):[\\s]*((.|[\\s])*?)([\\s]*)\\)\\)/g,\n '$1<line s=\"$2\">$3</line>$5'\n );\n }", "title": "" }, { "docid": "0f9dda3a808575de3858f25c67695497", "score": "0.51578987", "text": "function pigIt(str){\n return str\n .split(' ')\n .map(word =>\n word.match(/[a-zA-Z]/)\n ? (word.slice(1) + word[0] + 'ay')\n : word)\n .join(' ')\n}", "title": "" }, { "docid": "41d0d19704e9f9a98413fbf91db4a350", "score": "0.51554227", "text": "function animateWords($target, duration = 1.2, stagger = 0.01, reverse, masterStagger) {\n\n var masterTL = new TimelineMax();\n\n if ($target.length) {\n\n $target.each(function () {\n\n var\n tl = new TimelineMax(),\n $chars = $(this).find('.split-chars__char');\n\n if (reverse) {\n $chars = $chars.get().reverse();\n }\n\n if (!masterStagger) {\n masterStagger = '-=' + duration;\n }\n\n tl.staggerTo($chars, duration, {\n x: '0px',\n y: '0px',\n autoAlpha: 1,\n ease: Power4.easeOut\n }, stagger);\n\n masterTL.add(tl, masterStagger);\n\n });\n\n };\n\n return masterTL;\n\n }", "title": "" }, { "docid": "7c070964a5f950324684ac63cf95ac06", "score": "0.5152382", "text": "function addTimeSettingsInterim(speechData) {\n\tlet wholeString = speechData.results[0].alternatives[0].transcript;\n\t// console.log(wholeString);\n\n\tlet nlpObject = nlp(wholeString).out('terms');\n\n\tlet words_without_time = [];\n\n\tfor (let i = 0; i < nlpObject.length; i++) {\n\t\t//data\n\t\tlet word = nlpObject[i].text;\n\t\tlet tags = [];\n\n\t\t//generate span\n\t\tlet newSpan = document.createElement('span');\n\t\tnewSpan.innerHTML = word;\n\n\t\t//push all tags\n\t\tfor (let j = 0; j < nlpObject[i].tags.length; j++) {\n\t\t\ttags.push(nlpObject[i].tags[j]);\n\t\t}\n\n\t\t//add all classes\n\t\tfor (let j = 0; j < nlpObject[i].tags.length; j++) {\n\t\t\tlet cleanClassName = tags[j];\n\t\t\t// console.log(tags);\n\t\t\tlet className = `nl-${cleanClassName}`;\n\t\t\tnewSpan.classList.add(className);\n\t\t}\n\n\t\twords_without_time.push(newSpan);\n\t}\n\n\tfinalWord = false;\n\tendButton.disabled = true;\n\n\treturn words_without_time;\n}", "title": "" }, { "docid": "8661ea2200124712d24c96987179bac8", "score": "0.51520693", "text": "function addKeywords(parts) {\n allKeywords.push(parts.filter(function(part) {\n return part.slice(0, wordLen) == word;\n }));\n }", "title": "" }, { "docid": "ceb9317961722979def043d8eacfc01b", "score": "0.51436996", "text": "function sentence(state, string) {\n var config = {\n quoteState: [],\n capitaliseWords: function(str) {\n var words = str.split(\" \");\n for (var i=0,ilen=words.length;i<ilen;i++) {\n var word = words[i];\n if (word) {\n if (config.isFirst) {\n words[i] = _capitalise(word);\n config.isFirst = false;\n } else {\n words[i] = word.toLowerCase();\n }\n }\n }\n return words.join(\" \");\n },\n skipWordsRex: null,\n tagState: [],\n afterPunct: null,\n isFirst: true\n };\n return _textcaseEngine(config, string);\n }", "title": "" }, { "docid": "89ec8383fdb6f500688f2b99897a800d", "score": "0.5137484", "text": "function splitSentences(string) {\n\n if (string.length < 120)\n return [string];\n\n var str = string;\n var l = 100;\n\n var strs = [];\n while (str.length > l) {\n var separator;\n separator = str.substring(0, l).lastIndexOf('.') > 50 ? '.' : null;\n if (separator == null)\n separator = str.substring(0, l).lastIndexOf(',') > 50 ? ',' : ' ';\n\n\n var pos = str.substring(0, l).lastIndexOf(separator);\n\n pos = pos <= 0 ? l : pos;\n strs.push(str.substring(0, pos + 1));\n var i = str.indexOf(separator, pos) + 1;\n if (i < pos || i > pos + l)\n i = pos;\n str = str.substring(i);\n }\n strs.push(str);\n return strs;\n }", "title": "" }, { "docid": "c8c9f11527393beb9d78b01cff7c7a29", "score": "0.51358956", "text": "function joinWords(words) {\n \n var newStr = words[0];\n for ( var i = 1; i < words.length; i++) {\n if (!RiTa.isPunctuation(words[i]))\n newStr += SP;\n newStr += words[i];\n }\n return newStr;\n }", "title": "" } ]
c54ff8842d2e19670fa01e190f4fab5e
! moment.js locale configuration
[ { "docid": "7c5177e0705779055bafe4d4424c3902", "score": "0.0", "text": "function t(e,t,n,r){var i={m:[\"eine Minute\",\"einer Minute\"],h:[\"eine Stunde\",\"einer Stunde\"],d:[\"ein Tag\",\"einem Tag\"],dd:[e+\" Tage\",e+\" Tagen\"],w:[\"eine Woche\",\"einer Woche\"],M:[\"ein Monat\",\"einem Monat\"],MM:[e+\" Monate\",e+\" Monaten\"],y:[\"ein Jahr\",\"einem Jahr\"],yy:[e+\" Jahre\",e+\" Jahren\"]};return t?i[n][0]:i[n][1]}", "title": "" } ]
[ { "docid": "10d1879eaeed63952d2503fd69f151f3", "score": "0.8290896", "text": "function g(e,t,r){return e+\" \"+function(e,t){return 2===t?function(e){var t={m:\"v\",b:\"v\",d:\"z\"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}(e):e}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[r],e)}//! moment.js locale configuration", "title": "" }, { "docid": "a2cd0265366d469e1711c1dc40af6a12", "score": "0.76958364", "text": "function wa(e,t,n){var a={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},r=\" \";return(e%100>=20||e>=100&&e%100===0)&&(r=\" de \"),e+r+a[n]}//! moment.js locale configuration", "title": "" }, { "docid": "5d687930143ad23adb51a5822eb657c1", "score": "0.76550126", "text": "function init() {\n if (navigator && navigator.language) {\n moment.locale(navigator.language);\n }\n else {\n moment.locale('es');\n }\n }", "title": "" }, { "docid": "5d67dc8bcb8045ac2d2a13c12bedd632", "score": "0.7647121", "text": "function localizeMoment(mom){mom._locale = localeData;}", "title": "" }, { "docid": "157f60aa42f6cc835675896915a22a65", "score": "0.7548552", "text": "function localizeMoment(mom) {\n\t\tif ('_locale' in mom) { // moment 2.8 and above\n\t\t\tmom._locale = localeData;\n\t\t}\n\t\telse { // pre-moment-2.8\n\t\t\tmom._lang = localeData;\n\t\t}\n\t}", "title": "" }, { "docid": "157f60aa42f6cc835675896915a22a65", "score": "0.7548552", "text": "function localizeMoment(mom) {\n\t\tif ('_locale' in mom) { // moment 2.8 and above\n\t\t\tmom._locale = localeData;\n\t\t}\n\t\telse { // pre-moment-2.8\n\t\t\tmom._lang = localeData;\n\t\t}\n\t}", "title": "" }, { "docid": "83aee654a8d97aa81bf251da5968faeb", "score": "0.7198865", "text": "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "title": "" }, { "docid": "83aee654a8d97aa81bf251da5968faeb", "score": "0.7198865", "text": "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "title": "" }, { "docid": "83aee654a8d97aa81bf251da5968faeb", "score": "0.7198865", "text": "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "title": "" }, { "docid": "b5ee0f1824afd8786d73e0ab9ee28fb2", "score": "0.7184371", "text": "function localizeMoment(mom) {\r\n\t\tmom._locale = localeData;\r\n\t}", "title": "" }, { "docid": "b0d4c1b699e678f87040e762f40a7ead", "score": "0.71706426", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "b0d4c1b699e678f87040e762f40a7ead", "score": "0.71706426", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "53b156f71f17bcf54c6a9177af5e1045", "score": "0.7162304", "text": "function doTheMagic () {\n moment.locale('pt-BR');\n setDisplay();\n}", "title": "" }, { "docid": "ffeac031b2f05305244a4c7894bb3dd0", "score": "0.71301115", "text": "get lang() {\n return moment.locale();\n }", "title": "" }, { "docid": "96429cc3f1ee77f92477a1c0f838fa77", "score": "0.6983072", "text": "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "ef65c75b88e6f3908a65e44dcb470148", "score": "0.68839717", "text": "function sd(a,b,c){var d={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},e=\" \";return(a%100>=20||a>=100&&a%100===0)&&(e=\" de \"),a+e+d[c];}//! moment.js locale configuration", "title": "" }, { "docid": "ad6199621e48dee2be6e8e4a57acdbfc", "score": "0.6879218", "text": "function init(){\n moment.locale(\"it\");\n printGraphic();\n}", "title": "" }, { "docid": "8636f8bcf2bb73c7efc7501fe0dcbec9", "score": "0.68569857", "text": "function relativeTimeWithPlural$4(number,withoutSuffix,key){return\"m\"===key?withoutSuffix?\"хвилина\":\"хвилину\":\"h\"===key?withoutSuffix?\"година\":\"годину\":number+\" \"+\n//! moment.js locale configuration\nfunction plural$6(word,num){var forms=word.split(\"_\");return num%10==1&&num%100!=11?forms[0]:num%10>=2&&num%10<=4&&(num%100<10||num%100>=20)?forms[1]:forms[2]}({ss:withoutSuffix?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:withoutSuffix?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:withoutSuffix?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[key],+number)}", "title": "" }, { "docid": "d67a3b8503ec4102a172573ded84b961", "score": "0.67314214", "text": "defaultLocale() {\n return 'en';\n }", "title": "" }, { "docid": "2c83a51fb5077040656e855f9655f4e9", "score": "0.669054", "text": "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\n\tglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "461e6e675fb29fbbf2166539c9213026", "score": "0.66148484", "text": "formatMoment() {\n let lang = window.sessionStorage.getItem('language')\n let moment = require('moment'); /// para capturar o momento\n moment().format();\n moment.locale(lang);\n\n return moment().format('DD/MMMM/YYYY - HH:mm:ss')\n }", "title": "" }, { "docid": "d252e19be518329d10c10006b572f344", "score": "0.655731", "text": "function setLocaleDateTime () {\n\t var days = [\n\t $.localise.tr(\"Sunday\"),\n\t $.localise.tr(\"Monday\"),\n\t $.localise.tr(\"Tuesday\"),\n\t $.localise.tr(\"Wednesday\"),\n\t $.localise.tr(\"Thursday\"),\n\t $.localise.tr(\"Friday\"),\n\t $.localise.tr(\"Saturday\")\n\t ],\n\t months = [\n\t $.localise.tr(\"January\"),\n\t $.localise.tr(\"February\"),\n\t $.localise.tr(\"March\"),\n\t $.localise.tr(\"April\"),\n\t $.localise.tr(\"May\"),\n\t $.localise.tr(\"June\"),\n\t $.localise.tr(\"July\"),\n\t $.localise.tr(\"August\"),\n\t $.localise.tr(\"September\"),\n\t $.localise.tr(\"October\"),\n\t $.localise.tr(\"November\"),\n\t $.localise.tr(\"December\")\n\t ],\n\t days_abbrev = [\n\t $.localise.tr(\"Sun\"),\n\t $.localise.tr(\"Mon\"),\n\t $.localise.tr(\"Tue\"),\n\t $.localise.tr(\"Wed\"),\n\t $.localise.tr(\"Thu\"),\n\t $.localise.tr(\"Fri\"),\n\t $.localise.tr(\"Sat\")\n\t ],\n\t months_abbrev = [\n\t $.localise.tr(\"Jan\"),\n\t $.localise.tr(\"Feb\"),\n\t $.localise.tr(\"Mar\"),\n\t $.localise.tr(\"Apr\"),\n\t $.localise.tr(\"May\"),\n\t $.localise.tr(\"Jun\"),\n\t $.localise.tr(\"Jul\"),\n\t $.localise.tr(\"Aug\"),\n\t $.localise.tr(\"Sep\"),\n\t $.localise.tr(\"Oct\"),\n\t $.localise.tr(\"Nov\"),\n\t $.localise.tr(\"Dec\")\n\t ];\n\t wialon.util.DateTime.setLocale(days, months, days_abbrev, months_abbrev);\n\t}", "title": "" }, { "docid": "7021ea3c212c9bd2f74b6c37d94d6338", "score": "0.6470149", "text": "function getMomentLocale(key) {\n return {\n id: key,\n locale: {\n week: {\n // Angular monday = 0 whereas Moment monday = 1\n dow: ($locale.DATETIME_FORMATS.FIRSTDAYOFWEEK + 1) % 7,\n doy: defaultConfig.doys[key]\n }\n }\n };\n }", "title": "" }, { "docid": "6ead600a845fbd33f37f6d5efb69f1d5", "score": "0.63635415", "text": "function setLocaleLanguage(locale) {\n let fetch = false\n if(locale == 'en') {\n dateFormatter.locale = 'en'\n fetch = true\n }\n else dateFormatter.locale = 'ko-Kore_KR'\n\n localeJSON.year = !fetch ? 'yy년' : 'y,'\n localeJSON.day = !fetch ? 'EEEE' : 'E'\n localeJSON.realtime = !fetch ? '현재' : 'Real-time'\n localeJSON.country = !fetch ? '전국' : 'Korea'\n localeJSON.accumulate = !fetch ? '0시 기준' : 'Total'\n localeJSON.yesterday = !fetch ? '어제' : 'Last'\n localeJSON.count = !fetch ? ' 명' : ''\n localeJSON.calendar = !fetch ? '일정' : 'Calendar'\n localeJSON.reminder = !fetch ? '미리알림' : 'Reminder'\n\n localeJSON.sun = !fetch ? '일' : 'S'\n localeJSON.mon = !fetch ? '월' : 'M'\n localeJSON.tue = !fetch ? '화' : 'T'\n localeJSON.wen = !fetch ? '수' : 'W'\n localeJSON.thu = !fetch ? '목' : 'T'\n localeJSON.fri = !fetch ? '금' : 'F'\n localeJSON.sat = !fetch ? '토' : 'S'\n\n localeJSON.regions = ['Seoul', 'Busan', 'Incheon', 'Daegu',\n 'Gwangju', 'Daejeon', 'Ulsan', 'Sejong',\n 'Gyeonggi', 'Gangwon', 'ChungBuk',\n 'ChungNam', 'GyeongBuk', 'GyeongNam',\n 'JeonBuk', 'JeonNam', 'Jeju']\n}", "title": "" }, { "docid": "f9bdceec711408a9ac249b49874f3f6d", "score": "0.62350184", "text": "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key)\n } else {\n data = defineLocale(key, values)\n }\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data\n }\n }\n return globalLocale._abbr\n }", "title": "" }, { "docid": "cf395bb0083ba1ea07b9d05bf01925ac", "score": "0.618254", "text": "function ApexLocale() { }", "title": "" }, { "docid": "6e8eb0a6db712165ad6510dcb331f95c", "score": "0.61674327", "text": "beforeCreate(){\r\n if ( bbn.env && bbn.env.lang && (bbn.env.lang !== dayjs.locale()) ){\r\n dayjs.locale(bbn.env.lang);\r\n }\r\n }", "title": "" }, { "docid": "fcde36f904fbafdad011619f6d86d3ad", "score": "0.61562675", "text": "function overrideMonthNamesInCFPicker() {\n // short months for de locale have a dot at the end which makes java simpledateformat parser nuts\n if (confimoment.lang() == 'de') {\n confimoment.lang('de', {\n monthsShort: \"Jan_Feb_Mär_Apr_Mai_Jun_Jul_Aug_Sep_Okt_Nov_Dez\".split(\"_\")\n });\n }\n if (confimoment.lang() == 'es') {\n confimoment.lang('es', {\n monthsShort: function (a, b) {\n return \"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic\".split(\"_\")[a.month()];\n }\n });\n }\n if (confimoment.lang() == 'ja') {\n confimoment.lang('ja', {\n monthsShort: [\n \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\"\n ]\n });\n }\n}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60918134", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60918134", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60918134", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60918134", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60918134", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "52559860145ad28417b3ea5a7bcee95b", "score": "0.6085412", "text": "dateFormat(date) {\n return moment(date).locale('fr').format('Do MMMM YYYY')\n }", "title": "" }, { "docid": "e640ff1a70c59d2b6602b4c743d7ecf1", "score": "0.608126", "text": "function datetimeConfig(moment)\n {\n // Make sure moment is in english and the first day of week is a monday\n moment.lang('en', {\n // customizations.\n week: {\n dow: 1\n },\n calendar: {\n lastDay: '[Yesterday], dddd MMM D',\n sameDay : '[Today], dddd MMM D',\n nextDay : '[Tomorrow], dddd MMM D',\n lastWeek : 'dddd, MMM D',\n nextWeek : 'dddd, MMM D',\n sameElse : 'dddd, MMM D'\n }\n });\n\n // Add America/Detroit timezone, note that this is the same as Toronto\n moment.tz.add(\n [\n 'America/Detroit|EST EDT|50 40|01010101010101010101010|1BQT0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0',\n \"Etc/UTC|UTC|0|0|\"\n ]);\n }", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60771567", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60771567", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60771567", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60771567", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60771567", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60771567", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60771567", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60771567", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60771567", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60771567", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071916", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" } ]
c2b6225d133026e2d9fc2fb95240f402
Works like Element.prototype.closest, but uses a callback instead
[ { "docid": "b8e8682c5d220583eb67454e742fe008", "score": "0.8176868", "text": "function closestCallback(element, callback) {\n while (element) {\n if (callback(element)) {\n return element;\n }\n\n element = element.parentElement;\n }\n\n return null;\n}", "title": "" } ]
[ { "docid": "65518b12699d5fd64208d2d95cc3d7ac", "score": "0.7031596", "text": "function closestPolyfill(el, s) {\n var ElementProto = win.Element.prototype,\n elementMatches = ElementProto.matches ||\n ElementProto.msMatchesSelector ||\n ElementProto.webkitMatchesSelector,\n ret = null;\n if (ElementProto.closest) {\n ret = ElementProto.closest.call(el, s);\n }\n else {\n do {\n if (elementMatches.call(el, s)) {\n return el;\n }\n el = el.parentElement || el.parentNode;\n } while (el !== null && el.nodeType === 1);\n }\n return ret;\n }", "title": "" }, { "docid": "813f49358ef79d724efe1bb50b7aff6f", "score": "0.69324636", "text": "function closest(element, query) {\n\twhile (element !== document) {\n\t\tif (element.matches(query)) {\n\t\t\treturn element\n\t\t}\n\t\t// element operating on moves up DOM tree\n\t\telement = element.parentNode\n\t}\n\treturn null\n}", "title": "" }, { "docid": "ee27cca1e10ee0f27e3d3feae327e6ba", "score": "0.68799686", "text": "function closest(elem, className) {\n do {\n if ($(elem).hasClass(className)) {\n return elem;\n }\n elem = elem.parentElement;\n } while (elem);\n\n return null;\n }", "title": "" }, { "docid": "d364bc0f4432323da7c68c8076db3c62", "score": "0.6814328", "text": "function closestParentOrSelf( element, target ) {\n if ( element.nodeName.toLowerCase() === target.toLowerCase() )\n return element;\n\n element = element.parentElement;\n if ( element === undefined || !element )\n return null;\n\n if ( element.nodeName.toLowerCase() === target.toLowerCase() )\n return element;\n\n return closestParentOrSelf( element, target );\n }", "title": "" }, { "docid": "b2de287f261a99193f62cc3aaa15b04a", "score": "0.6796814", "text": "function closest(inputElement, nodeType) {\n\n\n\n var cur = inputElement;\n\n while(cur && cur.ownerDocument ) {\n\n if(jQuery(cur).is(nodeType))\n\n return cur;\n\n cur = cur.parentNode;\n\n }\n\n }", "title": "" }, { "docid": "379af028f468e98e6778239db4981211", "score": "0.67922777", "text": "function polyfillClosest(element, selector) {\n var curr = element;\n while (curr != null && !(curr instanceof Element && matches(curr, selector))) {\n curr = curr.parentNode;\n }\n return (curr || null);\n}", "title": "" }, { "docid": "d84b7d081fefdfcd671c7f0507ceb3db", "score": "0.674656", "text": "function polyfillClosest(element, selector) {\n var curr = element;\n\n while (curr != null && !(curr instanceof Element && matches(curr, selector))) {\n curr = curr.parentNode;\n }\n\n return curr || null;\n }", "title": "" }, { "docid": "ed8682581afd20627ebc1f3d0d165f67", "score": "0.66718173", "text": "function polyfillClosest(element, selector) {\n let curr = element;\n while (curr != null && !(curr instanceof Element && matches(curr, selector))) {\n curr = curr.parentNode;\n }\n return (curr || null);\n}", "title": "" }, { "docid": "ed8682581afd20627ebc1f3d0d165f67", "score": "0.66718173", "text": "function polyfillClosest(element, selector) {\n let curr = element;\n while (curr != null && !(curr instanceof Element && matches(curr, selector))) {\n curr = curr.parentNode;\n }\n return (curr || null);\n}", "title": "" }, { "docid": "d4c613dd88260b834c96b7b4e6a03543", "score": "0.6509572", "text": "function closest(el, selector) {\n\n if(el && el.nodeType === 1){\n\n if(matches(el, selector)){\n\n return el;\n\n }\n\n return closest(el.parentNode, selector);\n\n }\n\n return null;\n\n }", "title": "" }, { "docid": "2a04ad3f451c4c979a98821a116f28bc", "score": "0.6338779", "text": "function closest(el) {\n\t\tvar text = null;\n\t\tvar textLower = null;\n\t\tvar textUpper = null;\n\t\tvar UpperSiblings;\n\t\tvar LowerSiblings;\n\t\tvar countUpper = 0;\n\t\tvar countLower = 0;\n\t\tvar elSaved = el;\n\t\tupper:\n\t\t\tdo {\n\t\t\t\tcountUpper++;\n\t\t\t\tUpperSiblings = getAllSiblings(el);\n\n\t\t\t\tfor (var i = 0; i < UpperSiblings.length; i++) {\n\t\t\t\t\ttext = UpperSiblings[i].innerText; // || UpperSiblings;\n\t\t\t\t\tif (typeof text === \"string\" && text.length > 3) {\n\t\t\t\t\t\ttextUpper = text;\n\t\t\t\t\t\tbreak upper;\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t} while (el = el && el.parentNode);\n\n\t\tel = elSaved;\n\t\t// lower search\n\t\tlower:\n\t\t\tdo {\n\t\t\t\tcountLower++;\n\t\t\t\tLowerSiblings = getAllSiblings(el);\n\t\t\t\tfor (var i = 0; i < LowerSiblings.length; i++) {\n\t\t\t\t\ttext = LowerSiblings[i].innerText || LowerSiblings[i].textContent;\n\t\t\t\t\tif (typeof text === \"string\" && text.length > 3) {\n\t\t\t\t\t\ttextLower = text;\n\t\t\t\t\t\tbreak lower;\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t} while (el = el && el.childNode);\n\t\t// maybe if this is established switch order to search lower first since that has priority!\n\t\tif (textLower !== null && textUpper !== null) {\n\t\t\treturn textLower;\n\t\t} else if (textLower !== null) {\n\t\t\treturn textLower;\n\t\t} else if (textUpper !== null) {\n\t\t\treturn textUpper;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "title": "" }, { "docid": "6a8c2c7e89701f4ad3f782143660fbb2", "score": "0.6325216", "text": "function _parents(el, cb){\n const str = cb;\n typeof cb === 'string' && (cb = (el) => el.matches(str));\n\n if( cb(el) ) return el;\n\n // Traverse up the DOM\n while(el && el.parentNode !== document){\n el = el.parentNode;\n if( cb(el) ) return el;\n }\n return undefined;\n }", "title": "" }, { "docid": "ea38b409da7707854a67b8a6bf9e2f39", "score": "0.62657624", "text": "_getOuterElement(elem) {\n return elem.closest(SELECTOR_OUTER) || elem;\n }", "title": "" }, { "docid": "b7908bd3e2f755dd42342e0495c60583", "score": "0.623418", "text": "function findAncestor(node,callback){while(node){var result=callback(node);if(result===\"quit\"){return undefined;}else if(result){return node;}node=node.parent;}return undefined;}", "title": "" }, { "docid": "55611a03e5061c2070718f65f188fb45", "score": "0.6185551", "text": "function closest(target, query){\r\n target = getTarget(target);\r\n\r\n if(isList(target)){\r\n target = target[0];\r\n }\r\n\r\n while(\r\n target &&\r\n target.ownerDocument &&\r\n !is(target, query)\r\n ){\r\n target = target.parentNode;\r\n }\r\n\r\n return target === doc.document && target !== query ? null : target;\r\n}", "title": "" }, { "docid": "03e665fb441c04382b54887f17dd2eb1", "score": "0.59924614", "text": "function closestParent(child, className) {\n if (!child || child == document) {\n return null;\n }\n if (child.classList.contains(className)) {\n return child;\n }\n return closestParent(child.parentNode, className);\n }", "title": "" }, { "docid": "e4d15be7706ae230d9cb1137eee28040", "score": "0.5951634", "text": "function findParent(callback) {\n var path = this;\n while (path = path.parentPath) {\n if (callback(path)) return path;\n }\n return null;\n}", "title": "" }, { "docid": "acbf1c5bcb6a8ee1317ea7e2220f8597", "score": "0.5944806", "text": "function getNearestAncestorByClass(el, cls) {\n while ((el = el.parentElement) && !el.classList.contains(cls));\n if (el.classList.contains(cls)) return el;\n return null;\n}", "title": "" }, { "docid": "69e258188cf0eff4c84421503547f85a", "score": "0.5906639", "text": "closestCommonAncestor(vampire) {\n\n }", "title": "" }, { "docid": "71f4ec85e93e19fc4c5d18c504954fad", "score": "0.5895579", "text": "function closestParent(child, className) {\n if (!child || child == document) {\n return null;\n }\n if (child.classList.contains(className)) {\n return child;\n } else {\n return closestParent(child.parentNode, className);\n }\n}", "title": "" }, { "docid": "71f4ec85e93e19fc4c5d18c504954fad", "score": "0.5895579", "text": "function closestParent(child, className) {\n if (!child || child == document) {\n return null;\n }\n if (child.classList.contains(className)) {\n return child;\n } else {\n return closestParent(child.parentNode, className);\n }\n}", "title": "" }, { "docid": "de12de219d312bd7eb61d146ff9cde14", "score": "0.5870846", "text": "findClosestBlockly ($el) {\r\n // Return the clicked element if it's actually a draggable\r\n if ($el.classList.contains('blocklyDraggable')) {\r\n return $el\r\n }\r\n\r\n // Scan upwards for a draggable\r\n let parent = $el.parentNode\r\n let isBlockly = false\r\n while (parent.parentNode && !isBlockly) {\r\n if (parent.classList.contains('blocklyDraggable')) {\r\n isBlockly = true\r\n } else {\r\n parent = parent.parentNode\r\n }\r\n }\r\n\r\n // Return\r\n if (isBlockly) {\r\n return parent\r\n } else {\r\n return null\r\n }\r\n }", "title": "" }, { "docid": "a08b93f0e17e4d23e27ca9872fe3efce", "score": "0.5813973", "text": "function closestParent(child, className) {\n\t\tif (!child || child == document) {\n\t\t\treturn null;\n\t\t}\n\t\tif (child.classList.contains(className)) {\n\t\t\treturn child;\n\t\t} else {\n\t\t\treturn closestParent(child.parentNode, className);\n\t\t}\n\t}", "title": "" }, { "docid": "85eaa20cf9784926a7af312bbab2f702", "score": "0.5811159", "text": "function closestParent(child, className) {\n if (!child || child == document) {\n return null;\n }\n if (child.classList.contains(className)) {\n return child;\n } else {\n return closestParent(child.parentNode, className);\n }\n }", "title": "" }, { "docid": "0bcb969e1f9b7261f5e5c4af536bda6b", "score": "0.5797018", "text": "function closestParent(child, className) {\r\n if (!child || child == document) {\r\n return null;\r\n }\r\n if (child.classList.contains(className)) {\r\n return child;\r\n } else {\r\n return closestParent(child.parentNode, className);\r\n }\r\n }", "title": "" }, { "docid": "d3d86e21d832cdb1b6da11476d55b138", "score": "0.578582", "text": "function closestParent(child, className) {\n if (!child || child == document) {\n return null;\n }\n if (child.classList.contains(className)) {\n return child;\n } else {\n return closestParent(child.parentNode, className);\n }\n }", "title": "" }, { "docid": "fb310b7709a7157a134149e42dc198fa", "score": "0.5771963", "text": "closestRowToActiveElement() {\n const {\n activeElement\n } = document;\n\n if (!activeElement || !activeElement.closest || !this.ref.current) {\n return null;\n }\n\n return activeElement.closest('li');\n }", "title": "" }, { "docid": "f5b53d6a60761d36739be7f9b9f94ee8", "score": "0.57263285", "text": "function closestElement(selector, base) {\n if (base === void 0) {\n base = this;\n }\n\n function __closestFrom(el) {\n if (!el || el === getDocument() || el === getWindow()) return null;\n if (el.assignedSlot) el = el.assignedSlot;\n var found = el.closest(selector);\n return found || __closestFrom(el.getRootNode().host);\n }\n\n return __closestFrom(base);\n}", "title": "" }, { "docid": "5cbf85c714066cf82cc4adc12a604059", "score": "0.5677756", "text": "function closestElement(selector, base) {\n if (base === void 0) {\n base = this;\n }\n\n function __closestFrom(el) {\n if (!el || el === getDocument() || el === getWindow()) return null;\n if (el.assignedSlot) el = el.assignedSlot;\n const found = el.closest(selector);\n\n if (!found && !el.getRootNode) {\n return null;\n }\n\n return found || __closestFrom(el.getRootNode().host);\n }\n\n return __closestFrom(base);\n}", "title": "" }, { "docid": "0ad1476b42a587a01a4f2c452220777e", "score": "0.5669321", "text": "function findAncestor(el, className) {\n while ((el = el.parentNode) && !el.classList.contains(className));\n return el;\n}", "title": "" }, { "docid": "ce41133670c8335d3f0b9dbad81f5bd1", "score": "0.56655806", "text": "findPreviousSiblingOrAncestorMatchingSelector(target, selector) {\n // Target self\n let candidate = target;\n \n // Walk the DOM tree: preceding siblings and ancestors\n while (candidate) {\n if (candidate.matches(selector)) \n return candidate;\n candidate = candidate.previousElementSibling || candidate.parentElement;\n }\n\n // No match\n return null;\n }", "title": "" }, { "docid": "955ecab65768940c523f806f02d8233c", "score": "0.56488496", "text": "function findParents(el, cls) {\n while (el.parentNode) {\n el = el.parentNode;\n if (el.classList.contains(cls))\n return el;\n }\n return null;\n}", "title": "" }, { "docid": "46333a1c97cf11db701a5a22d8e6c584", "score": "0.5631168", "text": "function findFirstMatchingElement(parentEle, cb) {\n // do a depth-first search to recursively find the first element in the tree\n // that will return true when passed into the cb function\n if (cb(parentEle)) {\n return parentEle;\n }\n\n for (let i = 0; i < parentEle.children.length; i++) {\n const result = findFirstMatchingElement(parentEle.children[i], cb);\n if (result) return result;\n }\n\n return null;\n}", "title": "" }, { "docid": "7b4117621341e0c8b96ab1ce7f51d5b4", "score": "0.56237364", "text": "function getNearestElClass(element, className){\n\tif(element == document) return false;\n\tif(element.classList.contains(className)) return element;\n\treturn element.parentNode && getNearestElClass(element.parentNode, className);\n}", "title": "" }, { "docid": "d162c59582c6a634ebb11d1fbdec4fcc", "score": "0.56021804", "text": "find(callback) {\n return this.reduce((found, ele) => {\n // return !found && callback(ele) ? ele : found;\n if (!found && callback(ele)) {\n return ele;\n }\n else {\n return found;\n }\n });\n }", "title": "" }, { "docid": "49b44e3312a076f494f8e74a1b4881b0", "score": "0.55999345", "text": "function findRelated(e,value,name,relative)\n{\n\tname = name || \"tagName\";\n\trelative = relative || \"parentNode\";\n\tif(name == \"className\") {\n\t\twhile(e && !jQuery(e).hasClass(value)) {\n\t\t\te = e[relative];\n\t\t}\n\t} else {\n\t\twhile(e && e[name] != value) {\n\t\t\te = e[relative];\n\t\t}\n\t}\n\treturn e;\n}", "title": "" }, { "docid": "f16f10411104698108a8ecb95ef2f3e3", "score": "0.55891997", "text": "function qe(e,t){for(;e;){if(t(e))return e;e=e.parentElement}}", "title": "" }, { "docid": "3e83acd9fbff96e548579a5b9f42433d", "score": "0.5582636", "text": "function findParentElement(n) {\n if (n.nodeType == 1) {\n return n;\n } else {\n return findParentElement(n.parentNode);\n }\n}", "title": "" }, { "docid": "457040183e92a832277011aab9f5b51c", "score": "0.5581393", "text": "function findAncestorWithClass(el, className) {\n while((el = el.parentElement) && !el.classList.contains(className));\n return el;\n}", "title": "" }, { "docid": "7876f2259a5d46517776bd0f8703587b", "score": "0.5581157", "text": "function findMatchRecur(el){\n /* We're going to make the assumption that we're not binding\n * multiple event classes to the same element.\n * (next + previous = wait... err... what?)\n *\n * In the odd event we end up with an element with multiple\n * possible matches, the following priority order is applied:\n * hopscotch-cta, hopscotch-next, hopscotch-prev, hopscotch-close\n */\n if(el === evt.currentTarget){ return null; }\n if(utils.hasClass(el, 'hopscotch-cta')){ return 'cta'; }\n if(utils.hasClass(el, 'hopscotch-next')){ return 'next'; }\n if(utils.hasClass(el, 'hopscotch-prev')){ return 'prev'; }\n if(utils.hasClass(el, 'hopscotch-close')){ return 'close'; }\n /*else*/ return findMatchRecur(el.parentElement);\n }", "title": "" }, { "docid": "afe30bba33f18bf87bb7ffe2c64b4847", "score": "0.55580086", "text": "function findNearestInTree(start_element, selector) {\n // find nearest element with given selector\n // nearest = search in this order: (first found is returned)\n // - prefer previous siblings first\n // - search in the children\n // - search in the parents\n // repeat recusive\n\n // ******************************************\n // internal helper functions\n\n let attribute_name = 'findNearest';\n // let exclude_selector = ':not([' + attribute_name + '=visited])';\n let exclude_selector = ':not([' + attribute_name + '])';\n\n // function findNearestRecusive(element_list, selector) {\n function findNearestRecusive(target, element, selector) {\n let result = null;\n // let element = element_list[0];\n\n // console.log('element', element);\n // check siblings\n if (!result) {\n // console.log('checkSiblings');\n result = checkSiblings(target, element, selector);\n }\n\n // console.log('element', element);\n // check children\n if (!result) {\n // console.log('checkChildren');\n result = checkChildren(target, element, selector);\n }\n\n // console.log('element', element);\n // mark the current element as visited\n // element.setAttribute(attribute_name, 'visited');\n\n // console.log('element', element);\n // check parent\n if (!result) {\n // console.log('checkParent');\n result = checkParent(target, element, selector);\n }\n\n\n // if (element_list.length > 0) {\n // for (let element of element_list) {\n // // result.concat(findNearestRecusive(start_element, selector));\n //\n //\n // }\n // } else {\n // // nothing to do.\n // // we return an empty list.\n // }\n return result;\n }\n\n function checkSiblings(target, element, selector) {\n // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n // check siblings\n // first check if we have any siblings that are relevant\n let nearest_sibling = null;\n if (element) {\n let parentEl = element.parentElement;\n let parentPath = getSelectorFromRoot(parentEl);\n // console.log('parentPath', parentPath);\n let matching_siblings =\n parentEl.querySelectorAll(parentPath + ' > ' + selector);\n let nearest_sibling_distance = 999999;\n // let target_index = findNodeIndex(target);\n let target_index = findNodeIndex(element);\n if (matching_siblings.length > 0) {\n // (element.parentElement.childElementCount > 1)\n for (let child of matching_siblings) {\n let child_index = findNodeIndex(child);\n let child_distance = child_index - target_index;\n // 0 1 2 3 *4 5 6\n // 2 - 4 = -2\n // 5 - 4 = 1\n // 6 - 4 = 2\n if (\n (Math.abs(child_distance) < nearest_sibling_distance) ||\n (\n (\n Math.abs(child_distance) ===\n nearest_sibling_distance\n ) &&\n (child_distance < 0)\n )\n ) {\n nearest_sibling_distance = Math.abs(child_distance);\n nearest_sibling = child;\n }\n }\n\n }\n }\n return nearest_sibling;\n }\n\n function checkChildren(target, element, selector) {\n // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n // check children\n let nearest_child = null;\n if (element) {\n // we use a shortcut and hope that the first found is the nearest..\n nearest_child = element.querySelector(selector);\n\n // TODO\n // change this behavior:\n // check for the nearest element i\n let children = element.children;\n // console.log('children', children);\n // first check if we have any children that are relevant\n let matching_children = element.querySelectorAll(selector);\n // console.log('matching_children', matching_children);\n if (matching_children > 0 && children.length > 0) {\n // calculate distance to target_element\n // compare distances and use nearest.\n }\n\n }\n return nearest_child;\n }\n\n function checkParent(target, element, selector) {\n let result = null;\n if (element) {\n let parentEl = element.parentElement;\n // check if we have a valid parent\n // (if not we have reached the root of the tree)\n if (parentEl) {\n // console.group('ping: recusive');\n // console.log('new values: \\n',\n // ' target', target, '\\n',\n // ' new element', parentEl\n // // ' element', element, '\\n',\n // // ' parentEl', parentEl\n // );\n result = findNearestRecusive(target, parentEl, selector);\n // console.groupEnd();\n }\n }\n return result;\n }\n\n function cleanup() {\n let all_visited = document.querySelectorAll('[' + attribute_name + ']');\n for (let el of all_visited) {\n el.removeAttribute(attribute_name);\n }\n }\n\n\n\n // ******************************************\n // main function\n let result = null;\n if (start_element) {\n let element_list = document.querySelectorAll(selector);\n // console.log('element_list', element_list);\n if (element_list.length > 0) {\n if (element_list.length == 1) {\n // easy - there is only one match.\n // so we can use it directly..\n result = element_list[0];\n } else {\n // console.log('start_element', start_element);\n result = findNearestRecusive(\n start_element, start_element, selector);\n // cleanup();\n }\n } else {\n // nothing found.\n }\n } else {\n throw 'now start_element given';\n }\n return result;\n}", "title": "" }, { "docid": "3ee44c88f7c556887153d5e0c6a5b1c6", "score": "0.55545753", "text": "function upTo(el, tagName) {\n\ttagName = tagName.toLowerCase();\n\n\twhile (el && el.parentNode) {\n\t\tel = el.parentNode;\n\t\tif (el.tagName && el.tagName.toLowerCase() == tagName) {\n\t\t\treturn el;\n\t\t}\n\t}\n\treturn null;\n}", "title": "" }, { "docid": "2823a288c8b2e6b7455ea2ca1300e9ba", "score": "0.5535835", "text": "function resolveTarget(e)\r\n{\r\n var obj;\r\n if (e.target)\r\n obj = e.target;\r\n else if (e.srcElement)\r\n obj = e.srcElement;\r\n if (obj.nodeType == 3) // defeat Safari bug\r\n obj = obj.parentNode;\r\n return(obj);\r\n}", "title": "" }, { "docid": "9332ebcb34bca0d5c298dedc95b36f2c", "score": "0.5527907", "text": "function findRelated(e,value,name,relative)\n{\n\tname = name ? name : \"tagName\";\n\trelative = relative ? relative : \"parentNode\";\n\tif(name == \"className\")\n\t\t{\n\t\twhile(e && !hasClass(e,value))\n\t\t\t{\n\t\t\te = e[relative];\n\t\t\t}\n\t\t}\n\telse\n\t\t{\n\t\twhile(e && e[name] != value)\n\t\t\t{\n\t\t\te = e[relative];\n\t\t\t}\n\t\t}\n\treturn e;\n}", "title": "" }, { "docid": "12ee9c5b9f4fe87d94bd20b211242ee7", "score": "0.5509408", "text": "function findClosestValue(tree, target, closest) {\n cirrentNode = tree\n\n while (cirrentNode) {\n if (Math.abs(target - closest) > Math.abs(target - cirrentNode.value)) {\n closest = cirrentNode.value\n }\n if (target < cirrentNode.value) {\n cirrentNode = cirrentNode.left\n } else if (target > cirrentNode.value) {\n cirrentNode = cirrentNode.right\n } else {\n break\n }\n }\n\n return closest\n}", "title": "" }, { "docid": "c67c85d80b442f15a291f462acb5a298", "score": "0.5507941", "text": "closestCommonAncestor(vampire) {\n // if two same vampires\n if (this === vampire) {\n return this;\n }\n\n // direct ancesor case\n if (this.hasChildren(vampire)) {\n return this;\n }\n if (vampire.hasChildren(this)) {\n return vampire;\n }\n\n // non-direct case\n let ancestor = this;\n while (ancestor !== null) {\n if (ancestor.hasChildren(vampire)) {\n return ancestor;\n }\n ancestor = ancestor.creator;\n }\n }", "title": "" }, { "docid": "84ae2cc477ba8c724a8e252deb75630b", "score": "0.5500256", "text": "function getClosestInstanceFromNode(node){if(node[internalInstanceKey]){return node[internalInstanceKey];}// Walk up the tree until we find an ancestor whose instance we have cached.\nvar parents=[];while(!node[internalInstanceKey]){parents.push(node);if(node.parentNode){node=node.parentNode;}else{// Top of the tree. This node must not be part of a React tree (or is\n// unmounted, potentially).\nreturn null;}}var closest;var inst=node[internalInstanceKey];if(inst.tag===HostComponent||inst.tag===HostText){// In Fiber, this will always be the deepest root.\nreturn inst;}for(;node&&(inst=node[internalInstanceKey]);node=parents.pop()){closest=inst;if(parents.length){precacheChildNodes(inst,node);}}return closest;}", "title": "" }, { "docid": "e3aac795fa1acdd35653dfa7545b3d2e", "score": "0.54852957", "text": "function find() {\n var top = this.getBoundingClientRect().top,\n next = this.nextElementSibling;\n\n if ( !next.classList.contains('item') ) {\n return this;\n }\n\n return (next.getBoundingClientRect().top === top) ? find.call(next) : this; // recursive calls\n }", "title": "" }, { "docid": "060f1609ca7d2f821f8bb6c7a08ad6e7", "score": "0.5485067", "text": "function getClosestInstanceFromNode(node){if(node[internalInstanceKey]){return node[internalInstanceKey];}// Walk up the tree until we find an ancestor whose instance we have cached.\nvar parents=[];while(!node[internalInstanceKey]){parents.push(node);if(node.parentNode){node=node.parentNode;}else{// Top of the tree. This node must not be part of a React tree (or is\n// unmounted, potentially).\nreturn null;}}var closest=void 0;var inst=node[internalInstanceKey];if(inst.tag===HostComponent||inst.tag===HostText){// In Fiber, this will always be the deepest root.\nreturn inst;}for(;node&&(inst=node[internalInstanceKey]);node=parents.pop()){closest=inst;}return closest;}", "title": "" }, { "docid": "060f1609ca7d2f821f8bb6c7a08ad6e7", "score": "0.5485067", "text": "function getClosestInstanceFromNode(node){if(node[internalInstanceKey]){return node[internalInstanceKey];}// Walk up the tree until we find an ancestor whose instance we have cached.\nvar parents=[];while(!node[internalInstanceKey]){parents.push(node);if(node.parentNode){node=node.parentNode;}else{// Top of the tree. This node must not be part of a React tree (or is\n// unmounted, potentially).\nreturn null;}}var closest=void 0;var inst=node[internalInstanceKey];if(inst.tag===HostComponent||inst.tag===HostText){// In Fiber, this will always be the deepest root.\nreturn inst;}for(;node&&(inst=node[internalInstanceKey]);node=parents.pop()){closest=inst;}return closest;}", "title": "" }, { "docid": "060f1609ca7d2f821f8bb6c7a08ad6e7", "score": "0.5485067", "text": "function getClosestInstanceFromNode(node){if(node[internalInstanceKey]){return node[internalInstanceKey];}// Walk up the tree until we find an ancestor whose instance we have cached.\nvar parents=[];while(!node[internalInstanceKey]){parents.push(node);if(node.parentNode){node=node.parentNode;}else{// Top of the tree. This node must not be part of a React tree (or is\n// unmounted, potentially).\nreturn null;}}var closest=void 0;var inst=node[internalInstanceKey];if(inst.tag===HostComponent||inst.tag===HostText){// In Fiber, this will always be the deepest root.\nreturn inst;}for(;node&&(inst=node[internalInstanceKey]);node=parents.pop()){closest=inst;}return closest;}", "title": "" }, { "docid": "b87db6241a31769f0e70feebecdbfb8d", "score": "0.5482491", "text": "function findParent(thisElement, parentTagName, className) {\n if (className != '') {\n while (\n (thisElement = thisElement.parentElement) && !thisElement.classList.contains(className)\n );\n return thisElement\n } else {\n while (\n (thisElement = thisElement.parentElement) &&\n thisElement.tagName != parentTagName\n );\n //Searching loop only stop while parent is founded\n return thisElement //if searching no one will return null\n }\n}", "title": "" }, { "docid": "b5d5080b7c146fd4b86a51c2f670870e", "score": "0.547048", "text": "function findAncestor (el, cls) {\n while ((el = el.parentElement) && !el.classList.contains(cls));\n return el;\n}", "title": "" }, { "docid": "dcb9b4a5a604a456665896ed0e41e64a", "score": "0.54631996", "text": "function getClosestInstanceFromNode(node){if(node[internalInstanceKey]){return node[internalInstanceKey];}// Walk up the tree until we find an ancestor whose instance we have cached.\nvar parents=[];while(!node[internalInstanceKey]){parents.push(node);if(node.parentNode){node=node.parentNode;}else{// Top of the tree. This node must not be part of a React tree (or is\n// unmounted, potentially).\nreturn null;}}var closest;var inst;for(;node&&(inst=node[internalInstanceKey]);node=parents.pop()){closest=inst;if(parents.length){precacheChildNodes(inst,node);}}return closest;}", "title": "" }, { "docid": "dc834ea208f852d8cc21ac582147c0a6", "score": "0.54527026", "text": "function findParent(that, tag){\n while(that.tagName !== tag || that.tagName === 'html'){\n that = that.parentElement;\n }\n return that\n}", "title": "" }, { "docid": "393fcc7549aa36d1c519269494c42530", "score": "0.54452544", "text": "function getClosestSiblingByTagName(obj, tag) {\n var obj_sibling = obj.nextSibling;\n if (!obj_sibling) \n return false;\n if (obj_sibling.tagName.toLowerCase() == tag) \n return obj_sibling;\n else \n return getParentByTagName(obj_sibling, tag);\n }", "title": "" }, { "docid": "726081154579c6453bcdb7c4479f9f74", "score": "0.5433362", "text": "getClosestDialog(element) {\n let parent = element.parentElement;\n while (parent && !parent.classList.contains('thy-dialog-container')) {\n parent = parent.parentElement;\n }\n if (parent && parent.id) {\n return this.getDialogById(parent.id);\n }\n return null;\n }", "title": "" }, { "docid": "9209d207a25b6f6a461b3056f80ca54c", "score": "0.54265416", "text": "function findElementInEvent(e, selector) {\n var el = e.target;\n if (!el.matches(selector)) {\n if (typeof selector === 'string') {\n el = el.closest(selector);\n }\n else if (selector.nodeType) {\n var parentEl = el.parentElement;\n while (parentEl) {\n if (parentEl === selector) {\n return selector;\n }\n }\n return undefined;\n }\n }\n return el;\n}", "title": "" }, { "docid": "8a373da0e0bd6f7fe31e93117fccae55", "score": "0.5389052", "text": "function getClosestInstanceFromNode(node){if(node[internalInstanceKey]){return node[internalInstanceKey];}while(!node[internalInstanceKey]){if(node.parentNode){node=node.parentNode;}else{// Top of the tree. This node must not be part of a React tree (or is\n// unmounted, potentially).\nreturn null;}}var inst=node[internalInstanceKey];if(inst.tag===HostComponent||inst.tag===HostText){// In Fiber, this will always be the deepest root.\nreturn inst;}return null;}", "title": "" }, { "docid": "8a373da0e0bd6f7fe31e93117fccae55", "score": "0.5389052", "text": "function getClosestInstanceFromNode(node){if(node[internalInstanceKey]){return node[internalInstanceKey];}while(!node[internalInstanceKey]){if(node.parentNode){node=node.parentNode;}else{// Top of the tree. This node must not be part of a React tree (or is\n// unmounted, potentially).\nreturn null;}}var inst=node[internalInstanceKey];if(inst.tag===HostComponent||inst.tag===HostText){// In Fiber, this will always be the deepest root.\nreturn inst;}return null;}", "title": "" }, { "docid": "8a373da0e0bd6f7fe31e93117fccae55", "score": "0.5389052", "text": "function getClosestInstanceFromNode(node){if(node[internalInstanceKey]){return node[internalInstanceKey];}while(!node[internalInstanceKey]){if(node.parentNode){node=node.parentNode;}else{// Top of the tree. This node must not be part of a React tree (or is\n// unmounted, potentially).\nreturn null;}}var inst=node[internalInstanceKey];if(inst.tag===HostComponent||inst.tag===HostText){// In Fiber, this will always be the deepest root.\nreturn inst;}return null;}", "title": "" }, { "docid": "8a373da0e0bd6f7fe31e93117fccae55", "score": "0.5389052", "text": "function getClosestInstanceFromNode(node){if(node[internalInstanceKey]){return node[internalInstanceKey];}while(!node[internalInstanceKey]){if(node.parentNode){node=node.parentNode;}else{// Top of the tree. This node must not be part of a React tree (or is\n// unmounted, potentially).\nreturn null;}}var inst=node[internalInstanceKey];if(inst.tag===HostComponent||inst.tag===HostText){// In Fiber, this will always be the deepest root.\nreturn inst;}return null;}", "title": "" }, { "docid": "8a373da0e0bd6f7fe31e93117fccae55", "score": "0.5389052", "text": "function getClosestInstanceFromNode(node){if(node[internalInstanceKey]){return node[internalInstanceKey];}while(!node[internalInstanceKey]){if(node.parentNode){node=node.parentNode;}else{// Top of the tree. This node must not be part of a React tree (or is\n// unmounted, potentially).\nreturn null;}}var inst=node[internalInstanceKey];if(inst.tag===HostComponent||inst.tag===HostText){// In Fiber, this will always be the deepest root.\nreturn inst;}return null;}", "title": "" }, { "docid": "fe1a008d0f4f4c1c5fe7827bafea9079", "score": "0.5379851", "text": "function findParentByClass(el, classParentToFind) {\n if (el.parentNode.tagName == \"HTML\" || !el.parentNode) return;\n if (el.parentNode.classList.contains(classParentToFind)) return el.parentNode;\n return findParentByClass(el.parentNode, classParentToFind);\n }", "title": "" }, { "docid": "ff1c9398994059f6e766ffdcd7ce5a8a", "score": "0.5370499", "text": "function resolveTarget(e)\n{\n\tvar obj;\n\tif (e.target)\n\t\tobj = e.target;\n\telse if (e.srcElement)\n\t\tobj = e.srcElement;\n\tif (obj.nodeType == 3) // defeat Safari bug\n\t\tobj = obj.parentNode;\n\treturn(obj);\n}", "title": "" }, { "docid": "8486fb7a0588268ec0c97c748952e89b", "score": "0.53651065", "text": "findClosestAncestorsNodeWithId(id) {\n let current = this;\n\n while (current.parent) {\n const parent = current.parent;\n const node = parent.getNode(id);\n\n current = parent;\n\n if (node) {\n return node;\n }\n }\n }", "title": "" }, { "docid": "15494ddedf6c2d6563106b3db3526227", "score": "0.5357027", "text": "function getClosestInstanceFromNode(node){if(node[internalInstanceKey]){return node[internalInstanceKey];}while(!node[internalInstanceKey]){if(node.parentNode){node=node.parentNode;}else{// Top of the tree. This node must not be part of a React tree (or is\n\t// unmounted, potentially).\n\treturn null;}}var inst=node[internalInstanceKey];if(inst.tag===HostComponent||inst.tag===HostText){// In Fiber, this will always be the deepest root.\n\treturn inst;}return null;}", "title": "" }, { "docid": "33a0093aab694d227c20dc6f019b300c", "score": "0.5321186", "text": "function getClosestInstanceFromNode(node){if(node[internalInstanceKey]){return node[internalInstanceKey];}// Walk up the tree until we find an ancestor whose instance we have cached.\n\tvar parents=[];while(!node[internalInstanceKey]){parents.push(node);if(node.parentNode){node=node.parentNode;}else{// Top of the tree. This node must not be part of a React tree (or is\n\t// unmounted, potentially).\n\treturn null;}}var closest=void 0;var inst=node[internalInstanceKey];if(inst.tag===HostComponent||inst.tag===HostText){// In Fiber, this will always be the deepest root.\n\treturn inst;}for(;node&&(inst=node[internalInstanceKey]);node=parents.pop()){closest=inst;}return closest;}", "title": "" }, { "docid": "cbc7fc44039012065377c2e39bc562d9", "score": "0.53180236", "text": "function clickInsideElement(e, className) {\n var el = e.srcElement || e.target;\n\n\n if ($(el).hasClass(className)) {\n return el;\n } else {\n while (el = el.parentNode) {\n if ($(el).hasClass(className)) {\n return el;\n }\n }\n }\n return false;\n }", "title": "" }, { "docid": "44b76c79196fa5c574d10fc36f60f130", "score": "0.5316529", "text": "function findTarget(e, targetClass) {\n let node = e.target;\n let targetNode = null;\n\n while (node !== e.currentTarget) {\n if (node.classList.contains(targetClass)) {\n targetNode = node;\n break;\n }\n\n node = node.parentNode;\n }\n\n return targetNode;\n}", "title": "" }, { "docid": "63517ba5df0d5772fa917719a6e22544", "score": "0.5313375", "text": "function parent(child, classname) {\n if (child && \"closest\" in child) return child.closest(\".\" + classname);\n let ele = child;\n while (ele) {\n if (ele.classList && ele.classList.contains(classname)) return ele;\n else ele = ele.parentElement;\n }\n return null;\n } // parent", "title": "" }, { "docid": "6936b498e507b0ffe1ecc54206bea92b", "score": "0.53030753", "text": "function parentWithClass(el, className) {\n while (el.parentNode) {\n if (el.classList.contains(className)) {\n return el;\n }\n el = el.parentNode;\n }\n\n return null;\n }", "title": "" }, { "docid": "31dcce4f78578fcf9db33aea88e16cb1", "score": "0.52982944", "text": "function findParentByClass(el, className) {\n const root = el.getRootNode();\n while(el != root) {\n if (el.classList.contains(className)) return el;\n el = el.parentNode;\n }\n return null;\n}", "title": "" }, { "docid": "fec71bd2e5a639ddc26528b849657adf", "score": "0.5296853", "text": "findAncestor(el, utils) {\n const colour = utils.contrast.textColour(el);\n const backgroundColour = utils.contrast.backgroundColour(el);\n\n let cursor = el;\n while (cursor.parentNode !== document) {\n const parent = cursor.parentNode;\n if (utils.contrast.textColour(parent) !== colour\n && utils.contrast.backgroundColour(parent) !== backgroundColour) {\n break;\n }\n cursor = parent;\n }\n\n return cursor;\n }", "title": "" }, { "docid": "169a25a4e0ce48044e86ac029ad2cabd", "score": "0.5279291", "text": "function resolveTarget(e)\n{\n\tvar obj;\n\tif(e.target)\n\t\tobj = e.target;\n\telse if(e.srcElement)\n\t\tobj = e.srcElement;\n\tif(obj.nodeType == 3) // defeat Safari bug\n\t\tobj = obj.parentNode;\n\treturn obj;\n}", "title": "" }, { "docid": "6c22e57f35b971e3ae16741caf84ecfb", "score": "0.5233232", "text": "function returnTarget(e){\n var target = null;\n if (!e) \n e = window.event;\n if (e.target) {\n target = e.target;\n }\n else \n if (e.srcElement) {\n target = e.srcElement;\n }\n \n if (target.nodeType == 3) {// For Safari bug\n target = target.parentNode;\n }\n return target;\n}", "title": "" }, { "docid": "c02b83ec203da2817b37cacf0c7a3605", "score": "0.52230537", "text": "function findClosestLink( ele )\t{\n\t\twhile ( ele ) {\n\t\t\t// Look for the closest element with a nodeName of \"a\".\n\t\t\t// Note that we are checking if we have a valid nodeName\n\t\t\t// before attempting to access it. This is because the\n\t\t\t// node we get called with could have originated from within\n\t\t\t// an embedded SVG document where some symbol instance elements\n\t\t\t// don't have nodeName defined on them, or strings are of type\n\t\t\t// SVGAnimatedString.\n\t\t\tif ( ( typeof ele.nodeName === \"string\" ) && ele.nodeName.toLowerCase() === \"a\" ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tele = ele.parentNode;\n\t\t}\n\t\treturn ele;\n\t}", "title": "" }, { "docid": "46e557f76ace4b2143e5a69aba2103e7", "score": "0.52063936", "text": "function r(e){var t=e.target||e.srcElement||window;return t.correspondingUseElement&&(t=t.correspondingUseElement),3===t.nodeType?t.parentNode:t}", "title": "" }, { "docid": "734f025ac559ad1833a48bb959962ed7", "score": "0.5200821", "text": "function clickInsideElement(e, className) {\n var el = e.srcElement || e.target;\n if (el.classList.contains(className)) {\n return el;\n } else {\n while ((el = el.parentNode)) {\n if (el.classList && el.classList.contains(className)) {\n return el;\n }\n }\n }\n return false;\n }", "title": "" }, { "docid": "72ed1dfef4cf682ca1c104b25bc6ff8f", "score": "0.5198808", "text": "function clickInsideElement( e, className ) {\n var el = e.srcElement || e.target;\n\n if ( el.classList.contains(className) ) {\n return el;\n } else {\n while ( el = el.parentNode ) {\n if ( el.classList && el.classList.contains(className) ) {\n return el;\n }\n }\n }\n\n return false;\n }", "title": "" }, { "docid": "29ec2a4f3ce80e5e8fc2bdfa9b27526e", "score": "0.51898223", "text": "function findClosestLink(ele) {\r\n\t\t\t\t\t\t\twhile (ele) {\r\n\t\t\t\t\t\t\t\t// Look for the closest element with a nodeName\r\n\t\t\t\t\t\t\t\t// of \"a\".\r\n\t\t\t\t\t\t\t\t// Note that we are checking if we have a valid\r\n\t\t\t\t\t\t\t\t// nodeName\r\n\t\t\t\t\t\t\t\t// before attempting to access it. This is\r\n\t\t\t\t\t\t\t\t// because the\r\n\t\t\t\t\t\t\t\t// node we get called with could have originated\r\n\t\t\t\t\t\t\t\t// from within\r\n\t\t\t\t\t\t\t\t// an embedded SVG document where some symbol\r\n\t\t\t\t\t\t\t\t// instance elements\r\n\t\t\t\t\t\t\t\t// don't have nodeName defined on them, or\r\n\t\t\t\t\t\t\t\t// strings are of type\r\n\t\t\t\t\t\t\t\t// SVGAnimatedString.\r\n\t\t\t\t\t\t\t\tif ((typeof ele.nodeName === \"string\") && ele.nodeName.toLowerCase() === \"a\") {\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tele = ele.parentNode;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn ele;\r\n\t\t\t\t\t\t}", "title": "" }, { "docid": "ad5855c2c3ba17a1a7fbfb63f0384fdd", "score": "0.5178823", "text": "function findClosestLink( ele )\n\t{\n\t\twhile ( ele ) {\n\t\t\t// Look for the closest element with a nodeName of \"a\".\n\t\t\t// Note that we are checking if we have a valid nodeName\n\t\t\t// before attempting to access it. This is because the\n\t\t\t// node we get called with could have originated from within\n\t\t\t// an embedded SVG document where some symbol instance elements\n\t\t\t// don't have nodeName defined on them, or strings are of type\n\t\t\t// SVGAnimatedString.\n\t\t\tif ( ( typeof ele.nodeName === \"string\" ) && ele.nodeName.toLowerCase() === \"a\" ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tele = ele.parentNode;\n\t\t}\n\t\treturn ele;\n\t}", "title": "" }, { "docid": "ad5855c2c3ba17a1a7fbfb63f0384fdd", "score": "0.5178823", "text": "function findClosestLink( ele )\n\t{\n\t\twhile ( ele ) {\n\t\t\t// Look for the closest element with a nodeName of \"a\".\n\t\t\t// Note that we are checking if we have a valid nodeName\n\t\t\t// before attempting to access it. This is because the\n\t\t\t// node we get called with could have originated from within\n\t\t\t// an embedded SVG document where some symbol instance elements\n\t\t\t// don't have nodeName defined on them, or strings are of type\n\t\t\t// SVGAnimatedString.\n\t\t\tif ( ( typeof ele.nodeName === \"string\" ) && ele.nodeName.toLowerCase() === \"a\" ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tele = ele.parentNode;\n\t\t}\n\t\treturn ele;\n\t}", "title": "" }, { "docid": "ad5855c2c3ba17a1a7fbfb63f0384fdd", "score": "0.5178823", "text": "function findClosestLink( ele )\n\t{\n\t\twhile ( ele ) {\n\t\t\t// Look for the closest element with a nodeName of \"a\".\n\t\t\t// Note that we are checking if we have a valid nodeName\n\t\t\t// before attempting to access it. This is because the\n\t\t\t// node we get called with could have originated from within\n\t\t\t// an embedded SVG document where some symbol instance elements\n\t\t\t// don't have nodeName defined on them, or strings are of type\n\t\t\t// SVGAnimatedString.\n\t\t\tif ( ( typeof ele.nodeName === \"string\" ) && ele.nodeName.toLowerCase() === \"a\" ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tele = ele.parentNode;\n\t\t}\n\t\treturn ele;\n\t}", "title": "" }, { "docid": "3f8b48252e30d39febb66898c48dcc25", "score": "0.51742023", "text": "function closestHandle ( handles, location, style ) {\r\n\r\n\t\t\tif ( handles.length === 1 ) {\r\n\t\t\t\treturn handles[0];\r\n\t\t\t}\r\n\r\n\t\t\tvar total = handles[0].offset()[style] +\r\n\t\t\t\t\t\thandles[1].offset()[style];\r\n\r\n\t\t\treturn handles[ location < total / 2 ? 0 : 1 ];\r\n\t\t}", "title": "" }, { "docid": "48373dcff788d7976f89ec972176e545", "score": "0.51712006", "text": "function getNearestLinkAncestor(el) {\n if (el.nodeName && el.nodeName === \"A\") {\n return el;\n } else if (el.parentNode) {\n return getNearestLinkAncestor(el.parentNode);\n } else {\n return undefined;\n }\n }", "title": "" }, { "docid": "d6b9800d1cbe7a831023e721bb81f30d", "score": "0.5170395", "text": "function getParentWindowElement(el)\n{\n p = el.parentNode;\n while (p && p.className.toString().toLowerCase().split(\" \")[0] != \"window\")\n {\n p = p.parentNode;\n }\n return p;\n}", "title": "" }, { "docid": "080d1039d0fc1bb00409332a6c8253c6", "score": "0.5170289", "text": "function findUntilInternal(elem, fnIsMatch, results) {\n if (elem.nodeType !== 1) {\n return;\n }\n\n if (fnIsMatch.call(elem, elem, results) === false) {\n return;\n }\n\n for (var i = 0, len = elem.childNodes.length; i < len; i++) {\n findUntilInternal(elem.childNodes[i], fnIsMatch, results);\n }\n }", "title": "" }, { "docid": "59ea4e9fbab898414cc4ee8a56f92a74", "score": "0.51662564", "text": "function getOffsetParent(element, polyfill) {\n const window = getWindow(element);\n if (!isHTMLElement(element)) {\n return window;\n }\n let offsetParent = getTrueOffsetParent(element, polyfill);\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n }\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {\n return window;\n }\n return offsetParent || getContainingBlock(element) || window;\n}", "title": "" }, { "docid": "e2f14be6ac00d0ea0bb37a8f6f7f2044", "score": "0.51627487", "text": "function findClosestValueInBst(tree, target) {\n\tlet closest = Infinity;\n\treturn findClosestHelperFunc(tree, target, closest);\n}", "title": "" }, { "docid": "f78341e5c81eb96d0255bd398106aa51", "score": "0.51599884", "text": "function closestHandle ( handles, location, style ) {\n\n\t\t\tif ( handles.length === 1 ) {\n\t\t\t\treturn handles[0];\n\t\t\t}\n\n\t\t\tvar total = handles[0].offset()[style] +\n\t\t\t\t\t\thandles[1].offset()[style];\n\n\t\t\treturn handles[ location < total / 2 ? 0 : 1 ];\n\t\t}", "title": "" }, { "docid": "78b705960b5bdc2ad5ed0d9028336d7b", "score": "0.51495576", "text": "function getParent(elem) {\n return elem.parent || null;\n}", "title": "" }, { "docid": "78b705960b5bdc2ad5ed0d9028336d7b", "score": "0.51495576", "text": "function getParent(elem) {\n return elem.parent || null;\n}", "title": "" }, { "docid": "78b705960b5bdc2ad5ed0d9028336d7b", "score": "0.51495576", "text": "function getParent(elem) {\n return elem.parent || null;\n}", "title": "" }, { "docid": "78b705960b5bdc2ad5ed0d9028336d7b", "score": "0.51495576", "text": "function getParent(elem) {\n return elem.parent || null;\n}", "title": "" }, { "docid": "78b705960b5bdc2ad5ed0d9028336d7b", "score": "0.51495576", "text": "function getParent(elem) {\n return elem.parent || null;\n}", "title": "" }, { "docid": "78b705960b5bdc2ad5ed0d9028336d7b", "score": "0.51495576", "text": "function getParent(elem) {\n return elem.parent || null;\n}", "title": "" } ]
f4fa74606298841f52e2b7b08ebbd790
chuy?n sang action k? ti?p
[ { "docid": "15d789ff201670f032e458706801f092", "score": "0.0", "text": "static prev() {\r\n\r\n\t\tconsole.log('INFO: PREV');\r\n\t\tcheck_all = 1;\r\n\t\ttmp_page = 0;\r\n\t\taction--;\r\n\r\n\t\tif ( action >= 50 ) {\r\n\r\n\t\t\tconsole.log('INFO: ------ reload page - reload page - reload page -------');\r\n\t\t\tlocation.reload(true);\r\n\t\t}\r\n\t}", "title": "" } ]
[ { "docid": "0f665610c6da315a51095c4fc79fd390", "score": "0.6008121", "text": "function answerOrSneak(){\n switch (input.value.toLowerCase()){\n\n case 'j':\n\n answerDoor()\n break\n\n case 'n':\n text.innerHTML += '<p> Mormor har alltid sagt att saker som verkar för bra för att vara sant oftast är det. Med detta i åtanke ' + \n 'vänder du på klacken och stegar tillbaka för att ta stigen som leder till din mormors stuga. <br> Hoppas hon serverar pepparkakor... </p>'\n goToGrandma()\n break\n \n default:\n text.innerHTML += wrongInput\n }\n }", "title": "" }, { "docid": "60939fe4ca864bafdc82a2fba19c7949", "score": "0.6002031", "text": "function cherish(){\n\n}", "title": "" }, { "docid": "3e7e9e9646f88550fefad4316e69e379", "score": "0.5997216", "text": "function kbGTuVSCBjenekexrWe7fA() {}", "title": "" }, { "docid": "b78dc2e38a50a876abb87bebd6bd1345", "score": "0.5928483", "text": "function jh780122() { return 'han'; }", "title": "" }, { "docid": "4dcdccc6ffc47749bcff2d70491a0b2a", "score": "0.5906722", "text": "function activar_batiseñal() {\n return \"activada\";\n}", "title": "" }, { "docid": "9582ede28b9305298bcf981a797b0c2c", "score": "0.5898667", "text": "klik(){\n alert('Tombol sudah diklik !')\n }", "title": "" }, { "docid": "2a52fbb1f5b2e418503f0b3d89cbf51f", "score": "0.58666974", "text": "function actioncode(bo) {\n\n if (bo) return 1;\n\n return 0;\n} //action code s", "title": "" }, { "docid": "6c3cc0a8eef2b084e5ae102c3d00b64d", "score": "0.58333737", "text": "function FACE() {\r\n maintxt=\"> ?FACE?brk> Enjoy some faces made out of Terminal-10brkbrk> W^Wbrk> T_T\";\r\n}", "title": "" }, { "docid": "ca23104f70fa0c8520c6cad50ed98603", "score": "0.58212095", "text": "function islem(){\n console.log(\"Tekin GÜÇ\")\n console.log(\"Tekin ALİ\")\n console.log(\"Tekin Gazme\")\n console.log(\"Tekin POLAT\")\n \n}", "title": "" }, { "docid": "b8c85c3ee6d8144f22e48ce737f73303", "score": "0.5774221", "text": "function te1041775() { return 'atch '; }", "title": "" }, { "docid": "d596fd47b010e980b31df76f63d1bc73", "score": "0.5772489", "text": "success(language, key, args) {\n\t\t\ttry {\n\t\t\t\tlet emoji;\n\t\t\t\tif (this.type == 'dm') {\n\t\t\t\t\temoji = this.client.config.emojis.tick;\n\t\t\t\t} else {\n\t\t\t\t\temoji = this.permissionsFor(this.client.user).has('USE_EXTERNAL_EMOJIS') ? this.client.config.emojis.tick : ':white_check_mark:';\n\t\t\t\t}\n\t\t\t\treturn this.send({ embed:{ color:3066993, description:`${emoji} ${this.client.translate(language, key, args)}` } });\n\t\t\t} catch (err) {\n\t\t\t\tthis.client.logger.error(err.message);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "3f954c39fe85e117ee35b2f1445e8447", "score": "0.57716244", "text": "function codeThatText(e) {\n e.preventDefault();\n let morseText = \"\";\n userInput.split(\"\").forEach((chr) => {\n morseText += \" \" + Data[chr.toLowerCase()];\n });\n setTranslate(morseText);\n }", "title": "" }, { "docid": "3439f2f0706aad73174d67ad6d8a68cd", "score": "0.57663023", "text": "yik() {\n this.sendMessage({ key: 'yik' });\n }", "title": "" }, { "docid": "4bc324991cd81384bda50744f97caa95", "score": "0.5746969", "text": "function chooseAction(given, person) {\n var text = given.split(\" \");\n var activeFriend = Chat.m_ActiveFriend.m_strName;\n \n if (text.length > 1) {\n var val = text[1];\n }\n \n var action = text[0];\n\t\n // Temp disabled until admin commands are introduced\n \n\tif ((action == \"repeat\") && (person == admin)) {\n\t\tvar n = parseInt(text[1],10);\n\t\tvar command = text[2];\n if (n > 1000) {\n var dontdick = chatBot+\"Come on now, don't be a schmuck.\";\n sendMessage(dontdick);\n } else {\n for(var i = 0; i < n; i++){\n chooseAction(text.slice(2).join(\" \")); //send the second part of it\n }\n }\n\t}\n\n // Array loop for actions\n //console.log(\"Action: \"+action);\n for (var i=0; i < commands.length; i++) {\n if (action == commands[i][0]) {\n commands[i][1](text);\n }\n }\n\n // AFK controls\n if (action == \"/afk\") {\n sendMessage(setAfk(person, given));\n } else if (action != \"[\"+chatBotDisplayName+\"]\") {\n //console.log(person + \" AFK ACTION HERE\");\n if (isAfk(admin) && (admin != person)) {\n //console.log(\"userafk\");\n sendMessage(afkMsg(admin));\n }\n\n if (isAfk(activeFriend) && (admin == person)) {\n //console.log(\"friendafk\");\n sendMessage(afkMsg(activeFriend));\n }\n }\n}", "title": "" }, { "docid": "f90aa07d28ff1cf4b09f067046c4ea42", "score": "0.5729208", "text": "function confirmspecialCharacter() {\n if (specialCharacter)\n = (\"Would you like special characters?\");\n}", "title": "" }, { "docid": "c35407bd538fe3a042d13fbf3369a1cb", "score": "0.5718727", "text": "function specialText(text=\"\", action){\n switch (action.type) {\n case \"SPECIAL_TEXT\":\n return action.value\n default:\n return text;\n }\n}", "title": "" }, { "docid": "7ff1f0e70a065406b479c89a67cb76e2", "score": "0.57034564", "text": "function EROR(){\r\n maintxt=\"> ?EROR?brk> What do you think you're doing?\";\r\n alert(\"Did you expect an error? Not gonna happen! Try something else.\"); \r\n}", "title": "" }, { "docid": "0664b1d9cf975c0a06fa38575391721a", "score": "0.56855136", "text": "function t(e,t,i,n){switch(i){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "a5487aac7694958c28cd81e8d3718f26", "score": "0.5681068", "text": "function keyPressed() {\n switch (keyCode) {\n case 38:\n if (laatsteRichting == \"omlaag\") {} //om te voorkomen dat je dood kan gaan door omhoog te gaan als je net omlaag ging\n else {\n richting = \"omhoog\";\n }\n break;\n case 87:\n if (laatsteRichting == \"omlaag\") {} \n else {\n richting = \"omhoog\";\n }\n break;\n case 37:\n if (laatsteRichting == \"rechts\") {} \n else {\n richting = \"links\";\n }\n break;\n case 65:\n if (laatsteRichting == \"rechts\") {} \n else {\n richting = \"links\";\n }\n break;\n case 39:\n if (laatsteRichting == \"links\") {} \n else {\n richting = \"rechts\";\n }\n break;\n case 68:\n if (laatsteRichting == \"links\") {} \n else {\n richting = \"rechts\";\n }\n break;\n case 40:\n if (laatsteRichting == \"omhoog\") {} \n else {\n richting = \"omlaag\";\n }\n break;\n case 83:\n if (laatsteRichting == \"omhoog\") {} \n else {\n richting = \"omlaag\";\n }\n break;\n case 27: //esc\n //maakt pauzeScherm true als die false is en omgekeerd\n pauzeScherm = !pauzeScherm\n default:\n break;\n }\n}", "title": "" }, { "docid": "dd7d4a7a58f021e7a0101727489e8ed3", "score": "0.56695795", "text": "function keypressCallback(e) {\n\t\tvar key = e.which,\n\t\t\tcommand;\n\t\tif (key === 32) { // space\n\t\t\tcommand = 'playpause';\n\t\t\tactivateButton(playPause);\n\t\t} else if (key === 100) { // d\n\t\t\tcommand = 'thumbs down';\n\t\t\tactivateButton(dislike);\n\t\t} else if (key === 108) { // l\n\t\t\tcommand = 'thumbs up';\n\t\t\tactivateButton(like);\n\t\t} else if (key === 110) { // n\n\t\t\tcommand = 'next song';\n\t\t\tactivateButton(nextSong);\n\t\t} else if (key === 116) { // t\n\t\t\tcommand = 'tired of song';\n\t\t\tactivateButton(tiredOfSong);\n\t\t} else if (key === 61 || key === 43) { // = or +\n\t\t\tincreaseVolumeCallback(e);\n\t\t\treturn;\n\t\t} else if (key === 45 || key === 95) { // - or _\n\t\t\tdecreaseVolumeCallback(e);\n\t\t\treturn;\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\n\t\te.preventDefault();\n\n\t\tsendHermesCommand(command);\n\t}", "title": "" }, { "docid": "7cf31c1f87000ab399f84299242a9631", "score": "0.5663679", "text": "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "7cf31c1f87000ab399f84299242a9631", "score": "0.5663679", "text": "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "7cf31c1f87000ab399f84299242a9631", "score": "0.5663679", "text": "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "7cf31c1f87000ab399f84299242a9631", "score": "0.5663679", "text": "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "7cf31c1f87000ab399f84299242a9631", "score": "0.5663679", "text": "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "7cf31c1f87000ab399f84299242a9631", "score": "0.5663679", "text": "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "7cf31c1f87000ab399f84299242a9631", "score": "0.5663679", "text": "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "7cf31c1f87000ab399f84299242a9631", "score": "0.5663679", "text": "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "7cf31c1f87000ab399f84299242a9631", "score": "0.5663679", "text": "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "7cf31c1f87000ab399f84299242a9631", "score": "0.5663679", "text": "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "7cf31c1f87000ab399f84299242a9631", "score": "0.5663679", "text": "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "7cf31c1f87000ab399f84299242a9631", "score": "0.5663679", "text": "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "7cf31c1f87000ab399f84299242a9631", "score": "0.5663679", "text": "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "7cf31c1f87000ab399f84299242a9631", "score": "0.5663679", "text": "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "7cf31c1f87000ab399f84299242a9631", "score": "0.5663679", "text": "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "7cf31c1f87000ab399f84299242a9631", "score": "0.5663679", "text": "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "7cf31c1f87000ab399f84299242a9631", "score": "0.5663679", "text": "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "7cf31c1f87000ab399f84299242a9631", "score": "0.5663679", "text": "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "7cf31c1f87000ab399f84299242a9631", "score": "0.5663679", "text": "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "7cf31c1f87000ab399f84299242a9631", "score": "0.5663679", "text": "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "7cf31c1f87000ab399f84299242a9631", "score": "0.5663679", "text": "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "7cf31c1f87000ab399f84299242a9631", "score": "0.5663679", "text": "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "7cf31c1f87000ab399f84299242a9631", "score": "0.5663679", "text": "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "7cf31c1f87000ab399f84299242a9631", "score": "0.5663679", "text": "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "7cf31c1f87000ab399f84299242a9631", "score": "0.5663679", "text": "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "7cf31c1f87000ab399f84299242a9631", "score": "0.5663679", "text": "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "4e46728006a12734ee428797b77b0e8e", "score": "0.5660848", "text": "function actionTextFixUp(sText) {\r\n\t\"use strict\";\r\n\tif (sText === \"login\") {\r\n\t\tlogChange(sText, \"log in\");\r\n\t\treturn \"log in\";\r\n\t}\r\n\tif (sText === \"Login\") {\r\n\t\tlogChange(sText, \"Log in\");\r\n\t\treturn \"Log in\";\r\n\t}\r\n\tif (sText === \"logout\") {\r\n\t\tlogChange(sText, \"log out\");\r\n\t\treturn \"log out\";\r\n\t}\r\n\tif (sText === \"Logout\") {\r\n\t\tlogChange(sText, \"Log out\");\r\n\t\treturn \"Log out\";\r\n\t}\r\n}", "title": "" }, { "docid": "84ec92ba825089f132023931d712f08f", "score": "0.56604666", "text": "function tinhtoan() {\n console.log(\"day la vi du ve kieu void\");\n}", "title": "" }, { "docid": "e5780afa86d2e61a4ce7f65c62a6d12a", "score": "0.56561077", "text": "function t(e,t,a,n){switch(a){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "e5780afa86d2e61a4ce7f65c62a6d12a", "score": "0.56561077", "text": "function t(e,t,a,n){switch(a){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "e5780afa86d2e61a4ce7f65c62a6d12a", "score": "0.56561077", "text": "function t(e,t,a,n){switch(a){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "f9735b57e66c1fdd9a99ce1b185508b9", "score": "0.56525075", "text": "function e(t,e,i,n){switch(i){case\"s\":return e?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return t+(e?\" секунд\":\" секундын\");case\"m\":case\"mm\":return t+(e?\" минут\":\" минутын\");case\"h\":case\"hh\":return t+(e?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return t+(e?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return t+(e?\" сар\":\" сарын\");case\"y\":case\"yy\":return t+(e?\" жил\":\" жилийн\");default:return t}}", "title": "" }, { "docid": "f9735b57e66c1fdd9a99ce1b185508b9", "score": "0.56525075", "text": "function e(t,e,i,n){switch(i){case\"s\":return e?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return t+(e?\" секунд\":\" секундын\");case\"m\":case\"mm\":return t+(e?\" минут\":\" минутын\");case\"h\":case\"hh\":return t+(e?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return t+(e?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return t+(e?\" сар\":\" сарын\");case\"y\":case\"yy\":return t+(e?\" жил\":\" жилийн\");default:return t}}", "title": "" }, { "docid": "2a1f83193a8ae3ee5ebdba566f6ba406", "score": "0.5652113", "text": "function jh643790() { return 'o '; }", "title": "" }, { "docid": "1a0f894d25a230517da67bb1790ae9a8", "score": "0.564824", "text": "function sayyep() {\n console.log(\"Hello 😉\") \n }", "title": "" }, { "docid": "47a77d934366b41d39999713a0fdf7d6", "score": "0.5635781", "text": "function permisi() {\n console.log(\"Assalamu'alaikum\");\n}", "title": "" }, { "docid": "b48359258e107ba5d9b77f06dd6d4689", "score": "0.5616386", "text": "function e(t,e,n,i){switch(n){case\"s\":return e?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return t+(e?\" секунд\":\" секундын\");case\"m\":case\"mm\":return t+(e?\" минут\":\" минутын\");case\"h\":case\"hh\":return t+(e?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return t+(e?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return t+(e?\" сар\":\" сарын\");case\"y\":case\"yy\":return t+(e?\" жил\":\" жилийн\");default:return t}}", "title": "" }, { "docid": "b48359258e107ba5d9b77f06dd6d4689", "score": "0.5616386", "text": "function e(t,e,n,i){switch(n){case\"s\":return e?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return t+(e?\" секунд\":\" секундын\");case\"m\":case\"mm\":return t+(e?\" минут\":\" минутын\");case\"h\":case\"hh\":return t+(e?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return t+(e?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return t+(e?\" сар\":\" сарын\");case\"y\":case\"yy\":return t+(e?\" жил\":\" жилийн\");default:return t}}", "title": "" }, { "docid": "b48359258e107ba5d9b77f06dd6d4689", "score": "0.5616386", "text": "function e(t,e,n,i){switch(n){case\"s\":return e?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return t+(e?\" секунд\":\" секундын\");case\"m\":case\"mm\":return t+(e?\" минут\":\" минутын\");case\"h\":case\"hh\":return t+(e?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return t+(e?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return t+(e?\" сар\":\" сарын\");case\"y\":case\"yy\":return t+(e?\" жил\":\" жилийн\");default:return t}}", "title": "" }, { "docid": "b48359258e107ba5d9b77f06dd6d4689", "score": "0.5616386", "text": "function e(t,e,n,i){switch(n){case\"s\":return e?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return t+(e?\" секунд\":\" секундын\");case\"m\":case\"mm\":return t+(e?\" минут\":\" минутын\");case\"h\":case\"hh\":return t+(e?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return t+(e?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return t+(e?\" сар\":\" сарын\");case\"y\":case\"yy\":return t+(e?\" жил\":\" жилийн\");default:return t}}", "title": "" }, { "docid": "b48359258e107ba5d9b77f06dd6d4689", "score": "0.5616386", "text": "function e(t,e,n,i){switch(n){case\"s\":return e?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return t+(e?\" секунд\":\" секундын\");case\"m\":case\"mm\":return t+(e?\" минут\":\" минутын\");case\"h\":case\"hh\":return t+(e?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return t+(e?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return t+(e?\" сар\":\" сарын\");case\"y\":case\"yy\":return t+(e?\" жил\":\" жилийн\");default:return t}}", "title": "" }, { "docid": "b48359258e107ba5d9b77f06dd6d4689", "score": "0.5616386", "text": "function e(t,e,n,i){switch(n){case\"s\":return e?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return t+(e?\" секунд\":\" секундын\");case\"m\":case\"mm\":return t+(e?\" минут\":\" минутын\");case\"h\":case\"hh\":return t+(e?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return t+(e?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return t+(e?\" сар\":\" сарын\");case\"y\":case\"yy\":return t+(e?\" жил\":\" жилийн\");default:return t}}", "title": "" }, { "docid": "b48359258e107ba5d9b77f06dd6d4689", "score": "0.5616386", "text": "function e(t,e,n,i){switch(n){case\"s\":return e?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return t+(e?\" секунд\":\" секундын\");case\"m\":case\"mm\":return t+(e?\" минут\":\" минутын\");case\"h\":case\"hh\":return t+(e?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return t+(e?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return t+(e?\" сар\":\" сарын\");case\"y\":case\"yy\":return t+(e?\" жил\":\" жилийн\");default:return t}}", "title": "" }, { "docid": "2727e13a10cd98e74eb147eb9a7e11c3", "score": "0.5612803", "text": "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "2727e13a10cd98e74eb147eb9a7e11c3", "score": "0.5612803", "text": "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "2727e13a10cd98e74eb147eb9a7e11c3", "score": "0.5612803", "text": "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "2727e13a10cd98e74eb147eb9a7e11c3", "score": "0.5612803", "text": "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "2727e13a10cd98e74eb147eb9a7e11c3", "score": "0.5612803", "text": "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "2727e13a10cd98e74eb147eb9a7e11c3", "score": "0.5612803", "text": "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "2727e13a10cd98e74eb147eb9a7e11c3", "score": "0.5612803", "text": "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "2727e13a10cd98e74eb147eb9a7e11c3", "score": "0.5612803", "text": "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "2727e13a10cd98e74eb147eb9a7e11c3", "score": "0.5612803", "text": "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "2727e13a10cd98e74eb147eb9a7e11c3", "score": "0.5612803", "text": "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "2727e13a10cd98e74eb147eb9a7e11c3", "score": "0.5612803", "text": "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "2727e13a10cd98e74eb147eb9a7e11c3", "score": "0.5612803", "text": "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "2727e13a10cd98e74eb147eb9a7e11c3", "score": "0.5612803", "text": "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "2727e13a10cd98e74eb147eb9a7e11c3", "score": "0.5612803", "text": "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "2727e13a10cd98e74eb147eb9a7e11c3", "score": "0.5612803", "text": "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "c218ef4a8ea834f344f3de31e330c052", "score": "0.56043434", "text": "handleInteraction(e, event) {\n let show = new Phrase();\n if (e != 0) {\n let letter = e.target;\n show.checkLetter(letter.textContent, letter);\n } else {\n\n let buttons = document.getElementsByTagName('button')\n for (let i = 0; i < 27; i++) {\n if (buttons[i].textContent == event.key) {\n show.checkLetter(event.key, document.getElementsByTagName('button')[i])\n }\n }\n\n }\n\n }", "title": "" }, { "docid": "48a2f9306a15951710bfabc3839f4baa", "score": "0.5603494", "text": "function showChatFeatureHelp() {\n\tcreateModal('Chat Features');\n\tarr = {\n\t\t'/afk':'toggling your AFK (away from keyboard) status (<i>/afk</i>)',\n\t}\n\tbody.append('<br /><strong>Default CyTube Commands</strong><br /><br />');\n\tul = $('<ul />').appendTo(body);\n\tfor (cmd in arr) {\n\t\tul.append('<li><code>'+cmd+'</code> - '+arr[cmd]+'</li>');\n\t}\n\tarr = {\n\t\t'[m] text [/m]':'monospace text, e.g. <code>monospace</code>',\n\t\t'[b] text [/b]':'bold text, e.g. <strong>bold</strong>',\n\t\t'[u] text [/u]':'underline text, e.g. <span style=\"text-decoration: underline;\">underline</span>',\n '[i] text [/i]':'italics text, e.g. <em>italics</em>',\n '[st] text [/st]':'strikeout text, e.g. <s>strikeout</s>',\n '[sp] text [/sp]':'spoiler text, e.g. <span class=\"spoiler\">spoiler</span>',\n '/sp':'hiding a message in a hover-to-show spoiler box (e.g. <i>/sp This message is hidden</i>)',\n '/me':'showing an action-style message ([username] is dancing, e.g. <i>/me is dancing</i>)',\n '[TM]':'trade mark, e.g. â„¢',\n\t}\n\tbody.append('<br /><strong>Text Formatting Commands</strong><br /><br />');\n\tul = $('<ul />').appendTo(body);\n\tfor (cmd in arr) {\n\t\tul.append('<li><code>'+cmd+'</code> - '+arr[cmd]+'</li>');\n\t}\n arr = {\n\t\t'/happyfloof[##]':'Happy floofs, e.g. <i>/happyfloof05</i>',\n\t\t'/happyseal[##]':'Happy seals, e.g. <i>/happyseal02</i>',\n '/kiki[##]':'Kiki\\'s delivery gifs, e.g. <i>/kiki02</i>',\n '/fireelmo':'demon Elmo',\n '/soa':'seal of approval',\n\t}\n\tbody.append('<br /><strong>Bibtown Commands</strong><br /><br />');\n\tul = $('<ul />').appendTo(body);\n\tfor (cmd in arr) {\n\t\tul.append('<li><code>'+cmd+'</code> - '+arr[cmd]+'</li>');\n\t} \n}", "title": "" }, { "docid": "411215d8c9f58b2870c85dc87cd0559b", "score": "0.5587328", "text": "function t(n,t,e,i){switch(e){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return n+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return n+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return n+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return n+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return n+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return n+(t?\" жил\":\" жилийн\");default:return n}}", "title": "" }, { "docid": "880025685d0ba2c139ab57b7b91059a8", "score": "0.5581789", "text": "function t(e,t,n,o){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "9be561b87037fadc7b64d2da1937ef5d", "score": "0.5577897", "text": "function unKurabiye(){\r\n alert(\"Ingrediënten \\n- 1 paket Yağ \\n- 1 sb Pudra şekeri \\n- 1 çb Siviyağ \\n- 4 sb Un \\n- 1 sb Nişasta \\n- 1 paket Vanilya \\n- 1/2 paket Kabartmatozu\")\r\n}", "title": "" }, { "docid": "698e7fc94f18a9618d9ed187bbf3e665", "score": "0.55623496", "text": "function miski(){\n var text=\"asd\"; //lokaalne\n text=\"fgh\";//lokaalse yle vaartustamine\n num=100;//globaalse yle vaartustamine\n uus=true;//uus globaalmuutuja, aga ara pigem kasuta, \"strict modes\" ei toota\n}", "title": "" }, { "docid": "b49ae17fa706926807b5b1d99415050f", "score": "0.5559599", "text": "function giveContext(action) {\n\tif (typeof action == 'number') {\n\t\tcontextMessage.text = String.fromCharCode((96 <= action && action <= 105)? action-48 : action);\n\t} else {\n\t\tcontextMessage.text = action;\n\t}\n\tspeechSynthesis.speak(contextMessage);\n}", "title": "" }, { "docid": "4bcaaf4c9feeac7a37d0cc5d05665956", "score": "0.5558407", "text": "function e(t,e,n,a){switch(n){case\"s\":return e?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return t+(e?\" секунд\":\" секундын\");case\"m\":case\"mm\":return t+(e?\" минут\":\" минутын\");case\"h\":case\"hh\":return t+(e?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return t+(e?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return t+(e?\" сар\":\" сарын\");case\"y\":case\"yy\":return t+(e?\" жил\":\" жилийн\");default:return t}}", "title": "" }, { "docid": "4bcaaf4c9feeac7a37d0cc5d05665956", "score": "0.5558407", "text": "function e(t,e,n,a){switch(n){case\"s\":return e?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return t+(e?\" секунд\":\" секундын\");case\"m\":case\"mm\":return t+(e?\" минут\":\" минутын\");case\"h\":case\"hh\":return t+(e?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return t+(e?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return t+(e?\" сар\":\" сарын\");case\"y\":case\"yy\":return t+(e?\" жил\":\" жилийн\");default:return t}}", "title": "" }, { "docid": "08de752c1c7f697977d102d74892d98e", "score": "0.55504024", "text": "function showAllert(msg){\n let msgText = 'Your message = ' + msg; // a + b => ab , 5 + 6 => 11, 5 + a => 5a\n console.log( msgText );\n //alert( msgText );\n\n} // end of showAllert", "title": "" }, { "docid": "dd25744b2dbbdb5647f4d73d213b3aaa", "score": "0.5544019", "text": "function performAction(ninja, action = \"skulking\", message = ninja + \" \" + action){\n return message;\n}", "title": "" }, { "docid": "2320876605ad27a45c32e0cd1bb6adff", "score": "0.5540563", "text": "showAnswer(b, i){\r\n if(b){\r\n return this.state.words[this.state.selectedWords[i]][pos_eng] + \r\n \": \" + this.state.words[this.state.selectedWords[i]][pos_pin] + \r\n \": \" + this.state.words[this.state.selectedWords[i]][pos_chi];\r\n }\r\n return '';\r\n }", "title": "" }, { "docid": "0149b708aae1f6204f2d3edca1e4f497", "score": "0.55397266", "text": "function t(e,t,r,n){switch(r){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "0149b708aae1f6204f2d3edca1e4f497", "score": "0.55397266", "text": "function t(e,t,r,n){switch(r){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "0149b708aae1f6204f2d3edca1e4f497", "score": "0.55397266", "text": "function t(e,t,r,n){switch(r){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "0149b708aae1f6204f2d3edca1e4f497", "score": "0.55397266", "text": "function t(e,t,r,n){switch(r){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "0149b708aae1f6204f2d3edca1e4f497", "score": "0.55397266", "text": "function t(e,t,r,n){switch(r){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "a1246a8f736f5f423662a4c79fc6b762", "score": "0.5525168", "text": "function lesson1_1() {\n if(program == \"Echo\")\n {\n changeLevel();\n jqconsole.Write(command + error);\n return;\n }\n jqconsole.Write('\\x1b[31mJust try typing Echo\\x1b[0m\\n');\n }", "title": "" }, { "docid": "537c760852830c89f00505bd7cf8b4ae", "score": "0.55183685", "text": "function go() {\n return ':P';\n }", "title": "" }, { "docid": "4e48f8b5199ce39e8746eadc608dcb33", "score": "0.55113286", "text": "function fnGo(){\n\t\tvar tag = $('#kword').val();\n\t\t//fnInstagram(tag);\n\t\tfnThesaurus(tag);\n\t\t//fnRhymeWord(tag);\n\t\t//fnSeedWord();\n\t\t\n\n\t}", "title": "" }, { "docid": "5e3c19a4ed2511925560e7e386854726", "score": "0.5510298", "text": "function actionPath () {\n // bleach\n input = prompt('Great choice! What would you like to battle monsters with?\\n\\n[S]word\\n[A]rrows').toLowerCase()\n\n if (input === 's') {\n getSword()\n } else if (input === 'a') {\n getArrows()\n }\n}", "title": "" }, { "docid": "39949bdfb790f71a64ee222b8e94b52e", "score": "0.55080044", "text": "function lemmeSmash(charset) {\n let yeet = document.getElementById(\"yeet\");\n if (sfx.checked) yeet.play();\n hereElement.innerHTML = generateMessage();\n generateKeysmash(charset);\n}", "title": "" }, { "docid": "6f51bdca7bab834bebe21c3868b75a12", "score": "0.55028373", "text": "function t(e,t,i,s){switch(i){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" } ]
6c834caa93535688346b7d53f95d7d4e
function that filters the list view of the restaurants displayed on the navigation
[ { "docid": "a7d3ac3cec805bd579b186ae3949d380", "score": "0.0", "text": "filterFunction(value) {\n let matchesFilters = value.name.toUpperCase().match(this.state.query.toUpperCase());\n if(matchesFilters == null){\n return false\n }else{\n return true\n }\n }", "title": "" } ]
[ { "docid": "d7e14817a976bac997af5cc0cae4d18d", "score": "0.69812524", "text": "function filterRestaurants (){\n var searchRestaurant = $(\"#searcher\").val().toLowerCase();\n //determina si el valor ingresado es mayor a 0 y sin espacios\n if($(\"#searcher\").val().trim().length > 0) {\n //contacts es el array vacio y contact es el objeto armado de dos variables\n var filteredRestaurant = restaurants.filter(function(restaurants) {\n console.log(restaurants);\n return restaurants.name.toLowerCase().indexOf(searchRestaurant) >= 0;\n });\n $(\"#restaurant-card\").empty();\n filteredRestaurants.forEach(function(restaurants){\n paintContactsInHtml(restaurants);\n });\n }\n }", "title": "" }, { "docid": "348b7feb3edae64a3410644d4ce64dea", "score": "0.67311317", "text": "function renderRestaurantList() {\n let filteredList = restaurantList.filter((restaurant) =>\n restaurant.name.toLowerCase().includes(searchText.toLowerCase())\n );\n if (fakeLoading) {\n setTimeout(() => {\n setFakeLoading(false);\n }, 500); // 0.5 second\n return (\n <Spinner animation=\"border\" role=\"status\">\n <span className=\"sr-only\">Loading...</span>\n </Spinner>\n );\n } else {\n return filteredList.map((restaurant, index) => (\n <RestaurantItem\n key={index}\n restaurant={restaurant}\n setRestaurantId={props.setRestaurantId}\n />\n ));\n }\n }", "title": "" }, { "docid": "4c0ac52b88bc7b6973dd4e27adfede20", "score": "0.664097", "text": "function handleFilter(){\n console.log('calling handleFilter function');\n //Clear list of restaurants on page\n clearRestaurantList();\n selectedRestrictions = [];\n\n //For each checkbox that is selected, store it's id in the\n //selectedRestrictions array.\n $(\".checkbox:checked\").each(function(index, checkbox) {\n selectedRestrictions.push(removeHyphen(checkbox.id));\n });\n\n console.log(\"selectedRestrictions\",selectedRestrictions);\n\n //Check what elements are hidden/unhidden\n if($('.restaurant-list').hasClass('hide')){\n $('.restaurant-list').removeClass('hide');\n };\n if($('.restaurant-list ul').hasClass('hide')){\n $('.restaurant-list ul').removeClass('hide');\n };\n if($('.restaurant-list .map-container').hasClass('hide') === false){\n $('.restaurant-list .map-container').addClass('hide');\n };\n if($('.restaurant-info-container').hasClass('hide') === false){\n $('.restaurant-info-container').addClass('hide');\n };\n if($('.map-view-button').hasClass('hide') === true){\n $('.map-view-button').removeClass('hide');\n };\n if($('.list-view-button').hasClass('hide') === false){\n $('.list-view-button').addClass('hide');\n };\n if($('.back-button').hasClass('hide') === false){\n $('.back-button').addClass('hide');\n };\n if (selectedRestrictions.length === 0) {\n $('.map-view-button').addClass('hide');\n }\n\n //Iterate through the restaurants array of objects\n //Get array of tags\n //Compare tags to selected restrictions\n //Store restaurant in restFilter variable\n restFilter = restaurants.filter(function (restaurant) {\n //Need to return true statement to have filter pull out object.\n // console.log(\"Restaurant Object:\",restaurant);\n // console.log(\"Restaurant name:\",restaurant.name);\n\n //restMenuItems will hold array menu items for each restaurant.\n let restMenuItems = restaurant.menuItems; //Array of Objects\n // console.log(\"Restaurant Menu Items:\",restMenuItems);\n\n //restMenuItemsTags variable will hold menu items tags for each menu item.\n //This will be compared to the selected user restrictions.\n let restMenuItemsTags = [];\n\n //Results array will hold result of comparison of each menu item tag to\n //the user selected diet restrictions.\n let results = [];\n\n //Iterate through the menu items for each restaurant.\n $.each(restaurant.menuItems, function(index, menuItem){\n // console.log(`Menu Item ${index} Tags:`,menuItem.tags);\n //Iterate through the tags for each menu item.\n $.each(menuItem.tags,function(index2,tag){\n // console.log(`Menu Item ${index} Tag:`, tag);\n //Store each menu item tag in restMenuItemsTags array.\n restMenuItemsTags.push(tag);\n });\n });\n // console.log(\"restMenuItemsTags\",restMenuItemsTags);\n\n //Compare selectedRestrictions to the restaurant menu item tags.\n //Will store true or false if tag matches user diet restriction selection.\n $.each(selectedRestrictions, function(index,value){\n // console.log(`${value} inArray() result: `, $.inArray(value,restMenuItemsTags)!== -1);\n results.push($.inArray(value,restMenuItemsTags)!== -1);\n });\n // console.log(\"Restaurant Menu Item Tags: \",restMenuItemsTags);\n // console.log(\"In array:\", $.inArray(true,results) !== -1 );\n\n //Check if there is a true in the results array. If so, then user diet\n //restriction was found.\n return $.inArray(true,results) !== -1;\n });\n console.log(\"restFilter\",restFilter);\n\n //Display restFilter array to screen\n displayRestaurantNames(restFilter);\n\n //Listen for a click on one of the links for each restaurant listed.\n $(\"a\").click(handleRestaurantLink);\n $(\".map-view-button\").click(handleMapView);\n\n }", "title": "" }, { "docid": "04345418d37376c90e29f1e26bc3d292", "score": "0.66043496", "text": "function showHotelAllLocationFilters()\n{\n var filter = $(\"#searchBy\");\n var locationFilter = filter.find(\".location li\");\n var locationFilterMore = filter.find(\".location a.more\");\n\n locationFilterMore.hide();\n locationFilter.each(function()\n {\n $(this).show();\n });\n}", "title": "" }, { "docid": "35c95b76404afc1305e40b0ff2da5e57", "score": "0.6600317", "text": "function filterRating() {\r\n\r\n // Filter Restaurant by its rating\r\n var ratingRange = getRatingValues();\r\n\r\n var filteredByRating = [];\r\n\r\n restaurantData.forEach(function (restaurant) {\r\n\r\n var restaurantRating = restaurant.restaurant.user_rating.aggregate_rating;\r\n\r\n if (restaurantRating >= ratingRange[0] && restaurantRating <= ratingRange[1]) {\r\n filteredByRating.push(restaurant);\r\n }\r\n });\r\n document.getElementById('restaurant-list').innerHTML = getRestaurantList(filteredByRating);\r\n // return filteredByRating;\r\n}", "title": "" }, { "docid": "2b330488c93f583dd31ea9c0456f7a68", "score": "0.6534678", "text": "function filterView() {\n\tif (filter == \"all\") {\n\t\t$(\"#entryList div.panel\").removeClass(\"hidden\");\n\t}else {\n\t\t$(\"#entryList div.panel\").addClass(\"hidden\");\n if (filter == \"starred\") $(\"#entryList input[value='starred']\").parent().parent().removeClass(\"hidden\");\n\t\telse $(\"#entryList input[value='\" + filter + \"']\").parent().parent().parent().removeClass(\"hidden\");\n\t\tif (filter == \"unread\") $(\"#entryList input[value='new']\").parent().parent().parent().removeClass(\"hidden\");\n\t\t$(\"#entryList #more\").removeClass(\"hidden\");\n\t\t$(\"#entryList #last\").removeClass(\"hidden\");\n }\n \t// set first visible entry to be activea\n makeFirstEntryActive();\n\t\n}", "title": "" }, { "docid": "24d87b7ebe8d2b4ccc4b64b80fa7aba9", "score": "0.65240246", "text": "function filterAndListLocations() {\n // grab the text from the dom, grab in the view\n var text = self.filterSearchText().toLowerCase();\n var filteredAreas = [];\n var filteredMarkers = [];\n\n // for loop to match or not?\n for (var i = 0; i < View.markers.length; ++i) {\n if (View.markers[i].locationData.title.toLowerCase().includes(text)) {\n filteredAreas.push(View.markers[i].locationData);\n filteredMarkers.push(View.markers[i]);\n }\n }\n\n // hide first\n View.hideMarkers(View.markers);\n\n // show the filtered ones\n View.showMarkers(filteredMarkers);\n\n // filter areas\n self.locationsList(filteredAreas);\n }", "title": "" }, { "docid": "e5e13b84683cb4d5a74217965c055626", "score": "0.6429609", "text": "filteredTodos() {\n return filters[this.visibility](this.todos);\n }", "title": "" }, { "docid": "0f8104b63f728bff8f089a47772e22c0", "score": "0.6408452", "text": "function filterNoteList(){ // Separate function to be able to add more filter options, such as search or tags\n\tfilterFav();\n}", "title": "" }, { "docid": "90ff85f4b20537d4d13ea076d7705712", "score": "0.63795775", "text": "filteringFunc() {\n\t\tconst listData = _.filter(this.state.sortedList, (item) => {\n\t\t\tif (this.state.filterTerm === 'all') {\n\t\t\t\treturn item\n\t\t\t}\n\t\t\telse if (item.type === this.state.filterTerm) {\n\t\t\t\treturn item\n\t\t\t}\n\t\t})\n\t\tthis.setState({\n\t\t\tdisplayData: listData,\n\t\t\tactiveIndex: -1,\n\t\t\tterm: this.state.tempTerm\n\t\t})\n\t}", "title": "" }, { "docid": "8e7099138b5d22de3e5884f5122c005f", "score": "0.6269186", "text": "function setHotelFilter()\n{\n var filter = $(\"#searchBy\");\n var starRatingFilter = \"\";\n var starRatingFilterCheckbox = filter.find(\".starRating input:checked\");\n var locationFilter = new Array();\n var locationFilterCheckbox = filter.find(\".location input:checked\");\n var nameFilter = jQuery.trim(filter.find(\".hotel input:text\").val()).toLowerCase();\n var hotel = $(\"#listing > li\");\n var filteredResults = 0;\n var noResultsMessage = $(\"#noResultsMessage\");\n\n delete filter.lastFilterTimeoutID;\n\n //Prepare and optimize filters\n starRatingFilterCheckbox.each(function()\n {\n starRatingFilter += this.value;\n });\n locationFilterCheckbox.each(function()\n {\n locationFilter.push(this.value);\n });\n \n //Filter results\n hotel.each(function()\n {\n var matched = true;\n if (starRatingFilter.length > 0)\n matched = matched && (starRatingFilter.indexOf(this.starRating) > -1);\n if (locationFilter.length > 0)\n {\n var matchedLocation = false;\n for (var i in locationFilter)\n matchedLocation = matchedLocation || (this.location.indexOf(locationFilter[i]) > -1);\n matched = matched && matchedLocation;\n }\n if (nameFilter.length > 0)\n matched = matched && (this.name.indexOf(nameFilter) > -1);\n if (matched)\n {\n $(this).show();\n filteredResults++;\n }\n else\n {\n $(this).hide();\n }\n });\n\n //Display message if no results\n if (filteredResults > 0)\n noResultsMessage.addClass(\"invisible\");\n else\n noResultsMessage.removeClass(\"invisible\");\n}", "title": "" }, { "docid": "945c498bb7d4024eefbb3dffdc70d351", "score": "0.6225313", "text": "filteredList() {\n \n return this.list.filter(list => {\n return (this.search) ? list.name.toLowerCase().includes(this.search.toLowerCase()) : list;\n\n }).slice(this.skip, this.skip + this.limit) //limits the amount of filtered items on the page\n }", "title": "" }, { "docid": "1908dfc992511fe2ea64421551a3530d", "score": "0.62228113", "text": "function filterGeneral () {\n \t\tjq('#mainList').DataTable().search(\n \t\tjq('#mainList_filter').val()\n \t\t).draw();\n }", "title": "" }, { "docid": "025f748f4d8bbc48a219b59b88a15fcd", "score": "0.61777", "text": "function listInitFilters(){\n $(\".client-filter\").click(function() {\n var filter = this.id;\n $(\".data\").hide();\n if(filter == \"ALL\"){\n $(\".data\").show();\n }\n else {\n $(\".\"+filter.toLowerCase()).show();\n }\n });\n }", "title": "" }, { "docid": "a5e9310e76441ed2e11dff3428234d9a", "score": "0.61580026", "text": "function listInitFilters(){\n $(\".supplier-filter\").click(function() {\n var filter = this.id;\n $(\".data\").hide();\n if(filter == \"ALL\"){\n $(\".data\").show();\n }\n else {\n $(\".\"+filter.toLowerCase()).show();\n }\n });\n }", "title": "" }, { "docid": "43e4157d35e6abcb4436cc8092d25193", "score": "0.6157088", "text": "function TestDiscover(props) {\n const [filteredShows, setFilteredShows] = useState([]);\n const [shows, setShows] = useState([]);\n const [search, setSearch] = useState(\"\");\n\n useEffect(() => {\n loadShows();\n }, []);\n\n const loadShows = async () => {\n // const response = await fetch(showApi.getShows());\n const response = await fetch(\"https://www.episodate.com/api/search?q=\");\n if (!response.ok) {\n console.log(response.problem);\n }\n const json = await response.json();\n setShows(json.tv_shows);\n setFilteredShows(json.tv_shows);\n console.log(shows);\n };\n\n const searchFilter = (text) => {\n if (text) {\n //this is where the issue is... I need to figure out how to do a filter with a flatlist\n const newData = shows.filter((item) => {\n const itemData = item.name ? item.name.toUpperCase() : data;\n const textData = text.toUpperCase();\n return itemData.indexOf(textData) > -1;\n });\n setFilteredShows(newData);\n setSearch(text);\n console.log(\"filter:\" + filteredShows);\n console.log(\"search\" + search);\n console.log(\"text:\" + text);\n console.log(\"newData: \" + newData);\n // console.log(\"itemData:\" + itemData);\n // console.log(\"textData:\" + textData);\n } else {\n setFilteredShows(shows);\n setSearch(text);\n }\n };\n\n const numColumns = 4;\n\n return (\n <View>\n {/* <AppTextInput\n autoCapitalize=\"none\"\n autoCorrect={false}\n icon=\"magnify\"\n value={search}\n returnKeyType=\"search\"\n onChangeText={(text) => searchFilter(text)}\n placeholder=\"Search\"\n /> */}\n <TextInput\n value={search}\n placeholder=\"Search\"\n onChangeText={(text) => searchFilter(text)}\n />\n <FlatList\n data={shows}\n numColumns={numColumns}\n keyExtractor={(item) => item.id.toString()}\n // renderItem={({ item }) => <Text>{item.name}</Text>}\n renderItem={({ item }) => (\n // <Thumbail\n // title={item.name}\n // imageURL={item.image_thumbnail_path}\n // id={item.id}\n // />\n <ShowPreview\n title={item.name}\n desc={item.network}\n imageURL={item.image_thumbnail_path}\n id={item.id}\n />\n )}\n ></FlatList>\n </View>\n );\n}", "title": "" }, { "docid": "25c118a1beef4aada83950c4853167ce", "score": "0.60934323", "text": "function filterArticles(liste) {\n // hier fehlt noch die richtige Filterfunktion\n renderHtml(liste);\n}", "title": "" }, { "docid": "847bc45cd68d9ff0fec6c8b4a260be5a", "score": "0.60372835", "text": "filteredList() {\n //on récupère les éléments filtrés\n return this.products.filter((product) => {\n return product.description\n .toLowerCase()\n .includes(this.searchKey.toLowerCase());\n });\n }", "title": "" }, { "docid": "42aaa788bd9fe6d64c2bbb007d9ddf26", "score": "0.6029836", "text": "function getRestaurants(){\n return restaurants;\n}", "title": "" }, { "docid": "197323d892abc2c106f1bebd325dd6dc", "score": "0.60266113", "text": "function getRestaurantsList(){\n\tif(location_to_search.value === \"\"){\n\t\twindow.alert(\"Please enter a location\");\n\t} else {\n\t\tconsole.log(location_to_search.value);\n\t\t$.ajax({\n\t\t\ttype:'GET',\n\t\t\turl: YELP_API_URL,\n\t\t\tdatatype: 'json',\n\t\t\tdata: {\n\t\t\t\tterm: 'food',\n\t\t\t\tlocation: location_to_search.value\n\t\t\t},\n\t\t\theaders: {'authorization': 'Bearer ' + YELP_API_KEY},\n\t\t\tsuccess:\n\t\t\t\tfunction(data){\n\t // similar to enumerate in python\n\t \tconsole.log(\"received data\");\n\t // $.each(data,function(i,item){\n\t // $('<li>')\n\t // .text(item.name)\n\t // .appendTo('.location_list')\n\t // console.log(item.name)\n\t // })\n\t \t}\n\t\t});\n\t}\n}", "title": "" }, { "docid": "d8c56f0bb8552dcba610ff916b1f8cc3", "score": "0.60102135", "text": "function filterMethod() {\n\t\t\tvar localFilteredResults = [];\n\t\t\tif($rootScope.filteredDiseases && $rootScope.filteredDiseases.length > 0) {\n\t\t\t\tfor(var key in vm.results) {\n\t\t\t\t\tif($rootScope.filteredDiseases.indexOf(vm.results[key].term) > -1) {\n\t\t\t\t\t\tlocalFilteredResults.push(vm.results[key]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvm.filteredResults = localFilteredResults;\n\t\t\t} else if (($rootScope.selectedGenesModel !== undefined) && (($rootScope.selectedGenesModel.length > 0) || \n\t\t\t\t\t($rootScope.selectedPhenoTypesAndDiseasesModel !== undefined) && ($rootScope.selectedPhenoTypesAndDiseasesModel.length > 0))) {\n\t\t\t\t// user chose filter combination that left us with no diseases on the grid\n\t\t\t\tvm.filteredResults = localFilteredResults;\n\t\t\t} else {\n\t\t\t\tvm.filteredResults = vm.results;\n\t\t\t}\n\t\t\t$scope.$parent.$parent.tab.count = vm.filteredResults.length;\n\t\t}", "title": "" }, { "docid": "c98566202457316e8398ed2496ef2600", "score": "0.600261", "text": "function FilteredList() {\n if (!Self.Filter()) return Self.List();\n return Self.List().filter(function(V) { \n return V.Title.toLowerCase().indexOf(Self.Filter().toLowerCase()) > -1; \n });\n }", "title": "" }, { "docid": "9b2d9b5eb26729e0e5001999bce6850b", "score": "0.6000969", "text": "function FilterListUtil() {}", "title": "" }, { "docid": "a7b98e86cea21e55e7fc4174de9b52fd", "score": "0.5986145", "text": "viewTodos(filter) {\n console.log('View Todo');\n console.log(todoList);\n }", "title": "" }, { "docid": "7a0e9c4affe0f3288edd1bd2f552381b", "score": "0.5951645", "text": "filterFood(query) {\n let f = this.state.venueInfo.filter(loadVenueInfo => loadVenueInfo.venue.name.toLowerCase().includes(query.toLowerCase()))\n console.log(this.state)\n // showing or hiding map markers and list items depending on what's being searched\n this.state.venuePins.forEach(locationMarker => {\n console.log(locationMarker);\n locationMarker.name.toLowerCase().includes(query.toLowerCase()) === true ?\n locationMarker.setVisible(true) :\n locationMarker.setVisible(false)\n });\n\n if (f.length === 0) {\n this.state.venuePopup.close();\n }\n\n this.setState({ filterFood: f, query });\n\n }", "title": "" }, { "docid": "a03e26f966fb1b74b10a272627e90770", "score": "0.59383965", "text": "function filterRecipes(filterBy) {\r\n // If user is filtering by country, show that country name\r\n let regionName = document.getElementById(\"regionName\");\r\n regionName.innerHTML = \"Or Filter recipes by country : \";\r\n if (filterBy !== \"input\" && filterBy !== \"All\")\r\n regionName.innerHTML += filterBy;\r\n if (filterBy)\r\n filterBy = filterBy.toLowerCase();\r\n // incase user types in the search input, we need to show only those\r\n if (filterBy === \"input\")\r\n filterBy = \"all\"; // this variable searches for countries\r\n let showing = 0;\r\n let recipeNameToBeSearched = document.getElementById(\"searchInput\").value;\r\n if (recipeNameToBeSearched)\r\n recipeNameToBeSearched = recipeNameToBeSearched.toLowerCase();\r\n for (let recipe of recipesDiv) {\r\n let text = recipe.childNodes[0].childNodes[3].childNodes[1].innerHTML; // get the recipe name\r\n text = text.toLowerCase();\r\n // if recipename matches input filter(atleast \"\") & region filter(atleast \"all\"), display it\r\n if (text.indexOf(recipeNameToBeSearched) >= 0 || recipeNameToBeSearched === \"\") {\r\n if (recipe.classList[1].toLowerCase() === filterBy || filterBy === \"all\") {\r\n recipe.style.display = \"block\";\r\n showing++;\r\n }\r\n else\r\n recipe.style.display = \"none\";\r\n }\r\n else\r\n recipe.style.display = \"none\";\r\n }\r\n // if there are no recipes matching the filter, display the noRecipesDiv\r\n let noRecipesDiv = document.getElementById(\"noRecipes\");\r\n if (showing == 0)\r\n noRecipesDiv.style.display = \"block\";\r\n else\r\n noRecipesDiv.style.display = \"none\";\r\n}", "title": "" }, { "docid": "a219d9aaff3d275fd6f438f94fd3e357", "score": "0.593655", "text": "populateList () {\n if (!this.items) return\n\n let filterQuery = this.getFilterQuery()\n let filteredItems = this.items\n if (filterQuery.length) {\n if (!fuzzyFilter) fuzzyFilter = require('fuzzaldrin-plus').filter\n filteredItems = fuzzyFilter(this.items, filterQuery, {key: this.getFilterKey()})\n }\n\n this.list.empty()\n if (filteredItems.length) {\n this.setError(null)\n\n filteredItems = filteredItems.slice(0, this.maxItems)\n for (let item of filteredItems) {\n let itemView = $(this.viewForItem(item))\n itemView.data('select-list-item', item)\n this.list.append(itemView)\n }\n\n this.selectItemView(this.list.find('li:first'))\n } else {\n this.setError(this.getEmptyMessage(this.items.length))\n }\n }", "title": "" }, { "docid": "6cb25ab2d25705384096a7dc9f1daed1", "score": "0.59234667", "text": "static fetchRestaurantByCuisineAndNeighborhood(cuisine,neighborhood,callback){// Fetch all restaurants\nDBHelper.fetchRestaurants((error,restaurants)=>{if(error){callback(error,null);}else{let results=restaurants;if(cuisine!='all'){// filter by cuisine\nresults=results.filter(r=>r.cuisine_type==cuisine);}if(neighborhood!='all'){// filter by neighborhood\nresults=results.filter(r=>r.neighborhood==neighborhood);}callback(null,results);}});}", "title": "" }, { "docid": "90e596fe1825162c29f17522f3efad40", "score": "0.59216744", "text": "function filterCustomerList (){\n jq('#customerList').DataTable().search(\n \t\tjq('#customerList_filter').val()\n ).draw();\n }", "title": "" }, { "docid": "64248c7216225953d7f541975e8a1cb0", "score": "0.5905221", "text": "function getrestaurants() {\n $.get(\"/api/restaurants\", function(data) {\n var rowsToAdd = [];\n for (var i = 0; i < data.length; i++) {\n rowsToAdd.push(createrestaurantRow(data[i]));\n }\n renderrestaurantList(rowsToAdd);\n nameInput.val(\"\");\n\n });\n }", "title": "" }, { "docid": "e6393ee8c50d501521b5598191a3bcef", "score": "0.5880164", "text": "filteredList() { \r\n var userSearch = this.search.toLowerCase(); //variabile che salva i dati input trasformati \r\n\r\n //condizioni if + else per cercare i dati trasformati \r\n this.contacts.forEach((user, i) => { \r\n if(user.name.toLowerCase().includes(userSearch)) { \r\n user.visible = true; \r\n } else { \r\n user.visible = false; \r\n } \r\n }); \r\n }", "title": "" }, { "docid": "92529ca7d3a9c563c8414271b5b107d8", "score": "0.58784336", "text": "function filteredListFunction(filteredList) {\n if (settings.filter === \"gryffindor\") {\n filteredList = studentData.filter(isGryffindor);\n\n } else if (settings.filter === \"hufflepuff\") {\n filteredList = studentData.filter(isHufflepuff);\n\n } else if (settings.filter === \"ravenclaw\") {\n filteredList = studentData.filter(isRavenclaw);\n\n } else if (settings.filter === \"slytherin\") {\n filteredList = studentData.filter(isSlytherin);\n }\n return filteredList;\n}", "title": "" }, { "docid": "46413958fc9af931d533b9259fe9e480", "score": "0.5877053", "text": "function _filterItems() {\n $scope.$watch('filteredItems', function () {\n _navigateStart();\n }, true);\n }", "title": "" }, { "docid": "5f9f343de6127ef4519b7b4e981be2b1", "score": "0.5873413", "text": "function handleNewSearch() {\n clearRestaurantList();\n clearMenuItems();\n clearCarouselImages();\n //Reset checkboxes for filters\n $('input:checkbox').removeAttr('checked');\n\n //Reset variables\n selectedRestrictions = [];\n restFilter = [];\n\n //Unhide restaurant list on page\n $(\".restaurant-list\").removeClass(\"hide\");\n $(\".restaurant-list ul\").removeClass(\"hide\");\n\n //Hide restaurant info, map view button, back button & map2\n $(\".restaurant-info-container\").addClass(\"hide\");\n $(\".back-button\").addClass(\"hide\");\n $(\".map-view-button\").addClass(\"hide\");\n $(\".restaurant-list .map-container\").addClass(\"hide\");\n }", "title": "" }, { "docid": "52011def40a170ed93ad093f92f2435c", "score": "0.5868488", "text": "function applyFilter() {\n var filters = [];\n $('#sidebar .tree-filter option:selected').each(function(){\n filters.push($(this).val());\n });\n $('#sidebar .nav li').each(function(){\n var path = $(this).data('path');\n var valid = true;\n if(filters.length > 0){\n valid = false;\n for(var i = 0; i < filters.length; ++i){\n if(path.indexOf(filters[i]) == 0){\n valid = true;\n break;\n }\n }\n }\n if(valid) $(this).show();\n else $(this).hide();\n });\n}", "title": "" }, { "docid": "9a1f6b0c7bba7b119b8df83d993b704b", "score": "0.5847747", "text": "resetList() {\n this.filteredMasjids(this.fullMasjids.filter(masjid => {\n let name = masjid.name().toLowerCase();\n let search = this.searchMasjid().toLowerCase();\n if (name.includes(search)) {\n masjid.showOnMap(this.map);\n return true;\n } else {\n masjid.showOnMap(null);\n return false;\n }\n }));\n }", "title": "" }, { "docid": "6ecb387f6c5005b3714370955499d4a5", "score": "0.58441186", "text": "filterList(movieList, type) {\n if (type === 'highest_rating') {\n // Return list ordered on highest rating to lowest rating\n movieList.results.sort(function(a, b) {\n return b.vote_average - a.vote_average;\n });\n } else if (type === 'higher_rating') {\n // Return list filtered items that have an higher rating than 5.5\n movieList.results = movieList.results.filter(function(movie) {\n return movie.vote_average > 5.5;\n });\n } else if (type === 'most_votes') {\n // Return list ordered on most votest to least votes\n movieList.results.sort(function(a, b) {\n return b.vote_count - a.vote_count;\n });\n } else if (type === 'most_popular') {\n // Return list ordered on most popular movies to least popular movies.\n movieList.results.sort(function(a, b) {\n return b.popularity.toFixed(1) - a.popularity.toFixed(1);\n });\n }\n movieData.cleanList(movieList)\n }", "title": "" }, { "docid": "132882825b61120cfa7cc810a2ed97ac", "score": "0.5838486", "text": "function filterGlobal () {\n jq('#mainList').dataTable().search(\n \tjq('#mainList_filter').val()\n ).draw();\n }", "title": "" }, { "docid": "132882825b61120cfa7cc810a2ed97ac", "score": "0.5838486", "text": "function filterGlobal () {\n jq('#mainList').dataTable().search(\n \tjq('#mainList_filter').val()\n ).draw();\n }", "title": "" }, { "docid": "132882825b61120cfa7cc810a2ed97ac", "score": "0.5838486", "text": "function filterGlobal () {\n jq('#mainList').dataTable().search(\n \tjq('#mainList_filter').val()\n ).draw();\n }", "title": "" }, { "docid": "1e542c674553603cb382a96bbe7135d2", "score": "0.58341473", "text": "function applyFilter(currentType) {\n $(\".dishes\").empty();\n restGet(TEXT_HOST + '/dishes/query/?shopId=' + restaurantId, GET_METHOD,\n function(data) {\n $.each(data, function(i, dish) {\n if (currentType == \"All\" || dish.type == currentType) {\n appendDish(dish);\n }\n });\n }, '.dishes');\n}", "title": "" }, { "docid": "da770676285f1436ad404f2c764dcb92", "score": "0.583393", "text": "buildFilterList() {\n\t\tif (this.state.loading == true) return <Loading />;\n\t\telse {\n\n\t\t\treturn (\n\n\t\t\t\t<ScrollView scrollEventThrottle={16}>\n\t\t\t\t\t<View style={{flexDirection: 'row', flex: 1, marginTop: 15, marginHorizontal: 10}}>\n\t\t\t\t\t\t\t<Text style={{ flex: 1, textAlign: 'center', fontSize: 15, fontFamily: 'run' }}>Categoria</Text>\n\t\t\t\t\t\t\t<Text style={{ flex: 1, textAlign: 'center', fontSize: 15, fontFamily: 'run' }}>Cor</Text>\n\t\t\t\t\t\t\t<Text style={{ flex: 1, textAlign: 'center', fontSize: 15, fontFamily: 'run' }}>Tamanho</Text>\n\t\t\t\t\t\t\t<Text style={{ flex: 1, textAlign: 'center', fontSize: 15, fontFamily: 'run' }}>Min.</Text>\n\t\t\t\t\t\t\t<Text style={{ flex: 1, textAlign: 'center', fontSize: 15, fontFamily: 'run' }}>Max.</Text>\n\t\t\t\t\t\t\t<Text style={{ flex: 1, textAlign: 'center', fontSize: 15, fontFamily: 'run' }}></Text>\n\t\t\t\t\t</View>\n\t\t\t\t\t<View style={[styles.containerStyle]}>\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t<FlatList\n\t\t\t\t\t\t\tdata={this.state.filters}\n\t\t\t\t\t\t\tkeyExtractor={(item, index) => item.id.toString()}\n\t\t\t\t\t\t\tstyle={styles.list}\n\t\t\t\t\t\t\trenderItem={({ item, index }) => {\n\t\t\t\t\t\t\t\treturn this.buildSingleFilter(item, index);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</View>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tshadowless\n\t\t\t\t\t\tcolor=\"#3498DB\"\n\t\t\t\t\t\tstyle={[styles.button, styles.shadow]}\n\t\t\t\t\t\tonPress={() => this.props.navigation.navigate('Wanted')}>\n\t\t\t\t\t\tProcurar\n\t\t\t\t\t</Button>\n\t\t\t\t</ScrollView>\n\t\t\t);\n\t\t}\n\t}", "title": "" }, { "docid": "3af8d1775488c2b2c153638e92ef882a", "score": "0.5821895", "text": "function filterList() {\n let list = document.getElementById(\"list\").children;\n let searchValue = document.getElementById(\"search\").value.toLowerCase();\n for (let i = 0; i < list.length; i++) {\n if (!list[i].innerText.toLowerCase().includes(searchValue)) {\n list[i].classList.add(\"hidden\");\n } else {\n list[i].classList.remove(\"hidden\");\n }\n }\n }", "title": "" }, { "docid": "506b2b07afcf788cc61407d4f1a3ec3c", "score": "0.58098036", "text": "function filterPlaces() {\n if ($(\"#searcher\").val().trim().length > 0){\n var searchedPlaces = $('#search'). val().toLowerCase();\n var filteredPlace = places.filter (function(item) {\n return item.name.toLowerCase().indexOf(searchedPlaces) >= 0;\n })\n showPlaces (filteredPlace);\n}else {\n$ (\"#places-list\").empty ();\n showPlaces(places);\n}\n}", "title": "" }, { "docid": "ac03c0c509b06064db076bccffaefcba", "score": "0.5803654", "text": "function getRestaurants() {\n\tvar restaurants = [\n\t\t{\n\t\t\t'id':3,\n\t\t\t'name':'Sage Cafe',\n\t\t\t'location':\n\t\t\t\t{\n\t\t\t\t\t'latitude' : 37.778023,\n\t\t\t\t\t'longitude': -122.422500\n\t\t\t\t}\n\t\t},\n\t\t{\n\t\t\t'id':1,\n\t\t\t'name':'Cafe 50',\n\t\t\t'location':\n\t\t\t\t{\n\t\t\t\t\t'latitude' : 47.646973,\n\t\t\t\t\t'longitude': -122.133147\n\t\t\t\t}\n\t\t},\n\t\t{\n\t\t\t'id':2,\n\t\t\t'name':'Zuni Cafe',\n\t\t\t'location':\n\t\t\t\t{\n\t\t\t\t\t'latitude' : 37.773372,\n\t\t\t\t\t'longitude': -122.421663\n\t\t\t\t}\n\t\t}\n\t]\n\n\treturn restaurants;\n}", "title": "" }, { "docid": "9762ffe013b2e92280b112ca7ca78766", "score": "0.58015805", "text": "function filter_view()\n {\n $('.displayTable tbody tr').each(function(i, row) {\n if ((view.unconnectedVisible || is_connected(this)) && filter_match(this))\n $(this).removeClass('invisible');\n else\n $(this).addClass('invisible');\n });\n\n update_arrows();\n $(leftTable.table).trigger('update');\n $(rightTable.table).trigger('update');\n\n rightTable.set_status();\n leftTable.set_status();\n\n update_row_heights();\n }", "title": "" }, { "docid": "8f3166d857eb09a8c4581924830e56a8", "score": "0.57953066", "text": "filterUsersList() {\n\t\tconst { list } = this.props;\n\t\tconst { filter } = this.state;\n\n\t\treturn () => {\n\t\t\tif (!filter) {\n\t\t\t\treturn list;\n\t\t\t}\n\n\t\t\treturn list.filter(item => {\n\t\t\t\tconst fullName = `${item.name} ${item.last_name}`;\n\n\t\t\t\treturn fullName\n\t\t\t\t\t.toLowerCase()\n\t\t\t\t\t.includes(filter.toLowerCase());\n\t\t\t});\n\t\t};\n\t}", "title": "" }, { "docid": "1dbd63328457fa8eea9260d22ea2fda0", "score": "0.5793341", "text": "filteredUsersList() {\n\n return this.usersList.filter((element) => {\n // return element.name.toLowerCase().includes(this.search.toLowerCase());\n return element.name.toLowerCase().startsWith(this.search.toLowerCase());\n });\n }", "title": "" }, { "docid": "810fb0c222746371cb9db18f210b27a4", "score": "0.57918954", "text": "function displayFilters(tx, results) {\n\tsessionStorage.CurrentWhereQuery=\"\";\n\tvar andVar=\"\";\n\tvar len = results.rows.length;\n\t//alert(\"displayfilters firing... results.row.length:\"+len);\n\tjQuery(\"#filterList > li\").remove();\n\tfor (var i=0; i<len; i++) {\n\tvar filterResults = results.rows.item(i);\n\tif (filterResults.Descr1.indexOf(\"State\")!== -1) { // sets: sessionStorage.filterDeleteRow='+filterResults.rowid+1000 \n\t\t$('#filterList').append('<li data-icon=\"delete-red\"><a href=\"#search-advanced\" class=\"filterDelete\" onClick=\"sessionStorage.filterDeleteRow='+(filterResults.rowid+1000)+'\"><p><strong>'+ filterResults.Descr1 +' </strong> '+ filterResults.Descr2 +'</p><p>'+ filterResults.Descr3 +' <strong>'+unescape(filterResults.Descr4) +'</strong> '+ filterResults.Num +'</p></a></li>');\n\t}\n\telse {\n\t\t$('#filterList').append('<li data-icon=\"delete-red\"><a href=\"#search-advanced\" class=\"filterDelete\" onClick=\"sessionStorage.filterDeleteRow='+filterResults.rowid+'\" ><p><strong>'+ filterResults.Descr1 +' </strong> '+ filterResults.Descr2 +'</p><p>'+ filterResults.Descr3 +' <strong>'+unescape(filterResults.Descr4) +'</strong> '+ filterResults.Num +'</p></a></li>');\t\t\n\t}\n\tif (i==0) {\n\t\tandVar=\" WHERE \"}\n\telse {\n\t\tandVar=\" AND \"\n\t}\n\tsessionStorage.CurrentWhereQuery= sessionStorage.CurrentWhereQuery + andVar + unescape(filterResults.SQLWhere);\n\t}\n\t//alert(sessionStorage.CurrentWhereQuery);\n\t$('#filterList').listview('refresh');\n\tdb.transaction(getSearchClinicCount,transaction_error);\n}", "title": "" }, { "docid": "a67191e341d3a3210300ca3456ad7b10", "score": "0.5781536", "text": "function filterItems(e){\n var text = e.target.value.toLowerCase();\n var items = itemList.getElementsByTagName('li');\n Array.from(items).forEach(function(item){\n var itemName = item.firstChild.textContent;\n if(itemName.toLowerCase().indexOf(text) != -1){\n item.style.display = 'block';\n } else {\n item.style.display = 'none';\n }\n });\n}", "title": "" }, { "docid": "7ffb8d4889e344949f6fc1b2b1c488bc", "score": "0.5774469", "text": "function filterByType() {\n\t\tvar filterType = $(\"#site-type-filter\").find(\".ui-state-active\").attr(\"for\").split(\"-\");\n filterType = filterType[0];\n\t\t\n\t\t$(\"#sites-table tbody tr\").each(function() {\n\t\t\tvar type = $(this).attr('class');\n\t\t\tif (filterType == 'all') {\n\t\t\t\t$(this).show();\n\t\t\t} else if (type.indexOf(filterType) == -1) {\n\t\t\t\t$(this).hide();\n\t\t\t\tif ($(this).hasClass('selectedRow')) {\n\t\t\t\t\t$(this).removeClass('selectedRow');\n\t\t\t\t\tdisableButtons();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$(this).show();\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "fe55781e1175e10e4ab84663b7bf11a1", "score": "0.5774466", "text": "function filterItems(e){\n //get filter text and convert it to lower case\n var text = e.target.value.toLowerCase();\n //get lists \n var items = itemList.getElementsByTagName('li');\n \n //covert to an array\n Array.from(items).forEach(function(item){\n var itemName = item.firstChild.textContent;\n if(itemName.toLowerCase().indexOf(text) != -1){\n item.style.display = 'block';\n }else {\n item.style.display = 'none';\n }\n });\n}", "title": "" }, { "docid": "d7b2772133585ad309475376ee4f8903", "score": "0.577351", "text": "function filters() {\n if (stateOption !== \"ALL\") {\n membersFiltered = members.filter(member => member.state == stateOption)\n } else {\n membersFiltered = members\n }\n \n showFiltered = []\n if (partyOptions.length > 0) {\n showFiltered = membersFiltered.filter(member => partyOptions.includes(member.party))\n } else {\n showFiltered = membersFiltered\n }\n }", "title": "" }, { "docid": "3f8c0ed2999cad0d7b0e6d8fdd8d1a41", "score": "0.5762196", "text": "function filter_territoty(){\n\tcur_frm.set_query(\"route\", function() {\n\t\treturn {\n\t\t\t\"filters\": {\n\t\t\t\t\"type_of_territory\": \"route\"\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "ac33feb8c2985845e3f8305685704322", "score": "0.57598364", "text": "function getAll(typeOfList) {\n // 'typeOfList' parameter will be 'all' or 'filtered' \n return typeOfList === 'filtered' ? filteredTVShowsList : tvShowsList; \n }", "title": "" }, { "docid": "f3384e9c14667c53bbf10d59b6d629d3", "score": "0.5758397", "text": "function filterFunction() {\n\t\tvar input, filter, ul, li, a, i;\n\t\tinput = document.getElementById(\"itregationInputFilter\");\n\t\tfilter = input.value.toUpperCase();\n\t\tdiv = document.getElementById(\"intregationDropdownMain\");\n\t\ta = div.getElementsByTagName(\"a\");\n\t\tfor (i = 0; i < a.length; i++) {\n\t\t txtValue = a[i].textContent || a[i].innerText;\n\t\t if (txtValue.toUpperCase().indexOf(filter) > -1) {\n\t\t\ta[i].style.display = \"\";\n\t\t } else {\n\t\t\ta[i].style.display = \"none\";\n\t\t }\n\t\t}\n\t }", "title": "" }, { "docid": "c5a19f4129383dfa969f8e789a725d8c", "score": "0.5757417", "text": "function filterByWishlistType() {\n var type = this.firstChild.nodeValue;\n if (!type) return;\n var localA;\n var stateUL = this.parentNode.parentNode;\n if (stateUL) {\n var as = stateUL.getElementsByTagName('A');\n for (var i = 0; i < as.length; i++) {\n var a = as[i];\n var text = a.firstChild.nodeValue;\n a.firstChild.nodeValue = a.firstChild.nodeValue.replace(' *','');\n if (text == type) { localA = a; a.firstChild.nodeValue += ' *' }\n }\n }\n if (type.search(/all/i) > -1) type = false;\n\tanimeFilter['wishlisttype'] = type;\n for (var a in animes) {\n var anime = animes[a];\n if (!anime) continue;\n var row = document.getElementById('a'+anime.id);\n if (!row) continue;\n if (!type) { row.style.display = ''; filteredAnimes--; anime.filtered = false; }\n else {\n if (anime.wishlist && anime.wishlist['type'] == animeFilter['wishlisttype']) { row.style.display = ''; filteredAnimes--; anime.filtered = false; }\n else { row.style.display = 'none'; filteredAnimes++; anime.filtered = true; }\n }\n }\n curpage = 1; showPage(curpage);\n}", "title": "" }, { "docid": "03c39bdca32875102e2bf5f5978c39bc", "score": "0.57563686", "text": "function filterFunctionNew() {\n\t\tvar input, filter, ul, li, a, i;\n\t\tinput = document.getElementById(\"itregationInputFilter2\");\n\t\tfilter = input.value.toUpperCase();\n\t\tdiv = document.getElementById(\"intregationDropdownMain2\");\n\t\ta = div.getElementsByTagName(\"a\");\n\t\tfor (i = 0; i < a.length; i++) {\n\t\t txtValue = a[i].textContent || a[i].innerText;\n\t\t if (txtValue.toUpperCase().indexOf(filter) > -1) {\n\t\t\ta[i].style.display = \"\";\n\t\t } else {\n\t\t\ta[i].style.display = \"none\";\n\t\t }\n\t\t}\n\t }", "title": "" }, { "docid": "eeac92594d553489dd4b7cc13fb67c1c", "score": "0.57512164", "text": "function filterPrice() {\r\n var priceRange = getAmountValues();\r\n\r\n var filteredByPrice = [];\r\n\r\n restaurantData.forEach(function (restaurant) {\r\n\r\n var restaurantPrice = restaurant.restaurant.price_range;\r\n\r\n if (restaurantPrice >= priceRange[0] && restaurantPrice <= priceRange[1]) {\r\n filteredByPrice.push(restaurant);\r\n }\r\n });\r\n document.getElementById('restaurant-list').innerHTML = getRestaurantList(filteredByPrice);\r\n // return filteredByPrice\r\n}", "title": "" }, { "docid": "1e8a11e6b1827b6367b2bb935ba6dccd", "score": "0.57414174", "text": "function selectFilter() {\n filter = this.value.toUpperCase();\n studentsFilter = [];\n allStudents.filter(function(student) {\n if (filter === \"ALL\") {\n studentsFilter.push(student);\n }\n if (student.house === filter) {\n studentsFilter.push(student);\n }\n });\n // display the list of students\n displayList(studentsFilter);\n}", "title": "" }, { "docid": "d6ef2a1a80df2b7d5ad384398eecef8e", "score": "0.57391757", "text": "function loadRestaurants() {\n API.getRestaurants()\n .then((res) => setRestaurants(res.data))\n .catch((err) => console.log(err))\n }", "title": "" }, { "docid": "0d2a0a40d2d6d0038a23df8ff082edad", "score": "0.5727565", "text": "fetchRestaurantByCuisineAndNeighborhood(cuisine, neighborhood) {\n // Fetch all restaurants\n return this.restaurants\n .then((restaurants) => {\n let results = restaurants;\n if (cuisine != 'all') { // filter by cuisine\n results = results.filter(r => r.cuisine_type == cuisine);\n }\n if (neighborhood != 'all') { // filter by neighborhood\n results = results.filter(r => r.neighborhood === neighborhood);\n }\n return results;\n })\n .catch(error => console.error(error));\n }", "title": "" }, { "docid": "e040a6ea90ce95d1355be484fd1b066e", "score": "0.5723773", "text": "function filterTasks(e) {\n // Get the value from the input filter\n const filterValue = document.querySelector('#filter').value.toLowerCase();\n // Get the list items for iteration in the collection ul\n const listItems = document.querySelectorAll('ul li.collection-item');\n\n listItems.forEach(function(item){\n // Check if each list item contains the substring in the filter value\n if (item.textContent.toLowerCase().includes(filterValue)) {\n item.hidden = false;\n } else {\n // Hide the list item if substring filter value is not in the list item text content\n item.hidden = true;\n }\n });\n}", "title": "" }, { "docid": "82f73dffe91369b683f04f1767b7c0c7", "score": "0.5722463", "text": "filterlist(){\n\n\t\t\t// filterlist object\n\t\t\t// returns a filter funtion over the constructed post\n\t\t\treturn this.postlist.filter((post)=>{\n\n\t\t\t\t// of an inculded array of title-toLowerCase matching any keyword-toLowerCase returned\n\t\t\t\treturn post.title.toLowerCase().includes(this.keyword.toLowerCase());\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "8f0268367d9f9f490baec12dd1c006ad", "score": "0.5712307", "text": "filterTodo(filter) {\r\n let filteredList = [];\r\n\r\n if (filter === \"All\") {\r\n this.displayTodoList();\r\n this.addFocus(filter);\r\n return;\r\n } else if (filter === \"Active\") {\r\n this.toDoList.forEach(todo => {\r\n if (!todo.completed) {\r\n filteredList.push(todo);\r\n }\r\n });\r\n } else {\r\n this.toDoList.forEach(todo => {\r\n if (todo.completed) {\r\n filteredList.push(todo);\r\n }\r\n });\r\n }\r\n\r\n this.parentElement.innerHTML = '';\r\n renderTodoList(this.parentElement, filteredList);\r\n this.addFocus(filter);\r\n this.addTodoListener();\r\n }", "title": "" }, { "docid": "7407f1df3360e8b27470157dfd6e199c", "score": "0.5710908", "text": "function filterItems(e) {\n // convert text to lowercase\n var text = e.target.value.toLowerCase();\n // get all li's\n var items = itemList.getElementsByTagName('li');\n // turn html collection into an js array\n Array.from(items).forEach(function(item) {\n var itemName = item.firstChild.textContent;\n // test for match between itemname and search box text\n if(itemName.toLocaleLowerCase().indexOf(text) != -1){\n item.style.display = 'block';\n } else {\n item.style.display = 'none';\n }\n });\n\n}", "title": "" }, { "docid": "265b6ba8096881851be5845c8003e3a6", "score": "0.5710255", "text": "function doAmenityFilter()\n{\n\tnewAmenities=\"\";\n\tvar slectedAmenities = \"\";\n\t$(\"input[name='amenity_chbx']:checked\").each( function() //get selected amenities\n\t{\n\t\tslectedAmenities = slectedAmenities + \"_\" + $(this).val();\n\t});\n\t\n\t//if amenities are selected remove first character(\"_\")\n\tif( !empty(slectedAmenities) )\n\t{\n\t\tslectedAmenities = slectedAmenities.substring(1, slectedAmenities.length);\n\t}\n\t//if no amenities selected\n\telse\n\t{\n\t\tif( IS_FILTER_ALREADY_APPLIED )//if filter already applied send request to get all hotel items\n\t\t{\n\t\t\tslectedAmenities = \"all\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn;//otherwise display already displayed items\n\t\t}\n\t}\n\t\n\t$(\"#amenityFilterLink\").removeClass(\"CDrop\");\n\t$(\"#amenityFilterLink\").addClass(\"CDrop2\");\n\tvar params = \"filterType=amenityFilter&pdct=HTL&view=listView&filterAmenities=\" + slectedAmenities;//send amenity filter request\n\tdoAjax(\"FilterController\", params, filterCallBack, \"\", \"json\");\n\t$(\"#amenityFilterOverlay\").hide();\n}", "title": "" }, { "docid": "2cdfe7fe4087c26c51445c01e55982a5", "score": "0.57083565", "text": "function displayMeal(meal) {\n var newList;\n\n newList = filterList(items,meal);\n displayItems(newList);\n}", "title": "" }, { "docid": "a216a964409c2cdb3a96233f8bdaac2d", "score": "0.57076675", "text": "static fetchRestaurantByCuisine(cuisine,callback){// Fetch all restaurants with proper error handling\nDBHelper.fetchRestaurants((error,restaurants)=>{if(error){callback(error,null);}else{// Filter restaurants to have only given cuisine type\nconst results=restaurants.filter(r=>r.cuisine_type==cuisine);callback(null,results);}});}", "title": "" }, { "docid": "5355bd3a6300854de0ebdb88976a3616", "score": "0.5707442", "text": "function showMainSearch() {\n var pwaHeader = document.getElementById('pwa-header');\n if(pwaHeader.className.match('.pwa-header-active')){\n pwaHeader.className = 'header';\n showHide('main-search', 0);\n }else{\n pwaHeader.className += ' pwa-header-active';\n showHide('main-search', 1);\n showHide('saved-results', 1);\n document.getElementById('search').value = '';\n showHide('search-results', 0);\n }\n\n helper.empty('recently-searched');\n var container = document.getElementById('recently-searched');\n for(var i in _User.locations){\n container.innerHTML += '<li class=\"results\"><a onclick=\"javascript:searchResultsClicked(this, ' + i + ', \\'' + _User.locations[i].prsntNm + '\\', false, false )\" class=\"dropdown-name\">' + _User.locations[i].prsntNm + '</a></li>';\n }\n}", "title": "" }, { "docid": "ae44f963dac58f1fb959145b7da1e151", "score": "0.56927603", "text": "function filterPersist(){\n\tif ($(\"#filterOn.current\").length == 1){\n\t\t$(\"#feedList > li\").hide();\n\t\t$(\"#sidenavBottom .miniList > li\").has(\"div.filterBox:not(:visible)\").each(function(){\n\t\t\tvar listType = $(this).parents(\"ul\").attr(\"id\");\n\t\t\tvar id = parseInt($(this).attr(\"value\"), 8);\n\t\t\tswitch(listType){\n\t\t\t\tcase \"networkList\":\n\t\t\t\t\t$(\"#feedList > li.network\" + id).show();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"fieldList\":\n\t\t\t\t\t$(\"#feedList > li.field\" + id).show();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"groupList\":\n\t\t\t\t\t$(\"#feedList > li.group\" + id).show();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t});\n\t}\n}", "title": "" }, { "docid": "4a652f539f29b0cf8b9c0f3d40f8ca39", "score": "0.5691698", "text": "getVisibleItems() {}", "title": "" }, { "docid": "8a0c8afe1c1e496f3077e1b2dd16d1fb", "score": "0.5690749", "text": "function createList() {\n activateFilter();\n let pokemonInPage = [];\n if (filter === \"\") {\n getGenList();\n pokemonInPage = selectPokemonFromPage();\n } else {\n pokemonInPage = selectPokemonFiltered();\n }\n renderListNav(pokemonInPage);\n}", "title": "" }, { "docid": "e98dcff0127b038f7ddfb3d8be5093e0", "score": "0.5681639", "text": "function loadRestaurants() {\n API.getRestaurants()\n .then(res => \n setRestaurants(res.data)\n )\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "3c1cd439adf2582607962194b71496d5", "score": "0.5666045", "text": "function filterCard(keyword){\n var filtered = filterItems(keyword)\n showCard(filtered)\n}", "title": "" }, { "docid": "6eb92bdcc26eeb7578ef9421d558e568", "score": "0.5665805", "text": "function filterCats() {\n const onlyCats = allAnimals.filter(isCat);\n displayList(onlyCats);\n}", "title": "" }, { "docid": "4b674269dbfe6974c4adad931f29ce43", "score": "0.5663016", "text": "_filterMovies() {\n var filteredMovies;\n if (this.state['all-movies']) {\n filteredMovies = this.state.movies.filter(this._filterBySearch);\n } else {\n filteredMovies = this.state.movies.filter((movie) => {\n return this._filterBySearch(movie) && this._filterByWatched(movie);\n });\n \n }\n this.setState({filteredMovies: filteredMovies});\n }", "title": "" }, { "docid": "f846825a2b13a1293d1e8f7eb1169222", "score": "0.5662455", "text": "function filterName() {\r\n // Declare variables\r\n var input, filter, ul, li, a, i, txtValue;\r\n input = document.getElementById('species');\r\n filter = input.value.toUpperCase();\r\n ul = document.getElementById(\"myUL\");\r\n li = ul.getElementsByTagName('li');\r\n \r\n \r\n // Loop through all list items, and hide those who don't match the search query\r\n for (i = 0; i < li.length; i++) {\r\n a = li[i].getElementsByTagName(\"button\")[0];\r\n txtValue = a.textContent || a.innerText;\r\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\r\n li[i].style.display = \"\";\r\n } else {\r\n li[i].style.display = \"none\";\r\n };\r\n };\r\n}", "title": "" }, { "docid": "f12ccc899e0a9d08b7e6c75b030d0868", "score": "0.56620586", "text": "function filterPage()\r\n {\r\n filterStaticText();\r\n filterDynamicText();\r\n }", "title": "" }, { "docid": "58acca165044069c61e5ee0740c9ada0", "score": "0.5631988", "text": "function FilteredListings(type) {\n\tvar bounds = new google.maps.LatLngBounds();\n\t// Extend the boundaries of the map for each marker and display the marker\n\tfor (var i = 0; i < locations.length; i++) {\n\t\t//check for the selected Category\n\t\tif (locations[i].category == type || type == undefined || type == 'All') {\n\t\t\tmarkers[i].setMap(map);\n\t\t\tbounds.extend(markers[i].position);\n\t\t} else {\n\t\t\tmarkers[i].setMap(null);\n\t\t}\n\t}\n\tmap.fitBounds(bounds);\n}", "title": "" }, { "docid": "83acf3075510638ca9d57ee23d891c03", "score": "0.5631445", "text": "function filterCategory () {\n\n}", "title": "" }, { "docid": "cc841662289458bda6fd38cece0a9cc3", "score": "0.5631397", "text": "static fetchRestaurantByNeighborhood(neighborhood,callback){// Fetch all restaurants\nDBHelper.fetchRestaurants((error,restaurants)=>{if(error){callback(error,null);}else{// Filter restaurants to have only given neighborhood\nconst results=restaurants.filter(r=>r.neighborhood==neighborhood);callback(null,results);}});}", "title": "" }, { "docid": "60ec07a690d4c5e9890cb2d5b81a9b42", "score": "0.56223565", "text": "function filterBYBussNameFunc(e) {\n const text = e.target.value.toLowerCase();\n console.log(text);\n\n e.preventDefault();\n\n document.querySelectorAll('.viewItem').forEach(function(ver) {\n const item = ver.firstChild.textContent;\n\n if (item.toLowerCase().indexOf(text) != -1) {\n ver.style.display = 'block';\n } else {\n ver.style.display = 'none';\n }\n });\n}", "title": "" }, { "docid": "63fb5319737623f0b62f615f0c2c0ac9", "score": "0.5620934", "text": "filter()\n {\n const filterValue = appState.get('filter');\n\n switch (filterValue)\n {\n case 'all':\n this.addAll();\n break;\n\n case 'completed':\n this.addSome((item) => { return item.get('done'); });\n break;\n\n default:\n this.addSome((item) => { return !item.get('done'); });\n break;\n }\n }", "title": "" }, { "docid": "486f4bb2d6e0bb3643560f9025a0797c", "score": "0.56062716", "text": "function filterByRating(rating){\n filteredList = bookmarks.filter(item => item.rating >= rating);\n bookmarkList.render(filteredList);\n }", "title": "" }, { "docid": "7f49612758973bee65fff2098b5a99c2", "score": "0.5606217", "text": "showPlaces() {\n if (this.state.searchTerm === \"\") {\n return this.state.places\n }\n return this.state.places.filter(place => place.title.toLowerCase().includes(this.state.searchTerm.toLowerCase()))\n }", "title": "" }, { "docid": "181e9b5d22203433f8591db9162de4e0", "score": "0.5604048", "text": "function filterList(listClass, init_value, value_names){\r\n $('body').attr('id', 'search_wrap');\r\n if (!value_names)\r\n {\r\n value_names = [ 'blockNumber', 'responseText', 'TicketBlockNumber', 'user_name', 'ticketlocation', 'locationtick'];\r\n }\r\n else if (value_names)\r\n {\r\n value_names = value_names.split(',');\r\n }\r\n var options = {\r\n listClass: listClass,\r\n item: \"item\",\r\n valueNames: value_names\t\t\t\r\n };\r\n featureList = new List('search_wrap', options);\r\n init_value = init_value || $(\".search\").val();\r\n if (init_value)\r\n {\r\n featureList.search(init_value);\r\n $(\".search\").val(init_value);\r\n }\r\n /*\r\n featureList.on('updated',function(){\r\n //console.log(featureList);\r\n if (featureList.matchingItems.length > 1) \r\n {\r\n var itemMessage = 'There are ' + featureList.matchingItems.length + ' matching tickets.';\r\n //console.log( itemMessage);\r\n } else if (featureList.matchingItems.length === 0) {\r\n console.log( 'Bummer... 0 items found');\r\n }\r\n //else if (featureList.matchingItems.length == 1) { ; }\r\n });\r\n */\r\n //console.log(\"loaded list\");\r\n return featureList;\r\n}", "title": "" }, { "docid": "4a46be8f0d49446a0ff4fb988f80a1c5", "score": "0.56016374", "text": "function myFilter () {\n return function(input, predicate) {\n input = input || '';\n predicate = predicate || '';\n var output = [];\n //Iterate through full showlist\n for (var i = 0; i < input.length; i++) {\n //Iterate through user's followed shows\n for (var j = 0; j < predicate.ids.slug.length; j++) {\n if (input[i].ids.slug == predicate.ids.slug[j].$value) {\n output.push(input[i]);\n }\n }\n }\n return output;\n };\n }", "title": "" }, { "docid": "5dc7bdcd65c3d4febaf4901f0f7c40ae", "score": "0.56001794", "text": "function clearRestaurantList() {\n $(\".restaurant-list li\").remove();\n }", "title": "" }, { "docid": "02b1c2a00ee2c5b74d37a4f1bc4cfe51", "score": "0.55978286", "text": "static fetchRestaurantByCuisineAndNeighborhood(cuisine, neighborhood, isFavoritesFiltered, callback) {\r\n // Fetch all restaurants\r\n DBHelper.fetchRestaurants().then(restaurants => {\r\n let results = restaurants\r\n if (cuisine != 'all') { // filter by cuisine\r\n results = results.filter(r => r.cuisine_type == cuisine);\r\n }\r\n if (neighborhood != 'all') { // filter by neighborhood\r\n results = results.filter(r => r.neighborhood == neighborhood);\r\n }\r\n if (isFavoritesFiltered) {//filter by favorited restaurants\r\n results = results.filter(r => r.is_favorite === \"true\")\r\n }\r\n callback(null, results);\r\n }).catch(error => {\r\n callback(error, null)\r\n })\r\n }", "title": "" }, { "docid": "a175ae695f818c8a68ff4c718fa5aa28", "score": "0.559543", "text": "fetchRestaurantByNeighborhood(neighborhood) {\n // Fetch all restaurants\n return this.restaurants\n .then((restaurants) => {\n // Filter restaurants to have only given neighborhood\n const results = restaurants.filter(r => r.neighborhood === neighborhood);\n return results;\n })\n .catch(error => console.error(error));\n }", "title": "" }, { "docid": "18ab5a64d08fe089a673bae1c7e25cb1", "score": "0.55912966", "text": "function filterByCategory() {\n let category = $scope.currentCategory ? $scope.currentCategory.name : \"\";\n dataService.getRecipesByCategory(category, function (res) {\n $scope.recipes = res.data;\n });\n }", "title": "" }, { "docid": "f2d1fd9162ba60975d4aca62ea980acd", "score": "0.55900306", "text": "function filterList() {\n\tvar selectValue = document.getElementById('selectTask').value,\n\titem = document.getElementsByTagName('LI');\n\tfor (i = 0;i < item.length;i++) {\n\t\tvar txt = item[i].children[1].children[0].innerHTML;\n\t\tif (selectValue == \"Все\") {\n\t\t\titem[i].style.display = \"block\";\n\t\t} else if (txt.toLowerCase() !== selectValue.toLowerCase()) {\n\t\t\titem[i].style.display = \"none\";\n\t\t} else {\n\t\t\titem[i].style.display = \"block\";\t\n\t\t}\n\t}\n\tif (todoList.offsetHeight < 200) {\n\t\ttodoList.style.overflowY = \"hidden\";\n\t} else {\n\t\ttodoList.style.overflowY = \"scroll\";\n\t}\n}", "title": "" }, { "docid": "3d57ce3b2e537c6deb8bbaee33222b3d", "score": "0.5581926", "text": "function displayFilteredCoffees(e) {\n e.preventDefault(); // don't submit the form, we just want to update the data\n let selectedRoast = roastSelectionQS.value;\n // if all is selected in Roast criteria, show all Roast types\n let flag = (roastSelectionQS.value === \"all\");\n //Make all criteria Uppercase for case insensitive search\n let selectedCoffeeNameUpperCase = coffeeNameQS.value.toUpperCase();\n let filteredCoffees = [];\n //Get coffees from storage for filtering\n let coffees = getCoffeesFromStorage();\n coffees.forEach(function (coffee) {\n //uppercase for case insensitive search\n let coffeeNameUpperCase = coffee.name.toUpperCase();\n //if all is selected in Roast criteria\n if (flag) {\n if (coffeeNameUpperCase.search(selectedCoffeeNameUpperCase) > -1) {\n filteredCoffees.push(coffee);\n }\n } else {\n if ((coffee.roast === selectedRoast)\n &&\n coffeeNameUpperCase.search(selectedCoffeeNameUpperCase) > -1) {\n filteredCoffees.push(coffee);\n }\n }\n });\n divCoffeeQS.innerHTML = renderCoffees(filteredCoffees);\n}", "title": "" }, { "docid": "e47a1c82ffa185b542631096f1a9afc8", "score": "0.55772275", "text": "function filterTasks(e) {\n // Targetting the value of the 'filter' input and converting to lower case\n const text = e.target.value.toLowerCase();\n\n // Making selection to focus on ALL the list items with the class of 'collection-item' - since we are using\n // 'querySelectorAll' it turns all of the relevant selected items into a node list. That being the case we\n // are then able to use forEach to loop through everything. Then, our callback function executes action with\n // the help of conditionals to dictate our filter parameters:\n document.querySelectorAll('.collection-item').forEach(function (task) {\n // This 'item' variable is set so that it is focused on the text Content of the first child of the li\n // in this case, this would be the textContent of the li tag\n const item = task.firstChild.textContent;\n // If there is no match, the index of our text would be equal to '-1', but in our 'if' condition,\n // it states that if the item to lowercase is NOT equal to '-1,' i.e. there IS a match, our display shows\n if (item.toLowerCase().indexOf(text) != -1) {\n task.style.display = 'block';\n // Otherwise, if there is NO match to what is passed in, the display of that task will not show\n } else {\n task.style.display = 'none';\n }\n });\n}", "title": "" }, { "docid": "babff3df926fa7631f8013c494d81fb9", "score": "0.5575919", "text": "function showSearches(town) {\n\t\t//find list in HTML doc\n\t\tvar list = document.getElementById(\"recent\");\n\t\t//create new list item\n\t\tvar item = document.createElement('li')\n\t\t//create text content for list item\n\t\tvar content = document.createTextNode(town.name);\n\t\t//assemble the list\n\t\titem.appendChild(content);\n\t\tlist.appendChild(item);\n\t\t//when clicked, this calls the changeMap function by sending it this town object\n\t\titem.onclick = function(){ changeMap(town); };\n}", "title": "" }, { "docid": "6d6a76c14addd63f14d3775f2df29ca9", "score": "0.5574342", "text": "function showAll() {\n const item = document.querySelectorAll('.item');\n item.forEach(function (el) {\n el.style.display = \"flex\";\n })\n resultsError.style.display = \"none\";\n loadMore.style.display = \"flex\";\n tagFilterAll.classList.add(\"selected\");\n\n type = \"\";\n}", "title": "" }, { "docid": "8cbcda66ac7132e15bcc59c46b5a908e", "score": "0.55731624", "text": "feilFix(){\n if(this.state.dataSource.viewPoints.filter(item => item.title.startsWith(this.state.searchKey)).length == 0) {\n return null;\n }\n else {\n this.props.navigation.navigate('NewMap3', { vp: this.state.dataSource.viewPoints.filter(item => \n item.title.startsWith(this.state.searchKey)) })\n }\n }", "title": "" }, { "docid": "c1e099e0bcfa36f6d9a64e48f567c675", "score": "0.55719435", "text": "function loadApp() {\n $(\"#searcher\").keyup(filterRestaurants);\n}", "title": "" }, { "docid": "8b933dcfe8fd5786a047a323acf9dfd9", "score": "0.5571301", "text": "filter (inventory) {\n if (!this.props.filter) {\n return inventory;\n }\n return inventory.filter((ingredient) => ingredient.name.toLowerCase().search(this.props.filter.toLowerCase()) != -1)\n }", "title": "" }, { "docid": "466a18d155b15ef0475710614787dc21", "score": "0.5570749", "text": "function filterItems (e) {\n //convert text to lowercase\n var text = e.target.value.toLowerCase();\n // get li's\n var items = itemList.getElementsByTagName('li');\n // convert to an array\n Array.from(items).forEach(function (item) {\n var itemName = item.firstChild.textContent;\n if (itemName.toLowerCase().indexOf(text) !== -1) {\n item.style.display = 'block';\n } else {\n item.style.display = 'none';\n }\n })\n}", "title": "" } ]
7801b0f41faddb10180354fed8836239
unstack block under a button
[ { "docid": "9bd53792ad846fdc5d5ac3e2e0e60ba5", "score": "0.0", "text": "function updateVisibility(button) {\n\t\t$.each(dash_panels, function(key, val) {\n\t\t if(key === button) {\n\t\t\t $(val).css('display', 'block');\n\t\t } else {\n\t\t\t $(val).css('display', 'none');\n\t\t }\n\t\t});\n\t\treturn false;\n\t}", "title": "" } ]
[ { "docid": "16aa218e32c3575f65f519e5df3caa29", "score": "0.7380558", "text": "function unstackBlock(button) {\n\t\t$.each(toggle_pannels, function(key, val) {\n\t\t if(key === button) {\n\t\t\t $(val).slideToggle(\"slow\");\n\t\t }\n\t\t});\n\t\treturn false;\n\t}", "title": "" }, { "docid": "eb910cf6ccf618e762d06bd255757781", "score": "0.6609257", "text": "function onBlockBtnClick() {\n setBlock(!bg.get('block'));\n toggleBlockBtn();\n}", "title": "" }, { "docid": "08559e94fcdf7bfc7113fcaf6868b240", "score": "0.59962267", "text": "function toggleBlockBtn() {\n toggleBlockBtnBg();\n toggleBlockBtnText();\n}", "title": "" }, { "docid": "66023f95252fdcc94f1ae4c0d43729ce", "score": "0.56924945", "text": "function bumpBackBlocks () {\n\tif (Blockly.Block.dragMode_ == 0) {\n\t\tif (Blockly.selected) {\n\t\t\tvar trash = Blockly.selected.workspace.trashcan;\n\t\t\tvar blockHW = Blockly.selected.getHeightWidth();\n\t\t\tvar blockXY = Blockly.selected.getRelativeToSurfaceXY();\n\t\t var overlap = trash.myDispose(blockHW, blockXY);\n\t\t if (overlap) {\n\t\t \tgoog.Timer.callOnce(trash.close, 100, trash);\n\t \t\tBlockly.selected.dispose(false, true);\n\t\t }\n\t\t}\n\t\tvar topBlocks = Blockly.mainWorkspace.getTopBlocks(false);\n\t\tfor (var j = 0; j < topBlocks.length; j++) {\n\t\t\tif (topBlocks[j].type == 'procedures_defnoreturn') {\n\t\t\t\trestrictBoundry(topBlocks[j]);\n\t\t\t}\n }\n \n\t\tvar metrics = Blockly.getMainWorkspaceMetrics();\n \tif (metrics.contentTop < 0 ||\n \tmetrics.contentTop + metrics.contentHeight > metrics.viewHeight + metrics.viewTop ||\n \tmetrics.contentLeft < (Blockly.RTL ? metrics.viewLeft : 0) ||\n \tmetrics.contentLeft + metrics.contentWidth > (Blockly.RTL ? metrics.viewWidth : metrics.viewWidth + metrics.viewLeft)) {\n \t// One or more blocks is out of bounds. Bump them back in.\n \t\tvar MARGIN = 5;\n \tvar ToolboxWidth = Blockly.Toolbox.width;\n \tvar blocks = Blockly.mainWorkspace.getTopBlocks(false);\n \tfor (var b = 0, block; block = blocks[b]; b++) {\n \t\tvar blockXY = block.getRelativeToSurfaceXY();\n \t\tvar blockHW = block.getHeightWidth();\n \t\t\n \t\t// Bump any block that's above the top back inside.\n \t\tvar overflow = metrics.viewTop + MARGIN - blockHW.height - blockXY.y + blockHW.height;\n \t\tif (overflow > 0) {\n \t\tblock.moveBy(0, overflow);\n \t\t}\n \t\t// Bump any block that's below the bottom back inside.\n \t\tvar overflow = metrics.viewTop + metrics.viewHeight - MARGIN -\n \tblockXY.y - blockHW.height;\n \t\tif (overflow < 0) {\n \t\tblock.moveBy(0, overflow);\n \t\t}\n \t\t// Bump any block that's off the left back inside.\n \t\tvar overflow = MARGIN + ToolboxWidth + metrics.viewLeft - blockXY.x - 0; //(Blockly.RTL ? 0 : blockHW.width);\n \t\tif (overflow > 0) {\n \t\tblock.moveBy(overflow + 30, 0);\n \t\t}\n \t\t// Bump any block that's off the right back inside.\n \t\tvar overflow = metrics.viewLeft + metrics.viewWidth - MARGIN -blockXY.x + (Blockly.RTL ? blockHW.width : 0);\n \t\tif (overflow < 0) {\n \t\tblock.moveBy(overflow + 30, 0);\n \t\t}\n \t}\n\t\t}//*/\n }\n}", "title": "" }, { "docid": "08b641c05ba04ab76e771a2029bd94a9", "score": "0.5673366", "text": "function btn_nc(){\n switch (currentblock){\n case \"Boluo_A\":\n add_ZoneOverlay_Demo_Block_Boluo_A_nc();break;\n case \"Boluo_B\":\n add_ZoneOverlay_Demo_Block_Boluo_B_nc();break;\n case \"Boluo_C\":\n add_ZoneOverlay_Demo_Block_Boluo_C_nc();break;\n default:\n }\n}", "title": "" }, { "docid": "d9912f13cb2b9b73a50e2a118b4afb51", "score": "0.5615973", "text": "unblockHeaderElements() {\n var scrollerArr = this._getPaneScrollerArr();\n for (var i = 0; i < scrollerArr.length; i++) {\n scrollerArr[i].getHeader().getBlocker().unblock();\n }\n this.getChildControl(\"column-button\").getBlocker().unblock();\n }", "title": "" }, { "docid": "ac3a301e1aa05d5850f8d71317beddbd", "score": "0.552009", "text": "onClickBlock2() {\n\t\tif (this.state.msg.length > 0 && this.state.msg.length < 9) {\n\t\t\tthis.setState((prevState) => {\n\t\t\t\tprevState.block2.isOpen = true;\n\t\t\t\tprevState.block2.blockStyle = { height: spring(600, presets.noWobble), width: 700 };\n\t\t\t\treturn prevState\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "002aabcd9155d81362719c22e95917d1", "score": "0.55019534", "text": "function projectBlockMove(block, btn,width,hover,center,title){\n $(block).on('mousemove', function(){\n $(this).css({\n 'box-shadow': '0px 0px 37px 0px rgba(0,0,0,0.5)'\n });\n if (width >= 768 || width >= 992 || width >= 1200){\n $(this).stop(true).queue('fx', function() {\n $(this).animate({\n top: '-7px',\n left: '-7px',\n width: '364px',\n height: '364px',\n cursor: 'pointer'\n }, 300)\n .dequeue('fx');\n });\n $(hover).stop(true).queue('fx', function() {\n $(this).animate({\n top: '0',\n left: '0',\n }, 300)\n .dequeue('fx');\n });\n $(center).css({\n opacity:'0'\n });\n $(title).css({\n 'border-bottom':'1px solid #7dbe1f'\n });\n }\n else {\n $(this).stop(true).queue('fx', function() {\n $(this).animate({\n top: '-5px',\n left: '-5px',\n width: '300px',\n height: '376px'\n }, 300)\n .dequeue('fx');\n });\n $(hover).stop(true).queue('fx', function() {\n $(this).animate({\n height: '380px',\n top: '0',\n left: '0',\n }, 300)\n .dequeue('fx');\n });\n $(center).css({\n opacity:'0'\n });\n $(title).css({\n 'border-bottom':'1px solid #7dbe1f'\n });\n }\n \n $(btn).css({\n 'background': 'none',\n 'border': '1px solid #439c92'\n });\n\n $(btn).on('mousemove',function(){\n $(btn).css({\n width: '120px',\n height: '32px',\n 'line-height': '32px'\n });\n });\n $(btn).on('mouseout',function(){\n $(btn).css({\n width: '110px',\n height: '26px',\n 'line-height': '26px'\n });\n });\n });\n }", "title": "" }, { "docid": "637893509e095d39957fe92bf1b0cc3f", "score": "0.54822826", "text": "function depressButton() {\n buttonPosition.z += 0.05;\n }", "title": "" }, { "docid": "637893509e095d39957fe92bf1b0cc3f", "score": "0.54822826", "text": "function depressButton() {\n buttonPosition.z += 0.05;\n }", "title": "" }, { "docid": "637893509e095d39957fe92bf1b0cc3f", "score": "0.54822826", "text": "function depressButton() {\n buttonPosition.z += 0.05;\n }", "title": "" }, { "docid": "54e0e844f0aac032915e4d51473955d1", "score": "0.5449352", "text": "function create_else_block(ctx) {\n \tlet button;\n \tlet t;\n \tlet current;\n \tlet mounted;\n \tlet dispose;\n \tlet if_block = /*icon*/ ctx[3] && create_if_block_2$1(ctx);\n \tconst default_slot_template = /*#slots*/ ctx[34].default;\n \tconst default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[43], null);\n\n \tlet button_levels = [\n \t\t{ class: /*classes*/ ctx[1] },\n \t\t/*props*/ ctx[9],\n \t\t{ type: /*type*/ ctx[6] },\n \t\t{ disabled: /*disabled*/ ctx[2] }\n \t];\n\n \tlet button_data = {};\n\n \tfor (let i = 0; i < button_levels.length; i += 1) {\n \t\tbutton_data = assign(button_data, button_levels[i]);\n \t}\n\n \treturn {\n \t\tc() {\n \t\t\tbutton = element(\"button\");\n \t\t\tif (if_block) if_block.c();\n \t\t\tt = space();\n \t\t\tif (default_slot) default_slot.c();\n \t\t\tset_attributes(button, button_data);\n \t\t},\n \t\tm(target, anchor) {\n \t\t\tinsert(target, button, anchor);\n \t\t\tif (if_block) if_block.m(button, null);\n \t\t\tappend(button, t);\n\n \t\t\tif (default_slot) {\n \t\t\t\tdefault_slot.m(button, null);\n \t\t\t}\n\n \t\t\tcurrent = true;\n\n \t\t\tif (!mounted) {\n \t\t\t\tdispose = [\n \t\t\t\t\taction_destroyer(/*ripple*/ ctx[8].call(null, button)),\n \t\t\t\t\tlisten(button, \"click\", /*click_handler_3*/ ctx[42]),\n \t\t\t\t\tlisten(button, \"click\", /*click_handler_1*/ ctx[38]),\n \t\t\t\t\tlisten(button, \"mouseover\", /*mouseover_handler_1*/ ctx[39]),\n \t\t\t\t\tlisten(button, \"*\", /*_handler_1*/ ctx[40])\n \t\t\t\t];\n\n \t\t\t\tmounted = true;\n \t\t\t}\n \t\t},\n \t\tp(ctx, dirty) {\n \t\t\tif (/*icon*/ ctx[3]) {\n \t\t\t\tif (if_block) {\n \t\t\t\t\tif_block.p(ctx, dirty);\n\n \t\t\t\t\tif (dirty[0] & /*icon*/ 8) {\n \t\t\t\t\t\ttransition_in(if_block, 1);\n \t\t\t\t\t}\n \t\t\t\t} else {\n \t\t\t\t\tif_block = create_if_block_2$1(ctx);\n \t\t\t\t\tif_block.c();\n \t\t\t\t\ttransition_in(if_block, 1);\n \t\t\t\t\tif_block.m(button, t);\n \t\t\t\t}\n \t\t\t} else if (if_block) {\n \t\t\t\tgroup_outros();\n\n \t\t\t\ttransition_out(if_block, 1, 1, () => {\n \t\t\t\t\tif_block = null;\n \t\t\t\t});\n\n \t\t\t\tcheck_outros();\n \t\t\t}\n\n \t\t\tif (default_slot) {\n \t\t\t\tif (default_slot.p && dirty[1] & /*$$scope*/ 4096) {\n \t\t\t\t\tupdate_slot(default_slot, default_slot_template, ctx, /*$$scope*/ ctx[43], dirty, null, null);\n \t\t\t\t}\n \t\t\t}\n\n \t\t\tset_attributes(button, button_data = get_spread_update(button_levels, [\n \t\t\t\t(!current || dirty[0] & /*classes*/ 2) && { class: /*classes*/ ctx[1] },\n \t\t\t\t/*props*/ ctx[9],\n \t\t\t\t(!current || dirty[0] & /*type*/ 64) && { type: /*type*/ ctx[6] },\n \t\t\t\t(!current || dirty[0] & /*disabled*/ 4) && { disabled: /*disabled*/ ctx[2] }\n \t\t\t]));\n \t\t},\n \t\ti(local) {\n \t\t\tif (current) return;\n \t\t\ttransition_in(if_block);\n \t\t\ttransition_in(default_slot, local);\n \t\t\tcurrent = true;\n \t\t},\n \t\to(local) {\n \t\t\ttransition_out(if_block);\n \t\t\ttransition_out(default_slot, local);\n \t\t\tcurrent = false;\n \t\t},\n \t\td(detaching) {\n \t\t\tif (detaching) detach(button);\n \t\t\tif (if_block) if_block.d();\n \t\t\tif (default_slot) default_slot.d(detaching);\n \t\t\tmounted = false;\n \t\t\trun_all(dispose);\n \t\t}\n \t};\n }", "title": "" }, { "docid": "27e88f012f076846eec688fde2264039", "score": "0.5408485", "text": "function selectDiv(nbr) {\n reset();\n divs[nbr - 1].style.display = 'inline-block';\n // trying to move this here\n btns[nbr - 1].style.top = '2px';\n}", "title": "" }, { "docid": "95da0aaf0f3400423ae3e2613e2a7dc0", "score": "0.5396544", "text": "function toggleBlocks(event) {\n var targetBlock = event.target.parentElement;\n $('.region-header .active-header-block').not(targetBlock)\n .has(\".show-header-block:visible\")\n .removeClass('active-header-block')\n .children('.header-block-content').slideUp(resetVisible);\n\n $(this).next('.header-block-content').slideToggle(resetVisible)\n .parents('.block').toggleClass('active-header-block');\n }", "title": "" }, { "docid": "58d77eec38d7708fa83c9aa90d8d5698", "score": "0.53576756", "text": "function fixMoveButtons() {\n ['structure', 'resource'].forEach(function(block) {\n if($('.tbody .' + _blocks[block].parent, true).length > 1) {\n $('.tbody .btn-move-' + block, true).forEach(function(btn) {\n btn.style.visibility = '';\n })\n }\n else {\n $('.btn-move-' + block, true).forEach(function(btn) {\n btn.style.visibility = 'hidden';\n })\n }\n })\n}", "title": "" }, { "docid": "25455b4a073b8ff8080900d475ad8857", "score": "0.53476053", "text": "function stopMoveBlock() {\n\tif(moveTarget) {\n\t\tlet parts = moveTarget.id.split('_');\n\t\t// reset opacity\n\t\tmoveTarget.style.display = '';\n\t\tmoveTarget = false;\n\n let blocks = $('.block-placeholder', true);\n blocks.forEach(function(block) {\n block.remove();\n })\n\n\t\tif($(`.${parts[0]}`).length > 1) {\n\t\t // enable current buttons\n\t\t $(`#${parts[0]}_${parts[1]} button`).forEach(function(btn) {\n\t\t btn.disabled = '';\n\t\t })\n\t\t}\n\n $('.move-alert').style.display = 'none';\n\t}\n}", "title": "" }, { "docid": "6238042bd52069b6c49c114ca59aca85", "score": "0.532443", "text": "function unformatContentBlock()\n\t{\n\t\tthis.changeContentBlock('p');\n\t}", "title": "" }, { "docid": "cbe361d95bb66825c523cf7952acfec1", "score": "0.5315774", "text": "function removeBlock(){\n \n $.unblockUI();\n \n return false; \n \n }", "title": "" }, { "docid": "345e033c34f5e8bdd070e25be878895c", "score": "0.528227", "text": "draw_block_at(block_elt, x, y){\n if(x <= Workspace.suck_left_margin) {\n let dropped_on_block = Workspace.inst.spacer_elt_at(y) //document.elementFromPoint(x, y) fails due to wierd offset\n install_top_left_block(block_elt, dropped_on_block)\n clean_up_top_lefts()\n }\n else { //see blocks2.js block_drop_handler\n block_elt.classList.remove(\"block-top-left\")\n block_elt.classList.remove(\"arg_val\")\n block_elt.classList.add(\"block-absolute\")\n block_elt.style.position = \"absolute\" //note that setting its class to block-absolute SHOULD set its postion to \"absolute\" but it doesn't.\n block_elt.style.left = x + \"px\" //event.clientX + \"px\" //new_x + \"px\" // event.offsetX + \"px\"\n block_elt.style.top = y + \"px\" //event.clientX + \"px\" new_y + \"px\" //event.offsetY + \"px\"\n Workspace.inst.add_block_elt(block_elt)\n }\n focus_on_descendant_with_tag(block_elt)\n }", "title": "" }, { "docid": "bb6cec1dcea950d62e10712deebca121", "score": "0.52508485", "text": "function dropBlockOne() { // Drop Block One\t\n\t\t\tgridArray[b1_row+1][b1_col] = activeBlockOne;\n\t\t\tgridArray[b1_row][b1_col] = 0;\n\t\t\tb1_row = b1_row+1;\n\t\t}", "title": "" }, { "docid": "7f71093b7f4900723d8df85a9e0d2398", "score": "0.5245497", "text": "function removeFirstBlock() {\r\n\r\n\t\t$( \"#contentRow\" ).find( \".citizenAction\" ).css({ \"margin-top\" : \"-7px\" });\r\n\t\t$( \"#contentRow\" ).find( \".testDivblue\" ).eq(1).next().remove();\r\n\t\tvar firstBlock = $( \"#contentRow\" ).find( \".testDivblue\" ).eq(2);\r\n\t\tfirstBlock.next().remove();\r\n\t\tfirstBlock.remove();\r\n\t}", "title": "" }, { "docid": "df64e4181d13e5af0aea2fc5c4ad3977", "score": "0.52134526", "text": "function removeTTBlock() {\n if (validPointer($('#tt-needed-flowers-div'))) {$('#tt-needed-flowers-div').remove();}\n if (validPointer($('#tt-needed-plushies-div'))) {$('#tt-needed-plushies-div').remove();}\n }", "title": "" }, { "docid": "977cf547ea3d2d91a35610fa30eff5be", "score": "0.51834434", "text": "function unBlock(){\r\n\treturnInShop()\r\n}", "title": "" }, { "docid": "748b191735618f34a8ac7670690f2dad", "score": "0.51799166", "text": "function ws_stack_vertical(e,a,b){var f=jQuery;var h=f(this);var d=f(\"li\",b);var g=f(\"<div>\").addClass(\"ws_effect\").css({position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",overflow:\"hidden\"}).appendTo(b.parent());function c(m,j,k,i,l){if(e.support.transform&&e.support.transition){if(!j.transform){j.transform=\"\"}if(j.top){j.transform+=\" translate3d(0,\"+(j.top?j.top:0)+\"px,0)\"}delete j.top;j.transition=k+\"ms all \"+i+\"ms cubic-bezier(0.770, 0.000, 0.175, 1.000)\";m.css(j);if(l){setTimeout(l,k+i)}}else{if(l){m.animate(j,k,\"easeInOutExpo\",l)}else{m.css(j)}}}this.go=function(n,k,q,p){var j=(n-k+1)%d.length;if(Math.abs(p)>=1){j=(p>0)?0:1}j=!!j^!!e.revers;var l=(e.revers?1:-1)*b.height();d.each(function(r){if(j&&r!=k){this.style.zIndex=(Math.max(0,this.style.zIndex-1))}});var m=f(\"ul\",b);var i=f(d.get(j?n:k)).find(\"img\").clone().css({position:\"absolute\",\"z-index\":4,width:\"100%\",top:0}),o=f(d.get(j?k:n)).find(\"img\").clone().css({position:\"absolute\",\"z-index\":4,width:\"100%\",top:0});c(i,{top:(j?l:0)},e.duration,0);o.css(\"transform\",\"translate3d(0,\"+(j?0:-l*0.5)+\"px,0)\");if(j){o.appendTo(g);i.appendTo(g)}else{i.insertAfter(m);o.insertAfter(m)}if(!j){m.stop(true,true).hide().css({left:-n+\"00%\"});if(e.fadeOut){m.fadeIn(e.duration)}else{m.show()}}else{if(e.fadeOut){m.fadeOut(e.duration)}}setTimeout(function(){c(i,{top:(j?0:l)},e.duration,e.duration*(j?0:0.1),function(){h.trigger(\"effectEnd\");i.remove();o.remove()});c(o,{top:(j?2:0)*b.height()*0.5},e.duration,e.duration*(j?0.1:0))},0)}}", "title": "" }, { "docid": "7e2b1a6a51e01afd887925d09a7fb1cd", "score": "0.51747787", "text": "function removeTTBlock() {\n if (validPointer($('#tt-needed-flowers-div'))) {$('#tt-needed-flowers-div').remove();}\n if (validPointer($('#tt-needed-plushies-div'))) {$('#tt-needed-plushies-div').remove();}\n }", "title": "" }, { "docid": "7c4cb70ff2f23a7d5fc0b867dad805b1", "score": "0.5167803", "text": "function ws_stack_vertical(e,a,b){var f=jQuery;var h=f(this);var d=f(\"li\",b);var g=f(\"<div>\").addClass(\"ws_effect ws_stack_vertical\").css({position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",overflow:\"hidden\"}).appendTo(b);function c(m,j,k,i,l){if(e.support.transform&&e.support.transition){if(!j.transform){j.transform=\"\"}if(j.top){j.transform+=\" translate3d(0,\"+(j.top?j.top:0)+\"px,0)\"}delete j.top;j.transition=k+\"ms all \"+i+\"ms cubic-bezier(0.770, 0.000, 0.175, 1.000)\";m.css(j);if(l){m.on(\"transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd\",l)}}else{if(k){m.animate(j,k,\"easeInOutExpo\",l)}else{m.css(j)}}}this.go=function(n,k,q,p){var j=(n-k+1)%d.length;if(Math.abs(p)>=1){j=(p>0)?0:1}j=!!j^!!e.revers;var l=(e.revers?1:-1)*b.height();d.each(function(r){if(j&&r!=k){this.style.zIndex=(Math.max(0,this.style.zIndex-1))}});var m=f(\".ws_list\",b);var i=f(\"<div>\").css({position:\"absolute\",left:0,top:0,width:\"100%\",height:\"100%\",overflow:\"hidden\",zIndex:4}).append(f(a.get(j?n:k)).clone()),o=f(\"<div>\").css({position:\"absolute\",left:0,top:0,width:\"100%\",height:\"100%\",overflow:\"hidden\",zIndex:4}).append(f(a.get(j?k:n)).clone());if(e.responsive<3){i.find(\"img\").css(\"width\",\"100%\");o.find(\"img\").css(\"width\",\"100%\")}c(i,{top:(j?l:0)});c(o,{top:(j?0:-l*0.5)});if(j){o.appendTo(g);i.appendTo(g)}else{i.insertAfter(m);o.insertAfter(m)}if(!j){m.stop(true,true).hide().css({left:-n+\"00%\"});if(e.fadeOut){m.fadeIn(e.duration)}else{m.show()}}else{if(e.fadeOut){m.fadeOut(e.duration)}}setTimeout(function(){c(i,{top:(j?0:l)},e.duration,e.duration*(j?0:0.1),function(){h.trigger(\"effectEnd\");i.remove();o.remove()});c(o,{top:(j?1:0)*b.height()*0.5},e.duration,e.duration*(j?0.1:0))},0)}}", "title": "" }, { "docid": "39a6e91c72b812acb3fe5eaa55d87b1e", "score": "0.5145632", "text": "function buttonClick() {\n alert(\"Button has been clicked\");\n createBlock(objCB);\n }", "title": "" }, { "docid": "38e4091a66a0679f5db59b0a6322ffbb", "score": "0.51423836", "text": "function _createBackBlock() {\n var backBlock = _.create('li', 'menu-back back-block');\n backBlock.innerHTML = 'Back';\n return backBlock;\n }", "title": "" }, { "docid": "1d0a30f45a55089275b87b29f711f083", "score": "0.5141954", "text": "function fixInsertButton() {\n $('button.button-insert').forEach(function(el) {\n // add events for inserting blocks\n el.addEventListener('click', sendInsertBlock);\n })\n}", "title": "" }, { "docid": "ceba9575f55de5eed717cebb383e843b", "score": "0.5137566", "text": "function BlockInspectorButton({\n onClick = () => {}\n}) {\n const {\n shortcut,\n isBlockInspectorOpen\n } = (0,external_wp_data_namespaceObject.useSelect)(select => ({\n shortcut: select(external_wp_keyboardShortcuts_namespaceObject.store).getShortcutRepresentation('core/edit-site/toggle-block-settings-sidebar'),\n isBlockInspectorOpen: select(store_store).getActiveComplementaryArea(store.name) === SIDEBAR_BLOCK\n }), []);\n const {\n enableComplementaryArea,\n disableComplementaryArea\n } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);\n const label = isBlockInspectorOpen ? (0,external_wp_i18n_namespaceObject.__)('Hide more settings') : (0,external_wp_i18n_namespaceObject.__)('Show more settings');\n return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {\n onClick: () => {\n if (isBlockInspectorOpen) {\n disableComplementaryArea(STORE_NAME);\n (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Block settings closed'));\n } else {\n enableComplementaryArea(STORE_NAME, SIDEBAR_BLOCK);\n (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Additional settings are now available in the Editor block settings sidebar'));\n } // Close dropdown menu.\n\n\n onClick();\n },\n shortcut: shortcut\n }, label);\n}", "title": "" }, { "docid": "3d2422a1e9f6eff612365e38e8d33e49", "score": "0.513375", "text": "popTop() {\r\n\t\tthis.myPile.pop();\r\n\t\tif (this.myPile.length == 0) {\r\n\t\t\tthis.emptyColumnButton.style.display = \"block\";\r\n\t\t\tthis.mySuit = -1;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "0bf9376fa83f28186d9674d22ee7a24a", "score": "0.51282114", "text": "stopNoWrap () {\n this._stackItem.isNoWrap = false;\n }", "title": "" }, { "docid": "05fd58a8ca03ed514aa96cce67ca19af", "score": "0.51261544", "text": "function sortUpClicked(e, id)\r\n\t{\r\n\t\t// Stop event percolating up the DOM\r\n\t\te.preventDefault();\r\n\t\t\r\n\t\t// Take the perimeter boundry down and lose the idea of a currently selected block\r\n\t\tbench.unselectLastSelectedBlock();\r\n\t\r\n\t\t// Assumption is that the template has an enumerated value\r\n\t\tvar stackIdx = bench.isolateEnum(id) - 1;\r\n\t//\t\t\t$('#' + id).hide();\r\n\t\r\n\t\t// Switch the order in the data array first\r\n\t\tvar block = blockStack[stackIdx];\r\n\t\tvar other_block = blockStack[stackIdx - 1];\r\n\t\tblockStack.splice(stackIdx - 1, 2, block, other_block); // switch the order\r\n\r\n\t\t// Hide the previous templates since they are no longer accurate\r\n\t\t$('#' + block.getBlockID()).hide();\r\n\t\t$('#' + other_block.getBlockID()).hide();\r\n\t\r\n\t\t// recalculate the ids and redisplay the new order\r\n\t\tbench.fillBlock(stackIdx, blockStack[stackIdx - 1], true);\r\n\t\tbench.fillBlock(stackIdx + 1, blockStack[stackIdx], true);\r\n\t\tvar theBlock = '#' + blockStack[stackIdx - 1].getBlockID();\r\n\t\tdocument.getElementById(blockStack[stackIdx - 1].getBlockID()).scrollIntoView();\r\n\t\t$(theBlock).click(); // select the template we moved\r\n\t}", "title": "" }, { "docid": "5d28abd82b5c446e2388e0d83059fc83", "score": "0.51223326", "text": "thematicBreak() {\n const block = {\n object: 'block',\n isVoid: true,\n type: 'horizontal_rule',\n };\n this.stack.append(block);\n }", "title": "" }, { "docid": "80d8383d7f5591f94629b8e6c25f65e0", "score": "0.51049215", "text": "blockHeaderElements() {\n var scrollerArr = this._getPaneScrollerArr();\n for (var i = 0; i < scrollerArr.length; i++) {\n scrollerArr[i].getHeader().getBlocker().blockContent(20);\n }\n this.getChildControl(\"column-button\").getBlocker().blockContent(20);\n }", "title": "" }, { "docid": "20baf9a725ad90dca40be5336b1fb0af", "score": "0.51042604", "text": "function create_if_block_1$s(ctx) {\n\t\tlet uibutton;\n\t\tlet current;\n\t\tconst uibutton_spread_levels = [/*closeButton*/ ctx[0]];\n\t\tlet uibutton_props = {};\n\n\t\tfor (let i = 0; i < uibutton_spread_levels.length; i += 1) {\n\t\t\tuibutton_props = assign(uibutton_props, uibutton_spread_levels[i]);\n\t\t}\n\n\t\tuibutton = new Ui_button({ props: uibutton_props });\n\n\t\treturn {\n\t\t\tc() {\n\t\t\t\tcreate_component(uibutton.$$.fragment);\n\t\t\t},\n\t\t\tm(target, anchor) {\n\t\t\t\tmount_component(uibutton, target, anchor);\n\t\t\t\tcurrent = true;\n\t\t\t},\n\t\t\tp(ctx, dirty) {\n\t\t\t\tconst uibutton_changes = (dirty & /*closeButton*/ 1)\n\t\t\t\t? get_spread_update(uibutton_spread_levels, [get_spread_object(/*closeButton*/ ctx[0])])\n\t\t\t\t: {};\n\n\t\t\t\tuibutton.$set(uibutton_changes);\n\t\t\t},\n\t\t\ti(local) {\n\t\t\t\tif (current) return;\n\t\t\t\ttransition_in(uibutton.$$.fragment, local);\n\t\t\t\tcurrent = true;\n\t\t\t},\n\t\t\to(local) {\n\t\t\t\ttransition_out(uibutton.$$.fragment, local);\n\t\t\t\tcurrent = false;\n\t\t\t},\n\t\t\td(detaching) {\n\t\t\t\tdestroy_component(uibutton, detaching);\n\t\t\t}\n\t\t};\n\t}", "title": "" }, { "docid": "5c858272b78e571aa650f04d08ba353f", "score": "0.5090926", "text": "toggleStacked() {\n this.setState({\n stacked: !this.state.stacked\n });\n }", "title": "" }, { "docid": "15055a7fb6fd690baec985a156e95027", "score": "0.5083697", "text": "function closeButton() {\n\n block.removeClass('active');\n $('.block, .page-container').css('transition', '');\n block.css('cursor', 'pointer');\n history.pushState(null, null, ' ');\n if (screen.width < 850) {\n block.css('display', 'block');\n }\n}", "title": "" }, { "docid": "9653d5e1fe4b80ece74c2cde3c991e88", "score": "0.5065229", "text": "function subtractLine() {\n app.executeMenuCommand('Make Planet X');\n app.executeMenuCommand('Expand Planet X');\n if (selection[0].pageItems.length === 1) app.executeMenuCommand('ungroup');\n selection[0].groupItems[selection[0].groupItems.length - 1].remove();\n app.executeMenuCommand('ungroup');\n}", "title": "" }, { "docid": "8b8e0304b480abe99417ac17990c01de", "score": "0.5059668", "text": "function create_else_block(ctx) {\n\t\tlet uibutton;\n\t\tlet current;\n\n\t\tuibutton = new Ui_button({\n\t\t\t\tprops: {\n\t\t\t\t\ttitle: \"Поиск\",\n\t\t\t\t\ticon: \"search\",\n\t\t\t\t\tsize: \"large\",\n\t\t\t\t\tclasses: \" is-fullwidth \",\n\t\t\t\t\taction: /*toggleForm*/ ctx[3]\n\t\t\t\t}\n\t\t\t});\n\n\t\treturn {\n\t\t\tc() {\n\t\t\t\tcreate_component(uibutton.$$.fragment);\n\t\t\t},\n\t\t\tm(target, anchor) {\n\t\t\t\tmount_component(uibutton, target, anchor);\n\t\t\t\tcurrent = true;\n\t\t\t},\n\t\t\tp: noop,\n\t\t\ti(local) {\n\t\t\t\tif (current) return;\n\t\t\t\ttransition_in(uibutton.$$.fragment, local);\n\t\t\t\tcurrent = true;\n\t\t\t},\n\t\t\to(local) {\n\t\t\t\ttransition_out(uibutton.$$.fragment, local);\n\t\t\t\tcurrent = false;\n\t\t\t},\n\t\t\td(detaching) {\n\t\t\t\tdestroy_component(uibutton, detaching);\n\t\t\t}\n\t\t};\n\t}", "title": "" }, { "docid": "d0d2d986b36b2e7708c921b96e0f0233", "score": "0.50593925", "text": "startNoWrap () {\n this._stackItem.isNoWrap = true;\n }", "title": "" }, { "docid": "3277d8501eb3d0d0a461bf2cb6554d7c", "score": "0.50394326", "text": "function toggleBlockBtnBg() {\n els.block_btn.style.background = isBlocking() ? 'green' : 'red';\n}", "title": "" }, { "docid": "7eec905fbcaf843969ccc02cd3e61f5a", "score": "0.50244635", "text": "function subtractShape() {\n app.executeMenuCommand('group');\n app.executeMenuCommand('Live Pathfinder Subtract');\n app.executeMenuCommand('expandStyle');\n app.executeMenuCommand('ungroup');\n}", "title": "" }, { "docid": "cc275dda5679034fdffd6905b6e2dd83", "score": "0.50230473", "text": "function removeLeft() { \n\t\t$('#button-right').css('display', 'block');\n\t\t\n\t\tif (point===0) {\n\t\t\t$('#button-left').css('display', 'none');\t\n\t\t}\n\t}", "title": "" }, { "docid": "52fbe7fd4779fbe637fcd90283a642fb", "score": "0.50157934", "text": "deleteBlock(event) {\n let blocksCount = this.blocksTarget.querySelectorAll(':scope > .repeater-item').length;\n\n if (this.options.min && blocksCount <= this.options.min) {\n alert(`Minimum number of blocks reached`);\n return;\n }\n\n event.currentTarget.closest('.repeater-item').remove();\n\n this.sort()\n .checkEmpty();\n\n return this;\n }", "title": "" }, { "docid": "d3349c83cb8d2656e9f8705ccc062be2", "score": "0.5011759", "text": "function toggleBlock(block, init) {\n $(block).toggleClass('visible');\n $('.visible').not(block).removeClass('visible');\n $(init).toggleClass('active').siblings('.active').removeClass('active');\n return false;\n}", "title": "" }, { "docid": "ee8145866261bb11e150001a011749c8", "score": "0.5010617", "text": "function hook_block_view(delta, region) {\n}", "title": "" }, { "docid": "7c526fb1dd0e9c59693d167348fcdb4b", "score": "0.5002033", "text": "function showPhotoRemovingBlock(e) {\n\t\te.preventDefault();\n\t\t$(\".photo-editing\").slideUp(300);\n\t\t$(\".photo-removing\").slideDown(300);\n\t}", "title": "" }, { "docid": "09b7de7ac01cda973ee95458d91366a7", "score": "0.49975136", "text": "function registerButton(block)\n{\n var video=block;\n var button=document.createElement(\"input\");\n button.type='button';\n button.class='getVideo';\n button.value='Send Video To external player';\n button.addEventListener('click',function(){sendUrlToBg(video.src);});\n //To add a visible button we need to know which parent is visible - which is a pain...\n block.parentNode.parentNode.parentNode.appendChild(button);\n //block.parentNode.parentNode.parentNode.append(button);\n}", "title": "" }, { "docid": "bc610932a8c0682ac09ee317e229ab1c", "score": "0.49923867", "text": "function ocultar(btn){\n\tbtn.parentNode.style.display ='none';\n}", "title": "" }, { "docid": "f8558fe1dd644b93eada1fe9f64d1b53", "score": "0.49866655", "text": "render() {\n // eslint-disable-next-line no-unused-vars\n let baseStyle = {};\n // eslint-disable-next-line no-unused-vars\n let layoutFlowStyle = {};\n \n const style_mask = {\n backgroundImage: 'url('+img_elMask+')',\n backgroundSize: '100% 100%',\n pointerEvents: 'none',\n };\n const style_buttonstack = {\n backgroundImage: 'url('+img_elButtonstack+')',\n backgroundSize: '100% 100%',\n pointerEvents: 'none',\n };\n const style_title = {\n fontSize: 15.4,\n fontFamily: \"'Helvetica-Bold', sans-serif\",\n color: 'rgba(166, 167, 171, 0.8000)',\n textAlign: 'center',\n pointerEvents: 'none',\n };\n \n return (\n <div className=\"Buttonstack\" style={baseStyle}>\n <div className=\"compContent\">\n <div className='elMask' style={style_mask} />\n <div className='elButtonstack' style={style_buttonstack} />\n <div className='elTitle' style={style_title}>\n <div>{this.props.locStrings.buttonstack_title_282944}</div>\n </div>\n </div>\n </div>\n )\n }", "title": "" }, { "docid": "35841ad04a3bd25a10130bb1dc606287", "score": "0.4981968", "text": "function unblockElement(ele) {\n $(ele).removeAttr(\"data-last-position\");\n $(ele).find(\".blockCover\").remove();\n $(ele).removeClass('blocked');\n}", "title": "" }, { "docid": "ff53d4af5375ed0f6f7a9d3d48ce310b", "score": "0.4979198", "text": "function BlockMover(_ref) {\n\tvar onMoveUp = _ref.onMoveUp,\n\t onMoveDown = _ref.onMoveDown,\n\t isFirst = _ref.isFirst,\n\t isLast = _ref.isLast,\n\t uids = _ref.uids,\n\t blockType = _ref.blockType,\n\t firstIndex = _ref.firstIndex,\n\t isLocked = _ref.isLocked,\n\t instanceId = _ref.instanceId;\n\n\tif (isLocked) {\n\t\treturn null;\n\t}\n\n\t// We emulate a disabled state because forcefully applying the `disabled`\n\t// attribute on the button while it has focus causes the screen to change\n\t// to an unfocused state (body as active element) without firing blur on,\n\t// the rendering parent, leaving it unable to react to focus out.\n\treturn wp.element.createElement(\n\t\t'div',\n\t\t{ className: 'editor-block-mover' },\n\t\twp.element.createElement(__WEBPACK_IMPORTED_MODULE_3__wordpress_components__[\"t\" /* IconButton */], {\n\t\t\tclassName: 'editor-block-mover__control',\n\t\t\tonClick: isFirst ? null : onMoveUp,\n\t\t\ticon: __WEBPACK_IMPORTED_MODULE_9__arrows__[\"b\" /* upArrow */],\n\t\t\tlabel: Object(__WEBPACK_IMPORTED_MODULE_2__wordpress_i18n__[\"a\" /* __ */])('Move up'),\n\t\t\t'aria-describedby': 'editor-block-mover__up-description-' + instanceId,\n\t\t\t'aria-disabled': isFirst\n\t\t}),\n\t\twp.element.createElement(__WEBPACK_IMPORTED_MODULE_3__wordpress_components__[\"t\" /* IconButton */], {\n\t\t\tclassName: 'editor-block-mover__control',\n\t\t\tonClick: isLast ? null : onMoveDown,\n\t\t\ticon: __WEBPACK_IMPORTED_MODULE_9__arrows__[\"a\" /* downArrow */],\n\t\t\tlabel: Object(__WEBPACK_IMPORTED_MODULE_2__wordpress_i18n__[\"a\" /* __ */])('Move down'),\n\t\t\t'aria-describedby': 'editor-block-mover__down-description-' + instanceId,\n\t\t\t'aria-disabled': isLast\n\t\t}),\n\t\twp.element.createElement(\n\t\t\t'span',\n\t\t\t{ id: 'editor-block-mover__up-description-' + instanceId, className: 'editor-block-mover__description' },\n\t\t\tObject(__WEBPACK_IMPORTED_MODULE_7__mover_description__[\"a\" /* getBlockMoverDescription */])(uids.length, blockType && blockType.title, firstIndex, isFirst, isLast, -1)\n\t\t),\n\t\twp.element.createElement(\n\t\t\t'span',\n\t\t\t{ id: 'editor-block-mover__down-description-' + instanceId, className: 'editor-block-mover__description' },\n\t\t\tObject(__WEBPACK_IMPORTED_MODULE_7__mover_description__[\"a\" /* getBlockMoverDescription */])(uids.length, blockType && blockType.title, firstIndex, isFirst, isLast, 1)\n\t\t)\n\t);\n}", "title": "" }, { "docid": "fc18e6b667cb84a744a44af3cffb4b79", "score": "0.49716347", "text": "function piranha_plant_click(block) {\n if(!block.clicked) {\n block.clicked = true;\n game.add.tween(block).to({ y: block.y - 1.5 * 16 * settings.scale }, 1200, null, true);\n game.time.events.add(Phaser.Timer.SECOND * 2.4, function() {\n game.add.tween(block).to({ y: block.y + 1.5 * 16 * settings.scale }, 1200, null, true).onComplete.add(function() {\n game.time.events.add(Phaser.Timer.SECOND * 3, function() {block.clicked = false}, this);\n }, this);\n });\n }\n}", "title": "" }, { "docid": "6fee46993b119225d102037e625bc725", "score": "0.49657547", "text": "function removeRight() { \n\t\t$('#button-left').css('display', 'block');\n\t\t\n\t\tif (point===arr.length-1) {\n\t\t\t$('#button-right').css('display', 'none');\n\t\t}\n\t}", "title": "" }, { "docid": "11bd1cf0b9e7c911eba239062765a810", "score": "0.4964661", "text": "function swapButtonsDivOnTop() {\n cardOnTopButtonDiv.appendChild(addToCartButtonDivOnTop);\n addToCartButtonDivOnTop.setAttribute('class', 'btn btn-success disabled');\n addToCartButtonDivOnTop.textContent = 'Added';\n varnishDivOnTop.disabled = true;\n numberOfItemsDivOnTop.disabled = true;\n removeFromCartButtonDivOnTop.setAttribute('class', 'btn btn-danger');\n cardOnTopButtonDiv.appendChild(removeFromCartButtonDivOnTop);\n removeFromCartButtonDivOnTop.textContent = 'Remove item';\n }", "title": "" }, { "docid": "cdee3d872e242ef6d1a64506d76875a2", "score": "0.49597913", "text": "hide() {\n push();\n tint(255, 0);\n image(this.img,this.x,this.y,this.size,this.size);\n pop();\n }", "title": "" }, { "docid": "35f1ae6138abfcbb4d3da29ce2bad779", "score": "0.49567738", "text": "unlockGroupElements(){\n\t\tPaneObject.activateChildren(this);\n\t}", "title": "" }, { "docid": "552574974ef5ef306789dbf22160ee6b", "score": "0.49475396", "text": "printBlocks(){\n \n \n return (\n <div>\n \n {this.state.blocks.map((person, index) => (\n <div className='requests'><p key={index}>{person.blocked}</p>\n <button onClick = {this.unblock} data5 = {person.blocked}>Unblock</button>\n </div>\n \n ))}\n </div>\n )\n \n\n }", "title": "" }, { "docid": "0d37fe74acd6e53914166629d3aeb581", "score": "0.49463716", "text": "function BlockRemoveButton(_ref) {\n\tvar onRemove = _ref.onRemove,\n\t _ref$onClick = _ref.onClick,\n\t onClick = _ref$onClick === undefined ? __WEBPACK_IMPORTED_MODULE_0_lodash_noop___default.a : _ref$onClick,\n\t isLocked = _ref.isLocked,\n\t _ref$small = _ref.small,\n\t small = _ref$small === undefined ? false : _ref$small;\n\n\tif (isLocked) {\n\t\treturn null;\n\t}\n\n\tvar label = Object(__WEBPACK_IMPORTED_MODULE_3__wordpress_i18n__[\"a\" /* __ */])('Remove');\n\n\treturn wp.element.createElement(\n\t\t__WEBPACK_IMPORTED_MODULE_4__wordpress_components__[\"t\" /* IconButton */],\n\t\t{\n\t\t\tclassName: 'editor-block-settings-menu__control',\n\t\t\tonClick: __WEBPACK_IMPORTED_MODULE_1_lodash_flow___default()(onRemove, onClick),\n\t\t\ticon: 'trash',\n\t\t\tlabel: small ? label : undefined\n\t\t},\n\t\t!small && label\n\t);\n}", "title": "" }, { "docid": "6d4ebcb47b3155b9042ee52402dca0c9", "score": "0.4940306", "text": "function o_cta_btn(){\n if($('.leftorright').length !== 0){\n\n $('.leftorright').each(function(){\n $('.col', this).o_equal_height();\n });\n }\n }", "title": "" }, { "docid": "1011024a36624b19728f0837251abd5f", "score": "0.49397892", "text": "handleAddBlockButtonClick (e) {\n this.props.addBlockToLongform()\n }", "title": "" }, { "docid": "2f104fbb5da58a6152868a84da4a7f2c", "score": "0.49367544", "text": "function depressButton() {\n if (clicked) {\n buttonPosition.z += 0.05;\n clicked = false;\n }\n }", "title": "" }, { "docid": "33818bd8ed08ab58fb55ee960649d18d", "score": "0.49331206", "text": "showNextBlock(block) {\n windowCtx.clearRect(0, 0, 100, 100);\n for (let i = 0; i < 4; i++) {\n for (let j = 0; j < 4; j++) {\n if (block.rotations[0][i][j]) {\n this.createRect(j, i, block.color, windowCtx);\n }\n }\n }\n }", "title": "" }, { "docid": "e07cd02bc5f9488eb54739c623ff79e4", "score": "0.49311623", "text": "function mergeBlock() {\n debug$3('mergeBlock');\n\n /**\n * The delay is required because hitting `enter`, `enter` then `backspace`\n * in a word results in the cursor being one position to the right in\n * Android 9.\n *\n * Slate sets the position to `0` and we even check it immediately after\n * setting it and it is correct, but somewhere Android moves it to the right.\n *\n * This happens only when using the virtual keyboard. Hitting enter on a\n * hardware keyboard does not trigger this bug.\n *\n * The call to `focus` is required because when we switch examples then\n * merge a block, we lose focus in Android 9 (possibly others).\n */\n\n win.requestAnimationFrame(function () {\n renderSync(editor, function () {\n applyDiff();\n\n editor.select(last.range).deleteBackward().focus().restoreDOM();\n\n clearAction();\n });\n });\n }", "title": "" }, { "docid": "18c96e31d72ed0469453b54bf067fa00", "score": "0.49282092", "text": "blocks(e){\n return true;\n }", "title": "" }, { "docid": "cb324bdcf27dac20093343f33efa5d8a", "score": "0.4926639", "text": "function riverbuttonClicked(button, river) {\n if (river.expanded === 0) {\n river.expanded = 1\n createExpansion(button, river)\n }\n else {\n //Delete the expansion.\n river.expanded = 0\n var elem = document.getElementById(river.base + 2)\n if (elem) {\n elem.parentNode.removeChild(elem)\n }\n\n }\n}", "title": "" }, { "docid": "14d43fe678592560f2f9804a67bdaa12", "score": "0.4905671", "text": "function blockDecorWrap(block) {\n const blockWidth = $('.main-card').width();\n $(block).css('right', ((windowWidth() - blockWidth) / -2) + 32);\n}", "title": "" }, { "docid": "d46b4ddf6b233fb95e1d8e04eb695c23", "score": "0.49056378", "text": "uiEvtMouseUpPerformed(x, y) {\r\n if(this.isInnerBtn(x, y)){\r\n this.m_btn_pushed = false;\r\n this.m_btn_over = true;\r\n return true;\r\n }\r\n this.m_btn_pushed = false;\r\n this.m_btn_over = false;\r\n return false;\r\n }", "title": "" }, { "docid": "1f20d6764b91a6f5dc73eedb8314da10", "score": "0.49019", "text": "function oButton(){\n\t\tprocessLocal();\n\t\tgetTypes(info, \"Outside\");\n\t\tbuttonPress(info, OUT);\n\t}", "title": "" }, { "docid": "9bb72e456814da747fd6cee5cd6ae914", "score": "0.48995766", "text": "function create_if_block$E(ctx) {\n\t\tlet div;\n\t\tlet t;\n\t\tlet div_transition;\n\t\tlet current;\n\t\tlet mounted;\n\t\tlet dispose;\n\t\tlet if_block = /*closeButton*/ ctx[0] && create_if_block_1$u(ctx);\n\t\tconst default_slot_template = /*#slots*/ ctx[9].default;\n\t\tconst default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[8], null);\n\n\t\treturn {\n\t\t\tc() {\n\t\t\t\tdiv = element(\"div\");\n\t\t\t\tif (if_block) if_block.c();\n\t\t\t\tt = space();\n\t\t\t\tif (default_slot) default_slot.c();\n\t\t\t\tattr(div, \"class\", \"is-overlay not-overlay\");\n\t\t\t\tset_style(div, \"z-index\", zIndexStep * /*layer*/ ctx[3]);\n\t\t\t},\n\t\t\tm(target, anchor) {\n\t\t\t\tinsert(target, div, anchor);\n\t\t\t\tif (if_block) if_block.m(div, null);\n\t\t\t\tappend(div, t);\n\n\t\t\t\tif (default_slot) {\n\t\t\t\t\tdefault_slot.m(div, null);\n\t\t\t\t}\n\n\t\t\t\tcurrent = true;\n\n\t\t\t\tif (!mounted) {\n\t\t\t\t\tdispose = listen(div, \"click\", /*overlayClick*/ ctx[4]);\n\t\t\t\t\tmounted = true;\n\t\t\t\t}\n\t\t\t},\n\t\t\tp(ctx, dirty) {\n\t\t\t\tif (/*closeButton*/ ctx[0]) {\n\t\t\t\t\tif (if_block) {\n\t\t\t\t\t\tif_block.p(ctx, dirty);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif_block = create_if_block_1$u(ctx);\n\t\t\t\t\t\tif_block.c();\n\t\t\t\t\t\tif_block.m(div, t);\n\t\t\t\t\t}\n\t\t\t\t} else if (if_block) {\n\t\t\t\t\tif_block.d(1);\n\t\t\t\t\tif_block = null;\n\t\t\t\t}\n\n\t\t\t\tif (default_slot) {\n\t\t\t\t\tif (default_slot.p && dirty & /*$$scope*/ 256) {\n\t\t\t\t\t\tupdate_slot(default_slot, default_slot_template, ctx, /*$$scope*/ ctx[8], dirty, null, null);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!current || dirty & /*layer*/ 8) {\n\t\t\t\t\tset_style(div, \"z-index\", zIndexStep * /*layer*/ ctx[3]);\n\t\t\t\t}\n\t\t\t},\n\t\t\ti(local) {\n\t\t\t\tif (current) return;\n\t\t\t\ttransition_in(default_slot, local);\n\n\t\t\t\tadd_render_callback(() => {\n\t\t\t\t\tif (!div_transition) div_transition = create_bidirectional_transition(div, fade, {}, true);\n\t\t\t\t\tdiv_transition.run(1);\n\t\t\t\t});\n\n\t\t\t\tcurrent = true;\n\t\t\t},\n\t\t\to(local) {\n\t\t\t\ttransition_out(default_slot, local);\n\t\t\t\tif (!div_transition) div_transition = create_bidirectional_transition(div, fade, {}, false);\n\t\t\t\tdiv_transition.run(0);\n\t\t\t\tcurrent = false;\n\t\t\t},\n\t\t\td(detaching) {\n\t\t\t\tif (detaching) detach(div);\n\t\t\t\tif (if_block) if_block.d();\n\t\t\t\tif (default_slot) default_slot.d(detaching);\n\t\t\t\tif (detaching && div_transition) div_transition.end();\n\t\t\t\tmounted = false;\n\t\t\t\tdispose();\n\t\t\t}\n\t\t};\n\t}", "title": "" }, { "docid": "2853a850d9f0d1106dfc97c7b46aa4c3", "score": "0.48819014", "text": "function mouseOutCard(){\n var delete_button = this.querySelector('button');\n delete_button.style.opacity = 0;\n var restore_button = this.querySelector('#btn-restore');\n restore_button.style.opacity = 0;\n}", "title": "" }, { "docid": "e9660da1a3c5143b3cfc821b10a2df48", "score": "0.48761728", "text": "function create_if_block$1(ctx) {\n \tlet div;\n \tlet t;\n \tlet div_transition;\n \tlet current;\n \tlet dispose;\n \tlet if_block = /*closeButton*/ ctx[0] && create_if_block_1(ctx);\n \tconst default_slot_template = /*$$slots*/ ctx[10].default;\n \tconst default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[11], null);\n\n \treturn {\n \t\tc() {\n \t\t\tdiv = element(\"div\");\n \t\t\tif (if_block) if_block.c();\n \t\t\tt = space();\n \t\t\tif (default_slot) default_slot.c();\n \t\t\tattr(div, \"class\", \"not-overlay svelte-15dptf1\");\n \t\t},\n \t\tm(target, anchor, remount) {\n \t\t\tinsert(target, div, anchor);\n \t\t\tif (if_block) if_block.m(div, null);\n \t\t\tappend(div, t);\n\n \t\t\tif (default_slot) {\n \t\t\t\tdefault_slot.m(div, null);\n \t\t\t}\n\n \t\t\tcurrent = true;\n \t\t\tif (remount) dispose();\n \t\t\tdispose = listen(div, \"click\", /*overlayClick*/ ctx[2]);\n \t\t},\n \t\tp(ctx, dirty) {\n \t\t\tif (/*closeButton*/ ctx[0]) {\n \t\t\t\tif (if_block) {\n \t\t\t\t\tif_block.p(ctx, dirty);\n\n \t\t\t\t\tif (dirty & /*closeButton*/ 1) {\n \t\t\t\t\t\ttransition_in(if_block, 1);\n \t\t\t\t\t}\n \t\t\t\t} else {\n \t\t\t\t\tif_block = create_if_block_1(ctx);\n \t\t\t\t\tif_block.c();\n \t\t\t\t\ttransition_in(if_block, 1);\n \t\t\t\t\tif_block.m(div, t);\n \t\t\t\t}\n \t\t\t} else if (if_block) {\n \t\t\t\tgroup_outros();\n\n \t\t\t\ttransition_out(if_block, 1, 1, () => {\n \t\t\t\t\tif_block = null;\n \t\t\t\t});\n\n \t\t\t\tcheck_outros();\n \t\t\t}\n\n \t\t\tif (default_slot) {\n \t\t\t\tif (default_slot.p && dirty & /*$$scope*/ 2048) {\n \t\t\t\t\tdefault_slot.p(get_slot_context(default_slot_template, ctx, /*$$scope*/ ctx[11], null), get_slot_changes(default_slot_template, /*$$scope*/ ctx[11], dirty, null));\n \t\t\t\t}\n \t\t\t}\n \t\t},\n \t\ti(local) {\n \t\t\tif (current) return;\n \t\t\ttransition_in(if_block);\n \t\t\ttransition_in(default_slot, local);\n\n \t\t\tadd_render_callback(() => {\n \t\t\t\tif (!div_transition) div_transition = create_bidirectional_transition(div, fade, {}, true);\n \t\t\t\tdiv_transition.run(1);\n \t\t\t});\n\n \t\t\tcurrent = true;\n \t\t},\n \t\to(local) {\n \t\t\ttransition_out(if_block);\n \t\t\ttransition_out(default_slot, local);\n \t\t\tif (!div_transition) div_transition = create_bidirectional_transition(div, fade, {}, false);\n \t\t\tdiv_transition.run(0);\n \t\t\tcurrent = false;\n \t\t},\n \t\td(detaching) {\n \t\t\tif (detaching) detach(div);\n \t\t\tif (if_block) if_block.d();\n \t\t\tif (default_slot) default_slot.d(detaching);\n \t\t\tif (detaching && div_transition) div_transition.end();\n \t\t\tdispose();\n \t\t}\n \t};\n }", "title": "" }, { "docid": "807d20387427532fe8d4273fed622a83", "score": "0.48723796", "text": "bumpBlock(block) {\n this.dy *= -1;\n // When the ball hits a block, the block must be destroyed\n block.active = false;\n }", "title": "" }, { "docid": "b97d858f63ed2b6ec91fa13f8da8bbef", "score": "0.48661163", "text": "toFront() {\n this.get('group').toFront();\n }", "title": "" }, { "docid": "b2c4405a88a20661e22a5de908858be8", "score": "0.4861173", "text": "function unsliceAndStay(e) {\n\tvar screenOffset = $(e.target).offset().top - $(window).scrollTop();\n\tunslice();\n\t$(window).scrollTop($(e.target).offset().top - screenOffset);\n}", "title": "" }, { "docid": "1f6bb00df1592ca5b32646efea607319", "score": "0.48506182", "text": "function bttn_effect() {\n if ($('.amazing_buttons a').hasClass('btn_1')) {\n $('.btn_1').append('<svg><rect x=\"0\" y=\"0\" fill=\"none\" width=\"100%\" height=\"100%\"></rect></svg>');\n }\n}", "title": "" }, { "docid": "acb77a6e2aba0b85ea3587a70b09ff01", "score": "0.48502305", "text": "pop() {\n if (this.primero) {\n const boton=document.getElementById(\"b1\")\n const selecBtn = document.getElementById(\"btn\"+this.primero.animate.id)\n selecBtn.classList=\"animate__animated animate__hinge\"\n const sClone = selecBtn.cloneNode(true)\n selecBtn.parentNode.replaceChild(sClone, selecBtn)\n const a1= setInterval(function(){\n //Eliminando el botón\n const padre = sClone.parentNode\n padre.removeChild(sClone)\n clearInterval(a1)\n },2000)\n\n if (this.primero.siguiente) {\n const nodoAux = this.primero.siguiente;\n this.primero = nodoAux;\n\n this.primero.animate.x= (boton.offsetWidth/2) - (nodoAux.animate.disBtn/2)\n this.primero.animate.y= 20\n\n const selecBtnNuevo = document.getElementById(\"btn\"+this.primero.animate.id)\n selecBtnNuevo.classList=\"animate__animated animate__slideInUp\"\n const sClone3 = selecBtnNuevo.cloneNode(true)\n selecBtnNuevo.parentNode.replaceChild(sClone3, selecBtnNuevo)\n sClone3.style.left =(this.primero.animate.x).toString()+\"px\"\n sClone3.style.top =(this.primero.animate.y).toString()+\"px\"\n\n this.reOrdenar(this.primero)\n } else {\n this.primero = null;\n }\n }\n }", "title": "" }, { "docid": "6ab3abdecb7222ea55e6b5948856e631", "score": "0.48483562", "text": "function undo_segment() {\n\tbackup.pop();\n\tupdate_panel();\n\tundo_code_box();\n}", "title": "" }, { "docid": "7ccdbbd4ef1777cd54c59b3bca48d46d", "score": "0.48476896", "text": "_shoveTarget (data, script) {\n if (Array.isArray(data)) {\n script.destroy()\n } else if (data.indices) {\n const { workspace, parent, component, index } = getComponentFromIndices(data.indices)\n if (component instanceof Input) {\n let undoEntry\n const oldValue = component.getValue()\n if (oldValue instanceof Block) {\n // NOTE: Scratch puts it on the right of the script, vertically\n // in the middle. (That is not done here)\n const offset = inputRenderOptions.popOutOffset\n const { x, y } = oldValue.getWorkspaceOffset()\n undoEntry = {\n type: 'transfer',\n a: {\n indices: getIndicesOf(oldValue)\n },\n b: {\n workspace,\n index: workspace.scripts.length,\n x: x + offset,\n y: y + offset\n }\n }\n // This is a separate step, but it shall be grouped with this step.\n this._executeEntry(undoEntry)\n }\n component.insertBlock(script.components[0])\n component.resize()\n // Destroy the rest of the blocks in case the reporter\n // had blocks connected to it. This is not undoable because this\n // is not intended to happen.\n if (script.components.length) {\n script.destroy()\n }\n return undoEntry && [undoEntry]\n } else {\n // Shift target script\n const { dx = 0, dy = 0 } = data\n const { x, y } = parent.position\n parent.setPosition(x + dx, y + dy)\n const firstBlock = script.components[0]\n // Inserts all of the blocks in the carrier script into the target\n // stack\n let i = 0\n while (script.components.length) {\n const block = script.components[0]\n script.remove(block)\n parent.add(block, index + i)\n i++\n }\n const prom = Promise.resolve().then(() => parent.resize())\n if (data.branchAround) {\n const branch = firstBlock.getParamComponent(data.branchAround)\n // Insert all the blocks after the insert point that were already in the\n // target stack in the branch block\n while (parent.components[index + i]) {\n branch.add(parent.components[index + i])\n }\n // Ensure that the parent's other children are measured first\n prom.then(() => branch.resize())\n }\n }\n } else if (data.workspace) {\n script.setPosition(data.x, data.y)\n data.workspace.add(script, data.index)\n } else {\n throw new Error('wucky: Given `data` no make sense!')\n }\n }", "title": "" }, { "docid": "2e5a1e285d27c57cf8765cb086da1d7f", "score": "0.4846675", "text": "function slideBlock() {\r\n\t(shiftTo == 'left') ? blockPos -= SHIFT_INT : blockPos += SHIFT_INT;\r\n\r\n\r\n\tif (shiftTo == 'left' && Math.abs(blockPos) >= sideBlock.clientWidth) {\r\n\t/// left shifting is done\r\n\t\tclearInterval(intervId);\r\n\t\tScrollUserListBtn.style.display = 'none';\r\n\t} else if (shiftTo == 'right' && blockPos >= 0) {\r\n\t/// right shifting is done\r\n\t\tclearInterval(intervId);\r\n\t\t// fixing blocks styles\r\n\t\tsideBlock.style.left = '0px';\r\n\t\tif (chatWrapper.clientWidth > LAYOUT_PORTRAIT) {\r\n\t\t\tsideBlock.style.position = 'relative';\r\n\t\t\tmainBlock.style.width = MAIN_BLOCK_WIDTH;\r\n\t\t}\r\n\t\treturn;\r\n\t}\r\n\r\n\tsideBlock.style.left = blockPos + 'px';\r\n}", "title": "" }, { "docid": "9bc3fae5d261b87ca734acad05745cad", "score": "0.48418832", "text": "function createButton2 (){\n const button2 = document.createElement(\"button\")\n button2.className = \"button2\";\n button2.innerText = \"BACK\"\n explanation1Flex.appendChild(button2)\n button2.addEventListener(\"pointerdown\", function(){\n button2.classList.add(\"backFromExplanation\")\n });\n button2.addEventListener(\"pointerup\", function(){\n button2.classList.remove(\"backFromExplanation\")\n explanation1Flex.classList.remove(\"translate\");\n overlay.classList.add(\"hidden11\");\n })\n }", "title": "" }, { "docid": "f8f2ba44965f82f0f03320974194343f", "score": "0.48410752", "text": "function gridFrameButtonHandler(button, row, col) {\r\n button.on(\"click\", function (evt) {\r\n // Check that the object was moved AT LEAST 5 pixels\r\n if (!(Math.abs(evt.target.x - evt.target.oldX) < 5) &&\r\n !(Math.abs(evt.target.y - evt.target.oldY) < 5)) {\r\n // CLONE event object and place at the current coordinates\r\n\r\n let newBox = drawTenContainer(\"black\", 2.2, row, col,\r\n evt.target.parent.x, evt.target.parent.y);\r\n\r\n // update object stage staus & add to stage\r\n newBox.stageBox = true;\r\n chipStorage.addChild(newBox.box);\r\n // Reset Popup frame grid to zero\r\n // (for full button reset see gridSelectPopupHandler)\r\n boxButtonSelection.alpha = 0;\r\n }\r\n });\r\n}", "title": "" }, { "docid": "03aaf1b4c5e5fe7aec16567a24485b99", "score": "0.484052", "text": "popFrame() {\n this.inner.popFrame();\n }", "title": "" }, { "docid": "971fece87400cb856e493f310f72d0ad", "score": "0.48292693", "text": "function unstackViewUi(ui) {\n // dispatchBeforeViewTransitionEvent(\"in\", ui, getRouteByPath(ui.data(\"path\")));\n \n ui.removeClass(\"stack\").addClass(\"in\");\n if(!hasTransition || !transitionProp) {\n handleViewTransitionEnd({target: ui.get(0), propertyName: transitionProp});\n }\n }", "title": "" }, { "docid": "55deec96795e07e599ad09a16820b5d7", "score": "0.48274878", "text": "function buttonUntuck() {\n\t\tvar a = parseInt($(about).position().top);\n\t\tvar b = parseInt($(signin).position().top);\n\t\tif (a<96 && b<96) {\n\t\t\t$(\"a#about\").animate({top:\"175px\", left:\"183px\"}, \"fast\");\n\t\t\t$(\"a#signin\").animate({top:\"175px\", left:\"617px\"}, \"fast\");\n\t\t}\n\t}", "title": "" }, { "docid": "e3ff827feed4cf74a3ad7789c8decf63", "score": "0.4825777", "text": "function create_else_block(ctx) {\n var button;\n var current;\n var mounted;\n var dispose;\n var default_slot_template =\n /*#slots*/\n ctx[12][\"default\"];\n var default_slot = (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.create_slot)(default_slot_template, ctx,\n /*$$scope*/\n ctx[11], null);\n var button_levels = [\n /*$$restProps*/\n ctx[6], {\n \"class\":\n /*classes*/\n ctx[3]\n }];\n var button_data = {};\n\n for (var i = 0; i < button_levels.length; i += 1) {\n button_data = (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.assign)(button_data, button_levels[i]);\n }\n\n return {\n c: function c() {\n button = (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.element)(\"button\");\n if (default_slot) default_slot.c();\n (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.set_attributes)(button, button_data);\n },\n m: function m(target, anchor) {\n (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.insert)(target, button, anchor);\n\n if (default_slot) {\n default_slot.m(button, null);\n }\n\n current = true;\n\n if (!mounted) {\n dispose = [(0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.listen)(button, \"click\",\n /*click_handler_2*/\n ctx[15]), (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.listen)(button, \"click\",\n /*handleItemClick*/\n ctx[5])];\n mounted = true;\n }\n },\n p: function p(ctx, dirty) {\n if (default_slot) {\n if (default_slot.p && (!current || dirty &\n /*$$scope*/\n 2048)) {\n (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.update_slot)(default_slot, default_slot_template, ctx,\n /*$$scope*/\n ctx[11], dirty, null, null);\n }\n }\n\n (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.set_attributes)(button, button_data = (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.get_spread_update)(button_levels, [dirty &\n /*$$restProps*/\n 64 &&\n /*$$restProps*/\n ctx[6], (!current || dirty &\n /*classes*/\n 8) && {\n \"class\":\n /*classes*/\n ctx[3]\n }]));\n },\n i: function i(local) {\n if (current) return;\n (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.transition_in)(default_slot, local);\n current = true;\n },\n o: function o(local) {\n (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.transition_out)(default_slot, local);\n current = false;\n },\n d: function d(detaching) {\n if (detaching) (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.detach)(button);\n if (default_slot) default_slot.d(detaching);\n mounted = false;\n (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.run_all)(dispose);\n }\n };\n} // (45:15) ", "title": "" }, { "docid": "85e68cc354aba10e4724615263c1f017", "score": "0.48235017", "text": "function updateButtonPosition() {\n Overlays.editOverlay(spawnButton, {\n x: screenSize.x / 2 + PADDING,\n y: screenSize.y - (BUTTON_SIZE * 2 + PADDING),\n });\n Overlays.editOverlay(deleteButton, {\n x: screenSize.x / 2 - BUTTON_SIZE,\n y: screenSize.y - (BUTTON_SIZE * 2 + PADDING),\n });\n}", "title": "" }, { "docid": "af1979b8fe0dec401015a495b12a668b", "score": "0.482348", "text": "trigger_effect(card){ //becuase of how I reworks the card methods I don't actually need this anymore i don;t think\n card.to_stack(this)\n }", "title": "" }, { "docid": "a55dd0b133f0fe133bf61b434e773d12", "score": "0.482191", "text": "function instrButtonHandler(e)\n{\n stage.removeChild(menuStage); // Leave main menu\n stage.addChild(instrStage); // Go to instructions menu\n}", "title": "" }, { "docid": "327a4525042f80b680667cc522342a61", "score": "0.4816197", "text": "popFrame() {\n this.inner.popFrame();\n }", "title": "" }, { "docid": "b78f818df6e8fb9d4415e8e7abba69fd", "score": "0.48148295", "text": "onClickPrependInner() {\n this.$emit('click:prepend-inner');\n }", "title": "" }, { "docid": "501f83f44546d22cf1e93b1f6c17b89d", "score": "0.48063672", "text": "function makeButtonMenu(){\t\n\tvar message = \"<div id='blocker'>\"+\n\t\t\t\"<h2>Let's Make A Button</h2>\"+\n\t\t\t\"<ul>\"+\n\t\t\t\"<label>Label: </label><input type='text' placeholder='text?' id='labelInput'></li><br>\"+\n\t\t\t\"<label>Link: </label><input type='text' placeholder='url?' id='linkInput'></li>\"+\n\t\t\t\"<li><label>Color: </label><input id='buttonColorPicker' type='color'></li>\"+\n\t\t\t\"<li><label>Hover Color: </label><input id='buttonHColorPicker' type='color'></li>\"+\n\t\t\t\"<li><label>Text Color: </label><input id='buttonTColorPicker' type='color'></li>\"+\n\t\t\t\"<li><label>Border Color: </label><input id='buttonBColorPicker' type='color'></li>\"+\n\t\t\t\"</ul>\"+\n\t\t\t\"<button onclick='$.unblockUI();'>Cancel</button>\"+\n\t\t\t\"<button onclick=\\\"submitButton();\\\">Submit</button>\"+\n\t\t\t\"</div>\";\n\t$.blockUI({message: message, css: {top: '20%', backgroundColor: '#19a1a1'}});\n}", "title": "" }, { "docid": "4894b318769d57c040b5dbe263cb4c97", "score": "0.48033318", "text": "function enterBlock(){\n blockContext = Object.create(blockContext)\n }", "title": "" }, { "docid": "cf7bf419441ac020af9bbab37e85da89", "score": "0.48027328", "text": "function initBlock() {\n // TODO: add code here\n $('.nav__burger').on('click', function () {\n $(this).siblings('.nav__list').slideToggle();\n $(this).children('.fa-bars').toggle();\n $(this).children('.fa-times').toggle();\n });\n return true;\n}", "title": "" }, { "docid": "c06cc11c5d1b9e05196835b9723fe95a", "score": "0.48023552", "text": "function createButton4 (){\n const button4 = document.createElement(\"button\")\n button4.className = \"button4\";\n button4.innerText = \"BACK\"\n explanation2Flex.appendChild(button4)\n button4.addEventListener(\"click\", function(){\n explanation2Flex.classList.remove(\"translate\");\n overlay.classList.add(\"hidden11\");\n })\n}", "title": "" }, { "docid": "758a4f604f1a739426cdab6ae74cb3f7", "score": "0.4802299", "text": "function unselectBlocks() {\n $('.ui-selected').removeClass('ui-selected');\n}", "title": "" }, { "docid": "0e861a2fecd2ff82dd1b6ba6282757a3", "score": "0.47998416", "text": "function deleteBlock() {\n Blockly.Events.setGroup(true);\n Blockly.hideChaff();\n var heal = Blockly.dragMode_ != Blockly.DRAG_FREE;\n Blockly.selected.dispose(heal, true);\n if (Blockly.highlightedConnection_) {\n Blockly.highlightedConnection_.unhighlight();\n Blockly.highlightedConnection_ = null;\n }\n Blockly.Events.setGroup(false);\n }", "title": "" }, { "docid": "000d4532d521f5093a5f1bfad0d1fc87", "score": "0.47898227", "text": "__addNewLevel(index) {\n //Copy the the first button group\n let buttongroup = document.querySelector(\"#template-layer-block\");\n let copy = buttongroup.cloneNode(true);\n\n //Make the delete button visible since the first layer ui keeps it hidden\n copy.querySelector(\".delete-level\").style.visibility = \"visible\";\n\n //Change all the parameters for the UI elements\n\n //Update the level index for the layerblock\n copy.dataset.levelindex = String(index);\n\n //Change the Label\n let label = copy.querySelector(\".level-index\");\n label.innerHTML = \"LEVEL \" + (index + 1);\n\n //Change the button indices\n let flowbutton = copy.querySelector(\".flow-button\");\n flowbutton.dataset.layerindex = String(index * 3);\n setButtonColor(flowbutton, inactiveButtonBackground, inactiveButtonText);\n\n let controlbutton = copy.querySelector(\".control-button\");\n controlbutton.dataset.layerindex = String(index * 3 + 1);\n setButtonColor(controlbutton, inactiveButtonBackground, inactiveButtonText);\n\n //Add reference to the deletebutton\n let deletebutton = copy.querySelector(\".delete-level\");\n deletebutton.dataset.levelindex = String(index);\n\n return copy;\n }", "title": "" }, { "docid": "b8e61682bf5a296cbe3c9f987a451a86", "score": "0.47881994", "text": "function create_else_block(ctx) {\n var button;\n var current;\n var button_spread_levels = [\n /*$$restProps*/\n ctx[10], {\n ariaHaspopup:\n /*ariaHaspopup*/\n ctx[1]\n }, {\n \"class\":\n /*classes*/\n ctx[7]\n }, {\n color:\n /*color*/\n ctx[0]\n }, {\n size:\n /*size*/\n ctx[4]\n }, {\n outline:\n /*outline*/\n ctx[6]\n }];\n var button_props = {\n $$slots: {\n \"default\": [create_default_slot]\n },\n $$scope: {\n ctx: ctx\n }\n };\n\n for (var i = 0; i < button_spread_levels.length; i += 1) {\n button_props = (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.assign)(button_props, button_spread_levels[i]);\n }\n\n button = new _Button_svelte__WEBPACK_IMPORTED_MODULE_3__.default({\n props: button_props\n });\n button.$on(\"click\",\n /*click_handler_2*/\n ctx[18]);\n button.$on(\"click\",\n /*toggleButton*/\n ctx[9]);\n return {\n c: function c() {\n (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.create_component)(button.$$.fragment);\n },\n m: function m(target, anchor) {\n (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.mount_component)(button, target, anchor);\n current = true;\n },\n p: function p(ctx, dirty) {\n var button_changes = dirty &\n /*$$restProps, ariaHaspopup, classes, color, size, outline*/\n 1235 ? (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.get_spread_update)(button_spread_levels, [dirty &\n /*$$restProps*/\n 1024 && (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.get_spread_object)(\n /*$$restProps*/\n ctx[10]), dirty &\n /*ariaHaspopup*/\n 2 && {\n ariaHaspopup:\n /*ariaHaspopup*/\n ctx[1]\n }, dirty &\n /*classes*/\n 128 && {\n \"class\":\n /*classes*/\n ctx[7]\n }, dirty &\n /*color*/\n 1 && {\n color:\n /*color*/\n ctx[0]\n }, dirty &\n /*size*/\n 16 && {\n size:\n /*size*/\n ctx[4]\n }, dirty &\n /*outline*/\n 64 && {\n outline:\n /*outline*/\n ctx[6]\n }]) : {};\n\n if (dirty &\n /*$$scope, ariaLabel*/\n 524292) {\n button_changes.$$scope = {\n dirty: dirty,\n ctx: ctx\n };\n }\n\n button.$set(button_changes);\n },\n i: function i(local) {\n if (current) return;\n (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.transition_in)(button.$$.fragment, local);\n current = true;\n },\n o: function o(local) {\n (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.transition_out)(button.$$.fragment, local);\n current = false;\n },\n d: function d(detaching) {\n (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.destroy_component)(button, detaching);\n }\n };\n} // (54:25) ", "title": "" }, { "docid": "dbd2cefb5daabcd793951b0b80b3d9dd", "score": "0.47861195", "text": "stopPropagation(evt) {\n if (this.isButton) {\n evt.stopImmediatePropagation();\n }\n }", "title": "" } ]
ff2e4265fcdeaf98df6e553530909e84
The parent frame, if any. Detached and main frames return `null`.
[ { "docid": "8f8171bc515b1b5510cc2951a4c3118a", "score": "0.88445276", "text": "parentFrame() {\n return this._frameManager._frameTree.parentFrame(this._id) || null;\n }", "title": "" } ]
[ { "docid": "1f8f713e4c1ab85612b1a9ed3044739b", "score": "0.73686", "text": "async function switchToParentFrame() {\n const page = this.getPageHandle(true);\n /**\n * check if we can access child frames, if now we are already in the\n * parent browsing context\n */\n if (typeof page.parentFrame !== 'function') {\n return null;\n }\n /**\n * ToDo(Christian): investigate why we interchangeably use Page and Frames here\n */\n this.currentFrame = await page.parentFrame();\n return null;\n}", "title": "" }, { "docid": "fa9fca2e6e660c4b8930460fafcacbe7", "score": "0.73078436", "text": "function getOutermostiFrame()\r\n{\r\n\tvar currentFrame = self;\r\n\ttry{\r\n\t\twhile( currentFrame.parent.document \r\n\t\t\t\t&& currentFrame != currentFrame.parent )\r\n\t\t{\r\n\t\t\tcurrentFrame = currentFrame.parent;\r\n\t\t}\r\n\t}catch(e)\r\n\t{\r\n\t\t//do nothing\r\n\t}\r\n\treturn currentFrame;\r\n}", "title": "" }, { "docid": "8e1b0cd73112574750e9d97f23a3b0a2", "score": "0.71513253", "text": "function getMyFrameFromParent() {\n var arrFrames = parent.document.getElementsByTagName(\"IFRAME\");\n for (var i = 0; i <= arrFrames.length-1; i++) {\n if (arrFrames[i].contentWindow == window) {\n return arrFrames[i];\n }\n }\n}", "title": "" }, { "docid": "2223310978058979608f40492de77754", "score": "0.71171695", "text": "function parent() {\n return this[0] ? this[0].parent : null;\n}", "title": "" }, { "docid": "1dfee94293d4f5407ba836d0797a9250", "score": "0.7063473", "text": "get parentContext() {\n if (this.args.parent instanceof BlameContextSnapshot)\n return this.args.parent;\n return undefined;\n }", "title": "" }, { "docid": "1898f02f6709ed490e95e3b6b3cf5725", "score": "0.6935894", "text": "function getCurrentFrameContainer(win) {\n let currentWindow = win;\n let currentParentWindow;\n\n while (currentWindow !== win.top) {\n currentParentWindow = currentWindow.parent;\n if (!currentParentWindow.frames || !currentParentWindow.frames.length) return null;\n for (let idx = 0; idx < currentParentWindow.frames.length; idx++)\n if (currentParentWindow.frames[idx] === currentWindow) {\n if (!currentParentWindow.document) return null; \n for (let frameElement of currentParentWindow.document.getElementsByTagName('iframe')) {\n if (!frameElement.contentWindow) return null;\n if (frameElement.contentWindow === currentWindow) {\n return frameElement.parentElement;\n }\n }\n }\n }\n}", "title": "" }, { "docid": "a3c0f387f313efb012c98c379de95080", "score": "0.691931", "text": "get parent() {\n if (this.parentId === null) {\n return null;\n }\n return this.#browsingContextStorage.getContext(this.parentId);\n }", "title": "" }, { "docid": "279a63baacd116d52091e594250d3ca5", "score": "0.69068855", "text": "getParent() {\n return null;\n }", "title": "" }, { "docid": "df9bfba73f1fc6b783a1715f6f4c78cc", "score": "0.68890774", "text": "function getFrameObject(parentObj,frameName)\n{\n\tvar returnedFrameObj = null;\n\tif(parentObj != null){\n // first search all frames of the parentObj\n\t\tif(parentObj.frames != null){\n\t\t\tfor(var i=0; i< parentObj.frames.length; i++){\n\t\t\t\tvar arr = [];\n var name = parentObj.frames[i].name;\n\t\t\t\tif(name != null || name != \"\"){\n\t\t\t\t\tarr = name.match(frameName);\n\t\t\t\t}\n\t\t\t\tif(arr != null){\n\t\t\t\t\t//finding a name-matched frame object\n\t\t\t\t\treturnedFrameObj = parentObj.frames[i];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// if not found, recursively search on the next level up\n\t\tif(returnedFrameObj == null){\n\t\t\tif(parentObj!=window.top && parentObj.parent!=window.top)\n\t\t\t\treturnedFrameObj = getFrameObject(parentObj.parent, frameName);\n\t\t}\n\t}\n\treturn returnedFrameObj;\n}", "title": "" }, { "docid": "cba7962f7a64335c800f79cc833dbb68", "score": "0.68784356", "text": "function findFrame(Name)\r\n{\r\n var frameObject = parent.frames[Name];\r\n if((!frameObject) && parent.parent)\r\n {\r\n frameObject = parent.parent.frames[Name];\r\n }\r\n return frameObject;\r\n}", "title": "" }, { "docid": "c32be1a16653b0994d63d409002151bb", "score": "0.68076944", "text": "get currentFrame() {\n return this._currentFrames.first();\n }", "title": "" }, { "docid": "0c7c3370c390065f921a73fe60c6d3d3", "score": "0.6719958", "text": "getParent() {\n return this.parent;\n }", "title": "" }, { "docid": "8fcd5c37f7e4c88b53fb61e6a53cc9c4", "score": "0.6657858", "text": "getParent() {\n return this._parent\n }", "title": "" }, { "docid": "5da2a907c412b09efb1dd48903999bc9", "score": "0.6635886", "text": "get parent(): ?NavigationContext {\n var parent = this.__node.getParent();\n return parent ? parent.getValue() : null;\n }", "title": "" }, { "docid": "d8615413b1c8d349e755b5f5daa626b3", "score": "0.66318464", "text": "get topLevelParent() {\n let parent = this.parent;\n while (parent && parent.parent) {\n parent = parent.parent;\n }\n return parent;\n }", "title": "" }, { "docid": "6b62083da36504bdc54c13a882577ee1", "score": "0.65060914", "text": "function getParent() {\r\n\t\treturn this.PRIVATES(PRIVATES).parent;\r\n\t}", "title": "" }, { "docid": "d3a01ebd23843ee0f3061e4c2416473b", "score": "0.6500669", "text": "setParent(p: Frame) {\n this._parent = p;\n }", "title": "" }, { "docid": "df87f83d26551c3b6e5c1c6ca31b51eb", "score": "0.6472426", "text": "get parent() {\n const parent = this.nativeNode.parentNode;\n return parent ? new DebugElement(parent) : null;\n }", "title": "" }, { "docid": "d92d29b42469d56a0aad87099bb19159", "score": "0.646386", "text": "function getParent( )\n{\n\tif ( doc.activeLayer.parent != doc )\n\t{\n\t\tdoc.activeLayer = doc.activeLayer.parent;\n\t\tgetParent( );\n\t}\n\n\treturn;\n}", "title": "" }, { "docid": "c2d71103c73b30a5264ecceb230ef139", "score": "0.6456878", "text": "get frame() {\n return null\n }", "title": "" }, { "docid": "91e0222b6d19c64d00deb11235dc19ca", "score": "0.64211714", "text": "get parent() {\n var parent = this.__node.getParent();\n return parent ? parent.getValue() : null;\n }", "title": "" }, { "docid": "c594c3175b3830fdf7449dda147a9919", "score": "0.6419515", "text": "get currentFrame() {\n\t\t\treturn this._currentFrame;\n\t\t}", "title": "" }, { "docid": "e3e6ca199e3713f0e805bb2d3afcec1e", "score": "0.64154166", "text": "get parent() {\n return childToParent.get(this) || null;\n }", "title": "" }, { "docid": "9b972a815438db418e542f830d1eef87", "score": "0.6403297", "text": "function getDefaultFrame() {\n return frame_1.topmost();\n}", "title": "" }, { "docid": "01ab633e532da287747b0085dc45eed7", "score": "0.6392457", "text": "parent() {\n let ary = [], p;\n this.q.forEach(function(el) {\n if(!~ary.indexOf(p = el.parentElement) && p) ary.push(p);\n });\n return this.init(ary);\n }", "title": "" }, { "docid": "4c14eac92945a8ac75205a8a46b1d801", "score": "0.6385236", "text": "childFrames() {\n return this._frameManager._frameTree.childFrames(this._id);\n }", "title": "" }, { "docid": "8328fe4493f2036a0df9f6690e3ece3f", "score": "0.6373217", "text": "get currentFrame() {\n\t\treturn this._currentFrame;\n\t}", "title": "" }, { "docid": "06f4e8be110f6f28b9ddc18abe20b93c", "score": "0.6372123", "text": "frame() {\n return this.frames[this.currentFrame]\n }", "title": "" }, { "docid": "f34c25d903e15679d8ae816e745bf0cd", "score": "0.63299876", "text": "get parent() {\n return this._routerState.parent(this);\n }", "title": "" }, { "docid": "f34c25d903e15679d8ae816e745bf0cd", "score": "0.63299876", "text": "get parent() {\n return this._routerState.parent(this);\n }", "title": "" }, { "docid": "f34c25d903e15679d8ae816e745bf0cd", "score": "0.63299876", "text": "get parent() {\n return this._routerState.parent(this);\n }", "title": "" }, { "docid": "f34c25d903e15679d8ae816e745bf0cd", "score": "0.63299876", "text": "get parent() {\n return this._routerState.parent(this);\n }", "title": "" }, { "docid": "f34c25d903e15679d8ae816e745bf0cd", "score": "0.63299876", "text": "get parent() {\n return this._routerState.parent(this);\n }", "title": "" }, { "docid": "f34c25d903e15679d8ae816e745bf0cd", "score": "0.63299876", "text": "get parent() {\n return this._routerState.parent(this);\n }", "title": "" }, { "docid": "1aadd3973c489f117a057a9614320754", "score": "0.6312487", "text": "function getParent(elem){return elem.parent||null;}", "title": "" }, { "docid": "b3610ba2a0b04c8917b29e686b9dd52e", "score": "0.6304657", "text": "get parent() {\n return this._parent;\n }", "title": "" }, { "docid": "b3610ba2a0b04c8917b29e686b9dd52e", "score": "0.6304657", "text": "get parent() {\n return this._parent;\n }", "title": "" }, { "docid": "4088f611301df3af8a8fdbd1a534acf3", "score": "0.6284073", "text": "getFrame() {\n let topmostFrame = Frame.topmost();\n return topmostFrame;\n }", "title": "" }, { "docid": "bab56095e28e5a5f51231ad114febe69", "score": "0.6281873", "text": "function getFrameElement(window) {\n try {\n return window.frameElement;\n } catch (_a) {\n return null;\n }\n }", "title": "" }, { "docid": "bab56095e28e5a5f51231ad114febe69", "score": "0.6281873", "text": "function getFrameElement(window) {\n try {\n return window.frameElement;\n } catch (_a) {\n return null;\n }\n }", "title": "" }, { "docid": "235576c8768bb769813230df63efb83d", "score": "0.62695575", "text": "parent() {\n return this._parent;\n }", "title": "" }, { "docid": "793b20ab7597dd1dff987bcae759c1a3", "score": "0.6265824", "text": "function GetStandParent(e)\r\n{\r\n\tvar view;\r\n\tif(!e.currentStyle)view=e.ownerDocument.defaultView;\r\n\tfor(var pe=e.parentNode;pe!=null&&pe.nodeType==1;pe=pe.parentNode)\r\n\t{\r\n\t\tvar sp;\r\n\t\tif(pe.currentStyle)sp=pe.currentStyle.position;\r\n\t\telse view.getComputedStyle(pe, \"\").getPropertyValue(\"position\")\r\n\t\tif(sp==\"absolute\"||sp==\"relative\")\r\n\t\t\treturn pe;\r\n\t}\r\n\treturn (e.ownerDocument||e.document).body;\r\n}", "title": "" }, { "docid": "f888b75d66702038bdda0db422a627ba", "score": "0.6245787", "text": "function FindTopParent() : Transform\n{\n\tvar p : Transform = transform.parent;\n\twhile (p.name != \"prop_origin\" && p.tag != \"Environment\") {\n//\t\tDebug.Log(p.name);\n\t\tp = p.parent;\n\t} ;\n\tif(p.name == \"prop_origin\") return null;\n\treturn p;\n}", "title": "" }, { "docid": "0bb0b0d90317295e8d1013950fa3f969", "score": "0.622075", "text": "function GetParentCanvas () : Canvas\n\t{\n\t\t// Store the current parent.\n\t\tvar parent : Transform = myTransform.parent;\n\n\t\t// Loop through parents as long as there is one.\n\t\twhile( parent != null )\n\t\t{ \n\t\t // If there is a Canvas component, return the component.\n\t\t if( parent.transform.GetComponent( Canvas ) )\n\t\t return parent.transform.GetComponent( Canvas );\n\n\t\t\t// Else, shift to the next parent.\n\t\t\tparent = parent.transform.parent;\n\t\t}\n\n\t // If no Canvas was found on any parents, inform the user and return nothing.\n\t\tDebug.LogError( \"No Canvas component is attached to the parent gameObects. Please make sure there is a Canvas component on the root canvas.\" );\n\t\treturn null;\n\t}", "title": "" }, { "docid": "ae6e1a6e31e21dcbb5475140bc447036", "score": "0.6210196", "text": "function getParent(elem) {\n return elem.parent || null;\n}", "title": "" }, { "docid": "78b705960b5bdc2ad5ed0d9028336d7b", "score": "0.6210016", "text": "function getParent(elem) {\n return elem.parent || null;\n}", "title": "" }, { "docid": "78b705960b5bdc2ad5ed0d9028336d7b", "score": "0.6210016", "text": "function getParent(elem) {\n return elem.parent || null;\n}", "title": "" }, { "docid": "518fa189106ff32454e2bf01c7de22c6", "score": "0.62080926", "text": "function _getTopContainer()\n{\n\tvar\t\tw = window\n\n\t// Stop going up when either there is nothing there, or we are already there,\n\t// or we don't have access permission go there.\n\ttry {\n\t while ( w.parent != null && w != w.parent && typeof( w.parent ) != \"undefined\" )\n\t {\n\t\t\tw.parent._llAccessTest = true\n \t\t\tw = w.parent\n \t\t}\n \t} catch ( e ) { }\n\n\treturn w\n}", "title": "" }, { "docid": "cc96419d4016201de3103349b0ebdb63", "score": "0.61760527", "text": "function getParentUrl() {\n var isInIframe = (parent !== window),\n\t parentUrl = null;\n\n if (isInIframe) {\n\tparentUrl = document.referrer;\n }\n//\tif(parentUrl.indexOf(\"facebook\"))\n return parentUrl;\n}", "title": "" }, { "docid": "c1fcf78eff8ad31a21bcd6f102fa6445", "score": "0.6137334", "text": "_getTheParent(event) {\n /**\n * A shadow root’s get the parent algorithm, given an event, returns null\n * if event’s composed flag is unset and shadow root is the root of\n * event’s path’s first struct’s invocation target, and shadow root’s host\n * otherwise.\n */\n if (!event._composedFlag && !util_1.isEmpty(event._path) &&\n algorithm_1.tree_rootNode(event._path[0].invocationTarget) === this) {\n return null;\n }\n else {\n return this._host;\n }\n }", "title": "" }, { "docid": "d303f4281dd134133ac39e7009e2e1a4", "score": "0.613444", "text": "function getCurrentParentURL() {\n let uri = URIUtil.getCurrentURI({\n search: false\n });\n\n if (!uri) {\n return '';\n }\n\n return getParentURL(uri);\n }", "title": "" }, { "docid": "459e0612fb31fd7f6b3a91851d91fec6", "score": "0.61301833", "text": "get parentElement() { return this._parentElement_DOM; }", "title": "" }, { "docid": "a1fab9b40eba4fde6ea3f0614db83511", "score": "0.61231565", "text": "get parent() {\n return this._routerState.parent(this);\n }", "title": "" }, { "docid": "a1fab9b40eba4fde6ea3f0614db83511", "score": "0.61231565", "text": "get parent() {\n return this._routerState.parent(this);\n }", "title": "" }, { "docid": "3279378303d3d37e6085c36248eff1d1", "score": "0.61046505", "text": "getCurrentFrame() {\r\n let current = this.getFrameAt(this.getCurrentFrameIndex());\r\n if (current === null && this._forwarding)\r\n current = this.getPreviousDefinedFrameAt(this.getCurrentFrameIndex());\r\n else if (current === null && !this._forwarding)\r\n current = this.getNextDefinedFrameAt(this.getCurrentFrameIndex());\r\n return current;\r\n }", "title": "" }, { "docid": "2210848ff52adbb09000531131795814", "score": "0.6078016", "text": "function getDefaultFrame() {\n return Frame.topmost();\n}", "title": "" }, { "docid": "426a8da15820ec3d47ba2102a206e282", "score": "0.6071015", "text": "function getParent$1(elem) {\n return elem.parent || null;\n}", "title": "" }, { "docid": "313e106feda0935e82dd8bfa75792ffe", "score": "0.60348", "text": "function getFrameElement(window) {\n try {\n return window.frameElement;\n } catch (_a) {\n return null;\n }\n}", "title": "" }, { "docid": "d9c79b918b1ac2d529b9d32c0f3abfe9", "score": "0.6028549", "text": "function getParent(e){\n\tif (e.parentNode == null || document.defaultView.getComputedStyle(e, '').backgroundColor != \"transparent\" ) {\n\t\treturn e;\n\t}\n\telse {\n\t\treturn getParent(e.parentNode);\n\t}\n}", "title": "" }, { "docid": "6e6df4c170446a24b5c01ceb3e687f51", "score": "0.60106087", "text": "function getFrameElement(window) {\n try {\n return window.frameElement;\n }\n catch (_a) {\n return null;\n }\n}", "title": "" }, { "docid": "6e6df4c170446a24b5c01ceb3e687f51", "score": "0.60106087", "text": "function getFrameElement(window) {\n try {\n return window.frameElement;\n }\n catch (_a) {\n return null;\n }\n}", "title": "" }, { "docid": "6e6df4c170446a24b5c01ceb3e687f51", "score": "0.60106087", "text": "function getFrameElement(window) {\n try {\n return window.frameElement;\n }\n catch (_a) {\n return null;\n }\n}", "title": "" }, { "docid": "1bc41c1e543d9050c2bb758137480a76", "score": "0.59782654", "text": "function _inFrame() {\n try {\n return window.self !== window.top;\n } catch (e) {\n return true;\n }\n }", "title": "" }, { "docid": "6ead0be883b7f531ed7407399c8f17fb", "score": "0.5978234", "text": "function getParentInstance(inst) {\n\t !('_nativeNode' in inst) ? ({\"BROWSER\":true}).NODE_ENV !== 'production' ? invariant(false, 'getParentInstance: Invalid argument.') : invariant(false) : void 0;\n\n\t return inst._nativeParent;\n\t}", "title": "" }, { "docid": "834955f4e2d0186c6c31d3b9a6a14c90", "score": "0.5922274", "text": "function getParentInstance(inst) {\n\t !('_nativeNode' in inst) ? false ? invariant(false, 'getParentInstance: Invalid argument.') : invariant(false) : void 0;\n\t\n\t return inst._nativeParent;\n\t}", "title": "" }, { "docid": "edd7c718cf37cb8b87e5b1bffdad51ec", "score": "0.59041905", "text": "function topLevelFrames() {\n return figma.currentPage.children.filter((node) => node.type === 'FRAME');\n}", "title": "" }, { "docid": "6735fed92527b67c9771ffbf1d53cd19", "score": "0.58950573", "text": "function viewParentEl(view) {\n var parentView = view.parent;\n\n if (parentView) {\n return view.parentNodeDef.parent;\n } else {\n return null;\n }\n }", "title": "" }, { "docid": "6735fed92527b67c9771ffbf1d53cd19", "score": "0.58950573", "text": "function viewParentEl(view) {\n var parentView = view.parent;\n\n if (parentView) {\n return view.parentNodeDef.parent;\n } else {\n return null;\n }\n }", "title": "" }, { "docid": "9a6dbfa799a985ba9e81fc40131c6c15", "score": "0.58448625", "text": "getSelectionParent() {\n const editor = this.editor;\n const viewDocument = editor.editing.view.document;\n\n return viewDocument.selection.focus.getAncestors()\n .reverse()\n .find(node => node.is('element'));\n }", "title": "" }, { "docid": "c90e88abb1a58bed19541d2c4dddbe19", "score": "0.5829868", "text": "getHighestParent() {\n\n\t\t\tif ( !this.parentUI ) {\n\n\t\t\t\treturn this;\n\n\t\t\t}\n\n\t\t\treturn this.parent.getHighestParent();\n\n\n\t\t}", "title": "" }, { "docid": "11eeacdaf9f813597506ccabc550f183", "score": "0.5816618", "text": "goFirst() {\n const parent = this.currentFrame ? this.currentFrame.parent : null;\n if (parent && parent.first) {\n return this.setFrame(parent.first);\n }\n\n return null;\n }", "title": "" }, { "docid": "97b09120dcfa94d9b3cff3e24a8d3ab3", "score": "0.5806469", "text": "function getParentWindow(win) {\n\n\t win = win || window;\n\n\t if (win.opener) {\n\t return win.opener;\n\t }\n\n\t if (win.parent && win.parent !== win) {\n\t return win.parent;\n\t }\n\t}", "title": "" }, { "docid": "8022ac47c184a3bf952532c9024aa408", "score": "0.5805754", "text": "function getParentInstance(inst) {\n !('_nativeNode' in inst) ? \"development\" !== 'production' ? invariant(false, 'getParentInstance: Invalid argument.') : invariant(false) : void 0;\n\n return inst._nativeParent;\n}", "title": "" }, { "docid": "10228f5b00949880a2a517ebb48ef9b8", "score": "0.57801896", "text": "function getParent()/*:MetadataTreeNode*/ {\n return this.parent$pjKk;\n }", "title": "" }, { "docid": "137f4d912fdf421cb3d78ed5618ec13f", "score": "0.5777874", "text": "function getContainerRenderParent(tViewNode, view) {\n var container = getLContainer(tViewNode, view);\n return container ? container[RENDER_PARENT] : null;\n}", "title": "" }, { "docid": "137f4d912fdf421cb3d78ed5618ec13f", "score": "0.5777874", "text": "function getContainerRenderParent(tViewNode, view) {\n var container = getLContainer(tViewNode, view);\n return container ? container[RENDER_PARENT] : null;\n}", "title": "" }, { "docid": "f3a00d3ec7e4ff68e5d9afb9dd93bae8", "score": "0.57756764", "text": "function getParentInstance(inst){!('_nativeNode' in inst)?{\"BROWSER\":true}.NODE_ENV!=='production'?invariant(false,'getParentInstance: Invalid argument.'):invariant(false):void 0;return inst._nativeParent;}", "title": "" }, { "docid": "f3a00d3ec7e4ff68e5d9afb9dd93bae8", "score": "0.57756764", "text": "function getParentInstance(inst){!('_nativeNode' in inst)?{\"BROWSER\":true}.NODE_ENV!=='production'?invariant(false,'getParentInstance: Invalid argument.'):invariant(false):void 0;return inst._nativeParent;}", "title": "" }, { "docid": "f3a00d3ec7e4ff68e5d9afb9dd93bae8", "score": "0.57756764", "text": "function getParentInstance(inst){!('_nativeNode' in inst)?{\"BROWSER\":true}.NODE_ENV!=='production'?invariant(false,'getParentInstance: Invalid argument.'):invariant(false):void 0;return inst._nativeParent;}", "title": "" }, { "docid": "f3a00d3ec7e4ff68e5d9afb9dd93bae8", "score": "0.57756764", "text": "function getParentInstance(inst){!('_nativeNode' in inst)?{\"BROWSER\":true}.NODE_ENV!=='production'?invariant(false,'getParentInstance: Invalid argument.'):invariant(false):void 0;return inst._nativeParent;}", "title": "" }, { "docid": "f3a00d3ec7e4ff68e5d9afb9dd93bae8", "score": "0.57756764", "text": "function getParentInstance(inst){!('_nativeNode' in inst)?{\"BROWSER\":true}.NODE_ENV!=='production'?invariant(false,'getParentInstance: Invalid argument.'):invariant(false):void 0;return inst._nativeParent;}", "title": "" }, { "docid": "f3a00d3ec7e4ff68e5d9afb9dd93bae8", "score": "0.57756764", "text": "function getParentInstance(inst){!('_nativeNode' in inst)?{\"BROWSER\":true}.NODE_ENV!=='production'?invariant(false,'getParentInstance: Invalid argument.'):invariant(false):void 0;return inst._nativeParent;}", "title": "" }, { "docid": "aa0e1816fcb0ddd4830c0069efa984f2", "score": "0.5775108", "text": "function findParent(inst){ // TODO: It may be a good idea to cache this to prevent unnecessary DOM\n\t// traversal, but caching is difficult to do correctly without using a\n\t// mutation observer to listen for all DOM changes.\n\twhile(inst._nativeParent){inst=inst._nativeParent;}var rootNode=ReactDOMComponentTree.getNodeFromInstance(inst);var container=rootNode.parentNode;return ReactDOMComponentTree.getClosestInstanceFromNode(container);} // Used to store ancestor hierarchy in top level callback", "title": "" }, { "docid": "aa0e1816fcb0ddd4830c0069efa984f2", "score": "0.5775108", "text": "function findParent(inst){ // TODO: It may be a good idea to cache this to prevent unnecessary DOM\n\t// traversal, but caching is difficult to do correctly without using a\n\t// mutation observer to listen for all DOM changes.\n\twhile(inst._nativeParent){inst=inst._nativeParent;}var rootNode=ReactDOMComponentTree.getNodeFromInstance(inst);var container=rootNode.parentNode;return ReactDOMComponentTree.getClosestInstanceFromNode(container);} // Used to store ancestor hierarchy in top level callback", "title": "" }, { "docid": "aa0e1816fcb0ddd4830c0069efa984f2", "score": "0.5775108", "text": "function findParent(inst){ // TODO: It may be a good idea to cache this to prevent unnecessary DOM\n\t// traversal, but caching is difficult to do correctly without using a\n\t// mutation observer to listen for all DOM changes.\n\twhile(inst._nativeParent){inst=inst._nativeParent;}var rootNode=ReactDOMComponentTree.getNodeFromInstance(inst);var container=rootNode.parentNode;return ReactDOMComponentTree.getClosestInstanceFromNode(container);} // Used to store ancestor hierarchy in top level callback", "title": "" }, { "docid": "aa0e1816fcb0ddd4830c0069efa984f2", "score": "0.5775108", "text": "function findParent(inst){ // TODO: It may be a good idea to cache this to prevent unnecessary DOM\n\t// traversal, but caching is difficult to do correctly without using a\n\t// mutation observer to listen for all DOM changes.\n\twhile(inst._nativeParent){inst=inst._nativeParent;}var rootNode=ReactDOMComponentTree.getNodeFromInstance(inst);var container=rootNode.parentNode;return ReactDOMComponentTree.getClosestInstanceFromNode(container);} // Used to store ancestor hierarchy in top level callback", "title": "" }, { "docid": "aa0e1816fcb0ddd4830c0069efa984f2", "score": "0.5775108", "text": "function findParent(inst){ // TODO: It may be a good idea to cache this to prevent unnecessary DOM\n\t// traversal, but caching is difficult to do correctly without using a\n\t// mutation observer to listen for all DOM changes.\n\twhile(inst._nativeParent){inst=inst._nativeParent;}var rootNode=ReactDOMComponentTree.getNodeFromInstance(inst);var container=rootNode.parentNode;return ReactDOMComponentTree.getClosestInstanceFromNode(container);} // Used to store ancestor hierarchy in top level callback", "title": "" }, { "docid": "aa0e1816fcb0ddd4830c0069efa984f2", "score": "0.5775108", "text": "function findParent(inst){ // TODO: It may be a good idea to cache this to prevent unnecessary DOM\n\t// traversal, but caching is difficult to do correctly without using a\n\t// mutation observer to listen for all DOM changes.\n\twhile(inst._nativeParent){inst=inst._nativeParent;}var rootNode=ReactDOMComponentTree.getNodeFromInstance(inst);var container=rootNode.parentNode;return ReactDOMComponentTree.getClosestInstanceFromNode(container);} // Used to store ancestor hierarchy in top level callback", "title": "" }, { "docid": "95b591cfdd281a99e42aa6436469556c", "score": "0.5763794", "text": "function viewParentEl(view) {\n var parentView = view.parent;\n if (parentView) {\n return view.parentNodeDef.parent;\n }\n else {\n return null;\n }\n}", "title": "" }, { "docid": "95b591cfdd281a99e42aa6436469556c", "score": "0.5763794", "text": "function viewParentEl(view) {\n var parentView = view.parent;\n if (parentView) {\n return view.parentNodeDef.parent;\n }\n else {\n return null;\n }\n}", "title": "" }, { "docid": "95b591cfdd281a99e42aa6436469556c", "score": "0.5763794", "text": "function viewParentEl(view) {\n var parentView = view.parent;\n if (parentView) {\n return view.parentNodeDef.parent;\n }\n else {\n return null;\n }\n}", "title": "" }, { "docid": "95b591cfdd281a99e42aa6436469556c", "score": "0.5763794", "text": "function viewParentEl(view) {\n var parentView = view.parent;\n if (parentView) {\n return view.parentNodeDef.parent;\n }\n else {\n return null;\n }\n}", "title": "" }, { "docid": "b6bfad2cfa02e5fd3d8d1681f21b2767", "score": "0.5759803", "text": "function getParentInstance(inst){return getParent(inst);}", "title": "" }, { "docid": "b6bfad2cfa02e5fd3d8d1681f21b2767", "score": "0.5759803", "text": "function getParentInstance(inst){return getParent(inst);}", "title": "" }, { "docid": "b6bfad2cfa02e5fd3d8d1681f21b2767", "score": "0.5759803", "text": "function getParentInstance(inst){return getParent(inst);}", "title": "" }, { "docid": "b6bfad2cfa02e5fd3d8d1681f21b2767", "score": "0.5759803", "text": "function getParentInstance(inst){return getParent(inst);}", "title": "" }, { "docid": "b6bfad2cfa02e5fd3d8d1681f21b2767", "score": "0.5759803", "text": "function getParentInstance(inst){return getParent(inst);}", "title": "" }, { "docid": "b6bfad2cfa02e5fd3d8d1681f21b2767", "score": "0.5759803", "text": "function getParentInstance(inst){return getParent(inst);}", "title": "" }, { "docid": "b6bfad2cfa02e5fd3d8d1681f21b2767", "score": "0.5759803", "text": "function getParentInstance(inst){return getParent(inst);}", "title": "" }, { "docid": "b6bfad2cfa02e5fd3d8d1681f21b2767", "score": "0.5759803", "text": "function getParentInstance(inst){return getParent(inst);}", "title": "" } ]
bbea277a3441d7081d049986850592fc
Display lvl number and the instructions to succeed
[ { "docid": "8973aa30c2d58aa70bda71ca97b2a995", "score": "0.0", "text": "setStrings() {\n push();\n textAlign(CENTER, CENTER);\n textSize(32);\n fill(255);\n text(this.numLvlString, width / 10, height / 20);\n text(this.insString, width / 2, height / 10 * 2)\n pop()\n }", "title": "" } ]
[ { "docid": "c6f7c16e06f42483160d9d424bc79fef", "score": "0.6590975", "text": "function showLevel(){\n $('#level').text(\"Level = \" + level);\n }", "title": "" }, { "docid": "4a1727ee9e25f7edddbf01e8791d0acd", "score": "0.6127902", "text": "function showLevels() {\n nodes.forEach(node => {\n node.color = Colorlvl[node.lvl - 1];\n });\n recharge();\n}", "title": "" }, { "docid": "4edd756c60c51550cfe379e2259bb835", "score": "0.6116635", "text": "function nextLevel(){\n\tif ( level == \"1\" ){\n\t\tlevel = \"2\";\n\t\t$(\"#user_level\").html(level);\n\t\tretry1();\n\t}else if ( level == \"2\" ){\n\t\tlevel = \"3\";\n\t\t$(\"#user_level\").html(level);\n\t\tretry1();\n\t}else if ( level == \"3\" ){\n\t\tlevel = \"4\";\n\t\t$(\"#user_level\").html(level);\n\t\tretry1();\n\t}else if ( level == \"4\" ){\n\t\tlevel = \"5\";\n\t\t$(\"#user_level\").html(level);\n\t\tretry1();\n\t}else{\n\t\tlevel = \"1\";\n\t\t$(\"#user_level\").html(level);\n\t\tretry1();\n\t}\n}", "title": "" }, { "docid": "ef363da51136b4124932c1971a8a2dd0", "score": "0.60896474", "text": "function checkLevel(num) {\r\n if (num==1){\r\n return 20; }\r\n else if(num==2){\r\n return 40;\r\n }\r\n else if(num==3){\r\n return 60;\r\n }\r\n else\r\n { return 20;\r\n }\r\n}", "title": "" }, { "docid": "17a606102dcf62c80943ff84543034c1", "score": "0.608153", "text": "function displayInstructions(level,numberOfQuestions){\n\nvar display=`Level ${level}\nLevel ${level} has ${numberOfQuestions} questions`\nconsole.log(chalk.yellow(display));\n\n}", "title": "" }, { "docid": "49daa6f4cf7c73eb0fe0837f6964c72b", "score": "0.5978594", "text": "function executeLevel() {\n\tLEVEL = Math.floor(SCORE / 50);\n\tswitch (LEVEL) {\n\t\tcase 1 : {\n\t\t\tNUM_MONSTER_SHOW = 1;\n\t\t\tbreak;\n\t\t}\n\t\tcase 2 : {\n\t\t\tNUM_MONSTER_SHOW = 2;\n\t\t\tbreak;\n\t\t}\n\t\tcase 3 : {\n\t\t\tNUM_MONSTER_SHOW = 3;\n\t\t\tbreak;\n\t\t}\n\t\tcase 4 : {\n\t\t\tNUM_MONSTER_SHOW = 4;\n\t\t\tbreak;\n\t\t}\n\t\tcase 5 : {\n\t\t\tNUM_MONSTER_SHOW = 5;\n\t\t\tbreak;\n\t\t}\n\t\tcase 6 : {\n\t\t\tNUM_MONSTER_SHOW = 6;\n\t\t\tbreak;\n\t\t}\n\t\tcase 7 : {\n\t\t\tNUM_MONSTER_SHOW = 7;\n\t\t\tbreak;\n\t\t}\n\t\tcase 8 : {\n\t\t\tNUM_MONSTER_SHOW = 8;\n\t\t\tbreak;\n\t\t}\n\t\tcase 9 : {\n\t\t\tNUM_MONSTER_SHOW = 9;\n\t\t\tbreak;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "46c487195a5ba9a6d862c65d5f18b473", "score": "0.594524", "text": "function nextLevel(){\n\tagaining=false;\n\tmessagetext=\"\";\n\t\n\tcurlevel=Math.min(curlevel,LastScreen()?LastScreen():curlevel);\n\t\n\tif (titleScreen)\n\t\tStartLevelFromTitle();\n\telse {\n\t\tif(!SolvedAllLevels())\n\t\t\tAdvanceUnsolvedScreen();\n\t\telse if(curlevel<LastScreen())\n\t\t\tAdvanceEndScreen();\n\t\telse{\n\t\t\tRequestHallOfFame();\n\t\t\tResetGame();\n\t\t}\n\t}\n\t\n\tAdjustFlickscreen();\n\tcanvasResize();\n}", "title": "" }, { "docid": "c52ce7dbfeccc256ad9ed576ead91b35", "score": "0.5932829", "text": "printGivenLevel(node, level) {\n if(node == null) {\n return;\n }\n if(level == 1) {\n console.log(node.data);\n }\n else if(level > 1) {\n this.printGivenLevel(node.left, level-1);\n this.printGivenLevel(node.right, level-1);\n }\n }", "title": "" }, { "docid": "76b044d5e587b7dad4ba642bcbdada53", "score": "0.5913973", "text": "function changeLevel() {\n //Just changes the level-count according to what level it is\n if (level == 0) {\n $(\"#level-count\").text(\"--\");\n }\n else if (level < 10) {\n $(\"#level-count\").text(\"0\" + level);\n }\n else {\n $(\"#level-count\").text(\"0\" + level);\n }\n}", "title": "" }, { "docid": "0634718480bf063b1f5da3d0187027cd", "score": "0.5883014", "text": "function changeLevel() {\n const inputFieldLvlNr = document.getElementById('lvl_nr_input_field');\n const lvl_nr_input = parseInt(inputFieldLvlNr.value);\n if (lvl_nr_input >= 1 && lvl_nr_input <= nLevels) {\n lvlNumber = lvl_nr_input;\n toggleLevelBox();\n createGrid();\n loadLevel();\n resetGame();\n } else alert(`Puzzle number should be between 1 and ${nLevels}.`);\n}", "title": "" }, { "docid": "d9d93dac3e81e53a2b71577e53462c1b", "score": "0.5860192", "text": "function drawLevel() {\r\n ctx.font = \"16px Arial\";\r\n ctx.fillStyle = \"#0095DD\";\r\n ctx.fillText(\"Level: \" + level, mCanvas.width / 2 - 65, 20);\r\n }", "title": "" }, { "docid": "5deda100bca701c21a6b821462a61b84", "score": "0.58393216", "text": "function doExperience2 (Lev) {\n if (isNaN(Lev) || Lev < 0)\n return \"???\";\n \n if (Lev < 201)\n return (Lev * (Lev - 1) * 25).format('#&nbsp;##0');\n \n var tot = 200 * 199 * 25;\n var lvl = 200;\n \n while (lvl < Lev)\n tot += doExperience(lvl++, true);\n \n return tot.format('#&nbsp;##0');\n}", "title": "" }, { "docid": "45f0e21e04d4c6b3863fbf3441e4648f", "score": "0.5833581", "text": "function myFunction3() {\n \nfunction lvlup() {\n lvl += 1;\n multi += 1;\n coins += multi + jobs * 2;\n writeUI();\n}\n\n if (ep >= 100 && lvl === 1) {\n lvlup();\n }\n else if (ep >= 200 && lvl === 2) {\n lvlup();\n }\n else if (ep >= 400 && lvl === 3) {\n lvlup();\n }\n else if (ep >= 800 && lvl === 4) {\n lvlup();\n }\n else if (ep >= 1600 && lvl === 5) {\n lvlup();\n }\n else if (ep >= 3200 && lvl === 6) {\n lvlup();\n }\n else if (ep >= 6400 && lvl === 7) {\n lvlup();\n }\n else if (ep >= 12800 && lvl === 8) {\n lvlup();\n }\n else if (ep >= 25600 && lvl === 9) {\n lvlup();\n }\n else if (ep >= 51200 && lvl === 10) {\n lvlup();\n }\n}", "title": "" }, { "docid": "4c2c86dce2d2d93e8ac13f1303fdd153", "score": "0.58155245", "text": "function assessSituation(level, announcement, excuse){\n if (level > 50){\n console.log(announcement);\n } else if (level >= 10){\n console.log(excuse);\n } else {\n console.log(\"Meh. Hard pass.\");\n }\n}", "title": "" }, { "docid": "2846cabc840a6491b6d5d270b9e282d1", "score": "0.58125037", "text": "function IncreaseLevel(more) {\n if (more) {\n if (curLevel < maxLevel)\n curLevel++;\n }\n else {\n if (curLevel > 2)\n curLevel--;\n }\n curLevelLabel.innerHTML = curLevel;\n CreateGrid();\n}", "title": "" }, { "docid": "7e1ab981fcb97fcbd4d5a0152d565b23", "score": "0.5804909", "text": "function getTextLevel(lev) {\n\tswitch(lev) {\n\t\tcase 1:\n\t\t\t\treturn \"Peasant\";\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\treturn \"LandOwner\";\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\treturn \"Knight\";\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\treturn \"Lord\";\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\treturn \"King\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn \"Peasant\";\n\t\t\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "0b7c318e6cfb93fc5071383c6d8235e4", "score": "0.5776144", "text": "function levelCounter() {\n level++;\n counter.innerHTML = level;\n}", "title": "" }, { "docid": "09ccb70810ba02e2adfd350bf9c29d10", "score": "0.5758875", "text": "_nextLevel(){\n\n\t}", "title": "" }, { "docid": "1b2a5e3ff6143d9ec6d029600b31eb69", "score": "0.57569534", "text": "function winLevel()\n{\n debugger;\n// alert('winLevel!');\n commentsPanel.innerHTML = \"level complete <br /><br /> any key to continue\";\n curr_state = STATE_WIN;\n}", "title": "" }, { "docid": "ae6825e1896ca6151ce8bc599b8dcca9", "score": "0.5737359", "text": "function drawlevel(){\r\n\t\tvar level=parseInt(0);\r\n\t canvas.font = \"14px Verdana\";\r\n canvas.fillStyle = \"#005500\";\r\n\t\tif(gameScore>500) level= parseInt(gameScore/500);\r\n canvas.fillText(\"Level: \" + level, (width_of_canvas/2-40), 20);\r\n\t }", "title": "" }, { "docid": "9fd6be158e4118cf4099b3cf3f1c1169", "score": "0.5713523", "text": "function genLevel (\n level\n)\n{\n var s = \"\";\n\n for (var i = 0; i < level; i++)\n s += \" | \";\n if (level > 0)\n s += \" \";\n return s;\n}", "title": "" }, { "docid": "c8891bf18583877aff36ffb03fa46943", "score": "0.5690078", "text": "function debug(lvl, msg){\r\n if (lvl <= d_level) GM_log(\"\\n\"+msg);\r\n}", "title": "" }, { "docid": "b148011d5737494787dadb6fa79a8192", "score": "0.56762445", "text": "function display(strLevel, message) {\n\tvar level = getLevel(strLevel);\n\tif(level > currentLevel) return;\n\tvar date = printDate ? \"[\" + new Date() + \"]\" : \"\";\n\tconsole.log(\"[\"+strLevel+\"]\" + date + \"\\t\"+message);\n}", "title": "" }, { "docid": "5f6ef3ece709bb9cf5e86caf0fbc0fd5", "score": "0.5669", "text": "lvlUp() {\n this.lvl ++;\n console.log(\"Su pokémon ha subido de nivel, el nivel es: \" + this.lvl);\n\n // Sube alguno de sus stats dependiendo de la naturaleza del pokemon\n switch (this.naturaleza) {\n case 'Audaz':\n this.stats[\"ataque\"] ++;\n console.log(\"Tu nivel de ataque es: \" + this.stats[\"ataque\"]);\n break;\n case 'Osada':\n this.stats[\"defensa\"] ++;\n console.log(\"Tu nivel de defensa es: \" + this.stats[\"defensa\"]);\n break;\n case 'Cauta':\n this.stats[\"vida\"] ++;\n console.log(\"Tu nivel de vida es: \" + this.stats[\"vida\"]);\n break;\n case 'Alegre':\n this.stats[\"velocidad\"] ++;\n console.log(\"Tu nivel de velocidad es: \" + this.stats[\"velocidad\"]);\n break;\n default:\n console.log(\"Esto es raro, tu pokémon tiene un naturaleza que no había visto antes, no sé que hacer\")\n }\n if (this.lvl === 100) {\n console.log(\"Tu pokemon ha llegado al nivel 100\");\n }\n }", "title": "" }, { "docid": "4052ff09a421e54389021ae3bb13c139", "score": "0.5658833", "text": "function nextLevel() {\r\n\t$('nextlevel').style.display=\"none\";\r\n\tlevelCount += 1;\r\n\tsetCounters();\r\n\tsetLevelTarget();\r\n\tresetLevel();\r\n}", "title": "" }, { "docid": "c8a8e9c13f34889c481a5a3dea51919a", "score": "0.5653957", "text": "function updateLevel(lvl) {\n level = lvl;\n }", "title": "" }, { "docid": "4425f19d2fe7fd75ce67104478064ab2", "score": "0.56514883", "text": "function loadCode() {\r\n lvlStr = document.getElementById(\"level-code\").value;\r\n console.log(\"Loading... \\n\" + lvlStr);\r\n \r\n}", "title": "" }, { "docid": "fa18dc6ea69da32c0fccd064709a40bc", "score": "0.56417406", "text": "function doExperience(Level, noFormat) {\n if (isNaN(Level) || Level < 0)\n return \"???\";\n \n if (!Level)\n return 0;\n \n var retval = Level * 50 + Math.max(0, (Level - 199) * 450);\n \n return (noFormat ? retval : retval.format('#&nbsp;##0'));\n}", "title": "" }, { "docid": "dd6e5c7a46440aa458b4b4631ae8d5cb", "score": "0.56080174", "text": "function CheckLevelCompleted() {\n ++playerCurrentTilesDiscovered;\n if (playerCurrentTilesDiscovered === currentLevelItemNumber) {\n\n if (currentPlayerLevel + 2 > stageMaster.length) {\n UpdateMatchscore();\n ShowOverlay((overlayTextWin + currentMatchScore), overlayButtonRestart, ResetMatch);\n } else {\n UpdateMatchscore();\n ShowOverlay((overlayTextLevel + currentMatchScore), overlayButtonLevel, ResetBoard);\n }\n\n }\n\n\n}", "title": "" }, { "docid": "1b50b2fee7b228106ea48e09efdb1a8f", "score": "0.560379", "text": "function getLvlID() {\n return `${gridSize}x${gridSize}_nr${lvlNumber}`;\n}", "title": "" }, { "docid": "3c9d62090c25a56940325fa2401c78ad", "score": "0.55657613", "text": "function checkWin() {\r\n\t\tif ((b1Value == target) && (b2Value == target) && (b3Value == target) && (b4Value == target))\r\n\t\t\t$('nextlevel').style.display=\"block\";\r\n\t}", "title": "" }, { "docid": "7e268ca57c8e303ba25890266c423593", "score": "0.55642533", "text": "function checkLevel() {\n if (score >= 8000) {\n if (level < 7) {\n level = 7;\n setLevelLabel();\n clearInterval(interval);\n delay = 100;\n interval = setInterval(doNextStep, 100);\n }\n }\n if (score >= 6000) {\n if (level < 6) {\n level = 6;\n setLevelLabel();\n clearInterval(interval);\n delay = 200;\n interval = setInterval(doNextStep, 200);\n }\n }\n if (score >= 4000) {\n if (level < 5) {\n level = 5;\n setLevelLabel();\n clearInterval(interval);\n delay = 300;\n interval = setInterval(doNextStep, 300);\n }\n }\n if (score >= 3000) {\n if (level < 4) {\n level = 4;\n setLevelLabel();\n clearInterval(interval);\n delay = 400;\n interval = setInterval(doNextStep, 400);\n }\n }\n if (score >= 2000) {\n if (level < 3) {\n level = 3;\n setLevelLabel();\n clearInterval(interval);\n delay = 500;\n interval = setInterval(doNextStep, 500);\n }\n }\n if (score >= 1000) {\n if (level < 2) {\n level = 2;\n setLevelLabel();\n clearInterval(interval);\n delay = 600\n interval = setInterval(doNextStep, 600);\n }\n }\n}", "title": "" }, { "docid": "b6737bcb7de6a42f6ac8203b5bde23d4", "score": "0.5564184", "text": "function loadLevel() {\n // generate random tile values and add values to HTML tiles\n generateLevel();\n\n // store current grid size and level ID in local storage\n // to allow continue playing same level after browser refresh\n setToLocalStorage(currentGridSizeKey, gridSize);\n setToLocalStorage(currentLvlKey, lvlNumber);\n\n // show level ID\n document.getElementById('lvlText').innerHTML = `Puzzle number ${lvlNumber}`;\n // .innerHTML = `Puzzle ID: ${gridSize}x${gridSize} nr. ${lvlNumber}`;\n\n // show optimal score and nr. of moves for level\n showOptimalResult();\n\n // get level high score from local storage (defaults to -inf), and show it\n const localBestScoreKey = getLocalBestScoreKey();\n const localBestMovesKey = getLocalBestMovesKey();\n const localBestScore = +getFromLocalStorage(localBestScoreKey,\n Number.NEGATIVE_INFINITY);\n const localBestMoves = +getFromLocalStorage(localBestMovesKey,\n Number.POSITIVE_INFINITY);\n updateLocalBestDisplay(localBestScore, localBestMoves);\n\n // retrieve leaderboard data from server and show\n document.getElementById('leaderboard_box').innerHTML = '';\n if (gridSize >= leaderboardGridSize) makeLeaderboard();\n}", "title": "" }, { "docid": "4efee6ad3fb4e112e978931dc6d68bcc", "score": "0.55621356", "text": "success() {\n if (this.lvlWon) {\n push()\n this.playWinSFX();\n background(this.fill.r, this.fill.g, this.fill.b)\n textSize(25);\n fill(this.bgFill.r, this.bgFill.g, this.bgFill.b);\n textAlign(CENTER, CENTER);\n\n text(this.successString, this.successStringX, this.successStringY)\n pop()\n\n if (mouseIsPressed &&\n frameCount > this.successFrameStart + this.successMessageMinLength) {\n currentState = new Lvl4();\n }\n }\n }", "title": "" }, { "docid": "45bf4d159212523c53c01df2a8652447", "score": "0.55514115", "text": "function next_level() {\n reset_checked_planets();\n reset_planets_type();\n reset_removed_planets();\n set_stat(stat_types.level, gamer.level + 1);\n var temp_shoots = 120 - ((gamer.level - 1) * 5);\n if(temp_shoots < 80) {\n temp_shoots = 80;\n }\n set_stat(stat_types.shoots, temp_shoots);\n gamer.available_planets = 0;\n gamer.missed_groups = 0;\n set_stat(stat_types.score, global_score);\n insert_counter = 0;\n create_random_map();\n load_next_planet();\n load_next_planet();\n }", "title": "" }, { "docid": "7c9304827af1d273b5a007f27692885e", "score": "0.55400014", "text": "function levelProgress(levelComplete) {\n if (levelComplete) {\n showHide('#level-screen', '#playContainer');\n level++;\n if (level % 5 == 0) {\n difficultyTier++;\n if (difficultyTier == 2){\n numberOfTrains++;\n }\n }\n } else {\n showHide('#level-screen-fail', '#playContainer');\n }\n}", "title": "" }, { "docid": "ae7d74bdffe08196377005340e8860ff", "score": "0.5534875", "text": "printLevelOrder() {\n let h = this.height(this.root);\n for(let i = 0; i <= h; ++i)\n this.printGivenLevel(this.root, i);\n }", "title": "" }, { "docid": "64371aa7ed302f4e98dda29e598515f5", "score": "0.55347115", "text": "function getLevel(){\r\n return level;\r\n}", "title": "" }, { "docid": "49987b3c737002c8be115a4b8e9cefb5", "score": "0.55338633", "text": "function updateLevel(){\n level++;\n $(\"h1\").text(\"Level \" + level);\n}", "title": "" }, { "docid": "6c90d1dc25dcac555f679a722f86da7c", "score": "0.55217046", "text": "function afterGeneratingTreeNode(treeNode){\n if (treeNode.level.levelIndex == 0) {\n treeNode.setUpLabel('<b>' + getMessage('world') + '</b>');\n }\n}", "title": "" }, { "docid": "dba6590409a2dd8fbefdc0d563a3a11e", "score": "0.55182636", "text": "function LevelUp(level) {\n\tlevel++;\n\tSaveProgress();\n}", "title": "" }, { "docid": "b2bc72023650bf5f9f267ad112d013f4", "score": "0.55040526", "text": "function levelTransition() {\n if (score === 2000) {\n // Level 1 score amount.\n openTransition1();\n } else if (score === 5000) {\n // Level 1 + 2 score amount.\n openTransition2();\n } else if (score > 5000) {\n // Level 3 score amount.\n openScores();\n } else {\n return;\n }\n}", "title": "" }, { "docid": "cd32efb6ce5990d4c98767b44836dc30", "score": "0.549257", "text": "function handleLevelStart(response) {\n console.log(\"The level is: \" + response);\n}", "title": "" }, { "docid": "bd355455d32f7a17b5ef51969eb4cb65", "score": "0.54810375", "text": "levelUp(minLevel) {\n if(this.progress >= minLevel) {\n return; //If already at that level, ignore\n }\n this.progress = minLevel;\n switch(this.progress) {\n case 4:\n $('.level-4').show();\n case 3:\n $('.level-3').show();\n case 2:\n $('.level-2').show();\n }\n }", "title": "" }, { "docid": "5a07d87b58042135af518bb47eebed07", "score": "0.5480384", "text": "function Eldritch1() {\n $lvl = parseInt($('#level').val())\n if($lvl >=1) {\n EldritchAtt1();\n } if($lvl >= 5) {\n EldritchAtt1();\n } if($lvl>= 11) {\n EldritchAtt1();\n } if($lvl >= 17) {\n EldritchAtt1();\n }\n}", "title": "" }, { "docid": "9afa0647dbea91573471fe80ec33e47f", "score": "0.5466099", "text": "static IncreaseLevel() {}", "title": "" }, { "docid": "d272104d02a4d2332878d6f774c7c5b9", "score": "0.5461738", "text": "function renderDifficulty(diff) {\n // string for qualitative level given numerical level of difficulty\n var level;\n\n // set level according to numerical difficulty\n switch (diff) {\n case 1:\n level = \"n Easy \";\n break;\n case 4:\n level = \" Medium \";\n break;\n case 9:\n level = \" Hard \";\n break;\n default:\n alert(\"ERROR!\");\n }\n // change status accordingly\n $(\"#status\").html(\"A\" + level + \"Game\");\n}", "title": "" }, { "docid": "ed855d3de67e36b82dc98ae4e32e255b", "score": "0.54601043", "text": "levelUpEval() {\n\t if (this.level <= 4) {\n\t this.levelUpMessage();\n\t this.theInvaderCounter = 27;\n\t this.invaderLevelSpeed += 1;\n\t this.randomFireLevel += 1;\n\t setTimeout(() => {\n\t this.getReady();\n\t }, 3000);\n\t setTimeout(() => {\n\t this.lockAndLoad();\n\t }, 3000);\n\t setTimeout(() => {\n\t this.buildInvadersRow1();\n\t }, 3000);\n\t setTimeout(() => {\n\t this.buildInvadersRow2();\n\t }, 3000);\n\t setTimeout(() => {\n\t this.buildInvadersRow3();\n\t }, 3000);\n\t } else if (this.level > 4) {\n\t // this.level = 5;\n\t this.removeGameMusic();\n\t this.winnerMessage();\n\t setTimeout(() => {\n\t this.winnerVideo();\n\t }, 3000);\n\t }\n\t }", "title": "" }, { "docid": "c6afdf9f9b4842cc10efea4d642fe129", "score": "0.5455531", "text": "function levelUpTitle(){\n $(\"#level-title\").text(\"Level \" + level);\n setTimeout(function(){ clickBtnAnimation(pattern[pattern.length-1])}, 200);\n }", "title": "" }, { "docid": "ac183a7678753b3d4648868b13211702", "score": "0.54425097", "text": "function changeLevel() {\n var data = arrayInfo();\n var currentCounts = data[0];\n var currentPercents = data[1];\n\n if(currentCounts[currentLevel+1] > NUMBER_ATTEMPTED && currentPercents[currentLevel+1] >= PERCENT_CORRECT) {\n currentLevel += 1;\n minLength += 1;\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "d07b42a8df2bc47ae3798a0e8ca54cca", "score": "0.5433546", "text": "function levelUp(nextClass) {\r\n if (nextClass == \"flag\" && riderOn && currentLevel < totalLevels) {\r\n\tdocument.getElementById(\"levelup\").style.display = \"block\";\r\n\tclearTimeout(currentAnimation);\r\n\tsetTimeout (function() {\r\n\t document.getElementById(\"levelup\").style.display = \"none\";\r\n\t currentLevel++; //add an if statement if there are no more levels dont increment\r\n\t loadLevel(); \r\n\t \r\n\t}, 1000);\r\n\t\r\n } else if(nextClass == \"flag\" && riderOn && currentLevel >= totalLevels){\r\n\t document.getElementById(\"end\").style.display = \"block\";\r\n\t clearTimeout(currentAnimation);\r\n } // else if\r\n \r\n} //levelUp", "title": "" }, { "docid": "b9d3bbdc04fc6c905618cd5e63e492b3", "score": "0.5423278", "text": "levelControl() {\n\t\tvar levelBefore = this.level;\n\t\tthis.level = Math.floor((parseInt(this.score) - 100) / 100) + 1;\n\n\t\tif (this.level < levelBefore) {\n\t\t\tthis.level = levelBefore;\n\t\t}\n\n\t\tif (this.level > 3) {\n\t\t\tthis.level = 3;\n\t\t}\n\n\n\t\tvar numberOfMonsterBefore = this.numberOfMonster;\n\t\tthis.numberOfMonster = this.level;\n\t\tthis.speed = 2 * this.level;\n\t\tif (this.numberOfMonster > numberOfMonsterBefore) {\n\t\t\tthis.initListMonster();\n\t\t}\n\t}", "title": "" }, { "docid": "b367eade72e7c273dc718c54ba77fd87", "score": "0.54179096", "text": "function checkLevel() {\n\t$('#level').html(level + \"\");\n\t// intervals are restarted, and now chasers are faster\n\tpauseIntervals();\n\tstartIntervals();\n\tsetBackground(); // background should change for each level\n}", "title": "" }, { "docid": "5a0888dc4a8d7f5cec93c987b367a4cd", "score": "0.5412312", "text": "loadNextLvl()\n\t{\n\t\tthis.currentLvlIndex+=1;\n\n\t\t// On retourne false s'il n'y a plus de niveaux\n\t\tif(this.currentLvlIndex >= this.lvls.length) {return false;}\n\n\t\tthis.matrix = [];\n\n\t\t// On initialise le niveau actuel\n\t\tlet currentLvl = this.lvls[this.currentLvlIndex];\n\t\tthis.height = currentLvl.world.height;\n\t\tthis.width = currentLvl.world.width;\n\n\t\tthis.spawn = new Vector(0,0);\n\t\tthis.player = new Character(this.spawn);\n\t\tthis.exit = {\"x\": 0, \"y\" : 0};\n\n\t\tlet cases = currentLvl.cases;\n\n\t\t// On teste qu'on a bien le bon nombre de lignes\n\t\tif(currentLvl.world.matrix.length != this.height)\n\t\t{\n\t\t\tthrow new String(\"/!\\\\ Niveau mal formaté : nombre de ligne incorrect\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// On remplis notre matrice représentant le niveau\n\t\t\tfor (let i = 0; i < this.height; i++) // Pour chaque ligne\n\t\t\t{\n\t\t\t\tthis.matrix[i] = [];\n\t\t\t\t// On teste que la ligne fait la bonne taille\n\t\t\t\tif (currentLvl.world.matrix[i].length != this.width)\n\t\t\t\t{\n\t\t\t\t\tthrow new String(\"/!\\\\ Niveau mal formaté : Taille de la Ligne \" + i.toString() + \" != \" + this.width.toString());\n\t\t\t\t}\n\t\t\t\tfor (let j = 0; j < this.width; j++) // Pour chaque cases\n\t\t\t\t{\n\t\t\t\t\tif(currentLvl.world.matrix[i][j] == 'X') // S'il s'agit du joueur\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.spawn = new Vector(j*GLOBAL.BSIZE.x,i*GLOBAL.BSIZE.y);\n\t\t\t\t\t\tthis.player = new Character(this.spawn);\n\t\t\t\t\t}\n\t\t\t\t\telse if(currentLvl.world.matrix[i][j] == '@') // S'il s'agit de la fin du niveau\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.matrix[i][j] = new Tile(new Vector(j*GLOBAL.BSIZE.x, i*GLOBAL.BSIZE.y), \"signExit\", true);\n\t\t\t\t\t\tthis.exit = {\"x\": j, \"y\" : i};\n\t\t\t\t\t}\n\t\t\t\t\telse if(currentLvl.world.matrix[i][j] != ' ') // Si ça n'ai pas un espace vide\n\t\t\t\t\t{\n\t\t\t\t\t\tlet traversable = cases[currentLvl.world.matrix[i][j]].traversable || false;\n\t\t\t\t\t\tlet letal = cases[currentLvl.world.matrix[i][j]].letal || false;\n\t\t\t\t\t\tlet texture = cases[currentLvl.world.matrix[i][j]].texture;\n\t\t\t\t\t\tthis.matrix[i][j] = new Tile(new Vector(j*GLOBAL.BSIZE.x, i*GLOBAL.BSIZE.y), texture, traversable, letal);\n\t\t\t\t\t}\n\t\t\t\t\telse // Sinon on met la case à undefined\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.matrix[i][j] = undefined;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// On retourne true lorsque le niveau est chargé\n\t\treturn true;\n\t}", "title": "" }, { "docid": "5d69175739fc5ba05cb65875b54dbcb1", "score": "0.5405488", "text": "function leveling(){\n\tif(score >= 5 && !level1){\n\t\tlevel1 = true;\n\t\tlevelUp = true;\n\t}\n\tif(score >= 10 && !level2){\n\t\tlevel2 = true;\n\t\tlevelUp = true;\n\t}\n\tif(score >= 15 && !level3){\n\t\tlevel3 = true;\n\t\tlevelUp = true;\n\t}\n\tlevelUP();\n}", "title": "" }, { "docid": "c923cddff460813de3f3a6db17bc1cb8", "score": "0.5399131", "text": "function showLevel () {\n if (playlist.length < 10) {\n $('#level').text('0' + playlist.length)\n } else {\n $('#level').text(playlist.length)\n }\n return $('#level').text()\n}", "title": "" }, { "docid": "612f0cc4cab80ab1c822f68e9fe385ab", "score": "0.5398581", "text": "function verifyLevelIncrease() {\n if((constants.BOWL_LEVEL > 4 && constants.GAME_LEVEL === 1) ||\n (constants.BOWL_LEVEL > 5 && constants.GAME_LEVEL > 1)) {\n\n constants.BOWL_LEVEL = 2;\n constants.GAME_LEVEL++;\n calculatePoints(true);\n }\n }", "title": "" }, { "docid": "f568248d3eaba33324de15598d8546f8", "score": "0.53971267", "text": "function getLevel() {\r\n\t\treturn level;\r\n\t}", "title": "" }, { "docid": "4b9bbc960bf2dfb81e6cf90f2d327de4", "score": "0.5387193", "text": "function chkLevel() {\n if (level === 1)\n spawnEnemy(3);\n else if (level === 2)\n spawnEnemy(5);\n}", "title": "" }, { "docid": "1fbbe29bef5c1e73f8f0cd83a81b767b", "score": "0.53849685", "text": "formatLevel(leveledScore) {\n return leveledScore.level;\n }", "title": "" }, { "docid": "917ae0cac6d9981c02eeecdfc5da54d4", "score": "0.53833604", "text": "nextLevel() {\n this.level++;\n this.fire(\"loadLevel\", this.level);\n }", "title": "" }, { "docid": "0ad3abf6faff2eebf154f399ac679403", "score": "0.53707725", "text": "function setLevel(level){\n var levelInfo = document.querySelector(\".game-info .game-info-level\");\n levelInfo.innerHTML = level; \n $g_level.innerHTML = \"Level \" + level;\n $g_level.style.display = 'block';\n utils.playSound('newLevel');\n\n //removing unused missiles (we don't like rubish in our DOM)\n $('.missile').remove();\n\n //adding the words for the level\n createWords();\n }", "title": "" }, { "docid": "6b0afa08fe4ddf045b0335307367e1a4", "score": "0.5358814", "text": "function winGame()\n{\n commentsPanel.innerHTML = \"congratulations <br /><br /> you have finished all the levels <br /><br /> space bar to restart level 1\";\n level = 0;\n // To make the game restart we set it back to failed state:\n curr_state = STATE_FAILED;\n}", "title": "" }, { "docid": "0d1d6e0ed82fe8a3cf8af41c7de82089", "score": "0.53499985", "text": "function Level()\r\n{\r\n\r\n\r\n}", "title": "" }, { "docid": "191077a77711fad6786f1aff2cffd7b4", "score": "0.5348999", "text": "where(level) {\n var ar = this.getStack(level); // check function at level\n if (ar != null) {\n this.getInfo(\"Sl\", ar); // get info about it\n if (ar.currentline > 0) // is there info?\n {\n return ar.shortsrc + \":\" + ar.currentline + \": \";\n }\n }\n return \"\"; // else, no information available...\n }", "title": "" }, { "docid": "d267c87e594466bfefb10ec62091a7ec", "score": "0.5345562", "text": "function Level(number) {\n var level = number;\n var room = 0;\n \n var level1 = [\"N\", \"N\", \"E\", \"N\", \"W\", \"W\", \"S\"];\n var level2 = [\"W\", \"W\", \"N\", \"W\", \"S\", \"S\", \"W\"]; \n var level3 = [\"N\", \"E\", \"E\", \"S\", \"W\", \"N\", \"N\"];\n var level4 = [\"E\", \"S\", \"S\", \"S\", \"W\", \"S\", \"S\"];\n var level5 = [\"E\", \"N\", \"W\", \"W\", \"W\", \"N\", \"E\"];\n \n var levelArray = [level1, level2, level3, level4, level5];\n \n // Returns the level player is on\n this.getLevel = function() {\n return level;\n }\n //Test if a new level is needed\n this.testLevel = function() {\n var count = 0;\n var nextLevel = false;\n if (room == levelArray[level -1].length) {\n myMessage += \"\\nCongratulations you have cleared level \" + this.getLevel();\n nextLevel = true;\n if (level > 5) {\n $(\"#proceed\").hide();\n myMessage += \"\\nYou have completed all the levels for the game. You scored \" + game.getScore();\n }\n document.form1.textarea3.value = myMessage;\n }\n return nextLevel;\n }\n // test if direction has beeen travelled and calls search of item\n this.testDirection = function(travel) {\n var currentLevel = levelArray[level -1];\n if (travel == currentLevel[room]) {\n room++;\n return randomFind();\n } else {\n myMessage = \"You can not go this way.\";\n } \n document.form1.textarea3.value = myMessage;\n }\n}", "title": "" }, { "docid": "aae0128462483d63ad56f63ee34a366c", "score": "0.5345539", "text": "function goToNextLevel(){\n levelNumber += 1;\n startNewLevel(levelNumber);\n}", "title": "" }, { "docid": "3898ed779b989bd1a747882f28c5682c", "score": "0.53356177", "text": "function traversal(member, lvl){\n\n\t\t// print the name\n\t\tif(lvl < 1){\n\t\t\tconsole.log(member['name']); // This if statement was add because of \">\"\n\t\t} else{\n\t\t\tconsole.log(\"--\".repeat(lvl) + \"> \" + member['name']);\n\t\t}\n\n\t\t// Iterates and recurse until it gets to all children \n\t\tfor(var j=0; j<member['children'].length; j++){\n\t\t\ttraversal(member['children'][j], lvl+1);\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "053b8d94fd968f3d5fc131126b32ba18", "score": "0.53260213", "text": "function displayHelpText() {\n if (level == 1) {\n $(\"#helpTextLevel1\").show();\n }\n else {\n $(\"#helpTextLevel2\").show();\n }\n}", "title": "" }, { "docid": "386d3d9b59d83641efab23a1886dcd58", "score": "0.53221256", "text": "function levelUp(){\n let nextlvxp = getxpforlv(player.level + 1);\n while(player.xp > nextlvxp){\n if(player.level != 100){\n player.levelup();\n adddiv_c(\"You leveled up! You are now level \" + player.level + \".\", \"lime\");\n nextlvxp = getxpforlv(player.level + 1);\n } else {\n adddiv(\"You are already max level. You cannot gain any more xp.\");\n break;\n }\n }\n {\n if(player.level != 100){\n let str = separateNum(nextlvxp - player.xp);\n adddiv(str + \" xp till next level.\");\n }\n }\n}", "title": "" }, { "docid": "f85b9786bc7112e3ac635e1d3df9d44d", "score": "0.53156334", "text": "lucha(){\n\t\talert('Para derrotar al enemigo necesitas sacar entre 0 y 4');\n\t\tvar random = Math.floor(Math.random()*5);\n\t\tif(random == 0 || random == 1 || random == 2 || random == 3 || random == 4){\n\t\t\tthis.lvl = this.lvl + 1;\n\t\t\t$(\"#h2lvl\").html(this.lvl);\n\t\t\talert('Has ganado con un ' + random);\n\t\t} else {\n\t\t\talert('Has perdido con un ' + random);\n\t\t\twindow.location.replace('lucha');\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "dd1eec21161c17c113f58620cb2d1dea", "score": "0.52972287", "text": "function checkforLevelCompletion() {\n if(game.globals.zombieGroup.children.length === 0) {\n // Stop the current level's track.\n this.music.stop();\n game.globals.zombieGroup.destroy();\n \n // Load the next level.\n if (game.state.current === 'levelOne') {\n game.state.start('levelTwo'); \n }\n if (game.state.current === 'levelTwo') {\n game.state.start('levelThree'); \n }\n if (game.state.current === 'levelThree') {\n game.state.start('victory'); \n }\n }\n}", "title": "" }, { "docid": "af311b0d1254a62b5fc456dfb3a4f781", "score": "0.5284951", "text": "gotoLevel(levelIndex) {\r\t\t\tthis.currentLevel = levelIndex;\r\t\t\tthis.levels.forEach(function (lvl) {\r\t\t\t\tlvl.visible = lvl.levelIndex == levelIndex;\r\t\t\t})\r\t\t}", "title": "" }, { "docid": "8765adbd6137154da74a6f3e7dc78466", "score": "0.52838606", "text": "updateLevel() {\n if (this.level == 1 && this.points >= 225) {\n this.level = 2;\n this.levelChanged = true;\n this.mistakes = 0; //Reset\n this.attempt = 1;\n }\n else if (this.level == 2 && this.points >= 675) {\n this.level = 3;\n this.levelChanged = true;\n this.mistakes = 0;\n this.attempt = 1;\n }\n else if (this.level == 3 && this.points >= 1375) {\n this.finished = true;\n }\n }", "title": "" }, { "docid": "8d456fa702fdd9e19e164fa7f22d4427", "score": "0.52838165", "text": "function changeLevelNumerator(){\n $scope.levelNumerator = \"Nivå \" + (numberOfWins+1) + \"/3\";\n }", "title": "" }, { "docid": "89b48cb0062ecd0b6ccc8d358ccc3d8d", "score": "0.52670723", "text": "function runLevel(level, Display, andThen){\n var display = new Display(document.body, level);\n runAnimation(function(step){\n level.animate(step, arrows);\n display.drawFrame();\n\n if(level.isFinished()){\n display.clear();\n if(andThen){\n andThen(level.status);\n }\n return false;\n }\n\n });\n \n window.addEventListener('optimizedResize', display.resize.bind(display));\n}", "title": "" }, { "docid": "4cc43bd7c319213d56419315f4e5555f", "score": "0.52654654", "text": "function advanceLevel() {\n\tprogress++;\n\tcurrentLevel = levelPlans[progress - 1],\n\tlevelData = window[\"currentLevel\"].pop(),\n\tG = levelData[\"G\"];\n}", "title": "" }, { "docid": "942559d7b9e23d90b453303a52d11362", "score": "0.52640307", "text": "function setLevelText() {\n //console.log('setLevelText()');\n if (offCamera(game.levelText) && vars.score > (isLevel() * vars.levelEveryX) - (game.width / (2 * vars.ratio)) && isLevel() < getTotalLevels() ) {\n game.levelText.x = game.width;\n game.levelText.text = 'Level ' + (isLevel() + 1);\n //console.log('move level ' + (isLevel() + 1) + ' text to: ' + game.levelText.x);\n }\n}", "title": "" }, { "docid": "8b30a49f90ab6e10b16df7ebd51ea17a", "score": "0.52591205", "text": "function showLevelScreen() {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.fillStyle = brandColor;\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n ctx.fillStyle = \"white\"\n ctx.font = \"72px cymraeg\";\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"alphabetic\";\n ctx.fillText(\"Level \" + levelNumber, canvas.width / 2, canvas.height / 2);\n}", "title": "" }, { "docid": "2885e3e2a30693cd4b6a5f0e2a621f73", "score": "0.52355826", "text": "function nextLevel(){\n level++;\n choices = [];\n index = 0;\n pattern.push(characters[getRandomNumber()])\n levelUpTitle();\n }", "title": "" }, { "docid": "10e4cec4a02758fa6f91c259d05cc774", "score": "0.5233751", "text": "function level4() {\n changeVisibility(\"fourthLevel\");\n changeVisibility(\"menu\");\n\tchangeVisibility(\"invisibleClickBegin4\");\n changeVisibility(\"calculator4\");\n changeVisibility(\"numberOne2\");\n changeVisibility(\"numberTwo3\");\n changeVisibility(\"numberZero\");\n changeVisibility(\"times3\");\n changeVisibility(\"divide\");\n changeVisibility(\"clear4\");\n changeVisibility(\"equals4\");\n\tchangeVisibility(\"delete4\");\n changeVisibility(\"enterStuff4\");\n document.getElementById(\"enterStuff4\").innerHTML = \"\";\n} // level4", "title": "" }, { "docid": "1049f53192f44d121640d8fc8dc7a7b1", "score": "0.5232416", "text": "function level1() {\n changeVisibility(\"firstLevel\");\n changeVisibility(\"menu\");\n\tchangeVisibility(\"invisibleClickBegin\");\n changeVisibility(\"calculator1\");\n changeVisibility(\"numberTwo\");\n changeVisibility(\"numberThree\");\n changeVisibility(\"times\");\n changeVisibility(\"plus\");\n changeVisibility(\"clear\");\n changeVisibility(\"equals\");\n\tchangeVisibility(\"delete\");\n changeVisibility(\"enterStuff\");\n document.getElementById(\"enterStuff\").innerHTML = \"\";\n} // level1", "title": "" }, { "docid": "30731a31abc08ce3349766c0101980fa", "score": "0.5230679", "text": "function displayInstructions(level){\n\t\n if(level === 1){\n currentArray = MCArray;\n }else if(level === 2){\n currentArray = TFArray;\n }else {\n currentArray = FBArray;\n }\n \n //create a array of instructions as <li> to be displayed. \n const listOfInstructions = currentArray.map((instructions, index) =>\n\t <li key={index}>\n {instructions} \n\t </li>\t\t\t\t\t\t\t\t\t \n );\n\t\n\treturn listOfInstructions;\n }", "title": "" }, { "docid": "d8bb7c4b0be3bb8a5b77ec3437e6a82a", "score": "0.522504", "text": "function getLevel(num) {\n gGame.isOn = false\n gLevel.SIZE = num\n if (num === 4) gLevel.MINES = 2\n if (num === 8) gLevel.MINES = 12\n if (num === 12) gLevel.MINES = 30\n initGame()\n\n}", "title": "" }, { "docid": "e6cc27b544508bba9f277b006e0a559f", "score": "0.5221023", "text": "function setLevel(level) {\n\n // set global level\n curLevel = level;\n\n // print level to console\n console.log(\"Current level chosen: \" + curLevel);\n\n // hide levels\n document.getElementById(\"levelContainer\").hidden = true;\n\n // show Sudoku\n document.getElementById(\"gameContainer\").hidden = false;\n\n // generate game\n generateSudoku();\n}", "title": "" }, { "docid": "bc3df6cccd1e0e9b089aca0ea4e775d9", "score": "0.52092505", "text": "function updatePlayerLevel(monsterlevel, monsterItem) {\n playerlevel = (Math.floor(playerXP / playerXPperLevel)) + 1; // Spieler-Level = XP / XPproLevel\n if (playerlevel >= 20 && victory == false) { // IF Bedingung wenn das Spielerlev. größer gleich wird kommt ein Windowsalert.\n window.alert(\"Gewinner, gewinner Huhn Abendessen\");\n victory = true;\n }\n if (playerlevel <= 0) {\n alert(\"Du bist gestorben!\");\n }\n document.getElementById(\"xpCounter\").innerHTML = \"Player-Level: \" + playerlevel + \" (XP: \" + playerXP + \" / \" + playerXPperLevel * (playerlevel + 1) + \") Items: \" + playerItems; // Baue den String für die Spieler-Info zusammen \n console.log(\"Spieler \" + playerName + \" hat nun Level \" + playerlevel + \" mit \" + playerXP + \" (\" + playerXPperLevel + \" pro Level) außerdem hat er ein(e) \" + \" bekommen!\"); // Spieler-Level in der Konsole.\n}", "title": "" }, { "docid": "b2d77a16b57b60c00517f7d612057d4f", "score": "0.52089804", "text": "function winLevel() {\n\t\tgame.state.start('level2');\n\t}", "title": "" }, { "docid": "14ab66ac4548a022faa98613ac917a77", "score": "0.5208477", "text": "function displayNextLevel(bonusPoints) {\n\n $(document).off(\"click\", throwPerl);\n deactivateEventListener();\n\n // displaying bonus points\n $(\"#bonusVal\").text(bonusPoints);\n\n $(\"#finalTotalPoints\").text(constants.GAME_POINT);\n\n $(\"#exitGame\").off(\"click\").on(\"click\", function(e){\n e.stopImmediatePropagation();\n endGame();\n $(\"#bonusSection\").hide();\n });\n\n // adding black font color for time and point section only for level 4 for better visibility\n if(constants.GAME_LEVEL === 4) {\n $(\"#timeSection, #pointSection\").addClass(\"black-font-color\");\n }\n if(constants.GAME_LEVEL > 4) {\n // if level is reached last level (4) then exit game and relevant info will be shown\n $(\"#exitGame\").css({\n \"float\":\"none\",\n \"margin\": \"auto\"\n });\n timer.stopTimer();\n constants.changeText($(\"#levelInfo\"), \"BONUS.COMPLETED\");\n\n // continue level button will be disabled in this case\n $(\"#continueGame\").hide();\n } else {\n $(\"#continueGame\").off(\"click\").on(\"click\", function(e){\n e.stopImmediatePropagation();\n $(\"#bonusSection\").hide();\n\n $(document).one(\"click\", throwPerl);\n\n var $newLevel = $(\"#level\"+constants.GAME_LEVEL),\n $prevLevel = $(\"#level\"+(constants.GAME_LEVEL-1));\n\n $newLevel.show().addClass(\"level-entry\");\n $prevLevel.addClass(\"level-exit\");\n setTimeout(function() {\n $prevLevel.hide();\n activateEventListener();\n },1000);\n $(\".bowl:last .perl\",$prevLevel).appendTo($(\"#level\"+constants.GAME_LEVEL+\" .bowl\"+(constants.BOWL_LEVEL-1)));\n });\n }\n // bonus section is displayed\n $(\"#bonusSection\").show();\n }", "title": "" }, { "docid": "f327fdf507a778b4ae9e916f255a88c7", "score": "0.5206533", "text": "loadLevel(level) {\n if (level >= 0 && level < this.levels.length) {\n this.level = level - 1;\n this.nextLevel();\n return true\n }\n else {\n this.console.error(\"This level doesn't exist\");\n return false\n }\n }", "title": "" }, { "docid": "b535345516affa6679cb7a6b1e49c555", "score": "0.5182026", "text": "function levelUp(nextClass) {\r\n\tif ((nextClass == \"bank\" || nextClass == \"vehicleflag\" || nextClass == \"airport\") && currentLevel != levels.length - 1) {\r\n\t\tdocument.getElementById(\"levelup\").style.display = \"block\";\r\n\t\tclearTimeout(currentAnimation);\r\n\t\tsetTimeout (function() {\r\n\t\t\tdocument.getElementById(\"levelup\").style.display = \"none\";\r\n\t\t\tcurrentLevel++;\r\n\t\t\tloadLevel();\r\n\t\t\t\r\n\t\t}, 1000);\r\n\t} else if (nextClass == \"plane\" && currentLevel == levels.length -1) {\r\n\t\tdocument.getElementById(\"win\").style.display = \"block\";\r\n\t}\r\n\t\r\n}", "title": "" }, { "docid": "45e6ec6f4d892c98b36229d3cecfdb26", "score": "0.517635", "text": "function showMessageBox(type, level) {\n if(type == \"positive\") {\n $('.messageBox').addClass(type)\n $('.messageBox').toggle()\n $('.messageBox').text(`Congrats! You have completed level ${level}. Press \"Play\" button to play next level.`)\n } else if(type == \"negative\") {\n $('.messageBox').addClass(type);\n $('.messageBox').toggle();\n $('.messageBox').text(`Sorry! You failed to complete this level. Please start over.`);\n } else if(type == \"visible\") {\n $('.messageBox').addClass(type);\n $('.messageBox').toggle();\n $('.messageBox').text(`Select the coloured boxs in sequence then press the \"Submit\" button to submit your answer.`);\n } else if(type == \"complete\"){\n $('.messageBox').addClass('positive');\n $('.messageBox').toggle();\n $('.messageBox').text(`Yoo, congrates! you have successfully completed the game`);\n }\n isMessageShowing = true\n}", "title": "" }, { "docid": "08db2a5162cb79e203f5e02467c35409", "score": "0.516229", "text": "function whichLevel() {\n\t//TODO: esto lo he tenido que cambiar para que construya el proyecto.\n\tvar path : String /*[]*/ = /*EditorApplication.currentScene.Split(char.Parse(\"/\"))*/\"\";\n\t\n\tswitch(path[1]) {\n\t\n\t\tcase \"Level1\":\n\t\t\tlevel = \"L1\";\n\t\t\t\n\t\tcase \"Level2\":\n\t\t\tlevel = \"L2\";\n\t\t\n\t\t// Por ahora, que estamos en el editor, entrenamos con el nivel 2.\n\t\tdefault:\n\t\t\tlevel = \"L1\";\n\t}\n}", "title": "" }, { "docid": "4f977edae2594c3d2c23b27dac348eab", "score": "0.51612324", "text": "function nextLevel() {\n\tplayer = {};\n\tlevel += 0.1;\n\ttextLocation.textContent = ('You won! Get ready for the next level...');\n\tmakeEnemies();\n\tgetReadyStart();\n}", "title": "" }, { "docid": "2ffce1d86887db0e929bd939848d3997", "score": "0.51605", "text": "drawLevel(context){\n const string = 'level: ' + String(this.game.level);\n const x = 10;\n const y = context.canvas.height - this.font.charHeight - this.margin;\n\n this.font.print(string, context, x, y);\n }", "title": "" }, { "docid": "0463bf03f08e3eb529da0ef02ad12826", "score": "0.51573324", "text": "nextLevel(){\n this.accelerationBall();\n this._level +=1 ;\n if(nbLignWall<8){\n nbLignWall += 1 ;\n }\n }", "title": "" }, { "docid": "52c634860932be6cddc362df5ad6eb00", "score": "0.51396424", "text": "function drawInfos() {\r\n ctx.fillStyle = \"#daa520\";\r\n ctx.font = \"italic 20px astro\";\r\n ctx.fillText(\"SCORE:\",10,25);\r\n ctx.fillStyle = \"#c0c0c0\";\r\n ctx.font = \"20px astro\";\r\n ctx.fillText(score,95,25);\r\n\r\n ctx.fillStyle = \"#ff4500\";\r\n ctx.font = \"italic 20px astro\";\r\n ctx.fillText(\"LIFES:\",160,25);\r\n ctx.fillStyle = \"#c0c0c0\";\r\n ctx.font = \"20px astro\";\r\n ctx.fillText(chance,235,25);\r\n\r\n if (level === 1) {\r\n ctx.fillStyle = \"#7cfc00\";\r\n ctx.font = \"italic 20px astro\";\r\n ctx.fillText(\"EASY\",295,25); \r\n }\r\n if (level === 2) {\r\n ctx.fillStyle = \"#75BEF7\";\r\n ctx.font = \"italic 20px astro\";\r\n ctx.fillText(\"MEDIUM\",295,25); \r\n }\r\n if (level === 3) {\r\n ctx.fillStyle = \"#F76CEC\";\r\n ctx.font = \"italic 20px astro\";\r\n ctx.fillText(\"HARD\",295,25); \r\n }\r\n}", "title": "" }, { "docid": "6568652a2611dbad15e9ea0caa475a7b", "score": "0.51385534", "text": "function nextLevel() {\n\tcurrentLevelIndex += 1;\n\tresetGame();\n}", "title": "" }, { "docid": "2cb76b9f1344d8902ba6bde836a38364", "score": "0.5135535", "text": "function advanceLevel(){\n\n\t\t\tjewel.audio.play(\"levelUp\"); //p.306\n\n\t\t\tgameState.level++;\n\t\t\tannounce(\"Level \" + gameState.level);\n\t\t\tupdateGameInfo();\n\t\t\t//level value on gameInfo obj is 0 at beginning of game\n\t\t\tgameState.startTime = Date.now();\n\t\t\tgameState.endTime = jewel.settings.baseLevelTimer *\n\t\t\t\tMath.pow(gameState.level, -0.05 * gameState.level);\n\t\t\tsetLevelTimer(true);\n\t\t\tjewel.display.levelUp();\n\t\t} //end of advanceLevel()", "title": "" }, { "docid": "f5a62209fd25711b41341b86d5afeeaa", "score": "0.5117852", "text": "function levelUpLeech(){\n if(protein >= upgradeLeechCost)\n {\n protein -= upgradeLeechCost;\n levelLeech += 1;\n\n performCalculations();\n updateLabels();\n }\n}", "title": "" }, { "docid": "2b09e4fee4e8ebd40eba72c01eff25cb", "score": "0.5114604", "text": "function show() {\n var curr = ctx.head;\n if (curr) {\n console.log(repeat('-', 80));\n var indentwidth = 0;\n var indentation = '';\n do {\n if (curr.width !== indentwidth) {\n indentwidth = curr.width;\n indentation = repeat(' ', indentwidth);\n }\n console.log(indent(indentation, curr.text));\n curr = curr.next;\n } while (curr);\n }\n}", "title": "" }, { "docid": "6565d600f88dd400afd372385bd19cf2", "score": "0.5114113", "text": "function startNewLevel(levelNumber) {\n\tsetRandomPattern();\n\tsetRandomFlips(levelNumber);\n\tmakePuzzleObject();\n\tmixUpPuzzle();\n\tdrawPuzzle();\n\tlevelLabel.innerHTML = \"Level \" + levelNumber;\n startNewTimer();\n puzzleResets = 0;\n numberFlips = 0;\n totalNumberFlips = 0;\n gameControls.style.visibility = \"visible\";\n winReport.style.visibility = \"hidden\";\n}", "title": "" } ]
0e2f9c26ec4103b77383a60f707f5ce7
================================================================ function saveControl(src, dest); Purpose: Save data from a list control into a textbox. Input: src: list control. dest: text control. ================================================================
[ { "docid": "2fb918e90c59c35e1657e0a3f7704e79", "score": "0.7471455", "text": "function saveControl(src, dest) {\n var i;\n var s = \"\";\n if (src.options.length > 0) {\n for (i = 0; i < src.options.length; i++) {\n s = s + src.options[i].value + \"|\" + src.options[i].name + \",\";\n }\n dest.value = s.substring(0, s.length - 1);\n } else {\n dest.value = \"\";\n }\n}", "title": "" } ]
[ { "docid": "3512abedc7f72922a565a9e6071132e9", "score": "0.5819659", "text": "function saveEditedListsToTextareaFrontEnd() {\n\tfor (let i = 0; i < editedListsIntoTextarea.length; i++) {\n\t\tdocument.getElementById(\"inputArea\").appendChild(document.createTextNode(editedListsIntoTextarea));\n\t}\n}", "title": "" }, { "docid": "b38609d977987dec9f9305708496016e", "score": "0.56798327", "text": "function _save_textbox_value_to_textbox_obj(p_textbox_obj, the_separator) {\n var v_value;\n var list_value = the_separator;\n _save_checkbox_value_to_textbox_obj(document.getElementsByName('chk_multiple_textbox'), the_separator);\n try {\n if (!p_textbox_obj.length) {\n list_value = p_textbox_obj.value;\n //eval('document.forms[0].'+p_textbox_obj.xml_tag_in_db_name+'.value=document.forms[0].'+p_textbox_obj.xml_tag_in_db_name+'.value+\"'+list_value+'\"');\n document.getElementById(p_textbox_obj.getAttribute(\"xml_tag_in_db_name\")).setAttribute(\"value\", list_value);\n } else {\n current_chk_obj = p_textbox_obj[0].getAttribute(\"xml_tag_in_db_name\");\n for (i = 0; i < p_textbox_obj.length; i++) {\n next_chk_obj = p_textbox_obj[i].getAttribute(\"xml_tag_in_db_name\");\n if (current_chk_obj != next_chk_obj) { //Neu het danh sach thi gan vao gia tri cua danh sach\n //eval('document.forms[0].'+current_chk_obj+'.value = document.forms[0].'+current_chk_obj+'.value+\"'+list_value+'\"');\n document.getElementById(current_chk_obj).setAttribute(\"value\", list_value);\n list_value = the_separator;\n }\n v_value = replace(p_textbox_obj[i].value, the_separator, \"\");\n if (v_value == \"\" || v_value == null) {\n v_value = \" \";\n }\n list_value = list_append(list_value, v_value, the_separator);\n if (i == p_textbox_obj.length - 1) { //Cuoi gan gia tri vao danh sach\n //eval('document.forms[0].'+current_chk_obj+'.value=document.forms[0].'+current_chk_obj+'.value+\"'+list_value+'\"');\n document.getElementById(current_chk_obj).setAttribute(\"value\", list_value);\n list_value = the_separator;\n }\n current_chk_obj = next_chk_obj;\n }\n }\n } catch (e) {\n ;\n }\n}", "title": "" }, { "docid": "b7b644357e6919d4bdc5ecfb424f30b0", "score": "0.5572619", "text": "function restoreControl(src, dest) {\n var i;\n var s;\n for (i = dest.options.length - 1; i >= 0; i--) {\n dest.options.remove(dest.options[i]);\n }\n\n i = 0;\n s = src.value + \",\";\n while (s.indexOf(\",\") > 0) {\n var sValue = \"\" + s.substring(0, s.indexOf(\"|\"));\n var sName = \"\" + s.substring(s.indexOf(\"|\") + 1, s.indexOf(\",\"));\n\n dest.options[i] = new Option(sName, sValue);\n dest.options[i].id = sValue;\n dest.options[i].value = sValue;\n dest.options[i].name = sName;\n s = s.substring(s.indexOf(\",\") + 1, s.length);\n i++;\n }\n}", "title": "" }, { "docid": "fca455c9925f953bf08f160ebb694480", "score": "0.54777426", "text": "function btnSave() \n{ \n app.ShowPopup( choosen );\n txt = edt.GetText();\n app.WriteFile( choosen, txt );\n}", "title": "" }, { "docid": "ec4c038710c43fd49cf2f3e520d2744d", "score": "0.5445855", "text": "function setElement_txt(id,text)\r\n{\r\n\t\t//alert('value of id------- '+id);description\r\n\t\t//alert('value of Text------'+text);\r\n\t\tvar ta = document.getElementById(id).getElementsByTagName('TEXTAREA')[0]\r\n\t//var ta = document.getElementsByTagName('TEXTAREA')[0];\r\n\tta.value = text;\r\n\ttransferTextAreaContent(false,ta);\r\n}", "title": "" }, { "docid": "360aa594ea04507346094dba51601e9c", "score": "0.5428824", "text": "function setInformationTextbox(dd_text, dd_item_id) {\n document.getElementById('txtInfo').innerHTML = dd_text;\n document.getElementById('btn_drop').innerHTML = document.getElementById(dd_item_id).text + '<div><span class=\"glyphicon glyphicon-chevron-down left-pad-7\" aria-hidden=\"true\"></span></div>';\n}", "title": "" }, { "docid": "45666b04c6b12485f6bb63dec964df34", "score": "0.53811586", "text": "function saveItem(event){\n //get targeted button\n var targetButton = $(event.target);\n //get targeted button's previous sibling: textarea\n var textArea = targetButton.prev();\n //textArea stored locally using textArea's id as key (e.g. \"hour-9\")\n localStorage.setItem(textArea.attr(\"id\"), textArea.val());\n}", "title": "" }, { "docid": "b1b5df80b2bf3f497c49428d8671c3c3", "score": "0.53579223", "text": "function CopyToClipboard(contents) {\n var ED = new TEdit(PSForm);\n ED.Parent = WeBuilder;\n ED.Text = contents;\n ED.SelectAll();\n ED.CopyToClipboard();\n\n // Object cleanup\n delete ED;\n}", "title": "" }, { "docid": "5920b6f69848455f7df1ebf6dd7812af", "score": "0.5355208", "text": "function save_data_to_txt(){\n var date = Date();\n var output = \"dummy human creator gui data from \" + date + \" https://healingdrawing.github.io/\\n\";\n for (var i=0;i<ids.length;i++){ output += ids[i]+\" \"+document.getElementById(ids[i]).value+\"\\n\"; }\n var a = document.getElementById('GUIexport');\n\t\n\tvar type = \"text/plain\";\n\tvar name = \"exported_dummy_human_\"+date+\".txt\";\n\tvar file = new Blob([output], {type: type});\n\ta.href = URL.createObjectURL(file);\n\ta.download = name;\n\ta.click();\n}", "title": "" }, { "docid": "f019e0e42e75d9d81566faa395ac20b9", "score": "0.5300686", "text": "function label_to_textbox(){\n\t $( \".edit-label\" ).replaceWith( function() {\n\t \t$('.edit-btns').show();\n\t return \"<input type=\\\"text\\\" class=\\\"form-control edit-text\\\" value=\\\"\" + $( this ).html() + \"\\\" />\";\n\t });\n}", "title": "" }, { "docid": "14f85dd6317650b80e9f5cc46a6a1055", "score": "0.5283188", "text": "function copytext()\n{\n let txt = document.getElementById(\"copiedtxt\");\n let copy = document.getElementById(\"entertxt\");\n \n txt.value = copy.value;\n}", "title": "" }, { "docid": "1161550cc490ffdbf347a7ca10d72cc3", "score": "0.5275235", "text": "function converter(event, textBoxID, listID) {\r\n if (event.keyCode == 13 || event.which == 13) {\r\n var text = document.getElementById(textBoxID).value;\r\n if (text.length > 0) {\r\n if (text.substring(0, 7) != \"http://\" && text.substring(0, 8) != \"https://\") {\r\n text = \"http://\" + text;\r\n }\r\n Office.context.document.settings.set('link' + linkCount++, text);\r\n var element = document.createElement(\"li\");\r\n var link = document.createElement(\"a\");\r\n // link.id = \"link\" + (linkCount - 1);\r\n link.setAttribute(\"href\", text);\r\n link.setAttribute(\"target\", \"_blank\");\r\n if (text.length <= 40) {\r\n link.innerText = (text);\r\n }\r\n else {\r\n link.innerText = text.substring(0, 40) + \"...\";\r\n link.setAttribute(\"title\", text);\r\n }\r\n //link.setAttribute(\"onclick\", \"openURL(\"+link.id+\")\");\r\n element.appendChild(link);\r\n var list = document.getElementById(\"mylist\");\r\n list.appendChild(element);\r\n document.getElementById(textBoxID).value = \"\";\r\n Office.context.document.settings.set('linkCount', linkCount);\r\n Office.context.document.settings.saveAsync(function (asyncResult) {\r\n if (asyncResult.status == Office.AsyncResultStatus.Failed) {\r\n //Hopefully it'll go in here (means that the save worked)\r\n } else {\r\n //Save didn't work\r\n }\r\n });\r\n }\r\n }\r\n }", "title": "" }, { "docid": "3f9f00232891a8e0c64b52beaa2ece2d", "score": "0.52535504", "text": "function _save_checkbox_value_to_textbox_obj(p_chk_obj, the_separator) {\n var ret = \"\";\n try {\n if (!p_chk_obj.length) {\n if (document.getElementById(p_chk_obj.getAttribute(\"xml_tag_in_db_name\")).getAttribute(\"checked\")) {\n ret = document.getElementById(p_chk_obj.getAttribute(\"xml_tag_in_db_name\")).getAttribute(\"value\");\n document.getElementById(p_chk_obj.getAttribute(\"xml_tag_in_db_name\")).setAttribute(\"value\", ret);\n }\n } else {\n current_chk_obj = p_chk_obj[0].getAttribute(\"xml_tag_in_db_name\");\n for (i = 0; i < p_chk_obj.length; i++) {\n next_chk_obj = p_chk_obj[i].getAttribute(\"xml_tag_in_db_name\");\n if (current_chk_obj != next_chk_obj) { //Neu het danh sach thi gan vao gia tri cua danh sach\n document.getElementById(current_chk_obj).setAttribute(\"value\", ret);\n ret = \"\";\n }\n if (p_chk_obj[i].checked) {\n ret = list_append(ret, p_chk_obj[i].value, the_separator);\n }\n if (i == p_chk_obj.length - 1) { //Cuoi gan gia tri vao danh sach\n document.getElementById(current_chk_obj).setAttribute(\"value\", ret);\n ret = \"\";\n }\n current_chk_obj = next_chk_obj;\n }\n }\n } catch (e) {\n ;\n }\n}", "title": "" }, { "docid": "48215235b47714e0e1a41c1d85cfa1f7", "score": "0.5248733", "text": "function appendChangedValueToOptions( selectControl, txtControl, container)\r\n{\r\n\tvar changedValue = txtControl.value;\r\n\tvar controlID = selectControl.id;\r\n\tvar elOptNew = document.createElement('option');\r\n\telOptNew.title = changedValue;\r\n\telOptNew.value = changedValue;\r\n\telOptNew.selected = true;\r\n\tvar txtNode = document.createTextNode( changedValue );\r\n\telOptNew.appendChild( txtNode );\r\n\tselectControl.appendChild( elOptNew );\r\n}", "title": "" }, { "docid": "7e39e624cb5beed4a4af6d829ec71cae", "score": "0.5236958", "text": "function textAreaUpdate(control)\r\n{\r\n xappSetData(control.data('dataId'), control.val());\r\n}", "title": "" }, { "docid": "a791e3e4844a16558e254457ddf3dc9f", "score": "0.52321136", "text": "function addSrcToDestList(formName) {\ndestList = window.document.forms[formName].destList;\nsrcList = window.document.forms[formName].srcList; \nvar len = destList.length;\nfor(var i = 0; i < srcList.length; i++) {\n\tif ((srcList.options[i] != null) && (srcList.options[i].selected)) {\n\t//Check if this value already exist in the destList or not\n\t//if not then add it otherwise do not add it.\n\t\tvar found = false;\n\t\tfor(var count = 0; count < len; count++) {\n\t\t\tif (destList.options[count] != null) {\n\t\t\t\tif (srcList.options[i].text == destList.options[count].text) {\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t \t}\n\t\t }\n\t\t}\n\t\tif (found != true) {\n\t\t\tdestList.options[len] = new Option(srcList.options[i].text, srcList.options[i].value); \n\t\t //destList.options[len].value = new Option(srcList.options[i].value); \n\t\tlen++;\n\t }\n\t}\n}\n} //end of function", "title": "" }, { "docid": "eea57dcc612ff88ac742a5d84d1e46ec", "score": "0.5208441", "text": "function saveSelection(e) {\n var container = jQuery(e.target).closest('fieldset');\n var val = jQuery('input',container).val();\n switch (jQuery('input',container).attr('type')) {\n case 'checkbox':\n case 'radio':\n // join them all (radio will just get one)\n var texts = [];\n jQuery('input:checked',container).each(function(idx,item) {\n texts[texts.length] = jQuery(item.parentNode).text();\n });\n if (texts.length == 0) {\n return false;\n }\n val = texts.join(',');\n break;\n default:\n if (val == null || jQuery.trim(val) == '') {\n return false;\n }\n }\n jQuery('#toc-'+container.attr('id')+' .item-value').text(val);\n return true;\n}", "title": "" }, { "docid": "80ab693cd1cb05cdb12de11e8aec1041", "score": "0.5186923", "text": "function DVP_element_textbox_save() {\n if (textbox.value !== valueLabel.getAttribute(\"value\")) {\n valueLabel.setAttribute(\"value\", textbox.value);\n\n let expr = \"(\" + element.token + \"=\" + textbox.value + \")\";\n DebuggerController.StackFrames.evaluate(expr);\n }\n DVP_element_textbox_clear();\n }", "title": "" }, { "docid": "415d3cbdd4ff338c0c66d09a1eca652b", "score": "0.51552224", "text": "function transferTextAreaContent(e,inputObj,discardContentUpdate)\r\n{\r\n\tif(!inputObj)inputObj = this;\r\n\tinputObj.style.display='none';\r\n\tvar spans = inputObj.parentNode.getElementsByTagName('DIV');\r\n\t\r\n\tfor(var no=0;no<spans.length;no++){\r\n\t\tif(spans[no].className=='weekScheduler_appointment_txt'){\r\n\t\t\tif(!discardContentUpdate){\r\n\t\t\t\tappointmentProperties[inputObj.parentNode.id]['description'] = inputObj.value;\r\n\t\t\t\tspans[no].innerHTML = '<span style=\"float:right;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;</span>' + inputObj.value.replace(/\\n/g,'<br>');\r\n\t\t\t}\r\n\t\t\tspans[no].style.display='block';\r\n\r\n\t\t}\t\r\n\t\tif(spans[no].className=='weekScheduler_appointment_footer'){\r\n\t\t\tspans[no].style.display='block';\r\n\t\t}\t\r\n\t\tif(spans[no].className=='weekScheduler_appointment_time'){\r\n\t\t\tspans[no].style.display='block';\r\n\t\t}\t\t\t\r\n\t}\r\n\tcontentEditInProgress = false;\r\n\tcurrentEditableTextArea =false;\r\n\trepositionFooter(inputObj.parentNode);\r\n\tif(instantSave && appointmentProperties[inputObj.parentNode.id]['description'].length>0){\r\n\t\tsaveAnItemToServer(inputObj.parentNode.id);\r\n\t}\r\n\t\t\r\n}", "title": "" }, { "docid": "dea1c99bb6b1bafa5869befadd1dfa92", "score": "0.51413465", "text": "function copyWallLocations() {\n var txtWalls = document.getElementById(\"txtWallLocations\");\n txtWalls.style.display = \"inline\";\n //alert(txtWalls.value);\n txtWalls.select();\n document.execCommand('copy');\n txtWalls.style.display = \"none\";\n alert(\"Wall information has been copied to your clipboard.\");\n}", "title": "" }, { "docid": "4a8df9ee05de3ffb7945de2d17c9d142", "score": "0.5117652", "text": "function pasteButton(designerPanel, propertyPanel) {\n var PosX = designerPanel.cursorCustomX;\n var PosY = designerPanel.cursorCustomY;\n var arr = this.copyfield;\n for (var cnt = 0; cnt < arr.length; cnt++) {\n var obj = arr[cnt];\n if (obj.fieldTypeId == Ext.fieldID.insertVLine) {\n var field = configureItemList(obj, designerPanel, propertyPanel)\n } else if (obj.fieldTypeId == Ext.fieldID.insertImage) {\n field = createExtImgComponent(designerPanel, propertyPanel, obj.fieldTypeId, obj.src, obj.x, obj.y, obj);\n } else if (obj.fieldTypeId == Ext.fieldID.insertHLine) {\n field = createHoLineComponent(designerPanel, obj.fieldTypeId, propertyPanel, PosX, PosY, obj.width);\n } else {\n var labelHTML = obj.fieldTypeId != Ext.fieldID.insertField ? obj.labelhtml : \"<span attribute='{PLACEHOLDER:\" + obj.fieldid + \"}'>\" + obj.labelhtml + \"</span>\";\n field = createExtComponent(designerPanel, propertyPanel, obj.fieldTypeId, labelHTML, PosX, PosY, {\n width: obj.width,\n height: obj.height\n });\n }\n designerPanel.items.add(field);\n }\n designerPanel.doLayout();\n\n Ext.getCmp('pasteformattingbtn').enable();\n Ext.getCmp('copyformattingbtn').enable();\n}", "title": "" }, { "docid": "39b9afb0b038e4e735fe6519903a0564", "score": "0.51091975", "text": "function SaveData() {\n var lHtml = document.getElementById(lHtml);\n var nodes = lHtml.childNodes;\n var html = \"<!DOCTYPE html><html xmlns='http://www.w3.org/1999/xhtml'><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8'/> <title></title></head><body>\";\n\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i]) {\n if (nodes[i].nodeName == \"LABEL\") {\n html += \"<label>\" + nodes[i].innerText + \"</label>\";\n }\n if (nodes[i].nodeName == \"INPUT\") {\n if (nodes[i].type == \"checkbox\") {\n if (nodes[i].checked) {\n html += \"<input type='checkbox' id='\" + nodes[i].id + \"' class='\" + nodes[i].className + \"' checked>\";\n } else {\n html += \"<input type='checkbox' id='\" + nodes[i].id + \"' class='\" + nodes[i].className + \"' >\";\n }\n }\n if (nodes[i].type == \"text\" || nodes[i].type == \"textbox\") {\n html += \"<input type='textbox' id='\" + nodes[i].id + \"' value='\" + nodes[i].value + \"' class='\" + nodes[i].className + \"'>\";\n }\n }\n if (nodes[i].nodeName == \"BR\") {\n html += \"</BR>\";\n }\n }\n }\n html += \"</body></html>\";\n return html;\n}", "title": "" }, { "docid": "3cbff62febfe7d30aea9134d3e2a3c07", "score": "0.50732994", "text": "function editList(id){\n\tvar entry = document.getElementById(id);\n\tvar childs = entry.childNodes;\n\tvar currentValue = \"\";\n\tvar size = 0;\n\tvar sizeStr = \"\";\n\n\tfor (var i =0; i<childs.length;i++){\n\t\tcurrentValue= childs[i].innerHTML;\n\n\t\tif (childs[i].className != \"buttons\" ){\n\t\t\t\n\t\t\tvar textElement = document.createElement(\"input\");\n\t\t\ttextElement.type = \"text\"\n\t\t\tsize = currentValue.length;\n\t\t\tsizeStr = size.toString();\n\t\t\ttextElement.size = sizeStr;\n\t\t\ttextElement.value= currentValue;\n\t\t\tchilds[i].innerHTML = \"\";\n\t\t\tchilds[i].appendChild(textElement);\n \n\t\t} else if(i == childs.length-1){\n\t\t\t\n\t\t\tchilds[i].firstChild.value =\"Save\";\n\t\t\tchilds[i].firstChild.id = \"save\";\n\t\t\tdocument.getElementById(\"save\").onclick = function(){\n\t\t\t\tsaveElement(id);\n\n\t\t\t\tvar firstName = document.getElementById(id).firstChild.innerHTML;\n\t\t\t\tvar lastName = document.getElementById(id).firstChild.nextSibling.innerHTML;\n\t\t\t\tvar age = document.getElementById(id).firstChild.nextSibling.nextSibling.innerHTML;\n\t\t\t\tvar newId = firstName + \"-\" + lastName + \"-\" + age;\n\t\t\t\t\n\t\t\t\tdocument.getElementById(id).id = newId;\n\t\t\t\tlocalStorage.removeItem(id);\n\t\t\t\tstoreInfo(firstName,lastName,age,newId);\n\t\t\t\tlist.remove(id);\n\t\t\t\tlist.add(firstName,lastName,age);\n\t\t\t}\n\t\t}\n\n\t}\n}", "title": "" }, { "docid": "86182bae10902e7af126162e5d4a5ccf", "score": "0.5064607", "text": "function copyToClipboard(){\n var text = displayEl.innerText; \n var temporary = document.createElement(\"textarea\"); \n document.body.appendChild(temporary); \n temporary.value = text; \n temporary.select(); \n document.execCommand(\"copy\"); \n document.body.removeChild(temporary);\n\n}", "title": "" }, { "docid": "2b3ddbff6615b647fe2100a5a1bb719b", "score": "0.5057667", "text": "function inplace_textbox_read2write(div) {\n div_read = div + \"-r\";\n $(\"#\" + div_read).hide();\n \n div_nodata = div + \"-n\";\n $(\"#\" + div_nodata).hide();\n\n div_edit = div + \"-e\";\n input = div + \"-i\";\n\n value = $(\"#\" + div_read + \" span:first\").html();\n $(\"#\" + input).attr('value', value); // copypaste value from text-span to input control\n $(\"#\" + div_edit).show();\n $(\"#\" + div_edit + \" input:first\").focus().select();\n}", "title": "" }, { "docid": "0cb7d0aafd1842562b06c3a7e35a27ab", "score": "0.5039462", "text": "function addSrcToDestList() {\n\tdestList = window.document.forms[0].destList;\n\tsrcList = window.document.forms[0].srcList;\n\tvar len = destList.length;\n\tfor(var i = 0; i < srcList.length; i++) {\n\t\tif ((srcList.options[i] != null) && (srcList.options[i].selected)) {\n\t\t\t//Check if this value already exist in the destList or not\n\t\t\t//if not then add it otherwise do not add it.\n\t\t\tvar found = false;\n\t\t\tfor(var count = 0; count < len; count++) {\n\t\t\t\tif (destList.options[count] != null) {\n\t\t\t\t\tif (srcList.options[i].text == destList.options[count].text) {\n\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\tbreak;\n\t\t\t \t\t}\n \t\t\t\t }\n\t\t\t}\n\t\t\tif (found != true) {\n\t\t\t\tdestList.options[len] = new Option(srcList.options[i].text,srcList.options[i].value);\n\t\t\t\tlen++;\n\t \t}\n \t\t}\n \t }\n}", "title": "" }, { "docid": "2e4758e3500bb297d306ea75a43205aa", "score": "0.50359064", "text": "function saveElement(id){\n\tvar entry = document.getElementById(id);\n\tvar childs = entry.childNodes;\n\tvar info = \"\";\n\n\tfor (var i = 0; i<childs.length;i++){\n\t\tif (childs[i].className != \"buttons\"){\n\t\t\tinfo = childs[i].firstChild.value;\n\t\t\tchilds[i].innerHTML = info;\n\t\t} else if(i == childs.length-1){\n\t\t\tchilds[i].firstChild.value = \"Edit\";\n\t\t\tchilds[i].firstChild.id = \"edit\";\n\t\t\tdocument.getElementById(\"edit\").onclick = function(){\n\t\t\t\teditList(id);\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4f23a47a8b517bc9ac509af2e3709c28", "score": "0.50302935", "text": "function TextFieldCommaList_setValue(theValue)\r\n{\r\n this.textControl.value = theValue;\r\n}", "title": "" }, { "docid": "8ae323b2dcca07314a21e75ce5c264fb", "score": "0.50096", "text": "function addListItem(x1,y1,x2,y2){\n var clone = document.querySelector('.controls').cloneNode(true);\n clone.style.display=\"\";\n var inputs = clone.getElementsByTagName('input')\n inputs[0].value=x1;\n inputs[1].value=y1;\n inputs[2].value=x2;\n inputs[3].value=y2;\n document.getElementById('list').appendChild(clone);\n return inputs;\n}", "title": "" }, { "docid": "0ce305378b709a2ab1b3b5248ac7731f", "score": "0.49741232", "text": "function saveValues(obj, hiddenID)\n{ \n if (!hasOptions(obj)) { return; }\n \n var hidden = document.getElementById(hiddenID);\n var selectedValuesArr = Get_SelectedValues(obj); \n var sep = ',';\n \n //sep is in pos 3 \n if(arguments.length>2)\n {\n sep = arguments[2];\n }\n \n hidden.value = '';\n \n if(selectedValuesArr == null) return;\n \n for(i=0; i<selectedValuesArr.length; ++i)\n {\n //add comma after value\n if(i>0) hidden.value+= sep;\n hidden.value+=selectedValuesArr[i];\n }\n}", "title": "" }, { "docid": "c51f84cdef5cb6b628a3bb874f1b639d", "score": "0.49492773", "text": "function CopyIpaToClipboard() {\n if (window.clipboardData) {\n window.clipboardData.setData('Text', document.getElementById(\"txtIpa\").value);\n } else {\n document.getElementById(\"txtIpa\").focus();\n document.getElementById(\"txtIpa\").select();\n }\n}", "title": "" }, { "docid": "08f57b05bf3c3098a78373381e1d6553", "score": "0.49241668", "text": "function joinNoEditInAddOdr(index,ths){\r\n\tif($(ths)[0].innerText==\"SAVE\")\treturn false;\r\n\t$(ths)[0].innerHTML=\"<input type='text' class='form-control input-sm' value='\"+$(ths)[0].innerText+\"' style=''/> <span class='input-group-btn btc2'><button class='button button-5 button-5a icon-cart' style=' height: 25px; padding: 1px;text-align: -webkit-center;top: 1px;' onclick='saveeditedjoinNo(\"+index+\",this)'>SAVE</button></span>\";\r\n\t$(ths).find(\"input\")[\"0\"].select();\r\n\t$(ths).find(\"input\")[\"0\"].focus();\r\n\t}", "title": "" }, { "docid": "a01a58275657e2f5cb2a8c6bcab027c2", "score": "0.49188122", "text": "function editText() {\n $(\".cancelButton\").show();\n $(\".saveButton\").show();\n $(\".editButton\").attr(\"disabled\",\"true\");\n \n //store all textboxes on the page in textBoxList\n textBoxList = $(\".editable\");\n \n \n //create the text areas and store in a list called textAreaList\n for (var i = 0; i < textBoxList.length; i++) {\n textAreaList.push($(\"<textarea></textarea>\"));\n }\n\n //transfer text content of each textbox to a list called textContentList\n textBoxList.each(function(index, textBox) {\n textContentList.push($(textBox).text());\n });\n\nfor (var i = 0; i < textBoxList.length;i++) {\n $(textAreaList[i]).attr(\"id\", $(textBoxList[i]).attr(\"id\"));\n $(textAreaList[i]).text($(textBoxList[i]).text());\n}\n\n\n //replace the textboxes with the new textareas\n textBoxList.each(function(index, textBox) {\n if($(textBoxList[index]).is(\"p\")) {\n $(textAreaList[index]).css(\"width\", \"100%\");\n $(textAreaList[index]).css(\"height\", \"300px\");\n }\n $(textBox).replaceWith(textAreaList[index]);\n });\n\n}", "title": "" }, { "docid": "860dc76aedfdd5f8e070eb98e3b0ecb2", "score": "0.4917377", "text": "function saveText(event){\n //Var that hold the button clicked id\n var elIdTemp = event.target.id;\n var elId = elIdTemp.replace('btn','');\n\n //Switch statement that matches the input box to the target id\n switch(elId){\n case \"9\":\n inputTxt = document.getElementById('0').value;\n storeTxt(inputTxt, 0);\n break;\n case \"10\":\n inputTxt = document.getElementById('1').value;\n storeTxt(inputTxt, 1);\n break;\n case \"11\":\n inputTxt = document.getElementById('2').value;\n storeTxt(inputTxt, 2);\n break;\n case \"12\":\n inputTxt = document.getElementById('3').value;\n storeTxt(inputTxt, 3);\n break;\n case \"1\":\n inputTxt = document.getElementById('4').value;\n storeTxt(inputTxt, 4);\n break;\n case \"2\":\n inputTxt = document.getElementById('5').value;\n storeTxt(inputTxt, 5);\n break;\n case \"3\":\n inputTxt = document.getElementById('6').value;\n storeTxt(inputTxt, 6);\n break;\n case \"4\":\n inputTxt = document.getElementById('7').value;\n storeTxt(inputTxt, 7);\n break;\n case \"5\":\n inputTxt = document.getElementById('8').value;\n storeTxt(inputTxt, 8);\n break;\n }\n\n}", "title": "" }, { "docid": "65a48be759e76d60188265c83f65154d", "score": "0.49077773", "text": "function saveEditedListsTextArea() {\n\tfor (let i = 0; i < listBookArray.length; i++) {\n\t\ttextAreaArrayLists.push(listBookArray[i]);\n\t\tlistBookArray.splice(i, 1);\n\t\ti--;\n\t}\n\tlocalStorage.setItem(\"saveEditedLists\", JSON.stringify(textAreaArrayLists));\n\tlocalStorage.removeItem(\"savedListBooks\");\n}", "title": "" }, { "docid": "f3519e9672dcc3d592115e38fc3a655e", "score": "0.49060065", "text": "function copyButton(designerpanel, propertypanel)\n{\n if (isValidFieldSelected() && Ext.getCmp('hidden_allowformatting').getValue() == 'true') {\n var obj = Ext.getCmp(Ext.getCmp('hidden_fieldID').getValue());\n var items = [];\n var initconfig = obj.initialConfig;\n var fieldTypeId = obj.fieldTypeId;\n if (fieldTypeId != Ext.fieldID.insertTable) {// check for line items (id==5).\n if (fieldTypeId != Ext.fieldID.insertImage) {// check for image (id==3).\n var label = obj.el.dom.firstChild.innerHTML == undefined ? obj.el.dom.firstChild.nodeValue :\n (obj.el.dom.firstChild.innerHTML.indexOf(\"#\") == 0 ? obj.el.dom.firstChild.innerHTML : obj.el.dom.firstChild.outerHTML);\n var config = {\n x: obj.x,\n y: obj.y,\n labelhtml: label,\n height: obj.height,\n width: obj.width,\n fieldTypeId: obj.fieldTypeId\n };\n } else {\n var xPos = document.getElementById(obj.id + '-rzwrap').style.left.replace(\"px\", \"\") * 1;\n var yPos = document.getElementById(obj.id + '-rzwrap').style.top.replace(\"px\", \"\") * 1;\n config = {\n x: xPos,\n y: yPos,\n src: obj.src,\n height: obj.height,\n width: obj.width,\n fieldTypeId: obj.fieldTypeId\n };\n }\n // retrieve field id\n var content = obj.el.getHTML();\n var arr = content.match(/\\{PLACEHOLDER:(.*?)}/g);\n if (arr && arr[0]) {\n var matches = arr[0].replace(/\\{|\\}/gi, '').split(\":\");\n config['placeholder'] = matches[1];\n var rec = searchRecord(defaultFieldGlobalStore, matches[1], 'id');\n if (rec) {\n var recdata = rec.data;\n config['reftablename'] = recdata.reftablename;\n config['reftablefk'] = recdata.reftablefk;\n config['reftabledatacolumn'] = recdata.reftabledatacolumn;\n config['dbcolumnname'] = recdata.dbcolumnname;\n config['fieldid'] = recdata.id;\n config['label'] = recdata.label;\n config['xtype'] = recdata.xtype;\n config['customfield'] = recdata.customfield;\n }\n }\n items.push(config);\n this.copyfield = items;\n Ext.getCmp('pasteformattingbtn').enable();\n Ext.getCmp('copyformattingbtn').disable();\n }\n else {\n var listItems = Ext.get('itemlistconfig');\n if (listItems && listItems.dom.childNodes.length > 0) {\n var lineitems = [];\n var childItems = listItems.dom.childNodes;\n for (var itemcnt = 0; itemcnt < childItems.length; itemcnt++) {\n var child = childItems[itemcnt];\n var colSetting = child.attributes;\n var childConfig = {\n 'fieldid': child.value,\n 'label': child.innerHTML\n };\n for (var attrCnt = 0; attrCnt < colSetting.length; attrCnt++) {\n if (colSetting[attrCnt].name != 'class' && colSetting[attrCnt].name != 'style')\n childConfig[colSetting[attrCnt].name] = colSetting[attrCnt].value\n }\n lineitems.push(childConfig);\n }\n var lineConfig = {\n 'lineitems': lineitems,\n id: obj.id,\n x: obj.x,\n y: obj.y,\n width: obj.width,\n fieldTypeId: obj.fieldTypeId\n };\n items.push(lineConfig);\n }\n }\n }\n}", "title": "" }, { "docid": "8ef7ad3488541ba097495420835d2a56", "score": "0.49009448", "text": "function text() {\r\n var node = document.createElement(\"LI\");\r\n node.setAttribute('class', 'base');\r\n\r\n var x = document.createElement(\"INPUT\");\r\n x.setAttribute(\"type\", \"textarea\");\r\n x.setAttribute(\"id\", \"ta\");\r\n x.setAttribute('class', 'txt');\r\n var textName = \"textbx \" + String(getText());\r\n addText();\r\n x.setAttribute(\"id\", textName);\r\n\r\n var y = document.createElement('button');\r\n y.setAttribute('content', 'test content');\r\n y.setAttribute('class', 'properties');\r\n y.innerHTML = 'Edit';\r\n\r\n var z = document.createElement('button');\r\n z.setAttribute('class', 'delete');\r\n z.innerHTML = 'x';\r\n\r\n node.appendChild(x);\r\n node.appendChild(y);\r\n node.appendChild(z);\r\n\r\n var tabID = String(getSelectedTabId());\r\n\r\n var tabContID = document.getElementById(tabID).children[0].id;\r\n\r\n document.getElementById(tabContID).appendChild(node);\r\n\r\n var active = $(\"#tabs .ui-tabs-panel:visible\").attr(\"id\");\r\n\r\n var test = document.getElementById(active).getElementsByClassName(\"fieldClass\");\r\n\r\n if(test.length > 0) {\r\n remake();\r\n }\r\n }", "title": "" }, { "docid": "418717c1c9d08b4d89d3652164347f83", "score": "0.49000493", "text": "text(label) {\n\t\tvar i = this.tabs.indexOf(label);\n\t\tvar id = this.id + this.tabs[i] + \"content\";\n\t\tvar el = document.getElementById(id);\n\t\tvar textarea = (el instanceof HTMLTextAreaElement);\n\t\t\n\t\t// Handle content as textarea\n\t\tif(textarea) {\n\t\t\tvar lines = el.value.split(\"\\n\");\n\t\t\tvar tav = {\n\t\t\t\tpush: function(line) {\n\t\t\t\t\t// Avoid first empty line after clear textarea\n\t\t\t\t\tif(lines.length == 1 && lines[0].length == 0) {\n\t\t\t\t\t\tlines[0] = line;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlines.push(line);\n\t\t\t\t\t}\n\t\t\t\t\tvar val = lines.join(\"\\n\");\n\t\t\t\t\tel.value = val;\n\t\t\t\t},\n\t\t\t\tpop: function() {\n\t\t\t\t\tvar pl = lines.pop();\n\t\t\t\t\tvar val = lines.join(\"\\n\");\n\t\t\t\t\tel.value = val;\n\t\t\t\t\treturn pl;\n\t\t\t\t},\n\t\t\t\tpopAll: function() {\n\t\t\t\t\tel.value;\n\t\t\t\t\treturn lines;\n\t\t\t\t},\n\t\t\t\tclear: function() {\n\t\t\t\t\tel.value = \"\";\n\t\t\t\t},\n\t\t\t}\n\t\t\treturn tav;\n\t\t} else {\n\t\t\tvar msg = this.id + \" \" + this.tabs[i] +\n\t\t\t\t\" is not a textarea\";\n\t\t\tthrow new Error(msg);\n\t\t}\n\t}", "title": "" }, { "docid": "d7605bdcda7d7cee80216ca76f78d459", "score": "0.4899481", "text": "function save(event) {\n event.preventDefault();\n var index = $(this).attr('index');\n // jQuery selector always returns an array. to get around that, I had to use\n // .eq(0) (because it was always the only thing in the array).\n var textToSave = $('textarea[index=' + index + ']').eq(0).val();\n var objectToSave = {\n index: index,\n text: textToSave\n }\n localStorage.setItem(index, JSON.stringify(objectToSave));\n }", "title": "" }, { "docid": "bcccc3cca59efef7fe4b9c4224fe854b", "score": "0.48952764", "text": "function textToClipboard () {\n //copy items with 'p' tag into the clipboard\n var text = $('p').html();\n //convert into an input file to execute the copy commany\n var tempEl = $('<input>').val(text).appendTo('body').select();\n document.execCommand('copy');\n tempEl.remove();\n }", "title": "" }, { "docid": "bb8114a93a9d5b324f1bcb3156b03e0b", "score": "0.48767045", "text": "function handleSave(event){\n var value = $(this).siblings(\".textarea\").val();\n var key = $(this).siblings(\".textarea\").attr(\"id\");\n localStorage.setItem(key, value);\n}", "title": "" }, { "docid": "d66a933e9852ef45c6afdf02fbf30cac", "score": "0.48755047", "text": "function copyText(e) {\n\t\tvar o = document.createElement(\"textarea\");\n\t\to.value = e, document.body.appendChild(o), o.select(), document.execCommand(\"copy\"), document.body.removeChild(o)\n\t}", "title": "" }, { "docid": "a021aa51f62f55260f092e411dba7e1c", "score": "0.48582956", "text": "function logick_button_change_text()\n{\n\tcomplex_transaktion = new logick_transaktion(evoker,evoking_aktion,this.parentElement.parent,\"changtext\");\n\tthis.parentElement.hide();\n\tGLOBAL_OVERRIDE = logick_button_get_data_for_add_list;\n\tnotifikationbar.show(\"Choose text source for selected element\");\n}", "title": "" }, { "docid": "d1bf078acc4e0c457eb8e0a4f7c81224", "score": "0.48572698", "text": "function ListControl_set(newItemStr, optionalIndex) \n{\n var retVal = false;\n \n with (this) \n {\n index = object.selectedIndex;\n \n if (optionalIndex == null)\n {\n optionalIndex = index; // if not passed in, use selection\n }\n \n if (optionalIndex >= 0 && optionalIndex < list.length) // if selection in range\n {\n if (list[optionalIndex] != newItemStr) // if text has been changed\n {\n list[optionalIndex] = newItemStr; // replace text\n object.options[optionalIndex].text = newItemStr;\n //wmc - just selecting is not enough for an editable, need to set the text region.\n if ((object.editable) && (object.editable == \"true\"))\n {\n object.editText = newItemStr;\n }\n }\n retVal = true;\n }\n else //must handle setting editable text\n {\n if ((optionalIndex == -1) && //wmc - just selecting is not enough for an editable, need to set the text region.\n (object.editable) && (object.editable == \"true\"))\n {\n object.selectedIndex = -1;\n index = -1;\n object.editText = newItemStr;\n }\n }\n }\n\n return retVal;\n}", "title": "" }, { "docid": "5cd1a19bf218bc7090704df40d733851", "score": "0.48489037", "text": "saveValueForControl(controlName, currentValue) {\n if (controlName) this.set(controlName, currentValue);\n }", "title": "" }, { "docid": "68911cdceb84598fac4f2bbe696972a7", "score": "0.48430395", "text": "function editarLista(element) {\n var h2 = $(element).parents('h2');\n var texto = h2.text();\n $(h2).removeData(\"texto\");\n $(h2).attr(\"data-texto\", texto);\n $(h2).html('<textarea id=\"texareaGuardar\" rows=\"3\" class=\"form-control square\">' + texto + '</textarea><i onClick=\"cancelarEdicionLista(this)\" class=\"icon-close\"></i><i onClick=\"guardarEdicionLista(this)\" class=\"icon-checkmark\">');\n}", "title": "" }, { "docid": "31842a4fd6ea1c71a53d1c472dfa94e1", "score": "0.48365468", "text": "function toPastebin(e)\r\n{\r\n\tvar txt = null;\r\n\tvar nohtml = getSelText();\r\nvar html = getSelText();\r\n\r\n\t\r\n\tif(textAreaSelection)\r\n\t\ttxt = textAreaSelection;\r\n\telse if( html == nohtml )\r\n\t\ttxt = html;\r\n\t\t\r\n\t}", "title": "" }, { "docid": "bdb349a284c0bb179d34a0d4e91aaf15", "score": "0.48336402", "text": "function storyTextFieldArea2()\n{\n var v=document.getElementById(\"mobileScreenTextArea\").value;\n console.log(v);\n document.getElementById(\"storyPrintSectionArea\").innerHTML=v;\n txt=v;\n}", "title": "" }, { "docid": "68cbf70b4af60b0e60cbfee2e375767c", "score": "0.4823157", "text": "function copyToClipboard(text) {\n var dummy = document.createElement(\"input\");\n document.body.appendChild(dummy);\n dummy.setAttribute('value', text);\n dummy.select();\n document.execCommand('copy');\n document.body.removeChild(dummy);\n}", "title": "" }, { "docid": "1ea460dbe32d7f246ed60941a0395fee", "score": "0.48078582", "text": "function logick_button_add_list_element()\n{\n\tcomplex_transaktion = new logick_transaktion(evoker,evoking_aktion,this.parentElement.parent,\"addtolist\");\n\tthis.parentElement.hide();\n\tGLOBAL_OVERRIDE = logick_button_get_data_for_add_list;\n\tnotifikationbar.show(\"Choose text source for List element\");\n}", "title": "" }, { "docid": "55335f8a5d93f7a6ff393ea73e73f369", "score": "0.48016864", "text": "function CallSuccess(res, destCtrl) {\n var dest = document.getElementById(destCtrl);\n dest.value = res;\n}", "title": "" }, { "docid": "e9e0abe9e77ba98efabe6061a249d9e6", "score": "0.47949794", "text": "function copy(){\n var textForCopy = document.getElementById(\"mainDisplay\")\n textForCopy.select()\n document.execCommand(\"copy\") \n}", "title": "" }, { "docid": "7cb7c42a73e513496ea06c6a3fded3f8", "score": "0.4793356", "text": "function addSavedItem(evt, text) {\n\t\t\t// Replicate this item\n\t\t\t// <li class=\"my-2 input-group\">\n\t\t\t// \t<input type=\"text\" class=\"col-6\">\n\t\t\t// \t<div class=\"input-group-append\">\n\t\t\t// \t\t<div class=\"input-group-text\"><i class=\"material-icons\">save</i></div>\n\t\t\t// \t</div>\n\t\t\t// </li>\n\t\t\tvar saveIcon = Util.create(\"i\", {\n\t\t\t\tclass: \"material-icons\",\n\t\t\t});\n\t\t\tsaveIcon.innerText = \"star\";\n\n\t\t\tvar div1 = Util.create(\"div\", {\n\t\t\t\tclass: \"input-group-text\",\n\t\t\t});\n\t\t\tdiv1.appendChild(saveIcon);\n\t\t\tvar div2 = Util.create(\"div\", {\n\t\t\t\tclass: \"input-group-append\",\n\t\t\t});\n\t\t\tdiv2.appendChild(div1);\n\t\t\tvar liItem = Util.create(\"li\", {\n\t\t\t\tclass: \"my-2 input-group\",\n\t\t\t});\n\t\t\tvar inputCell = Util.create(\"input\", {\n\t\t\t\ttype: \"text\",\n\t\t\t\tclass: \"col-10 item-input form-control\",\n\t\t\t});\n if ($('#item-input').find('#'+text.toLowerCase().replace(/ |\\.|-/g, '_')).length) {\n return\n }\n inputCell.value = text;\n inputCell.id = text.toLowerCase().replace(/ |\\.|-/g, '_');\n\t\t\tinputCell.value = text;\n\t\t\tliItem.appendChild(inputCell);\n\t\t\tliItem.appendChild(div2);\n\t\t\tUtil.events(div2, {\n\t\t\t\t\"mousedown\": (evt) => {\n\t\t\t\t\tsaveButton(evt, div2);\n\t\t\t\t},\n\t\t\t})\n\t\t\tvar item_input = Util.one(\"#item-input\");\n\t\t\tvar allNodes = [];\n\t\t\tvar flag = false;\n\t\t\tvar addFlag = false;\n\t\t\tArray.from(Util.one(\"#item-input\").childNodes).forEach(function (node) {\n\t\t\t\tif(node.nodeName === \"li\" || node.nodeName === \"LI\") {\n\t\t\t\t\tif(node.childNodes[1].value !== \"\") {\n\t\t\t\t\t\tallNodes.push(node);\n\t\t\t\t\t} else {\n\t\t\t\t\t\taddFlag = true;\n\t\t\t\t\t\tif((flag === false) && (text !== \"\")) {\n\t\t\t\t\t\t\tflag = true;\n\t\t\t\t\t\t\tallNodes.push(liItem);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tallNodes.push(node);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tif((text === \"\") && (addFlag === false)) {\n\t\t\t\tallNodes.push(liItem);\n\t\t\t}\n\t\t\twhile(item_input.childNodes.length > 0)\n\t\t\t\titem_input.removeChild(item_input.childNodes[0]);\n\t\t\tfor(x in allNodes) {\n\t\t\t\titem_input.appendChild(allNodes[x]);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "627a694f02872f04fee48346f0a92469", "score": "0.47912198", "text": "function SetSaveButton()\n{\n var savebutton = parent.GetObject(self, 'savebutton');\n var text = 'Save';\n if(editinfo.isnew) {\n if(editinfo.ismodified)\n text += ' (new, modified)';\n else\n text += ' (new)';\n }\n else if(editinfo.ismodified)\n text += ' (modified)';\n if(editinfo.ischanged)\n text += ' *';\n savebutton.value = text;\n\n /* Show the cancel button if modified */\n if(editinfo.ismodified) {\n var cancelbutton = parent.GetObject(self, 'cancelbutton');\n cancelbutton.style.visibility = 'visible';\n }\n}", "title": "" }, { "docid": "1be9cf3317fcdf7020daf18e32a8ff68", "score": "0.47906384", "text": "addTx_list(e){\n e.preventDefault();\n //make new list and make it draggable also add usertext in the list\n let new_li = document.createElement('li');\n let usertext = e.target.parentElement.nextElementSibling;\n new_li.draggable = true;\n new_li.classList.add('li')\n new_li.setAttribute('ondragstart','drag_start(event)');\n new_li.setAttribute('ondragend','drag_end(event)');\n new_li.innerHTML = usertext.value;\n //make textarea empty for next text\n usertext.value = '';\n //add, made up list to the ul(list holder)\n e.target.parentElement.parentElement.previousElementSibling.appendChild(new_li);\n //make ready the shape of the form for new add(so that user can add again)\n text.text_area_off(); \n }", "title": "" }, { "docid": "a7b6b14d13bdaa53bdf63ae1a6cb71ba", "score": "0.47738817", "text": "function _saveToStorage(id, value) {\n //save textarea data in localStorage\n localStorage.setItem(id, value);\n }", "title": "" }, { "docid": "c241523463e172437ffd383df8947296", "score": "0.4766671", "text": "function copyText() {\n var copyText = document.getElementById(\"exampleFormControlTextarea1\");\n copyText.select();\n copyText.setSelectionRange(0, 99999)\n document.execCommand(\"copy\");\n alert(\"Copied the text: \" + copyText.value);\n}", "title": "" }, { "docid": "5149563b7558324a6e785133a84d52ce", "score": "0.47630832", "text": "function ControlUtilities() {\n\n this.BuildStyleProperty = function (styleArray) {\n if (styleArray.length > 0) {\n return ' style=\"' + styleArray.join(' ') + '\"';\n } else {\n return '';\n }\n };\n // Used to parse the XML for ListItems and return an array of ListItem objects.\n this.ParseListItems = function (node) {\n var li = null;\n var arrItems = new Array;\n node.find(\"ListItem\").each(function () {\n $li = jQuery(this);\n li = new ListItem($li.text(), $li.attr(\"Value\"));\n arrItems.push(li);\n });\n return arrItems;\n };\n // parses a control's XML for Validate tags. Returns an array of ctlValidate objects\n // or null if none found.\n this.ParseValidateTags = function (node) {\n var $node = jQuery(node);\n if ($node.find(\"Validate\")) {\n var valItems = new Array;\n $node.find(\"Validate\").each(function () {\n valItems.push(new ctlValidate(jQuery(this)));\n });\n return valItems;\n }\n return null;\n };\n // this is designed to load the validation designer with an array of ctlValidate objects\n // it sets up the designer to handle multiple validate tags.\n this.LoadValidationDesigner = function (designer, validateTags) {\n designer.find(\".val-dataentry\").hide();\n var sHtml = '';\n var $lst = designer.find(\".val-validatorlist\");\n $lst.html('');\n if (validateTags) {\n var valType, valTypeCaption;\n for (var i = 0; i < validateTags.length; i++) {\n valType = validateTags[i].Type;\n valTypeCaption = valType // set default;\n switch (valType) {\n case 'regex': valTypeCaption = \"Regular Expression\"; break;\n case 'required': valTypeCaption = \"Required\"; break;\n case 'range': valTypeCaption = \"Range\"; break;\n case 'compare': valTypeCaption = \"Compare\"; break;\n case 'email': valTypeCaption = \"Email\"; break;\n case 'checkbox': valTypeCaption = \"Checkbox\"; break;\n case 'checkboxlist': valTypeCaption = \"CheckboxList\"; break;\n case 'xml': valTypeCaption = \"XML\"; break;\n }\n sHtml += '<option value=\"' + valType + '\">' + valTypeCaption + '</option>';\n }\n }\n $lst.append(sHtml);\n $lst.data(keyValidateTags, validateTags); // so the tags can be referenced later.\n $lst.change(function () {\n // load validate tag\n var idx = this.selectedIndex;\n var curTag = jQuery(this).data(keyValidateTags)[idx];\n var designer = jQuery(this).parent();\n curTag.LoadDesigner(designer);\n designer.find(\".val-dataentry\").show();\n });\n if (!bValidateDesignerInit) {\n // assign events, etc. so the designer works correctly.\n designer.find('ul li span.ui-icon-plus').click(function () {\n // prep form for adding new validator\n var des = jQuery(this).parent().parent().parent();\n var tag = new ctlValidate();\n tag.LoadDesigner(des, tag);\n des.find('.val-dataentry').show();\n des.find('.val-all').show();\n des.find('select.validation-type-selector').val('').change();\n des.find('.val-validatorlist').val('');\n });\n // delete selected validator\n designer.find('ul li span.ui-icon-close').click(function () {\n var des = jQuery(this).parent().parent().parent();\n var $lst = des.find(\".val-validatorlist\");\n var idx = $lst.get(0).selectedIndex;\n $lst.data(keyValidateTags).splice(idx, 1);\n $lst.find('option:eq(' + idx + ')').remove();\n // clean up data entry area\n var tag = new ctlValidate();\n tag.LoadDesigner(des, tag);\n des.find('.val-dataentry').hide();\n });\n // update or add new validator tag\n designer.find('input[value=\"Save\"]').click(function () {\n var des = jQuery(this).parent().parent();\n var $lst = des.find('.val-validatorlist');\n var idx = $lst.get(0).selectedIndex;\n // this is needed so we can display the user-friendly validator type name \n // in the list of validators.\n var $lstType = des.find('select.validation-type-selector');\n var idxType = $lstType.get(0).selectedIndex;\n var FriendlyTypeName = $lstType.find('option:eq(' + idxType + ')').text();\n\n if (idx >= 0) {\n var tag = $lst.data(keyValidateTags)[idx];\n // read data into the tag from the form\n tag.LoadFromDesigner(des);\n // update the list box of validators to match updated validator\n $lst.find('option:eq(' + idx + ')').text(FriendlyTypeName);\n } else {\n // new tag. add it to the list and data object\n var tag = new ctlValidate();\n tag.LoadFromDesigner(des);\n if (!$lst.data(keyValidateTags)) {\n $lst.data(keyValidateTags, new Array);\n }\n $lst.data(keyValidateTags).push(tag);\n $lst.append('<option value=\"' + tag.Type + '\">' + FriendlyTypeName + '</option>');\n }\n // clean up data entry area.\n var tag = new ctlValidate();\n tag.LoadDesigner(des, tag);\n des.find('.val-dataentry').hide();\n });\n // cancel action, clean up data entry area\n designer.find('input[value=\"Cancel\"]').click(function () {\n var des = jQuery(this).parent().parent();\n des.find('.val-validatorlist').val('');\n var tag = new ctlValidate();\n tag.LoadDesigner(des, tag);\n des.find('.val-dataentry').hide();\n });\n bValidateDesignerInit = true;\n }\n };\n // returns an array of ctlValidate objects from the designer\n this.LoadFromValidationDesigner = function (designer) {\n // access the list of validators and retrieve the array\n var $lst = designer.siblings('#designer-validate').find(\".val-validatorlist\");\n return $lst.data(keyValidateTags);\n };\n\n this.BuildListOptions = function (ListItemsArray) {\n var out = '';\n if (ListItemsArray) {\n for (var i = 0; i < ListItemsArray.length; i++) {\n out += '<option value=\"' + ListItemsArray[i].Value + '\">' + ListItemsArray[i].Text + '</option>';\n }\n }\n return out;\n };\n // returns XML from an array of any \"ctl\" object\n this.GetListItemsXml = function (ListItemsArray, indent) {\n var out = '';\n if (!indent) { indent = ' '; }\n for (var i = 0; i < ListItemsArray.length; i++) {\n out += ' ' + indent + ListItemsArray[i].GetXml() + '\\n';\n }\n return out;\n };\n\n this.BuildSqlSelect = function (table, arrFields, sortField, sortOrder) {\n var out = 'SELECT ';\n for (var i = 0; i < arrFields.length; i++) {\n if (i > 0) { out += ', ' };\n out += arrFields[i];\n }\n out += ' FROM ' + table;\n if (sortField) {\n out += ' ORDER BY ' + sortField\n if (sortOrder) {\n out += ' ' + sortOrder.toUpperCase();\n }\n }\n return out;\n }\n \n this.BuildSqlInsert = function (table, arrFields) {\n var out = 'INSERT INTO ' + table + ' (';\n var params = '';\n for (var i = 0; i < arrFields.length; i++) {\n if (i > 0) { \n out += ', ';\n params += ', ';\n };\n out += arrFields[i];\n params += '@' + arrFields[i];\n }\n out += ') VALUES (' + params + ')';\n\n return out;\n } \n\n this.BuildSqlUpdate = function (table, arrFields, arrKeyFields) {\n var out = 'UPDATE ' + table + ' SET ';\n var params = '';\n for (var i = 0; i < arrFields.length; i++) {\n if (i > 0) { \n out += ', ';\n };\n out += arrFields[i] + ' = @' + arrFields[i];\n }\n out += ' WHERE '; \n for (var j = 0; j < arrKeyFields.length; j++) {\n if (j > 0) {\n out += ' AND ';\n }\n out += arrKeyFields[j] + ' = @' + arrKeyFields[j];\n }\n\n return out;\n } \n this.ParseXmlProperties = function (ctl, $node, defDataType) {\n ctl.ID = $node.attr(\"Id\");\n ctl.Label = new ctlLabel($node.find(\"Label\"), ctl.ID);\n ctl.Height = ($node.attr(\"Height\")) ? $node.attr(\"Height\") : null;\n ctl.Width = ($node.attr(\"Width\")) ? $node.attr(\"Width\") : null;\n ctl.Nullable = ($node.attr(\"Nullable\")) ? $node.attr(\"Nullable\") : null;\n ctl.DataField = ($node.attr(\"DataField\")) ? $node.attr(\"DataField\") : null;\n if (defDataType) { ctl.DataType = ($node.attr(\"DataType\")) ? $node.attr(\"DataType\") : defDataType; }\n\n }\n\n // helper function for creating Property Sheet for controls' tag editing dialog\n this.CreateTextInput = function (label, className, value) {\n var sValue = (value) ? ' value=\"' + value + '\"' : '';\n return '<div class=\"xmp-designer-row\">\\n' +\n '<label>' + label + '</label>\\n' +\n '<input type=\"text\"' + sValue + ' class=\"' + className + '\" />\\n</div>';\n }\n this.CreateTextArea = function (label, className) {\n return '<div class=\"xmp-designer-row\">\\n' +\n '<label style=\"display:block;\">' + label + '</label>\\n' +\n '<textarea style=\"width:98%;height:130px;\" class=\"' + className + '\"></textarea>\\n</div>';\n }\n this.CreateDropdown = function (label, className, arrItemsText, arrItemsValue) {\n return this.CreateListBox(label, className, 1, arrItemsText, arrItemsValue);\n }\n this.CreateDataTypeDropdown = function (label, className) {\n return this.CreateListBox(label, className, 1,\n [\"\", \"Boolean\", \"Byte\", \"Date\", \"DateTime\", \"Decimal\", \"Double\",\n \"Int16\", \"Int32\", \"Int64\", \"Single\", \"String\"]);\n }\n this.CreateListBox = function (label, className, rows, arrItemsText, arrItemsValue) {\n var sItems = '';\n if (arrItemsText) {\n for (var i = 0; i < arrItemsText.length; i++) {\n var sText = arrItemsText[i];\n var sVal = sText;\n if (arrItemsValue) sVal = arrItemsValue[i];\n sItems += '<option value=\"' + sVal + '\">' + sText + '</option>\\n'\n }\n }\n var sOut = '<div class=\"xmp-designer-row\">\\n' +\n '<label>' + label + '</label>\\n' +\n '<select size=\"' + rows + '\" class=\"' + className + '\"';\n if (sItems) {\n sOut += '>\\n' + sItems + '</select>\\n</div>';\n } else {\n sOut += ' />\\n</div>';\n }\n return sOut;\n }\n this.CreateCheckbox = function (label, className) {\n return '<div class=\"xmp-designer-row\">\\n' +\n '<label>' + label + '</label>\\n' +\n '<input type=\"checkbox\" class=\"' + className + '\" />\\n</div>';\n }\n this.CreateFieldEditor = function (label, className) {\n return '<div class=\"xmp-designer-row\">\\n' +\n '<label>' + label + '</label>\\n' +\n '<div class=\"' + className + '\"></div>';\n }\n this.CreateDataChooser = function () {\n return '<div class=\"xmp-designer-row\">\\n' +\n '<div class=\"designer-datachooser\"></div>\\n' +\n '</div>'\n }\n\n}", "title": "" }, { "docid": "823904a6f3be758e5793c2984162c9f9", "score": "0.47597206", "text": "function saveHtml() {\n for (var i = 0; i < textAreas.length; i++) {\n $(textAreas[i]).text($(textAreas[i]).val());\n localStorage.setItem(`${i}`, $(textAreas[i]).text());\n }\n }", "title": "" }, { "docid": "0dcf0b673d81dc886018a79a9ed4544f", "score": "0.47575304", "text": "setText(_id,txt) {\n this.listElement.setText(_id,txt);\n }", "title": "" }, { "docid": "232688344553fb4660a67cf83a56621e", "score": "0.474258", "text": "function SetArtCostTxtBoxList(sRetailPriceInclExclVatFormattedSel, sOriginalRetailPriceInclExclVatFormattedSel)\n{\n if (bIsViewCost == true)\n {\n var priceField = $('.cssArtItemCostExclVatNr');\n if (priceField.length)\n { priceField.text(sRetailPriceInclExclVatFormattedSel); }\n\n var originalPriceField = $('.cssArtItemCost .cssArtCostDiscountExclVatNr');\n if (originalPriceField.length)\n {\n sOriginalPriceText = (sRetailPriceInclExclVatFormattedSel != sOriginalRetailPriceInclExclVatFormattedSel) ? sOriginalRetailPriceInclExclVatFormattedSel : '';\n originalPriceField.text(sOriginalPriceText);\n }\n }\n}", "title": "" }, { "docid": "23c6481162392648c1eafbc59878471f", "score": "0.47366652", "text": "function saveText(event) {\n let target = event.target;\n let keyName;\n let textareaValue;\n let rowElement;\n\n if (target.tagName == \"DIV\") {\n textareaValue = target.previousElementSibling.children[0].value;\n rowElement = target.parentElement.getAttribute(\"data-index\");\n keyName = \"hour-\" + rowElement;\n } else {\n textareaValue =\n target.parentElement.previousElementSibling.children[0].value;\n rowElement = target.parentElement.parentElement.getAttribute(\n \"data-index\"\n );\n keyName = \"hour-\" + rowElement;\n }\n\n if (textareaValue !== \"\") {\n localStorage.setItem(keyName, textareaValue);\n } else {\n localStorage.removeItem(keyName);\n }\n }", "title": "" }, { "docid": "906e5dfb4b60261fd8ef16b00a7a7cc4", "score": "0.47278193", "text": "function copyForm(selector) {\r\n\r\n /* Get the text field */\r\n var copyText = document.getElementById(selector);\r\nconsole.log(selector);\r\n /* Select the text field */\r\n copyText.select();\r\n copyText.setSelectionRange(0, 99999); /*For mobile devices*/\r\n\r\n /* Copy the text inside the text field */\r\n document.execCommand(\"copy\");\r\n\r\n /* Alert the copied text */\r\n alert(\"Conteúdo copiado para a área de transferência.\");\r\n\r\n\r\n}", "title": "" }, { "docid": "dc554d09ce9f1a9328546f0a505eb578", "score": "0.4721606", "text": "function save_list_item(listID, dataID, item, desc){\n\n\t\tshow_save('Saved.');\n\t\t\n\t\t$.ajax({\n\t\t type: \"POST\",\n\t\t url: 'save_item/'+listID,\n\t\t data: {\n\t\t \t'id': dataID,\n\t\t \t'title' : item,\n\t\t \t'description' : desc\n\t\t },\n\t\t success: function(){\n\t\t }\n\t\t});\t\n\t\t\n\t\thide_save();\t\n\t}", "title": "" }, { "docid": "6a42891386fafaf91741758bd369075b", "score": "0.4720187", "text": "function task_details_edit(list, task, description, date)\r\n{\r\n\t// update the task details div area.\r\n\tdocument.getElementById(task+\"details\").innerHTML = \"<strong>Description:</strong> <textarea style=\\\"opacity: 1;\\\" id=\\\"\"+task+\"textarea\\\" >\"+description+\"</textarea><br /><br /><strong>Due Date: </strong> <input type=\\\"date\\\" id=\\\"\"+task+\"date\\\" value=\\\"\"+date+\"\\\"/><a class=\\\"icon\\\" style=\\\"text-align: right; display: block;\\\" href=\\\"javascript:task_details_edit_done(\\'\"+list+\"\\', document.getElementById(\\'\"+task+\"textarea\\').value, document.getElementById(\\'\"+task+\"date\\').value, '\"+task+\"');\\\" style=\\\"vertical-align: top;\\\"><img title=\\\"done\\\" onmousedown=\\\"this.ondragstart = function() { return false; }\\\" src=\\\"/assets/images/pencil-done.png\\\" /></a>\";\r\n}", "title": "" }, { "docid": "ff6e8b09993cc813eea1e105a4db73b8", "score": "0.4704303", "text": "function exportList() {\n var filename = \"todo.txt\";\n dataIO = saveData();\n\n var textToSaveAsBlob = new Blob([dataIO], {type:\"text/plain\"});\n var textToSaveAsURL = window.URL.createObjectURL(textToSaveAsBlob);\n\n var downloadLink = document.createElement(\"a\");\n downloadLink.download = filename;\n downloadLink.innerHTML = \"Download File\";\n downloadLink.href = textToSaveAsURL;\n downloadLink.onclick = destroyClickedElement;\n downloadLink.style.display = \"none\";\n document.body.appendChild(downloadLink);\n\n downloadLink.click();\n $('#showChartsSelector').show();\n}", "title": "" }, { "docid": "5c46359aa446c6863b5d5bc6c3a54c20", "score": "0.47038046", "text": "function save() {\n var text = document.getElementById('tosave').value;\n var data = new Blob([text], { type: 'text/plain' });\n var url = window.URL.createObjectURL(data);\n document.getElementById('download_link').style.visibility = 'visible';\n document.getElementById('download_link').href = url;\n document.getElementById('download_link').click();\n document.getElementById('download_link').style.visibility = 'collapse';\n\n}", "title": "" }, { "docid": "5c46359aa446c6863b5d5bc6c3a54c20", "score": "0.47038046", "text": "function save() {\n var text = document.getElementById('tosave').value;\n var data = new Blob([text], { type: 'text/plain' });\n var url = window.URL.createObjectURL(data);\n document.getElementById('download_link').style.visibility = 'visible';\n document.getElementById('download_link').href = url;\n document.getElementById('download_link').click();\n document.getElementById('download_link').style.visibility = 'collapse';\n\n}", "title": "" }, { "docid": "c0b2a5fefb0d591fbb16e67e72ffca19", "score": "0.46936047", "text": "function SaveData () {\r\n\t// Convinience\r\n\tvar toSavedData = [\"0.04\",time,money,food,pop,territory,militiamen,swordmen,archers,barrack,farms,well,house,barn,outpost];\r\n\t\r\n\tset_cookie(\"save\",toSavedData);\r\n\tTextboxSave(\"ftpTextbox\",toSavedData);\r\n\t\r\n\tpushMessage(\"Saved!\");\r\n\t\r\n}", "title": "" }, { "docid": "b1b791e8511e75a3a39213489325833a", "score": "0.4688569", "text": "function saveList() {\n\tif (inputArea.value === \"\") {\n\t\talert(\"Can not add an empty list.\");\n\t} else {\n\t\tif (document.getElementById(\"ulElement\") === null) {\n\t\t\tlet newUL = document.createElement(\"ul\");\n\t\t\tnewUL.setAttribute(\"id\", \"ulElement\");\n\t\t\tmain.appendChild(newUL);\n\t\t}\n\n\t\tlet userText = inputArea.value.split(\"\\n\");\n\n\t\tfor (let i = 0; i < userText.length; i++) {\n\t\t\tif (userText[i] !== \"\") {\n\t\t\t\tlet listItem = document.createElement(\"li\");\n\t\t\t\tlet textNode = document.createTextNode(userText[i]);\n\t\t\t\tlistItem.appendChild(textNode);\n\t\t\t\tdocument.getElementById(\"ulElement\").appendChild(listItem);\n\t\t\t}\n\t\t}\n\n\t\tstoreListInMain();\n\t}\n\n\tinputArea.value = \"\";\n}", "title": "" }, { "docid": "2c54ce2cc3e07f9c34866635e1faa6fc", "score": "0.46844363", "text": "function upFromDestList() {\n\tvar destList = window.document.forms[0].destList;\n\tvar len = destList.options.length;\n\tfor(var i = 0; i <= (len-1); i++) {\n\t\tif ((destList.options[i] != null) && (destList.options[i].selected == true)) {\n\t\t\tif(i>0 && destList.options[i-1] != null){\n\t\t\t\tfromtext = destList.options[i-1].text;\n\t\t\t\tfromvalue = destList.options[i-1].value;\n\t\t\t\ttotext = destList.options[i].text;\n\t\t\t\ttovalue = destList.options[i].value;\n\t\t\t\tdestList.options[i-1] = new Option(totext,tovalue);\n\t\t\t\tdestList.options[i-1].selected = true;\n\t\t\t\tdestList.options[i] = new Option(fromtext,fromvalue);\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f37f4c03920e3ac055779a0695e2ce9e", "score": "0.4675372", "text": "function undo() {\n counter.decrement();\n document.getElementById(\"textarea\").value = historylist[counter.current];\n}", "title": "" }, { "docid": "3b701555b0f3e92dc428434a09ced5be", "score": "0.46633416", "text": "function __NC_displayFormEdit(){\r\n\tif (this.outputWindow.rows.length>0){\r\n\t\tthis.outputWindow.deleteRow(2);\r\n\t\tthis.outputWindow.deleteRow(1);\r\n\t\tthis.outputWindow.deleteRow(0);\r\n\t}\r\n\talink = document.getElementById(\"addLink\");\r\n\talink.style.display='none';\r\n\tvar r = this.outputWindow.insertRow(-1);\r\n\tvar c = r.insertCell(-1);\r\n\t\tc.innerHTML = \"Add sub folder to \";\r\n\tvar c = r.insertCell(-1);\r\n\t\tstr = \"<select id='categoryLocation' name='categoryLocation' style='width:300px'>\";\r\n\t\tstartCat = this.id;\r\n\t\tif (this.id==''){\r\n\t\t\tif (this.list.length>0){\r\n\t\t\t\tstartCat = this.list[0][0];\r\n\t\t\t}\r\n\t\t}\r\n\t\tstr += \"<option value='\"+startCat +\"'>new top level entry</option>\";\r\n\t\tstr += this.showCat(startCat,0);\r\n\t\tstr += \"</select>\";\r\n\t\tc.innerHTML = str;\r\n\tvar r = this.outputWindow.insertRow(-1);\r\n\tvar c = r.insertCell(-1);\r\n\t\tc.innerHTML = \"Label\";\r\n\tvar c = r.insertCell(-1);\r\n\t\tstr = \"<input name='categoryLabel' id='categoryLabel' type='text' value='' style='width:300'/>\";\r\n\t\tc.innerHTML = str;\r\n\tvar r = this.outputWindow.insertRow(-1);\r\n\tvar c = r.insertCell(-1);\r\n\t\tc.colspan=\"2\";\r\n\t\tc.innerHTML = \"<input type='button' onclick='newCategory.submitNewCat()' value='Add' class='bt'/> <input type='button' onclick='newCategory.submitCancelCat()' value='Cancel' class='bt'/>\";\r\n\tthis.outputWindow.style.display='';\r\n}", "title": "" }, { "docid": "7b641109d85917fb31ed475734f8b805", "score": "0.465689", "text": "function copySelectedHtmlText(){\n copyToClipboard(getSelectedObject().innerHTML);\n}", "title": "" }, { "docid": "a260fb9b2fc826426a8a2cbab8d3e1d4", "score": "0.46497476", "text": "function copyToClipboard(text) {\n var dummy = document.createElement(\"textarea\");\n document.body.appendChild(dummy);\n dummy.value = text;\n dummy.select();\n document.execCommand(\"copy\");\n document.body.removeChild(dummy);\n}", "title": "" }, { "docid": "f290c07fb650137ff6ce2c5d7d181528", "score": "0.46491325", "text": "function OnClickCountryList(window, control) {\n var cityDropBox = window.GetControl(kCityDropBox);\n cityDropBox.text = new Array();\n GetCityList(window, control.value);\n}", "title": "" }, { "docid": "f5ab75c7c3720b5ff4b50d3428271459", "score": "0.46424967", "text": "function save_hidden_input(f, p_save_hidden_input_obj) {\n var errors = \"\";\n var strReturn = \"\";\n var stt = 1;\n for (var i = 0; i < f.length; i++) {\n var e = f.elements[i];\n if (e.type == \"hidden\" && e.save == \"1\") {\n strReturn = strReturn + e.name + _SUB_LIST_DELIMITOR + e.value;\n strReturn = strReturn + _LIST_DELIMITOR;\n }\n }\n p_save_hidden_input_obj.value = strReturn;\n}", "title": "" }, { "docid": "5714959c2084e645be52ca96227aa1f8", "score": "0.4640498", "text": "function copyToClipboard()\r\n {\r\n $('#templateTextarea').select();\r\n }", "title": "" }, { "docid": "1e60408d25c3871d9e13c43cd77ef33a", "score": "0.46375093", "text": "function ListControl_updateContents()\n{\n var optionArr = new Array();\n var selIndex = this.object.selectedIndex; \n \n for (var i=0; i < this.list.length; i++) \n {\n var listVal = this.list[i];\n if (listVal != \"\")\n\t\tlistVal = dwscripts.entityNameEncode(listVal);\n\tvar selStr = \"\";\n\tif( selIndex == i )\n\t{\n\t\tif( document.getIsXHTMLDocument() )\n\t\t\tselStr = ' selected=\"selected\"';\n\t\telse\n\t\t\tselStr = \" selected\";\n\t}\n\t\t\n\tif (this.valueList.length > i)\n {\n var value = this.valueList[i];\n if (value != \"\")\n\t\tvalue = dwscripts.entityNameEncode(value);\n\t optionArr.push(\"<option\" + ' value=\"' + value + '\"' + selStr +\">\" + listVal + \"</option>\");\n }\n else\n {\n optionArr.push(\"<option\" + selStr + \">\" + listVal + \"</option>\");\n }\n }\n this.object.innerHTML = optionArr.join(\"\");\n}", "title": "" }, { "docid": "0eec8e294e402a302b04e4e18067e5ff", "score": "0.46279547", "text": "function setTextContent() {\n for (const [key, value] of Object.entries(savedTextAreaContent)) {\n $(\"#\" + key).val(value);\n }\n}", "title": "" }, { "docid": "9579d824684dca1050aa2bf400d3c77f", "score": "0.4626993", "text": "function storetext() {\n\n var enter = \"\";\n\n if (!(localStorage.getItem(\"streamers\") === null)) {\n jlist = localStorage.streamers;\n streamers = JSON.parse(jlist);\n }\n\n for (var i = 0; i < streamers.length; i++) {\n document.getElementById(\"streamlurk\").value += enter;\n document.getElementById(\"streamlurk\").value += streamers[i].toLowerCase();\n enter = '\\n';\n }\n }", "title": "" }, { "docid": "268fbc2325a1b967ce0e6e60c47ac783", "score": "0.46261188", "text": "function contentPersist(){\n $('textarea').each(function(){ \n var id = $(this).attr('id');\n var value = localStorage.getItem(id);\n\n $(this).val(value);\n\n }); \n\n\n\n\n\n}", "title": "" }, { "docid": "886c8469352971a141255e2b5f490fe4", "score": "0.46197683", "text": "function convertTextToHTML() {\n var template_writing_copy = template_writing;\n template_writing_copy[1] = document.getElementById(\"inputTitle\").value; //title\n var convertedTitle = document.getElementById(\"inputTitle\").value.toLowerCase();\n convertedTitle = convertedTitle.replace(/-/g, \"\").trimEnd().replace(/ /g, \"-\");\n if(convertedTitle.length > 50){\n convertedTitle = convertedTitle.substring(0, 50);\n }\n template_writing_copy[3] = document.getElementById(\"inputDate\").value; //date\n var convertedText = document.getElementById(\"inputTextarea\").value; //raw content\n //conversion logic\n convertedText = convertedText.replace(/(?:\\r\\n|\\r|\\n)/g, '<br /><br />');\n template_writing_copy[5] = convertedText; //converted content\n document.getElementById(\"inputTextarea\").value = template_writing_copy.join(\"\");\n document.getElementById(\"inputTextarea\").select();\n document.execCommand('copy');\n document.getElementById(\"successMsg\").innerHTML = \"&check; Successfully Generated Code To Download & Copied To Clipboard\";\n var element = document.createElement('a');\n element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(template_writing_copy.join(\"\")));\n element.setAttribute('download', convertedTitle+\".html\");\n element.style.display = 'none';\n document.body.appendChild(element);\n element.click();\n document.body.removeChild(element);\n}", "title": "" }, { "docid": "effd23eb0f055292d31734cd1f60523f", "score": "0.461848", "text": "function set_textbox(id, s)\n{\n document.getElementById(id).value = s;\n}", "title": "" }, { "docid": "d5f653febce2038460378d7fc5ef6e6d", "score": "0.4618314", "text": "function listSelectStep2(_ctr, _item, _separator)\r\n{\r\n\tvar objWindow;\r\n\tvar col;\r\n\t\r\n\tobjWindow = top.window.opener;\r\n\r\n\tif (_separator == undefined)\r\n\t{\r\n\t\t_separator = \", \";\r\n\t}\r\n\r\n\tcol = objWindow.document.all.tags(\"INPUT\");\r\n\tif (col != null) \r\n\t{\r\n\t for (i = 0; i < col.length; i++) \r\n\t\t{\r\n\t\t\tif(col[i].name == _ctr)\r\n\t\t\t{\r\n\t\t\t\tif ( col[i].value != '' )\r\n\t\t\t\t{\r\n\t\t\t\t\tcol[i].value = col[i].value + _separator + unescape(_item);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tcol[i].value = unescape(_item);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "019011fda6c1fee6c468d00f1c583279", "score": "0.46116704", "text": "function saveData()\n{ \n localStorage.setItem(storedDate,moment().format(\"DD/MM/YYYY\"));\n console.log(\"Iam inside data\");\n $correspondingTextArea = $($(this).parent().children()[1]);\n textContent = $correspondingTextArea.val();\n console.log(\"the text value here is \"+textContent);\n textId = $correspondingTextArea.attr(\"id\");\n console.log(\"value inside the text area is \"+textContent+ \"id value is \"+textId);\n addData(textContent,textId);\n}", "title": "" }, { "docid": "85bde53ca05936cbaa633d051ca3b8bf", "score": "0.46063903", "text": "setViewControls(list)\r\n {\r\n let appModel = this.model;\r\n for(let i = 0; i < list.items.length; i++)\r\n {\r\n if(list.items[i] != null)\r\n {\r\n let listItem = list.items[i];\r\n let currDesc = document.getElementById(\"desc-\" + list.id + \"-\" + listItem.id);\r\n currDesc.onchange = function () {\r\n //console.log(\"Save Desc!\");\r\n appModel.addNewTaskTransaction(i, currDesc.value, listItem.description);//passes new value\r\n }\r\n let currDue = document.getElementById(\"due-\"+list.id+\"-\"+listItem.id);\r\n currDue.onchange = function () {\r\n //console.log(\"Save Date!\");\r\n appModel.addNewDueTransaction(i, currDue.value, listItem.dueDate);\r\n }\r\n let currStat = document.getElementById(\"stat-\"+list.id+\"-\"+listItem.id);\r\n currStat.onchange = function () {\r\n //console.log(\"Save Task!\");\r\n appModel.addNewStatTransaction(i, currStat.value, listItem.status);\r\n }\r\n let upArrow = document.getElementById(\"up-\"+list.id+\"-\"+listItem.id);\r\n if(i == 0){upArrow.style.color = \"#000000\";}\r\n else\r\n {\r\n upArrow.style.color = \"#ffffff\";\r\n }\r\n upArrow.onmousedown = function () {\r\n //console.log(\"Go Up!\");\r\n if(i > 0)//cant go up after 1!\r\n {\r\n appModel.addNewUpTransaction(i);//current position!\r\n }\r\n }\r\n let downArrow = document.getElementById(\"down-\"+list.id+\"-\"+listItem.id);\r\n if(i == list.items.length-1){downArrow.style.color = \"#000000\";}\r\n else\r\n {\r\n downArrow.style.color = \"#ffffff\";\r\n }\r\n downArrow.onmousedown = function () {\r\n //console.log(\"Go Down!\")\r\n if(i < list.items.length - 1)\r\n {\r\n appModel.addNewDownTransaction(i);\r\n }\r\n }\r\n let closeBtn = document.getElementById(\"close-\"+list.id + \"-\"+listItem.id);\r\n {\r\n closeBtn.onmousedown = function () {\r\n //console.log(\"Close List!\");\r\n appModel.addNewCloseTransaction(list.items[i], i);\r\n }\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "347bd72a1b37ba1b78ab2d6345e4429f", "score": "0.46057165", "text": "function getTextPanelClone(objTile){\n\t\tvar objTextPanelClone = objTile.data(\"objTextPanelClone\");\n\t\t\n\t\treturn(objTextPanelClone);\n\t\t\n\t}", "title": "" }, { "docid": "f5e2d87cd969e855a19cc16702746843", "score": "0.4605488", "text": "function saveSelectObjectsAndMove(target, wnd)\n\t{\n\t\tvar count = getObjectCount(); \n\t\tfor (var i = 0; i < count; i++)\n\t\t{\n\t\t\tvar lCheckbox = wnd.document.getElementById(\"Obj\" + i);\n\t\t\tassert(lCheckbox != null);\n\t\t\t\n\t\t\tsetObjectSelected(i, lCheckbox.checked);\n\t\t}\n\t\t\n\t\twnd.location.replace(target);\n\t\t\n\t}", "title": "" }, { "docid": "bc02e83f8663788d54a317e1d3e18bf3", "score": "0.45971003", "text": "function setOutputFile(){\r outputFile = File.saveDialog(\"Choose an output file\");\r\r if(outputFile){\r UI[\"filePath\"].text = outputFile.absoluteURI;\r }\r}", "title": "" }, { "docid": "c0a228c5b16991e5c4fd904e6f79d57b", "score": "0.45923358", "text": "function writeControls(){\n\n document.writeln(\"<span style=\\\"position:relative; -moz-transform:scale(2.0);\\\">\\n\");\n document.writeln(\"<a href=\\\"javascript:arrangeObjects(allMASHObjects);\\\"><img id=\\\"\" + CTRL_REARRANGE_IMG_ID + \"\\\" src=\\\"\" + CTRL_REARRANGE_IMG_FILE + \"\\\" title=\\\"Re-arrange\\\" alt=\\\"re-arrange objects to their original state\\\" border=\\\"0\\\"></a>&nbsp;\");\n document.writeln(\"<a href=\\\"javascript:freezeAllObjects();\\\" ><img id=\\\"\" + CTRL_FREEZE_IMG_ID + \"\\\" src=\\\"\" + CTRL_UNFREEZE_IMG_FILE + \"\\\" title=\\\"Freeze Space\\\" alt=\\\"freezes the space. Objects cannot be moved\\\" border=\\\"0\\\"></a>&nbsp;||&nbsp;\");\n// document.writeln(\"<a href=\\\"javascript:saveAllObjects();\\\" ><img id=\\\"\" + CTRL_SAVE_IMG_ID + \"\\\" src=\\\"\" + CTRL_SAVE_IMG_FILE + \"\\\" title=\\\"Save Space\\\" alt=\\\"save the objects' current state\\\" border=\\\"0\\\"></a>&nbsp;\");\n// document.writeln(\"<a href=\\\"javascript:restoreAllObjects();\\\" ><img id=\\\"\" + CTRL_RESTORE_IMG_ID + \"\\\" src=\\\"\" + CTRL_RESTORE_IMG_FILE + \"\\\" title=\\\"Restore Space\\\" alt=\\\"restore the objects to the previously saved state\\\" border=\\\"0\\\"></a>&nbsp;||&nbsp;\");\n\n// if(MASH_FileManagerDefined) {\n// MASH_FileManager.writeControls();\n// }\n\n// document.writeln(\"<a href=\\\"javascript:zoom(2/1);\\\" ><img id=\\\"\" + CTRL_ZOOM_IN_PAGE_IMG_ID + \"\\\" src=\\\"\" + CTRL_ZOOM_IN_PAGE_IMG_FILE + \"\\\" title=\\\"Zoom In Space\\\" alt=\\\"zooms in the whole space\\\" border=\\\"0\\\"></a>&nbsp;\");\n// document.writeln(\"<a href=\\\"javascript:zoom(1/2);\\\" ><img id=\\\"\" + CTRL_ZOOM_OUT_PAGE_IMG_ID + \"\\\" src=\\\"\" + CTRL_ZOOM_OUT_PAGE_IMG_FILE + \"\\\" title=\\\"Zoom Out Space\\\" alt=\\\"zooms out the whole space\\\" border=\\\"0\\\"></a>&nbsp;||&nbsp;\");\n\n document.writeln(\"<span style=\\\"color:#000000; font-family:arial; font-size:8pt; font-weight:bold;\\\">Annotations:</span>\");\n// document.writeln(\"<a href=\\\"javascript:showAnnotations(MASH_UserAnnotation.ALL_ANNOTATIONS);\\\"><img id=\\\"\" + CTRL_ANNOTATE_SHOW_IMG_ID + \"\\\" src=\\\"\" + CTRL_ANNOTATE_SHOW_IMG_FILE + \"\\\" title=\\\"Show Annotation\\\" alt=\\\"Show Annotation\\\" border=\\\"0\\\"></a>\");\n// document.writeln(\"<a href=\\\"javascript:hideAnnotations(MASH_UserAnnotation.ALL_ANNOTATIONS);\\\"><img id=\\\"\" + CTRL_ANNOTATE_HIDE_IMG_ID + \"\\\" src=\\\"\" + CTRL_ANNOTATE_HIDE_IMG_FILE + \"\\\" title=\\\"Hide Annotation\\\" alt=\\\"Hide Annotation\\\" border=\\\"0\\\"></a>&nbsp;||&nbsp;\");\n document.writeln(\"<a href=\\\"javascript:toggleAnnotations(MASH_UserAnnotation.ALL_ANNOTATIONS);\\\"><img id=\\\"\" + CTRL_ANNOTATE_SHOW_IMG_ID + \"\\\" src=\\\"\" + CTRL_ANNOTATE_SHOW_IMG_FILE + \"\\\" title=\\\"Show/Hide Annotations\\\" alt=\\\"Show/Hide Annotations\\\" border=\\\"0\\\"></a>&nbsp;||&nbsp;\");\n\n\n document.writeln(\"<a href=\\\"javascript:createArchivalSubGroup();\\\" ><img id=\\\"\" + CTRL_ANNOTATE_COLLECTION_BLUE_IMG_ID + \"\\\" src=\\\"\" + CTRL_ANNOTATE_COLLECTION_BLUE_IMG_FILE + \"\\\" title=\\\"Create Sub-Group\\\" alt=\\\"Sub-Group\\\" border=\\\"0\\\"></a>\");\n document.writeln(\"<a href=\\\"javascript:createArchivalSeries();\\\" ><img id=\\\"\" + CTRL_ANNOTATE_COLLECTION_GREEN_IMG_ID + \"\\\" src=\\\"\" + CTRL_ANNOTATE_COLLECTION_GREEN_IMG_FILE + \"\\\" title=\\\"Create Series\\\" alt=\\\"Series\\\" border=\\\"0\\\"></a>\");\n document.writeln(\"<a href=\\\"javascript:createArchivalSubSeries();\\\" ><img id=\\\"\" + CTRL_ANNOTATE_COLLECTION_RED_IMG_ID + \"\\\" src=\\\"\" + CTRL_ANNOTATE_COLLECTION_RED_IMG_FILE + \"\\\" title=\\\"Create Sub-Series\\\" alt=\\\"Sub-Series\\\" border=\\\"0\\\"></a>\");\n document.writeln(\"<a href=\\\"javascript:createArchivalFile();\\\" ><img id=\\\"\" + CTRL_ANNOTATE_COLLECTION_YELLOW_IMG_ID + \"\\\" src=\\\"\" + CTRL_ANNOTATE_COLLECTION_YELLOW_IMG_FILE + \"\\\" title=\\\"Create File\\\" alt=\\\"File\\\" border=\\\"0\\\"></a>&nbsp;||&nbsp;\");\n// document.writeln(\"<a href=\\\"javascript:annotateCollection('#eef8ff', '#000088');\\\" ><img id=\\\"\" + CTRL_ANNOTATE_COLLECTION_BLUE_IMG_ID + \"\\\" src=\\\"\" + CTRL_ANNOTATE_COLLECTION_BLUE_IMG_FILE + \"\\\" title=\\\"Create Sub-Group\\\" alt=\\\"Sub-Group\\\" border=\\\"0\\\"></a>\");\n// document.writeln(\"<a href=\\\"javascript:annotateCollection('#eefff8', '#008800');\\\" ><img id=\\\"\" + CTRL_ANNOTATE_COLLECTION_GREEN_IMG_ID + \"\\\" src=\\\"\" + CTRL_ANNOTATE_COLLECTION_GREEN_IMG_FILE + \"\\\" title=\\\"Create Series\\\" alt=\\\"Series\\\" border=\\\"0\\\"></a>\");\n// document.writeln(\"<a href=\\\"javascript:annotateCollection('#fff8ee', '#880000');\\\" ><img id=\\\"\" + CTRL_ANNOTATE_COLLECTION_RED_IMG_ID + \"\\\" src=\\\"\" + CTRL_ANNOTATE_COLLECTION_RED_IMG_FILE + \"\\\" title=\\\"Create Sub-Series\\\" alt=\\\"Sub-Series\\\" border=\\\"0\\\"></a>\");\n// document.writeln(\"<a href=\\\"javascript:annotateCollection('#ffffee', '#aaaa00');\\\" ><img id=\\\"\" + CTRL_ANNOTATE_COLLECTION_YELLOW_IMG_ID + \"\\\" src=\\\"\" + CTRL_ANNOTATE_COLLECTION_YELLOW_IMG_FILE + \"\\\" title=\\\"Create File\\\" alt=\\\"File\\\" border=\\\"0\\\"></a>&nbsp;||&nbsp;\");\n\n// document.writeln(\"<a href=\\\"javascript:annotateBlueCircle();\\\" ><img id=\\\"\" + CTRL_ANNOTATE_CIRCLE_BLUE_IMG_ID + \"\\\" src=\\\"\" + CTRL_ANNOTATE_CIRCLE_BLUE_IMG_FILE + \"\\\" title=\\\"Make Blue Circle Annotation\\\" alt=\\\"Make Blue Circle Annotation\\\" border=\\\"0\\\"></a>\");\n// document.writeln(\"<a href=\\\"javascript:annotateGreenCircle();\\\" ><img id=\\\"\" + CTRL_ANNOTATE_CIRCLE_GREEN_IMG_ID + \"\\\" src=\\\"\" + CTRL_ANNOTATE_CIRCLE_GREEN_IMG_FILE + \"\\\" title=\\\"Make Green Circle Annotation\\\" alt=\\\"Make Green Circle Annotation\\\" border=\\\"0\\\"></a>\");\n// document.writeln(\"<a href=\\\"javascript:annotateRedCircle();\\\" ><img id=\\\"\" + CTRL_ANNOTATE_CIRCLE_RED_IMG_ID + \"\\\" src=\\\"\" + CTRL_ANNOTATE_CIRCLE_RED_IMG_FILE + \"\\\" title=\\\"Make Red Circle Annotation\\\" alt=\\\"Make Red Circle Annotation\\\" border=\\\"0\\\"></a>\");\n// document.writeln(\"<a href=\\\"javascript:annotateYellowCircle();\\\" ><img id=\\\"\" + CTRL_ANNOTATE_CIRCLE_YELLOW_IMG_ID + \"\\\" src=\\\"\" + CTRL_ANNOTATE_CIRCLE_YELLOW_IMG_FILE + \"\\\" title=\\\"Make Yellow Circle Annotation\\\" alt=\\\"Make Yellow Circle Annotation\\\" border=\\\"0\\\"></a>&nbsp;||&nbsp;\");\n\n document.writeln(\"<a href=\\\"javascript:annotateBlueText();\\\" ><img id=\\\"\" + CTRL_ANNOTATE_TEXT_BLUE_IMG_ID + \"\\\" src=\\\"\" + CTRL_ANNOTATE_TEXT_BLUE_IMG_FILE + \"\\\" title=\\\"Make Blue Text Annotation\\\" alt=\\\"Make Blue Text Annotation\\\" border=\\\"0\\\"></a>\");\n document.writeln(\"<a href=\\\"javascript:annotateGreenText();\\\" ><img id=\\\"\" + CTRL_ANNOTATE_TEXT_GREEN_IMG_ID + \"\\\" src=\\\"\" + CTRL_ANNOTATE_TEXT_GREEN_IMG_FILE + \"\\\" title=\\\"Make Green Text Annotation\\\" alt=\\\"Make Green Text Annotation\\\" border=\\\"0\\\"></a>\");\n document.writeln(\"<a href=\\\"javascript:annotateRedText();\\\" ><img id=\\\"\" + CTRL_ANNOTATE_TEXT_RED_IMG_ID + \"\\\" src=\\\"\" + CTRL_ANNOTATE_TEXT_RED_IMG_FILE + \"\\\" title=\\\"Make Red Text Annotation\\\" alt=\\\"Make Red Text Annotation\\\" border=\\\"0\\\"></a>\");\n document.writeln(\"<a href=\\\"javascript:annotateYellowText();\\\" ><img id=\\\"\" + CTRL_ANNOTATE_TEXT_YELLOW_IMG_ID + \"\\\" src=\\\"\" + CTRL_ANNOTATE_TEXT_YELLOW_IMG_FILE + \"\\\" title=\\\"Make Yellow Text Annotation\\\" alt=\\\"Make Yellow Text Annotation\\\" border=\\\"0\\\"></a>&nbsp;||&nbsp;\");\n document.writeln(\"</span>\");\n}//writeControls", "title": "" }, { "docid": "f8532b4b32f202bbfedffbc4f313d7fe", "score": "0.45906687", "text": "function inplace_textbox_write2read(div) { \n div_read = div + \"-r\";\n div_nodata = div + \"-n\";\n input = div + \"-i\";\n div_edit = div + \"-e\";\n\n $(\"#\" + div_edit).hide();\n \n value_input = $(\"#\" + input).attr('value');\n $(\"#\" + div_read + \" span:first\").html(value_input);\n if (jQuery.trim(value_input) == '') {\n $(\"#\" + div_nodata).show();\n } else {\n $(\"#\" + div_read).show();\n }\n}", "title": "" }, { "docid": "589d350d7c4ed3e5cf7ac0e410c29d61", "score": "0.45897505", "text": "function savedText1() {\n localStorage.setItem(\"data1\", textBtn1.value);\n}", "title": "" }, { "docid": "71e594791fb0d9f2466776914c1a0b41", "score": "0.45879233", "text": "function saveProfile() {\n txtProfileText = $(\"#txtProfile\").val();\n console.log(\"the current profile text is\" + txtProfileText);\n\n hoverProfileButtons = 2;\n hideProfileButtons();\n\n\n\n}", "title": "" }, { "docid": "218d09f649220eacf14e04220e2357d9", "score": "0.45864683", "text": "function copyToClipboard(text) {\n var tempInput = document.createElement(\"input\");\n tempInput.value = text;\n document.body.appendChild(tempInput);\n tempInput.select();\n document.execCommand(\"copy\");\n tempInput.remove();\n}", "title": "" }, { "docid": "33fdf3cd045d192abcd1964942714e97", "score": "0.45840403", "text": "function Fev_ReplaceLastListControlOption(objListElement, strValue, strText)\n{\n var strTagName = Fev_GetElementTagName(objListElement);\n if (strTagName != null) strTagName = strTagName.toLowerCase();\n switch (strTagName)\n {\n case \"select\":\n var objOption = objListElement.options[objListElement.options.length-1];\n objOption.value = strValue;\n objOption.text = strText;\n //objOption.innerText = strText;\n return true;\n break;\n default:\n break;\n }\n return false;\n}", "title": "" }, { "docid": "882a38ea49cdd804954df01453ba3c65", "score": "0.4583662", "text": "function whenClickTextBox(obj) {\n // console.log(\"con\");\n pickedTextBox = obj;\n changeDataForm(obj)\n obj.addClass = 'text-box-picked';\n console.log(obj);\n}", "title": "" }, { "docid": "3b4bd678e1b164f8ccbef5467180f1ed", "score": "0.457747", "text": "function storeStuff() {\n var text = $(this).parent(\"div\").parent(\"div\").find(\"textarea\").val().trim();\n var textId = $(this).parent(\"div\").parent(\"div\").find(\"textarea\").get(0).id;\n localStorage.setItem(textId, text);\n}", "title": "" }, { "docid": "c694393cfe56e19d552e86c73018a998", "score": "0.4572386", "text": "function showList(){\n txt.blur();\n txt.css('display', 'none');\n list.css('display', 'block');\n new_btn.text('New');\n}", "title": "" }, { "docid": "22061e8f0c2bc159a351778bbd2b1cb5", "score": "0.45697635", "text": "setClipboardText( obj = {} ) {\n\t\tthis._setlocalStorage( 'pavobuilder', JSON.stringify( obj ) );\n\t}", "title": "" } ]
f914622bda9770c70f5bfb25dd3bbc9c
esta funcion pide un numero
[ { "docid": "3264aa691b0b137bdcbf81907918e4eb", "score": "0.0", "text": "function proceso7(callback) {\n\tvar numero = parseInt(prompt(\"ingrese numero\"));\n\tcallback(numero);\n}", "title": "" } ]
[ { "docid": "645a4e503777f49b6eedf1539a6ff4d3", "score": "0.74339086", "text": "function retorno2(numero){\n\n\treturn numero;\n}", "title": "" }, { "docid": "2e2a872299acc176585bea3ad65f21e1", "score": "0.73377776", "text": "function retorno2(numero){\n return numero;\n}", "title": "" }, { "docid": "26f5512ccd9c1788bba7f4b9791bd748", "score": "0.71456254", "text": "function conosciNum(n) {\n\t// Controllo che sia un valore di tipo numerico\n\tif (typeof n == \"number\") {\n\t\t// controllo il modulo se il numero e' pari\n\t\tif (n % 2 == 0) {\n\t\t\talert(\"Il numero passato è pari.\");\n\t\t} else if (n % 2 != 0) {\n\t\t\t// In alternativa controllo se e' dispari\n\t\t\talert(\"Il numero passato è dispari.\");\n\t\t}\n\t} else {\n\t\t// Se il parametro passato non e' di valore numerico mostro un alert\n\t\talert(\"Non mi hai passato alcun numero.\");\n\t}\n}", "title": "" }, { "docid": "179bdca17ae6c6e4a66f01c69480bc6b", "score": "0.7058455", "text": "function esNumero(numero) {\n //console.log(\"Estoy en la funcion 'esNumero'\");\n return !isNaN(numero);\n}", "title": "" }, { "docid": "78884ab8f8eaf300f8359aac25c39b78", "score": "0.70494735", "text": "function getNum() {\n return 1;\n}", "title": "" }, { "docid": "3b9ef722f222426582213f4f45071469", "score": "0.70393974", "text": "function devuelveNumero(num) {\n return \"El numero es: \" + num;\n}", "title": "" }, { "docid": "0b213ef09be816a98ba0d40d2d8b8417", "score": "0.692316", "text": "function devuelveNumero(num) {\r\n return \"Número devuelto: \" + num;\r\n}", "title": "" }, { "docid": "8bdc8d6271d8132d6923437ce3da7df2", "score": "0.68943924", "text": "function numero(xx) { // funcion que recoge el numero pulsado en el argumento\n if (x == \"0\" || xi == 1) {\n pantalla.innerHTML = xx; // mostramos en pantalla dicho numero\n x = xx; // guardar el numero\n if (xx == \".\") { //si escribimos una coma al principio del numero\n pantalla.innerHTML = \"0.\";\n x = xx;\n coma = 1; //cambiamos el estado de la coma\n }\n } else { // continuar con el numero\n if (xx == \".\" && coma == 0) {\n pantalla.innerHTML += xx;\n x += xx;\n coma = 1;\n } else if (xx == \".\" && coma == 1) {\n // si intentamos escribir una segunda coma decimal\n // no realizamos ninguna accion\n\n } else {\n\n pantalla.innerHTML += xx; //anadir y mostrar en pantalla\n x += xx; // anadir y guardar\n }\n\n }\n xi = 0; // el numero estain iciado y podemos ampliarlo\n}", "title": "" }, { "docid": "58f9cbcdac9ccbb7a2a9dbd80f51006e", "score": "0.6814887", "text": "function verificaNumeroInteiro(campo){\r\n\t \tvar valorAuxiliar = \"\";\r\n\t\tdigitosValidos = \"0123456789\" ;\r\n\t\t\r\n\t\tvalor = campo.value;\r\n\t\t//retira digitos terao numericos\r\n \t\tfor (i=0;i<valor.length;i++){\r\n \t\t\tif(digitosValidos.indexOf(valor.charAt(i))>=0) {\r\n \t\t\t\tvalorAuxiliar += valor.charAt(i);\r\n \t\t\t}\r\n \t\t}\r\n\r\n\t\t\r\n\t\t//retira zeros desnecessarios ao inicio do numero\r\n\t\twhile (valorAuxiliar.length > 1 && valorAuxiliar.charAt(0) == \"0\")\r\n\t\t\tvalorAuxiliar = valorAuxiliar.substring(1);\r\n\r\n\t\tvalor = valorAuxiliar;\r\n\t\tcampo.value = valor;\r\n\r\n\t}", "title": "" }, { "docid": "c4faf43b4ce67be789daabc13e6b44b0", "score": "0.679486", "text": "function retornoParametros(numero) {\n return numero;\n\n}", "title": "" }, { "docid": "6f7cc8b2bae25464f30ed359cebf24d5", "score": "0.67358476", "text": "function textoOuNumero(retornaTexto){\n if(retornaTexto) {\n return \"Sou um texto!\";\n } \n return 123;\n }", "title": "" }, { "docid": "b214b79fd1a07b1c5457e046311926b7", "score": "0.6681953", "text": "function retorno() {\n let numero = 5;\n return numero;\n\n}", "title": "" }, { "docid": "98d4899ae73d84a5f8be900c3e9fa568", "score": "0.66612774", "text": "function numContent(num) {\n\n}", "title": "" }, { "docid": "dd7f00b242a8169885307726497b2c48", "score": "0.66336924", "text": "function descobrir(num){\n if(num < 0 ){\n return console.log(\"Numero negativo\")\n }else{\n return console.log(\"Numero positivo\")\n }\n}", "title": "" }, { "docid": "dfc76d6b614032ce2c0add17c2a659e5", "score": "0.65661013", "text": "function esnumero(campo) { return (!(isNaN(campo))); }", "title": "" }, { "docid": "75dab224f3d9aee6a57968797bf6ee66", "score": "0.65520334", "text": "function negativo(numero){\n if (numero===0){\n return 0;\n }\n return numero *-1;\n}", "title": "" }, { "docid": "d6cb867a22cba6951160294f47b096d9", "score": "0.6512563", "text": "function obtenerNumero(){\n \n function retornarNumero(){\n return 80;\n }\n return obtenerNumero();\n\n function retornarNumero(){\n return 50;\n }\n \n}", "title": "" }, { "docid": "9d8620e7f52465bef239b39bc31d09c1", "score": "0.6500487", "text": "function retornarMaior(numero){\n let numeroMaior = -99999\n for (let i =0 ; i < numero.length; i++){\n if(numero[i]> numeroMaior){\n numeroMaior = numero[i]\n }\n \n }\n return numeroMaior\n }", "title": "" }, { "docid": "0e111d6f2b4c2fb80131b5213ad359c3", "score": "0.6487024", "text": "function esNumero(campo){\n\tif (isNaN(campo.value)) {\n\t\talert('..:: Valor Digitado No Es Numerico ::..');\n\t\tcampo.value='';\n\t}\n}", "title": "" }, { "docid": "0a9e33e2f6a86bfc47b6f86998ca4ba7", "score": "0.64705026", "text": "function Solo_Numerico(variable){\n Numer=parseInt(variable);\n if (isNaN(Numer)){\n return \"\";\n \n }\n return Numer;\n}", "title": "" }, { "docid": "586a92cc77b1fa906f6e81275c35e2ff", "score": "0.6454083", "text": "function Validarnumero(txtobj){\r\nif (isNaN(txtobj.value))\r\n{\r\n\tVerMensaje('error',\"Debe cargar valores numericos\");\r\n\ttxtobj.value = 0;\r\n\ttxtobj.focus();\r\n\ttxtobj.select();\r\n return 0;\r\n}\r\nreturn 1;\r\n}", "title": "" }, { "docid": "18beddd5e2848a24a761d68aa29fdc66", "score": "0.6444084", "text": "function mostrar (n){\n console.log(`me han pasado ${n}`)\n}", "title": "" }, { "docid": "239c1ffcae85aeae2948f7b85c616d1c", "score": "0.64368206", "text": "function somente_numero(campo){\r\n \tvar digits=\"0123456789/\";\r\n \tvar campo_temp = null;\r\n\t for (var i=0;i<campo.value.length;i++){\r\n\t campo_temp=campo.value.substring(i,i+1) \r\n\t if (digits.indexOf(campo_temp)==-1){\r\n\t campo.value = campo.value.substring(0,i);\r\n\t break;\r\n\t }\r\n\t }\r\n\t}", "title": "" }, { "docid": "9a110ab987dbf62d281b64c26ea1282a", "score": "0.6435667", "text": "function setNumero(num_formateado) {\r\n\tvar num = num_formateado.toString();\r\n\tnum = num.replace(/[.]/gi, \"\");\r\n\tnum = num.replace(/[,]/gi, \".\");\r\n\t\r\n\tvar numero = new Number(num);\r\n\treturn numero;\r\n}", "title": "" }, { "docid": "9a110ab987dbf62d281b64c26ea1282a", "score": "0.6435667", "text": "function setNumero(num_formateado) {\r\n\tvar num = num_formateado.toString();\r\n\tnum = num.replace(/[.]/gi, \"\");\r\n\tnum = num.replace(/[,]/gi, \".\");\r\n\t\r\n\tvar numero = new Number(num);\r\n\treturn numero;\r\n}", "title": "" }, { "docid": "c02e8cc24e1760d63e7bd06627ac386b", "score": "0.6416412", "text": "function EsParONo (numero) {\n\t\n\treturn\n}", "title": "" }, { "docid": "f99572a2d1703c6fd6e68da5a433b4c9", "score": "0.64040214", "text": "function obtenerNumero(){\n function retornarNumero(){\n return 80;\n }\n\n function retornarNumero(){\n return 50;\n }\n\n return obtenerNumero();\n}", "title": "" }, { "docid": "61fa5aba1e37f1573c010f1ab7da217d", "score": "0.6389293", "text": "function proceso9(callback) {\n\tvar d = parseInt(prompt(\"ingrese numero\"));\n\tvar s = parseInt(prompt(\"ingrese otro numero\"));\n var resultado = s - d\n\tcallback(resultado);\n}", "title": "" }, { "docid": "1c83491d5fb692ba68843808b8d6eacf", "score": "0.6380254", "text": "function magicNumber(num) {\n\n}", "title": "" }, { "docid": "f4acade559c053ae39b73ebb4bbb20db", "score": "0.63795245", "text": "function getNumber() {\n return \"1234567890\"\n }", "title": "" }, { "docid": "97f4b421aaeb743915d158ab92967638", "score": "0.6368031", "text": "function verif_num(num) {\n if (isNumber(num) && num.length == 7) { //un nombre de 7 chiffre (verifications supplementaires sur la couche html)\n //!attention cette 2eme verification est importante car elle protege des champs vides (non filtres par le pattern html) \n printHTML(\"#con_error_num\", \"\"); //remise a blanc du precedent message d'erreur eventuel\n return true;\n }\n func_erreur_connexion(\"#con_error_num\", \"<font color = \\\"red\\\">Num&eacute;ro d'&eacute;tudiant invalide.</font>\");\n //alert(\"num rouge\");\n return false;\n}", "title": "" }, { "docid": "181d9589ef575d39e95a886683c2ad26", "score": "0.6356345", "text": "function retorno1(){\n\n\tvar numero = 5;\n\treturn numero;\n}", "title": "" }, { "docid": "bd0c36b1985335626c296c13288dfd12", "score": "0.63511926", "text": "function getNum(narr) {\r\n if (narr==\"Dioneo\")\r\n return 0;\r\n else if (narr==\"Elissa\")\r\n return 1;\r\n else if (narr==\"Emilia\")\r\n return 2;\r\n else if (narr==\"Fiammetta\")\r\n return 3;\r\n else if (narr==\"Filomena\")\r\n return 4;\r\n else if (narr==\"Filostrato\")\r\n return 5;\r\n else if (narr==\"Lauretta\")\r\n return 6;\r\n else if (narr==\"Neifile\")\r\n return 7;\r\n else if (narr==\"Pampinea\")\r\n return 8;\r\n else\r\n return 9;\r\n}", "title": "" }, { "docid": "97e91eb564d1729df7635448f24643c7", "score": "0.63446885", "text": "function proceso8(callback) {\n\tvar s = parseInt(prompt(\"ingrese numero\"));\n\tcallback(s);\n}", "title": "" }, { "docid": "fdd796d7ade6c37f41ca1c6958b87b28", "score": "0.63399065", "text": "function retorno1(){\n let numero = 5;\n return numero;\n}", "title": "" }, { "docid": "0db751dde13cde388fb70b670f4721f5", "score": "0.6323737", "text": "function soloNumeros(e) {\t\n\ttecla=(document.all) ? e.keyCode : e.which;\n\t\n\t//Comprueba numeros del 1 al 9 y 0 - MAS -> Tecla 8 = RETROCESO & Tecla 0 = SUP Y FLECHAS.\n\tif (tecla==48 || tecla==49 || tecla==50 || tecla==51 || tecla==52 || tecla==53 || tecla==54 || tecla==55 || tecla==56 || tecla==57 || tecla==59 || tecla==8 || tecla==0) {\n\t\treturn true;\n\t}\n\telse\n\t\treturn false;\n}", "title": "" }, { "docid": "61b2245d5b09047989dc5cf5f16c7706", "score": "0.63218284", "text": "function esPrimo(num){\n\n // 0 y 1 no se consideran numeros primos ni compuesto y \n //4 es un numero compuesto porque que tiene mas de dos divisores\n // los numeros primos y compuestos solamente son los naturales positivos mayores o iguales a 2 \n // si digita algo que no sea un numero o un numero menor \n //a 2 da error\n if(!isNaN(num) && num >= 2){\n //si el numero es divisible es primo es falso\n let prime = true;\n if (num == 0 || num == 1 || num == 4){\n prime = false;\n }\n //el for comienza de 2 porque ni 0 y 1 son numeros ni \n //primos ni compuestos, si encuentra otro numero con el que se pueda dividir\n // primo es falso\n for (let i = 2; i < num ; i++) {\n if (num % i == 0) {\n prime = false;\n }\n }\n if ( prime == true){\n return true;\n }else{\n return false;\n }\n\n }else{\n console.log('error');\n }\n}", "title": "" }, { "docid": "663e3e4f13a29912db75fa09e289babd", "score": "0.63066244", "text": "function generarNumero(numero){\n\treturn (Math.random()*numero).toFixed(0);\n}", "title": "" }, { "docid": "a5e13bf761d052d09fd2616da994f068", "score": "0.6306337", "text": "function cuatosDigitosTiene(numero){\n texnum = numero + \"\"\n return texnum.length\n}", "title": "" }, { "docid": "8ed59577d5e8d14449ab97b8ab98ea20", "score": "0.63017046", "text": "function GetInteger() {\n entree=window.prompt(\"Entrez la valeur souhaitée.\");\n entree=parseInt(entree);\n}", "title": "" }, { "docid": "223122e5bd9a5780d1fd11d7f025823e", "score": "0.62911695", "text": "function aumentar_cero(num){\r\n if (num < 10) {\r\n num = \"0\" + num;\r\n }\r\n return num;\r\n}", "title": "" }, { "docid": "1bb5b4ed0aa1ecedf249e992c0f41059", "score": "0.62848365", "text": "getNumero() {\n return this.numero;\n }", "title": "" }, { "docid": "8eb61546cdf0158cfed3460ceec57520", "score": "0.62815905", "text": "function tambahDeret(num) {\n\n var i, total;\n num = Number(num)\n\n if (num >= 1 && num <= 1000) {\n total = 0;\n\n for (i = num; i > 0; i--) {\n\n total += i;\n }\n return `total penjumlahan angka 1 sampai ${num} adalah ` + total;\n\n } else {\n return `masukan angka yang benar (1 - 1000)`;\n }\n}", "title": "" }, { "docid": "2c66b3dbea57f49bcf66b40e36dee7d9", "score": "0.6276992", "text": "function NumRange() {\n if (numUtente >= 1 && numUtente <= maxNumberUtente) {\n numUtente;\n } else{\n alert(\"il numero inserito non è valido, riprova!\")\n }\n}", "title": "" }, { "docid": "d34ced9606ede894a0c645bae8c4292d", "score": "0.62767935", "text": "function somente_numero_zero_a_nove(campo){\r\n \tvar digits=\"0123456789\";\r\n \tvar campo_temp = null;\r\n\t for (var i=0;i<campo.value.length;i++){\r\n\t campo_temp=campo.value.substring(i,i+1) \r\n\t if (digits.indexOf(campo_temp)==-1){\r\n\t campo.value = campo.value.substring(0,i);\r\n\t break;\r\n\t }\r\n\t }\r\n\t}", "title": "" }, { "docid": "6a9967049284080e726294101d802f77", "score": "0.62737125", "text": "getNumber() {\n const formData = `/getNumber?number=${this.numInput}`;\n this.sendAjax(formData, 1, false);\n }", "title": "" }, { "docid": "ee680779f5c70c3389cfbb6c800de4a4", "score": "0.6273622", "text": "function display_numeros(numero) {\n //document hace referencia en lo que es mi documento es decir la pagina web, el objeto documento tiene una serie de metodos, en lo que esta get element by id\n //identifico objeto y ahora accedo a su propiedad valor OBEJTO.PROPIEDAD=VALOR\n\n //En estas lineas se almacenan los numeros que apreto y la suma al proximo\n document.getElementById(\"display\").value = cifra + numero;\n\n //lo que esta en el display se almacena en la variable cifra\n cifra = document.getElementById(\"display\").value;\n}", "title": "" }, { "docid": "a1331181785d27d6ed2e80be54a29c6e", "score": "0.62655", "text": "function aumentar_cero(num){\n if (num < 10) {\n num = \"0\" + num;\n }\n return num;\n}", "title": "" }, { "docid": "7333786ffd9ae98eb90fd54af0f9d620", "score": "0.6253294", "text": "function esNumerico(monto){\n if(monto/1==monto){\n return true;\n }else{\n alert(\"-----INGRESE UN VALOR NUMERICO----\");\n }\n}", "title": "" }, { "docid": "91bc2957afc7646daf2264623b3e8933", "score": "0.6250815", "text": "function suma(numero) {\n var sale;\n sale = '0';\n if (numero < 10) {\n return sale + numero.toString();\n } else\n return numero.toString();\n }", "title": "" }, { "docid": "e0686c7322715f26e879da75afb0bb22", "score": "0.62503016", "text": "function generarNumeroAleatorioEntre(minimo, maximo){\n\tvar anchoFranjaNumerica = (maximo-minimo) + 1;\n\tvar numero = Math.floor((Math.random() * anchoFranjaNumerica) + minimo);\n\treturn numero;\n}", "title": "" }, { "docid": "02b2ded7ed29ddf7885acbd99a2b57cb", "score": "0.62462366", "text": "function generarNumero() {\n\n var numero = Math.round( Math.random() * 100 )\n\n console.log( \"el numero generado es \" + numero )\n\n return numero\n\n}", "title": "" }, { "docid": "07b4747401b244fc8f15202eba752621", "score": "0.6240622", "text": "function getNumber(num) {\n// sætter en variabel = det HTML element som har id'et 'input'\n// hvilket er et <input> element af typen 'box', som er selve 'skærmem' på lommeregneren\n\n\tvar visibleInput = document.getElementById('input2'); \n\n// Denne her switch sætning checker hvilket tal-input\n// der bliver valgt og lægger det til variablen's værdi\n// .value fanger 'værdien' af variablen. \n// x += '1' er det samme som at sige input x = x + 1: \n\tswitch (num) {\n\t\tcase 1:\n\t\tinvisibleInput += '1';\n\t\tvisibleInput.value += '1';\n\t\tbreak; \n\t\tcase 2:\n\t\tinvisibleInput += '2';\n\t\tvisibleInput.value += '2';\n\t\tbreak; \n\t\tcase 3:\n\t\tinvisibleInput += '3';\n\t\tvisibleInput.value += '3';\n\t\tbreak; \n\t\tcase 4:\n\t\tinvisibleInput += '4';\n\t\tvisibleInput.value += '4';\n\t\tbreak; \n\t\tcase 5:\n\t\tinvisibleInput += '5';\n\t\tvisibleInput.value += '5';\n\t\tbreak; \n\t\tcase 6:\n\t\tinvisibleInput += '6';\n\t\tvisibleInput.value += '6';\n\t\tbreak; \n\t\tcase 7:\n\t\tinvisibleInput += '7';\n\t\tvisibleInput.value += '7';\n\t\tbreak; \n\t\tcase 8:\n\t\tinvisibleInput += '8';\n\t\tvisibleInput.value += '8';\n\t\tbreak; \n\t\tcase 9:\n\t\tinvisibleInput += '9';\n\t\tvisibleInput.value += '9';\n\t\tbreak; \n\t\tcase 0:\n\t\tinvisibleInput += '0';\n\t\tvisibleInput.value += '0';\n\t\tbreak; \n\n\t}\n}", "title": "" }, { "docid": "be22b88b8b640ae06ac54a58bd9ac45a", "score": "0.62375313", "text": "Digitos(numero) {\n return parseFloat(numero) > 999999999 ? true : false;\n }", "title": "" }, { "docid": "12e663254d118cfcfd1d014a3bf7f69a", "score": "0.6230779", "text": "function agregar_inicio(){\n \n var valor = parseInt(document.getElementById(\"numero\").value);\n\n if (!/^([0-9])*$/.test(valor)) {\n alert(\"El valor \" +valor+ \" no es un número\");\n document.getElementById(\"numero\").value=null;\n }\n else\n {\n if(!valor){\n alert(\"No escribiste nada\");\n }\n else{\n lista.agregarInicio(valor);\n let cadena = lista.imprimir();\n document.getElementById(\"contenedorLista\").innerHTML = cadena;\n document.getElementById(\"tamañoLista\").innerHTML = lista.obtenerTamaño();\n document.getElementById(\"numero\").value=\"\";\n }\n }\n}", "title": "" }, { "docid": "b100935b0931f551fae9860427fdd1cd", "score": "0.62223303", "text": "function soloNumeros(e){\n\t\tvar key = window.event ? e.which : e.keyCode;\n\t\tif (key != 13){\n\t\t\tif (key < 48 || key > 57){\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t}else{\n\t\t\tvar pTipoIdentificacion = \"\";\n\t var pNumeroIdentificacion = \"\";\n\t pTipoIdentificacion = $(\"#cmbTipoIdentificacion option:selected\").val();\n\t pNumeroIdentificacion = $(\"#identificacion\").val();\n\t\t\tif (pNumeroIdentificacion == \"\"){\n\t\t\t\tmostrarPopUpError(\"Por favor ingrese un número de identificación\");\n\t\t\t}\n\t\t\telse{\n\t consultarCargasTercero();\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "fb090cddc7113bd35970ac830044c845", "score": "0.6200027", "text": "function calcNum(num) {\n if(inicio == 0){\n document.calcform.visor.value = ''\n inicio = 1\n }else{\n document.calcform.visor.value = document.calcform.visor.value + num\n }\n }", "title": "" }, { "docid": "b6f00ab6f418fad60fa5822673362f8d", "score": "0.619814", "text": "function sumaEnteros(numero){\n\n if(numero==1){ // comprobamos la condicion dada \n return 1\n }\n return numero + sumaEnteros( numero - 1) \n\n}", "title": "" }, { "docid": "db7f0d452d0be7ea6782ab0ad47df912", "score": "0.6196054", "text": "function leerNumeroPositivo(mensaje) {\n var read = 0;\n //repetir esta instrucción hasta ingresar un numero positivo\n do{\n read = parseFloat(prompt(mensaje, \"\"));\n }while (read<0 || isNaN(read));\n return read;\n}", "title": "" }, { "docid": "1bae63c2caf415471fd3987c3f51384d", "score": "0.619401", "text": "function verificaNumeroInteiroComAlerta(campo, nome){\r\n\t \tvar valorAuxiliar = \"\";\r\n\t\tdigitosValidos = \"0123456789\" ;\r\n\t\tvar numeroInvalido = false;\r\n\t\t\r\n\t\tvalor = campo.value;\r\n\t\t//retira digitos terao numericos\r\n \t\tfor (i=0;i<valor.length;i++){\r\n \t\t\tif(digitosValidos.indexOf(valor.charAt(i))>=0) {\r\n \t\t\t\tvalorAuxiliar += valor.charAt(i);\r\n \t\t\t} else {\r\n \t\t\t\tnumeroInvalido = true;\r\n \t\t\t}\r\n \t\t}\r\n\r\n\t\t\r\n\t\t//retira zeros desnecessarios ao inicio do numero\r\n\t\twhile (valorAuxiliar.length > 1 && valorAuxiliar.charAt(0) == \"0\")\r\n\t\t\tvalorAuxiliar = valorAuxiliar.substring(1);\r\n\r\n\t\tvalor = valorAuxiliar;\r\n\t\tif(numeroInvalido) {\r\n\t\t\tcampo.value = \"\";\r\n\t\t\talert(\"Campo \" + nome + \" inv�lido.\");\r\n\t\t} else {\r\n\t\t\tcampo.value = valor;\r\n\t\t}\r\n\r\n\t}", "title": "" }, { "docid": "1771c7c1463d36ef7c21ef2ab63b39a0", "score": "0.6193205", "text": "function esNumero(campo){\n error=false;\n var string = document.getElementById(campo).value;\n var numero = parseFloat(string);\n if(isNaN(numero)){\n document.getElementById(campo).style.background = \"#FFCCE0\";\n error = true;\n }else{\n document.getElementById(campo).style.background = \"#FFFFFF\";\n error = false;\n }\n return error;\n }", "title": "" }, { "docid": "d948df9103905cdfa25cc64578b67599", "score": "0.61751926", "text": "function keyCodeNumber(value){\n\t\tif (nb1 === null) {\n\t\t\tnb1 = value ;\n\t\t\t$('#result').append(nb1);\n\t\t}\n\t\telse if (nb2 === null){\n\t\t\tnb2 = value ;\n\t\t\t$('#result').append(nb2);\n\t\t}\n\t\telse {\n\t\t\talert('Remettez à 0 avec CE.');\n\t\t}\n\t}", "title": "" }, { "docid": "90c16f9438a024f0a3ce394a843bef05", "score": "0.61737514", "text": "function miNum(y){\n if (y >= 0){\n console.log(\"Es positivo\")\n } else if (y < 0){\n console.log(\"Es negativo\")\n } else if (y === 0){\n console.log(\"Es el numero 0\")\n }\n else {\n console.log(\"ERROR\")\n }\n}", "title": "" }, { "docid": "447dd127e45caa45984bbb4b6c5519ca", "score": "0.61709994", "text": "function invertirDigitos(numero) {\r\n var invertido = 0\r\n var resto = numero\r\n do {\r\n invertido = invertido * 10 + (resto % 10)\r\n resto = Math.floor(resto / 10)\r\n } while (resto > 0)\r\n return invertido\r\n}", "title": "" }, { "docid": "ff67472cce6ed9149cf41bf7dcf054c8", "score": "0.61694795", "text": "function redondeo(numero) {\n return Math.round(numero);\n} //FIN FUNCION", "title": "" }, { "docid": "9d47bbf759f2cc8cff48d7f8ed7ed90e", "score": "0.6168664", "text": "function chiediUnNum(min, max){\n\n return parseInt(prompt(\"Dimmi un numero da \" + min + \" a \" + max + \"!\"));\n \n}", "title": "" }, { "docid": "1d0167802f225142d3107fa18d71a36a", "score": "0.61684215", "text": "function es_par(numero) {\r\n\tresultado = false;\r\n\r\n\t// Implementacion de la funcion\r\n\tif(numero != null) {\r\n\t\tif (numero % 2 == 0) {\r\n\t\t\tresultado = true;\r\n\t\t}\r\n\t}\r\n\treturn resultado;\r\n}", "title": "" }, { "docid": "770bcfb0188563ad77f2d18eb6bcc62c", "score": "0.61603755", "text": "function jugar(num){\r\n\tif(numjug.value==2){\r\n\t\tdosjugadores(num);\r\n\t}else{\r\n\t\tunjugador(num);\r\n\t}\r\n}", "title": "" }, { "docid": "00eea5f92a59f3b6d7f2d732f491a940", "score": "0.6153561", "text": "function verificaNumero(e) {\n if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {\n return false;\n }\n } // Funcao para nao colocar Letras nos campos que so é aceito numeros em tempo real (exibir presione crtl+shift+[)", "title": "" }, { "docid": "df1b11f3279c6657f9f26d2059b9216b", "score": "0.61455184", "text": "function obtenerNumeros() {\n\n var retornaNumeros = function () {\n return 80;\n };\n return retornaNumeros();\n\n var retornaNumeros = function () {\n return 50;\n }\n}", "title": "" }, { "docid": "d3f7d9b6bab94a9c7bd2ba10fb5db6ba", "score": "0.6127517", "text": "function btnConvertir(){\n\tvar val=document.getElementById('txNumero').value;\n\tif(!isNaN(val)){\n\t\t//Se asigna una variable que se va a contener la conversión del numero décimal\n\t\tval=Math.abs(val); \n\t\tvar str= ConvertirRomano(val);\n\t\t//Una vez se tiene el resultado se inyecta en el area de la interfaz donde el usuario lo puede consultar\n\t\tdocument.getElementById('Resultado').innerHTML=str;\n\t}\n\telse\n\t{\n\t\talert('El valor debe ser numerico');\n\t}\n}", "title": "" }, { "docid": "bba4145a4f9b61758319530a0d108035", "score": "0.6118425", "text": "function dobro(number){\n return number * 2;\n}", "title": "" }, { "docid": "f527de5add3f3fc607976dd3ff9e7bdd", "score": "0.6118072", "text": "function despliegaNumero(){\n let digitos = {\n uno: Number(String(fecha.day.value).charAt(0)),\n dos: Number(String(fecha.day.value).charAt(1)),\n tres: Number(String(fecha.month.value).charAt(0)),\n cuatro: Number(String(fecha.month.value).charAt(1)),\n cinco: Number(String(fecha.year.value).charAt(0)),\n seis: Number(String(fecha.year.value).charAt(1)),\n siete: Number(String(fecha.year.value).charAt(2)),\n ocho: Number(String(fecha.year.value).charAt(3)),\n } \n\n let numeroAlma = digitos.uno + digitos.dos\n let numeroKarma = Number(fecha.month.value)\n let numeroDon = digitos.siete + digitos.ocho\n let numeroDestino = digitos.cinco + digitos.seis + numeroDon\n let numeroMision = numeroAlma + digitos.tres + digitos.cuatro + numeroDestino\n\n calculaNumeros(numeroAlma, numeros.soul)\n calculaNumeros(numeroKarma, numeros.karm)\n calculaNumeros(numeroDon, numeros.gift)\n calculaNumeros(numeroDestino, numeros.destiny)\n calculaNumeros(numeroMision, numeros.mission)\n}", "title": "" }, { "docid": "da490b3633f4c2706a659aaa5c9e25d5", "score": "0.6117671", "text": "function validaNumeros(e){\n tecla = (document.all) ? e.keyCode : e.which;\n\n //Tecla de retroceso para borrar, siempre la permite\n if (tecla==8){\n return true;\n }\n// Patron de entrada, en este caso solo acepta numeros\n patron =/[0-9]/;\n tecla_final = String.fromCharCode(tecla);\n return patron.test(tecla_final);\n}", "title": "" }, { "docid": "114f48fc00c96aaee32fc57f73d4dcd6", "score": "0.6114702", "text": "function sommaNumeri(numero1, numero2)\n{\n\t// === Validazione dei parametri in ingresso\n\tif(typeof numero1 !== \"number\" && typeof numero2!==\"number\")\n\t{\n\t\treturn false;\n\t}\n\n\treturn numero1 + numero2\n}", "title": "" }, { "docid": "170d784a1e24f07fe9f1e92f061aac19", "score": "0.6111386", "text": "function numeros(numero){\n\tif(operador == \"\"){ //Escribe en operando1\n\t\tvar valorInicial=document.calculadora.operando1.value;\n\t\tif(valorInicial==\"0\"){\n\t\t\tdocument.calculadora.operando1.value=\"\";\n\t\t}\n\t\t//concatena los valores de numero con los del operando1\n\t\tdocument.calculadora.operando1.value=document.calculadora.operando1.value+numero;\n\t}else{ //operando2\n\t\tvar valorInicial=document.calculadora.operando2.value;\n\t\tif(valorInicial==\"0\"){\n\t\t\tdocument.calculadora.operando2.value=\"\";\n\t\t}\n\t\t//concatena los valores de numero con los del operando1\n\t\tdocument.calculadora.operando2.value=document.calculadora.operando2.value+numero;\n\t}\n}", "title": "" }, { "docid": "c08239e921c5d4d3197195ec143bf101", "score": "0.6103813", "text": "function funwhile()\n\t{\n\t\tvar num = prompt(\"Ingrese el número entre 0-50\");\n\t\t// Conversión a Númerico\n\t\tnum= Number(num);\n\t\t/*\tif ( num < 0 || num > 50 )\n\t\t\t{\n\t\t\t\talert (\"Número fuera del rango 0-50\");\n\t\t\t}\n\t\t\telse\n\t\t\t{ */\n\t\t\t\twhile ( num < 50 )\n\t\t\t\t{\n\t\t\t\t\tnum++;\n\t\t\t\t\talert (\"Número : \"+ num);\n\t\t\t\t}\n\t\t\t//}\n\t}", "title": "" }, { "docid": "d889b4061801e77c19d160128807db5e", "score": "0.61035717", "text": "function formatinteger( numero ) {\n numero = numero.replace(/,/g, \"\");\n numero = parseInt( numero );\n return verifyNaN(numero); \n }", "title": "" }, { "docid": "3d73e5fd650513bf881ef155f2e798f5", "score": "0.6100972", "text": "function adicionaZero(numero) {\n if (numero <= 9)\n return \"0\" + numero;\n else\n return numero;\n}", "title": "" }, { "docid": "a23ec1e8a6bbd770e855b76b20634282", "score": "0.6100185", "text": "function setupNumber(bot) {\n bot.hears('Изменить количество победителей', async (ctx) => {\n // Get chat id\n const chatId = await getChatIdForConfig_1.getChatIdForConfig(ctx);\n if (!chatId) {\n return;\n }\n // Get chat\n let chat = await chat_1.findChat(chatId);\n // Check if `/number XXX` format\n const numberString = (ctx.message || ctx.channelPost).text.substr(8).trim();\n if (numberString &&\n !isNaN(+numberString) &&\n +numberString > 0 &&\n +numberString < 10000000) {\n chat.number = +numberString;\n chat = await chat.save();\n // Reply\n return ctx.reply(locale_1.loc('number_selected', chat.language), {\n disable_notification: true,\n });\n }\n // Reply\n return ctx.reply(locale_1.loc('select_number', chat.language), {\n reply_markup: getButtons(),\n disable_notification: true,\n });\n });\n}", "title": "" }, { "docid": "f116b601f19e168242b6bff774b136b1", "score": "0.6100164", "text": "function uno_a_tres() {\n let n3 = 0;\n // sea n100 un número del 1 al 100 y n3 el resultado de tu función\n var n100 = Math.floor(Math.random() * 100 + 1);\n\n if (n100 <= 25) {\n n3 = 1;\n } else if (n100 <= 75) {\n n3 = 2;\n } else {\n n3 = 3;\n }\n return n3;\n }", "title": "" }, { "docid": "617f4596aaa211f5ac06cce9c19dd89d", "score": "0.6096011", "text": "function validarSiNumero(numero) {\n if (/^([0-9])*$/.test(numero)) {\n return true;\n } else {\n alert(\"'\" + numero + \"' no es una entrada válida\");\n return false;\n }\n \n }", "title": "" }, { "docid": "50cce09e3b56c34424a6e4596e04c461", "score": "0.6092481", "text": "function suma(numero){\n var otroNumero = 7\n // console.log(numero + otroNumero * numero)\n return numero + otroNumero * numero\n}", "title": "" }, { "docid": "026373664213208d4cd1632b217d4282", "score": "0.6086495", "text": "function numberIterator(num) {\n // only code here\n //1. set stoper kalau num sampai dengan 0\n //2. set decrement menggunakan rekursif sampai kondisi terpenuhi\n\n if (num > 0) {\n console.log(num)\n return numberIterator(num - 1);\n\n } else {\n return num\n\n }\n}", "title": "" }, { "docid": "60016361cf1d89901b023f3646e726be", "score": "0.60738635", "text": "getNumber() {\n let nbr = util_1.Util.extractNumber(this.data, this._ptr);\n this._ptr = nbr.end_index + 1;\n return nbr.result;\n }", "title": "" }, { "docid": "5e8e98200c6c831bb2d261b3c5955498", "score": "0.60617256", "text": "function comprobarNumero(e) {\r\n\tvar keychar;\r\n\tvar teclanum;\r\n\tvar miNumero = document.getElementById('numero');\r\n\t// alert('holaa prueba 2 comprobarNumero');\r\n\tteclanum = e.which;\r\n\tkeychar = String.fromCharCode(teclanum);\r\n\r\n\t// alert(keychar);\r\n\tif (keychar < '0' || keychar > '9') {\r\n\t\t// alert('holaa prueba 1 comprobarNumero');\r\n\t\treturn false;\r\n\t} else {\r\n\t\treturn true;\r\n\t}\r\n\t// alert('holaa prueba 2 comprobarNumero');\r\n\tif (/^\\d{9}/.test(miNumero) && (miNumero.length <= 9)) {\r\n\t\treturn true;\r\n\t} else {\r\n\t\talert(\"El numero insertado \" + miNumero + \" es erroneo\");\r\n\t\treturn false;\r\n\t}\r\n}", "title": "" }, { "docid": "070706121cf0a8acdf85a867bdb7abab", "score": "0.6055213", "text": "function numero(cadena)\n\t{\n\t var str = \"1234567890\";\n\t for(cont = 0;cont < cadena.length;cont++)\n\t\t{\n\t\ttmp = cadena.substring(cont,cont+1);\n\t\tif (str.indexOf (tmp,0)== -1)\n\t\treturn(false);\n\t\t}\n\t return(true); \n\t}", "title": "" }, { "docid": "b25cc06873a06482b5d84414d3059103", "score": "0.60514975", "text": "function solo_numeros(e){\n //Almacena la entrada del teclado//\n key=e.keyCode || e.which;\n //Almacena lo que haya en la entrada del teclado//\n teclado=String.fromCharCode(key);\n //La variable contiene los numeros válidos//\n numero=\".0123456789\";\n //Teclas que se van a ejecutar//\n especiales=\"8-13-37-38-46\";\n\n teclado_especial=false;\n\n for(var i in especiales){\n if(key==especiales[i]){\n teclado_especial=true;\n }\n }\n //VERIFICO SI LO QUE SE CAPTURÓ SON SOLO NUMEROS//\n if(numero.indexOf(teclado)==-1 && !teclado_especial){\n return false;\n\n }\n}", "title": "" }, { "docid": "601cb9145eca5a1fe834d6ca948acef7", "score": "0.60507", "text": "function eventoSoloNumeros(event) {\n\tif( (event.keyCode>=48 && event.keyCode<=57) || (event.keyCode>=96 && event.keyCode<=105) ) {\n\t\tevent.returnValue = true;\n\t}\n\telse {\n\t\tevent.returnValue = false;\n\t}\n\t/*var tecla = String.fromCharCode(event.keyCode)\n\talert(isNumber(tecla));\n\tif( !isNumber(tecla) ) {\n\t\tevent.returnValue = false;\n\t}*/\n}", "title": "" }, { "docid": "07e37b6a86e26db2f45ae519667f287c", "score": "0.60481614", "text": "function dado(){\r\n var num=0;\r\n num=Math.ceil(Math.random()*6);//La funcion cell me devuelve valores enteros\r\n return num;\r\n}", "title": "" }, { "docid": "7c914336a39a5c8ce5f8ab5a0f3d3551", "score": "0.60374075", "text": "function number(param) {\r\n var nilai = param.value.replace(/\\D/g, \"\").replace(/[a-zA-Z]*/g, \"\");\r\n document.getElementById(param.getAttribute('id')).value = nilai;\r\n}", "title": "" }, { "docid": "c369d7752b2dbcd69589efc07a0c7931", "score": "0.60335857", "text": "function esPrimo(){\n\tvar n= parseInt(prompt(\"ingrese un numero\"));\n\t\n\n\tif (n<=1){\n\t\talert(\"Número invalido \");\n\n\t} else if (n===2){\n\t\talert(\"Es número primo \");\n\n\t} else if (n>=3){\n\t\tvar esPrimo = true; // asume que es un primo\n\n\t\tfor (var i=2; i<n-1; i++){ // tratando de encontrar un divisor, se rompe la regla\n\t\t\tif(n%i===0){\n\t\t\t\tesPrimo = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif(esPrimo) {\n\t\t\talert(\"es primo\");\n\t\t} else {\n\t\t\talert(\"no es primo\")\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a6d187b21da31ce9aa28e5f39b6b1f3c", "score": "0.6031263", "text": "function somaNúmeros(numero3,numero4)\n {\n let somar = numero3 + numero4\n console.log(somar)\n }", "title": "" }, { "docid": "a5aaa4414d1ec1d84bc1631d370f2623", "score": "0.60297304", "text": "function pedirNumeros(){\n do{\n let valor = parseInt(prompt('Introduzca un numero: '));\n introducirNumero(valor);\n num++; \n }while(num < 6);\n }", "title": "" }, { "docid": "340cff84a68c35459e8feb68b0f4dfe3", "score": "0.60207236", "text": "function cuadrado (num){\n return num*num;\n}", "title": "" }, { "docid": "c7c2a9a26908bd9d1f4c7dff5294d870", "score": "0.6016505", "text": "function numeriRandom(){\n var numeroRandom = Math.floor(Math.random() * range) + 1;\n return numeroRandom;\n}", "title": "" }, { "docid": "417efa43353abee8d9ba542e4c66ca77", "score": "0.60124606", "text": "function sendNumber() {\n var number = parseInt($(this).attr('id')[1], 10);\n game.isCorrect(number);\n }", "title": "" }, { "docid": "4004179c02acd5c7c81f70e32ef207d0", "score": "0.60093987", "text": "function testPariODispari (numero) {\n if (numero % 2 == 0) {\n return 'pari'\n } else {\n return 'dispari'\n }\n}", "title": "" }, { "docid": "d28029c0ee522ebdd9a4e2e72a182c4a", "score": "0.6009368", "text": "function AcharNumeroPrimo() {\n for(let i = 2; i < 6; i++){\n if(i == 2){\n NumeroPrimo1 = i\n\n }\n\n if(i == 3){\n NumeroPrimo2 = i\n }\n\n if(i == 5){\n NumeroPrimo3 = i\n }\n }\n}", "title": "" }, { "docid": "4eec93941c58c267e6391807dcf93a1a", "score": "0.6005512", "text": "function ejercicio4() {\n var res4 = $(\"#resultado4\");\n var num4 = Number($(\"#num4\").val());\n\n\tif(num4 == !isNaN){\n\t\tres4.text(\"Ingrese un numero\").addClass(\"alert\");\n\n\t}\n\t\telse{\n\t res4.removeClass(\"alert\");\n //controlar si es negativo o positivo\n if (num4 > 0) {\n num4 += \", Si es Positivo! \";\n } else if (num4 == 0) {\n num4 = \"Cero\";\n } else {\n num4 *= -1;\n }\n //este valor lo agregamos al resultado.\n\n res4.html(\"El resultado es \" + num4);\n\t\t};\n}", "title": "" }, { "docid": "0b08cde4891fe00c8c4e6d00218fb1bf", "score": "0.59875536", "text": "function getNumeroPlanejamento(AlunoID, Numero)\n{\n\n\tvar contador = 0;\n\n\tdataPlanejamentoRoteiro = getData('PlanejamentoRoteiro/aluno', AlunoID);\n\n\tfor(var a=0; a< dataPlanejamentoRoteiro.length; a++)\n\t{\n\t\t\n\t\tif(Numero == 1)\n\t\t{\n\t\t\t\n\t\t\tif(dataPlanejamentoRoteiro[a].status == \"2\" ||\n\t\t\t\t\t\t\tdataPlanejamentoRoteiro[a].status == \"3\" ||\n\t\t\t\t\t\t\tdataPlanejamentoRoteiro[a].status == \"4\")\n\t\t\t{\n\n\t\t\t\tcontador++;\n\n\t\t\t}\n\n\t\t} else if(Numero == 2)\n\t\t{\n\n\t\t\tif(dataPlanejamentoRoteiro[a].status == \"3\")\n\t\t\t{\n\t\t\t\t\n\t\t\t\tcontador++;\n\n\t\t\t}\n\n\t\t}\n\t}\n\n\treturn contador;\n}", "title": "" } ]
43cd50521ae9845b58d404ff5c4903f7
Count number of points in a list of complex polygons
[ { "docid": "7dca749b2e9bae3295030ce144fd573d", "score": "0.7568194", "text": "function getPointCount(polygons) {\n return polygons.reduce(function (points, polygon) {\n return points + Polygon.getVertexCount(polygon);\n }, 0);\n}", "title": "" } ]
[ { "docid": "5e1fc4404617930f63b1aae12488d90f", "score": "0.7412894", "text": "function getPointCount(polygons) {\n return polygons.reduce(function (points, polygon) {\n return points + __WEBPACK_IMPORTED_MODULE_0__polygon__[\"b\" /* getVertexCount */](polygon);\n }, 0);\n}", "title": "" }, { "docid": "e4a1cda4027c91e7481bafe808c431a2", "score": "0.68722147", "text": "function getTriangleCount(polygons) {\n return polygons.reduce(function (triangles, polygon) {\n return triangles + Polygon.getTriangleCount(polygon);\n }, 0);\n}", "title": "" }, { "docid": "024768cc6971ac3b65eef05c5ee36750", "score": "0.67210543", "text": "function getTriangleCount(polygons) {\n return polygons.reduce(function (triangles, polygon) {\n return triangles + __WEBPACK_IMPORTED_MODULE_0__polygon__[\"c\" /* getTriangleCount */](polygon);\n }, 0);\n}", "title": "" }, { "docid": "4271bee0bb740e8d8a47eaefb6b34425", "score": "0.665259", "text": "function countVertices(vertices) {\n return vertices.reduce(function (count, polygon) {\n return count + polygon.length;\n }, 0);\n}", "title": "" }, { "docid": "44074fb673aa3c03af35992edff740e2", "score": "0.644195", "text": "countPoints(points) {\n let counts = points.map(this.keyFromCoords).reduce((acc, k) => {\n acc[k] = acc[k] !== undefined ? acc[k] + 1 : 1;\n return acc;\n }, {});\n\n return Object.keys(counts).map(d => {\n let coord = d.split(\"/\");\n return {\n lat: coord[0],\n lon: coord[1],\n count: counts[d]\n };\n });\n }", "title": "" }, { "docid": "38c893bf1940fc510cf604f0256add7d", "score": "0.6241341", "text": "function getCount(objects) {\n var count = 0;\n for (var i = 0; i < objects.length; i++) {\n if (objects[i].x == objects[i].y) {\n count++;\n }\n }\n return count;\n}", "title": "" }, { "docid": "cb47e983fadab57abff89442715cd2c6", "score": "0.6213515", "text": "function getfeatures_count()\n {\n var number_of_features = 0;\n Object.keys(vector_list).forEach(function(key) {\n number_of_features = number_of_features + Number(vector_source_list[key].getFeatures().length);\n });\n return number_of_features;\n }", "title": "" }, { "docid": "3eb321aa5341920ad926c06dbe5a20b3", "score": "0.6120001", "text": "function getCount(objects) {\n return objects.filter(i => i.x == i.y).length;\n}", "title": "" }, { "docid": "f10b20afbda8cdc766ee138d2dc53fc6", "score": "0.60577035", "text": "function getTriangleCount(polygon) {\n var triangleCount = 0;\n var first = true;\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = normalize(polygon)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var simplePolygon = _step.value;\n\n var size = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__lib_utils__[\"c\" /* count */])(simplePolygon);\n if (first) {\n triangleCount += size >= 3 ? size - 2 : 0;\n } else {\n triangleCount += size + 1;\n }\n first = false;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return triangleCount;\n}", "title": "" }, { "docid": "5e394602dd68d0b68495f36b433727af", "score": "0.5960021", "text": "getPointCount() {\n\t\treturn $_(this).points.length\n\t}", "title": "" }, { "docid": "e3aed492f8c792202db1cf99af99004e", "score": "0.5948603", "text": "get countSides() {\n // console.log(\"this.arr.length\", this.arr.length)\n // this.arr.length 3\n // that returns the number of sides of the polygon\n return this.arr.length\n }", "title": "" }, { "docid": "54dc0beef44d269b5c818d2b9daa1b7e", "score": "0.5896107", "text": "function getVertexLength(geometryPointCount) {\n\t return imul(geometryPointCount, 3);\n\t}", "title": "" }, { "docid": "edc68613009a5b9557575357c24a5835", "score": "0.5797163", "text": "function getCount(objects) {\n \n let n = 0\n const func = (ar)=> {\n if(ar.x === ar.y){\n return n = n + 1;\n }else {\n return n\n }\n }\n objects.forEach(func)\n return n;\n}", "title": "" }, { "docid": "7d959c79f51a3a577277ced750cfdb31", "score": "0.5746849", "text": "get vertexCount() { return this.geo.vertices.length / 3; }", "title": "" }, { "docid": "da5762228fbe334f9f963b7130ffae76", "score": "0.57107973", "text": "function countVertices() {\n \tfor (var i = 0; i < workingPaths.length; i++) {\n \t\tvar path = workingPaths[i]; // Path\n \t\tfor (var v = 0; v < path.segments.length - 1; v++)\n \t\t\tpath.segments[v].end.totalCount++;\n \t}\n }", "title": "" }, { "docid": "4ed01eba8a6376d27f23f8ff655684c2", "score": "0.5636905", "text": "get pointCount() {\n let count = 0;\n if ((this.mpoints != null)) {\n count = this.mpoints.length;\n }\n return count;\n }", "title": "" }, { "docid": "4ed01eba8a6376d27f23f8ff655684c2", "score": "0.5636905", "text": "get pointCount() {\n let count = 0;\n if ((this.mpoints != null)) {\n count = this.mpoints.length;\n }\n return count;\n }", "title": "" }, { "docid": "0aa2022d6ea889fc5afe353f64ed4d49", "score": "0.56032217", "text": "geometryCountByStyle () {\n let counts = {};\n scene.tile_manager.getRenderableTiles().forEach(tile => {\n for (let style in tile.meshes) {\n counts[style] = counts[style] || 0;\n tile.meshes[style].forEach(mesh => {\n counts[style] += mesh.geometry_count;\n });\n }\n });\n return counts;\n }", "title": "" }, { "docid": "97d16bc57919a3689ccad415e692b6af", "score": "0.5585844", "text": "getCentroids(polygons) {\n return polygons.map((d) => this.centroid(d));\n }", "title": "" }, { "docid": "8b0ab9d59256a0f141515812fd84dc1c", "score": "0.5574405", "text": "function sumPoints(objectList) {\n var points = 0;\n for (var i = 0; i < objectList.length; i++) {\n points += objectList[i].points;\n }\n return points;\n}", "title": "" }, { "docid": "718167e3b7e9c245dfe72ac862259ba4", "score": "0.5559908", "text": "addPolygon(points) {\n let count = (points.length * 2);\n let p = [];\n this.startFigure();\n for (let i = 0; i < points.length; i++) {\n p.push(points[i].x);\n p.push(points[i].y);\n }\n this.addPoints(p, PathPointType.Line);\n this.closeFigure();\n }", "title": "" }, { "docid": "718167e3b7e9c245dfe72ac862259ba4", "score": "0.5559908", "text": "addPolygon(points) {\n let count = (points.length * 2);\n let p = [];\n this.startFigure();\n for (let i = 0; i < points.length; i++) {\n p.push(points[i].x);\n p.push(points[i].y);\n }\n this.addPoints(p, PathPointType.Line);\n this.closeFigure();\n }", "title": "" }, { "docid": "3cba13c945c59a181085f29095c14971", "score": "0.5496446", "text": "function getPolygonLength(poly) {\n \"use strict\";\n var part = poly.getPath();\n var dist = 0;\n var len = part.getLength();\n for (var i = 0; i < len - 1; i++) {\n dist += google.maps.geometry.spherical.computeDistanceBetween(part.getAt(i), part.getAt(i + 1));\n }\n dist += google.maps.geometry.spherical.computeDistanceBetween(part.getAt(0), part.getAt(len - 1));\n return dist;\n}", "title": "" }, { "docid": "5a33e25f9e22fb0858b46454ed561e11", "score": "0.54737365", "text": "function getPolygonOffsets(polygons) {\n var offsets = new Array(polygons.length + 1);\n offsets[0] = 0;\n var offset = 0;\n polygons.forEach(function (polygon, i) {\n offset += Polygon.getVertexCount(polygon);\n offsets[i + 1] = offset;\n });\n return offsets;\n}", "title": "" }, { "docid": "2b4a0ba71a349327763dde911258731f", "score": "0.5460221", "text": "function countColTriang(pointsList) {\n let triObj = {};\n let result = {};\n let seen = {};\n for (let i = 0; i < pointsList.length; i++) {\n if (triObj[pointsList[i][1]]) {\n triObj[pointsList[i][1]].push(pointsList[i][0]);\n } else {\n triObj[pointsList[i][1]] = [pointsList[i][0]];\n }\n result[pointsList[i][1]] = 0;\n seen[pointsList[i][1]] = new Set([]);\n }\n for (let color in triObj) {\n for (let i = 0; i < triObj[color].length; i++) {\n for (let j = 0; j < triObj[color].length; j++) {\n for (let k = 0; k < triObj[color].length; k++) {\n let point1 = triObj[color][i];\n let point2 = triObj[color][j];\n let point3 = triObj[color][k];\n if (\n arePointsDifferent(point1, point2) &&\n arePointsDifferent(point1, point3) &&\n arePointsDifferent(point2, point3)\n ) {\n if (\n isValidTriangle(point1, point2, point3) &&\n !seen[color].has(pointsToSortedStr(i, j, k))\n ) {\n result[color] += 1;\n seen[color].add(pointsToSortedStr(i, j, k));\n }\n }\n }\n }\n }\n }\n let totalPoints = pointsList.length;\n let numOfColors = Object.keys(result).length;\n let numOfTriangles = Object.keys(result).reduce(\n (y, x) => parseInt(result[x]) + y,\n 0\n );\n let max = 0;\n let maxKey = {};\n for (let key in result) {\n if (result[key] >= max) {\n max = result[key];\n maxKey[key] = max;\n }\n }\n let maxArr = [];\n for (let key in maxKey) {\n if (maxKey[key] === max) {\n maxArr.push(key);\n }\n }\n maxArr.sort();\n maxArr.push(max);\n if (max === 0) {\n return [totalPoints, numOfColors, numOfTriangles, []];\n }\n return [totalPoints, numOfColors, numOfTriangles, maxArr];\n}", "title": "" }, { "docid": "646c7c7181769a38b4bcce0a59ee0119", "score": "0.5437883", "text": "count() {\n let n = 0;\n for (const list of this.lists) {\n n += list.group.elements.length;\n }\n return n;\n }", "title": "" }, { "docid": "646c7c7181769a38b4bcce0a59ee0119", "score": "0.5437883", "text": "count() {\n let n = 0;\n for (const list of this.lists) {\n n += list.group.elements.length;\n }\n return n;\n }", "title": "" }, { "docid": "efc6a67fa99ecb8547a2bc2dea624868", "score": "0.54377615", "text": "get length() {\n let count = this.points.length;\n if (this.divided) {\n for (var child of this.children) {\n count += child.length;\n }\n }\n return count;\n }", "title": "" }, { "docid": "e924edb89bf7dba1e9850ec6c3fc3311", "score": "0.5429165", "text": "function countSquares(j) {\n // console.log(\"count start\", j);\n var count = 0;\n\n if (j == null) return 0;\n\n // is col/row data then just count it\n if (Array.isArray(j)) {\n return j.length;\n } else {\n // check rows\n if (j.r != null) {\n for (var i = 0; i < j.r.length; i++) {\n if (j.r[i].r != null) {\n count += countSquares(j.r[i].r);\n } else if (j.r[i].c != null) {\n count += countSquares(j.r[i].c);\n } else {\n count++;\n }\n }\n }\n\n // check cols\n if (j.c != null) {\n for (var i = 0; i < j.c.length; i++) {\n if (j.c[i].r != null) {\n count += countSquares(j.c[i].r);\n } else if (j.c[i].c != null) {\n count += countSquares(j.c[i].c);\n } else {\n count++;\n }\n }\n }\n }\n\n return count;\n}", "title": "" }, { "docid": "e113ed10eb4bb34a7f4c57870742c56b", "score": "0.5428677", "text": "function pts_in_polygon(points,pts){\n for (a=0; a<pts.length; a++) {\n if(point_in_polygon(points,pts[a])){\n return true;\n };\n }\n return false;\n}", "title": "" }, { "docid": "493adfdcd4ce38b79de6fd591f614fac", "score": "0.542092", "text": "getFeatureCount(testPlan) {\n let count = 0;\n for (const api in testPlan.specifications) {\n for (const scenario in testPlan.specifications[api].features) {\n count += 1;\n }\n }\n return count;\n }", "title": "" }, { "docid": "41ef226436f392371f0fd49cf72f1139", "score": "0.54133284", "text": "function countElements(ax, ay, bx, by, cx, cy) {\n const mx = (ax + bx) >> 1;\n const my = (ay + by) >> 1;\n\n if (Math.abs(ax - cx) + Math.abs(ay - cy) > 1 && errors[my * size + mx] > maxError) {\n countElements(cx, cy, ax, ay, mx, my);\n countElements(bx, by, cx, cy, mx, my);\n } else {\n indices[ay * size + ax] = indices[ay * size + ax] || ++numVertices;\n indices[by * size + bx] = indices[by * size + bx] || ++numVertices;\n indices[cy * size + cx] = indices[cy * size + cx] || ++numVertices;\n numTriangles++;\n }\n }", "title": "" }, { "docid": "9048629eae611334c65a12c735d52c21", "score": "0.54105395", "text": "function countElements(ax, ay, bx, by, cx, cy) {\n const mx = (ax + bx) >> 1;\n const my = (ay + by) >> 1;\n\n var err = errors[my * size + mx];\n if (Math.abs(ax - cx) + Math.abs(ay - cy) > 1 && err > maxError) {\n countElements(cx, cy, ax, ay, mx, my);\n countElements(bx, by, cx, cy, mx, my);\n } else {\n indices[ay * size + ax] = indices[ay * size + ax] || ++numVertices;\n indices[by * size + bx] = indices[by * size + bx] || ++numVertices;\n indices[cy * size + cx] = indices[cy * size + cx] || ++numVertices;\n numTriangles++;\n }\n }", "title": "" }, { "docid": "6e12ec728b7909f012111dd322139799", "score": "0.54081476", "text": "count() {\n let n = 0;\n for (const group of this.groups) {\n n += group[1].elements.length;\n }\n return n;\n }", "title": "" }, { "docid": "6e12ec728b7909f012111dd322139799", "score": "0.54081476", "text": "count() {\n let n = 0;\n for (const group of this.groups) {\n n += group[1].elements.length;\n }\n return n;\n }", "title": "" }, { "docid": "58fbca739fb91555d8d5a03a7af9eea2", "score": "0.53938276", "text": "function polyArea(points) {\n // debugger;\n let p1, p2;\n for (var area = 0, len = points.length, i = 0; i < len; ++i) {\n p1 = points[i];\n p2 = points[(i - 1 + len) % len]; // Previous point, with wraparound\n area += (p2.x + p1.x) * (p2.y - p1.y);\n }\n return Math.abs(area / 2);\n }", "title": "" }, { "docid": "863f6e2d93a7a8ea4fc3421723d5b3be", "score": "0.53928816", "text": "function getHoleIndices(complexPolygon) {\n var holeIndices = null;\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__lib_utils__[\"c\" /* count */])(complexPolygon) > 1) {\n var polygonStartIndex = 0;\n holeIndices = [];\n complexPolygon.forEach(function (polygon) {\n polygonStartIndex += __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__lib_utils__[\"c\" /* count */])(polygon);\n holeIndices.push(polygonStartIndex);\n });\n // Last element points to end of the flat array, remove it\n holeIndices.pop();\n }\n return holeIndices;\n}", "title": "" }, { "docid": "9e0fe5e1ac4623d37cf38bfebc10573a", "score": "0.5386915", "text": "function getNumberGraphicsFeatures(center, visual_version) {\n\n // Reset variables\n puntosArrayGraphics = new Array();\n lineasArrayGraphics = new Array();\n poligonosArrayGraphics = new Array();\n\n var featuresArray = new Array(); //templatePicker.featureLayers;\n featuresArray.push(pointServiceLayer);\n featuresArray.push(LineServiceLayer);\n featuresArray.push(PolygonServiceLayer);\n\n var campoVisual = \"\";\n\n if (objectType.toLowerCase() == \"vo\") {\n campoVisual = \"FK_GEO_VISUAL_OUTPUT_ID\"; //This field corresponding to visual project id \n } else {\n campoVisual = \"FK_GEO_VISUAL_PROJECT_ID\"; //This field corresponding to visual version id \n }\n\n\n if (visual_version != -1 && visual_version != undefined) {\n var whereStatement = campoVisual + \" = \" + visual_version;\n\n for (var i = 0; i < featuresArray.length; i++) {\n var featureItem = featuresArray[i];\n var geometryType = featureItem.geometryType;\n\n switch (geometryType) {\n case \"esriGeometryPoint\":\n getNumObjectsFeature(pointServiceLayer, whereStatement, 0, center);\n break;\n case \"esriGeometryPolyline\":\n getNumObjectsFeature(LineServiceLayer, whereStatement, 1, center);\n break;\n case \"esriGeometryPolygon\":\n getNumObjectsFeature(PolygonServiceLayer, whereStatement, 2, center);\n break;\n }\n }\n } else {\n puntosArrayGraphics = new Array();\n lineasArrayGraphics = new Array();\n poligonosArrayGraphics = new Array();\n }\n}", "title": "" }, { "docid": "1c82e28a87f4b6943012ac8a219e0e2f", "score": "0.53851676", "text": "function splitPolygon (geoPts)\r\n{\r\n var retPolys = []\r\n \r\n}", "title": "" }, { "docid": "1c82e28a87f4b6943012ac8a219e0e2f", "score": "0.53851676", "text": "function splitPolygon (geoPts)\r\n{\r\n var retPolys = []\r\n \r\n}", "title": "" }, { "docid": "d08ada3b338d7a2ddb4d3a7395e66043", "score": "0.5358198", "text": "function getExcitedElementsTotal(coordsArray, xasElements) {\n // does not handle full regex\n var numNodes = 0;\n for (i in xasElements) {\n\tatoms = \"\" + xasElements[i];\n\tif (atoms.match(/^[a-zA-Z]{1,2}\\d+$/) != null) {//C6 type\n\t numNodes++;\n\t}\n\telse {//C Type\n\t for (j in coordsArray) {\n\t\tif (coordsArray[j].split(\" \")[0] == atoms)\n\t\t numNodes++;\n\t }\n\t}\n }\n return numNodes;\n}", "title": "" }, { "docid": "44ec6717ec9140be43a1edc425989e51", "score": "0.53426206", "text": "function countVertices(cells) {\n var vc = -1\n , max = Math.max\n for(var i=0, il=cells.length; i<il; ++i) {\n var c = cells[i]\n for(var j=0, jl=c.length; j<jl; ++j) {\n vc = max(vc, c[j])\n }\n }\n return vc+1\n}", "title": "" }, { "docid": "44ec6717ec9140be43a1edc425989e51", "score": "0.53426206", "text": "function countVertices(cells) {\n var vc = -1\n , max = Math.max\n for(var i=0, il=cells.length; i<il; ++i) {\n var c = cells[i]\n for(var j=0, jl=c.length; j<jl; ++j) {\n vc = max(vc, c[j])\n }\n }\n return vc+1\n}", "title": "" }, { "docid": "44ec6717ec9140be43a1edc425989e51", "score": "0.53426206", "text": "function countVertices(cells) {\n var vc = -1\n , max = Math.max\n for(var i=0, il=cells.length; i<il; ++i) {\n var c = cells[i]\n for(var j=0, jl=c.length; j<jl; ++j) {\n vc = max(vc, c[j])\n }\n }\n return vc+1\n}", "title": "" }, { "docid": "963ee15b509d999012799aec09d4a596", "score": "0.5334514", "text": "function getPolygonOffsets(polygons) {\n var offsets = new Array(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__lib_utils__[\"c\" /* count */])(polygons) + 1);\n offsets[0] = 0;\n var offset = 0;\n polygons.forEach(function (polygon, i) {\n offset += __WEBPACK_IMPORTED_MODULE_0__polygon__[\"b\" /* getVertexCount */](polygon);\n offsets[i + 1] = offset;\n });\n return offsets;\n}", "title": "" }, { "docid": "964367a8b12009088eaad6b484b18a64", "score": "0.53159404", "text": "function POLYPOINT (points) {\n\t//return SIMPLICIAL_COMPLEX(points)([[0],[1],[2],[3],[4]]);\n\t return SIMPLICIAL_COMPLEX(points)(points.map(function(p,i){\treturn[i];\t}));\n}", "title": "" }, { "docid": "0d100c7325e8633e64adf08362172744", "score": "0.5315096", "text": "function countVertices(cells) {\n var vc = -1\n , max = Math.max;\n for(var i=0, il=cells.length; i<il; ++i) {\n var c = cells[i];\n for(var j=0, jl=c.length; j<jl; ++j) {\n vc = max(vc, c[j])\n }\n }\n return vc+1\n}", "title": "" }, { "docid": "0d100c7325e8633e64adf08362172744", "score": "0.5315096", "text": "function countVertices(cells) {\n var vc = -1\n , max = Math.max;\n for(var i=0, il=cells.length; i<il; ++i) {\n var c = cells[i];\n for(var j=0, jl=c.length; j<jl; ++j) {\n vc = max(vc, c[j])\n }\n }\n return vc+1\n}", "title": "" }, { "docid": "8195efef7e8a86d917c63f0911dca591", "score": "0.5311785", "text": "getVerticesCount(model) {\n return $('.f').length;\n }", "title": "" }, { "docid": "4926d0428d4e56fd9817c61bbc8eddb1", "score": "0.52798814", "text": "function countParams(x) {\n var shape = x.shape;\n if (shape.length > 0) {\n return shape.reduce(function (a, b) { return a * b; });\n }\n else {\n // Scalar.\n return 1;\n }\n}", "title": "" }, { "docid": "f6227d41f11a05229c7732e78b524208", "score": "0.5277253", "text": "function countFacets(input) {\n return input.length;\n}", "title": "" }, { "docid": "eb9567a4e4255ae763a8a9864170451e", "score": "0.5275634", "text": "function countParams(x) {\n const shape = x.shape;\n if (shape.length > 0) {\n return shape.reduce((a, b) => a * b);\n }\n else {\n // Scalar.\n return 1;\n }\n}", "title": "" }, { "docid": "6109dbc6d25b5f673682eb6abcae1961", "score": "0.5272848", "text": "function polygons(\n prefix, sides, color, count, startPosition, startRadius, startAngle, startRotation,\n) {\n // Calculate polygon radius from side length\n const radius = sideLength / 2 / Math.sin(Math.PI / sides);\n // Create the polygons\n const shapes = [];\n for (let i = 0; i < count; i += 1) {\n const sAng = (startAngle - 1) * halfAng * 2 + halfAng + i * Math.PI * 2 / 6;\n const solutionPosition = [\n startRadius * Math.cos(sAng), startRadius * Math.sin(sAng),\n ];\n const solutionRotation = startRotation + i * Math.PI * 2 / 6;\n shapes.push(makePolygon(`polygon${prefix}${sides}_${i}`, radius, color, sides, startPosition, solutionPosition, solutionRotation));\n }\n return shapes;\n}", "title": "" }, { "docid": "3f1d10d9f35dd5785c057f45b9c5e2de", "score": "0.5253648", "text": "function getPerimeter(districtsGeoJson) {\n\n $.grep(districtsGeoJson.features, function (feature) {\n var peri = 0;\n\n if (feature.geometry.type === \"Polygon\") {\n\n peri = turf.lineDistance(turf.lineString(feature.geometry.coordinates[0]))\n\n } else if (feature.geometry.type === \"MultiPolygon\") {\n\n var array = feature.geometry.coordinates;\n\n for (i = 0; i < array.lengthl; i++) {\n peri += turf.lineDistance(turf.lineString(feature.geometry.coordinates[i]));\n }\n\n }\n console.log(\"perimeter: \" + peri + \" kilometers\");\n });\n\n}", "title": "" }, { "docid": "c650c0ecaa257fd4549c82ff6f5ee34c", "score": "0.52435815", "text": "function getNumberOfRooms(){\r\n roomLen = inputRoom.rooms[0].length; // along z\r\n roomBre = inputRoom.rooms.length; // along x\r\n roomList = [];\r\n for (var l = 0 ; l < roomLen; l++){\r\n for(var b = 0; b < roomBre; b++) {\r\n if( Number.isInteger(inputRoom.rooms[b][l]) ) {\r\n if( !roomList.includes(inputRoom.rooms[b][l]) ){\r\n roomList.push(inputRoom.rooms[b][l]);\r\n }\r\n }\r\n // get portals along with it\r\n if( inputRoom.rooms[b][l] == \"p\"){\r\n // console.log(\"p @: \" + b + \" \" + l);\r\n portals.push([\r\n //Right face\r\n [(b+1)*wallBredth-deltaBre, 0, l*wallLength-deltaLen],\r\n [(b+1)*wallBredth-deltaBre, 0, (l+1)*wallLength-deltaLen],\r\n [(b+1)*wallBredth-deltaBre, 1, (l+1)*wallLength-deltaLen],\r\n [(b+1)*wallBredth-deltaBre, 1, l*wallLength-deltaLen],\r\n //LeftFace\r\n [b*wallBredth-deltaBre, 0, l*wallLength-deltaLen],\r\n [b*wallBredth-deltaBre, 0, (l+1)*wallLength-deltaLen],\r\n [b*wallBredth-deltaBre, 1, (l+1)*wallLength-deltaLen],\r\n [b*wallBredth-deltaBre, 1, l*wallLength-deltaLen]\r\n ]);\r\n }\r\n }\r\n }\r\n // console.log(portals);\r\n return roomList.length;\r\n}", "title": "" }, { "docid": "4134187c78b6fa7a1f5d724b48c04522", "score": "0.5208724", "text": "function getHoleIndices(complexPolygon) {\n var holeIndices = null;\n if (complexPolygon.length > 1) {\n var polygonStartIndex = 0;\n holeIndices = [];\n complexPolygon.forEach(function (polygon) {\n polygonStartIndex += polygon.length;\n holeIndices.push(polygonStartIndex);\n });\n // Last element points to end of the flat array, remove it\n holeIndices.pop();\n }\n return holeIndices;\n}", "title": "" }, { "docid": "0ac180eea02d26c3d44a6f7bab936adb", "score": "0.520827", "text": "function getVertexCount(_ref6) {\n var drawMode = _ref6.drawMode,\n vertexCount = _ref6.vertexCount;\n\n var primitiveCount = getPrimitiveCount({ drawMode: drawMode, vertexCount: vertexCount });\n switch (drawMode) {\n case __WEBPACK_IMPORTED_MODULE_0__gl_constants__[\"a\" /* default */].POINTS:\n return primitiveCount;\n case __WEBPACK_IMPORTED_MODULE_0__gl_constants__[\"a\" /* default */].LINES:\n case __WEBPACK_IMPORTED_MODULE_0__gl_constants__[\"a\" /* default */].LINE_STRIP:\n case __WEBPACK_IMPORTED_MODULE_0__gl_constants__[\"a\" /* default */].LINE_LOOP:\n return vertexCount * 2;\n case __WEBPACK_IMPORTED_MODULE_0__gl_constants__[\"a\" /* default */].TRIANGLES:\n case __WEBPACK_IMPORTED_MODULE_0__gl_constants__[\"a\" /* default */].TRIANGLE_STRIP:\n case __WEBPACK_IMPORTED_MODULE_0__gl_constants__[\"a\" /* default */].TRIANGLE_FAN:\n return vertexCount * 3;\n default:\n __WEBPACK_IMPORTED_MODULE_3_assert___default()(false);return 0;\n }\n}", "title": "" }, { "docid": "83bc4dbb9bafbc19c19675197367cbe9", "score": "0.52009153", "text": "function countBagsInside(bag_refs) {\n if (bag_refs.length === 0) {\n return 1;\n }\n\n const resolved_bags = bag_refs\n .map(bag => [bag.count, bags.find(({color}) => color === bag.color)])\n\n\n const count = resolved_bags\n .reduce((acc, [bag_count, bag]) => acc + bag_count * countBagsInside(bag.bags_inside), 1)\n\n return count;\n}", "title": "" }, { "docid": "e8fc7a169104fc58c6982fb4836000b7", "score": "0.5192825", "text": "function crossCount(g,layering){var cc=0;for(var i=1;i<layering.length;++i){cc+=twoLayerCrossCount(g,layering[i-1],layering[i]);}return cc;}", "title": "" }, { "docid": "dce9299303b5b81ec2aa9c1c14670638", "score": "0.51850927", "text": "function californiaDevelopers (list) {\n let count = 0\n for (let i = 0; i < list.length; i++) {\n if (list[i].state === 'CA') {\n count += 1\n }\n }\n console.log(count)\n}", "title": "" }, { "docid": "22bc24a585d3c16595f39750d17706f1", "score": "0.51753116", "text": "function count(map) {\n\treturn map._size;\n}", "title": "" }, { "docid": "9e317d6d189c73907e47656fad7bdc6a", "score": "0.5169549", "text": "function crossCount(g,layering){var cc=0;for(var i=1;i<layering.length;++i){cc+=twoLayerCrossCount(g,layering[i-1],layering[i])}return cc}", "title": "" }, { "docid": "9e317d6d189c73907e47656fad7bdc6a", "score": "0.5169549", "text": "function crossCount(g,layering){var cc=0;for(var i=1;i<layering.length;++i){cc+=twoLayerCrossCount(g,layering[i-1],layering[i])}return cc}", "title": "" }, { "docid": "79a284943cb481ae19bb716967d18a4c", "score": "0.5169516", "text": "numVisited() {\n let count = 0;\n for (let i = 0; i < this.vertices.length; i += 1) {\n let v = this.vertices[i];\n if (v.beenVisited()) {\n count += 1;\n }\n }\n return count;\n }", "title": "" }, { "docid": "6263d30f717184c435b551aaa655d1be", "score": "0.51587385", "text": "numFigures(){\n for (let row of this.fields) {\n for (let field of row) {\n if (!field.isOccupied){\n this.numEmptyFields++;\n }\n }\n }\n }", "title": "" }, { "docid": "d21bc4d0a5453879b9792f881dd90e86", "score": "0.514535", "text": "buildPolygons () { return 0; }", "title": "" }, { "docid": "8dbd6ae5632a7519a26154fd37f767a6", "score": "0.51436055", "text": "function count(xs) {\n return Array.isArray(xs) || ArrayBuffer.isView(xs)\n ? xs.length\n : fold(function (acc, x) { return acc + 1; }, 0, xs);\n}", "title": "" }, { "docid": "aa2fb883747538a525fabd13793fc56e", "score": "0.51372397", "text": "numVertices() {\n \treturn this.vertices.length\n }", "title": "" }, { "docid": "70933cf13c244fa35d1bba8a9f73b978", "score": "0.51320374", "text": "function count_dirty_spots_cleaned(dirty_spots,clean_coordinates){\n\tvar count = 0;\n\tvar clean_x_coordinate;\n\tvar clean_y_coordinate;\n\tvar dirty_x_coordinate;\n\tvar dirty_y_coordinate;\n\ti = 0;\n\twhile(i<dirty_spots.length){\n\t\tj = 0;\n\t\tdirty_x_coordinate = dirty_spots[i][0];\n\t\tdirty_y_coordinate = dirty_spots[i][1];\n\t\twhile(j<clean_coordinates.length){\n\t\t\tclean_x_coordinate = clean_coordinates[j][0];\n\t\t\tclean_y_coordinate = clean_coordinates[j][1];\t\n\t\t\t//when both x and y coordinates are equal, increase the count and i variables and break out of the inner while loop\n\t\t\tif(dirty_x_coordinate==clean_x_coordinate&&dirty_y_coordinate==clean_y_coordinate){\n\t\t\t\tcount++;\n\t\t\t\ti++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tj++;\n\t\t}\n\t\ti++;\n\t}\n\treturn count;\n}", "title": "" }, { "docid": "2ef1946b4d9fedeab1589eb10f4c0945", "score": "0.5125285", "text": "function isInPoly(vertices, point) {\n var nvert = vertices.length;\n var i, j, c = 0;\n for (i = 0, j = nvert-1; i < nvert; j = i++) {\n if ( ((vertices[i].y>point.y) != (vertices[j].y>point.y)) &&\n (point.x < (vertices[j].x-vertices[i].x) * (point.y-vertices[i].y) / (vertices[j].y-vertices[i].y) + vertices[i].x) )\n c = !c;\n }\n return c;\n}", "title": "" }, { "docid": "003167b0dbe04e9dca10eb2c44777291", "score": "0.51231754", "text": "function countTotalPoints() {\r\n var total = 0 ;\r\n for (i=1; i<= 10; i++) {\r\n var two_potential_value = Math.pow(2,i);\r\n eval(\"var points\"+i+\" = \"+two_potential_value+\"* $(\\\"div.tile-\"+two_potential_value+\":not([class~='tile-merged'])\\\").size();\");\r\n eval(\"total += points\"+i+\";\");\r\n }\r\n return total;\r\n}", "title": "" }, { "docid": "9e350d61ed44bc80338e7bae1eb8f24c", "score": "0.5119781", "text": "function contours() {\n var dx = 1,\n dy = 1,\n smooth = smoothLinear;\n\n function contours(values, tz) {\n return tz.map(value => contour(values, value));\n } // Accumulate, smooth contour rings, assign holes to exterior rings.\n // Based on https://github.com/mbostock/shapefile/blob/v0.6.2/shp/polygon.js\n\n\n function contour(values, value) {\n var polygons = [],\n holes = [];\n isorings(values, value, ring => {\n smooth(ring, values, value);\n if (area(ring) > 0) polygons.push([ring]);else holes.push(ring);\n });\n holes.forEach(hole => {\n for (var i = 0, n = polygons.length, polygon; i < n; ++i) {\n if (contains((polygon = polygons[i])[0], hole) !== -1) {\n polygon.push(hole);\n return;\n }\n }\n });\n return {\n type: 'MultiPolygon',\n value: value,\n coordinates: polygons\n };\n } // Marching squares with isolines stitched into rings.\n // Based on https://github.com/topojson/topojson-client/blob/v3.0.0/src/stitch.js\n\n\n function isorings(values, value, callback) {\n var fragmentByStart = new Array(),\n fragmentByEnd = new Array(),\n x,\n y,\n t0,\n t1,\n t2,\n t3; // Special case for the first row (y = -1, t2 = t3 = 0).\n\n x = y = -1;\n t1 = values[0] >= value;\n cases[t1 << 1].forEach(stitch);\n\n while (++x < dx - 1) {\n t0 = t1, t1 = values[x + 1] >= value;\n cases[t0 | t1 << 1].forEach(stitch);\n }\n\n cases[t1 << 0].forEach(stitch); // General case for the intermediate rows.\n\n while (++y < dy - 1) {\n x = -1;\n t1 = values[y * dx + dx] >= value;\n t2 = values[y * dx] >= value;\n cases[t1 << 1 | t2 << 2].forEach(stitch);\n\n while (++x < dx - 1) {\n t0 = t1, t1 = values[y * dx + dx + x + 1] >= value;\n t3 = t2, t2 = values[y * dx + x + 1] >= value;\n cases[t0 | t1 << 1 | t2 << 2 | t3 << 3].forEach(stitch);\n }\n\n cases[t1 | t2 << 3].forEach(stitch);\n } // Special case for the last row (y = dy - 1, t0 = t1 = 0).\n\n\n x = -1;\n t2 = values[y * dx] >= value;\n cases[t2 << 2].forEach(stitch);\n\n while (++x < dx - 1) {\n t3 = t2, t2 = values[y * dx + x + 1] >= value;\n cases[t2 << 2 | t3 << 3].forEach(stitch);\n }\n\n cases[t2 << 3].forEach(stitch);\n\n function stitch(line) {\n var start = [line[0][0] + x, line[0][1] + y],\n end = [line[1][0] + x, line[1][1] + y],\n startIndex = index(start),\n endIndex = index(end),\n f,\n g;\n\n if (f = fragmentByEnd[startIndex]) {\n if (g = fragmentByStart[endIndex]) {\n delete fragmentByEnd[f.end];\n delete fragmentByStart[g.start];\n\n if (f === g) {\n f.ring.push(end);\n callback(f.ring);\n } else {\n fragmentByStart[f.start] = fragmentByEnd[g.end] = {\n start: f.start,\n end: g.end,\n ring: f.ring.concat(g.ring)\n };\n }\n } else {\n delete fragmentByEnd[f.end];\n f.ring.push(end);\n fragmentByEnd[f.end = endIndex] = f;\n }\n } else if (f = fragmentByStart[endIndex]) {\n if (g = fragmentByEnd[startIndex]) {\n delete fragmentByStart[f.start];\n delete fragmentByEnd[g.end];\n\n if (f === g) {\n f.ring.push(end);\n callback(f.ring);\n } else {\n fragmentByStart[g.start] = fragmentByEnd[f.end] = {\n start: g.start,\n end: f.end,\n ring: g.ring.concat(f.ring)\n };\n }\n } else {\n delete fragmentByStart[f.start];\n f.ring.unshift(start);\n fragmentByStart[f.start = startIndex] = f;\n }\n } else {\n fragmentByStart[startIndex] = fragmentByEnd[endIndex] = {\n start: startIndex,\n end: endIndex,\n ring: [start, end]\n };\n }\n }\n }\n\n function index(point) {\n return point[0] * 2 + point[1] * (dx + 1) * 4;\n }\n\n function smoothLinear(ring, values, value) {\n ring.forEach(point => {\n var x = point[0],\n y = point[1],\n xt = x | 0,\n yt = y | 0,\n v0,\n v1 = values[yt * dx + xt];\n\n if (x > 0 && x < dx && xt === x) {\n v0 = values[yt * dx + xt - 1];\n point[0] = x + (value - v0) / (v1 - v0) - 0.5;\n }\n\n if (y > 0 && y < dy && yt === y) {\n v0 = values[(yt - 1) * dx + xt];\n point[1] = y + (value - v0) / (v1 - v0) - 0.5;\n }\n });\n }\n\n contours.contour = contour;\n\n contours.size = function (_) {\n if (!arguments.length) return [dx, dy];\n\n var _0 = Math.floor(_[0]),\n _1 = Math.floor(_[1]);\n\n if (!(_0 >= 0 && _1 >= 0)) (0, _vegaUtil.error)('invalid size');\n return dx = _0, dy = _1, contours;\n };\n\n contours.smooth = function (_) {\n return arguments.length ? (smooth = _ ? smoothLinear : noop, contours) : smooth === smoothLinear;\n };\n\n return contours;\n}", "title": "" }, { "docid": "a21402b1af2902883eaddfb91eb48ecc", "score": "0.5119638", "text": "function californiaAries (list) {\n let count = 0\n for (let i = 0; i < list.length; i++) {\n if (list[i].state === 'CA' && list[i].zodiacSign === 'Aries') {\n count += 1\n }\n }\n console.log(count)\n}", "title": "" }, { "docid": "c49a45eae42fb6c1fa378dda584a7c66", "score": "0.511076", "text": "function polygonal_surface_intersection()\n{\n //TODO\n}", "title": "" }, { "docid": "33ae76b25a634ebb05afe377eaa34904", "score": "0.5110428", "text": "function _getTotalAreaOf(googleMapPolygon, mapRelatedService) {\n var paths = googleMapPolygon.getPaths();\n var i = 0;\n var sum = 0;\n var pathslen = paths.getLength();\n for( i = 0; i < pathslen; i++){\n if (i === 0){\n sum = Math.abs(mapRelatedService.spherical.computeSignedArea(paths.getAt(i)) );\n }else {\n sum -= Math.abs(mapRelatedService.spherical.computeSignedArea(paths.getAt(i)) );\n }\n }\n // console.log(sum);\n return sum;\n }", "title": "" }, { "docid": "1ffef7130251b3288922fdeaf2a9d789", "score": "0.5091359", "text": "function area(points) {\n\t\tvar area = 0;\n\t\tvar j = points.length - 1;\n\n\t\tfor (var i = 0; i < points.length; j = i++) {\n\t\t\tvar pi = points[i];\n\t\t\tvar pj = points[j];\n\t\t\tarea += (pj.x + pi.x) * (pj.y - pi.y)\n\t\t}\n\n\t\treturn area / 2;\n\t}", "title": "" }, { "docid": "f9ee2f550bcd218b81f9624597b187bb", "score": "0.5077445", "text": "function countEuropeanJavascriptDevs(list) {\n var noOfEuropeanJavascriptsDevs = 0;\n for (var i = 0; i < list.length; i++) {\n var currentPerson = list[i];\n // { firstName: 'Noah', lastName: 'M.', country: 'Switzerland', continent: 'Europe', age: 19, language: 'JavaScript' },\n if (\n currentPerson.continent === \"Europe\" &&\n currentPerson.language === \"JavaScript\"\n ) {\n noOfEuropeanJavascriptsDevs = noOfEuropeanJavascriptsDevs + 1;\n }\n }\n return noOfEuropeanJavascriptsDevs;\n}", "title": "" }, { "docid": "95fc0088caae74433ac15d545c81aa91", "score": "0.50691396", "text": "function modelToPolygon0(model,unicode,x1,y1,x2,y2) {\n let modelRef = model[unicode]['onRefs'];\n let modelOff = model[unicode]['onOffsets'];\n let modelCon = model[unicode]['onContourIndices'];\n let polygon = [];\n let contour = [];\n let arrCount = 0;\n let xCount = 0;\n\n var map = {};\n for (var i=0;i<modelCon.length;i++) {\n if (typeof(map[modelCon[i]])==\"undefined\") {\n map[modelCon[i]] = 1;\n } else {\n map[modelCon[i]] = map[modelCon[i]] + 1;\n }\n }\n // console.log(map);\n\n var obj = {};\n for(let i=0; i <= Object.getOwnPropertyNames(map).length; i++){\n obj['arr'+i] = [];\n }\n \n let a = (512 / (x2 - x1));\n let b = (512 / (y2 - y1));\n for (let i = 0; i < modelCon.length; i++) {\n // [x,y] \n let x = []; \n x[0] = modelRef[i][0]/a + x1 + stroke_width*modelOff[i][0];\n x[1] = modelRef[i][1]/b + y1 + stroke_width*modelOff[i][1];\n obj['arr'+arrCount][xCount] = x;\n if (modelCon[i]!==modelCon[i+1]) {\n polygon[arrCount] = obj['arr'+arrCount];\n // let contour = [];\n arrCount++;\n xCount = 0;\n // console.log(arrCount);\n }\n else{\n xCount++;\n }\n }\n // console.log(polygon);\n return polygon;\n}", "title": "" }, { "docid": "9f18c2fc7d1318e14ecae1363122b8fa", "score": "0.50677353", "text": "function countTuplets(note, location) {\n\t\t return note.tupletStack.filter(function (tuplet) {\n\t\t return tuplet.location === location;\n\t\t }).length;\n\t\t }", "title": "" }, { "docid": "99fa81113a37e9fcc0b95fcf2d8592ba", "score": "0.5061886", "text": "function count(xs) {\n return Array.isArray(xs) || ArrayBuffer.isView(xs) ? xs.length : fold$1((acc, x) => acc + 1, 0, xs);\n}", "title": "" }, { "docid": "9cd071088585e07bc7035fc6d4cc4092", "score": "0.5052676", "text": "function pathLength(points) {\n\t var d = 0.0;\n\n\t for (var i = 1; i < points.length; ++i) {\n\t if (points[i].strokeId === points[i - 1].strokeId) {\n\t d += distance(points[i - 1], points[i]);\n\t }\n\t }\n\n\t return d;\n\t}", "title": "" }, { "docid": "a9293771af3680a1e92dc4edbd6a582b", "score": "0.505136", "text": "function getAreas(districtsGeoJson) {\n\n $.grep(districtsGeoJson.features, function (feature) {\n var poly;\n if (feature.geometry.type === \"Polygon\")\n poly = turf.polygon(feature.geometry.coordinates);\n else if (feature.geometry.type === \"MultiPolygon\")\n poly = turf.multiPolygon(feature.geometry.coordinates);\n console.log(\"area: \" + turf.area(poly) / 1000000 + \" square kilometers\");\n });\n}", "title": "" }, { "docid": "e8ea14a61679f513eabd1f89a9773508", "score": "0.5047958", "text": "function isInPolygon(checkPoint, polygonPoints) { \n var counter = 0; \n var i; \n var xinters; \n var p1, p2; \n var pointCount = polygonPoints.length; \n p1 = polygonPoints[0]; \n \n for (i = 1; i <= pointCount; i++) { \n p2 = polygonPoints[i % pointCount]; \n if ( \n checkPoint[0] > Math.min(p1[0], p2[0]) && \n checkPoint[0] <= Math.max(p1[0], p2[0]) \n ) { \n if (checkPoint[1] <= Math.max(p1[1], p2[1])) { \n if (p1[0] != p2[0]) { \n xinters = \n (checkPoint[0] - p1[0]) * \n (p2[1] - p1[1]) / \n (p2[0] - p1[0]) + \n p1[1]; \n if (p1[1] == p2[1] || checkPoint[1] <= xinters) { \n counter++; \n } \n } \n } \n } \n p1 = p2; \n } \n if (counter % 2 == 0) {\n return false; \n } else { \n return true; \n } \n}", "title": "" }, { "docid": "2953867b11bd63a260a2ff4de1c4aa8c", "score": "0.5041657", "text": "function localCount(sum, data, ...coords) {\n const c0 = Math.max(0, coords[0]-1)\n const cN = Math.min(coords[0]+2, data.length);\n\n data = data.slice(c0, cN);\n // console.log(' coords', coords);\n // displayHyperCube(data)\n\n if (coords.length > 1) {\n return data.reduce((sum, datum) =>\n localCount(sum, datum, ...coords.slice(1)), sum);\n } else {\n return data.reduce((sum, cell) => sum + cell, sum);\n }\n}", "title": "" }, { "docid": "53161473522fd8da03e48fe2ee57b3f2", "score": "0.5041049", "text": "function aryCount( ary )\n{\n var count = 0;\n \n ary.forEach(function(element) \n {\n if(element)\n {\n count++;\n }\n });\n return count;\n}", "title": "" }, { "docid": "7398a3b19bb559c9c8fdb605ed5a444f", "score": "0.50371116", "text": "for (let i = 0; i < line.length; ++i) {\n if (!pointWithinPolygon(line[i], polygon)) {\n return false;\n }\n }", "title": "" }, { "docid": "89425820e7930f514ccda0b6c6abce94", "score": "0.50336576", "text": "getPolyCoords(geojson) {\n let result = []\n geojson.forEach((top) => {\n top.forEach((middle) => {\n middle.forEach((bottom) => {\n bottom = new Array(bottom[1], bottom[0])\n result.push(bottom)\n })\n })\n })\n return result\n }", "title": "" }, { "docid": "b6d5b8ae6f2cd2dec4ea99c1027deaa8", "score": "0.50328594", "text": "function geometryExists(polygon) {\n if(polygon && \n polygon.geometry && \n polygon.geometry.coordinates && \n polygon.geometry.coordinates.length &&\n polygon.geometry.coordinates.length > 0\n ) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "d5001e0f6a14506f83e47ac5c756027e", "score": "0.5027461", "text": "function polyArea(poly) {\n let area = 0,\n pts = poly.points,\n len = pts.numberOfItems;\n for (let i = 0; i < len; ++i) {\n let p1 = pts.getItem(i),\n p2 = pts.getItem((i + len - 1) % len);\n area += (p2.x + p1.x) * (p2.y - p1.y);\n }\n return Math.abs(area / 2);\n }", "title": "" }, { "docid": "b09497eadba9ace0cca955056a17f545", "score": "0.5021788", "text": "function countProperties(obj){\n let count = 0;\n \n for (const el in obj ){\n count +=1\n }\n return count; \n}", "title": "" }, { "docid": "f6c0a121a53592db4db3e7717214cd5e", "score": "0.5006993", "text": "function pointArrayToPolygon(points) {\n points.push(points[0]);\n return turf.polygon([points.map(function(p) {\n return p.geometry.coordinates;\n })]);\n}", "title": "" }, { "docid": "8624c19e2a868f5d9c8579b3f57fd730", "score": "0.4983127", "text": "function createPoly(){\n let polyPoints =[]\n\n polygonLayer.clearLayers();\n\n deviceArray.forEach(device => { \n var latlng = L.latLng(device.lat, device.lng)\n polyPoints.push(latlng)\n });\n polygon = L.polygon(polyPoints, {color: 'green'});\n polygon.addTo(polygonLayer);\n}", "title": "" }, { "docid": "f0caa5b71345b18f0bfc45952f70828a", "score": "0.49750784", "text": "function uccount(check, list) {\n let result = [];\n let l = check.length;\n for (let i = 0; i < l; i++) {\n let h = list[i].length;\n let temp = [];\n let x = 0;\n let y = 0;\n for (let j = 0; j < h; j++) {\n temp.push({\n 'x': x,\n 'y': y,\n });\n if (check[i] !== 1) {\n y += list[i][j];\n }\n x += list[i][j];\n }\n result.push(temp);\n }\n return result;\n }", "title": "" }, { "docid": "29f410878462e6f0bcbeecc8cc9be17c", "score": "0.49750218", "text": "makePolygon(points) {\n\t\tif (!Array.isArray(points) || points.length < 1) {\n\t\t\tchao.log(\"makePolygon: points param is not an array or has no elements. :(\");\n\t\t\treturn;\n\t\t}\n\n\t\tvar i;\n\n\t\tif (typeof points[0] != \"object\") {\n\t\t\tvar newPoints = [];\n\t\t\tfor (i = 0; i < points.length / 2; ++i) {\n\t\t\t\tnewPoints.push({\n\t\t\t\t\tx: points[i * 2],\n\t\t\t\t\ty: points[i * 2 + 1]\n\t\t\t\t});\n\t\t\t}\n\t\t\tpoints = newPoints;\n\t\t}\n\n\t\tvar left = Number.MAX_VALUE;\n\t\tvar right = -Number.MAX_VALUE;\n\t\tvar top = Number.MAX_VALUE;\n\t\tvar bottom = -Number.MAX_VALUE;\n\n\t\tfor (i = 0; i < points.length; ++i) {\n\t\t\tif (points[i].x < left) left = points[i].x;\n\t\t\tif (points[i].x > right) right = points[i].x;\n\t\t\tif (points[i].y < top) top = points[i].y;\n\t\t\tif (points[i].y > bottom) bottom = points[i].y;\n\t\t}\n\n\t\treturn {\n\t\t\tpoints: points,\n\t\t\tleft: left,\n\t\t\tright: right,\n\t\t\ttop: top,\n\t\t\tbottom: bottom,\n\n\t\t\tintersects(otherPoly) {\n\t\t\t\tvar polys = [this, otherPoly];\n\t\t\t\tvar i1, pi, point, projected;\n\t\t\t\tfor (var i = 0; i < polys.length; ++i) {\n\t\t\t\t\tvar polygon = polys[i];\n\n\t\t\t\t\tfor (i1 = 0; i1 < polygon.points.length; i1++) {\n\t\t\t\t\t\tvar i2 = (i1 + 1) % polygon.points.length;\n\t\t\t\t\t\tvar p1 = polygon.points[i1];\n\t\t\t\t\t\tvar p2 = polygon.points[i2];\n\n\t\t\t\t\t\tvar normal = chao.makeVector2(p2.y - p1.y, p1.x - p2.x);\n\n\t\t\t\t\t\tvar minA = null,\n\t\t\t\t\t\t\tmaxA = null;\n\t\t\t\t\t\tfor (pi = 0; pi < this.points.length; ++pi) {\n\t\t\t\t\t\t\tpoint = this.points[pi];\n\t\t\t\t\t\t\tprojected = normal.x * point.x + normal.y * point.y;\n\t\t\t\t\t\t\tif (minA === null || projected < minA)\n\t\t\t\t\t\t\t\tminA = projected;\n\t\t\t\t\t\t\tif (maxA === null || projected > maxA)\n\t\t\t\t\t\t\t\tmaxA = projected;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar minB = null,\n\t\t\t\t\t\t\tmaxB = null;\n\t\t\t\t\t\tfor (pi = 0; pi < otherPoly.points.length; ++pi) {\n\t\t\t\t\t\t\tpoint = otherPoly.points[pi];\n\t\t\t\t\t\t\tprojected = normal.x * point.x + normal.y * point.y;\n\t\t\t\t\t\t\tif (minB === null || projected < minB)\n\t\t\t\t\t\t\t\tminB = projected;\n\t\t\t\t\t\t\tif (maxB === null || projected > maxB)\n\t\t\t\t\t\t\t\tmaxB = projected;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (maxA < minB || maxB < minA)\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t},\n\n\t\t\tisPointInside(point) {\n\t\t\t\tif (point.x < this.left || point.x > this.right || point.y < this.top || point.y > this.bottom) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tvar intersections = 0;\n\t\t\t\tvar raycastOrigin = {\n\t\t\t\t\tx: this.left - 1,\n\t\t\t\t\ty: point.y\n\t\t\t\t};\n\t\t\t\tvar pointsNum = this.points.length;\n\t\t\t\tvar polyLineA;\n\t\t\t\tvar polyLineB;\n\n\t\t\t\tfor (var i = 0; i < pointsNum; ++i) {\n\t\t\t\t\tpolyLineA = this.points[i];\n\t\t\t\t\tpolyLineB = i === 0 ? this.points[pointsNum - 1] : this.points[i - 1];\n\n\t\t\t\t\tif (chao.getLinesIntersection(raycastOrigin, point, polyLineA, polyLineB) !== false) {\n\t\t\t\t\t\tintersections++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn intersections & 1 == 1;\n\t\t\t},\n\n\n\t\t};\n\t}", "title": "" }, { "docid": "6fab7272869c67f37023b8fc519a36b4", "score": "0.49724776", "text": "function extractPolygons(inputFile) {\n var stats = {\n matched: 0,\n errors: 0\n };\n\n var handlers = {\n filter: function filterCallback(area) {\n return !!(area.properties.boundary === 'administrative' && area.properties.admin_level);\n },\n area: function areaCallback(area) {\n stats.matched++;\n process.send({type: 'area', data: area});\n },\n error: function errorCallback(err) {\n stats.errors++;\n process.send({type: 'error', data: err});\n }\n };\n\n var areaBuilder = new OSMAreaBuilder(inputFile, path.extname(inputFile), handlers);\n\n areaBuilder.on('done', function (results) {\n process.send({\n type: 'done',\n data: {\n osmiumResults: results,\n areaTotal: results.areaCount,\n errorTotal: results.errorCount,\n areaMatched: stats.matched,\n errorMatched: stats.errors\n }\n });\n });\n\n areaBuilder.start();\n\n // process needs to be kill explicitly, otherwise it just hangs around\n process.exit();\n}", "title": "" }, { "docid": "ab72fb6cebbedef51e9c9e9b2b4ca6b5", "score": "0.4967889", "text": "function layerAreas (map, rc) {\n var points = window.polygon.map(function (point) {\n return rc.unproject([point.x, point.y])\n })\n var layerAreas = L.polygon([points])\n //map.addLayer(layerAreas)\n return layerAreas\n }", "title": "" }, { "docid": "180b47ba208faaea2bd0428805c9965e", "score": "0.49575913", "text": "function improvePoints(pts, n, extent) {\n\tn = n || 1;\n\textent = extent || defaultExtent;\n\tfor (var i = 0; i < n; i++) {\n\t\tpts = voronoi(pts, extent)\n\t\t.polygons(pts)\n\t\t.map(centroid);\n\t}\n\treturn pts;\n}", "title": "" }, { "docid": "31a96509b730cd0cda3b73d8dd5222f0", "score": "0.495158", "text": "function simplifyPolygon(points) {\n\t\tif (points.length < 4) {\n\t\t\treturn null;\n\t\t}\n\n\t\tvar slices = [];\n\t\tvar bestSlice = null;\n\t\tvar addPoint = null;\n\t\tfunction updateBestSlice(begin, end, intersection) {\n\t\t\tif (!bestSlice) {\n\t\t\t\t// First slice, so it's the best slice so far\n\t\t\t\tbestSlice = [begin, end];\n\t\t\t\taddPoint = intersection;\n\t\t\t} else {\n\t\t\t\t// Check if this slice overlaps a known intersecting slice\n\t\t\t\tvar overlaps = false;\n\t\t\t\tfor (var i = 0; i < slices.length; ++i) {\n\t\t\t\t\tif (begin <= slices[i][1] && slices[i][0] <= end) {\n\t\t\t\t\t\toverlaps = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!overlaps && (end - begin) > bestSlice[1] - bestSlice[0]) {\n\t\t\t\t\t/* Does not contain a subslice with an intersection, and\n\t\t\t\t\t contains more points than the best slice, so this is our\n\t\t\t\t\t new best slice. Using actual distance rather than\n\t\t\t\t\t number of points may make more sense here, but this\n\t\t\t\t\t seems to work well and is much less expensive. */\n\t\t\t\t\tbestSlice = [begin, end];\n\t\t\t\t\taddPoint = intersection;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add to slices list for overlap checking next time around\n\t\t\tslices.push([begin, end]);\n\t\t}\n\n\t\tfor (var i = 0; i < points.length - 3; ++i) {\n\t\t\tvar p0 = points[i];\n\t\t\tvar p1 = points[i + 1];\n\n\t\t\tvar foundIntersection = false;\n\t\t\tfor (var j = i + 2; j < points.length - 1 && !foundIntersection; ++j) {\n\t\t\t\tvar p2 = points[j];\n\t\t\t\tvar p3 = points[j + 1];\n\n\t\t\t\t// Check for an actual line intersection\n\t\t\t\tvar intersection = lineIntersection(p0, p1, p2, p3);\n\t\t\t\tif (intersection) {\n\t\t\t\t\tupdateBestSlice(i, j, intersection);\n\t\t\t\t\tfoundIntersection = true;\n\t\t\t\t} else if (j > i + 4) {\n\t\t\t\t\t// Check if endpoints are close enough to be considered intersecting\n\t\t\t\t\tif (distance(p0.x, p0.y, p2.x, p2.y) <= polyDistance) {\n\t\t\t\t\t\tupdateBestSlice(i, j, null);\n\t\t\t\t\t\tfoundIntersection = true;\n\t\t\t\t\t} else if (distance(p1.x, p1.y, p2.x, p2.y) <= polyDistance) {\n\t\t\t\t\t\tupdateBestSlice(i + 1, j, null);\n\t\t\t\t\t\tfoundIntersection = true;\n\t\t\t\t\t} else if (distance(p0.x, p0.y, p3.x, p3.y) <= polyDistance) {\n\t\t\t\t\t\tupdateBestSlice(i, j + 1, null);\n\t\t\t\t\t\tfoundIntersection = true;\n\t\t\t\t\t} else if (distance(p1.x, p1.y, p3.x, p3.y) <= polyDistance) {\n\t\t\t\t\t\tupdateBestSlice(i + 1, j + 1, null);\n\t\t\t\t\t\tfoundIntersection = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (foundIntersection) {\n\t\t\t\t// Found an intersection, so no point in checking overlapping intervals\n\t\t\t\ti = j;\n\t\t\t\tfoundIntersection = false;\n\t\t\t}\n\t\t}\n\n\t\tif (bestSlice) {\n\t\t\tvar poly = points.slice(bestSlice[0], bestSlice[1]);\n\t\t\tif (addPoint) {\n\t\t\t\tpoly.push(addPoint);\n\t\t\t}\n\t\t\treturn poly;\n\t\t}\n\n\t\treturn null;\n\t}", "title": "" }, { "docid": "67dec4e93b95b1055525b3916cde27ac", "score": "0.4949851", "text": "function getCompsCount(obj){\n\t\tvar size = 0, key;\n\t\tfor (key in obj) {\n\t\t\tif (obj.hasOwnProperty(key) && (key !== \"file\" || key !== \"windowMethod\")) size++;\n\t\t}\n\t\treturn size;\n\t}", "title": "" }, { "docid": "42d73e25e6ace80d147d4da16ea8c3d4", "score": "0.49451792", "text": "function bonusPoints(){\r\n var i = 0;\r\n subjects.forEach( subject => {\r\n countBonusPoints.forEach( extraPoint => {\r\n if( subject.title == extraPoint.id ){\r\n subject.parties.forEach( partie => {\r\n if(answers[i] == partie.position){\r\n partiesStartNull[partie.name]++;\r\n } \r\n });\r\n }\r\n });\r\n i++;\r\n });\r\n}", "title": "" } ]
82135042675ac7f98d44ba7f55f808e4
============================== Handle Input Change ==============================
[ { "docid": "5a02dbe4e0b152b2211f0f0181bb3dda", "score": "0.0", "text": "function handleInputChange(inputValue, actionMeta, onInputChange) {\n if (onInputChange) {\n var newValue = onInputChange(inputValue, actionMeta);\n if (typeof newValue === 'string') return newValue;\n }\n return inputValue;\n}", "title": "" } ]
[ { "docid": "db6fe823e9fd3549153928304f203a5f", "score": "0.77278125", "text": "function inputChangeHandler() {\n readAndValidateInputs.call(this);\n }", "title": "" }, { "docid": "165f1cb94bf2c7fcebfd4d99e7eb6546", "score": "0.76772946", "text": "onInputChange () {\n\n }", "title": "" }, { "docid": "9a37a01008a70aa2d3c58bc7f0f7f5af", "score": "0.74662966", "text": "handleInput() {\n this.reparse();\n this.trigger('update');\n }", "title": "" }, { "docid": "2c3f3717123cb9f4c353914140a5069e", "score": "0.74540675", "text": "function handleInputChange(e) {\n setInput(e.target.value);\n // setQuery(e.target.value);\n }", "title": "" }, { "docid": "62a01b6e2c6a31c7600a5bd2061b82ea", "score": "0.731277", "text": "handleInput(e) {\n if (this.props.onUpdate) { this.props.onUpdate(e.currentTarget.value) }\n }", "title": "" }, { "docid": "dd168c4fee64b2a0ae7789a4d2bb5efe", "score": "0.72734135", "text": "function OnInput(event) {\n var inputValue = event.target.value;\n handleValue(inputValue);\n\n }", "title": "" }, { "docid": "92f36f1a03949af6f11e4314fd71cadb", "score": "0.71023923", "text": "inputValueChanged() {\n this.model.set('value', this.getInputValue());\n this.elementUpdated();\n }", "title": "" }, { "docid": "2fc70c689332f9b63d8f3ac91266961e", "score": "0.7088224", "text": "onInputChange(event) { // 'onInputChange' is the event handler and 'event' is the event object, an arguement of event handler\n console.log(event.target.value); //'event.target.value' gives us the input change that occurs in the input field\n }", "title": "" }, { "docid": "25c56aa2ef4dd54238703ba1809ac3d8", "score": "0.7082223", "text": "changeInput(e, input){\n const val = e.target.value;\n this.setState(prev => { // set the input in the state to the value\n prev.inputs[input] = val;\n return prev;\n });\n }", "title": "" }, { "docid": "915f39297060d3026b02478e07b39e97", "score": "0.70755", "text": "function inputUpdated(inputNumber, type, value){\n\t if (inputNumber == _activeInput.input && type == _activeInput.type) {\n\t\t if (type == \"v\") {\n\t\t\t value = value.replace(/mV\\r\\n/, \"\");\n\t\t }\n\t\t graph.pushValue(\"input\" + _activeInput.input + _activeInput.inputType, value);\n\t }\n }", "title": "" }, { "docid": "5d762d04a8441bb449300164c419c786", "score": "0.7058485", "text": "function handleInputChange(event) {\n props.parentCallBack(event.target.value);\n }", "title": "" }, { "docid": "477d3ea888bbea7cff7097b0144a445f", "score": "0.7050262", "text": "_input() {\n let value = this._element.value;\n let transformedValue;\n let unformatted;\n let valid;\n\n // cut unnecessary characters\n transformedValue = this._restrict(value);\n unformatted = this._unformat(transformedValue);\n valid = this._validate(unformatted);\n\n this.setValue(transformedValue, false);\n\n // update model value\n if (valid && this.value !== unformatted) {\n this.value = unformatted;\n }\n\n this.emit(this.constructor.EVENTS.INPUT);\n }", "title": "" }, { "docid": "0dc770ebf7c9364bfcc7366e55ef58e3", "score": "0.7050255", "text": "handleInputChange(event) {\n\t\tconst field = event.target.name;\n const updatedEvent = this.state.updatedEvent;\n updatedEvent[field] = event.target.value;\n this.setState({\n updatedEvent\n });\n\t}", "title": "" }, { "docid": "6e0506a527991de359ca56d3a7fbb008", "score": "0.70494264", "text": "function handleChange (e){\n // e.preventDefault()\n setInput(e.target.value)\n }", "title": "" }, { "docid": "fca3ed5771098e81754bc2fc1c5ff784", "score": "0.7041051", "text": "function handleChange(e) {\n let userInput = e.target.value;\n setInput(userInput);\n }", "title": "" }, { "docid": "b40227e0524e6cad72f92bf901a4e25f", "score": "0.7039565", "text": "function inputChange(evt){\n // Get the input id of the input being...well...inputted\n var inputId = evt.currentTarget.id;\n var regEx = regExObjs[inputId];\n var inputData;\n setTimeout(function(){\n\n inputData = evt.currentTarget.value;\n console.log(\"is\" + inputData);\n //if we leave an input blank during fill in, not necessarily invalid\n //wait until 'add sensor' clicked...less anxiety\n if(inputData == \"\"){\n $(evt.target).css('background-color', 'white');\n inputStatus[inputId] = false;\n return;\n }\n if (regEx.exec(inputData) == null){\n inputStatus[inputId] = false;\n $(evt.target).css('background-color', 'IndianRed');\n }\n else{ // Data is valid for the moment\n inputStatus[inputId] = true;\n $(evt.target).css('background-color', 'lime');\n }\n },250);\n }", "title": "" }, { "docid": "856dc5b85cdc35c1d012e769246dcd67", "score": "0.70026815", "text": "_onInput(e) {\n const val = e.target.value;\n const {value} = this._getFixedValue(val.trim(), this.get('value'));\n const data = {_value: val, value};\n // if (_value === val) {\n // data.value = value;\n // }\n this.set(data);\n }", "title": "" }, { "docid": "750ec70589249ae974fbe1c136158492", "score": "0.69942707", "text": "handleInputChange(e){\n\t\t// e.target: dom node\n\t\tconst value = this.input.value\n\t\tthis.setState(() => ({\n\t\t\tinputValue: value\n\t\t}))\n\t}", "title": "" }, { "docid": "01639301403719b2734b94bf83c25cc1", "score": "0.69762045", "text": "@autobind\n _onChange(event) {\n const isValid = this._validateInput(event.target)\n if (isValid) {\n this._currentValue = this._input.value\n }\n }", "title": "" }, { "docid": "b59b01ee50c3d7285500d283054011b0", "score": "0.6938426", "text": "function inputChangeHandler(event) {\n console.log(event.target.value);\n var inp = event.target.value;\n var meaning = emojiDict[inp];\n\n if (meaning === undefined) {\n meaning = \"We dont seem to find this in our database\";\n }\n\n set_user_input(meaning);\n }", "title": "" }, { "docid": "c666dec891d3933c28e33813d96cd92c", "score": "0.69362736", "text": "function handleInputChange(e) {\n dispatch({ type: \"SET_INPUT\", name: e.target.name, value: e.target.value });\n }", "title": "" }, { "docid": "84793ed987b0c1312351ea08bf08bbff", "score": "0.6935916", "text": "onInputChange() {\n console.log(\"Changing inputs!\");\n let config = new classes.OpConfig(\n this.jqueryMap.$orig_width.val(),\n this.jqueryMap.$orig_height.val(),\n this.jqueryMap.$x_offset.val(),\n this.jqueryMap.$y_offset.val(),\n this.jqueryMap.$crop_width.val(),\n this.jqueryMap.$crop_height.val(),\n // this.jqueryMap.$filename.val(),\n // this.jqueryMap.$crop_aspect.val(),\n // this.jqueryMap.$prescale.val(),\n );\n this.stateMap.backend.updateConfig(config);\n return false;\n }", "title": "" }, { "docid": "035284b652fd4a827eb0a0df7d8bf5f8", "score": "0.69298375", "text": "_onInput() { }", "title": "" }, { "docid": "993c9ba21ececbe1674c2d89ce64199c", "score": "0.6902934", "text": "function ChangeEventHandler(changedInput) {\n if (changedInput.target.value in emojiDict) {\n setAns(emojiDict[changedInput.target.value]);\n } else {\n if (changedInput.target.value === \"\") {\n setAns(\"\");\n } else {\n setAns(\"Sorry, This Emoji is not registered in our database.\");\n }\n }\n }", "title": "" }, { "docid": "cc5faabb5eef98aed62671bfa3eb0e83", "score": "0.68796307", "text": "function changeHandle(e) {\n setUserInput(e.target.value);\n }", "title": "" }, { "docid": "a9cc5ed987aad2afc1f045a9994961bd", "score": "0.6867399", "text": "onChangeInputKey(oldKey, newKey) {\n let keys = Object.keys(this.model.inputs);\n\n let newInputs = {};\n\n for(let key of keys) {\n let value = this.model.inputs[key];\n\n if(key === oldKey) { key = newKey; }\n\n newInputs[key] = value;\n }\n\n this.model.inputs = newInputs;\n\n this.onChange();\n }", "title": "" }, { "docid": "48b029e1728f5b9a51750e990b200741", "score": "0.6837717", "text": "inputChange(event) {\n let obj = {};\n obj[event.target.name] = event.target.value;\n this.setState(obj);\n this.updateButton();\n }", "title": "" }, { "docid": "fe123a031845e445cd8a715d1cfc6813", "score": "0.68368274", "text": "handleInputChange(type, event) {\n const { target } = event;\n const { name, value } = target;\n let newValue = value;\n if (is(type, 'number')) {\n newValue = 0;\n if (parseInt(value) !== 0) {\n newValue = parseInt(value) || parseFloat(value) || '';\n }\n }\n this.setDeepState(target, name, newValue);\n }", "title": "" }, { "docid": "58f4db13e8a04a98262eaeefb454cb47", "score": "0.68364346", "text": "function changeInput(e){\n const {value} = e.target\n changeSearchInput(value)\n }", "title": "" }, { "docid": "03bbffa7b0cacd81548b2dc17722a932", "score": "0.6807885", "text": "handleChange(event) {\n\t\tconst inputVal = event.target.value;\n\t\tthis.setValue(inputVal);\n\t}", "title": "" }, { "docid": "84a31d4bc6189d2f590cdc3f54914166", "score": "0.68055725", "text": "onInputChange(event) {\n console.log(event.target.value);\n }", "title": "" }, { "docid": "d366e2737827ff33efae9a4c598e5660", "score": "0.6802313", "text": "handleInput(event) {\n this.appendState({ inputValue: event.target.value });\n }", "title": "" }, { "docid": "162446dab6a3d85ee23e798a9731797d", "score": "0.67865837", "text": "function handleInput(event) {\n // This function tracks the string information typed into the input field.\n const value = event.target.value;\n setInput(value);\n }", "title": "" }, { "docid": "37342382383ec8fd5ce59e03db5eba77", "score": "0.6778994", "text": "_inputValueChanged(e){// Handle only input events from our inputElement.\nif(-1!==e.composedPath().indexOf(this.inputElement)){this._inputElementValue=this.inputElement[this._propertyForValue];this._filterFromInput(e)}}", "title": "" }, { "docid": "5a32c49c68727ca07e5ead841c97bdc3", "score": "0.67785233", "text": "function calendar_editor_field_change($input) {\r\n\r\n\t\t/**\r\n\t\t * Exit if the input does not have the needed data values\r\n\t\t *\r\n\t\t */\r\n\t\tif (typeof $input.data('year') == 'undefined')\r\n\t\t\treturn false;\r\n\r\n\t\tif (typeof $input.data('month') == 'undefined')\r\n\t\t\treturn false;\r\n\r\n\t\tif (typeof $input.data('day') == 'undefined')\r\n\t\t\treturn false;\r\n\r\n\t\tif (typeof $input.data('name') == 'undefined')\r\n\t\t\treturn false;\r\n\r\n\t\t/**\r\n\t\t * Sanitize the data values and set them as variables\r\n\t\t *\r\n\t\t */\r\n\t\tvar year = parseInt($input.data('year'));\r\n\t\tvar month = parseInt($input.data('month'));\r\n\t\tvar day = parseInt($input.data('day'));\r\n\t\tvar name = $input.data('name');\r\n\r\n\t\t// Update data\r\n\t\tupdate_calendar_data(year, month, day, name, $input.val());\r\n\r\n\t}", "title": "" }, { "docid": "51ca4e0276a0b02a4620fe7c726cfdb3", "score": "0.6775553", "text": "input($event) {\n const value = $event.target.value;\n // update v-model relationship with parent\n this.$emit(\"input\", value);\n // trigger change event on models\n this.$emit(\"event\", \"change\", this.name, value);\n }", "title": "" }, { "docid": "77ce7373b89f784f1de8b351aefb01c1", "score": "0.6762516", "text": "async function handleInputChange(event) {\n setInputValue(event.target.value);\n filterTopicsOnSearch(event.target.value);\n }", "title": "" }, { "docid": "327507cb3e45fe1bbddf86a042b26a94", "score": "0.6754313", "text": "onchangeInput(e){\n\t\t//console.log('change')\n\t\t//console.log(e)\n\t\tdocument.getElementById('clearInputDonorButton').style.display='inline-block';//display the clear input button\n\n\n\t\tthis.autosearchDonor() //send to autosearch Donor\n\n\t}", "title": "" }, { "docid": "2364f864741c87c7d882008b79b756fb", "score": "0.6750885", "text": "_handleFieldChange() {\n if (this.type === \"text\" || this.type === \"textarea\") this._updateCount();\n if (this.autovalidate) this.validate();\n this.value = this._getFieldValue();\n if (this.type === \"textarea\") this.autoGrow();\n }", "title": "" }, { "docid": "0b5058e798b9b7565421b9dc49d8fa83", "score": "0.6746384", "text": "onInputChange(event) {\n console.log(event.target.value);\n }", "title": "" }, { "docid": "c50bf9a065a92123706d054fe871b6c3", "score": "0.6745398", "text": "_onInput() {\n // Need to invoke _checkInputValue from PatternMixin to prevent invalid input\n this._checkInputValue();\n }", "title": "" }, { "docid": "42defd9768b047647e98ad177a72a1ea", "score": "0.6743374", "text": "_onInput() {\n // This is a noop function and is used to let Angular know whenever the value changes.\n // Angular will run a new change detection each time the `input` event has been dispatched.\n // It's necessary that Angular recognizes the value change, because when floatingLabel\n // is set to false and Angular forms aren't used, the placeholder won't recognize the\n // value changes and will not disappear.\n // Listening to the input event wouldn't be necessary when the input is using the\n // FormsModule or ReactiveFormsModule, because Angular forms also listens to input events.\n }", "title": "" }, { "docid": "42defd9768b047647e98ad177a72a1ea", "score": "0.6743374", "text": "_onInput() {\n // This is a noop function and is used to let Angular know whenever the value changes.\n // Angular will run a new change detection each time the `input` event has been dispatched.\n // It's necessary that Angular recognizes the value change, because when floatingLabel\n // is set to false and Angular forms aren't used, the placeholder won't recognize the\n // value changes and will not disappear.\n // Listening to the input event wouldn't be necessary when the input is using the\n // FormsModule or ReactiveFormsModule, because Angular forms also listens to input events.\n }", "title": "" }, { "docid": "0551dc66055645d16df480e33cdf21af", "score": "0.6733389", "text": "onChangeInputDefinition(key, newValue) {\n if(!this.model.inputs) { this.model.inputs = {}; }\n \n this.model.inputs[key] = newValue;\n\n this.onChange();\n }", "title": "" }, { "docid": "320503cef46d7fd6f739ead20a234112", "score": "0.67308635", "text": "handleInput(event) {\n if (event.target.name == 'caseInput') {\n this.caseSearchTerm = event.target.value;\n }\n }", "title": "" }, { "docid": "9d733b9dccfa7231a63fcec7bd1530d5", "score": "0.67254436", "text": "function handleInputChange(inputValue, actionMeta, onInputChange) {\n if (onInputChange) {\n var newValue = onInputChange(inputValue, actionMeta);\n if (typeof newValue === 'string') return newValue;\n }\n\n return inputValue;\n } // ==============================", "title": "" }, { "docid": "05f8ea0379eba8b8e7f58ee9bf9b4273", "score": "0.67209715", "text": "function handleToInputChange(event) {\n if (this.toRodInput !== event.target.value)\n this.toRodInput = Number.parseInt(event.target.value, 10);\n }", "title": "" }, { "docid": "257f1210ce811dac5ecff34354fb7a57", "score": "0.6718745", "text": "function handleChange(event) {\n const { name, value } = event.target;\n setInput((prevInput) => {\n return {\n ...prevInput,\n [name]: value,\n };\n });\n }", "title": "" }, { "docid": "257f1210ce811dac5ecff34354fb7a57", "score": "0.6718745", "text": "function handleChange(event) {\n const { name, value } = event.target;\n setInput((prevInput) => {\n return {\n ...prevInput,\n [name]: value,\n };\n });\n }", "title": "" }, { "docid": "b89ab9ebe51a052139630d0bcfc8046b", "score": "0.6710954", "text": "function onInputChange(setState, evt) {\n setState(evt.target.value);\n }", "title": "" }, { "docid": "3fb072847c0de0e830dd2c12104d84d1", "score": "0.6706374", "text": "inputValueChanged(ev) {\n ev && ev.stopPropagation();\n // Skip the default update in case a custom emit method is defined\n if (this.emit) return;\n this.model.upValue(ev.target.value);\n }", "title": "" }, { "docid": "68df85bc7d1c0eb6fde676d695224134", "score": "0.67028576", "text": "function inputHandler(e) {\n const { name, value } = e.target;\n if (name === \"age\" && value>0) {\n characterContext.updateAge(value);\n } else if (name === \"name\") {\n characterContext.updateName(value);\n }\n }", "title": "" }, { "docid": "c815da8c3e7d8d788c3c15805c850a97", "score": "0.6684349", "text": "handleChange(event) {\n\n\t\t// As the input field changes, capture the change\n\t\tvar newState = {};\n\t\tnewState[event.target.id] = event.target.value;\n\n\t\t// Set the topic, startYear, or endYear to the the change that was captured\n\t\tthis.setState(newState);\n\t}", "title": "" }, { "docid": "1529f3071d5f297daf7c8fe00b04df71", "score": "0.66813767", "text": "function listenChange(){\n if(inputNode.addEventListener){\n inputNode.addEventListener('input', handler, false);\n }else if(inputNode.attachEvent){\n //IE8及以下\n inputNode.attachEvent('onpropertychange', handler);\n }\n }", "title": "" }, { "docid": "8f196b4870bdf8058a14772d9923804e", "score": "0.66792244", "text": "function handleInputChange(e) {\n var $target = $(e.currentTarget);\n var key = $target.attr('name');\n var value = null;\n switch ($target.attr('type')) {\n case 'text':\n case 'radio':\n case 'button':\n value = $target.val();\n if ((key == 'type')) {\n if (value == 'pronounceable') {\n $('#canDigital_container').hide();\n $('#canSpecial_container').hide();\n $('#mindigits_container').hide();\n } else {\n $('#canDigital_container').show();\n $('#canSpecial_container').show();\n $('#mindigits_container').show();\n }\n }else if(key == 'length'){\n $('button[name=\"length\"]').removeClass('active');\n $target.addClass('active');\n }\n break;\n case 'checkbox':\n value = $target.prop('checked');\n if ($target.attr('name') == 'canDigital') {\n if (value == true) {\n $('#mindigits_container').show();\n } else {\n $('#mindigits_container').hide();\n }\n }\n break;\n }\n if (value !== null) {\n if (value != currentOptions[key]) {\n updateOption(key, value);\n }\n else {\n coppyPassword();\n }\n }\n }", "title": "" }, { "docid": "b222e91974cdc100526c71f807ccbc06", "score": "0.66765946", "text": "function handleInput(e) {\n inputValue = e.target.value;\n}", "title": "" }, { "docid": "79b54063febbbf83a6b461f6ed267cfc", "score": "0.6675335", "text": "handleChange(event) {\r\n // Store the element's changed value\r\n this.setState({ input: event.target.value });\r\n }", "title": "" }, { "docid": "c33075130a44559dc0428bdc39973e3e", "score": "0.66726553", "text": "_onChange() {\n this.set('_inputValue', this.get('value'));\n }", "title": "" }, { "docid": "725c79d235ec8537e04736e20c1a0809", "score": "0.66639566", "text": "onInput(e) {\n this.updateFilledState();\n }", "title": "" }, { "docid": "2b6e9996f943b66826b14de2888342df", "score": "0.66507566", "text": "handleInputChange(event) {\n const target = event.target;\n const name = target.name;\n const value = target.value;\n // console.log(\"GameChooserForm.handleInputEvent - value changed:\"+name+\":\"+value)\n this.setState({\n [name]: value\n });\n }", "title": "" }, { "docid": "35feadaff4ca99baae56a5b1196a81bf", "score": "0.66486794", "text": "update() {\n this.handleInput();\n }", "title": "" }, { "docid": "34cd22088113c1d5eec8e8e1a1892259", "score": "0.6625973", "text": "_onInputButtonPressed(input){\n switch (typeof input) {\n\t\t\tcase 'number':\n\t\t\t\treturn this._handleNumberInput(input)\n\t\t\tcase 'string':\n\t\t\t\treturn this._handleStringInput(input)\n\t\t}\n }", "title": "" }, { "docid": "a45e854f209eb3f3d602e39fd3379135", "score": "0.6623869", "text": "_onInput() {\n const value = this.refs.keytrap.val();\n this._requestEditCell(value);\n // Clear keytrap after sending an action\n this.refs.keytrap.val('');\n }", "title": "" }, { "docid": "ff666e8046608d08634d8cc928f4e73e", "score": "0.6622533", "text": "function handleInputChange(event) {\n\t\tconst { name, value } = event.target;\n\t\tsetUserResponse({ ...userResponse, [name]: value });\n\t}", "title": "" }, { "docid": "32f18b0df385becd28f7d8ba18bde6ef", "score": "0.6622416", "text": "function onInput(e) {\r\n\t console.log(e.detail);\r\n\t console.log(\"onInput: \", e.detail);\r\n\t }", "title": "" }, { "docid": "32f18b0df385becd28f7d8ba18bde6ef", "score": "0.6622416", "text": "function onInput(e) {\r\n\t console.log(e.detail);\r\n\t console.log(\"onInput: \", e.detail);\r\n\t }", "title": "" }, { "docid": "69e9d3006bf70961651c8fd49f660463", "score": "0.6619707", "text": "inputChange(event, attr) {\n if (!!event) {\n let stateOb = {};\n stateOb[attr] = event.target.value;\n this.setState(stateOb);\n }\n }", "title": "" }, { "docid": "e46eb32fe0559be1667edcc67145a42c", "score": "0.66141975", "text": "updateInputValue(event) {\r\n let value = event.currentTarget.value;\r\n let name = event.currentTarget.name;\r\n\r\n this.formValidation(name, value);\r\n this.props.handleInputValue(name, value);\r\n }", "title": "" }, { "docid": "25cc351afee365104888dd05acd6b06b", "score": "0.66116667", "text": "function onInput() {\n\n /**\n * event data (contains informations about the input field)\n * @type {object}\n */\n var event_data = { gap: 1 + i, input: this.value };\n\n // has logger instance? => log 'input' event\n if ( self.logger ) self.logger.log( 'input', event_data );\n\n // has individual 'input' callback? => perform it\n if ( self.oninput ) self.oninput( self, event_data );\n\n }", "title": "" }, { "docid": "fa4df2f8c9a22e11b22f5a1bcf964304", "score": "0.66007763", "text": "handleInputChange(event) {\n console.log('handleInputChange');\n const target = event.target;\n const value = target.value;\n const name = target.name;\n\n this.setState({[name]: value});\n\n //Run the tail number on the validator and check existing aircraft mappings\n if (name === \"tail\") {\n this.validateInput(value);\n this.checkIfExists(value, this.state.nose);\n }\n else if(name=== \"nose\"){\n this.checkIfExists(this.state.tail, value);\n }\n }", "title": "" }, { "docid": "273abed86173ac76046c7ed622b4767f", "score": "0.6600541", "text": "onInput(e) {\n\t\tthis.listofAllCryptoCoinsAPI();\n\t\tthis.setState({\n\t\t\tinput: e.target.value,\n\t\t});\n\t}", "title": "" }, { "docid": "bc4e5f8642275b710203851c5725a102", "score": "0.6599888", "text": "onChangeText(input) {\n\n }", "title": "" }, { "docid": "d9e91a49b2c1fbea47fc11fae45d24f9", "score": "0.65980864", "text": "function onInput(e) {\r\n\t console.log(e.detail);\r\n\t console.log(\"onInput: \", e.detail);\r\n\t }", "title": "" }, { "docid": "539867dda7ce439806ccb6a5c2bc3c17", "score": "0.6597245", "text": "function handleValueChange() {\n\t\tprops.inputData(data.value);\n\t}", "title": "" }, { "docid": "b3dfa2e7370d15e82b096e7bc20484ed", "score": "0.6586733", "text": "handleChangeInput(e) {\n this.userInput.value = e.target.value;\n this.userInput.canShow = true;\n if (this.userInput.canShow) {\n this.fetchCountrySpecific();\n }\n }", "title": "" }, { "docid": "6cbd057fc803c8ccb16176babc8bff02", "score": "0.6575274", "text": "update() {\n this.value = this.originalInputValue;\n }", "title": "" }, { "docid": "ab77668a030636111a1786752fce429f", "score": "0.65717137", "text": "updateInputValue(e) {\n this.setState({\n inputValue: e.target.value,\n });\n this.activateField(e);\n e.preventDefault();\n }", "title": "" }, { "docid": "e77f1687a2cabccd3ee9f8f407ae1821", "score": "0.6570704", "text": "handleInputUpdate(inputValue, restore) {\n if(restore) {\n this.setState({ field: inputValue });\n return this.restoredCell();\n }\n if(inputValue !== this.state.field) {\n this.props.saveCounter(1);\n this.setState({ edited: true });\n }\n return this.setState({ field: inputValue });\n }", "title": "" }, { "docid": "cbb49068b6664b1d80794671623da9fa", "score": "0.65680367", "text": "handleInputChange(event) {\n\t\tconst target = event.target;\n\t\tconst name = target.name;\n\t\tconst value = target.value;\n\t\t\n\t\tthis.setState({\n\t\t\t[name]: value\n\t\t});\n\t}", "title": "" }, { "docid": "4ffd49ea3ca6df7a5063eb5e47f5a4d3", "score": "0.65631527", "text": "function handleChange(event){//it will get event\n //destructure event\n const {name, value} = event.target;//it will save name of input and value of it\n setNote(function(prevNote){//we get access to previous note\n //console.log(prevNote); it returns previous note object values\n return {//this function sets value of note\n ...prevNote,//return object with previous note\n [name]: value//actual value of key(its 'title' or 'content') equal to new value that user typed\n //to that input \n }\n })\n\n }", "title": "" }, { "docid": "1bc497e5f6ea49318b1bb31b7085e42c", "score": "0.65618575", "text": "function handleUserInput(event){\n const input = event.target.value;\n setUserInput(input);\n }", "title": "" }, { "docid": "c852220056918a6679d25e1203a3969e", "score": "0.6558738", "text": "update(args) {\n var inputValue = this.getInputValue();\n this.setOriginalInputValue(inputValue);\n this.postUpdate();\n if (!(args || {}).withoutChangeEvent && !this.state.blockChangeEvent) this.triggerChangeEvent();\n }", "title": "" }, { "docid": "d8b8378cc17d1951a72e33ea7782a4a8", "score": "0.6557702", "text": "handleInputChange (event) {\n this.setState({value: event.target.value})\n }", "title": "" }, { "docid": "e90512b4af32b63eb3b723da5c867a45", "score": "0.6556027", "text": "inputValueChanged(field, value) {\n let sectionChangeset = get(this, 'changeset');\n sectionChangeset.set(field, value);\n this.propertyDidChange('changeset');\n this.send('_sendUpdate');\n }", "title": "" }, { "docid": "f556869d4f0a796881e7d22c203313a8", "score": "0.65525657", "text": "function handleInputChange(event)\n {\n setIsLinkEmpty(false);\n setShowShort(false);\n setClassCopy('base_copy_class');\n setDisableCreate(false);\n\n setInputLong(event.target.value);\n\n }", "title": "" }, { "docid": "f2f83835258593d1b77be1e9530585b8", "score": "0.6551753", "text": "handleChange(event) {\n event.stopPropagation();\n\n // The input event fires continually for every value change while the change event gets\n // fired when the user releases the mouse button for example. This can cause two change\n // events to be fired for the same value change. To prevent this, ignore the change event\n // if the value hasn't changed.\n const shouldIgnoreChangeEvent = this._value === event.target.value;\n if (shouldIgnoreChangeEvent) {\n return;\n }\n\n this.handleInput(event);\n }", "title": "" }, { "docid": "1fd1d9587dd80c49cd973f3e88d53aa5", "score": "0.6549585", "text": "function inputKeyup (ev) {\n var val = ev.target.value\n store.inputVal = val\n loop.update(store)\n}", "title": "" }, { "docid": "40620a0f9ef2d048ab7505b9267ccd7d", "score": "0.6545668", "text": "onUpdateInput(value) {\r\n var self = this;\r\n if (!this.fieldStatus.dirty) {\r\n this.fieldStatus.dirty = true;\r\n this.updateToStore();\r\n }\r\n }", "title": "" }, { "docid": "a0d5b9dc50b4f21c688865c84680105e", "score": "0.6534106", "text": "_onSourceChanged(sender, args) {\n if (this._changeGuard) {\n return;\n }\n if (this._inputDirty || this.editor.hasFocus()) {\n this._dataDirty = true;\n return;\n }\n this._setValue();\n }", "title": "" }, { "docid": "c30ce7ff5e640075fef93a7c3799307f", "score": "0.6532919", "text": "onInputChange(event) {\n const eventName = event.target.name;\n const eventValue = (event.target.type === \"number\") ?\n parseInt(event.target.value,10) :\n event.target.value\n ;\n const newState = {\n ...this.state\n }\n newState.event[eventName] = eventValue;\n this.setState(newState);\n }", "title": "" }, { "docid": "cada5066f5cd03d6431196822852f90f", "score": "0.6530004", "text": "setEventInput (event) {\n const { id, value, name } = event.target;\n const inputKey = id || name;\n this.setInput(inputKey, value);\n }", "title": "" }, { "docid": "40bc7fe9af32737dfda17ee21c99972f", "score": "0.65291756", "text": "function handleInputChange(inputValue, actionMeta, onInputChange) {\n if (onInputChange) {\n var newValue = onInputChange(inputValue, actionMeta);\n if (typeof newValue === 'string') return newValue;\n }\n\n return inputValue;\n} // ==============================", "title": "" }, { "docid": "40bc7fe9af32737dfda17ee21c99972f", "score": "0.65291756", "text": "function handleInputChange(inputValue, actionMeta, onInputChange) {\n if (onInputChange) {\n var newValue = onInputChange(inputValue, actionMeta);\n if (typeof newValue === 'string') return newValue;\n }\n\n return inputValue;\n} // ==============================", "title": "" }, { "docid": "40bc7fe9af32737dfda17ee21c99972f", "score": "0.65291756", "text": "function handleInputChange(inputValue, actionMeta, onInputChange) {\n if (onInputChange) {\n var newValue = onInputChange(inputValue, actionMeta);\n if (typeof newValue === 'string') return newValue;\n }\n\n return inputValue;\n} // ==============================", "title": "" }, { "docid": "40bc7fe9af32737dfda17ee21c99972f", "score": "0.65291756", "text": "function handleInputChange(inputValue, actionMeta, onInputChange) {\n if (onInputChange) {\n var newValue = onInputChange(inputValue, actionMeta);\n if (typeof newValue === 'string') return newValue;\n }\n\n return inputValue;\n} // ==============================", "title": "" }, { "docid": "40bc7fe9af32737dfda17ee21c99972f", "score": "0.65291756", "text": "function handleInputChange(inputValue, actionMeta, onInputChange) {\n if (onInputChange) {\n var newValue = onInputChange(inputValue, actionMeta);\n if (typeof newValue === 'string') return newValue;\n }\n\n return inputValue;\n} // ==============================", "title": "" }, { "docid": "40bc7fe9af32737dfda17ee21c99972f", "score": "0.65291756", "text": "function handleInputChange(inputValue, actionMeta, onInputChange) {\n if (onInputChange) {\n var newValue = onInputChange(inputValue, actionMeta);\n if (typeof newValue === 'string') return newValue;\n }\n\n return inputValue;\n} // ==============================", "title": "" }, { "docid": "40bc7fe9af32737dfda17ee21c99972f", "score": "0.65291756", "text": "function handleInputChange(inputValue, actionMeta, onInputChange) {\n if (onInputChange) {\n var newValue = onInputChange(inputValue, actionMeta);\n if (typeof newValue === 'string') return newValue;\n }\n\n return inputValue;\n} // ==============================", "title": "" }, { "docid": "40bc7fe9af32737dfda17ee21c99972f", "score": "0.65291756", "text": "function handleInputChange(inputValue, actionMeta, onInputChange) {\n if (onInputChange) {\n var newValue = onInputChange(inputValue, actionMeta);\n if (typeof newValue === 'string') return newValue;\n }\n\n return inputValue;\n} // ==============================", "title": "" }, { "docid": "3ca114988eb223e3093033106b5d9367", "score": "0.6526022", "text": "function onInput() {\n\n /**\n * text area value\n * @type {string}\n */\n var value = this.value;\n\n // has logger instance? => log input event\n if ( self.logger ) self.logger.log( 'input', value );\n\n // has individual input callback? => perform it\n if ( self.oninput ) self.oninput( self, value );\n\n }", "title": "" }, { "docid": "c0e1f83d319e29501cbc65c45d8b4e15", "score": "0.6521647", "text": "handleInput(e){\n //console.log(\"Watch out Anonymous. I'm a real hacker\")\n\n this.setState({\n input: e.target.value\n })\n\n //console.log('handleInput update -' + this.state.input)\n}", "title": "" } ]
bba33fe569c6b11406bfff29719f5a9f
1277 Extracts operator piece, if present, from position string // 1278
[ { "docid": "9e50a18af4b561320b33500d728f1181", "score": "0.794297", "text": "function extractOp(position) { // 1279\n var firstPositionPiece = position.slice(0, position.indexOf('[')); // 1280\n return firstPositionPiece.substring(0, 1) === '$' ? firstPositionPiece : null; // 1281\n} // 1282", "title": "" } ]
[ { "docid": "713caae5933ddc390a5e7aba6e12eb6a", "score": "0.72534597", "text": "function extractOp(position) {\n const firstPositionPiece = position.slice(0, position.indexOf('['));\n return (firstPositionPiece.substring(0, 1) === '$') ? firstPositionPiece : null;\n}", "title": "" }, { "docid": "ac477eaa6e916e190e4492ad03a68dd6", "score": "0.6880294", "text": "operatorPositions(expression) {\n return expression\n .split(\"\")\n .reduce((acc, character, idx) => {\n if (this.operators.includes(character))\n acc.push(idx)\n return acc;\n }, []);\n }", "title": "" }, { "docid": "934450b7e7bdcce81f05ed9e670ed789", "score": "0.6528209", "text": "function extractOperation(startPos, inputChangeset){\n var endPos = startPos + 1;\n var operators = \":><$=+-\";\n while(!operators.includes(inputChangeset[endPos]) && endPos<inputChangeset.length){\n endPos++;\n }\n return inputChangeset.slice(startPos,endPos);\n }", "title": "" }, { "docid": "adfd839aa326a6a8f4bc76c6dc778df2", "score": "0.6142915", "text": "function infixOperatorLocationOf (expression, tokens) {\n var token = findOperatorTokenOf(expression, tokens);\n return token ? token.loc : expression.left.loc;\n}", "title": "" }, { "docid": "adfd839aa326a6a8f4bc76c6dc778df2", "score": "0.6142915", "text": "function infixOperatorLocationOf (expression, tokens) {\n var token = findOperatorTokenOf(expression, tokens);\n return token ? token.loc : expression.left.loc;\n}", "title": "" }, { "docid": "1b64aaaafb89dfc0792711cc93dc7a34", "score": "0.6116297", "text": "function getOperator() {\n var start = scanner.tokenStart;\n\n scanner.next();\n\n return {\n type: 'Operator',\n info: getInfo(start),\n value: scanner.substrToCursor(start)\n };\n}", "title": "" }, { "docid": "2fe00ef9ffe4ba87d2733195d2869be8", "score": "0.60961694", "text": "function parseOperator(position) {\n //Determine operator\n var object = {\n position: position\n };\n\n if(/\\+=([\\d\\.]*)/.test(position))\n object.operator = \"+=\";\n\n if (/\\-=([\\d\\.]*)/.test(position))\n object.operator = \"-=\";\n\n if (typeof object.operator != \"undefined\")\n object.position = parseFloat(String(position).replace(object.operator, \"\"));\n\n return object;\n }", "title": "" }, { "docid": "bf2fb99600f0df325862581287b9180b", "score": "0.5985456", "text": "function parse_operator_name(op) {\n\top = ''+op;\n\top = op.split(':')[0];\n\treturn op;\n}", "title": "" }, { "docid": "34efc4909dc912112de02df0cb6c154f", "score": "0.59653133", "text": "function o(e){var t,r=e?e.indexOf(\"!\"):-1;return r>-1&&(t=e.substring(0,r),e=e.substring(r+1,e.length)),[t,e]}", "title": "" }, { "docid": "c9d3c3d3d008f3adfa741cadd1c84fc6", "score": "0.5933067", "text": "function detectOperator(a){\n let ops = {\n '39': 'Golden Telecom',\n '50': 'MTS',\n '63': 'Life:)',\n '66': 'MTS',\n '67': 'Kyivstar',\n '68': 'Beeline',\n '93': 'Life:)',\n '95': 'MTS',\n '96': 'Kyivstar',\n '97': 'Kyivstar',\n '98': 'Kyivstar',\n '99': 'MTS'\n }\n return ops[a.toString().slice(2, 4)] || 'no info';\n}", "title": "" }, { "docid": "2bd2b6881114ddcc8cfe3a5209f9a1a5", "score": "0.5878034", "text": "scanComplexOperator(start,one,twoCode,two,threeCode,three){this.advance();let str=one;if(this.peek==twoCode){this.advance();str+=two;}if(threeCode!=null&&this.peek==threeCode){this.advance();str+=three;}return newOperatorToken(start,str);}", "title": "" }, { "docid": "c559f9c50410a98f9de3b27b78b06565", "score": "0.5861579", "text": "function parseExpressionAt(input, pos, options) {\n\t var p = new _state.Parser(options, input, pos);\n\t p.nextToken();\n\t return p.parseExpression();\n\t}", "title": "" }, { "docid": "12450883c9ee7e097e3725238ebf211e", "score": "0.58353984", "text": "function parseOperator(str) {\n var match = str.match(/^(\\w+)\\s+\\((.+)\\)\\s*$/) || []\n var args = match[2] && match[2].split(/,\\s*/g) || [];\n return {\n name: match[1] || '',\n data: args[0] || '',\n args: args.slice(1) || []\n }\n}", "title": "" }, { "docid": "0d4c20ca460eb229551c7d60ed495187", "score": "0.58085096", "text": "function parseExpressionAt(input, pos, options) {\n\t var p = new Parser(options, input, pos)\n\t p.nextToken()\n\t return p.parseExpression()\n\t}", "title": "" }, { "docid": "92f19b74dd97a289aa593b413c018540", "score": "0.5760028", "text": "function parseExpressionAt(input, pos, options) {\n var p = new Parser(options, input, pos);\n p.nextToken();\n return p.parseExpression();\n }", "title": "" }, { "docid": "13bb8e57ffda4a0ca3b64320927b0ffd", "score": "0.5758042", "text": "function parseExpressionAt(input, pos, options) {\n var p = new _state.Parser(options, input, pos);\n p.nextToken();\n return p.parseExpression();\n}", "title": "" }, { "docid": "13bb8e57ffda4a0ca3b64320927b0ffd", "score": "0.5758042", "text": "function parseExpressionAt(input, pos, options) {\n var p = new _state.Parser(options, input, pos);\n p.nextToken();\n return p.parseExpression();\n}", "title": "" }, { "docid": "13bb8e57ffda4a0ca3b64320927b0ffd", "score": "0.5758042", "text": "function parseExpressionAt(input, pos, options) {\n var p = new _state.Parser(options, input, pos);\n p.nextToken();\n return p.parseExpression();\n}", "title": "" }, { "docid": "b2e4e1fd355efc548f9876f28a2f1209", "score": "0.5738065", "text": "function parseExpressionAt(input, pos, options) {\n var p = new Parser(options, input, pos)\n p.nextToken()\n return p.parseExpression()\n }", "title": "" }, { "docid": "c89209f8a6c6e31f0fb02bf7b0d4fcc2", "score": "0.573444", "text": "function operandsParser(str)\n{\n let counter = 0;\n let operandFound = '';\n for (let i=0; i < operands.length; i++){\n if (str.indexOf(operands[i]) >= 0){\n counter++;\n operandFound = operands[i];\n }\n }\n\n if ( counter > 1 ) { \n return void 0; \n }\n\n if (counter == 0) {\n return str;\n }\n\n let a = str.split(operandFound);\n\n return [a[0].trim(), operandFound, a[1].trim()];\n}", "title": "" }, { "docid": "806931356e25fd2ed2db5ab2a36591ee", "score": "0.5706549", "text": "function parseExpressionAt(input, pos, options) {\n var p = new Parser(options, input, pos);\n p.nextToken();\n return p.parseExpression();\n }", "title": "" }, { "docid": "805c26887df0f50677f5d75806af2508", "score": "0.5703564", "text": "function parseExpressionAt(input, pos, options) {\n var p = new Parser(options, input, pos)\n p.nextToken()\n return p.parseExpression()\n}", "title": "" }, { "docid": "805c26887df0f50677f5d75806af2508", "score": "0.5703564", "text": "function parseExpressionAt(input, pos, options) {\n var p = new Parser(options, input, pos)\n p.nextToken()\n return p.parseExpression()\n}", "title": "" }, { "docid": "805c26887df0f50677f5d75806af2508", "score": "0.5703564", "text": "function parseExpressionAt(input, pos, options) {\n var p = new Parser(options, input, pos)\n p.nextToken()\n return p.parseExpression()\n}", "title": "" }, { "docid": "805c26887df0f50677f5d75806af2508", "score": "0.5703564", "text": "function parseExpressionAt(input, pos, options) {\n var p = new Parser(options, input, pos)\n p.nextToken()\n return p.parseExpression()\n}", "title": "" }, { "docid": "d2b764cdaaaa099f882cebfb253cd30c", "score": "0.56986314", "text": "function parseExpressionAt(input, pos, options) {\n var p = new Parser(options, input, pos);\n p.nextToken();\n return p.parseExpression()\n}", "title": "" }, { "docid": "d2b764cdaaaa099f882cebfb253cd30c", "score": "0.56986314", "text": "function parseExpressionAt(input, pos, options) {\n var p = new Parser(options, input, pos);\n p.nextToken();\n return p.parseExpression()\n}", "title": "" }, { "docid": "2e00c59fb81be80f45f3849a95f723db", "score": "0.5692402", "text": "function parseExpressionAt(input, pos, options) {\n return Parser.parseExpressionAt(input, pos, options)\n }", "title": "" }, { "docid": "eb4caa5e319ff1393932099982ef9e30", "score": "0.56804544", "text": "function getOp(){\r\n if(value[0] != undefined){\r\n op = this.value;\r\n opFlag = true;\r\n index = 1;\r\n }\r\n}", "title": "" }, { "docid": "8813ced3164b1614c27c3f8ec167dc09", "score": "0.56764376", "text": "function charpos(p) { return op == \"ins\" ? base+p : base; }", "title": "" }, { "docid": "742700da0308f71ca1bfe8221e77999b", "score": "0.5640428", "text": "parse(str) {\n // First of all: Away with all we don't have a need for:\n // Additionally, replace some constants:\n str = this.cleanupInputString(str);\n\n let lastChar = str.length - 1,\n index = 0,\n state = 0,\n expressions = [],\n char = \"\",\n tmp = \"\",\n funcName = null,\n pCount = 0;\n\n while (index <= lastChar) {\n switch (state) {\n case 0:\n // None state, the beginning. Read a char and see what happens.\n char = str.charAt(index);\n if (char.match(/[0-9.]/)) {\n // found the beginning of a number, change state to \"within-number\"\n state = \"within-nr\";\n tmp = \"\";\n index--;\n } else if (this.isOperator(char)) {\n // Simple operators. Note: \"-\" must be treated specifically,\n // it could be part of a number.\n // it MUST be part of a number if the last found expression\n // was an operator (or the beginning):\n if (char === \"-\") {\n if (\n expressions.length === 0 ||\n (expressions[expressions.length - 1] && typeof expressions[expressions.length - 1] === \"string\")\n ) {\n state = 0;\n tmp = \"\";\n expressions.push(-1, \"*\");\n break;\n }\n }\n\n // Found a simple operator, store as expression:\n if (\n (index === lastChar || this.isOperator(expressions[index - 1])) &&\n !expressions[index - 1].match(/[\\*\\^]/)\n ) {\n state = -1; // invalid to end with an operator, or have 2 operators in conjunction\n break;\n } else {\n expressions.push(char);\n state = 0;\n }\n } else if (char === \"(\") {\n // add a check if an expression just finished and about to start a new one\n if (str.charAt(index - 1).match(/[a-zA-Z0-9\\)\\]\\-]/)) {\n expressions.push(\"*\");\n }\n\n // left parenthes found, seems to be the beginning of a new sub-expression:\n state = \"within-parentheses\";\n tmp = \"\";\n pCount = 0;\n } else if (char === \"[\") {\n\n // add a check if an expression just finished and about to start a new one\n if (str.charAt(index - 1).match(/[a-zA-Z0-9\\)\\]\\-]/)) {\n expressions.push(\"*\");\n }\n\n // left named var separator char found, seems to be the beginning of a named var:\n state = \"within-named-var\";\n tmp = \"\";\n } else if (char.match(/[a-zA-Z]/)) {\n // multiple chars means it may be a function, else its a var which counts as own expression:\n if (index < lastChar && str.charAt(index + 1).match(/[a-zA-Z]/)) {\n // check for coefficient\n if (str.charAt(index - 1).match(/[0-9]/)) {\n expressions.push(\"*\");\n }\n tmp = char;\n state = \"within-func\";\n } else {\n // Single variable found:\n // We need to check some special considerations:\n // - If the last char was a number (e.g. 3x), we need to create a multiplication out of it (3*x)\n if (expressions.length > 0) {\n if (typeof expressions[expressions.length - 1] === \"number\") {\n expressions.push(\"*\");\n }\n }\n expressions.push(this.createVariableEvaluator(char));\n this.registerVariable(char);\n state = 0;\n tmp = \"\";\n }\n }\n break;\n\n case \"within-nr\":\n char = str.charAt(index);\n if (char.match(/[0-9.]/)) {\n //Still within number, store and continue\n tmp += char;\n if (index === lastChar) {\n expressions.push(Number(tmp));\n state = 0;\n }\n } else {\n // Number finished on last round, so add as expression:\n expressions.push(Number(tmp));\n tmp = \"\";\n state = 0;\n index--;\n }\n break;\n\n case \"within-func\":\n char = str.charAt(index);\n if (char.match(/[a-zA-Z0-9]/)) {\n tmp += char;\n } else if (char === \"(\") {\n funcName = tmp;\n tmp = \"\";\n pCount = 0;\n state = \"within-func-parentheses\";\n } else {\n throw new Error(`Wrong character for function at position ${index}`);\n }\n break;\n\n case \"within-named-var\":\n char = str.charAt(index);\n if (char === \"]\") {\n // end of named var, create expression:\n expressions.push(this.createVariableEvaluator(tmp));\n this.registerVariable(tmp);\n\n // add a check if a new expression is coming up and just ended one\n if (str.charAt(index + 1).match(/[a-zA-Z0-9\\(\\[]/)) { // by Squagward\n expressions.push(\"*\");\n }\n\n tmp = \"\";\n state = 0;\n } else if (char.match(/\\w/)) {\n tmp += char;\n } else {\n throw new Error(`Character not allowed within named variable: ${char}`);\n }\n break;\n\n case \"within-parentheses\":\n case \"within-func-parentheses\":\n char = str.charAt(index);\n if (char === \")\") {\n //Check if this is the matching closing parenthesis.If not, just read ahead.\n if (pCount <= 0) {\n // Yes, we found the closing parenthesis, create new sub-expression:\n if (state === \"within-parentheses\") {\n expressions.push(new Formula(tmp, this));\n } else if (state === \"within-func-parentheses\") {\n // Function found: return a function that,\n // when evaluated, evaluates first the sub-expression\n // then returns the function value of the sub-expression.\n // Access to the function is private within the closure:\n expressions.push(this.createFunctionEvaluator(tmp, funcName));\n funcName = null;\n }\n if (str.charAt(index + 1).match(/[a-zA-Z0-9]/)) {\n expressions.push(\"*\");\n }\n state = 0;\n } else {\n pCount--;\n tmp += char;\n }\n } else if (char === \"(\") {\n // begin of a new sub-parenthesis, increase counter:\n pCount++;\n tmp += char;\n } else {\n // all other things are just added to the sub-expression:\n tmp += char;\n }\n break;\n }\n index++;\n }\n\n if (state !== 0) {\n throw new Error(\"Could not parse formula: Syntax error.\");\n }\n\n return expressions;\n }", "title": "" }, { "docid": "c2004ae33122da80ebca7b6d33257e45", "score": "0.56206703", "text": "function getLastIndexOfOperator() {\n var arith = \"+-*/%\";\n var temp = output + \" + \";\n for (var i = 0; i < temp.length; i++) {\n for (var j = 0; j < arith.length; j++) {\n if (temp[i] === arith[j]) {\n lastIndex = i;\n }\n }\n }\n }", "title": "" }, { "docid": "8260810ce4389d97da7d4eee62bf3ee1", "score": "0.56070423", "text": "function parseOffset(str)\n\t{\n\t\tif (typeof(str) !== 'string')\n\t\t\tfw.error(\"Docking offset isn't a string!\");\n\n\t\tvar ofs = str.split(' ', 2);\t// Break into pieces\n\n\t\t// Clean up\n\t\t$.each(ofs, function(key) {\n\t\t\tofs[key] = parseInt(ofs[key]);\n\t\t\tif (isNaN(ofs[key]))\n\t\t\t\tfw.error('Invalid offset in docking data: ' + str);\n\t\t});\n\n\t\t// If only one value was passed, copy it to both positions\n\t\tif (!defined(ofs[1]))\n\t\t\tofs[1] = ofs[0];\n\n\t\treturn ofs;\n\t}", "title": "" }, { "docid": "0895e1521abc400efb8b9edad042992d", "score": "0.5598256", "text": "function parseExpressionAt(input, pos, options) {\n return Parser.parseExpressionAt(input, pos, options)\n}", "title": "" }, { "docid": "0895e1521abc400efb8b9edad042992d", "score": "0.5598256", "text": "function parseExpressionAt(input, pos, options) {\n return Parser.parseExpressionAt(input, pos, options)\n}", "title": "" }, { "docid": "0895e1521abc400efb8b9edad042992d", "score": "0.5598256", "text": "function parseExpressionAt(input, pos, options) {\n return Parser.parseExpressionAt(input, pos, options)\n}", "title": "" }, { "docid": "0895e1521abc400efb8b9edad042992d", "score": "0.5598256", "text": "function parseExpressionAt(input, pos, options) {\n return Parser.parseExpressionAt(input, pos, options)\n}", "title": "" }, { "docid": "0895e1521abc400efb8b9edad042992d", "score": "0.5598256", "text": "function parseExpressionAt(input, pos, options) {\n return Parser.parseExpressionAt(input, pos, options)\n}", "title": "" }, { "docid": "0895e1521abc400efb8b9edad042992d", "score": "0.5598256", "text": "function parseExpressionAt(input, pos, options) {\n return Parser.parseExpressionAt(input, pos, options)\n}", "title": "" }, { "docid": "d690e3e51f1d463cfa0a2b0e4e61a14e", "score": "0.5573464", "text": "function interpret(t) {\n\tif(t[0]=='Q') {\n\t\treturn t[2](t[3](interpret(t[4])));\n\t}\n\tif(t[0]=='U') {\n\t\treturn t[2](interpret(t[3]));\n\t}\n\tif(t[0]=='B') {\n\t\treturn t[3](interpret(t[2]))(interpret(t[4]));\n\t}\n\tif(t[0]=='0p') {\n\t\treturn t[2];\n\t}\n\tif(t[0]=='1p') {\n\t\treturn t[2](t[3]);\n\t}\n\tif(t[0]=='2p' || t[0]=='=') {\n\t\treturn t[2](t[3])(t[4]);\n\t}\n}", "title": "" }, { "docid": "ed79f6cbf2b5275a3be0a5f8b1d2720a", "score": "0.5572343", "text": "function extractInfoFromInput(str) {\n var word = \"\";\n var info = [];\n for (var i = 0; i < str.length; i++) {\n var ch = str.charAt(i);\n if (ch !== ' ') {\n word = word + ch;\n }\n else {\n info[0] = word;\n word = \"\";\n }\n }\n info[1] = rowMap.indexOf(word[0]);\n info[2] = parseInt(word[1]) - 1;\n movePiece(info);\n}", "title": "" }, { "docid": "fb803b2222d7b82202cdb77eb71b15f5", "score": "0.55628693", "text": "function useFirstOp()\n{\n\tvar ops = args[0];\n\tops = ops.replace(/!/g, \"\");\n\t\n\tops = ops.substr(0, 1);\n\t\n\treturn ops;\n}", "title": "" }, { "docid": "0d7b544a435bd0b0d9f17bef056ebb90", "score": "0.5530484", "text": "function paren(str, pos){\n\tvar result = pos+1;\n\tvar parenCount = 0;\n\n\twhile(result < str.length){\n\t\tif(str[result]===\"(\"){\n\t\t\tresult++;\n\t\t\tparenCount += 1;\n\t\t} else if(str[result] === \")\" && parenCount === 0){\n\t\t\treturn result;\n\t\t} else if(str[result] === \")\" && parenCount > 0){\n\t\t\tresult++;\n\t\t\tparenCount -= 1;\n\t\t} else {\n\t\t\tresult++;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4ea644827578bcc3ee40378ce3c20bab", "score": "0.55154294", "text": "function parenBit(word, i=0, start=null) {\n if(i >= word.length)\n return '' \n if(start !== null && word[i] === ')')\n return word.substring(start, i+1)\n if(word[i] === '(')\n return parenBit(word, i+1, i)\n if(start !== null) \n return parenBit(word, i+1, start)\n return parenBit(word, i+1) \n}", "title": "" }, { "docid": "89ac1ed8416361b2bec1ef0b9cebb81d", "score": "0.5479731", "text": "function find_op(format) {\n for (var i = 0; i < format.length; i++) {\n if (format[i] == \"o\" && (i + 1) < format.length && format[i + 1] == \"r\") {\n return i;\n }else if(format[i] == \"a\" && (i + 2) < format.length &&\n format[i + 1] == \"n\" && format[i + 2] == \"d\") {\n return i;\n }\n }\n return -1;\n }", "title": "" }, { "docid": "a72086cb612f7ddb5b3a5bf254369e7d", "score": "0.54463273", "text": "function bitpos() {\n}", "title": "" }, { "docid": "4670b7aeb63424ab11142d70e2ac53c7", "score": "0.5437549", "text": "function division(match, p1, offset, string){\n\t\tvar depth = 0;\n\t\tif(p1[0] !== '('){\n\t\t\t// Search for first operator\n\t\t\tfor(var i=0; i<p1.length; ++i){\n\t\t\t\tif(p1[i] === ')' && depth > 0){\n\t\t\t\t\t--depth;\n\t\t\t\t} else if(p1[i] === '('){\n\t\t\t\t\t++depth;\n\t\t\t\t}\n\t\t\t\tif(depth === 0 && p1[i].match(/[\\+\\*\\^\\)]/g)){\n\t\t\t\t\tp1 = '*('+p1.slice(0, i)+')^(-1)'+p1.slice(i, p1.length);\n\t\t\t\t\treturn p1;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Search for closing )\n\t\t\tfor(var i=1; i<p1.length; ++i){\n\t\t\t\tif(p1[i] === ')'){\n\t\t\t\t\t--depth;\n\t\t\t\t} else if(p1[i] === '('){\n\t\t\t\t\t++depth;\n\t\t\t\t}\n\t\t\t\tif(depth === -1){\n\t\t\t\t\tp1 = '*('+p1.slice(0, i)+')^(-1)'+p1.slice(i, p1.length);\n\t\t\t\t\treturn p1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn '*('+p1+')^(-1)';\n\t}", "title": "" }, { "docid": "3510558b260e6cf32c950e5d06c0efc6", "score": "0.5437527", "text": "function PositiveOperatorMatcher() {}", "title": "" }, { "docid": "05a93885a1bc30eb36e9b2dcd4ec85cf", "score": "0.54304695", "text": "parseUnaryOperator(node, isPrefix) {\n node.operator = this.state.value;\n }", "title": "" }, { "docid": "694f701516c70b72d96e62b9a8db6dba", "score": "0.54163885", "text": "readExpressionFactor(){\n\t\t/* Read first opcode */\n\t\tvar op_code = this.readExpressionPow();\n\t\twhile (this.findNextToken(\"*\") || this.findNextToken(\"/\") || this.findNextToken(\"%\")){\n\t\t\tif (this.findNextToken(\"*\")){\n\t\t\t\tthis.matchNextToken(\"*\");\n\t\t\t\top_code = new OpMult(op_code, this.readExpressionPow());\n\t\t\t}\n\t\t\telse if (this.findNextToken(\"/\")){\n\t\t\t\tthis.matchNextToken(\"/\");\n\t\t\t\top_code = new OpDiv(op_code, this.readExpressionPow());\n\t\t\t}\n\t\t\telse if (this.findNextToken(\"%\")){\n\t\t\t\tthis.matchNextToken(\"%\");\n\t\t\t\top_code = new OpMod(op_code, this.readExpressionPow());\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow this.nextTokenExpected(\"\\\"*\\\", \\\"/\\\" or \\\"%\\\"\");\n\t\t\t}\n\t\t}\n\t\treturn op_code;\n\t}", "title": "" }, { "docid": "572d6a29f60d6c38bc906efad037098f", "score": "0.53986084", "text": "function getExpressionOffset(command, start)\r\n{\r\n if (typeof start === 'undefined')\r\n start = command.length;\r\n\r\n var bracketCount = 0, instr = false;\r\n\r\n // When completing []-accessed properties, start instead from the last [.\r\n var lastBr = command.lastIndexOf(\"[\", start);\r\n if (lastBr !== -1 && /^\" *$/.test(command.substring(lastBr+1, start)))\r\n start = lastBr;\r\n\r\n for (var i = start-1; i >= 0; --i)\r\n {\r\n var c = command[i];\r\n if (reOpenBracket.test(c))\r\n {\r\n if (bracketCount)\r\n --bracketCount;\r\n else\r\n break;\r\n }\r\n else if (reCloseBracket.test(c))\r\n {\r\n var next = command[i + 1];\r\n if (bracketCount === 0 && next !== \".\" && next !== \"[\")\r\n break;\r\n else\r\n ++bracketCount;\r\n }\r\n else if (bracketCount === 0)\r\n {\r\n if (c === '\"') instr = !instr;\r\n else if (instr || reJSChar.test(c) || c === \".\" ||\r\n (c === \"%\" && command[i-1] === \".\"))\r\n ;\r\n else\r\n break;\r\n }\r\n }\r\n ++i;\r\n\r\n // The 'new' operator has higher precedence than function calls, so, if\r\n // present, it should be included if the expression contains a parenthesis.\r\n var ind = command.indexOf(\"(\", i+1);\r\n if (i-4 >= 0 && ind !== -1 && ind < start && command.substr(i-4, 4) === \"new \")\r\n {\r\n i -= 4;\r\n }\r\n\r\n return i;\r\n}", "title": "" }, { "docid": "1a6d8c760c60e6b818df0fff8dbe0f40", "score": "0.53928775", "text": "function getOperator(operator){\n\tconsole.log(operator.innerHTML)\n\t\n}", "title": "" }, { "docid": "62a79ecc66e6de0f8bb9811d9122710e", "score": "0.5360461", "text": "function getVariableFromField(){\n //step1: \n let operator\n //loop through the array of the number/signs we have.\n operand.forEach(element => {\n //if the element will have is not a number, \n //then make operator to be equal to the element\n if (isNaN(element)) {\n operator = element \n }\n });\n //step2:\n let operatorIndex = operand.indexOf(operator)\n //step 3&4\n //first number after we have joined the array\n\n let firstNumber = parseInt(operand.slice(0, operatorIndex).join(\"\"))\n let secondNumber = parseInt(operand.slice(operatorIndex +1, operand.length).join(\"\"))\n \n console.log([firstNumber, secondNumber, operatorIndex])\n \n return [firstNumber, secondNumber, operatorIndex]\n\n //it will return an array that will collect firstNUmber and secondNumber\n}", "title": "" }, { "docid": "71bf468de4f5cbc19398827f7c32ccf0", "score": "0.53517455", "text": "function GetWord(s, pos)\n{\n if(pos < 0)\n return null;\n\n\n if(s === \"\")\n return null;\n\n var rightPos = pos;\n var leftPos = pos;\n \n while (true)\n {\n \n if (rightPos >= s.length)\n break;\n\n if (s[rightPos] == \"(\")\n return null; // if found a opening bracket it is a function. we don't like functions\n\n if (s[rightPos] == \" \" || s[rightPos] == \"\\t\")\n {\n // just look 1 more square a head. see if this is actually a function.\n // some people leave spaces when calling functions. (i do too sometimes)\n if (s[rightPos + 1] == \"(\")\n return null;\n\n rightPos--;\n break;\n }\n\n if (s[rightPos] === \".\" ||\n s[rightPos] === \"[\" ||\n s[rightPos] === \",\" ||\n s[rightPos] === \";\" ||\n s[rightPos] === \"+\" ||\n s[rightPos] === \"-\" ||\n s[rightPos] === \"/\" ||\n s[rightPos] === \"*\" ||\n s[rightPos] === \")\" ||\n s[rightPos] === \"]\"\n )\n {\n rightPos--;\n break;\n }\n\n rightPos++;\n \n \n }\n \n while (true)\n {\n if (s[leftPos] == \" \" ||\n s[leftPos] == \"\\t\" ||\n s[leftPos] == \"[\" ||\n s[leftPos] == \"(\" ||\n s[leftPos] == \",\" ||\n s[leftPos] == \"+\" ||\n s[leftPos] == \"-\" ||\n s[leftPos] == \"/\" ||\n s[leftPos] == \"*\" ||\n s[leftPos] == \";\" ||\n s[leftPos] == \"=\" ||\n s[leftPos] == \"&\" ||\n s[leftPos] == \"@\")\n {\n leftPos++;\n break;\n }\n\n if (leftPos <= 0)\n break;\n \n leftPos--;\n \n }\n\n return s.substr(leftPos, rightPos - leftPos + 1).match(/^((::)?[_a-zA-Z][_a-z0-9A-Z.]?)+$/);\n}", "title": "" }, { "docid": "89fb70560ef6dc01aae9a97b60b84ad7", "score": "0.533616", "text": "function parseExpressionAt(A,t,e){var i=new n.Parser(e,A,t);return i.nextToken(),i.parseExpression()}", "title": "" }, { "docid": "7a1ba44c76168305f33a690c50e1bcfe", "score": "0.53247225", "text": "function IsOperator(strArg)\r\n{\r\n if (lstArithOps.indexOf(strArg) >= 0 || lstCompaOps.indexOf(strArg) >= 0)\r\n return true;\r\n return false;\r\n}", "title": "" }, { "docid": "713430b0cf0dfcfed614509346e69b3b", "score": "0.5321681", "text": "function parse_operator_type(op, def) {\n\top = ''+op;\n\tif(op.indexOf(':') === -1) {\n\t\treturn def || 'boolean';\n\t}\n\treturn op.split(':')[1];\n}", "title": "" }, { "docid": "32291460ce6c6f403c42c739fb97eabd", "score": "0.5317872", "text": "function POS_str(var_names, lambda_or_fcn_bits){\n if(typeof lambda_or_fcn_bits === \"object\")\n return get_SOP_or_POS(var_names, lambda_or_fcn_bits, 0);\n else \n return get_SOP_or_POS(var_names, \n apply_user_TT_func(var_names.length, lambda_or_fcn_bits), 0);\n}", "title": "" }, { "docid": "8ded69d539bdf5f017c09224ff45c77a", "score": "0.531718", "text": "function getPosition(input){\n var singleDirections = input.split('');\n var counter = 0;\n var position = 0;\n for (var i = 0; i < singleDirections.length; i++) {\n position += 1;\n if(singleDirections[i] === '('){\n counter += 1;\n if(counter === -1){\n console.log(position, \"position\");\n break;\n }\n } else {\n counter -= 1;\n if(counter === -1){\n console.log(position, \"position\");\n break;\n }\n }\n }\n}", "title": "" }, { "docid": "81d746a7512ae4d55d8f9bbf7fd23cbb", "score": "0.5307319", "text": "function isOperator(str) {\n if (str == \"*\") return true;\n else if (str == \"+\") return true;\n else if (str == \"-\") return true;\n else if (str == \"/\") return true;\n else if (str == \"%\") return true;\n else return false;\n}", "title": "" }, { "docid": "4813069d458c960dce008aa0f1d64897", "score": "0.5305956", "text": "function unsafePeek (l) {\n\t\treturn input.substr(position,l)\n\t}", "title": "" }, { "docid": "726bda648c19c7198fec50a4df016362", "score": "0.5291725", "text": "function matrix2position(str) {\n var match = str.match(/^\\w+\\((.+)\\)/);\n if (!match) {\n return [0, 0];\n }\n return match[1].split(/,\\s+/).map(Number).slice(-2);\n}", "title": "" }, { "docid": "a89230218b9861d3aff476e4a6da183c", "score": "0.5278338", "text": "function peek() {\n return input.charAt(pos);\n }", "title": "" }, { "docid": "ea6d412604ab9a6cfdd4d2ad734df251", "score": "0.52599853", "text": "function parse_PtgExp(blob, length, opts) {\n blob.l++;\n if (opts && opts.biff == 12) return [blob.read_shift(4, 'i'), 0];\n var row = blob.read_shift(2);\n var col = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);\n return [row, col];\n }", "title": "" }, { "docid": "ea6d412604ab9a6cfdd4d2ad734df251", "score": "0.52599853", "text": "function parse_PtgExp(blob, length, opts) {\n blob.l++;\n if (opts && opts.biff == 12) return [blob.read_shift(4, 'i'), 0];\n var row = blob.read_shift(2);\n var col = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);\n return [row, col];\n }", "title": "" }, { "docid": "1daf9eabe41b188b7345f738af9d2b36", "score": "0.5249044", "text": "function parse_PtgExp(blob, length, opts) {\n\tblob.l++;\n\tif(opts && opts.biff == 12) return [blob.read_shift(4, 'i'), 0];\n\tvar row = blob.read_shift(2);\n\tvar col = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);\n\treturn [row, col];\n}", "title": "" }, { "docid": "1daf9eabe41b188b7345f738af9d2b36", "score": "0.5249044", "text": "function parse_PtgExp(blob, length, opts) {\n\tblob.l++;\n\tif(opts && opts.biff == 12) return [blob.read_shift(4, 'i'), 0];\n\tvar row = blob.read_shift(2);\n\tvar col = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);\n\treturn [row, col];\n}", "title": "" }, { "docid": "1daf9eabe41b188b7345f738af9d2b36", "score": "0.5249044", "text": "function parse_PtgExp(blob, length, opts) {\n\tblob.l++;\n\tif(opts && opts.biff == 12) return [blob.read_shift(4, 'i'), 0];\n\tvar row = blob.read_shift(2);\n\tvar col = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);\n\treturn [row, col];\n}", "title": "" }, { "docid": "1daf9eabe41b188b7345f738af9d2b36", "score": "0.5249044", "text": "function parse_PtgExp(blob, length, opts) {\n\tblob.l++;\n\tif(opts && opts.biff == 12) return [blob.read_shift(4, 'i'), 0];\n\tvar row = blob.read_shift(2);\n\tvar col = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);\n\treturn [row, col];\n}", "title": "" }, { "docid": "1daf9eabe41b188b7345f738af9d2b36", "score": "0.5249044", "text": "function parse_PtgExp(blob, length, opts) {\n\tblob.l++;\n\tif(opts && opts.biff == 12) return [blob.read_shift(4, 'i'), 0];\n\tvar row = blob.read_shift(2);\n\tvar col = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);\n\treturn [row, col];\n}", "title": "" }, { "docid": "1daf9eabe41b188b7345f738af9d2b36", "score": "0.5249044", "text": "function parse_PtgExp(blob, length, opts) {\n\tblob.l++;\n\tif(opts && opts.biff == 12) return [blob.read_shift(4, 'i'), 0];\n\tvar row = blob.read_shift(2);\n\tvar col = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);\n\treturn [row, col];\n}", "title": "" }, { "docid": "80620ef45e486c4d724f88e854c8961c", "score": "0.52393144", "text": "peek() { return this.string[this.index]; }", "title": "" }, { "docid": "f47980b9a0aa7614178dee3a09e49580", "score": "0.52367526", "text": "function parse_PtgExp(blob, length, opts) {\n blob.l++;\n if (opts && opts.biff == 12) return [blob.read_shift(4, 'i'), 0];\n var row = blob.read_shift(2);\n var col = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);\n return [row, col];\n }", "title": "" }, { "docid": "144375bfcbbfdc5fd3f11c3412264ea5", "score": "0.5236211", "text": "function repairOperators(exp)\n{\n\t\n\tvar rx = /([\\^\\*\\+\\/\\-]{2,})/g;\n\t\n\texp = exp.replace(rx, useFirstOp);\n\t\n\trx = /(\\()([\\^\\*\\+\\/\\-!]+)([A-Za-z0-9~])/g;\n\t\n\texp = exp.replace(rx, \"$1$3\");\n\t\n\t//maybeTODO: temporarily removed * and !\n\trx = /([A-Za-z0-9~])([\\^\\+\\/\\-!]+)(\\))/g;\n\t\n\texp = exp.replace(rx, \"$1$3\");\n\t\n\treturn exp;\n}", "title": "" }, { "docid": "29422e0342f98b41d27aaa365fa2d86d", "score": "0.5217805", "text": "function store(){\r\n //getting input string from text field of html\r\n inputElement = document.getElementById('numtxt').value\r\n //last position of the input string\r\n lastindex = inputElement.length-1\r\n /* comparing the input string to operands and storing the value to\r\n global variable 'addop' which is operator, 'number1' which stores\r\n the value of string before the operator and 'number2' which stores the \r\n value of string which comes after the operator.\r\n */\r\n for(var i=0;i<lastindex;i++){\r\n for(var j=0;j<operands.length;j++){\r\n if(inputElement.charAt(i)==operands[j]){\r\n //addop(global varialble) to store the operator of input string\r\n addop = inputElement.charAt(i)\r\n //number1(global variable) to store number which comes before the\r\n //operator of input string\r\n number1 = inputElement.substring(0,i)\r\n //number2(global variable) to store number which comes after the\r\n //operator of input string\r\n number2 = inputElement.substr(i+1,lastindex)\r\n console.log(number1)\r\n console.log(addop)\r\n console.log(number2)\r\n console.log(typeof(number2))\r\n }\r\n }\r\n } \r\n }", "title": "" }, { "docid": "bef239181d9d1133e4a07b6381ebf6eb", "score": "0.5216871", "text": "function solveExpressionRegex(exp) {\n\texp = exp.replace(\"=\", \"==\").replace(\"--\", \"+\");\n\tfor (var i = 0; i < 10; i++) {\n\t\tif (eval(exp.replace(/\\?/g, i)) && !exp.includes(i)) {\n\t\t\tif (!/^00+$/.test(exp.replace(/\\?/g, i).split(\"==\")[1])) return i;\n\t\t}\n\t}\n\treturn -1;\n}", "title": "" }, { "docid": "5307d96d2db17a695d76c5c68e172982", "score": "0.52101636", "text": "function storeOperator(op) {\n if (op.indexOf(\"*\") > -1) {\n operator = 1;\n }; //codes for *\n if (op.indexOf(\"/\") > -1) {\n operator = 2;\n }; // slash (divide)\n if (op.indexOf(\"+\") > -1) {\n operator = 3;\n }; // sum\n if (op.indexOf(\"-\") > -1) {\n operator = 4;\n }; // difference\n memory = current_input; //store value\n current_input = \"0\";\n}", "title": "" }, { "docid": "eca27936dda9f9cfcd9f29463fc63843", "score": "0.5199229", "text": "function getOperator() {\n var node = {\n type: 'Operator',\n info: getInfo(),\n value: scanner.token.value\n };\n\n scanner.next();\n\n return node;\n}", "title": "" }, { "docid": "aa1e52af730339f64983f676f3e37ccc", "score": "0.51975346", "text": "function getWord(str, pos) {\n return (str.charCodeAt(pos) << 8) + str.charCodeAt(pos+1)\n }", "title": "" }, { "docid": "cee555c7788773c9d70a75e0f162734a", "score": "0.5195513", "text": "function isOperator0(x) {\n\t\treturn [\"+\", \"-\", \"±\", \"*\", \"=\", \">\", \"<\", \"≥\", \"≤\", \"≠\", \"→\", \" \", \"〔\", \"〕\", \":\"].includes(input[x]);\n\t}", "title": "" }, { "docid": "7852ebe9f58191dfb28b87cc63b5821b", "score": "0.51948565", "text": "function get_op(format) {\n var index = find_op(format);\n if (format[index] == \"o\") {\n return \"or\";\n }\n return \"and\";\n }", "title": "" }, { "docid": "e807ac1221c57d60133dac107c86d9a8", "score": "0.5193894", "text": "function extract(str, open, close) {\n\n\t var start,\n\t level = 0,\n\t matches = [],\n\t re = new RegExp('('+open.source+')|('+close.source+')', 'g')\n\n\t str.replace(re, function(_, open, close, pos) {\n\n\t // if outer inner bracket, mark position\n\t if (!level && open) start = pos\n\n\t // in(de)crease bracket level\n\t level += open ? 1 : -1\n\n\t // if outer closing bracket, grab the match\n\t if (!level && close != null) matches.push(str.slice(start, pos+close.length))\n\n\t })\n\n\t return matches\n\t }", "title": "" }, { "docid": "b1e41d51a706d761c33374cc71167f96", "score": "0.519024", "text": "function extract(str, open, close) {\n\n\t var start,\n\t level = 0,\n\t matches = [],\n\t re = new RegExp('('+open.source+')|('+close.source+')', 'g')\n\n\t str.replace(re, function(_, open, close, pos) {\n\n\t // if outer inner bracket, mark position\n\t if(!level && open) start = pos\n\n\t // in(de)crease bracket level\n\t level += open ? 1 : -1\n\n\t // if outer closing bracket, grab the match\n\t if(!level && close != null) matches.push(str.slice(start, pos+close.length))\n\n\t })\n\n\t return matches\n\t }", "title": "" }, { "docid": "1660ae4264cd1a8a31c137e561cd71e6", "score": "0.51872885", "text": "function parseExpressionAt(input,pos,options){var p=new Parser(options,input,pos);p.nextToken();return p.parseExpression();}// Acorn is organized as a tokenizer and a recursive-descent parser.", "title": "" }, { "docid": "0811ff30db6066e6e9c73915bcb2f0df", "score": "0.5186697", "text": "function CalcPop (str) {\r\n var p = 0;\r\n for (var i = 2; i < str.length; ) {\r\n\tp += bitPop[str.charCodeAt (i++)];\r\n }\r\n return p;\r\n}", "title": "" }, { "docid": "add5c76dd1fd04a8250cd2b503cd6418", "score": "0.518276", "text": "function ifExpression(expression,order) {\n\tvar operator=null;\n\tif (expression.match(\"==\") !=null)\n\t{\n\t\toperator=\"==\";\n\t}\n\telse if (expression.match(\">\") !=null)\n\t{\n\t\toperator=\">\";\n\t}\n\telse if (expression.match(\"<\") !=null)\n\t{\n\t\toperator=\"<\";\n\t}\n\telse if (expression.match(\"!=\") !=null)\n\t{\n\t\toperator=\"!=\";\n\t}\n\tif(order==0)\n\t\tvar regex = new RegExp(\"(.+)\" +operator );\n\telse if(order==1)\n\t\tvar regex = new RegExp(operator+\"(.+)\" );\n\n\n\tvar matchedText=expression.match(regex)[1];\n\n\treturn matchedText;\n\n\n}", "title": "" }, { "docid": "104ac94d8654f20e85059cafc57e6ceb", "score": "0.51821053", "text": "function findRelativeCodes(operatorObj, firstDigit){\n return operatorObj.filter(function(op){ return (op[0].toString()[0] == firstDigit.toString()) }).map(function(obj){return obj[0]; })\n }", "title": "" }, { "docid": "54fb0c0b41683b8ece12a9f775daf77a", "score": "0.5169351", "text": "function parseExpression() {\n var start = index;\n while (!eof()) {\n chr = peek();\n if (isStringStart(chr)) {\n parseString();\n } else if (isExpStart(chr)) {\n parseSpecialExp(chr);\n } else if (chr === pipeChr) {\n next();\n chr = peek();\n if (chr === pipeChr) {\n next();\n } else {\n if (state === startState || state === filterArgState) {\n state = filterState;\n }\n break;\n }\n } else if (chr === spaceChr && (state === filterNameState || state === filterArgState)) {\n eatSpace();\n break;\n } else {\n if (state === filterState) {\n state = filterNameState;\n }\n next();\n }\n }\n\n return str.slice(start + 1, index) || null;\n}", "title": "" }, { "docid": "54fb0c0b41683b8ece12a9f775daf77a", "score": "0.5169351", "text": "function parseExpression() {\n var start = index;\n while (!eof()) {\n chr = peek();\n if (isStringStart(chr)) {\n parseString();\n } else if (isExpStart(chr)) {\n parseSpecialExp(chr);\n } else if (chr === pipeChr) {\n next();\n chr = peek();\n if (chr === pipeChr) {\n next();\n } else {\n if (state === startState || state === filterArgState) {\n state = filterState;\n }\n break;\n }\n } else if (chr === spaceChr && (state === filterNameState || state === filterArgState)) {\n eatSpace();\n break;\n } else {\n if (state === filterState) {\n state = filterNameState;\n }\n next();\n }\n }\n\n return str.slice(start + 1, index) || null;\n}", "title": "" }, { "docid": "5d70618e9a2fe9aae72b38b9fb45aa57", "score": "0.5167169", "text": "function parseExpression() {\n\t var start = index;\n\t while (!eof()) {\n\t chr = peek();\n\t if (isStringStart(chr)) {\n\t parseString();\n\t } else if (isExpStart(chr)) {\n\t parseSpecialExp(chr);\n\t } else if (chr === pipeChr) {\n\t next();\n\t chr = peek();\n\t if (chr === pipeChr) {\n\t next();\n\t } else {\n\t if (state === startState || state === filterArgState) {\n\t state = filterState;\n\t }\n\t break;\n\t }\n\t } else if (chr === spaceChr && (state === filterNameState || state === filterArgState)) {\n\t eatSpace();\n\t break;\n\t } else {\n\t if (state === filterState) {\n\t state = filterNameState;\n\t }\n\t next();\n\t }\n\t }\n\t\n\t return str.slice(start + 1, index) || null;\n\t}", "title": "" }, { "docid": "5d70618e9a2fe9aae72b38b9fb45aa57", "score": "0.5167169", "text": "function parseExpression() {\n\t var start = index;\n\t while (!eof()) {\n\t chr = peek();\n\t if (isStringStart(chr)) {\n\t parseString();\n\t } else if (isExpStart(chr)) {\n\t parseSpecialExp(chr);\n\t } else if (chr === pipeChr) {\n\t next();\n\t chr = peek();\n\t if (chr === pipeChr) {\n\t next();\n\t } else {\n\t if (state === startState || state === filterArgState) {\n\t state = filterState;\n\t }\n\t break;\n\t }\n\t } else if (chr === spaceChr && (state === filterNameState || state === filterArgState)) {\n\t eatSpace();\n\t break;\n\t } else {\n\t if (state === filterState) {\n\t state = filterNameState;\n\t }\n\t next();\n\t }\n\t }\n\t\n\t return str.slice(start + 1, index) || null;\n\t}", "title": "" }, { "docid": "adb02c7d0779ced8b20775a4d07f4ece", "score": "0.51624924", "text": "peek() {\n return this.string.charCodeAt(this.pos);\n }", "title": "" }, { "docid": "44557244c8e28245fdd6043492fe31a8", "score": "0.51445746", "text": "function parse(s) {\n\ts = s.replace(/ /g,'');\n\tif(s=='') {return [];}\n\tvar s1 = [];\n\tvar s2 = [];\n\tif(isQ(s)) {\n\t\ts1 = parse(s.substring(2));\n\t\treturn s1.length ? ['Q',s,s.charAt(0),s.charAt(1),s1] : [];\n\t}\n\tif(isU(s[0])) {\n\t\ts1 = parse(s.substring(1));\n\t\treturn s1.length ? ['U',s,s[0],s1] : [];\n\t}\n\tif(s[0] =='(' && s[s.length-1]==')') {\n\t\tvar a = gSub(s);\n\t\tif(a.indexOf(undefined)>=0 || a.indexOf('')>=0) {\n\t\t\treturn [];\n\t\t} else {\n\t\t\ts1 = parse(a[0]);\n\t\t\ts2 = parse(a[2]);\n\t\t\tif(s1.length && s2.length) {\n\t\t\t\treturn ['B',s,s1,a[1],s2];\n\t\t\t} else {return [];}\n\t\t}\n\t}\n\tif(isAt(s)) {\n\t\tif(s.length==1) {\n\t\t\treturn ['0p',s,s];\n\t\t}\n\t\tif(s.length==2) {\n\t\t\treturn ['1p',s,s[0],s[1]];\n\t\t} \n\t\tif(s.length==3 && s[1]=='=') {\n\t\t\treturn ['=',s,s[1],s[0],s[2]];\n\t\t}\n\t\tif(s.length==3) {\n\t\t\treturn ['2p',s,s[0],s[1],s[2]];\n\t\t} else {return [];} // not allowing n-place predicates for n>2\n\t\n\t} else {return [];}\n}", "title": "" }, { "docid": "66acbbe2a89ea7a0fe963cd941a174e1", "score": "0.5143708", "text": "function parseParam(p) {\n\n //primitives\n if (p === '') return undefined;//todo what should we do here?\n if (p[0] === '\"') return p.substr(1, p.length - 2);\n if (p[0] === \"'\") return p.substr(1, p.length - 2);\n if (p === \"null\") return null;\n if (p === \"undefined\") return undefined;\n if (p === 'false') return false;\n if (p === 'true') return true;\n const num = parseFloat(p);\n if (num === p) return num;\n\n //<operator [*!&]{0,2}><state [a-z][a-zA-Z]*>\n const [match, op, key] = p.match(/([*!&]{0,2})([a-z][a-zA-Z]*)/) || [];\n if (match)\n return {op, key};\n throw new SyntaxError('Illegal parameter: ' + p);\n}", "title": "" }, { "docid": "ff62634797cb26c20ea9094a6e3644ab", "score": "0.51368046", "text": "static OPCODE(instruction) {\n // POS_OP == 0 (shift amount)\n // SIZE_OP == 6 (opcode width)\n return instruction & 0x3f;\n }", "title": "" }, { "docid": "34ca3bf9961126f9182b8173146f3f24", "score": "0.5134112", "text": "function parseExpression() {\n\t var start = index;\n\t while (!eof()) {\n\t chr = peek();\n\t if (isStringStart(chr)) {\n\t parseString();\n\t } else if (isExpStart(chr)) {\n\t parseSpecialExp(chr);\n\t } else if (chr === pipeChr) {\n\t next();\n\t chr = peek();\n\t if (chr === pipeChr) {\n\t next();\n\t } else {\n\t if (state === startState || state === filterArgState) {\n\t state = filterState;\n\t }\n\t break;\n\t }\n\t } else if (chr === spaceChr && (state === filterNameState || state === filterArgState)) {\n\t eatSpace();\n\t break;\n\t } else {\n\t if (state === filterState) {\n\t state = filterNameState;\n\t }\n\t next();\n\t }\n\t }\n\n\t return str.slice(start + 1, index) || null;\n\t}", "title": "" }, { "docid": "1b63a89797b89706297335b0e6e47d75", "score": "0.5127459", "text": "function parseString() {\n var startChar = S[pos];\n var startpos = ++pos;\n pos = S.indexOf(startChar, startpos)\n return S.slice(startpos, pos);\n }", "title": "" }, { "docid": "63fc11551b94b766395817abfadd58c1", "score": "0.5123673", "text": "function bracket_safe_get_operators(input)\n{\n\tif (input == null)\n\t\treturn [];\n\tif (input.length < 1)\n\t\treturn [];\n\tif (has_binary_operators(input) == false)\n\t\treturn [];\n\t\n\tvar out = [];\n\tvar position = 0;\n\tvar open_bracket = 0;\n\t\n\tfor (position=0; position<input.length; position++)\n\t{\n\t\tif (input[position] == \"(\")\n\t\t\topen_bracket++;\n\t\telse if (input[position] == \")\")\n\t\t\topen_bracket--;\n\n\t\tif (open_bracket == 0)\n\t\t\tout.push(input[position]);\n\t}\n\t// need to remove multiple operators since the sort function does not\n\tout = get_unique_tokens(out);\n\t// operation_sort will place only the operators in an array\n\t// and sort that based on precedence; returns null on no \n\t// operators found\n\treturn operation_sort(out);\n}", "title": "" }, { "docid": "a2227671db493184f134cd459c1db835", "score": "0.5123019", "text": "scanComplexOperator(start, one, twoCode, two, threeCode, three) {\n this.advance();\n let str = one;\n if (this.peek == twoCode) {\n this.advance();\n str += two;\n }\n if (threeCode != null && this.peek == threeCode) {\n this.advance();\n str += three;\n }\n return newOperatorToken(start, this.index, str);\n }", "title": "" }, { "docid": "8f0e2964a33dba46d81ba72fa49c9242", "score": "0.5115322", "text": "function parseExpression() {\n var left = parseExp1()\n while (at(['||','&&'])) {\n var op = match()\n var right = parseExp1()\n left = new BinaryExpression(op, left, right)\n }\n return left\n}", "title": "" } ]
925c0c652f5ca674f8ad72afa14eac1d
Astronomy pic of the day API w/ GET and POST routes
[ { "docid": "e01fbc9476d495502017c038872f2dc1", "score": "0.0", "text": "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 }", "title": "" } ]
[ { "docid": "cf5c44c264df3d1609879403060c5e01", "score": "0.5891342", "text": "function API(){}", "title": "" }, { "docid": "cf5c44c264df3d1609879403060c5e01", "score": "0.5891342", "text": "function API(){}", "title": "" }, { "docid": "cdf83abcd1b676f1a68845caf8e47a62", "score": "0.588472", "text": "constructor() {\n super(\"api/planetspecies\");\n this.router\n .get(\"\", this.getAll)\n .post(\"\", this.create);\n }", "title": "" }, { "docid": "a6baf024d52a4e59f4e08ef3d93f7fd5", "score": "0.57864344", "text": "async routes () {\n let { data } = await axios.post(process.env.POSTS_URL,\n JSON.stringify({\n filter: { published: true },\n sort: {_created:-1},\n populate: 1\n }),\n {\n headers: { 'Content-Type': 'application/json' }\n })\n\n const collection = collect(data.entries)\n\n let tags = collection.map(post => post.tags)\n .flatten()\n .unique()\n .map(tag => `category/${tag}`)\n .all()\n\n let posts = collection.map(post => post.title_slug).all()\n\n if(perPage < data.total) {\n let pages = collection\n .take(perPage-data.total)\n .chunk(perPage)\n .map((items, key) => `blog/${key+2}`)\n .all()\n\n return posts.concat(tags,pages)\n }\n\n return posts.concat(tags)\n }", "title": "" }, { "docid": "ddecf8945ddff25e5e4b4131df529536", "score": "0.5781799", "text": "function apiHandler(req, reply) {\n\n var rb = new RepresentationBuilder(settings.relsUrl);\n var resource = rb.create({}, req.url);\n\n // grab the routing table and iterate\n var routes = req.server.table();\n for (var i = 0; i < routes.length; i++) {\n var route = routes[i];\n\n // :\\\n var halConfig = route.settings.app && route.settings.app.hal;\n\n if (halConfig && halConfig.apiRel) {\n var rel = halConfig.apiRel;\n var href = routes[i].path;\n\n // grab query options\n if (halConfig.query) {\n href += halConfig.query;\n }\n\n // check if link is templated\n var link = new hal.Link(rb.resolve(rel), href);\n if (/{.*}/.test(href)) {\n link.templated = true;\n }\n\n // todo process validations for query parameters\n resource.link(link);\n }\n }\n\n // handle any curies\n rb.addCuries(resource);\n reply(resource).type('application/hal+json');\n }", "title": "" }, { "docid": "ce85dbbfa7c2c6c10e0537476467dd84", "score": "0.57683265", "text": "router() {\n const router = require('express').Router()\n\n router.get('/mf2json', this.mf2json)\n router.get('/mf2json/page/:page', this.mf2json)\n router.get('/mf2json/:postType', this.mf2json)\n router.get('/mf2json/:postType/page/:page', this.mf2json)\n\n router.get('/jf2', this.jf2)\n router.get('/jf2/category/:category', this.jf2)\n router.get('/jf2/type/:postType', this.jf2)\n router.get('/rss', this.rss)\n router.get('/rss/category/:category', this.rss)\n router.get('/rss/type/:postType', this.rss)\n router.get('/atom', this.atom)\n router.get('/atom/category/:category', this.atom)\n router.get('/atom/type/:postType', this.atom)\n router.get('/json', this.json)\n router.get('/json/category/:category', this.json)\n router.get('/json/type/:postType', this.json)\n\n return router\n }", "title": "" }, { "docid": "b9a80f2f7eb8dc74257aface9f3306b8", "score": "0.5712106", "text": "GET() {\n }", "title": "" }, { "docid": "dde1eebb31ff48b84fa88e97db7329ac", "score": "0.56816", "text": "function makeAPICall() {\n movieAndDinnerObject.queryURL = createUrl();\n // console.log(movieAndDinnerObject.queryURL);\n\n $.ajax({\n url: movieAndDinnerObject.queryURL,\n method: \"GET\"\n }).then(function (response) {\n buildMovieData(response);\n createTheaters();\n }).fail(function (error) {\n console.log(\"error: \" + error);\n\n });\n }", "title": "" }, { "docid": "8d21d4d09fc891ed79ec4294de80dbda", "score": "0.56565875", "text": "function submit_search_data(req, res) {\n // variables defined in\n // the Swagger document can be referenced using req.swagger.params.{parameter_name}\n\n let json = req.body;\n\n let type = json.type;\n\n if(type === \"FeatureCollection\") {\n simulatePath.calculatePathsForInput(json, res);\n }\n}", "title": "" }, { "docid": "080a14e29165b818a365276db202af94", "score": "0.56185544", "text": "api () {\r\n const router = new Router()\r\n // READ\r\n router.get('/',\r\n (req, res) => {\r\n this\r\n .getAll(req.query)\r\n .then(this.ok(res))\r\n .then(null, this.fail(res))\r\n })\r\n router.get('/:key',\r\n (req, res) => {\r\n this\r\n .get(req.params.key, req.query)\r\n .then(this.ok(res))\r\n .then(null, this.fail(res))\r\n })\r\n // CREATE\r\n router.post('/',\r\n this.requiretmobileid,\r\n (req, res, next) => this.logUserAction(req, res, next, this.name, 'POST'),\r\n (req, res) => {\r\n this\r\n .post(req.body, req.query)\r\n .then(this.ok(res))\r\n .then(null, this.fail(res))\r\n })\r\n // UPDATE\r\n router.patch('/:key',\r\n this.requiretmobileid,\r\n (req, res, next) => this.logUserAction(req, res, next, this.name, 'PATCH'),\r\n (req, res) => {\r\n this\r\n .patch(req.params.key, req.body, req.query) // query?\r\n .then(this.ok(res))\r\n .then(null, this.fail(res))\r\n })\r\n // DELETE\r\n router.delete('/:key',\r\n this.requiretmobileid,\r\n (req, res, next) => this.logUserAction(req, res, next, this.name, 'DELETE'),\r\n (req, res) => {\r\n this\r\n .delete(req.params.key, req.query)\r\n .then(this.ok(res))\r\n .then(null, this.fail(res))\r\n })\r\n\r\n return router\r\n }", "title": "" }, { "docid": "7bcf8410bf5db58024fb85a0bc40af6a", "score": "0.5606201", "text": "function movieApi(app){\n const router = express.Router();\n app.use('/api/movies', router);\n\n const moviesService = new MoviesService()\n\n router.get('/', async function(req,res,next){\n const { tags } = req.query;\n try{\n const movie = await moviesService.getMovies({tags});\n\n res.status(200).json({\n data: movie,\n menssage: 'movie listed'\n });\n }catch(err){\n next(err);\n }\n });\n\n router.get('/:movieId', async function(req,res,next){\n const { movieId } = req.params;\n try{\n const movie = await moviesService.getMovie({movieId});\n\n res.status(200).json({\n data: movie,\n menssage: 'movie retrieved'\n });\n }catch(err){\n next(err);\n }\n });\n\n router.post('/', async function(req,res,next){\n const { body: movie } = req;\n try{\n const createdMovieId = moviesService.createMovie({movie});\n\n res.status(201).json({\n data: createdMovieId,\n menssage: 'movie created'\n });\n }catch(err){\n next(err);\n }\n });\n\n router.put('/:movieId', async function(req,res,next){\n const { movieId } = req.params;\n const { body: movie } = req;\n try{\n const updateMovieId = await moviesService.updateMovie({ movieId, movie });\n\n res.status(200).json({\n data: updateMovieId,\n menssage: 'movie update'\n });\n }catch(err){\n next(err);\n }\n });\n\n router.delete('/:movieId', async function(req,res,next){\n const { movieId } = req.params;\n try{\n const deleteMovie = await moviesService.deleteMovie({ movieId });\n\n res.status(200).json({\n data: deleteMovie,\n menssage: 'movie deleted'\n });\n }catch(err){\n next(err);\n }\n });\n}", "title": "" }, { "docid": "a9e0b503585f61948f3a69c7ba5691b9", "score": "0.55730486", "text": "init() {\n this.router.get(\"/\", (req, res, next) => {\n res.status(200).json(this._service.defaultMethod());\n });\n }", "title": "" }, { "docid": "b5ad3f9a07baabdacfe4b1132813cabe", "score": "0.55569685", "text": "onRoute (info) {\n openApi.addRoute(info, {\n basePath: env.REST_API_PREFIX\n })\n }", "title": "" }, { "docid": "5828913571c9dcec49c218a2c0f522b8", "score": "0.5523321", "text": "function addRoutes(api) {\n //api.post('/api/v2/outbound/:name', postItem);\n}", "title": "" }, { "docid": "3fc0df14ef08ed85db86198bb21e8b22", "score": "0.550837", "text": "function get(req, res, next) {\n const prop = pluralize.singular(req.params.resource);\n req.query[`${prop}${opts.foreignKeySuffix}`] = req.params.id;\n req.url = `/${req.params.nested}`;\n next();\n } // Rewrite URL (/:resource/:id/:nested -> /:nested) and request body", "title": "" }, { "docid": "d9f0ed856ae3109b09947604ee19fbc4", "score": "0.5503617", "text": "function NousTrougerGet(req, res) {\n res.send('/api/noustrouver');\n}", "title": "" }, { "docid": "0510c0050bd2774eaead0073f5bc1505", "score": "0.5484867", "text": "indexAction(req, res) {\n this.jsonResponse(res, 200, { 'message': 'Default API route!' });\n }", "title": "" }, { "docid": "e8bc665f98c05df00df2d905cca3a343", "score": "0.54815465", "text": "initRoutes() {\n this.app.get(\n `${this.apiBasePath}/person/:personId/appearances`,\n (req, res, next) => {\n personController.getAppearances(req, res, next);\n },\n );\n\n this.app.get(\n `${this.apiBasePath}/person/:personId/movies`,\n (req, res, next) => {\n personController.getMovieAppearances(req, res, next);\n },\n );\n\n this.app.get(\n `${this.apiBasePath}/person/:personId/tv`,\n (req, res, next) => {\n personController.getTvAppearances(req, res, next);\n },\n );\n }", "title": "" }, { "docid": "fe7ef5dc608fee9d1fcd81600f94542d", "score": "0.54803646", "text": "function route(...etc)\n{\n etc.unshift(stockAPI);\n let sOut = etc.reduce((acc, curr)=>acc+=curr+'/');\n return sOut;\n}", "title": "" }, { "docid": "518ecda64a24a2c404b3adabebb6bd74", "score": "0.54791397", "text": "function post(req, res, next) {\n const prop = toProp(req.params.resource)\n req.body[prop] = toId(req.params.id)\n req.url = `/${req.params.nested}`\n next()\n }", "title": "" }, { "docid": "de21f08f3f4c5c065c58ad49d41215cd", "score": "0.5477415", "text": "static ROUTE_LIST () {\n const index = {\n endpoint: '/',\n type: 'get'\n }\n const create = {\n endpoint: '/create',\n type: 'get'\n }\n const store = {\n endpoint: '/',\n type: 'post'\n }\n const show = {\n endpoint: '/:id',\n type: 'get'\n }\n const edit = {\n endpoint: '/:id/edit',\n type: 'get'\n }\n const update = {\n endpoint: '/:id',\n type: 'put'\n }\n const destory = {\n endpoint: '/:id',\n type: 'delete'\n }\n return {\n index: { ...index },\n create: { ...create },\n store: { ...store },\n show: { ...show },\n edit: { ...edit },\n update: { ...update },\n destory: { ...destory },\n }\n }", "title": "" }, { "docid": "cc5ea8d431037b1c8dbef8767a289e6a", "score": "0.54740053", "text": "function getBlogViewRoutes() {\n const router = express.Router();\n // Blog routing\n // Daftar semua blog, descending date\n router.get('/', getBlogIndex);\n // Halaman membuat blog\n router.get('/create', createBlogPage);\n router.get('/about-us', getAboutPage);\n router.get('/about', redirectAboutPage);\n // Membuka halaman detail dari blog yang dipilih\n router.get('/:id', getBlogDetail);\n\n // ENDPOINT REST API\n // API untuk Mengirim kiriman data blog\n router.post('/', validateCreateBlog, createBlogPost);\n // Hapus data blog yang ditulis\n return router;\n}", "title": "" }, { "docid": "ed0d0457d6dbee0ffcc4e167045269bd", "score": "0.5459905", "text": "async function routes(fastify, options) {\n\tfastify.get('/', async (request, reply) => {\n\t\treturn { name: 'Hydrant API', version: process.env.npm_package_version, routes: 'api' }\n\t})\n\n\tfastify.get('/measurement', (request, reply) => {\n\t\tconst $top = request.query.top;\n\t\tif ($top)\n\t\t\tdb.all('SELECT * FROM Measurements LIMIT $top', { $top }, (err, rows) => {\n\t\t\t\treply.send(rows);\n\t\t\t});\n\t\telse\n\t\t\tdb.all('SELECT * FROM Measurements', (err, rows) => {\n\t\t\t\treply.send(rows);\n\t\t\t})\n\t});\n}", "title": "" }, { "docid": "6cf48dd53a2cc7946f5289e8b203741d", "score": "0.54499215", "text": "function moviesApi(app) {\n const router = express.Router();\n app.use('/api/asks', router);\n\n const asksService = new AsksService();\n\n router.get('/', async function (req, res, next) {\n cacheResponse(res, 300);\n const tags = req.query;\n\n try {\n const asks = await asksService.getAsks(tags);\n res.status(200).json({\n data: asks,\n message: 'Asks listed',\n });\n } catch (error) {\n next(error);\n }\n });\n\n router.post('/', async function (req, res, next) {\n const { body: ask } = req;\n\n try {\n const createdAskId = await asksService.createAsk({ ask });\n res.status(201).json({\n data: createdAskId,\n message: 'Ask created',\n });\n } catch (error) {\n next(error);\n }\n });\n}", "title": "" }, { "docid": "868472967a565241a2a84543c835e30c", "score": "0.54352564", "text": "async function munchEndpoints(tekst, type) {\n let headers = {\n Accept: \"application/vnd.fotoware.assetlist+json\",\n };\n // Decide whether to search through the English titles, or the Norwegian\n // Title (English)\n const api_url = `https://foto.munchmuseet.no/fotoweb/archives/${type}/?105=${tekst}`;\n // Search all available fields - q\n // const api_url = `https://foto.munchmuseet.no/fotoweb/archives/${type}/?q=${tekst}`;\n // Tittel (Norsk)\n // const api_url = `https://foto.munchmuseet.no/fotoweb/archives/${type}/?5=${tekst}`;\n const fetch_response = await fetch(api_url, {\n method: \"GET\",\n headers: headers,\n });\n const json = await fetch_response.json();\n return json;\n}", "title": "" }, { "docid": "7503cfce3402b5d0de9bef4727a1fb2b", "score": "0.54336554", "text": "init() {\n this.router.route('/')\n .get(this.getAll)\n .post(this.postHero);\n this.router.route('/:id')\n .get(this.getOne);\n }", "title": "" }, { "docid": "393de135807e27098d2b68c8014b9100", "score": "0.5420807", "text": "build_paths() {\n return {\n items: {\n list: { // Returns a list of items\n method: \"GET\",\n path: \"items\", \n }, \n item: { // Returns a single item with ID %%\n method: \"GET\",\n path: \"items/%%\"\n }, \n item_metadata: { // Returns metadata for item %%\n method: \"GET\",\n path: \"items/%%/metadata\", \n }, \n item_bitstreams: { // Returns available bitstreams for item %%\n method: \"GET\",\n path: \"items/%%/bitstreams\" \n },\n find_by_metadata: { // Returns items based on specified metadata value\n method: \"POST\",\n path: \"items/find-by-metadata-field\"\n } \n },\n query: { \n filtered_items: { // Returns items based on chosen filters\n method: \"GET\",\n path: \"filtered-items\", \n }, \n filtered_collections: { // Returns collections based on chosen filters\n method: \"GET\",\n path: \"filtered-collections\",\n }, \n collection: { // Returns collection with ID %%\n method: \"GET\",\n path: \"filtered-collections/%%\",\n } \n },\n bitstreams: { \n list: { // Returns all bitstreams in DSpace\n method: \"GET\",\n path: \"bitsreams\"\n },\n item: { // Returns an item with bitstream ID %%\n method: \"GET\",\n path: \"bitstreams/{%%}\"\n },\n item_policy: { // Returns the policy for a bitstream with ID %%\n method: \"GET\",\n path: \"bitstreams/%%/policy\"\n },\n content: { // Retrieve content for a bitstream with ID %%\n method: \"GET\",\n path: \"bitstreams/%%/retrieve\"\n }\n },\n schemas: {\n list: { // Returns a list of all schemas\n method: \"GET\",\n path: \"registries/schema\"\n },\n item: { // Returns a metadata schema with schema prefix %%\n method: \"GET\",\n path: \"registries/schema/%%\"\n },\n field: { // Returns a metadata schema with field ID %%\n method: \"GET\",\n path: \"registries/metadata-fields/%%\"\n }\n }\n };\n }", "title": "" }, { "docid": "93b4ecd6bdaa6f1a95f8adff9b6543e3", "score": "0.5410735", "text": "static apiRoute() {\n return 'api'\n }", "title": "" }, { "docid": "1a8e944ed705b30fe3b49b45a28d2336", "score": "0.5403323", "text": "function Post($resource,BaseUrl){//nos permite pillar datos de esta url\n\t\treturn $resource(BaseUrl + 'posts/:id', {id:'@id'})\n\t}", "title": "" }, { "docid": "f9fdb2588282e9f50014ac50c33f6aa3", "score": "0.540323", "text": "function homeHandler(req, res) {\n let url = `https://digimon-api.herokuapp.com/api/digimon`; // the link who has the data\n superagent.get(url)\n .then(data => { // in our exam we have simple array of objects so req.body will make us reach to any property directly\n let digiArray = data.body.map(val => { // we want to map over each element in array // data.body represent the array of objects so we use map directly \n return new Digimons(val) // creating new object depending on our constructor and do the return inside the digiArray variable that will used for index\n }) // now go to make the constructor \n res.render('index', { data: digiArray }) // we want to render on index page so we must put the path for it (but we put just 'index' because the server.js is already always exists in the route of views folder so we just write the path like we did )\n }) // { data: digiArray } , we want to know what to render and the answer is (digiArray),and data is just a key for it\n}", "title": "" }, { "docid": "ea7c2501f4feffdf47748663fe86a329", "score": "0.54003036", "text": "function moviesApi(app) {\n const router = express.Router(); // Creams un router.\n app.use('/api/movies', router); // Esta direccion usara este rourer.\n\n // Instanciamos la clase de los servicios.\n const moviesService = new MoviesService();\n\n // Este get del home se refuere a la ruta principal del router ( /api/movies ).\n // No usaremos ninguna validacion de schema para este.\n router.get('/', async function(req, res, next) {\n // Se usa try/catch porque es codigo es asincrono pero con promesas y async/await.\n\n // Establecemos la cache en 300 milisegundos como esta en la constante.\n cacheResponse(res, FIVE_MINUTES_IN_SECONDS);\n\n const { tags } = req.query; // Estos tags como vienen del query son los que se ponen el '?' el nombre del query.\n // Estos se pueden concatenar.\n\n try {\n // Vamos a filtrar por tags. Y esos tags se reciven del query de la url.\n // Lo pasamos a la capa de servicios.\n const movies = await moviesService.getMovies({ tags }); // Pedimos los datos del archivo falso.\n // Respondemos con estatus 200 y pasamos los datos que recivimos del archivo falso\n // mas un mensaje indicando lo que hicimos.\n\n //throw new Error('Inducimos error para probar el middleware de error.')\n\n res.status(200).json({ \n data: movies,\n message: 'movies listed',\n });\n } catch (err) {\n next(err); // Manejamos el error.\n }\n });\n\n // Para este get si ya que hacemos una peticion con el id y necesitamos que cumpla con el schema.\n // Esta validacion la hacemos en el llamado de la funcion. Usamos la funcion validationHandler y como parametro solo\n // necesitamos pasarle el schema y de donde sacara los datos. El schema lo pasamos con { movieId: movieIdSchema } y\n // el segundo seria params ya que ahi estara el id que queremos validar.\n router.get('/:movieId', validationHandler({ movieId: movieIdSchema }, 'params'), async function(req, res, next) {\n // Establecemos la cache en 3600 milisegundos como esta en la constante.\n cacheResponse(res, SIXTY_MINUTES_IN_SECONDS);\n\n const { movieId } = req.params;\n\n try {\n const movie = await moviesService.getMovie({ movieId });\n res.status(200).json({ \n data: movie, // Retornamos la pelicula.\n message: 'movie retrieved',\n });\n } catch (err) {\n next(err);\n }\n });\n\n // Para el post necesitamos validar el schema create ya que con post cramos una nueva movie.\n // Para este caso solo vamos a pasar el schema con el que queremos validar ya que los datos\n // los sacara del body que es el valor por defecto del segundo parametro de esta funcion.\n router.post('/', validationHandler(createMovieSchema), async function(req, res, next) {\n // Para el post los datos pasan es en el cuerpo de la peticion.\n // Entonces seria const { body } = req; Pero como no queremos que la variable\n // se llame body le ponemos un alias movie con { body: movie }\n const { body: movie } = req;\n\n try {\n const createdMovie = await moviesService.createMovie({ movie });\n res.status(201).json({ // El 201 es porque ese es el estatus code de crear.\n data: createdMovie,\n message: 'movie created',\n });\n } catch (err) {\n next(err);\n }\n });\n\n // Para este caso en el que se va a actualizar una movie. lo que se hace es colocar dos validaciones.\n // De esta manera primero valida una y luego la otra. Como necesitamos validar el id y ademas validar\n // el schema de actualizacion de movie.\n router.put(\n '/:movieId', \n validationHandler({ movieId: movieIdSchema }, 'params'), \n validationHandler(updateMovieSchema), \n async function(req, res, next) {\n // Recivimos el cuerpo y el id de la pelicula que se va a actualizar.\n const { body: movie } = req;\n const { movieId } = req.params;\n \n try {\n const updatedMovieId = await moviesService.updateMovie({ movieId, movie });\n res.status(200).json({ \n data: updatedMovieId,\n message: 'movie updated',\n });\n } catch (err) {\n next(err);\n }\n });\n\n // Reto Patch\n router.patch(\"/:movieId\", async function(req,res,next) {\n\t\tconst { movieId } = req.params;\n\t\tconst { body: movie } = req;\n\n\t\ttry {\n\t\t\tconst updatedMovieId = await moviesService.partialUpdateMovie({ movieId, movie });\n\n\t\t\tres.status(200).json({\n\t\t\t\tdata: updatedMovieId,\n\t\t\t\tmessage: \"movie updated partially\"\n\t\t\t});\n\t\t}\n\t\tcatch(error) {\n\t\t\tnext(error);\n\t\t}\n\t});\n\n // Para el delete solo hace falta validar el id.\n router.delete('/:movieId', validationHandler({ movieId: movieIdSchema }, 'params'), async function(req, res, next) {\n const { movieId } = req.params;\n\n try {\n const deletedMovieId = await moviesService.deleteMovie({ movieId });\n res.status(200).json({ \n data: deletedMovieId,\n message: 'movie deleted',\n });\n } catch (err) {\n next(err);\n }\n });\n}", "title": "" }, { "docid": "f39ca4d600e1db97df161fe9224420ee", "score": "0.5385354", "text": "index(req, res) {\n logging.logTheinfo(\"widgets index Router\");\n console.log(req.body);\n \n widgets.findAll(\n \n {}\n ).then(data=>{\n res.send(data) \n })\n }", "title": "" }, { "docid": "ecc6216954b36b04c83bcbd98a89c324", "score": "0.53813004", "text": "function contentRoutes(contentType){\n\t\n\t//client.del(contentType+'Key');\n\tapp.get('/api/'+ contentType + '/',\n\t\tfunction (req, res){\n\t\t client.hgetall(contentType + 'Key',\n\t\t\t\t function (err, reply) {\n\t\t\t\t if (err)\n\t\t\t\t\t console.log(err);\n\t\t\t\t res.json(reply);\n\t\t\t\t });\n\t\t});\n\tapp.post('/api/' + contentType + '/', isLoggedIn,\n\t\t function (req, res) {\n\t\t client.HMSET(contentType + 'Key', req.body,\n\t\t\t\t function (err, reply) {\n\t\t\t\t if (err)\n\t\t\t\t\t console.log(err);\n\t\t\t\t res.json(reply);\n\t\t\t\t });\n\t\t }); \n\t\t\t\t\t \t \n }", "title": "" }, { "docid": "2b6cc2ca21647a5c1a69476356dbb4a3", "score": "0.534261", "text": "async index(req, res){\n //pegando as techs da minha requisição\n //e achando os spots que usam ela\n const { tech } = req.query;\n const spots = await Spot.find({ techs: tech });\n\n return res.json(spots);\n }", "title": "" }, { "docid": "9289797094417c45628e6f2665bca647", "score": "0.53415567", "text": "function postRESTlet(datain) {\n\n}", "title": "" }, { "docid": "b577253e5ba579c5a8cfe5f91c537f31", "score": "0.53280085", "text": "function apiAction(action, img, label, gallery) {\n let bodyData = {\n \"image\": `${img}`,\n }\n bodyData = action !== 'detect' ? {...bodyData, \"subject_id\": `${label}`, \"gallery_name\": `${gallery}` } : bodyData;\n return fetch(`https://api.kairos.com/${action}`, {\n method: \"POST\",\n headers: {\n \"Content-type\": \"application/json\",\n \"app_id\": \"ba0a24c4\",\n \"app_key\": \"a43c8444406ffa00a859c6a95daa47c3\"\n },\n body: JSON.stringify(bodyData)\n })\n .then(data => {\n return data.json();\n })\n .then(data => {\n return data;\n })\n .catch(err => {\n return true;\n });\n}", "title": "" }, { "docid": "ada2380e84f414d8df60492bbaa00161", "score": "0.5325816", "text": "init() {\n this.router.post('/generate', (request, response, next) => {\n this.generateKeys(request, response, next);\n });\n this.router.get('/keys/:platform', (request, response, next) => {\n this.getKeys(request, response, next);\n });\n this.router.get('/validate', (request, response, next) => {\n this.validate(request, response, next);\n });\n this.router.get('/platforms', (request, response, next) => {\n this.getStatus(request, response, next);\n });\n // TODO: chenge post to delete\n this.router.delete('/delete', (request, response, next) => {\n this.deleteKey(request, response, next);\n });\n this.router.put('/status', (request, response, next) => {\n this.updateStatus(request, response, next);\n });\n }", "title": "" }, { "docid": "0c93f9bbdc78361ddfeaed421f76ed2f", "score": "0.53175604", "text": "function api(aPathParam, aQueryParam) {\n return new Promise((resolve) => {\n // Use superagent\n // FIXME - where do we get the hostname from?\n const response = {\n todos: [\n {\n text: 'Use Redux',\n completed: false,\n },\n {\n text: 'Use Saga',\n completed: false,\n },\n ],\n };\n resolve(response);\n });\n}", "title": "" }, { "docid": "e3322f4075b7d1450b3784b75412a058", "score": "0.53044504", "text": "function API(router, baseurl) {\n var wildcard = require('wildcard');\n var express = require('express');\n var expressRouter = express.Router();\n\n // handle requests to manage the routesets\n var bodyParser = require('body-parser');\n var jsonParser = bodyParser.json();\n\n expressRouter.route('/')\n .get(function (req, res) {\n res.send({\n routesets: baseurl+'/routesets'\n });\n });\n\n expressRouter.route('/routesets')\n .get(function(req, res) {\n router.getRouteSets(req.query.all !== undefined)\n .then(function (routesets) {\n res.send(\n routesets.map(function (rs) {\n return {\n name: rs.name,\n routes: rs.routes,\n self: baseurl + '/routesets/' + rs.name\n };\n }).filter(function (rs) {\n return (!req.query.name || wildcard(req.query.name,rs.name));\n })\n );\n })\n .catch(function (err) {\n res.status(500).send(err);\n });\n })\n .post(jsonParser, function(req,res) {\n var rs = req.body;\n if(!rs || !rs.name) {\n res.status(400).send('name is required');\n } else {\n router.getAppRouteSet(rs.name,true).then(function(routeset) {\n routeset.setRoutes(rs.routes);\n return routeset.store();\n }).then(function() {\n res.status(201).send('Created');\n }).catch(function (err) {\n res.status(500).send(err);\n });\n\n }\n });\n\n expressRouter.route('/routesets/:name')\n .get(function(req, res) {\n var rsName = req.params.name;\n var rs;\n if(rsName === '_default_') {\n rs = Promise.resolve(router.defaultRouteSet);\n } else {\n rs = router.getAppRouteSet(rsName);\n }\n\n rs.then(function(routeset) {\n res.send(\n {\n name: routeset.name,\n routes: routeset.routes,\n self: baseurl+'/routesets/' + routeset.name\n }\n );\n }).catch(function(err) {\n res.sendStatus(404);\n });\n })\n .put(jsonParser, function(req,res) {\n var rsName = req.params.name;\n var rs = req.body;\n\n if(rsName === '_default_') {\n res.status(400).send('_default_ cannot be update via the API');\n } else {\n router.getAppRouteSet(rsName,true).then(function (routeset) {\n routeset.setRoutes(rs.routes);\n return routeset.store();\n }).then(function(routeset) {\n res.send(\n {\n name: rsName,\n routes: routeset.routes,\n self: baseurl+'/routesets/' + rsName\n }\n );\n }).catch(function (err) {\n console.error(err);\n console.error(err.stack);\n res.status(500).send(err);\n });\n\n }\n })\n .delete(jsonParser, function(req,res) {\n var rsName = req.params.name;\n\n if(rsName === '_default_') {\n res.status(400).send('_default_ cannot be update via the API');\n } else {\n router.getAppRouteSet(rsName,true).then(function (routeset) {\n delete router.appRouteSets[rsName];\n return routeset.delete();\n }).then(function() {\n res.sendStatus(200);\n }).catch(function (err) {\n console.error(err);\n console.error(err.stack);\n res.status(500).send(err);\n });\n\n }\n });\n\n return expressRouter;\n}", "title": "" }, { "docid": "d4e582ec94ddddf7213f70cad3f91ea1", "score": "0.5298979", "text": "function getPhotoOfTheDay() {\n const apodContainer = document.getElementById(\"apodContainer\")\n var request = new XMLHttpRequest();\n var api_key = 'n4s6U5u8Tc5MzpfYauL7w9vuiVo2Z8IzIliGYFok';\n\n request.open('GET', 'https://api.nasa.gov/planetary/apod?api_key=' + api_key, true)\n request.onload = function() {\n // Begin accessing JSON data here\n var data = JSON.parse(this.response)\n\n if (request.status >= 200 && request.status < 400) {\n console.log(data);\n\n var container = document.createElement(\"div\");\n container.setAttribute(\"class\", \"apodContainer\");\n\n var title = document.createElement(\"h3\");\n title.textContent = data.title;\n title.setAttribute(\"class\", \"apodTitle\");\n\n var img = document.createElement(\"img\");\n var imageUrl = data.url;\n img.setAttribute(\"src\", imageUrl);\n img.setAttribute(\"class\", \"apodImg\");\n\n var explanation = document.createElement(\"p\");\n explanation.textContent = data.explanation;\n explanation.setAttribute(\"class\", \"apodText\");\n\n container.appendChild(img);\n container.appendChild(title);\n container.appendChild(explanation);\n\n apodContainer.children[0].appendChild(container);\n\n } else {\n console.log('error')\n }\n }\n\n request.send()\n}", "title": "" }, { "docid": "1ccb46b66910d98c34ca8583b767800e", "score": "0.52984834", "text": "function postGet() {\n key++\n retrieveData(baseUrl + apiKey)\n .then(weather => {\n\n postData('/add', {\n key: key,\n temperature: weather.main.temp,\n desc: weather.weather[0].description,\n date: newDate,\n day: day,\n userResponse: feelings,\n })\n })\n .then(\n () => {\n updateUI()\n }\n )\n}", "title": "" }, { "docid": "d980c7592d055c758a0d3d62a25390ad", "score": "0.52969307", "text": "function setApiUrl(entity, action) {\n switch(entity) {\n case \"track\":\n switch(action){\n case \"getAll\":\n return \"../api/track/getAll.php\";\n case 'getById':\n return \"../api/track/getById.php\";\n case 'search':\n return \"../api/track/search.php\";\n }\n break;\n case \"album\":\n switch(action){\n case \"getAll\":\n return \"../api/album/getAll.php\";\n case 'getById':\n return \"../api/album/getById.php\";\n case 'search':\n return \"../api/album/search.php\";\n }\n break;\n case \"artist\":\n switch(action){\n case \"getAll\":\n return \"../api/artist/getAll.php\";\n case 'getById':\n return \"../api/artist/getById.php\";\n case 'search':\n return \"../api/artist/search.php\";\n }\n break;\n case \"profile\":\n switch(action){\n case \"getProfile\":\n return \"../api/profile/get-profile.php\";\n case \"editProfile\":\n return \"../api/profile/edit-profile.php\";\n case \"changePassword\":\n return \"../api/profile/edit-password.php\";\n }\n break;\n case \"purchase\":\n switch(action){\n case \"createInvoice\":\n return \"../api/purchase/create-invoice.php\";\n }\n break;\n case \"user\":\n switch(action){\n case \"create\":\n return \"../api/user/create.php\";\n case \"validate\":\n return \"../api/user/validate.php\";\n case \"sign-out\":\n return \"../api/user/sign-out.php\";\n }\n break;\n }\n}", "title": "" }, { "docid": "bddcf90805adef18446fc1b29b648729", "score": "0.52890265", "text": "function callbackGetGenericApi(req, res) {\n var apiConfig=\n (req.method==\"GET\")?getConfig\n :(req.method==\"POST\")?postConfig:[];\n /* check first if services is not loaded */\n if (apiConfig.length==0)\n return res.json({statusCode: 404, message: \"Missing API configuration\", Data: []});\n\n ///api/:type/:path?\n /* decouple request api */\n var request = {\n type:req.params.type,\n t_type:req.params.type+\".\"+req.method,\n header:req.headers||{},\n body:req.body,\n path:req.params.path||\"\",\n query:req.query||{}\n };\n\n requestApi(apiConfig,request,function(d) {\n return res.json(d);\n })\n }", "title": "" }, { "docid": "9bf4a87112a667e58205983eb00fa86c", "score": "0.5287776", "text": "createAPI(app) {\n\n // Add swagger validation and ui.\n swagger_helper.addValidation(router, teamsSwagger);\n swagger_helper.addUI(app, teamsSwagger, 'teams');\n\n router.get(\"/\", (req, res, next) => {\n \n this.teams_dao.getTeams()\n .then((teams) => {\n res.status(200).json(teams);\n })\n .catch((err) => {\n res.status(500).json({ err: err });\n }); \n });\n\n router.post(\"/\", (req, res, next) => {\n res.status(200).json({ msg: 'Post team successful' });\n });\n\n router.put('/', (req, res, next) => {\n\n this.teams_dao.updateTeam(req.body)\n .then(() => {\n res.status(200).json({ msg: 'Put team successful' });\n })\n .catch((err) => {\n res.status(500).json({ err: err });\n }); \n });\n\n router.delete('/', (req, res, next) => {\n res.status(200).json({ msg: 'Delete team successful' });\n }); \n\n return router;\n }", "title": "" }, { "docid": "bd769bcc4afdc645f0f1ead711483fb1", "score": "0.52826446", "text": "function photo_api(picAPI) {\n request('https://images-api.nasa.gov/search?q={q}', { json: true }, (err, res, body) => {\n if (err) { return console.log(err); }\n if (res.statusCode === 200) {\n picAPI(body);\n };\n });\n }", "title": "" }, { "docid": "1e009f6ac945a1d6501f0c0bc7abe3c8", "score": "0.52771384", "text": "function indexAction() { // GET /data/\n}", "title": "" }, { "docid": "ed56fb972f17cba67fbee09da5dd9967", "score": "0.5272564", "text": "async function main() {\n const app = express();\n const port = 3000;\n const dp = DataPoint.create();\n\n // json route: /planet/:planetId.json\n\n // html route: /planet/:planetId\n\n app.listen(port, () => console.log(`Example app listening on port ${port}!`));\n}", "title": "" }, { "docid": "ba0dea9f9a68eee8cf281d3a48dc7a17", "score": "0.5254114", "text": "doRoute() {\n let routename = 'HTTP:' + this.request.method + ':' + this.url.pathname;\n this.run(routename, this.restnio.routes, \n Parser.parseFullHttpParams, this.request, this.url);\n }", "title": "" }, { "docid": "c5b68adb7e0fb747c35f5de4254f72e2", "score": "0.52537054", "text": "async index({request, response}) {\r\n\r\n\t\t\r\n\t}", "title": "" }, { "docid": "6561d0ace780cf3ae64f10fc75907c55", "score": "0.5243712", "text": "static routes() {\n\n\t\tconst keys = ['all', 'delete', 'get', 'patch', 'post', 'put'];\n\n\t\treturn MapContainer.create(...keys);\n\t}", "title": "" }, { "docid": "1155ba4690c72784edf1d649781c8f70", "score": "0.5243049", "text": "registerRoutes() {\n this.get(`/`, `version`);\n\n // Register routes for branch resources\n this.get(`/branches`, `branch-data`);\n this.get(`/branches/:id`, `branch-find`);\n this.post(`/branches`, `branch-create`);\n\n // Register routes for sales resource\n this.get(`/sales`, `sales-data`);\n this.get(`/sales/:id`, `sale-find`);\n this.post(`/sales`, `sale-create`);\n }", "title": "" }, { "docid": "9bdbd11caf2ea1d1b62c53569e3ae081", "score": "0.5239443", "text": "static head( route, params, opts = { } ) {\n const options = { ...opts, method: \"head\" };\n return iNaturalistAPI.post( route, params, options );\n }", "title": "" }, { "docid": "6445f40e79f644b2599dac25e8ed0eb4", "score": "0.5232856", "text": "_RESTfulFactory(verb, type, method, params) {\n\n this.httpHelper.blockUI.start();\n\n let paramsName = ['post', 'put'].indexOf(verb) > -1 ? 'data' : 'params';\n\n return this.$http[verb](this._getUrl(type, method), {\n [paramsName]: params\n }).then(this.httpHelper.verify, this.httpHelper.error);\n\n }", "title": "" }, { "docid": "64d9e1eacf36dcf18652b1cdc1640e95", "score": "0.5232229", "text": "function restApi(action, moreParams) {\n return boxApi.url + \"rest?action=\" + action + \"&api_key=\" + boxApi.apiKey\n + \"&auth_token=\" + boxApi.authToken + \"&\" + (moreParams || \"\");\n }", "title": "" }, { "docid": "538db15e7ec378e060a42ef7230eed16", "score": "0.52310115", "text": "function contentHelperRoutes(contentType, content){\n\t\n\tapp.get('/api/' + contentType + '/',\n\t\tfunction (req, res) {\n\t\t content.find(\n\t\t\tfunction (err, list) {\n\t\t\t if(err)\n\t\t\t\tres.send(err);\n\t\t\t \n\t\t\t var contentObject = {};\n\t\t\t for(var i in list)\n\t\t\t\tcontentObject[list[i][\"id\"]] = {\n\t\t\t\t name : list[i][\"name\"],\n\t\t\t\t description : list[i][\"description\"],\n\t\t\t\t imgUrl : list[i][\"imgUrl\"]\n\t\t\t\t};\n\t\t\t \n\t\t\t res.json(contentObject); \n\t\t\t});\n\t\t \n\t\t});\n\tapp.post('/api/' + contentType + '/', isLoggedIn,\n\t\t function (req, res) {\n\t\t content.findOne(\n\t\t\t {\n\t\t\t 'name' : req.body.name\n\t\t\t },\n\t\t\t function (err, someThing) {\n\t\t\t if (err)\n\t\t\t\t res.send(err);\n\t\t\t if (someThing)\n\t\t\t\t res.json({ message : 'already exist'});\n\t\t\t else{\n\t\t\t\t var newObject = new content;\n\t\t\t\t newObject.name = req.body.name;\n\t\t\t\t newObject.description = req.body.description;\n\t\t\t\t newObject.imgUrl = req.body.imgUrl;\n\t\t\t\t newObject.save(\n\t\t\t\t function (err) {\n\t\t\t\t\t if (err) \n\t\t\t\t\t throw err;\n\t\t\t \t res.json({ message: 'OK' });\n\t\t\t\t });\n\t\t\t }\t\t\t\t\t\n\t\t\t });\n\t\t });\t\n\tapp.delete('/api/' + contentType + '/:id', isLoggedIn,\n\t\t function (req, res) {\n\t\t content.remove({ _id : req.params.id },\n\t\t\t\t function (err, someThing){\n\t\t\t\t\t if (err)\n\t\t\t\t\t res.send(err);\n\t\t\t\t\t res.json({message : 'OK'});\n\t\t\t\t });\n\t\t });\n\t\n }", "title": "" }, { "docid": "ab4e53d30f11989fc7015b7327b73d53", "score": "0.52286", "text": "function postDataToApi() {\n var datePickerVal = $(\"#p-date\").val();\n var post = {\n title: $(\"#p-title\").val(),\n date: new Date(datePickerVal + \" 0:0:0\"),\n description: $(\"#p-desc\").val(),\n type: state.type\n };\n\n if (state.type === \"text\") {\n post.description = $(\"#p-desc\").val();\n } else if (state.type === \"video\") {\n post.video_url = getId($(\"#yt-desc\").val());\n } else if (state.type === \"image\") {\n post.image_url = $(\"#img-desc\").val();\n } else {\n post.location = {\n lat: $(\"#gm-lat\").val(),\n lng: $(\"#gm-lng\").val()\n };\n }\n\n const settings = {\n url: \"/api/posts\",\n data: JSON.stringify(post),\n dataType: \"json\",\n contentType: \"application/json\",\n type: \"POST\",\n headers: {\n Authorization: `Bearer ${state.token}`\n },\n success: function(data) {\n getDataFromApi();\n },\n error: function(error) {\n console.log(\"error\", error);\n }\n };\n $.ajax(settings);\n}", "title": "" }, { "docid": "3f3d1e5e14e8adc16977c3f1197bdf71", "score": "0.52266794", "text": "function homePage(req,res) {\r\n superagent.get('https://digimon-api.herokuapp.com/api/digimon')\r\n .then((data)=>{\r\n let allDigimon = data.body.map((val)=>{\r\n return new Digimon(val);\r\n })\r\n res.render('digimonExam/index', {results:allDigimon});\r\n }).catch((err)=>errorHandler(err,req,res));\r\n}", "title": "" }, { "docid": "3f0e659a2f9dbb91e060c6faa0e21e1d", "score": "0.5212619", "text": "postview(filmRef) {\n return apiClient.post(`films/view`, { filmRef: filmRef })\n }", "title": "" }, { "docid": "56fc72a46839969b6cff8ca1dc8d22c3", "score": "0.52059054", "text": "function controller(app) {\n\n app.get(\"/homepage\", function (req, res) {\n if (!req.user) {\n // The user is not logged in, send back an empty object\n res.render(\"login\", {})\n } else {\n // Otherwise send back the user's email and id\n // Sending back a password, even a hashed password, isn't a good idea\n res.render(\"homepage\", {})\n };\n \n });\n\n app.get(\"/api/discussion\", function (req, res) {\n console.log(\"hello world 2\")\n res.render(\"discussion\", {})\n });\n\n app.get(\"/api/results\", function (req, res) {\n console.log(\"hello world\")\n res.render(\"results\", {})\n });\n\n app.get(\"/api/anis\", function (req, res) {\n res.render(\"homepage\");\n });\n\n app.post(\"/api/anis\", function (req, res) {\n db.User.create({ username: req.body.usrname, password: req.body.psw}).then((result)=>{\n console.log(result.dataValues.username)\n var obj = {\n username: result.dataValues.username.toUpperCase(),\n password: result.dataValues.password\n };\n res.render(\"homepage\", obj)\n });\n });\n\n app.get(\"/api/all\", function(req, res) {\n\n // Finding all Chirps, and then returning them to the user as JSON.\n // Sequelize queries are asynchronous, which helps with perceived speed.\n // If we want something to be guaranteed to happen after the query, we'll use\n // the .then function\n db.Post.findAll({}).then(function(results) {\n // results are available to us inside the .then\n res.json(results);\n });\n\n });\n\n // Add a chirp\n app.post(\"/api/new\", function(req, res) {\n\n console.log(\"Post Data:\");\n console.log(req.body);\n\n db.Post.create({\n author: req.body.author,\n body: req.body.body,\n }).then(function(results) {\n // `results` here would be the newly created chirp\n res.end();\n });\n\n });\n\n}", "title": "" }, { "docid": "0bcb3a45c7c954f5ac02ee0595bf218f", "score": "0.5184172", "text": "post(...args) {\n this.route('post', ...args);\n }", "title": "" }, { "docid": "95f19736ab42bf350ec9b7c03815622d", "score": "0.51737446", "text": "async index(req, res) {\n // Usando a filtragem por tecnologias usando req.query\n const { tech } = req.query;\n\n // Listando os spots que possuem a tech indicada acima.\n const spots = await Spot.find({ techs: tech });\n\n return res.json(spots);\n }", "title": "" }, { "docid": "cd479903d15e57b8fa44d8bd92b5fbb4", "score": "0.51720226", "text": "post(uri, action) {\n\n this.route('POST', uri, action);\n }", "title": "" }, { "docid": "111bbeb9611fbb62bd234066de6d1b32", "score": "0.5171524", "text": "function handleSubmit(e) {\n e.preventDefault();\n //get the value input in a readable format for the API call\n let inputReadyForUrl = formatInput(input.value);\n\n //launch the API request and return an object of movies\n postRequest(inputReadyForUrl);\n}", "title": "" }, { "docid": "74cc924c17ea77a0c1560cb9ad704ca9", "score": "0.5170344", "text": "init(): void {\n this.router.post('/progress/:taskUUID/:progress', this.dispatchProgress);\n this.router.post('/message/:taskUUID', this.dispatchMessages);\n this.router.post('/prompt/:taskUUID/:type', this.dispatchWithResponsePrompt);\n this.router.post('/manageTasks/:taskUUID', this.dispatchManageTasks);\n }", "title": "" }, { "docid": "ac6a7fb2b8b7db59e235eaba0b0610bd", "score": "0.5166848", "text": "_registerRoutes() {\n this.app.get('/:guild/metrics', (req, res) => {\n let guild = this.guilds.guilds[req.params.guild];\n if (typeof guild !== 'undefined') {\n guild.getMetrics((contentType, metrics) => {\n res.set('Content-Type', contentType);\n res.end(metrics);\n });\n } else {\n res.send('Guild not found');\n }\n });\n }", "title": "" }, { "docid": "2af65212d15048dd87cbbdcf4fc62e90", "score": "0.5160698", "text": "getMetaData(recId){\n if(this.unmounted) return\n var metaBody = {recId: recId};\n\n fetch('/api/recipemeta', {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(metaBody)\n })\n .then(res => res.json())\n .then(res => {\n // console.log(res);\n //server replies with the mongo id that the recipe is saved with\n // console.log(res.data);\n //generate express API path with mongo id parameter and call getRecipe function with that path\n let recipeGet = '/api/recipes/'+res;\n this.getRecipe(recipeGet);\n });\n }", "title": "" }, { "docid": "690a13021b71d0f52feb5618d98ac147", "score": "0.51598346", "text": "function atRiskAPICall() {\n\tvar data = {\n\t\t\"data\": {\n\t\t\t\"filters\": [\n\t\t\t\t{\n\t\t\t\t\"fieldName\": \"animals.priority\",\n\t\t\t\t\"operation\": \"lessthan\",\n\t\t\t\t\"criteria\": 1\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t};\n\t$.ajax({\n\t\turl: rgUrl + \"search/available/dogs/haspic?include=pictures&limit=50\",\n\t\tmethod: \"POST\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/vnd.api+json\",\n\t\t\t\"Authorization\": rgKey,\n\t\t},\n\t\tdata: JSON.stringify(data)\n\t}).then(function(response) {\n\t\tatRiskPets(response);\n\t});\n}", "title": "" }, { "docid": "419ca5077cfaab0217cd703cf750b5da", "score": "0.51512486", "text": "all(){\nreturn this.post(Config.API_URL + Constant.REFFERAL_ALL);\n}", "title": "" }, { "docid": "d9391df63ba704b4eaf39ba1d51896ff", "score": "0.51400876", "text": "function apis (req, res, next) {\n const headers = [\n {'header': 'X-Api-Key', 'value': app.settings.apiKey},\n {'header': 'X-Admin-Auth-Token', 'value': app.settings.adminWebToken},\n ];\n\n return app.helpers.ajax({\n url: `${app.settings.baseApi}/apis`,\n headers: headers\n })\n .then((e) => {\n res.setHeader('Content-Type', 'application/json');\n res.commit(e.responseText)\n })\n .catch((e) => {res.error(e)});\n }", "title": "" }, { "docid": "4f6ee631db589005705d7bf86082a601", "score": "0.5139397", "text": "function getAll(req, res) {\n // On récupère la date demandée.\n const date = req.params.date;\n\n retrieveAll(date, (jsonRes) => {\n res.status(200).json(jsonRes);\n });\n}", "title": "" }, { "docid": "d3e07be8d53f90873973f17b13425cd6", "score": "0.513726", "text": "function weatherHandler(req, res) {\n let city = req.query.search_query;\n // console.log(',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,', city)\n let key = process.env.WEATHER_API_KEY\n const url = `https://api.weatherbit.io/v2.0/forecast/daily?city=${city}&key=${key}`;\n superagent.get(url).then((wData) => {\n // console.log(wData);\n res.status(200).json(wData.body.data.map((day) => new Weather(day)));\n });\n}", "title": "" }, { "docid": "add9649c95cea79bf3a5296d155260f3", "score": "0.51366377", "text": "function getUrl() {\n url = \"https://api.nasa.gov/EPIC/api/natural/date/\" + date + \"?api_key=\" + API_KEY;\n}", "title": "" }, { "docid": "706bdff743b3409d8773d3dd0a23e5b2", "score": "0.513555", "text": "function moviesApi(app) {\n const router = express.Router();\n app.use('/api/movies', router);\n\n //Instanciando un nuevo servicio\n const moviesServices = new MoviesServices();\n\n //----------------- Aqui definimos las rutas -----------------------------\n\n //Aqui passport actua como un middleware y en este caso no requiere de un custom callback, de esta forma protegemos nuestros endpoint con passport. Cn lo que la unica manera de obtener acceso es si tenemos un jwt valido.\n router.get(\n '/',\n passport.authenticate('jwt', { session: false }),\n scopesValidationHandler(['read:movies']),\n async function(req, res, next) {\n cacheResponse(res, FIVE_MINUTES_IN_SECONDS);\n //los tags probiene del query de la url recuerda response.object y request.object la lectura del curso\n const { tags } = req.query;\n try {\n //getMovies probiene del la capa de servicios\n const movies = await moviesServices.getMovies({ tags });\n //Hardcode Error para ver un error\n //throw new Error('error for testing propuses');\n res.status(200).json({\n data: movies,\n massage: 'movies Listed'\n });\n } catch (err) {\n next(err);\n }\n }\n );\n\n //NOTA:La diferencia principal entre parametros y query es que: los parametros estan establecidos en l url y query es cuando se le pone ?-nombreQuery- y ademas se puede concatenar.\n\n //Implementando metodos CRUD\n //Buscado por medio del ID\n //NOTA: Los middleware van entre la ruta y la definicion de la ruta tantos como se quiera\n router.get(\n '/:movieId',\n passport.authenticate('jwt', { session: false }),\n scopesValidationHandler(['read:movies']),\n validationHandler({ movieId: movieIdSchema }, 'params'),\n async function(req, res, next) {\n cacheResponse(res, SIXTY_MINUTES_IN_SECONDS);\n //en este caso el id biene como parametro en la url\n const { movieId } = req.params;\n try {\n const movies = await moviesServices.getMovie({ movieId });\n res.status(200).json({\n data: movies,\n massage: 'Movie retrive'\n });\n } catch (err) {\n next(err);\n }\n }\n );\n\n //Creando y recibiendo la pelicula\n router.post(\n '/',\n passport.authenticate('jwt', { session: false }),\n scopesValidationHandler(['create:movies']),\n validationHandler(createMovieSchema),\n async function(req, res, next) {\n //en este caso biene es del cuerpo el body con un alias para ser mas especifioc en este caso boyd: movie(alias)\n const { body: movie } = req;\n try {\n const createMovieId = await moviesServices.createMovie({ movie });\n //cuando creamos el codigo es 201\n res.status(201).json({\n data: createMovieId,\n massage: 'Movies created'\n });\n } catch (err) {\n next(err);\n }\n }\n );\n\n //Actualizando las peliculas\n router.put(\n '/:movieId',\n passport.authenticate('jwt', { session: false }),\n scopesValidationHandler(['update:movies']),\n validationHandler({ movieId: movieIdSchema }, 'params'),\n validationHandler(updateMovieSchema),\n async function(req, res, next) {\n const { movieId } = req.params;\n const { body: movie } = req;\n try {\n const updatedMovieId = await moviesServices.updateMovie({\n movieId,\n movie\n });\n res.status(200).json({\n data: updatedMovieId,\n massage: 'Movie updated'\n });\n } catch (err) {\n next(err);\n }\n }\n );\n\n //Reto:\n //NOTA: PATCH como PUT se usa para actualizaciones pero con la diferencia de que este es usado para hacer cambios en una parte del recurso en una locacion y no el recurso completo es descrito como una minorUpdate y fallara si el recurso no existe. Mas info https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods\n router.patch('/:movieId', async (req, res, next) => {\n const { movieId } = req.params;\n const { body: movie } = req;\n\n try {\n const partiallyUpdatedMovieId = await moviesServices.partialUpdateMovie({\n movieId,\n movie\n });\n\n res.status(200).json({\n data: partiallyUpdatedMovieId,\n massage: 'partially updated movie'\n });\n } catch (err) {\n next(err);\n }\n });\n\n //Borrar las Peliculas\n router.delete(\n '/:movieId',\n passport.authenticate('jwt', { session: false }), //Validar Autenticacion\n scopesValidationHandler(['delete:movies']), //Validar Permisos Necesarios\n validationHandler({ movieId: movieIdSchema }, 'params'), //Validar que los Datos esten Correctos\n async function(req, res, next) {\n const { movieId } = req.params;\n try {\n const movies = await moviesServices.deleteMovie({ movieId });\n res.status(200).json({\n data: movies,\n massage: 'Movies deleted'\n });\n } catch (err) {\n next(err);\n }\n }\n );\n}", "title": "" }, { "docid": "b6fc236eef1636ec1fe8ad321cf4894a", "score": "0.5133607", "text": "createRoutes() {\n this.routes['/asciimo'] = (req, res) => {\n var link = \"http://i.imgur.com/kmbjB.png\";\n res.send(\"<html><body><img src='\" + link + \"'></body></html>\");\n };\n }", "title": "" }, { "docid": "995226ffc60e80f1707c286135c0f369", "score": "0.5132368", "text": "function getToys() {\n // GET function via fetch which does post, put, delete, patch;\n fetch(apiUrl)\n .then(response => response.json())\n .then(json => renderToys(json))\n .catch(err =>console.log(err));\n // any request should have '.catch'\n}", "title": "" }, { "docid": "646be45bf4e6a8b57825f823c59f9f77", "score": "0.5131852", "text": "function RestService() {\n // This is the spoke we'll be in touch with. When returning will wrap it with Plug.\n var spoke = through.obj();\n\n // It's always good to init services on the second tick\n process.nextTick(function () {\n spoke.write(messages.log(\"STARTING API\"));\n\n var api = express();\n\n api.get(\"/dogs\", function (req, res) {\n // We can access the hub as a stream\n spoke.write(messages.log(\"DOGS REQUEST\"));\n\n // or with MueRequest\n requestDogs(spoke, function (err, dogs) {\n res.json({dogs: dogs.dogs});\n })\n })\n api.get(\"/dogs/add/:type/:name\", function (req, res) {\n // Application logic validation should be handled here,\n // Business logic validation should be handled within the DOG ADDING service\n\n addDog(spoke, {type: req.params.type, name: req.params.name}, function (err, addedDog) {\n res.json(addedDog);\n })\n })\n\n api.listen(3000);\n });\n\n // Really important to wrap it with Plug. Otherwise, if you return a through stream, you'll get into a recursion.\n return Plug(spoke);\n}", "title": "" }, { "docid": "e296e82a10e121929d5ad40447ec5b2f", "score": "0.5127998", "text": "function indexRoute(req, res) {\n return res.json({\n users: {\n users: '/users',\n user: '/users/{id}',\n register: '/users/register',\n login: '/users/login',\n me: '/users/me',\n newPin: '/program/{id}/add',\n },\n program: {\n newProgram: '/program',\n program: '/program/{id}/view',\n exercises: '/program/{clientId}/view/{programId}',\n },\n exercise: {\n exercise: '/program/{id}/add',\n }\n });\n}", "title": "" }, { "docid": "8153296d369a0f9d00234465af40dc1a", "score": "0.51214725", "text": "setUpRoutes () {\n\n /*\n * Hotels Query\n * GET /hotels\n * params: stringify query\n * - ?name=**&stars=[2, 5]\n * - ?_id=**\n */\n this.app.get('/hotels', async (req, res) => {\n const query = parse(req.url, true).query\n\n for (const i in query) query[i] = JSON.parse(unescape(query[i])) // parse query to object\n\n console.log(query)\n const results = this.filterData(query, data)\n res.status(200).json(results)\n })\n\n /*\n * Hotels Create\n * POST /\n * body: Hotel fields (see validator)\n */\n this.app.post('/', db(async (req, res) => {\n const {Model} = req\n const data = req.body\n let result = {}\n try {\n result = await new Model(data).save()\n } catch (err) {\n console.log('error', err)\n if (err.name && err.name === 'ValidationError') {\n return res.status(400).send({message: err.message})\n }\n return res.status(500).send({message: 'Error: save hotel'})\n }\n return res.status(200).send(result)\n }))\n\n /*\n * Hotel Update\n * PUT /:id\n * params: @id\n * body: Dataset to update\n */\n this.app.put('/:id', db(async (req, res) => {\n const {Model} = req\n const data = req.body\n const {id} = req.params\n delete data._id\n let result = {}\n try {\n result = await Model.findByIdAndUpdate(id, { $set: data }, { new: true })\n } catch (err) {\n console.log('error', err)\n if (err.name && err.name === 'ValidationError') {\n return res.status(400).send({message: err.message})\n }\n return res.status(500).send({message: 'Error: update hotel'})\n }\n return res.status(200).send(result)\n }))\n\n /*\n * Hotel Delete\n * DELETE /:id\n * params: @id\n */\n this.app.delete('/:id', db(async (req, res) => {\n const {Model} = req\n const {id} = req.params\n let result = {}\n try {\n result = await Model.findByIdAndRemove(id)\n if (!result) {\n return res.status(404).send({message: 'hotel not found'})\n }\n } catch (err) {\n if (err.name && err.name === 'ValidationError') {\n return res.status(400).send({message: err.message})\n }\n return res.status(500).send({message: 'Error: delete hotel'})\n }\n return res.status(200).send({message: 'delete ok', data: result})\n }))\n\n /*\n * Hotels find by id\n * GET /:id\n * params: @id\n */\n this.app.get('/:id', db(async (req, res) => {\n const {Model} = req\n const {id} = req.params\n let result = {}\n try {\n result = await Model.findById(id)\n if (!result) {\n return res.status(404).send({message: 'hotel not found'})\n }\n } catch (err) {\n if (err.name && err.name === 'ValidationError') {\n return res.status(400).send({message: err.message})\n }\n return res.status(500).send({message: 'Error: find by id hotel'})\n }\n return res.status(200).send(result)\n }))\n\n /*\n * Hotels Query\n * GET /hotels\n * params: stringify query\n * - ?name=**&stars=[2, 5]\n * - ?_id=**\n */\n this.app.get('/', db(async (req, res) => {\n const {Model} = req\n const query = parse(req.url, true).query\n\n for (const i in query) query[i] = JSON.parse(unescape(query[i])) // parse query to object\n let results = []\n try {\n results = await Model.find(query)\n } catch (err) {\n return res.status(500).send({message: 'Error: find all hotels'})\n }\n return res.status(200).send(results)\n }))\n }", "title": "" }, { "docid": "3ea17a32aa99d224f822a0964cdb16ea", "score": "0.51144964", "text": "llamarRutasAPI(){\n this.app.use('/', rutas);\n }", "title": "" }, { "docid": "1b9734e2dffbcc0d37cb27025877d9df", "score": "0.5110009", "text": "function getEpisodes() {\n let api = \"../api/Episodes/Admin\";\n\n ajaxCall(\"GET\", api, \"\", getEpisodesSuccessCB, getErrorCB);\n}", "title": "" }, { "docid": "2a72b33f6f893c0f8a73412b30c234e1", "score": "0.5102547", "text": "function get(req, res, next) {\n const prop = toProp(req.params.resource)\n req.query[prop] = toId(req.params.id)\n req.url = `/${req.params.nested}`\n next()\n }", "title": "" }, { "docid": "f730eb228164ba9ca5f10be7959614ad", "score": "0.5096117", "text": "function createYourDisneyDay(e) {\n e.preventDefault()\n let data = { \n ride: e.target[0].value,\n dining: e.target[1].value,\n show: e.target[2].value,\n photoop: e.target[3].value,\n shopping: e.target[4].value}\n \n\n let day = new YourDisneyDay(data) \n console.log(YourDisneyDay.all)\n day.renderDay()\n \n fetch(this.baseURL+\"/disney_days\", {\n method: 'POST',\n headers: {\n 'Content-type': 'application/json',\n 'Accept': 'application/json'\n },\n body: JSON.stringify({\n id: userObj.id, //come back after creating user\n day: data\n })\n })\n .then(resp => resp.json())\n .then(data => {\n const { id, name, category } = data;\n new Attraction(id, name, category)\n renderAttractions()\n })\n .catch(err => console.log(err));\n}", "title": "" }, { "docid": "aec31cbf337d51c18eb4e8d6ac563747", "score": "0.5095386", "text": "landmarkSubmit(method, event, data, id) {\n event.preventDefault();\n fetch(`/api/landmarks/${id || ''}`, {\n method,\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(data),\n })\n .then(res => res.json())\n .then((res) => {\n this.getLandmarksFromDb();\n });\n }", "title": "" }, { "docid": "78a50b981f81936005b5dee3342d5c3c", "score": "0.5092744", "text": "function retrievePosts(req, res, next){\n courseService.retrievePosts(req.params.id, req.user.sub).then(x => {\n res.json(x);\n })\n}", "title": "" }, { "docid": "cbcb72977eabe86036aa343536a01923", "score": "0.5092319", "text": "index(request, response) {\n Resttask.find({})\n .then(resttask => response.json(resttask))\n .catch(error => response.json(error));\n }", "title": "" }, { "docid": "24a25dd781f7bd6ac9f4ffa7870505bf", "score": "0.50832593", "text": "build_paths() {\n return {\n items: {\n list: { // Returns a list of items\n method: \"GET\",\n path: \"[path]\", \n }, \n item: { // Returns a single item with ID %%\n method: \"GET\",\n path: \"[path]/%%\"\n }, \n item_metadata: { // Returns metadata for item %%\n method: \"GET\",\n path: \"[path]/%%/[key]\", \n }, \n find_by_metadata: { // Returns items based on specified metadata value\n method: \"POST\",\n path: \"[path]\"\n } \n },\n query: { \n filtered_items: { // Returns items based on chosen filters\n method: \"GET\",\n path: \"[path]\", \n }, \n filtered_collections: { // Returns collections based on chosen filters\n method: \"GET\",\n path: \"[path]\",\n }, \n collection: { // Returns collection with ID %%\n method: \"GET\",\n path: \"[path]/%%\",\n } \n }\n };\n }", "title": "" }, { "docid": "3b9e781971333c668cdefaa364a8a678", "score": "0.50734925", "text": "function api (req, res) {\n return Prismic.api(configuration.apiEndpoint, {\n accessToken: configuration.accessToken,\n req: req\n })\n}", "title": "" }, { "docid": "28edafd2fbe1e99b73a8cbee31793b81", "score": "0.50706595", "text": "function index(req, res) {\n \n}", "title": "" }, { "docid": "22be4164081df3eb0b973424d5755efa", "score": "0.50658566", "text": "show(req, res) {\n logging.logTheinfo(\"widgets show Router\");\n res.status(200).send(\"show\");\n\n }", "title": "" }, { "docid": "d6cfd97355076971aa8f88548bcd4b52", "score": "0.50642014", "text": "static defaultEndpoint(req : $Request, res : $Response) {\n res.json({\n version: '1.0',\n });\n }", "title": "" }, { "docid": "8a328cd54dd1826b14bb0ae6087e81a5", "score": "0.50633013", "text": "createAPI(data) {\n return null;\n }", "title": "" }, { "docid": "a538b8f1c858a3341dae03869f2f4065", "score": "0.5058198", "text": "function postApi(route){\n var jsonRoute = JSON.stringify({ data: route })\n fetch('http://vps1.nickforall.nl:6123/route', {\n method: 'post',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: jsonRoute\n })\n .then(function (response) {\n return response;\n })\n .then(function (result) {\n console.log(\"post succes: \"+ result);\n })\n .catch (function (error) {\n console.log('Request failed', error);\n });\n}", "title": "" }, { "docid": "f10110888ea0f34c366e1cb209601ff3", "score": "0.5057146", "text": "function index(req, res) {\n return _news2.default.find().populate('image', 'PublicID').exec().then(respondWithResult(res)).catch(handleError(res));\n}", "title": "" }, { "docid": "6b6c2b87de4de87c7eca931e92f85ec1", "score": "0.5055989", "text": "update(req, res) {\n logging.logTheinfo(\"widgets index Router\");\n res.status(200).send(\"update\");\n\n }", "title": "" }, { "docid": "dd6a50b9cb1a6a1fd9a69e36e9b263aa", "score": "0.504786", "text": "route() {\n return `/api/staff/v1/${this._api_route}`;\n }", "title": "" }, { "docid": "e763e5cdcbfe8a75b82547f7c2791d27", "score": "0.50446206", "text": "getAPIResource(opts){\n let { type, uri, id } = opts;\n if( type === 'pathways' ){\n if( uri !== null ){\n return this.getPathway( uri );\n } else {\n throw new Error('Invalid parameter. Pathways api calls require a uri parameter');\n }\n }\n if( type === 'factoids' ){\n if( id !== null ){\n return this.getFactoid(opts.id);\n } else {\n throw new Error('Invalid paramter. Factoids api calls require a id parameter');\n }\n }\n }", "title": "" }, { "docid": "66bab72499870d2b396d0122b2ba5ed2", "score": "0.5043663", "text": "function convertLiveDocs(apiInfo){\n rename(apiInfo,'title','name');\n rename(apiInfo,'prefix','publicPath');\n rename(apiInfo,'server','basePath');\n apiInfo.resources = {};\n for (var e in apiInfo.endpoints) {\n var ep = apiInfo.endpoints[e];\n var eName = ep.name ? ep.name : 'Default';\n\n if (!apiInfo.resources[eName]) apiInfo.resources[eName] = {};\n apiInfo.resources[eName].description = ep.description;\n\n for (var m in ep.methods) {\n var lMethod = ep.methods[m];\n if (!apiInfo.resources[eName].methods) apiInfo.resources[eName].methods = {};\n var mName = lMethod.MethodName ? lMethod.MethodName : 'Default';\n if (mName.endsWith('.')) mName = mName.substr(0,mName.length-1);\n mName = mName.split(' ').join('_');\n rename(lMethod,'HTTPMethod','httpMethod');\n rename(lMethod,'URI','path');\n rename(lMethod,'Synopsis','description');\n rename(lMethod,'MethodName','name');\n\n lMethod.path = fixPathParameters(lMethod.path);\n\n var params = {};\n for (var p in lMethod.parameters) {\n var lParam = lMethod.parameters[p];\n if (!lParam.type) lParam.type = 'string';\n if (lParam.type == 'json') lParam.type = 'string';\n if (!lParam.location) {\n if (lMethod.path.indexOf(':'+lParam.name)>=0) {\n lParam.location = 'path';\n }\n else {\n lParam.location = 'query';\n }\n }\n if (lParam.location == 'boddy') lParam.location = 'body'; // ;)\n params[lParam.name] = lParam;\n delete lParam.name;\n delete lParam.input; // TODO checkbox to boolean?\n delete lParam.label;\n rename(lParam,'options','enum');\n }\n lMethod.parameters = params;\n if (Object.keys(params).length==0) delete lMethod.parameters;\n\n apiInfo.resources[eName].methods[mName] = lMethod;\n }\n\n }\n delete apiInfo.endpoints; // to keep size down\n return apiInfo;\n}", "title": "" }, { "docid": "d8c5c0bcb3f69ba443f2541d9df97176", "score": "0.50407714", "text": "function get_uri(name, title, operation, fields, category_item, insertedId, show_all) {\n \n var uri;\n if (insertedId == null) {\n uri = 'http://localhost:9000/erp/' + category_item;\n }\n else if (show_all) {\n uri = 'http://localhost:9000/erp/' + category_item;\n }\n else {\n \n uri = 'http://localhost:9000/erp/' + category_item + '/' + insertedId;\n }\n \n var return_uri = {\n \"name\": name,\n \"title\": title,\n \"method\": operation,\n \"href\": uri,\n \"type\": \"application/x-www-form-urlencoded\",\n \"fields\": fields\n };\n \n return return_uri;\n\t\n}", "title": "" }, { "docid": "759c489bcf68cea7ca87561cf7aa0b9f", "score": "0.504002", "text": "function v1Endpoints(server, rooms, lessons, degrees, courses) {\n // Corsi\n server.get('/v1/degrees', (req, res, next) => {\n //res.json(degrees)\n\t\tres.header('content-type', config.debug ? 'text' : 'json')\n\t\tres.send(config.debug ? prettyjson.render(degrees) : degrees)\n next()\n })\n\n server.get('/v1/degrees/:abbr/courses', (req, res, next) => {\n //res.json(courses.filter(x => x.laurea == req.params.abbr))\n\t\tres.header('content-type', config.debug ? 'text' : 'json')\n\t\tres.send(config.debug ? prettyjson.render(courses.filter(x => x.laurea == req.params.abbr)) : courses.filter(x => x.laurea == req.params.abbr))\n next()\n })\n\n server.get('/v1/degrees/:abbr/courses/semesters/:sem', (req, res, next) => {\n //res.json(courses.filter(x => x.laurea == req.params.abbr && x.semestre == req.params.sem))\n\t\tres.header('content-type', config.debug ? 'text' : 'json')\n\t\tres.send(config.debug ? prettyjson.render(courses.filter(x => x.laurea == req.params.abbr && x.semestre == req.params.sem)) : courses.filter(x => x.laurea == req.params.abbr && x.semestre == req.params.sem))\n next()\n })\n\n // Edifici\n server.get('/v1/buildings', (req, res, next) => {\n let buildings = new Set()\n for(let i in rooms) {\n buildings.add(rooms[i].building)\n }\n //res.json(Array.from(buildings))\n res.header('content-type', config.debug ? 'text' : 'json')\n config.debug ? res.send(prettyjson.render(Array.from(buildings))) : res.send(Array.from(buildings))\n next()\n })\n\n server.get('/v1/buildings/:name/rooms', (req, res, next) => {\n //res.json(queries.getRoomsInBuilding(rooms, req.params.name))\n\t\tres.header('content-type', config.debug ? 'text' : 'json')\n\t\tres.send(config.debug ? prettyjson.render(queries.getRoomsInBuilding(rooms, req.params.name)) : queries.getRoomsInBuilding(rooms, req.params.name))\n next()\n })\n\n // Lezioni\n server.get('/v1/lessons/days/:day', (req, res, next) => {\n //res.json(lessons.filter(x => x.lessons == req.params.day))\n\t\tres.header('content-type', config.debug ? 'text' : 'json')\n\t\tres.send(config.debug ? prettyjson.render(lessons.filter(x => x.lessons == req.params.day)) : lessons.filter(x => x.lessons == req.params.day))\n next()\n })\n\n server.get('/v1/lessons/days/:day/:hour/:minute', (req, res, next) => {\n const moment = moment(parseInt(req.params.hour).toString() + \":\" + parseInt(req.params.minute).toString())\n //res.json(queries.getLessonsDuringMoment(lessons, req.params.day, moment))\n\t\tres.header('content-type', config.debug ? 'text' : 'json')\n\t\tres.send(config.debug ? prettyjson.render(queries.getLessonsDuringMoment(lessons, req.params.day, moment)) : queries.getLessonsDuringMoment(lessons, req.params.day, moment))\n next()\n })\n\n server.get('/v1/lessons/buildings/:bld', (req, res, next) => {\n const isInBuilding = (roomname, building) => {\n const room = rooms.find(x => x.name == roomname)\n return room && room.building == building\n }\n //res.json(lessons.filter(x => isInBuilding(x.room, req.params.bld)))\n\t\tres.header('content-type', config.debug ? 'text' : 'json')\n\t\tres.send(config.debug ? prettyjson.render(lessons.filter(x => isInBuilding(x.room, req.params.bld))) : lessons.filter(x => isInBuilding(x.room, req.params.bld)))\n next()\n })\n\n server.get('/v1/lessons/rooms/:room', (req, res, next) => {\n //res.json(lessons.filter(x => x.room == req.params.room))\n\t\tres.header('content-type', config.debug ? 'text' : 'json')\n\t\tres.send(config.debug ? prettyjson.render(lessons.filter(x => x.room == req.params.room)) : lessons.filter(x => x.room == req.params.room))\n next()\n })\n}", "title": "" }, { "docid": "54ea6d99761176832c016119ed7675f5", "score": "0.5038638", "text": "function init(router) {\n router.route('/categories').get(getCategories);\n router.route('/categories/:categoryCode').get(getCategoriesByCategoryCode);\n router.route('/categories/:categoryCode/types').get(getTypesByCategoryCode);\n router.route('/categories/:categoryCode/types/:typeCode').get(getTypesByCategoryAndTypeCode);\n router.route('/categories/:categoryCode/types/:typeCode/subtypes').get(getSubTypesByCategoryCodeAndTypeCode);\n router.route('/categories/:categoryCode/types/:typeCode/subtypes/:subTypeCode').get(getSubTypesByCategoryCodeTypeCodeAndSubTypeCode);\n router.route('/categories/:categoryCode/typedesc/:typeDesc/subtypedesc/:subTypeDesc').get(getSubTypeCodeByCategoryCodeTypeCodeAndSubType);\n\n router.route('/tenants').get(getTenantsByTenantCode);\n router.route('/tenants/:tenantCode').get(getTenantsByTenantCode);\n\n router.route('/priorities').get(getPrioritiesByPriorityCode);\n router.route('/priorities/:priorityCode').get(getPrioritiesByPriorityCode);\n\n router.route('/statuses').get(getStatus);\n router.route('/statuses/:statusCode').get(getStatusByStatusCode);\n router.route('/statuses').post(postStatusByArrayOfStatusCodes);\n}", "title": "" }, { "docid": "17de23cf5a691227a18e4b2aed64231f", "score": "0.503649", "text": "function getRoutes() {\n const xhr = new XMLHttpRequest(); //create new XHR-Object to send a request\n const url = 'http://localhost:3000/application/getRoutes'; //request url\n xhr.responseType = \"json\"; //data type for the request's response\n xhr.open(\"GET\", url); //send the request to the server\n xhr.send();\n //if the result is available return the response\n xhr.onreadystatechange = (() => {\n if (xhr.readyState == 4) {\n getAnimalData(xhr.response); //forward the response to the next function to use it later on\n }\n });\n}", "title": "" } ]
f30bba73b61ac186e4db4d4e5289bf41
helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
[ { "docid": "a7ebcc5f5de81a85ce0b2ee946899017", "score": "0.0", "text": "function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {\n\t\t return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);\n\t\t }", "title": "" } ]
[ { "docid": "e116143e66b7212bfabc003ae4b76084", "score": "0.655875", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(vf=c)),vf._abbr}", "title": "" }, { "docid": "e116143e66b7212bfabc003ae4b76084", "score": "0.655875", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(vf=c)),vf._abbr}", "title": "" }, { "docid": "e116143e66b7212bfabc003ae4b76084", "score": "0.655875", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(vf=c)),vf._abbr}", "title": "" }, { "docid": "532f1421d8bf933bdc7e06407444d417", "score": "0.63261455", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "title": "" }, { "docid": "532f1421d8bf933bdc7e06407444d417", "score": "0.63261455", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "title": "" }, { "docid": "532f1421d8bf933bdc7e06407444d417", "score": "0.63261455", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "title": "" }, { "docid": "532f1421d8bf933bdc7e06407444d417", "score": "0.63261455", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "title": "" }, { "docid": "532f1421d8bf933bdc7e06407444d417", "score": "0.63261455", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "title": "" }, { "docid": "532f1421d8bf933bdc7e06407444d417", "score": "0.63261455", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "title": "" }, { "docid": "532f1421d8bf933bdc7e06407444d417", "score": "0.63261455", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "title": "" }, { "docid": "532f1421d8bf933bdc7e06407444d417", "score": "0.63261455", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "title": "" }, { "docid": "532f1421d8bf933bdc7e06407444d417", "score": "0.63261455", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "title": "" }, { "docid": "213035ca19cedb1d97c9c1ddda12ffcc", "score": "0.61222297", "text": "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(qf=c)),qf._abbr}", "title": "" }, { "docid": "213035ca19cedb1d97c9c1ddda12ffcc", "score": "0.61222297", "text": "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(qf=c)),qf._abbr}", "title": "" }, { "docid": "213035ca19cedb1d97c9c1ddda12ffcc", "score": "0.61222297", "text": "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(qf=c)),qf._abbr}", "title": "" }, { "docid": "213035ca19cedb1d97c9c1ddda12ffcc", "score": "0.61222297", "text": "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(qf=c)),qf._abbr}", "title": "" }, { "docid": "213035ca19cedb1d97c9c1ddda12ffcc", "score": "0.61222297", "text": "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(qf=c)),qf._abbr}", "title": "" }, { "docid": "2ed5032e5b1a6e14efb005f4b78a7b9b", "score": "0.6121653", "text": "function formatMoment(m,format){\nif(!m.isValid()){\nreturn m.localeData().invalidDate();}\n\n\nformat=expandFormat(format,m.localeData());\nformatFunctions[format]=formatFunctions[format]||makeFormatFunction(format);\n\nreturn formatFunctions[format](m);}", "title": "" }, { "docid": "97cb43a890aff82d5175ef74d2aa6950", "score": "0.60964704", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\n return a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "title": "" }, { "docid": "8d8a08bce85b125976b10dde8c15097d", "score": "0.6046598", "text": "function formatTimes() {\n moment.locale('en-gb');\n\n $('time.ago').each(function(_, element) {\n $(element).text(moment($(element).attr('datetime')).fromNow());\n });\n }", "title": "" }, { "docid": "1af8a6f663441b788462ffcb57a66bce", "score": "0.6011162", "text": "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(se=c)),se._abbr}", "title": "" }, { "docid": "1af8a6f663441b788462ffcb57a66bce", "score": "0.6011162", "text": "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(se=c)),se._abbr}", "title": "" }, { "docid": "1af8a6f663441b788462ffcb57a66bce", "score": "0.6011162", "text": "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(se=c)),se._abbr}", "title": "" }, { "docid": "1af8a6f663441b788462ffcb57a66bce", "score": "0.6011162", "text": "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(se=c)),se._abbr}", "title": "" }, { "docid": "1af8a6f663441b788462ffcb57a66bce", "score": "0.6011162", "text": "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(se=c)),se._abbr}", "title": "" }, { "docid": "1af8a6f663441b788462ffcb57a66bce", "score": "0.6011162", "text": "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(se=c)),se._abbr}", "title": "" }, { "docid": "1af8a6f663441b788462ffcb57a66bce", "score": "0.6011162", "text": "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(se=c)),se._abbr}", "title": "" }, { "docid": "1af8a6f663441b788462ffcb57a66bce", "score": "0.6011162", "text": "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(se=c)),se._abbr}", "title": "" }, { "docid": "1af8a6f663441b788462ffcb57a66bce", "score": "0.6011162", "text": "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(se=c)),se._abbr}", "title": "" }, { "docid": "1580008a48fb2b6740ce7f4bf4e3875b", "score": "0.59837216", "text": "function Za(a,b){var c;\r\n// moment.duration._locale = moment._locale = data;\r\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(se=c)),se._abbr}", "title": "" }, { "docid": "621db0fbaed275e9387938b3fb538cf3", "score": "0.5983332", "text": "when() {\n const now = new AnDate();\n\n const years = this.year() - now.year();\n if (years !== 0) {\n const s = Math.abs(years) == 1 ? 'year' : 'years';\n return years > 0 ? `${years} ${s} from now` : `${Math.abs(years)} ${s} ago`;\n }\n\n const months = this.month() - now.month();\n if (months !== 0) {\n const s = Math.abs(months) === 1 ? 'month' : 'months';\n return months > 0 ? `${months} ${s} from now` : `${Math.abs(months)} ${s} ago`;\n }\n\n const days = this.day() - now.day();\n if (days !== 0) {\n const s = Math.abs(days) == 1 ? 'day' : 'days';\n return days > 0 ? `${days} ${s} from now` : `${Math.abs(days)} ${s} ago`;\n }\n\n const hours = this.hours() - now.hours();\n if (hours !== 0) {\n const s = Math.abs(hours) == 1 ? 'hour' : 'hours';\n return hours > 0 ? `${hours} ${s} from now` : `${Math.abs(hours)} ${s} ago`;\n }\n\n const minutes = this.minutes() - now.minutes();\n if (minutes !== 0) {\n const s = Math.abs(minutes) == 1 ? 'minute' : 'minutes';\n return minutes > 0 ? `${minutes} ${s} from now` : `${Math.abs(minutes)} ${s} ago`;\n }\n\n const seconds = this.seconds() - now.seconds();\n if (seconds !== 0) {\n const s = Math.abs(seconds) == 1 ? 'second' : 'seconds';\n return seconds > 0 ? `${seconds} ${s} from now` : `${Math.abs(seconds)} ${s} ago`;\n }\n\n return \"Right now!\"\n }", "title": "" }, { "docid": "e43291f72e6462d1be030fcdeb445b01", "score": "0.59432185", "text": "function qa(a,b,c,d,e){var f;// works with moment-pre-2.8\n// Expand localized format strings, like \"LL\" -> \"MMMM D YYYY\"\n// BTW, this is not important for `formatDate` because it is impossible to put custom tokens\n// or non-zero areas in Moment's localized format strings.\nreturn a=Ta.moment.parseZone(a),b=Ta.moment.parseZone(b),f=(a.localeData||a.lang).call(a),c=f.longDateFormat(c)||c,d=d||\" - \",ra(a,b,ta(c),d,e)}// expose", "title": "" }, { "docid": "6606e3f0b59324cd2221bf034a41ec51", "score": "0.59232676", "text": "function formatMoment(m,format){if(!m.isValid()){return m.localeData().invalidDate()}format=expandFormat(format,m.localeData());formatFunctions[format]=formatFunctions[format]||makeFormatFunction(format);return formatFunctions[format](m)}", "title": "" }, { "docid": "c23529018ca256cb26b9294078496cf1", "score": "0.58724225", "text": "function relativeTimeWithPlural(number,withoutSuffix,key){var separator=\" \";return(number%100>=20||number>=100&&number%100==0)&&(separator=\" de \"),number+separator+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[key]}", "title": "" }, { "docid": "0632150d8a01c20b234393301f4d9cc7", "score": "0.5826341", "text": "function humanDate(str)\n{\n\treturn moment(str).format(\"MMM. D, YYYY\");\t// add another M for full month spelled out\n}", "title": "" }, { "docid": "5d0875cb1ad0a9650ccf5468f8b068c5", "score": "0.58147436", "text": "function substituteTimeAgo(string,number,withoutSuffix,isFuture,locale){return locale.relativeTime(number||1,!!withoutSuffix,string,isFuture);}", "title": "" }, { "docid": "5d0875cb1ad0a9650ccf5468f8b068c5", "score": "0.58147436", "text": "function substituteTimeAgo(string,number,withoutSuffix,isFuture,locale){return locale.relativeTime(number||1,!!withoutSuffix,string,isFuture);}", "title": "" }, { "docid": "5d0875cb1ad0a9650ccf5468f8b068c5", "score": "0.58147436", "text": "function substituteTimeAgo(string,number,withoutSuffix,isFuture,locale){return locale.relativeTime(number||1,!!withoutSuffix,string,isFuture);}", "title": "" }, { "docid": "5d0875cb1ad0a9650ccf5468f8b068c5", "score": "0.58147436", "text": "function substituteTimeAgo(string,number,withoutSuffix,isFuture,locale){return locale.relativeTime(number||1,!!withoutSuffix,string,isFuture);}", "title": "" }, { "docid": "5d0875cb1ad0a9650ccf5468f8b068c5", "score": "0.58147436", "text": "function substituteTimeAgo(string,number,withoutSuffix,isFuture,locale){return locale.relativeTime(number||1,!!withoutSuffix,string,isFuture);}", "title": "" }, { "docid": "6d973484505f82055252000e3973ad1d", "score": "0.5789508", "text": "function substituteTimeAgo(string,number,withoutSuffix,isFuture,locale){return locale.relativeTime(number||1,!!withoutSuffix,string,isFuture)}", "title": "" }, { "docid": "05de0807a61d78565b775153d151c037", "score": "0.5786588", "text": "function relativeTimeWithPlural(e,r,n){var i=\" \";return(e%100>=20||e>=100&&e%100==0)&&(i=\" de \"),e+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "a00b679acde2685aa4d0839f9e775db5", "score": "0.5779805", "text": "function substituteTimeAgo(string,number,withoutSuffix,isFuture,locale){return locale.relativeTime(number || 1,!!withoutSuffix,string,isFuture);}", "title": "" }, { "docid": "6fdaa6227a5bb5ec216e174ae74f30b6", "score": "0.57722056", "text": "function human(seconds, suffix) {\n if (seconds instanceof Date)\n seconds = Math.round((Date.now() - seconds) / 1000);\n if (suffix === undefined)\n suffix = seconds < 0 ? ' from now' : ' ago';\n seconds = Math.abs(seconds);\n\n var times = [\n seconds / 60 / 60 / 24 / 365, // years\n seconds / 60 / 60 / 24 / 30, // months\n seconds / 60 / 60 / 24, // days\n seconds / 60 / 60, // hours\n seconds / 60, // minutes\n seconds // seconds\n ];\n var names = ['year', 'month', 'day', 'hour', 'minute', 'second'];\n\n for (var i = 0; i < names.length; i++) {\n var time = Math.floor(times[i]);\n if (time > 1)\n return util.format('%d %ss%s', time, names[i], suffix);\n else if (time === 1)\n return util.format('%d %s%s', time, names[i], suffix);\n }\n return util.format('0 seconds%s', suffix);\n}", "title": "" }, { "docid": "753541294a49fe90de2db1e857f9364d", "score": "0.57698756", "text": "function relativeTimeWithPlural(number,withoutSuffix,key){var num,forms;return\"m\"===key?withoutSuffix?\"минута\":\"минуту\":number+\" \"+(num=+number,forms={ss:withoutSuffix?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:withoutSuffix?\"минута_минуты_минут\":\"минуту_минуты_минут\",hh:\"час_часа_часов\",dd:\"день_дня_дней\",ww:\"неделя_недели_недель\",MM:\"месяц_месяца_месяцев\",yy:\"год_года_лет\"}[key].split(\"_\"),num%10==1&&num%100!=11?forms[0]:num%10>=2&&num%10<=4&&(num%100<10||num%100>=20)?forms[1]:forms[2])}", "title": "" }, { "docid": "6b58641820bcf6cabbf4c18f4d261a58", "score": "0.5765265", "text": "function substituteTimeAgo(string,number,withoutSuffix,isFuture,locale){\nreturn locale.relativeTime(number||1,!!withoutSuffix,string,isFuture);}", "title": "" }, { "docid": "b7fb6a854387f9f896e311bd299b9faf", "score": "0.5742762", "text": "function mkago(t)\n\t{\n\t\tif (!t)\n\t\t\treturn '';\n\t\tt |= 0;\n\t\tt = now - t;\n\t\tif (t < 0)\n\t\t\treturn 'a moment ago';\n\t\tvar min = (t/60)|0;\n\t\tvar hour = (min/60)|0;\n\t\tvar day = (hour/24)|0;\n\t\tif (day === 1) return 'a day ago';\n\t\tif (day) return day + ' days ago';\n\t\tif (hour === 1) return 'a hour ago';\n\t\tif (hour) return hour + ' hours ago';\n\t\tif (min === 1) return 'a minute ago';\n\t\tif (min) return min + ' minutes ago';\n\t\treturn 'a moment ago';\n\t}", "title": "" }, { "docid": "088b061cdc4f0d05857c493f7bffd3e3", "score": "0.57295805", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture ? 'nekaj sekund' : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n }\n else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n }\n else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n }\n else {\n result += withoutSuffix || isFuture ? 'sekund' : 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n }\n else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n }\n else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n }\n else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n }\n else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n }\n else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n }\n else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n }\n else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n }\n else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n }\n else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n }\n else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n }\n else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n }\n else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n }\n else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n }\n else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n}", "title": "" }, { "docid": "e0fe0702b980987347948cdd01aa4237", "score": "0.5720072", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture ?\n 'nekaj sekund' :\n 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;}\n\n }", "title": "" }, { "docid": "9b2d85900cad576f7ac29f1f5f2493c3", "score": "0.56952614", "text": "function formatMoment(m, inputString) {\n var currentMonth = m.month(),\n currentDate = m.date(),\n currentYear = m.year(),\n currentDay = m.day(),\n currentHours = m.hours(),\n currentMinutes = m.minutes(),\n currentSeconds = m.seconds(),\n currentZone = -m.zone(),\n ordinal = moment.ordinal,\n meridiem = moment.meridiem;\n // check if the character is a format\n // return formatted string or non string.\n //\n // uses switch/case instead of an object of named functions (like http://phpjs.org/functions/date:380)\n // for minification and performance\n // see http://jsperf.com/object-of-functions-vs-switch for performance comparison\n function replaceFunction(input) {\n // create a couple variables to be used later inside one of the cases.\n var a, b;\n switch (input) {\n // MONTH\n case 'M' :\n return currentMonth + 1;\n case 'Mo' :\n return (currentMonth + 1) + ordinal(currentMonth + 1);\n case 'MM' :\n return leftZeroFill(currentMonth + 1, 2);\n case 'MMM' :\n return moment.monthsShort[currentMonth];\n case 'MMMM' :\n return moment.months[currentMonth];\n // DAY OF MONTH\n case 'D' :\n return currentDate;\n case 'Do' :\n return currentDate + ordinal(currentDate);\n case 'DD' :\n return leftZeroFill(currentDate, 2);\n // DAY OF YEAR\n case 'DDD' :\n a = new Date(currentYear, currentMonth, currentDate);\n b = new Date(currentYear, 0, 1);\n return ~~ (((a - b) / 864e5) + 1.5);\n case 'DDDo' :\n a = replaceFunction('DDD');\n return a + ordinal(a);\n case 'DDDD' :\n return leftZeroFill(replaceFunction('DDD'), 3);\n // WEEKDAY\n case 'd' :\n return currentDay;\n case 'do' :\n return currentDay + ordinal(currentDay);\n case 'ddd' :\n return moment.weekdaysShort[currentDay];\n case 'dddd' :\n return moment.weekdays[currentDay];\n // WEEK OF YEAR\n case 'w' :\n a = new Date(currentYear, currentMonth, currentDate - currentDay + 5);\n b = new Date(a.getFullYear(), 0, 4);\n return ~~ ((a - b) / 864e5 / 7 + 1.5);\n case 'wo' :\n a = replaceFunction('w');\n return a + ordinal(a);\n case 'ww' :\n return leftZeroFill(replaceFunction('w'), 2);\n // YEAR\n case 'YY' :\n return leftZeroFill(currentYear % 100, 2);\n case 'YYYY' :\n return currentYear;\n // AM / PM\n case 'a' :\n return currentHours > 11 ? meridiem.pm : meridiem.am;\n case 'A' :\n return currentHours > 11 ? meridiem.PM : meridiem.AM;\n // 24 HOUR\n case 'H' :\n return currentHours;\n case 'HH' :\n return leftZeroFill(currentHours, 2);\n // 12 HOUR\n case 'h' :\n return currentHours % 12 || 12;\n case 'hh' :\n return leftZeroFill(currentHours % 12 || 12, 2);\n // MINUTE\n case 'm' :\n return currentMinutes;\n case 'mm' :\n return leftZeroFill(currentMinutes, 2);\n // SECOND\n case 's' :\n return currentSeconds;\n case 'ss' :\n return leftZeroFill(currentSeconds, 2);\n // TIMEZONE\n case 'zz' :\n // depreciating 'zz' fall through to 'z'\n case 'z' :\n return (m._d.toString().match(timezoneRegex) || [''])[0].replace(nonuppercaseLetters, '');\n case 'Z' :\n return (currentZone < 0 ? '-' : '+') + leftZeroFill(~~(Math.abs(currentZone) / 60), 2) + ':' + leftZeroFill(~~(Math.abs(currentZone) % 60), 2);\n case 'ZZ' :\n return (currentZone < 0 ? '-' : '+') + leftZeroFill(~~(10 * Math.abs(currentZone) / 6), 4);\n // LONG DATES\n case 'L' :\n case 'LL' :\n case 'LLL' :\n case 'LLLL' :\n case 'LT' :\n return formatMoment(m, moment.longDateFormat[input]);\n // DEFAULT\n default :\n return input.replace(/(^\\[)|(\\\\)|\\]$/g, \"\");\n }\n }\n return inputString.replace(charactersToReplace, replaceFunction);\n }", "title": "" }, { "docid": "848d47e3b77f2f334051e3764fac744a", "score": "0.5694874", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture ? 'nekaj sekund' : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "b6ba6d6f75b40f553a8f9269853a76dc", "score": "0.5692205", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n\n switch (key) {\n case 's':\n return withoutSuffix || isFuture ? 'nekaj sekund' : 'nekaj sekundami';\n\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n\n return result;\n\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n\n return result;\n\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n\n return result;\n\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n\n return result;\n\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n\n return result;\n\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n\n return result;\n }\n }", "title": "" }, { "docid": "b6ba6d6f75b40f553a8f9269853a76dc", "score": "0.5692205", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n\n switch (key) {\n case 's':\n return withoutSuffix || isFuture ? 'nekaj sekund' : 'nekaj sekundami';\n\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n\n return result;\n\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n\n return result;\n\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n\n return result;\n\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n\n return result;\n\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n\n return result;\n\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n\n return result;\n }\n }", "title": "" }, { "docid": "a787e6678ce42d0dd4e0a55030bd9e25", "score": "0.56893486", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n\n switch (key) {\n case 's':\n return withoutSuffix || isFuture ? 'nekaj sekund' : 'nekaj sekundami';\n\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n\n return result;\n\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n\n return result;\n\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n\n return result;\n\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n\n return result;\n\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n\n return result;\n\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682987", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682987", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682987", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682987", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682987", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682987", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682987", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682987", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682987", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682987", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682987", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682987", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682987", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682987", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682987", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682987", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682987", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682987", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682987", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682987", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682987", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682987", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682987", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682987", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682987", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682987", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682987", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682987", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682987", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682987", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682987", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682987", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "04029762daed3052605fde729856ac69", "score": "0.5682987", "text": "function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture\n ? 'nekaj sekund'\n : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }", "title": "" }, { "docid": "9b7143ae8c81d1f31b39f5e80be35cdf", "score": "0.5682838", "text": "function humanDuration(seconds) {\n seconds = Math.floor(seconds);\n if (seconds < 1) {\n return \"Less than a second\";\n } else if (seconds < 60) {\n return seconds + \" seconds\";\n }\n minutes = Math.floor(seconds / 60);\n if (minutes == 1) {\n return \"About a minute\";\n } else if (minutes < 60) {\n return minutes + \" minutes\";\n }\n hours = Math.floor(minutes / 60);\n if (hours == 1) {\n return \"About an hour\"\n } else if (hours < 48) {\n return hours + \" hours\";\n } else if (hours < 24*7*2) {\n return Math.floor(hours/24) + \" days\";\n } else if (hours < 24*30*3) {\n return Math.floor(hours/24/7) + \" weeks\";\n } else if (hours < 24*365*2) {\n return Math.floor(hours/24/30) + \" months\";\n }\n return Math.floor(hours/24/365) + \" years\";\n}", "title": "" }, { "docid": "c747d72f8822ed72fe91673a2116f7da", "score": "0.56790286", "text": "function processRelativeTime(number,withoutSuffix,key,isFuture){var format={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return withoutSuffix?format[key][0]:format[key][1]}", "title": "" }, { "docid": "2aed4e96ca84577c8621561b33dc1313", "score": "0.56428725", "text": "function relativeTimeWithPlural(number,withoutSuffix,key){var num,forms;return\"m\"===key?withoutSuffix?\"хвилина\":\"хвилину\":\"h\"===key?withoutSuffix?\"година\":\"годину\":number+\" \"+(num=+number,forms={ss:withoutSuffix?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:withoutSuffix?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:withoutSuffix?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[key].split(\"_\"),num%10==1&&num%100!=11?forms[0]:num%10>=2&&num%10<=4&&(num%100<10||num%100>=20)?forms[1]:forms[2])}", "title": "" }, { "docid": "df59704a8fc28cf3035ee9fdcb19e841", "score": "0.5640206", "text": "function date_translate(date) {\n var now = new Date();\n var delta = (now.getTime() - date.getTime()) / 1000;\n\n const round = function(n) {\n return n.toFixed(0);\n }\n\n const SECOND = 1;\n const MINUTE = 60 * SECOND;\n const HOUR = 60 * MINUTE;\n const DAY = 24 * HOUR;\n const MONTH = 30 * DAY;\n \n if (delta < -1 * MINUTE)\n {\n // in the future\n return _(\"not yet\"); // ???\n }\n if (delta < 1 * MINUTE)\n {\n return _(\"just now\");\n }\n if (delta < 2 * MINUTE)\n {\n return _(\"one minute ago\");\n }\n if (delta < 45 * MINUTE)\n {\n // some minutes ago\n return _(\"%s minutes ago\", round(delta/60));\n }\n if (delta < 90 * MINUTE)\n {\n return _(\"one hour ago\");\n }\n if (delta < 24 * HOUR)\n {\n // some hours ago\n return _(\"%s hours ago\", round(delta/60/60));\n }\n if (delta < 36 * HOUR)\n {\n // yesterday\n return _(\"yesterday\");\n }\n if (delta < 30 * DAY)\n {\n // some days ago\n return _(\"%s days ago\", round(delta/60/60/24) );\n }\n // even earlier\n\n var MONTHS = _(\"_month_names_\");\n if(\"object\" != typeof MONTHS) {\n MONTHS = [\"Jan\", \"Feb\", \"Mar\", \"Apr\",\n \"May\", \"Jun\", \"Jul\", \"Aug\",\n \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n }\n \n\n var day = date.getUTCDate();\n var monthnum = date.getUTCMonth();\n var month = MONTHS[monthnum];\n var year = date.getUTCFullYear();\n // alert( \"le \" + day + \" \" + month + \" \" + year);\n var hour = date.getUTCHours();\n var minute = date.getUTCMinutes();\n \n if(delta < 6 * MONTH) {\n return _(\"%2$s %3$d at %4$d:%5$02d\",\n year, month, day, hour, minute);\n }\n else {\n return _(\"%2$s %3$d %1$d at %4$d:%5$02d\",\n year, month, day, hour, minute);\n }\n }", "title": "" }, { "docid": "54ab5019be1bbb04a46c2995fce1e41b", "score": "0.5633177", "text": "function formatMoment(m, inputString) {\n var currentMonth = m.month(),\n currentDate = m.date(),\n currentYear = m.year(),\n currentDay = m.day(),\n currentHours = m.hours(),\n currentMinutes = m.minutes(),\n currentSeconds = m.seconds(),\n currentZone = -m.zone(),\n ordinal = moment.ordinal,\n meridiem = moment.meridiem;\n // check if the character is a format\n // return formatted string or non string.\n //\n // uses switch/case instead of an object of named functions (like http://phpjs.org/functions/date:380)\n // for minification and performance\n // see http://jsperf.com/object-of-functions-vs-switch for performance comparison\n function replaceFunction(input) {\n // create a couple variables to be used later inside one of the cases.\n var a, b;\n switch (input) {\n // MONTH\n case 'M' :\n return currentMonth + 1;\n case 'Mo' :\n return (currentMonth + 1) + ordinal(currentMonth + 1);\n case 'MM' :\n return leftZeroFill(currentMonth + 1, 2);\n case 'MMM' :\n return moment.monthsShort[currentMonth];\n case 'MMMM' :\n return moment.months[currentMonth];\n // DAY OF MONTH\n case 'D' :\n return currentDate;\n case 'Do' :\n return currentDate + ordinal(currentDate);\n case 'DD' :\n return leftZeroFill(currentDate, 2);\n // DAY OF YEAR\n case 'DDD' :\n a = new Date(currentYear, currentMonth, currentDate);\n b = new Date(currentYear, 0, 1);\n return ~~ (((a - b) / 864e5) + 1.5);\n case 'DDDo' :\n a = replaceFunction('DDD');\n return a + ordinal(a);\n case 'DDDD' :\n return leftZeroFill(replaceFunction('DDD'), 3);\n // WEEKDAY\n case 'd' :\n return currentDay;\n case 'do' :\n return currentDay + ordinal(currentDay);\n case 'ddd' :\n return moment.weekdaysShort[currentDay];\n case 'dddd' :\n return moment.weekdays[currentDay];\n // WEEK OF YEAR\n case 'w' :\n a = new Date(currentYear, currentMonth, currentDate - currentDay + 5);\n b = new Date(a.getFullYear(), 0, 4);\n return ~~ ((a - b) / 864e5 / 7 + 1.5);\n case 'wo' :\n a = replaceFunction('w');\n return a + ordinal(a);\n case 'ww' :\n return leftZeroFill(replaceFunction('w'), 2);\n // YEAR\n case 'YY' :\n return leftZeroFill(currentYear % 100, 2);\n case 'YYYY' :\n return currentYear;\n // AM / PM\n case 'a' :\n return currentHours > 11 ? meridiem.pm : meridiem.am;\n case 'A' :\n return currentHours > 11 ? meridiem.PM : meridiem.AM;\n // 24 HOUR\n case 'H' :\n return currentHours;\n case 'HH' :\n return leftZeroFill(currentHours, 2);\n // 12 HOUR\n case 'h' :\n return currentHours % 12 || 12;\n case 'hh' :\n return leftZeroFill(currentHours % 12 || 12, 2);\n // MINUTE\n case 'm' :\n return currentMinutes;\n case 'mm' :\n return leftZeroFill(currentMinutes, 2);\n // SECOND\n case 's' :\n return currentSeconds;\n case 'ss' :\n return leftZeroFill(currentSeconds, 2);\n // TIMEZONE\n case 'zz' :\n // depreciating 'zz' fall through to 'z'\n case 'z' :\n return (m._d.toString().match(timezoneRegex) || [''])[0].replace(nonuppercaseLetters, '');\n case 'Z' :\n return (currentZone < 0 ? '-' : '+') + leftZeroFill(~~(Math.abs(currentZone) / 60), 2) + ':' + leftZeroFill(~~(Math.abs(currentZone) % 60), 2);\n case 'ZZ' :\n return (currentZone < 0 ? '-' : '+') + leftZeroFill(~~(10 * Math.abs(currentZone) / 6), 4);\n // LONG DATES\n case 'L' :\n case 'LL' :\n case 'LLL' :\n case 'LLLL' :\n case 'LT' :\n return formatMoment(m, moment.longDateFormat[input]);\n // DEFAULT\n default :\n return input.replace(/(^\\[)|(\\\\)|\\]$/g, \"\");\n }\n }\n return inputString.replace(charactersToReplace, replaceFunction);\n }", "title": "" }, { "docid": "f2d9f6caa0787bb17a3353e82b233896", "score": "0.5621383", "text": "function durationFormat() {\n\n var args = [].slice.call(arguments);\n var settings = extend({}, this.format.defaults);\n\n // Keep a shadow copy of this moment for calculating remainders.\n // Perform all calculations on positive duration value, handle negative\n // sign at the very end.\n var asMilliseconds = this.asMilliseconds();\n var asMonths = this.asMonths();\n\n // Treat invalid durations as having a value of 0 milliseconds.\n if (typeof this.isValid === \"function\" && this.isValid() === false) {\n asMilliseconds = 0;\n asMonths = 0;\n }\n\n var isNegative = asMilliseconds < 0;\n\n // Two shadow copies are needed because of the way moment.js handles\n // duration arithmetic for years/months and for weeks/days/hours/minutes/seconds.\n var remainder = moment.duration(Math.abs(asMilliseconds), \"milliseconds\");\n var remainderMonths = moment.duration(Math.abs(asMonths), \"months\");\n\n // Parse arguments.\n each(args, function (arg) {\n if (typeof arg === \"string\" || typeof arg === \"function\") {\n settings.template = arg;\n return;\n }\n\n if (typeof arg === \"number\") {\n settings.precision = arg;\n return;\n }\n\n if (isObject(arg)) {\n extend(settings, arg);\n }\n });\n\n var momentTokens = {\n years: \"y\",\n months: \"M\",\n weeks: \"w\",\n days: \"d\",\n hours: \"h\",\n minutes: \"m\",\n seconds: \"s\",\n milliseconds: \"S\"\n };\n\n var tokenDefs = {\n escape: /\\[(.+?)\\]/,\n years: /\\*?[Yy]+/,\n months: /\\*?M+/,\n weeks: /\\*?[Ww]+/,\n days: /\\*?[Dd]+/,\n hours: /\\*?[Hh]+/,\n minutes: /\\*?m+/,\n seconds: /\\*?s+/,\n milliseconds: /\\*?S+/,\n general: /.+?/\n };\n\n // Types array is available in the template function.\n settings.types = types;\n\n var typeMap = function (token) {\n return find(types, function (type) {\n return tokenDefs[type].test(token);\n });\n };\n\n var tokenizer = new RegExp(map(types, function (type) {\n return tokenDefs[type].source;\n }).join(\"|\"), \"g\");\n\n // Current duration object is available in the template function.\n settings.duration = this;\n\n // Eval template function and cache template string.\n var template = typeof settings.template === \"function\" ? settings.template.apply(settings) : settings.template;\n\n // outputTypes and returnMomentTypes are settings to support durationsFormat().\n\n // outputTypes is an array of moment token types that determines\n // the tokens returned in formatted output. This option overrides\n // trim, largest, stopTrim, etc.\n var outputTypes = settings.outputTypes;\n\n // returnMomentTypes is a boolean that sets durationFormat to return\n // the processed momentTypes instead of formatted output.\n var returnMomentTypes = settings.returnMomentTypes;\n\n var largest = settings.largest;\n\n // Setup stopTrim array of token types.\n var stopTrim = [];\n\n if (!outputTypes) {\n if (isArray(settings.stopTrim)) {\n settings.stopTrim = settings.stopTrim.join(\"\");\n }\n\n // Parse stopTrim string to create token types array.\n if (settings.stopTrim) {\n each(settings.stopTrim.match(tokenizer), function (token) {\n var type = typeMap(token);\n\n if (type === \"escape\" || type === \"general\") {\n return;\n }\n\n stopTrim.push(type);\n });\n }\n }\n\n // Cache moment's locale data.\n var localeData = moment.localeData();\n\n if (!localeData) {\n localeData = {};\n }\n\n // Fall back to this plugin's `eng` extension.\n each(keys(engLocale), function (key) {\n if (typeof engLocale[key] === \"function\") {\n if (!localeData[key]) {\n localeData[key] = engLocale[key];\n }\n\n return;\n }\n\n if (!localeData[\"_\" + key]) {\n localeData[\"_\" + key] = engLocale[key];\n }\n });\n\n // Replace Duration Time Template strings.\n // For locale `eng`: `_HMS_`, `_HM_`, and `_MS_`.\n each(keys(localeData._durationTimeTemplates), function (item) {\n template = template.replace(\"_\" + item + \"_\", localeData._durationTimeTemplates[item]);\n });\n\n // Determine user's locale.\n var userLocale = settings.userLocale || moment.locale();\n\n var useLeftUnits = settings.useLeftUnits;\n var usePlural = settings.usePlural;\n var precision = settings.precision;\n var forceLength = settings.forceLength;\n var useGrouping = settings.useGrouping;\n var trunc = settings.trunc;\n\n // Use significant digits only when precision is greater than 0.\n var useSignificantDigits = settings.useSignificantDigits && precision > 0;\n var significantDigits = useSignificantDigits ? settings.precision : 0;\n var significantDigitsCache = significantDigits;\n\n var minValue = settings.minValue;\n var isMinValue = false;\n\n var maxValue = settings.maxValue;\n var isMaxValue = false;\n\n // formatNumber fallback options.\n var useToLocaleString = settings.useToLocaleString;\n var groupingSeparator = settings.groupingSeparator;\n var decimalSeparator = settings.decimalSeparator;\n var grouping = settings.grouping;\n\n useToLocaleString = useToLocaleString && toLocaleStringWorks;\n\n // Trim options.\n var trim = settings.trim;\n\n if (isArray(trim)) {\n trim = trim.join(\" \");\n }\n\n if (trim === null && (largest || maxValue || useSignificantDigits)) {\n trim = \"all\";\n }\n\n if (trim === null || trim === true || trim === \"left\" || trim === \"right\") {\n trim = \"large\";\n }\n\n if (trim === false) {\n trim = \"\";\n }\n\n var trimIncludes = function (item) {\n return item.test(trim);\n };\n\n var rLarge = /large/;\n var rSmall = /small/;\n var rBoth = /both/;\n var rMid = /mid/;\n var rAll = /^all|[^sm]all/;\n var rFinal = /final/;\n\n var trimLarge = largest > 0 || any([rLarge, rBoth, rAll], trimIncludes);\n var trimSmall = any([rSmall, rBoth, rAll], trimIncludes);\n var trimMid = any([rMid, rAll], trimIncludes);\n var trimFinal = any([rFinal, rAll], trimIncludes);\n\n // Parse format string to create raw tokens array.\n var rawTokens = map(template.match(tokenizer), function (token, index) {\n var type = typeMap(token);\n\n if (token.slice(0, 1) === \"*\") {\n token = token.slice(1);\n\n if (type !== \"escape\" && type !== \"general\") {\n stopTrim.push(type);\n }\n }\n\n return {\n index: index,\n length: token.length,\n text: \"\",\n\n // Replace escaped tokens with the non-escaped token text.\n token: (type === \"escape\" ? token.replace(tokenDefs.escape, \"$1\") : token),\n\n // Ignore type on non-moment tokens.\n type: ((type === \"escape\" || type === \"general\") ? null : type)\n };\n });\n\n // Associate text tokens with moment tokens.\n var currentToken = {\n index: 0,\n length: 0,\n token: \"\",\n text: \"\",\n type: null\n };\n\n var tokens = [];\n\n if (useLeftUnits) {\n rawTokens.reverse();\n }\n\n each(rawTokens, function (token) {\n if (token.type) {\n if (currentToken.type || currentToken.text) {\n tokens.push(currentToken);\n }\n\n currentToken = token;\n\n return;\n }\n\n if (useLeftUnits) {\n currentToken.text = token.token + currentToken.text;\n } else {\n currentToken.text += token.token;\n }\n });\n\n if (currentToken.type || currentToken.text) {\n tokens.push(currentToken);\n }\n\n if (useLeftUnits) {\n tokens.reverse();\n }\n\n // Find unique moment token types in the template in order of\n // descending magnitude.\n var momentTypes = intersection(types, unique(compact(pluck(tokens, \"type\"))));\n\n // Exit early if there are no moment token types.\n if (!momentTypes.length) {\n return pluck(tokens, \"text\").join(\"\");\n }\n\n // Calculate values for each moment type in the template.\n // For processing the settings, values are associated with moment types.\n // Values will be assigned to tokens at the last step in order to\n // assume nothing about frequency or order of tokens in the template.\n momentTypes = map(momentTypes, function (momentType, index) {\n // Is this the least-magnitude moment token found?\n var isSmallest = ((index + 1) === momentTypes.length);\n\n // Is this the greatest-magnitude moment token found?\n var isLargest = (!index);\n\n // Get the raw value in the current units.\n var rawValue;\n\n if (momentType === \"years\" || momentType === \"months\") {\n rawValue = remainderMonths.as(momentType);\n } else {\n rawValue = remainder.as(momentType);\n }\n\n var wholeValue = Math.floor(rawValue);\n var decimalValue = rawValue - wholeValue;\n\n var token = find(tokens, function (token) {\n return momentType === token.type;\n });\n\n if (isLargest && maxValue && rawValue > maxValue) {\n isMaxValue = true;\n }\n\n if (isSmallest && minValue && Math.abs(settings.duration.as(momentType)) < minValue) {\n isMinValue = true;\n }\n\n // Note the length of the largest-magnitude moment token:\n // if it is greater than one and forceLength is not set,\n // then default forceLength to `true`.\n //\n // Rationale is this: If the template is \"h:mm:ss\" and the\n // moment value is 5 minutes, the user-friendly output is\n // \"5:00\", not \"05:00\". We shouldn't pad the `minutes` token\n // even though it has length of two if the template is \"h:mm:ss\";\n //\n // If the minutes output should always include the leading zero\n // even when the hour is trimmed then set `{ forceLength: true }`\n // to output \"05:00\". If the template is \"hh:mm:ss\", the user\n // clearly wanted everything padded so we should output \"05:00\";\n //\n // If the user wants the full padded output, they can use\n // template \"hh:mm:ss\" and set `{ trim: false }` to output\n // \"00:05:00\".\n if (isLargest && forceLength === null && token.length > 1) {\n forceLength = true;\n }\n\n // Update remainder.\n remainder.subtract(wholeValue, momentType);\n remainderMonths.subtract(wholeValue, momentType);\n\n return {\n rawValue: rawValue,\n wholeValue: wholeValue,\n // Decimal value is only retained for the least-magnitude\n // moment type in the format template.\n decimalValue: isSmallest ? decimalValue : 0,\n isSmallest: isSmallest,\n isLargest: isLargest,\n type: momentType,\n // Tokens can appear multiple times in a template string,\n // but all instances must share the same length.\n tokenLength: token.length\n };\n });\n\n var truncMethod = trunc ? Math.floor : Math.round;\n var truncate = function (value, places) {\n var factor = Math.pow(10, places);\n return truncMethod(value * factor) / factor;\n };\n\n var foundFirst = false;\n var bubbled = false;\n\n var formatValue = function (momentType, index) {\n var formatOptions = {\n useGrouping: useGrouping,\n groupingSeparator: groupingSeparator,\n decimalSeparator: decimalSeparator,\n grouping: grouping,\n useToLocaleString: useToLocaleString\n };\n\n if (useSignificantDigits) {\n if (significantDigits <= 0) {\n momentType.rawValue = 0;\n momentType.wholeValue = 0;\n momentType.decimalValue = 0;\n } else {\n formatOptions.maximumSignificantDigits = significantDigits;\n momentType.significantDigits = significantDigits;\n }\n }\n\n if (isMaxValue && !bubbled) {\n if (momentType.isLargest) {\n momentType.wholeValue = maxValue;\n momentType.decimalValue = 0;\n } else {\n momentType.wholeValue = 0;\n momentType.decimalValue = 0;\n }\n }\n\n if (isMinValue && !bubbled) {\n if (momentType.isSmallest) {\n momentType.wholeValue = minValue;\n momentType.decimalValue = 0;\n } else {\n momentType.wholeValue = 0;\n momentType.decimalValue = 0;\n }\n }\n\n if (momentType.isSmallest || momentType.significantDigits && momentType.significantDigits - momentType.wholeValue.toString().length <= 0) {\n // Apply precision to least significant token value.\n if (precision < 0) {\n momentType.value = truncate(momentType.wholeValue, precision);\n } else if (precision === 0) {\n momentType.value = truncMethod(momentType.wholeValue + momentType.decimalValue);\n } else { // precision > 0\n if (useSignificantDigits) {\n if (trunc) {\n momentType.value = truncate(momentType.rawValue, significantDigits - momentType.wholeValue.toString().length);\n } else {\n momentType.value = momentType.rawValue;\n }\n\n if (momentType.wholeValue) {\n significantDigits -= momentType.wholeValue.toString().length;\n }\n } else {\n formatOptions.fractionDigits = precision;\n\n if (trunc) {\n momentType.value = momentType.wholeValue + truncate(momentType.decimalValue, precision);\n } else {\n momentType.value = momentType.wholeValue + momentType.decimalValue;\n }\n }\n }\n } else {\n if (useSignificantDigits && momentType.wholeValue) {\n // Outer Math.round required here to handle floating point errors.\n momentType.value = Math.round(truncate(momentType.wholeValue, momentType.significantDigits - momentType.wholeValue.toString().length));\n\n significantDigits -= momentType.wholeValue.toString().length;\n } else {\n momentType.value = momentType.wholeValue;\n }\n }\n\n if (momentType.tokenLength > 1 && (forceLength || foundFirst)) {\n formatOptions.minimumIntegerDigits = momentType.tokenLength;\n\n if (bubbled && formatOptions.maximumSignificantDigits < momentType.tokenLength) {\n delete formatOptions.maximumSignificantDigits;\n }\n }\n\n if (!foundFirst && (momentType.value > 0 || trim === \"\" /* trim: false */ || find(stopTrim, momentType.type) || find(outputTypes, momentType.type))) {\n foundFirst = true;\n }\n\n momentType.formattedValue = formatNumber(momentType.value, formatOptions, userLocale);\n\n formatOptions.useGrouping = false;\n formatOptions.decimalSeparator = \".\";\n momentType.formattedValueEn = formatNumber(momentType.value, formatOptions, \"en\");\n\n if (momentType.tokenLength === 2 && momentType.type === \"milliseconds\") {\n momentType.formattedValueMS = formatNumber(momentType.value, {\n minimumIntegerDigits: 3,\n useGrouping: false\n }, \"en\").slice(0, 2);\n }\n\n return momentType;\n };\n\n // Calculate formatted values.\n momentTypes = map(momentTypes, formatValue);\n momentTypes = compact(momentTypes);\n\n // Bubble rounded values.\n if (momentTypes.length > 1) {\n var findType = function (type) {\n return find(momentTypes, function (momentType) {\n return momentType.type === type;\n });\n };\n\n var bubbleTypes = function (bubble) {\n var bubbleMomentType = findType(bubble.type);\n\n if (!bubbleMomentType) {\n return;\n }\n\n each(bubble.targets, function (target) {\n var targetMomentType = findType(target.type);\n\n if (!targetMomentType) {\n return;\n }\n\n if (parseInt(bubbleMomentType.formattedValueEn, 10) === target.value) {\n bubbleMomentType.rawValue = 0;\n bubbleMomentType.wholeValue = 0;\n bubbleMomentType.decimalValue = 0;\n targetMomentType.rawValue += 1;\n targetMomentType.wholeValue += 1;\n targetMomentType.decimalValue = 0;\n targetMomentType.formattedValueEn = targetMomentType.wholeValue.toString();\n bubbled = true;\n }\n });\n };\n\n each(bubbles, bubbleTypes);\n }\n\n // Recalculate formatted values.\n if (bubbled) {\n foundFirst = false;\n significantDigits = significantDigitsCache;\n momentTypes = map(momentTypes, formatValue);\n momentTypes = compact(momentTypes);\n }\n\n if (outputTypes && !(isMaxValue && !settings.trim)) {\n momentTypes = map(momentTypes, function (momentType) {\n if (find(outputTypes, function (outputType) {\n return momentType.type === outputType;\n })) {\n return momentType;\n }\n\n return null;\n });\n\n momentTypes = compact(momentTypes);\n } else {\n // Trim Large.\n if (trimLarge) {\n momentTypes = rest(momentTypes, function (momentType) {\n // Stop trimming on:\n // - the smallest moment type\n // - a type marked for stopTrim\n // - a type that has a whole value\n return !momentType.isSmallest && !momentType.wholeValue && !find(stopTrim, momentType.type);\n });\n }\n\n // Largest.\n if (largest && momentTypes.length) {\n momentTypes = momentTypes.slice(0, largest);\n }\n\n // Trim Small.\n if (trimSmall && momentTypes.length > 1) {\n momentTypes = initial(momentTypes, function (momentType) {\n // Stop trimming on:\n // - a type marked for stopTrim\n // - a type that has a whole value\n // - the largest momentType\n return !momentType.wholeValue && !find(stopTrim, momentType.type) && !momentType.isLargest;\n });\n }\n\n // Trim Mid.\n if (trimMid) {\n momentTypes = map(momentTypes, function (momentType, index) {\n if (index > 0 && index < momentTypes.length - 1 && !momentType.wholeValue) {\n return null;\n }\n\n return momentType;\n });\n\n momentTypes = compact(momentTypes);\n }\n\n // Trim Final.\n if (trimFinal && momentTypes.length === 1 && !momentTypes[0].wholeValue && !(!trunc && momentTypes[0].isSmallest && momentTypes[0].rawValue < minValue)) {\n momentTypes = [];\n }\n }\n\n if (returnMomentTypes) {\n return momentTypes;\n }\n\n // Localize and pluralize unit labels.\n each(tokens, function (token) {\n var key = momentTokens[token.type];\n\n var momentType = find(momentTypes, function (momentType) {\n return momentType.type === token.type;\n });\n\n if (!key || !momentType) {\n return;\n }\n\n var values = momentType.formattedValueEn.split(\".\");\n\n values[0] = parseInt(values[0], 10);\n\n if (values[1]) {\n values[1] = parseFloat(\"0.\" + values[1], 10);\n } else {\n values[1] = null;\n }\n\n var pluralKey = localeData.durationPluralKey(key, values[0], values[1]);\n\n var labels = durationGetLabels(key, localeData);\n\n var autoLocalized = false;\n\n var pluralizedLabels = {};\n\n // Auto-Localized unit labels.\n each(localeData._durationLabelTypes, function (labelType) {\n var label = find(labels, function (label) {\n return label.type === labelType.type && label.key === pluralKey;\n });\n\n if (label) {\n pluralizedLabels[label.type] = label.label;\n\n if (stringIncludes(token.text, labelType.string)) {\n token.text = token.text.replace(labelType.string, label.label);\n autoLocalized = true;\n }\n }\n });\n\n // Auto-pluralized unit labels.\n if (usePlural && !autoLocalized) {\n labels.sort(durationLabelCompare);\n\n each(labels, function (label) {\n if (pluralizedLabels[label.type] === label.label) {\n if (stringIncludes(token.text, label.label)) {\n // Stop checking this token if its label is already\n // correctly pluralized.\n return false;\n }\n\n // Skip this label if it is correct, but not present in\n // the token's text.\n return;\n }\n\n if (stringIncludes(token.text, label.label)) {\n // Replece this token's label and stop checking.\n token.text = token.text.replace(label.label, pluralizedLabels[label.type]);\n return false;\n }\n });\n }\n });\n\n // Build ouptut.\n tokens = map(tokens, function (token) {\n if (!token.type) {\n return token.text;\n }\n\n var momentType = find(momentTypes, function (momentType) {\n return momentType.type === token.type;\n });\n\n if (!momentType) {\n return \"\";\n }\n\n var out = \"\";\n\n if (useLeftUnits) {\n out += token.text;\n }\n\n if (isNegative && isMaxValue || !isNegative && isMinValue) {\n out += \"< \";\n isMaxValue = false;\n isMinValue = false;\n }\n\n if (isNegative && isMinValue || !isNegative && isMaxValue) {\n out += \"> \";\n isMaxValue = false;\n isMinValue = false;\n }\n\n if (isNegative && (momentType.value > 0 || trim === \"\" || find(stopTrim, momentType.type) || find(outputTypes, momentType.type))) {\n out += \"-\";\n isNegative = false;\n }\n\n if (token.type === \"milliseconds\" && momentType.formattedValueMS) {\n out += momentType.formattedValueMS;\n } else {\n out += momentType.formattedValue;\n }\n\n if (!useLeftUnits) {\n out += token.text;\n }\n\n return out;\n });\n\n // Trim leading and trailing comma, space, colon, and dot.\n return tokens.join(\"\").replace(/(,| |:|\\.)*$/, \"\").replace(/^(,| |:|\\.)*/, \"\");\n }", "title": "" }, { "docid": "1eecf3da06e095ec9858ae9f18c6af2f", "score": "0.5621383", "text": "function durationFormat() {\n\n var args = [].slice.call(arguments);\n var settings = extend({}, this.format.defaults);\n\n // Keep a shadow copy of this moment for calculating remainders.\n // Perform all calculations on positive duration value, handle negative\n // sign at the very end.\n var asMilliseconds = this.asMilliseconds();\n var asMonths = this.asMonths();\n\n // Treat invalid durations as having a value of 0 milliseconds.\n if (typeof this.isValid === \"function\" && this.isValid() === false) {\n asMilliseconds = 0;\n asMonths = 0;\n }\n\n var isNegative = asMilliseconds < 0;\n\n // Two shadow copies are needed because of the way moment.js handles\n // duration arithmetic for years/months and for weeks/days/hours/minutes/seconds.\n var remainder = moment.duration(Math.abs(asMilliseconds), \"milliseconds\");\n var remainderMonths = moment.duration(Math.abs(asMonths), \"months\");\n\n // Parse arguments.\n each(args, function (arg) {\n if (typeof arg === \"string\" || typeof arg === \"function\") {\n settings.template = arg;\n return;\n }\n\n if (typeof arg === \"number\") {\n settings.precision = arg;\n return;\n }\n\n if (isObject(arg)) {\n extend(settings, arg);\n }\n });\n\n var momentTokens = {\n years: \"y\",\n months: \"M\",\n weeks: \"w\",\n days: \"d\",\n hours: \"h\",\n minutes: \"m\",\n seconds: \"s\",\n milliseconds: \"S\"\n };\n\n var tokenDefs = {\n escape: /\\[(.+?)\\]/,\n years: /\\*?[Yy]+/,\n months: /\\*?M+/,\n weeks: /\\*?[Ww]+/,\n days: /\\*?[Dd]+/,\n hours: /\\*?[Hh]+/,\n minutes: /\\*?m+/,\n seconds: /\\*?s+/,\n milliseconds: /\\*?S+/,\n general: /.+?/\n };\n\n // Types array is available in the template function.\n settings.types = types;\n\n var typeMap = function (token) {\n return find(types, function (type) {\n return tokenDefs[type].test(token);\n });\n };\n\n var tokenizer = new RegExp(map(types, function (type) {\n return tokenDefs[type].source;\n }).join(\"|\"), \"g\");\n\n // Current duration object is available in the template function.\n settings.duration = this;\n\n // Eval template function and cache template string.\n var template = typeof settings.template === \"function\" ? settings.template.apply(settings) : settings.template;\n\n // outputTypes and returnMomentTypes are settings to support durationsFormat().\n\n // outputTypes is an array of moment token types that determines\n // the tokens returned in formatted output. This option overrides\n // trim, largest, stopTrim, etc.\n var outputTypes = settings.outputTypes;\n\n // returnMomentTypes is a boolean that sets durationFormat to return\n // the processed momentTypes instead of formatted output.\n var returnMomentTypes = settings.returnMomentTypes;\n\n var largest = settings.largest;\n\n // Setup stopTrim array of token types.\n var stopTrim = [];\n\n if (!outputTypes) {\n if (isArray(settings.stopTrim)) {\n settings.stopTrim = settings.stopTrim.join(\"\");\n }\n\n // Parse stopTrim string to create token types array.\n if (settings.stopTrim) {\n each(settings.stopTrim.match(tokenizer), function (token) {\n var type = typeMap(token);\n\n if (type === \"escape\" || type === \"general\") {\n return;\n }\n\n stopTrim.push(type);\n });\n }\n }\n\n // Cache moment's locale data.\n var localeData = moment.localeData();\n\n if (!localeData) {\n localeData = {};\n }\n\n // Fall back to this plugin's `eng` extension.\n each(keys(engLocale), function (key) {\n if (typeof engLocale[key] === \"function\") {\n if (!localeData[key]) {\n localeData[key] = engLocale[key];\n }\n\n return;\n }\n\n if (!localeData[\"_\" + key]) {\n localeData[\"_\" + key] = engLocale[key];\n }\n });\n\n // Replace Duration Time Template strings.\n // For locale `eng`: `_HMS_`, `_HM_`, and `_MS_`.\n each(keys(localeData._durationTimeTemplates), function (item) {\n template = template.replace(\"_\" + item + \"_\", localeData._durationTimeTemplates[item]);\n });\n\n // Determine user's locale.\n var userLocale = settings.userLocale || moment.locale();\n\n var useLeftUnits = settings.useLeftUnits;\n var usePlural = settings.usePlural;\n var precision = settings.precision;\n var forceLength = settings.forceLength;\n var useGrouping = settings.useGrouping;\n var trunc = settings.trunc;\n\n // Use significant digits only when precision is greater than 0.\n var useSignificantDigits = settings.useSignificantDigits && precision > 0;\n var significantDigits = useSignificantDigits ? settings.precision : 0;\n var significantDigitsCache = significantDigits;\n\n var minValue = settings.minValue;\n var isMinValue = false;\n\n var maxValue = settings.maxValue;\n var isMaxValue = false;\n\n // formatNumber fallback options.\n var useToLocaleString = settings.useToLocaleString;\n var groupingSeparator = settings.groupingSeparator;\n var decimalSeparator = settings.decimalSeparator;\n var grouping = settings.grouping;\n\n useToLocaleString = useToLocaleString && (toLocaleStringWorks || intlNumberFormatWorks);\n\n // Trim options.\n var trim = settings.trim;\n\n if (isArray(trim)) {\n trim = trim.join(\" \");\n }\n\n if (trim === null && (largest || maxValue || useSignificantDigits)) {\n trim = \"all\";\n }\n\n if (trim === null || trim === true || trim === \"left\" || trim === \"right\") {\n trim = \"large\";\n }\n\n if (trim === false) {\n trim = \"\";\n }\n\n var trimIncludes = function (item) {\n return item.test(trim);\n };\n\n var rLarge = /large/;\n var rSmall = /small/;\n var rBoth = /both/;\n var rMid = /mid/;\n var rAll = /^all|[^sm]all/;\n var rFinal = /final/;\n\n var trimLarge = largest > 0 || any([rLarge, rBoth, rAll], trimIncludes);\n var trimSmall = any([rSmall, rBoth, rAll], trimIncludes);\n var trimMid = any([rMid, rAll], trimIncludes);\n var trimFinal = any([rFinal, rAll], trimIncludes);\n\n // Parse format string to create raw tokens array.\n var rawTokens = map(template.match(tokenizer), function (token, index) {\n var type = typeMap(token);\n\n if (token.slice(0, 1) === \"*\") {\n token = token.slice(1);\n\n if (type !== \"escape\" && type !== \"general\") {\n stopTrim.push(type);\n }\n }\n\n return {\n index: index,\n length: token.length,\n text: \"\",\n\n // Replace escaped tokens with the non-escaped token text.\n token: (type === \"escape\" ? token.replace(tokenDefs.escape, \"$1\") : token),\n\n // Ignore type on non-moment tokens.\n type: ((type === \"escape\" || type === \"general\") ? null : type)\n };\n });\n\n // Associate text tokens with moment tokens.\n var currentToken = {\n index: 0,\n length: 0,\n token: \"\",\n text: \"\",\n type: null\n };\n\n var tokens = [];\n\n if (useLeftUnits) {\n rawTokens.reverse();\n }\n\n each(rawTokens, function (token) {\n if (token.type) {\n if (currentToken.type || currentToken.text) {\n tokens.push(currentToken);\n }\n\n currentToken = token;\n\n return;\n }\n\n if (useLeftUnits) {\n currentToken.text = token.token + currentToken.text;\n } else {\n currentToken.text += token.token;\n }\n });\n\n if (currentToken.type || currentToken.text) {\n tokens.push(currentToken);\n }\n\n if (useLeftUnits) {\n tokens.reverse();\n }\n\n // Find unique moment token types in the template in order of\n // descending magnitude.\n var momentTypes = intersection(types, unique(compact(pluck(tokens, \"type\"))));\n\n // Exit early if there are no moment token types.\n if (!momentTypes.length) {\n return pluck(tokens, \"text\").join(\"\");\n }\n\n // Calculate values for each moment type in the template.\n // For processing the settings, values are associated with moment types.\n // Values will be assigned to tokens at the last step in order to\n // assume nothing about frequency or order of tokens in the template.\n momentTypes = map(momentTypes, function (momentType, index) {\n // Is this the least-magnitude moment token found?\n var isSmallest = ((index + 1) === momentTypes.length);\n\n // Is this the greatest-magnitude moment token found?\n var isLargest = (!index);\n\n // Get the raw value in the current units.\n var rawValue;\n\n if (momentType === \"years\" || momentType === \"months\") {\n rawValue = remainderMonths.as(momentType);\n } else {\n rawValue = remainder.as(momentType);\n }\n\n var wholeValue = Math.floor(rawValue);\n var decimalValue = rawValue - wholeValue;\n\n var token = find(tokens, function (token) {\n return momentType === token.type;\n });\n\n if (isLargest && maxValue && rawValue > maxValue) {\n isMaxValue = true;\n }\n\n if (isSmallest && minValue && Math.abs(settings.duration.as(momentType)) < minValue) {\n isMinValue = true;\n }\n\n // Note the length of the largest-magnitude moment token:\n // if it is greater than one and forceLength is not set,\n // then default forceLength to `true`.\n //\n // Rationale is this: If the template is \"h:mm:ss\" and the\n // moment value is 5 minutes, the user-friendly output is\n // \"5:00\", not \"05:00\". We shouldn't pad the `minutes` token\n // even though it has length of two if the template is \"h:mm:ss\";\n //\n // If the minutes output should always include the leading zero\n // even when the hour is trimmed then set `{ forceLength: true }`\n // to output \"05:00\". If the template is \"hh:mm:ss\", the user\n // clearly wanted everything padded so we should output \"05:00\";\n //\n // If the user wants the full padded output, they can use\n // template \"hh:mm:ss\" and set `{ trim: false }` to output\n // \"00:05:00\".\n if (isLargest && forceLength === null && token.length > 1) {\n forceLength = true;\n }\n\n // Update remainder.\n remainder.subtract(wholeValue, momentType);\n remainderMonths.subtract(wholeValue, momentType);\n\n return {\n rawValue: rawValue,\n wholeValue: wholeValue,\n // Decimal value is only retained for the least-magnitude\n // moment type in the format template.\n decimalValue: isSmallest ? decimalValue : 0,\n isSmallest: isSmallest,\n isLargest: isLargest,\n type: momentType,\n // Tokens can appear multiple times in a template string,\n // but all instances must share the same length.\n tokenLength: token.length\n };\n });\n\n var truncMethod = trunc ? Math.floor : Math.round;\n var truncate = function (value, places) {\n var factor = Math.pow(10, places);\n return truncMethod(value * factor) / factor;\n };\n\n var foundFirst = false;\n var bubbled = false;\n\n var formatValue = function (momentType, index) {\n var formatOptions = {\n useGrouping: useGrouping,\n groupingSeparator: groupingSeparator,\n decimalSeparator: decimalSeparator,\n grouping: grouping,\n useToLocaleString: useToLocaleString\n };\n\n if (useSignificantDigits) {\n if (significantDigits <= 0) {\n momentType.rawValue = 0;\n momentType.wholeValue = 0;\n momentType.decimalValue = 0;\n } else {\n formatOptions.maximumSignificantDigits = significantDigits;\n momentType.significantDigits = significantDigits;\n }\n }\n\n if (isMaxValue && !bubbled) {\n if (momentType.isLargest) {\n momentType.wholeValue = maxValue;\n momentType.decimalValue = 0;\n } else {\n momentType.wholeValue = 0;\n momentType.decimalValue = 0;\n }\n }\n\n if (isMinValue && !bubbled) {\n if (momentType.isSmallest) {\n momentType.wholeValue = minValue;\n momentType.decimalValue = 0;\n } else {\n momentType.wholeValue = 0;\n momentType.decimalValue = 0;\n }\n }\n\n if (momentType.isSmallest || momentType.significantDigits && momentType.significantDigits - momentType.wholeValue.toString().length <= 0) {\n // Apply precision to least significant token value.\n if (precision < 0) {\n momentType.value = truncate(momentType.wholeValue, precision);\n } else if (precision === 0) {\n momentType.value = truncMethod(momentType.wholeValue + momentType.decimalValue);\n } else { // precision > 0\n if (useSignificantDigits) {\n if (trunc) {\n momentType.value = truncate(momentType.rawValue, significantDigits - momentType.wholeValue.toString().length);\n } else {\n momentType.value = momentType.rawValue;\n }\n\n if (momentType.wholeValue) {\n significantDigits -= momentType.wholeValue.toString().length;\n }\n } else {\n formatOptions.fractionDigits = precision;\n\n if (trunc) {\n momentType.value = momentType.wholeValue + truncate(momentType.decimalValue, precision);\n } else {\n momentType.value = momentType.wholeValue + momentType.decimalValue;\n }\n }\n }\n } else {\n if (useSignificantDigits && momentType.wholeValue) {\n // Outer Math.round required here to handle floating point errors.\n momentType.value = Math.round(truncate(momentType.wholeValue, momentType.significantDigits - momentType.wholeValue.toString().length));\n\n significantDigits -= momentType.wholeValue.toString().length;\n } else {\n momentType.value = momentType.wholeValue;\n }\n }\n\n if (momentType.tokenLength > 1 && (forceLength || foundFirst)) {\n formatOptions.minimumIntegerDigits = momentType.tokenLength;\n\n if (bubbled && formatOptions.maximumSignificantDigits < momentType.tokenLength) {\n delete formatOptions.maximumSignificantDigits;\n }\n }\n\n if (!foundFirst && (momentType.value > 0 || trim === \"\" /* trim: false */ || find(stopTrim, momentType.type) || find(outputTypes, momentType.type))) {\n foundFirst = true;\n }\n\n momentType.formattedValue = formatNumber(momentType.value, formatOptions, userLocale);\n\n formatOptions.useGrouping = false;\n formatOptions.decimalSeparator = \".\";\n momentType.formattedValueEn = formatNumber(momentType.value, formatOptions, \"en\");\n\n if (momentType.tokenLength === 2 && momentType.type === \"milliseconds\") {\n momentType.formattedValueMS = formatNumber(momentType.value, {\n minimumIntegerDigits: 3,\n useGrouping: false\n }, \"en\").slice(0, 2);\n }\n\n return momentType;\n };\n\n // Calculate formatted values.\n momentTypes = map(momentTypes, formatValue);\n momentTypes = compact(momentTypes);\n\n // Bubble rounded values.\n if (momentTypes.length > 1) {\n var findType = function (type) {\n return find(momentTypes, function (momentType) {\n return momentType.type === type;\n });\n };\n\n var bubbleTypes = function (bubble) {\n var bubbleMomentType = findType(bubble.type);\n\n if (!bubbleMomentType) {\n return;\n }\n\n each(bubble.targets, function (target) {\n var targetMomentType = findType(target.type);\n\n if (!targetMomentType) {\n return;\n }\n\n if (parseInt(bubbleMomentType.formattedValueEn, 10) === target.value) {\n bubbleMomentType.rawValue = 0;\n bubbleMomentType.wholeValue = 0;\n bubbleMomentType.decimalValue = 0;\n targetMomentType.rawValue += 1;\n targetMomentType.wholeValue += 1;\n targetMomentType.decimalValue = 0;\n targetMomentType.formattedValueEn = targetMomentType.wholeValue.toString();\n bubbled = true;\n }\n });\n };\n\n each(bubbles, bubbleTypes);\n }\n\n // Recalculate formatted values.\n if (bubbled) {\n foundFirst = false;\n significantDigits = significantDigitsCache;\n momentTypes = map(momentTypes, formatValue);\n momentTypes = compact(momentTypes);\n }\n\n if (outputTypes && !(isMaxValue && !settings.trim)) {\n momentTypes = map(momentTypes, function (momentType) {\n if (find(outputTypes, function (outputType) {\n return momentType.type === outputType;\n })) {\n return momentType;\n }\n\n return null;\n });\n\n momentTypes = compact(momentTypes);\n } else {\n // Trim Large.\n if (trimLarge) {\n momentTypes = rest(momentTypes, function (momentType) {\n // Stop trimming on:\n // - the smallest moment type\n // - a type marked for stopTrim\n // - a type that has a whole value\n return !momentType.isSmallest && !momentType.wholeValue && !find(stopTrim, momentType.type);\n });\n }\n\n // Largest.\n if (largest && momentTypes.length) {\n momentTypes = momentTypes.slice(0, largest);\n }\n\n // Trim Small.\n if (trimSmall && momentTypes.length > 1) {\n momentTypes = initial(momentTypes, function (momentType) {\n // Stop trimming on:\n // - a type marked for stopTrim\n // - a type that has a whole value\n // - the largest momentType\n return !momentType.wholeValue && !find(stopTrim, momentType.type) && !momentType.isLargest;\n });\n }\n\n // Trim Mid.\n if (trimMid) {\n momentTypes = map(momentTypes, function (momentType, index) {\n if (index > 0 && index < momentTypes.length - 1 && !momentType.wholeValue) {\n return null;\n }\n\n return momentType;\n });\n\n momentTypes = compact(momentTypes);\n }\n\n // Trim Final.\n if (trimFinal && momentTypes.length === 1 && !momentTypes[0].wholeValue && !(!trunc && momentTypes[0].isSmallest && momentTypes[0].rawValue < minValue)) {\n momentTypes = [];\n }\n }\n\n if (returnMomentTypes) {\n return momentTypes;\n }\n\n // Localize and pluralize unit labels.\n each(tokens, function (token) {\n var key = momentTokens[token.type];\n\n var momentType = find(momentTypes, function (momentType) {\n return momentType.type === token.type;\n });\n\n if (!key || !momentType) {\n return;\n }\n\n var values = momentType.formattedValueEn.split(\".\");\n\n values[0] = parseInt(values[0], 10);\n\n if (values[1]) {\n values[1] = parseFloat(\"0.\" + values[1], 10);\n } else {\n values[1] = null;\n }\n\n var pluralKey = localeData.durationPluralKey(key, values[0], values[1]);\n\n var labels = durationGetLabels(key, localeData);\n\n var autoLocalized = false;\n\n var pluralizedLabels = {};\n\n // Auto-Localized unit labels.\n each(localeData._durationLabelTypes, function (labelType) {\n var label = find(labels, function (label) {\n return label.type === labelType.type && label.key === pluralKey;\n });\n\n if (label) {\n pluralizedLabels[label.type] = label.label;\n\n if (stringIncludes(token.text, labelType.string)) {\n token.text = token.text.replace(labelType.string, label.label);\n autoLocalized = true;\n }\n }\n });\n\n // Auto-pluralized unit labels.\n if (usePlural && !autoLocalized) {\n labels.sort(durationLabelCompare);\n\n each(labels, function (label) {\n if (pluralizedLabels[label.type] === label.label) {\n if (stringIncludes(token.text, label.label)) {\n // Stop checking this token if its label is already\n // correctly pluralized.\n return false;\n }\n\n // Skip this label if it is correct, but not present in\n // the token's text.\n return;\n }\n\n if (stringIncludes(token.text, label.label)) {\n // Replece this token's label and stop checking.\n token.text = token.text.replace(label.label, pluralizedLabels[label.type]);\n return false;\n }\n });\n }\n });\n\n // Build ouptut.\n tokens = map(tokens, function (token) {\n if (!token.type) {\n return token.text;\n }\n\n var momentType = find(momentTypes, function (momentType) {\n return momentType.type === token.type;\n });\n\n if (!momentType) {\n return \"\";\n }\n\n var out = \"\";\n\n if (useLeftUnits) {\n out += token.text;\n }\n\n if (isNegative && isMaxValue || !isNegative && isMinValue) {\n out += \"< \";\n isMaxValue = false;\n isMinValue = false;\n }\n\n if (isNegative && isMinValue || !isNegative && isMaxValue) {\n out += \"> \";\n isMaxValue = false;\n isMinValue = false;\n }\n\n if (isNegative && (momentType.value > 0 || trim === \"\" || find(stopTrim, momentType.type) || find(outputTypes, momentType.type))) {\n out += \"-\";\n isNegative = false;\n }\n\n if (token.type === \"milliseconds\" && momentType.formattedValueMS) {\n out += momentType.formattedValueMS;\n } else {\n out += momentType.formattedValue;\n }\n\n if (!useLeftUnits) {\n out += token.text;\n }\n\n return out;\n });\n\n // Trim leading and trailing comma, space, colon, and dot.\n return tokens.join(\"\").replace(/(,| |:|\\.)*$/, \"\").replace(/^(,| |:|\\.)*/, \"\");\n }", "title": "" }, { "docid": "9c5046cd916c57dce20504bfe4e3f2d6", "score": "0.56186205", "text": "humanizeMinutes(minutes, start_at_hours) {\n var days, hours, humanized_effort, show_minutes, unit;\n humanized_effort = \"\";\n start_at_hours = start_at_hours || false;\n if (minutes != null) {\n minutes = parseInt(minutes);\n if (!isNaN(minutes)) {\n if (!start_at_hours) {\n if (minutes >= this.day()) {\n unit = \"d\";\n days = Math.floor(minutes / this.day());\n minutes = minutes - (days * this.day());\n humanized_effort = humanized_effort + `${days}${unit} `;\n }\n }\n // hours\n if (minutes >= 60) {\n unit = \"h\";\n hours = Math.floor(minutes / 60);\n minutes = minutes - (hours * 60);\n humanized_effort = humanized_effort + `${hours}${unit} `;\n }\n // minutes\n if (minutes >= 0) {\n unit = \"m\";\n show_minutes = true;\n if ((minutes === 0) && ((days > 0) || (hours > 0))) {\n show_minutes = false;\n }\n if (show_minutes) {\n humanized_effort = humanized_effort + `${minutes}${unit}`;\n }\n }\n return humanized_effort;\n } else {\n return \"0m\";\n }\n } else {\n return \"0m\";\n }\n }", "title": "" }, { "docid": "09d64026045d313fcd6606e8c680aa5b", "score": "0.5617953", "text": "function createAdder(direction,name){\nreturn function(val,period){\nvar dur,tmp;\n//invert the arguments, but complain about it\nif(period!==null&&!isNaN(+period)){\ndeprecateSimple(name,'moment().'+name+'(period, number) is deprecated. Please use moment().'+name+'(number, period).');\ntmp=val;val=period;period=tmp;}\n\n\nval=typeof val==='string'?+val:val;\ndur=create__createDuration(val,period);\nadd_subtract__addSubtract(this,dur,direction);\nreturn this;};}", "title": "" }, { "docid": "f27b1d9bea72e13dcda4ad29006a9234", "score": "0.5616724", "text": "function humanizeDate(date) {\n\t\t\tif (!date) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar dayCalc = 24 * 60 * 60 * 1000,\n\t\t\t\tdateObj = new Date(date),\n\t\t\t\ttimeAgo = Date.now() - dateObj,\n\t\t\t\tdaysAgo = Math.floor(timeAgo / dayCalc);\n\n\t\t\t// if older than 1 week\n\t\t\tif (daysAgo > 7) {\n\t\t\t\t// display full date\n\t\t\t\treturn $filter('date')(dateObj, 'fullDate');\n\t\t\t} else {\n\t\t\t\t// otherwise, display in relative time (eg. \"3 days ago\")\n\t\t\t\tif (daysAgo === 0) {\n\t\t\t\t\treturn 'today';\n\t\t\t\t} else if (daysAgo === 1) {\n\t\t\t\t\treturn '1 day ago';\n\t\t\t\t}\n\t\t\t\treturn daysAgo + ' days ago';\n\t\t\t}\n\n\t\t}", "title": "" }, { "docid": "8be6564a23b68eabda356f56fbd351b2", "score": "0.56077933", "text": "function formatRelativeTime(fromDate) {\n if (fromDate === undefined)\n fromDate = new Date();\n if ((fromDate instanceof Date) === false)\n fromDate = new Date(fromDate);\n var msPerMinute = 60 * 1000;\n var msPerHour = msPerMinute * 60;\n var msPerDay = msPerHour * 24;\n var msPerMonth = msPerDay * 30;\n var msPerYear = msPerDay * 365;\n\n var elapsed = new Date() - fromDate;\n\n if (elapsed < msPerMinute) {\n return Math.round(elapsed / 1000) + ' giây trước';\n }\n\n else if (elapsed < msPerHour) {\n return Math.round(elapsed / msPerMinute) + ' phút trước';\n }\n\n else if (elapsed < msPerDay) {\n return Math.round(elapsed / msPerHour) + ' giờ trước';\n }\n\n else if (elapsed < msPerMonth) {\n return 'approximately ' + Math.round(elapsed / msPerDay) + ' ngày trước';\n }\n\n else if (elapsed < msPerYear) {\n return 'approximately ' + Math.round(elapsed / msPerMonth) + ' tháng trước';\n }\n\n else {\n return 'approximately ' + Math.round(elapsed / msPerYear) + ' năm trước';\n }\n}", "title": "" }, { "docid": "3f12d051df67463148e436c37043ad09", "score": "0.56072855", "text": "function relativeTimeWithMutation(number,withoutSuffix,key){return number+\" \"+function(text,number){return 2===number?function(text){var mutationTable={m:\"v\",b:\"v\",d:\"z\"};return void 0===mutationTable[text.charAt(0)]?text:mutationTable[text.charAt(0)]+text.substring(1)}(text):text}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[key],number)}", "title": "" }, { "docid": "4e180b34488b31f3a6a7ddf38b24d3c6", "score": "0.5562325", "text": "function processRelativeTime(number,withoutSuffix,key,isFuture){var format={s:[\"mõne sekundi\",\"mõni sekund\",\"paar sekundit\"],ss:[number+\"sekundi\",number+\"sekundit\"],m:[\"ühe minuti\",\"üks minut\"],mm:[number+\" minuti\",number+\" minutit\"],h:[\"ühe tunni\",\"tund aega\",\"üks tund\"],hh:[number+\" tunni\",number+\" tundi\"],d:[\"ühe päeva\",\"üks päev\"],M:[\"kuu aja\",\"kuu aega\",\"üks kuu\"],MM:[number+\" kuu\",number+\" kuud\"],y:[\"ühe aasta\",\"aasta\",\"üks aasta\"],yy:[number+\" aasta\",number+\" aastat\"]};return withoutSuffix?format[key][2]?format[key][2]:format[key][1]:isFuture?format[key][0]:format[key][1]}", "title": "" }, { "docid": "cb2fcbeb4bee6ac664bd3df3c1f7709e", "score": "0.5551895", "text": "function relativeTimeWithPlural(number,withoutSuffix,key){var num,forms;return\"m\"===key?withoutSuffix?\"хвіліна\":\"хвіліну\":\"h\"===key?withoutSuffix?\"гадзіна\":\"гадзіну\":number+\" \"+(num=+number,forms={ss:withoutSuffix?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:withoutSuffix?\"хвіліна_хвіліны_хвілін\":\"хвіліну_хвіліны_хвілін\",hh:withoutSuffix?\"гадзіна_гадзіны_гадзін\":\"гадзіну_гадзіны_гадзін\",dd:\"дзень_дні_дзён\",MM:\"месяц_месяцы_месяцаў\",yy:\"год_гады_гадоў\"}[key].split(\"_\"),num%10==1&&num%100!=11?forms[0]:num%10>=2&&num%10<=4&&(num%100<10||num%100>=20)?forms[1]:forms[2])}", "title": "" } ]
48bcef90511b7991b50c60f55359ca07
INPUT LISTENS FOR 'E' AND '+' PREVENTS APPEARANCE
[ { "docid": "0e5aac1db749ed9b054a3db631dd3f00", "score": "0.0", "text": "function disable() {\n if (guessInput.value.length == 0) {\n clearButton.disabled = true;\n } else {\n clearButton.disabled = false;\n }\n}", "title": "" } ]
[ { "docid": "bdfdd4324160dc3cb641e5926d0a5969", "score": "0.6140711", "text": "function eventPressOperator(e){\n\n const regex = /\\+|\\*|\\/|\\./;\n\n if(regex.test(e.key)){\n\n if(!isNaN(result.value.charAt(result.value.length -1)))\n { \n addExpression(e.key);\n }\n }\n else if(e.key === \"-\"){\n\n addExpression(e.key);\n result.value = result.value.replace(\"--\",\"+\");\n result.value = result.value.replace(\"++\",\"+\");\n }\n else if(e.key === \"Enter\" || e.key === \"=\"){\n\n result.value = calculateExpression(result.value);\n }\n else if(e.key === '%' ){\n \n result.value = calculatePercent(result.value);\n }\n}", "title": "" }, { "docid": "429257984a4330a9ccc2e954ef12bc99", "score": "0.60963064", "text": "function inputPieceAdvice(_e) {\n if (_e) this.__current = _e.target;\n else if (this.__fastComplete && this.__fastCurrent) this.__current = this.__fastCurrent;\n\n if (this.__current && this.__current.tagName == 'LI') {\n var value = this.__input.value;\n var lengthBeforeLine = getLengthToLine(value, this.__handlingObject.current.range.row);\n var newCursorPos = this.__handlingObject.current.range.min + this.__current.textContent.length + lengthBeforeLine;\n this.__input.setSelectionRange(0, 0);\n this.__input.value = value.substr(0, this.__handlingObject.current.range.min + lengthBeforeLine) + this.__current.textContent + value.substr(this.__handlingObject.current.range.max + lengthBeforeLine);\n this.__input.focus();\n this.__input.setCursorTo(newCursorPos);\n this.hide();\n this.clear();\n }\n }", "title": "" }, { "docid": "da4dbe5f647b1ab90d4c3d75623b8e7c", "score": "0.5969325", "text": "function checkKeysInputs(event) {\n if (event.code == \"Enter\") {\n operation(\"=\");\n }\n while (!(/^-?[0-9]*\\.?[0-9]*$/.test(this.value))) {\n this.value = this.value.substr(0, this.value.length - 1);\n }\n}", "title": "" }, { "docid": "8fe1aa6df549baa8eec5ab44daa08d54", "score": "0.5911741", "text": "function PlusMinus(){\n\tif (Current.indexOf(\"e\") != -1){\n\t\tvar epos = Current.indexOf(\"e-\");\n\t\tif (epos != -1){\n\t\t\tCurrent = Current.substring(0,1+epos) + Current.substring(2+epos);\n\t\t}else{\n\t\t\tepos = Current.indexOf(\"e\");\n\t\t\tCurrent = Current.substring(0,1+epos) + \"-\" + Current.substring(1+epos);\n\t\t};\n\t}else{\n\t\tif (Current.indexOf(\"-\") == 0){\n\t\t\tCurrent = Current.substring(1);\n\t\t}else{\n\t\t\tCurrent = \"-\" + Current;\n\t\t};\n\t};\n\trenderDisplay();\n\tconsole.log('Swapped between plus and minus');\n}", "title": "" }, { "docid": "dbdfb535aea405265e9848e1497a246f", "score": "0.5730512", "text": "initAddEventsKeyboard() {\n document.addEventListener('keyup', (e) => {\n\n switch (e.key) {\n case 'c':\n //Limpa tudo\n this.clear();\n break;\n case 'Backspace':\n //apaga ultimo caractere\n if (this._ifResult == true) {\n this.clear()\n }\n this.erase();\n this.calcPrev()\n break;\n case 'Enter':\n //calcular valor final\n if (this._ifResult == true) {\n return\n }\n this._prev = ''\n this.calculate(this._listExp)\n break;\n case '+':\n case '-':\n case '1':\n case '2':\n case '3':\n case '4':\n case '5':\n case '6':\n case '7':\n case '8':\n case '9':\n case '0':\n case '.':\n //Após o resultado do calculo ele limpa a tela ao pressionar outro número, podendo fazer novos calculos \n if (this._ifResult == true) {\n this.clear()\n this._ifResult = false\n }\n this.addValExp(e.key)\n this.calcPrev()\n //adicionar ma lista da expresão\n break;\n case '/':\n if (this._ifResult == true) {\n this.clear()\n this._ifResult = false\n }\n this.addValExp('÷')\n this.calcPrev()\n break;\n case '*':\n if (this._ifResult == true) {\n this.clear()\n this._ifResult = false\n }\n this.addValExp('×')\n this.calcPrev()\n break;\n }\n this.calcPrev()\n if (isNaN(this._listExp[0])) {\n this.error()\n }\n })\n }", "title": "" }, { "docid": "9c3d9adc9e56b8f4728fdc08edc05cef", "score": "0.5719768", "text": "function disE(e) {\n let item = e.target.value;\n equation.value += item;\n}", "title": "" }, { "docid": "b8aa38a68ac2490008b23f8c722b5be9", "score": "0.5700825", "text": "function acceptFloatOnly(e) \n{\n \tvar key;\n\tvar keychar;\n\tvar reg;\n\t\n\tif(window.event) {\n \t// for IE, e.keyCode or window.event.keyCode can be\n \tused\n \tkey = e.keyCode;\n\t}\n\telse if(e.which) {\n \t// netscape\n \tkey = e.which;\n\t}\n\t\n\tif (key ==0 || key ==8 || key ==13) {\n\t\treturn true;\n\t}\n\t\n\tkeychar = String.fromCharCode(key);\n\treg = /[0-9.\\-]/ ;\n\t\n\treturn reg.test(keychar);\n}", "title": "" }, { "docid": "43b15b59be378e6258946c15bf00a210", "score": "0.56982446", "text": "acceptPlus() {\n //\n // Not calling ordinal() because that would decode '+' to a space.\n //\n if (this.text.charCodeAt(this.pos) == CHAR_PLUS) {\n this.pos++;\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "0a902499af706267601592b8c4d5cce6", "score": "0.56839746", "text": "function addExpression_alert() { \n var prefix = document.getElementById(\"prefixEquationText_alert\").value;\n var device = document.getElementById(\"deviceCombo_alert\").value; \n var channel = document.getElementById(\"channelCombo_alert\").value;\n var constant = document.getElementById(\"constValText\").value;\n\n var n = prefix.length;\n var number = prefix.substring(0, n-1);\n if(!isNaN(number)){\n var op = prefix.substring(n-1, n);\n //if (op==\"\") op = \"*\";\n var operands = \"+/*-\";\n if(operands.includes(op)){\n \n if(prefix == \"\"){\n op = \"*\";\n number = \"1\";\n }\n\n var ex = {\n device: device,\n channel: channel,\n constant: constant,\n number: number,\n op: op,\n unit: \"\"\n };\n \n var expression = parseExpression_alert(ex);\n expression = \"(\" + expression + \")\";\n\n \n tempExpressionsList_alert.push(ex);\n\n var operands = \"=<>;\";\n var expText = $(\"#equationText_alert\").html();\n if ((expText != \"\") && !operands.includes(expText[expText.length - 2])) {\n expression = \"+\" + expression;\n //if (alertStr != \"\") alertStr = \"+\" + alertStr;\n }\n document.getElementById(\"equationText_alert\").innerHTML += expression;\n } \n } \n}", "title": "" }, { "docid": "4cbb5619d82f1f3081e58ce6aedb3dea", "score": "0.5618073", "text": "function blockspecialchar_first(e) \n{\n //console.log(e);\n\tvar str;\n\tstr = e.value;\n\t\t//viewAlert(str.charCodeAt(0));\n\tswitch (str.charCodeAt(0)) {\n\t\tcase 44:\n\t\t\t{\n\t\t\t\tviewAlert(\", Not allowed in 1st Place!!!\");\n\t\t\t\te.value = \"\";\n\t\t\t\te.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\tcase 47:\n\t\t\t{\n\t\t\t\tviewAlert(\"/ Not allowed in 1st Place!!!\");\n\t\t\t\te.value = \"\";\n\t\t\t\te.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\tcase 58:\n\t\t\t{\n\t\t\t\tviewAlert(\": Not allowed in 1st Place!!!\");\n\t\t\t\te.value = \"\";\n\t\t\t\te.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\tcase 46:\n\t\t\t{\n\t\t\t\tviewAlert(\". Not allowed in 1st Place!!!\");\n\t\t\t\te.value = \"\";\n\t\t\t\te.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\tcase 39:\n\t\t\t{\n\t\t\t\tviewAlert(\"Single Quote Not allowed in 1st Place!!!\");\n\t\t\t\te.value = \"\";\n\t\t\t\te.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\tcase 32:\n\t\t\t{\n\t\t\t\tviewAlert(\"White Space Not allowed in 1st Place!!!\");\n\t\t\t\te.value = \"\";\n\t\t\t\te.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\tcase 40:\n\t\t\t{\n\t\t\t\tviewAlert(\"( Not allowed in 1st Place!!!\");\n\t\t\t\te.value = \"\";\n\t\t\t\te.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\tcase 41:\n\t\t\t{\n\t\t\t\tviewAlert(\") Not allowed in 1st Place!!!\");\n\t\t\t\te.value = \"\";\n\t\t\t\te.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\tcase 45:\n\t\t\t{\n\t\t\t\tviewAlert(\"- Not allowed in 1st Place!!!\");\n\t\t\t\te.value = \"\";\n\t\t\t\te.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t case 95:\n\t\t\t{\n\t\t\t\tviewAlert(\"_ Not allowed in 1st Place!!!\");\n\t\t\t\te.value = \"\";\n\t\t\t\te.focus();\n\t\t\t\treturn false;\n\t\t\t}\t\n\n\t\tcase 59:\n\t\t\t{\n\t\t\t\tviewAlert(\"; Not allowed in 1st Place!!!\");\n\t\t\t\te.value = \"\";\n\t\t\t\te.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\tcase 124:\n\t\t\t{\n\t\t\t\tviewAlert(\"| Not allowed in 1st Place!!!\");\n\t\t\t\te.value = \"\";\n\t\t\t\te.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\tcase 63:\n\t\t\t{\n\t\t\t\tviewAlert(\"? Not allowed in 1st Place!!!\");\n\t\t\t\te.value = \"\";\n\t\t\t\te.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t/*case 64:\n\t\t\t{\n\t\t\t\tviewAlert(\"@ Not allowed in 1st Place!!!\");\n\t\t\t\te.value = \"\";\n\t\t\t\te.focus();\n\t\t\t\treturn false;\n\t\t\t}*/\n\t\t\n\t\tcase 34:\n\t\t\t{\n\t\t\t\tviewAlert('\" Not allowed in 1st Place!!!');\n\t\t\t\te.value = \"\";\n\t\t\t\te.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\tcase 35:\n\t\t\t{ \n if(e.name!='txtName[]' && e.name!='txtName')\n {\n\t\t\t\tviewAlert(\"# Not allowed in 1st Place!!!\");\n\t\t\t\te.value = \"\";\n\t\t\t\te.focus();\n\t\t\t\treturn false;\n }\n else\n {\n return true;\n }\n\t\t\t}\n\t\t\t\n\t\tcase 36:\n\t\t\t{\n\t\t\t\tviewAlert(\"$ Not allowed in 1st Place!!!\");\n\t\t\t\te.value = \"\";\n\t\t\t\te.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\tcase 38:\n\t\t\t{\n\t\t\t\tviewAlert(\"& Not allowed in 1st Place!!!\");\n\t\t\t\te.value = \"\";\n\t\t\t\te.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\tcase 126:\n\t\t\t{\n\t\t\t\tviewAlert(\"~ Not allowed in 1st Place!!!\");\n\t\t\t\te.value = \"\";\n\t\t\t\te.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\t\n\t\tcase 96:\n\t\t\t{\n\t\t\t\tviewAlert(\"` Not allowed in 1st Place!!!\");\n\t\t\t\te.value = \"\";\n\t\t\t\te.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\tcase 33:\n\t\t\t{\n\t\t\t\tviewAlert(\"! Not allowed in 1st Place!!!\");\n\t\t\t\te.value = \"\";\n\t\t\t\te.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\n\t\tcase 37:\n\t\t\t{\n\t\t\t\tviewAlert(\"% Not allowed in 1st Place!!!\");\n\t\t\t\te.value = \"\";\n\t\t\t\te.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\n\t\tcase 94:\n\t\t\t{\n\t\t\t\tviewAlert(\"^ Not allowed in 1st Place!!!\");\n\t\t\t\te.value = \"\";\n\t\t\t\te.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\tcase 42:\n\t\t\t{\n\t\t\t\tviewAlert(\"* Not allowed in 1st Place!!!\");\n\t\t\t\te.value = \"\";\n\t\t\t\te.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\t\tcase 92:\n\t\t\t{\n\t\t\t\tviewAlert(\"\\\\ Not allowed in 1st Place!!!\");\n\t\t\t\te.value = \"\";\n\t\t\t\te.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\tcase 43:\n\t\t\t{\n\t\t\t\tviewAlert(\"+ Not allowed in 1st Place!!!\");\n\t\t\t\te.value = \"\";\n\t\t\t\te.focus();\n\t\t\t\treturn false;\n\t\t\t}\t\n\t\tcase 61:\n\t\t\t{\n\t\t\t\tviewAlert(\"= Not allowed in 1st Place!!!\");\n\t\t\t\te.value = \"\";\n\t\t\t\te.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\t\tcase 123:\n\t\t\t{\n\t\t\t\tviewAlert(\"{ Not allowed in 1st Place!!!\");\n\t\t\t\te.value = \"\";\n\t\t\t\te.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\tcase 125:\n\t\t\t{\n\t\t\t\tviewAlert(\"} Not allowed in 1st Place!!!\");\n\t\t\t\te.value = \"\";\n\t\t\t\te.focus();\n\t\t\t\treturn false;\n\t\t\t}\t\n\t\t\t\n\t\tcase 91:\n\t\t\t{\n\t\t\t\tviewAlert(\"[ Not allowed in 1st Place!!!\");\n\t\t\t\te.value = \"\";\n\t\t\t\te.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\tcase 93:\n\t\t\t{\n\t\t\t\tviewAlert(\"] Not allowed in 1st Place!!!\");\n\t\t\t\te.value = \"\";\n\t\t\t\te.focus();\n\t\t\t\treturn false;\n\t\t\t}\t\n\t\t\t\n\t\tcase 60:\n\t\t\t{\n\t\t\t\tviewAlert(\"< Not allowed in 1st Place!!!\");\n\t\t\t\te.value = \"\";\n\t\t\t\te.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\tcase 62:\n\t\t\t{\n\t\t\t\tviewAlert(\"> Not allowed in 1st Place!!!\");\n\t\t\t\te.value = \"\";\n\t\t\t\te.focus();\n\t\t\t\treturn false;\n\t\t\t}\t\n\t}\n\n}", "title": "" }, { "docid": "fc7cb6ac24da7a03d6d676ceba5f08fa", "score": "0.5601712", "text": "function validateOperator(e){\n\tvar val = $(e.target).val();\n\tif(val != '+' && val != '-' && val != '/' && val != '*' && val != '%'){\n\t\t$(e.target).val('');\n\t}\n}", "title": "" }, { "docid": "b6f98a5c450995d4286f8bebe43eeca3", "score": "0.559991", "text": "function appendElement(event) {\n if (calcMode === 'convert')\n return;\n let input = document.getElementById('input').innerHTML;\n let number = event.target.innerHTML;\n if (number === '%' && (/%$/g.test(input) || input === '0' || /[\\+\\-×÷]$/g.test(input)))\n return;\n if (/[\\+\\-×÷]$/g.test(document.getElementById('input').innerHTML) && /[\\+\\-×÷]$/g.test(number))\n return;\n if (document.getElementById('input').innerHTML === '0' && systemMode !== 2)\n document.getElementById('input').innerHTML = '';\n document.getElementById('input').innerHTML += number;\n}", "title": "" }, { "docid": "8779c7fdcb43bb90114aeee8b3e774c7", "score": "0.5565034", "text": "function checkKey(e) {\n\tlet key = e.key\n\tlet regexPattern = /[0-9\\.\\+\\-\\*\\x\\/\\=\\(\\)\\c]|Enter|Backspace|Delete/g;\n\tif(regexPattern.test(key)) {\n\t\tif(key == \"Enter\") key = \"=\"\n\t\tif(key.toLowerCase() == \"x\" || key == \"*\") key = \"x\"\n\t\tif(key == \"/\") key = \"÷\"\n\t\tif(key.toLowerCase() == \"c\") key = \"Clear\"\n\t\tif(key == \"Backspace\" || key == \"Delete\") key = \"⇤\"\n\n\t\tif(signOperators.indexOf(key) > -1) appendSignOperator(key)\n\t\telse if (operators.indexOf(key) > -1) appendOperator(key)\n\t\telse if (operands.indexOf(key) > -1)appendOperand(key)\n\t\telse return\n\t\tif(key != \"⇤\" && key != \"Clear\") firstInput = false\n\t}\n}", "title": "" }, { "docid": "9f49ab36abb0dca7496761e5e5dbd4f1", "score": "0.5551717", "text": "function checkKey(e) {\n let key = e.key\n let regexPattern = /[0-9\\.\\+\\-\\*\\x\\/\\=\\(\\)\\c]|Enter|Backspace|Delete/g;\n if (regexPattern.test(key)) {\n if (key == \"Enter\") key = \"=\"\n if (key.toLowerCase() == \"x\" || key == \"*\") key = \"x\"\n if (key == \"/\") key = \"÷\"\n if (key.toLowerCase() == \"c\") key = \"Clear\"\n if (key == \"Backspace\" || key == \"Delete\") key = \"⇤\"\n\n if (signOperators.indexOf(key) > -1) appendSignOperator(key)\n else if (operators.indexOf(key) > -1) appendOperator(key)\n else if (operands.indexOf(key) > -1) appendOperand(key)\n else return\n if (key != \"⇤\" && key != \"Clear\") firstInput = false\n }\n}", "title": "" }, { "docid": "4fd158208e8e7380d3c717b4a31a1386", "score": "0.55334395", "text": "function K(e){return e===\"Enter\"||e===\" \"}", "title": "" }, { "docid": "1eb7ec07ac85e628ec863fd954d9b43b", "score": "0.5513293", "text": "function addListAfterKeyPress(event) {\n\tif(inputLenght() > 0 && event.keyCode === 13) {\n\t\t\tcreateListElement();\n\t}\n}", "title": "" }, { "docid": "3471182f822946d5b003e0de537730e4", "score": "0.54914576", "text": "function getAndJoinKeyInputs (e){\n \n const calcInput = [\n e.currentTarget.value\n ]\n calcInputs.push(calcInput);\n displayValue = calcInputs.join('');\n userDisplay(displayValue);\n keyInput = parseInt(displayValue);\n}", "title": "" }, { "docid": "f5273ef8a81aa10daf07e375aa83c24e", "score": "0.5480977", "text": "function calcmany(e) {\n if (tequals) return false;\n if (undo.length == 0) ucalc.value = \"\";\n addundo();\n ucalc.value += e.srcElement.value;\n tnumber = false;\n return true;\n }", "title": "" }, { "docid": "a54d448865fac89c91996394a5270867", "score": "0.54737085", "text": "function SplNumbers(Val)\r\n\t{\r\n\t\tvar alp = \"0123456789+- \";\r\n\t\r\n\t\tfor (var i=0;i<Val.value.length;i++){\r\n\t\t\ttemp=Val.value.substring(i,i+1);\r\n\t\t\tif (alp.indexOf(temp)==-1){\r\n\t\t\t\talert(\"No special characters \\nValid entries are [0-9][ + - ]\");\r\n\t\t\t\tVal.focus();\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t} // closing the for loop\r\n\t\r\n\t} // closing the function SplNumbers()", "title": "" }, { "docid": "f06495a937930861762a3a3659a177cd", "score": "0.54562366", "text": "function soloNumeros(e){ \t \t\n\tvar key = window.event ? e.which : e.keyCode;\t\n var el = e.srcElement.value;\t\n if(key == 8 || key == 13 || key == 46 || key == 0 || key ==110 || key == 190) {\n\t //return true;\t\t\n\t if(el.indexOf('.') > -1){\n\t\t e.preventDefault();\t\t\t\t\t\t\t\t\n\t }\n }\n else{\n\t if (key < 48 || key > 57) {\t\t\t\n\t\t e.preventDefault();\n\t }\n\t}\n}", "title": "" }, { "docid": "e89df87b2991e44d193c3ca5e25c1d21", "score": "0.54520935", "text": "function ee(e){var t=U();(t.type!==Ht.Punctuator||t.value!==e)&&Q(t)}", "title": "" }, { "docid": "64c4bf89431d84529ae15d3e1801022f", "score": "0.5428291", "text": "function apertoushiftE(event){\n\n\tif(event.shiftKey == true && event.keyCode == 69)\n\t\tconsole.log(\"Apertou shift + E\");\n\n}", "title": "" }, { "docid": "f224f05c7e815e5d4082c6fe72b2e9a7", "score": "0.5425857", "text": "function getOperationInput (e) {\n if (displayOperation.textContent == 0) displayOperation.textContent = '';\n\n let value = (e.key) ? e.key : e.target.textContent;\n switch (value) {\n case '+':\n case '-':\n case '/':\n case '*':\n if (operatorEnabled) displayValue.push(value)\n operatorEnabled = false\n e.preventDefault()\n floatEnabled = true;\n break;\n case '.':\n if (floatEnabled) displayValue.push('.');\n floatEnabled = false;\n break;\n case 'Backspace':\n case 'Delete':\n case 'DEL':\n if (displayValue[displayValue.length-1] in operators) operatorEnabled = true;\n if (displayValue[displayValue.length-1] == '.') floatEnabled = true;\n if (displayValue.length > 0) displayValue.pop();\n break;\n case 'c':\n case 'C':\n clear()\n break;\n case 'Enter':\n case '=':\n displayPreviousOperation.textContent = displayValue.join('')\n displayValue = parseOperation(displayValue.join(''))\n addHistory()\n break;\n case '0':\n case '1':\n case '2':\n case '3':\n case '4':\n case '5':\n case '6':\n case '7':\n case '8':\n case '9':\n displayValue.push(value)\n operatorEnabled = true;\n break;\n }\n displayOperation.textContent = (displayValue.length > 0) ? displayValue.join('') : 0\n}", "title": "" }, { "docid": "4cf98fab74786648bc96d81cd1919f28", "score": "0.5422932", "text": "function restrictNegativeValues(elem){\n\telem.keypress(function (e) {\n\t //if the letter is not digit then display error and don't type anything\n\t if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {\n\t \treturn false;\n\t }\n\t});\n}", "title": "" }, { "docid": "819db05d48de1c79590c13a16d20bc47", "score": "0.5420829", "text": "function checkSpecialKeys(e) { \n if (e.keyCode != 8 && e.keyCode != 46 && e.keyCode != 37 && e.keyCode != 38 && e.keyCode != 39 && e.keyCode != 40) \n return false; \n else \n return true; \n }", "title": "" }, { "docid": "e34e92599746b4e8fbedc23f370b98eb", "score": "0.542019", "text": "function inputKeyboard(e) {\n if (e.key >= 0 || e.key <= 9) inputNumber(e.key);\n if (e.key === \".\") inputDecimal();\n if (e.key === \"Enter\") compute();\n if (e.key === \"Backspace\") deleteNumber();\n if (e.key === \"Escape\") clear();\n if (e.key === \"/\" || e.key === \"*\" || e.key === \"-\" || e.key === \"+\")\n inputOperator(convertOperator(e.key));\n}", "title": "" }, { "docid": "1628b2c344649c0cbf4bc4aff0d23fe0", "score": "0.5419724", "text": "function plusClick() {\n input.value = input.value + \"+\";\n}", "title": "" }, { "docid": "fbda3f6fe1b6ec4b6b98a5bc1ceb6452", "score": "0.5391679", "text": "function input(e){\n\n\t\tconsole.log(inputArray);\n\t\tvar newEl=document.createElement('span');\n\t\tvar text=document.createTextNode(e);\n\t\tnewEl.appendChild(text);\n\n\t\tdocument.getElementById('entry').appendChild(newEl);\n\n\t}", "title": "" }, { "docid": "90389354186c90ad9a4804287c0b0fd3", "score": "0.5365675", "text": "function validate_eps(ep1,ep2) { //EPs limits | ep1 = current EPs | ep2 = EPs to be added\r\n var n = actp;\r\n var eps = 1*$('eps-'+n).innerHTML;\r\n epsum = 1*ep1 + 1*ep2;\r\n epsum2 = 1*ep1 + (510-1*eps);\r\n if (ep2 < 0 && epsum > 0) { return epsum; }\r\n if (eps < 510 && ep1 < 255) {\r\n ep3 = (eps + 1*ep2 < 510)?((epsum < 255)?epsum:255):((epsum2 < 255)?epsum2:255);\r\n return ((ep3 < 0)?0:ep3);\r\n }\r\n else { return ep1; }\r\n }", "title": "" }, { "docid": "dcfba5b5d3666e7d9b06a4272bb998be", "score": "0.53571856", "text": "function inputSpecialChars(){\n var specialCharEnable = window.confirm(\"Would you like to include special characters in your password? (example: @!#$%^)\");\n if (specialCharEnable){\n charactertypes.push(...spchars);\n window.alert(\"Special characters will be included in the password.\");\n checkSelections()\n }else{\n window.alert(\"Special characters will NOT be included in the password.\");\n checkSelections()\n }\n }", "title": "" }, { "docid": "3f98b7a3fe4d890297e55e123b48c7b4", "score": "0.53566647", "text": "function isNoFirstPlus(input) {\n const value = input.value\n const strong = document.createElement('strong')\n strong.innerText = 'первый символ +!'\n if (value[0] == '+') {\n alertError(input, strong)\n return false\n }else {\n alertSuccess(input, strong)\n }\n return true\n}", "title": "" }, { "docid": "7cecfccc7d7dfba935283c5389f68e8e", "score": "0.53491193", "text": "function numericKeyDown(ev)\n{\n var key = ev.key;\n if (/\\d/.test(key))\n return true;\n if (key == '+')\n return true;\n if (key.length == 1)\n {\n ev.preventDefault();\n return false;\n }\n else\n return true;\n}", "title": "" }, { "docid": "0542924445ec14516d26b18440ff6e3b", "score": "0.5348525", "text": "function addListAfterKeypress(event) {\n error.innerHTML = \"\";\n if (inputLength() > 0 && event.keyCode === 13) {\n createListElement();\n }\n}", "title": "" }, { "docid": "e8a78af4469525af9b84efbd05eb0362", "score": "0.5343708", "text": "function kbdListKeyPress(e)\n{\n\tif(window.event) // IE\n\t{\n\t\tkeynum = e.keyCode;\n\t}\n\telse if(e.which) // Netscape/Firefox/Opera\n\t{\t\t\n\t\tkeynum = e.which;\n\t}\n\n\t// Enter\n\tif(keynum == 13)\n\t{\n\t\tkbdListPopupPick();\t\n\t\tdisableKeyboardKey(e);\n\t\treturn false;\n\t}\t\n\n\t// Escape key\n\tif(keynum == 27)\n\t{ \t\t\n\t\t// Hide the popup\n\t\tlistKbdOptPopup.hidePopup();\n\t\tisClickSameField(1,2);\n\t\t\n\t\t// Focus back on input field\n\t\tlistPopupInput.focus(); \n\t}\t\n}", "title": "" }, { "docid": "96b895e1cd451f6b37dcdb96d81771ce", "score": "0.53230834", "text": "function SadeceHarf(e) {\n\tvar K = EventOgren(e)\n\t//var whichCode = (window.Event) ? e.which : e.keyCode;\n\tif (K == 13) return true; // Enter\n\tif (K == 44) return true; // Comma\n\tif (K > 47 && K < 58){ return false;}\n}", "title": "" }, { "docid": "c9f6f181f7edb53c03ad9c8d159555f4", "score": "0.5308732", "text": "function addExponent(input){\n\tvar text=input.val();\n\tvar space =text.indexOf(\".\");\n\ttext=text.trim().replace('.', '');\n\tinput.val(replaceNumber(text));\n\t\n\tif(space==1||text.length==1){\n\t\treturn 0;\n\t}\n\telse if(space==2 ||text.length==2){\n\t\treturn 1;\n\t}\n\telse{\n\t\treturn 2;\n\t}\n\n}", "title": "" }, { "docid": "b366f0a78d9b943b037c98435e8d5b2d", "score": "0.5308012", "text": "function addListAfterKeypress(event) {\n\t//NOTE = event in this case comes from input.addEventListener from the bottom.\n\tif (inputLength() > 0 && event.keyCode === 13) {\n\t\tcreateListElement();\n\t}\n}", "title": "" }, { "docid": "9db057243e744c69ecac2ff0aedf1992", "score": "0.52984524", "text": "function onDigitInputsChange(event)\n{\n\tif(event.ctrlKey){\n\t\treturn false;\n\t}\n\t//event.charCode != 0 means the key has a character result that would show in the input\n\tif(event.charCode != 0 && (event.which < 48 || event.which > 57) && event.charCode != 46)\n\t{\n\t\tevent.preventDefault();\n\t\treturn false;\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "a6127fe5b545e8c6b4f1ff9bfec8257c", "score": "0.5297998", "text": "function addAmount(e) {\n e.preventDefault();\n\n if (amount.value === '' || rate.value === '') {\n showError('fill out both EXCHANGE RATE and AMOUNT');\n }\n\n //calculate\n let calcAmount = amount.value / rate.value;\n calcAmount = Math.round(calcAmount * 100) / 100;\n\n //add new item\n const li = document.createElement('li');\n li.className = 'item';\n li.textContent = `${amount.value}PLN \\u2192 ${calcAmount}\\u20AC`;\n\n const link = document.createElement('a');\n link.innerHTML = '<i class=\"trash icon grey del\"></i>';\n li.appendChild(link);\n list.appendChild(li);\n\n storeData(`${amount.value}PLN \\u2192 ${calcAmount}\\u20AC`);\n amount.value = '';\n amount.focus();\n}", "title": "" }, { "docid": "2ca49aa8dfeb75d1153fe7db03705bd5", "score": "0.5296587", "text": "function editOnBeforeInput(editor, e) {\n\t void 0 !== editor._pendingStateFromBeforeInput && (editor.update(editor._pendingStateFromBeforeInput), \n\t editor._pendingStateFromBeforeInput = void 0);\n\t var editorState = editor._latestEditorState, chars = e.data;\n\t // In some cases (ex: IE ideographic space insertion) no character data\n\t // is provided. There's nothing to do when this happens.\n\t if (chars) {\n\t // Allow the top-level component to handle the insertion manually. This is\n\t // useful when triggering interesting behaviors for a character insertion,\n\t // Simple examples: replacing a raw text ':)' with a smile emoji or image\n\t // decorator, or setting a block to be a list item after typing '- ' at the\n\t // start of the block.\n\t if (editor.props.handleBeforeInput && isEventHandled(editor.props.handleBeforeInput(chars, editorState))) return void e.preventDefault();\n\t // If selection is collapsed, conditionally allow native behavior. This\n\t // reduces re-renders and preserves spellcheck highlighting. If the selection\n\t // is not collapsed, we will re-render.\n\t var selection = editorState.getSelection();\n\t if (!selection.isCollapsed()) return e.preventDefault(), void editor.update(replaceText(editorState, chars, editorState.getCurrentInlineStyle(), getEntityKeyForSelection(editorState.getCurrentContent(), editorState.getSelection())));\n\t var mayAllowNative = !isSelectionAtLeafStart(editorState), newEditorState = replaceText(editorState, chars, editorState.getCurrentInlineStyle(), getEntityKeyForSelection(editorState.getCurrentContent(), editorState.getSelection()));\n\t if (!mayAllowNative) return e.preventDefault(), void editor.update(newEditorState);\n\t var anchorKey = selection.getAnchorKey(), anchorTree = editorState.getBlockTree(anchorKey), originalFingerprint = BlockTree.getFingerprint(anchorTree), newFingerprint = BlockTree.getFingerprint(newEditorState.getBlockTree(anchorKey));\n\t mustPreventDefaultForCharacter(chars) || originalFingerprint !== newFingerprint || nullthrows(newEditorState.getDirectionMap()).get(anchorKey) !== nullthrows(editorState.getDirectionMap()).get(anchorKey) ? (e.preventDefault(), \n\t editor.update(newEditorState)) : (newEditorState = EditorState.set(newEditorState, {\n\t nativelyRenderedContent: newEditorState.getCurrentContent()\n\t }), // The native event is allowed to occur. To allow user onChange handlers to\n\t // change the inserted text, we wait until the text is actually inserted\n\t // before we actually update our state. That way when we rerender, the text\n\t // we see in the DOM will already have been inserted properly.\n\t editor._pendingStateFromBeforeInput = newEditorState, setImmediate(function() {\n\t void 0 !== editor._pendingStateFromBeforeInput && (editor.update(editor._pendingStateFromBeforeInput), \n\t editor._pendingStateFromBeforeInput = void 0);\n\t }));\n\t }\n\t }", "title": "" }, { "docid": "a870ffdab33bf1205f9c49489c9c72c9", "score": "0.52900445", "text": "function check_char(e)\n{\n\tvar key, keychar;\n\tif (window.event)\n\t\tkey=window.event.keyCode;\n\telse if (e)\n\t\tkey=e.which;\n\telse\n\t\treturn true;\n\tkeychar = String.fromCharCode(key);\n\tkeychar = keychar.toLowerCase();\n\tgoods = goods.toLowerCase();\n\tif (goods.indexOf(keychar) != -1)\n\t{\n\t\tgoods=\"0123456789.\";\n\t\treturn true;\n\t}\n\tif ( key==null || key==0 || key==8 || key==9 || key==13 || key==27 )\n\t{\n\t\tgoods=\"0123456789.\";\n\t\treturn true;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "8eae128539314de196f2e45dd85b5617", "score": "0.5289624", "text": "function cancelEntry() {\n let newlisting = [];\n list.pop()\n list.pop()\n\n //current_operation = list.join('')\n\n for (let i=0; i < list.length; i++){\n \n if(list[i] === '÷'){\n newlisting.push('/');\n }else if (list[i] === 'x'){\n newlisting.push('*');\n }else{\n newlisting.push(list[i]);\n }\n\n }\n \n current_operation = newlisting.join('')\n if (current_operation.length === 0){\n display.value = \"0\"\n }else{\n display.value = list.join('') \n }\n \n }", "title": "" }, { "docid": "9792b05cc14aa0a7bea6ebd8fd26a2cc", "score": "0.52886015", "text": "function plusMinus() {\r\n\tif (display.value.charAt(0) === \"-\") {\r\n\t\tdisplay.value = display.value.slice(1);\r\n\t} else {\r\n\t\tdisplay.value = \"-\" + display.value;\r\n\t}\r\n}", "title": "" }, { "docid": "08c3d1bd5a7bdec3c0fca07cdf0aba5c", "score": "0.5275036", "text": "function typeIn(e){\n\tlet value = this.getAttribute('data-value');\n\n\tif(value == '.' && inputVal.includes('.')) {\n\t\treturn false; \n\t}\n\tif(inputVal[0] === '0' && inputVal[1] !== '.' && value !== '.')\n\t\t{\n\t\t\tinputVal = ''; \n\t\t}\n\n\tinputVal = inputVal.concat(value);\n\n\tdisplay();\n\tconsole.log(value);\n}", "title": "" }, { "docid": "bfe80c6d48a3576599250ef8617be64c", "score": "0.52660084", "text": "function makeAlphaNumDescription()\r\n{\r\n //***if ((event.keyCode<48 || event.keyCode>57) && (event.keyCode<65 || event.keyCode>90) && (event.keyCode<97 || event.keyCode>122) && (event.keyCode!=32))\r\n //if ((event.keyCode<48 || event.keyCode>57) && (event.keyCode<65 || event.keyCode>90) && (event.keyCode<97 || event.keyCode>122) && (event.keyCode!=32) && (event.keyCode!=39) && (event.keyCode!=35) && (event.keyCode!=38) && (event.keyCode!=44) && (event.keyCode!=60) && (event.keyCode!=62))\r\n //**//if((event.keyCode<48 || event.keyCode>57) && (event.keyCode<65 || event.keyCode>90) && (event.keyCode<97 || event.keyCode>122) && (event.keyCode!=38) && (event.keyCode!=44) && (event.keyCode!=32))\r\n if ((event.keyCode<40 || event.keyCode>58) && (event.keyCode<63 || event.keyCode>126) && (event.keyCode<32 || event.keyCode>33) && (event.keyCode<36 || event.keyCode>37) && (event.keyCode!=38) && (event.keyCode!=39) && (event.keyCode!=35) && (event.keyCode!=59) && (event.keyCode!=60) && (event.keyCode!=62))\r\n {\r\n event.returnValue = false;\r\n }\r\n else if (event.keyCode>=97 && event.keyCode<=122)\r\n {\r\n\tevent.keyCode = event.keyCode - 32;\r\n }\r\n}", "title": "" }, { "docid": "4d98cd9a1f756f29b98212a80b22a647", "score": "0.52603555", "text": "function validatenumber(xxxxx) {\n \n \tvar maintainplus = '';\n \tvar numval = xxxxx.value\n \tif ( numval.charAt(0)=='+' ){ var maintainplus = '+';}\n \tcurnumbervar = numval.replace(/[\\\\A-Za-z!\"£$%^&*+_={};:'@#~,¦\\/<>?|`¬\\]\\[]/g,'');\n \txxxxx.value = maintainplus + curnumbervar;\n \tvar maintainplus = '';\n // alert(\"enter integers only\");\n \txxxxx.focus;\n}", "title": "" }, { "docid": "1919ade9aeab65d48163f7f124ba1fe9", "score": "0.525675", "text": "function setOperation(e){\n if(getNumber!==''){\n numbArr.push(parseFloat(getNumber))\n }\n if(numbArr.length===operatorArr.length+1){\n operatorArr.push(e)\n getNumber=''\n } \n}", "title": "" }, { "docid": "11873365d1ea6381fa728483c5fa44d1", "score": "0.5254433", "text": "function addListAfterKeypress(event){\r\n\tif(inputLength() > 0 && event.keyCode === 13){\r\n\t\tcreateListElement();\r\n\t}\r\n}", "title": "" }, { "docid": "b57dc559ad38c5de8dd638e23c413863", "score": "0.525407", "text": "keyUpHandler(e) {\n this.trigger('keyup', e);\n const element = e.target;\n // List of keys need to prevent while validation\n const excludeKeys = [16, 17, 18, 20, 35, 36, 37, 38, 39, 40, 45, 144, 225];\n if (e.which === 9 && (!this.rules[element.name] || (this.rules[element.name] && !this.rules[element.name][this.required]))) {\n return;\n }\n if (this.validated.indexOf(element.name) !== -1 && this.rules[element.name] && excludeKeys.indexOf(e.which) === -1) {\n this.validate(element.name);\n }\n }", "title": "" }, { "docid": "c596ccaa31c85cc037248cbed738d2af", "score": "0.52457756", "text": "function addListAfterKeypress(event) {\n\tif (inputLength() > 0 && event.keyCode === 13) {\n\t\tcreateListElement();\n\t\n\t}\n}", "title": "" }, { "docid": "939679376bfed41395c6b6a75c827ac2", "score": "0.52414936", "text": "function processInput(input) {\n switch (input) {\n case '.':\n case '0':\n case '1':\n case '2':\n case '3':\n case '4':\n case '5':\n case '6':\n case '7':\n case '8':\n case '9':\n //if '.', check if already in value - if already in value, disregard input\n if ((input == '.') && (currentInput.getValue().indexOf('.') > -1))\n {\n return;\n }\n\n if (currentInput.getType() == 'equalSign') {\n allClear();\n $('#display_area').text(' ');\n }\n //if number, check if previous object was number\n // if so, string + string, i.e. '2' and '2' make '22'\n //else is new number\n\n if (currentInput.getType() == 'number') {\n currentInput.setValue(currentInput.getValue() + input);\n }\n else {\n currentInput.setValue(input);\n }\n currentInput.setType('number');\n\n $('#display_area').text($('#display_area').text() + input);\n break;\n case '+':\n case '-':\n case 'x':\n case '/':\n if (currentInput.getType() == 'number') {\n //assumes previous input was number, pushes number into array\n putInto(currentInput.getType(), currentInput.getValue());\n }\n else if ((currentInput.getType() == 'equalSign') && (array[0].getValue() != 'Ready')) {\n //Leave existing value in the array, presumed to be number\n }\n else {\n //pressed a second operator, first must have been wrong, remove old\n array.pop();\n }\n //inputs (new) operator into array\n currentInput.setValue(input);\n currentInput.setType('operator');\n putInto(currentInput.getType(), currentInput.getValue());\n //and displays whole equation thus far\n displayCalc();\n break;\n case '=':\n //assumes previous input was number, pushes number into array\n // allows input of operator for advanced operations\n if (currentInput.getType() == 'number') {\n putInto(currentInput.getType(), currentInput.getValue());\n }\n //if user hits '=' 2 or more times consecutively, repeat last operation\n // and push previous operator and operand to the stack\n else if ((currentInput.getType() == 'equalSign') && previous.getRun()){\n putInto('operator', previous.getOp());\n putInto('number', previous.getNum());\n previous.setRun(false);\n }\n //inputs operator into array\n currentInput.setValue(input);\n currentInput.setType('equalSign');\n //put call to do calculation here\n putInto(currentInput.getType(), currentInput.getValue());\n //actual parsing and calculations\n doMath();\n //display result cal calling displayCalc\n displayCalc();\n break;\n default:\n console.log(\"Congratulations, this is the error message. You weren't supposed to even be able to get here.\");\n break;\n }\n\n /*console.log(\"input\");\n var str = '';\n for (var i = 0; i< array.length; i++)\n {\n str += array[i].getValue() + 'P';\n }\n console.log(str);\n console.log(\"input end\");*/\n}", "title": "" }, { "docid": "dc40c54f2a19be6efb48cab5af0c1fb1", "score": "0.5232185", "text": "function addListAfterKeypress(event) {\n\tif (inputLength() > 0 && event.keyCode === 13) {\n\t\tcreateListElement();\n\t}\n}", "title": "" }, { "docid": "dc40c54f2a19be6efb48cab5af0c1fb1", "score": "0.5232185", "text": "function addListAfterKeypress(event) {\n\tif (inputLength() > 0 && event.keyCode === 13) {\n\t\tcreateListElement();\n\t}\n}", "title": "" }, { "docid": "dc40c54f2a19be6efb48cab5af0c1fb1", "score": "0.5232185", "text": "function addListAfterKeypress(event) {\n\tif (inputLength() > 0 && event.keyCode === 13) {\n\t\tcreateListElement();\n\t}\n}", "title": "" }, { "docid": "dc40c54f2a19be6efb48cab5af0c1fb1", "score": "0.5232185", "text": "function addListAfterKeypress(event) {\n\tif (inputLength() > 0 && event.keyCode === 13) {\n\t\tcreateListElement();\n\t}\n}", "title": "" }, { "docid": "dc40c54f2a19be6efb48cab5af0c1fb1", "score": "0.5232185", "text": "function addListAfterKeypress(event) {\n\tif (inputLength() > 0 && event.keyCode === 13) {\n\t\tcreateListElement();\n\t}\n}", "title": "" }, { "docid": "dc40c54f2a19be6efb48cab5af0c1fb1", "score": "0.5232185", "text": "function addListAfterKeypress(event) {\n\tif (inputLength() > 0 && event.keyCode === 13) {\n\t\tcreateListElement();\n\t}\n}", "title": "" }, { "docid": "dc40c54f2a19be6efb48cab5af0c1fb1", "score": "0.5232185", "text": "function addListAfterKeypress(event) {\n\tif (inputLength() > 0 && event.keyCode === 13) {\n\t\tcreateListElement();\n\t}\n}", "title": "" }, { "docid": "d80a3ae3d148a53b421d1cb9e906f2f6", "score": "0.5223488", "text": "function editOnBeforeInput(e) {\n\t var chars = e.data;\n\t\n\t // In some cases (ex: IE ideographic space insertion) no character data\n\t // is provided. There's nothing to do when this happens.\n\t if (!chars) {\n\t return;\n\t }\n\t\n\t // Allow the top-level component to handle the insertion manually. This is\n\t // useful when triggering interesting behaviors for a character insertion,\n\t // Simple examples: replacing a raw text ':)' with a smile emoji or image\n\t // decorator, or setting a block to be a list item after typing '- ' at the\n\t // start of the block.\n\t if (this.props.handleBeforeInput && this.props.handleBeforeInput(chars)) {\n\t e.preventDefault();\n\t return;\n\t }\n\t\n\t // If selection is collapsed, conditionally allow native behavior. This\n\t // reduces re-renders and preserves spellcheck highlighting. If the selection\n\t // is not collapsed, we will re-render.\n\t var editorState = this.props.editorState;\n\t var selection = editorState.getSelection();\n\t\n\t if (!selection.isCollapsed()) {\n\t e.preventDefault();\n\t this.update(replaceText(editorState, chars, editorState.getCurrentInlineStyle(), getEntityKeyForSelection(editorState.getCurrentContent(), editorState.getSelection())));\n\t return;\n\t }\n\t\n\t var mayAllowNative = !isSelectionAtLeafStart(editorState);\n\t var newEditorState = replaceText(editorState, chars, editorState.getCurrentInlineStyle(), getEntityKeyForSelection(editorState.getCurrentContent(), editorState.getSelection()));\n\t\n\t if (!mayAllowNative) {\n\t e.preventDefault();\n\t this.update(newEditorState);\n\t return;\n\t }\n\t\n\t var anchorKey = selection.getAnchorKey();\n\t var anchorTree = editorState.getBlockTree(anchorKey);\n\t\n\t // Check the old and new \"fingerprints\" of the current block to determine\n\t // whether this insertion requires any addition or removal of text nodes,\n\t // in which case we would prevent the native character insertion.\n\t var originalFingerprint = BlockTree.getFingerprint(anchorTree);\n\t var newFingerprint = BlockTree.getFingerprint(newEditorState.getBlockTree(anchorKey));\n\t\n\t if (mustPreventDefaultForCharacter(chars) || originalFingerprint !== newFingerprint || nullthrows(newEditorState.getDirectionMap()).get(anchorKey) !== nullthrows(editorState.getDirectionMap()).get(anchorKey)) {\n\t e.preventDefault();\n\t } else {\n\t // The native event is allowed to occur.\n\t newEditorState = EditorState.set(newEditorState, {\n\t nativelyRenderedContent: newEditorState.getCurrentContent()\n\t });\n\t }\n\t\n\t this.update(newEditorState);\n\t}", "title": "" }, { "docid": "7e2659853eea3508ccaf5138df2bcb54", "score": "0.5221591", "text": "function blockSpecialChar(e) {\n var k = e.keyCode;\n return ((k > 64 && k < 91) || (k > 96 && k < 123) || k == 8 || k == 16 || k == 95 || k == 32 || (k > 43 && k < 47) || (k >= 48 && k <= 57));\n}", "title": "" }, { "docid": "94e7d8dab430cd862935177d222fc577", "score": "0.5216014", "text": "function onlyNumbers(e, obj, decimalSeparator, groupingSeparator, allowingNegative)\n{\n\tvar arrSpecialChars = new Array(8, 9, 13, 35, 36, 37, 38, 39, 40, 46, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123);\n\t\n\tif(window.event) // IE\n\t{\n\t\tkeynum = e.keyCode\n\t\tif (keynum == 13)//enter\n \treturn true;\n\n\t}\t\n\telse // Netscape/Firefox/Opera\n\t{\n\t\tif (InArray(arrSpecialChars, e.keyCode) >= 0)\n\t return true;\n\t\tkeynum = e.which\n\t}\n\n\tvar strChar = String.fromCharCode(keynum);\n\tvar finalStr = obj.value.substring(0, getSelectionStart(obj))+strChar+obj.value.substring(getSelectionEnd(obj));\n\n\tvar arrValidChars=new Array();\n\tif(decimalSeparator)\n\t{\n\t\tarrValidChars.push(decimalSeparator);\n\t\tfinalStr = finalStr.replace(decimalSeparator, \".\");\n\t}\n\tif(allowingNegative)\n\t\tarrValidChars.push(\"-\");\n\tif(groupingSeparator)\n\t{\n\t\t//arrValidChars.push(groupingSeparator);\n\t\twhile(finalStr.indexOf(groupingSeparator)!=-1)\n\t\t\tfinalStr = finalStr.replace(groupingSeparator, \"\");\n\t}\n\n return ((keynum>=48 && keynum<=57) ||InArray(arrValidChars, strChar)>=0) && (isFinite(finalStr) || finalStr==\"-\");\n}", "title": "" }, { "docid": "a63eb0679c171ed0fb72d0aab8de6901", "score": "0.5196795", "text": "function additionRule() {\n\t\tvar expression = $(\"#input-addition-rule\").val();\n\t\tvar f_x, g_x, d_f_x, d_g_x, return_expression, i = 1, maxLength = expression.length;\n\t\t\n\t\t// deal with the f_x\n\t\treturn_expression = subExpression(i, maxLength, expression);\n\t\tf_x = return_expression[0];\n\t\ti = return_expression[1];\n\n\t\t// find the new starting index\n\t\ti = findStart(expression, \"[\", i);\n\t\treturn_expression = subExpression(i + 1, maxLength, expression);\n\t\tg_x = return_expression[0];\n\t\t// console.log(\"f(x): \" + f_x);\n\t\t// console.log(\"g(x): \" + g_x);\n\t\t\n\t\td_f_x = evaluate(f_x);\n\t\td_g_x = evaluate(g_x);\n\t\t// console.log(\"d[f(x)]: \" + d_f_x);\n\t\t// console.log(\"d[g(x)]: \" + d_g_x);\n\n\t\t$(\"#view-addition-rule\").html(\"<p>\" + d_f_x + \"+\" + d_g_x + \"</p>\");\n\n\t}", "title": "" }, { "docid": "300c2e883a6d8bc83ca40c34e5b1c778", "score": "0.5191108", "text": "function InputOnlyAlphaNumericWithBracket(pEvent) {\n var vKeycode = pEvent.keyCode;\n if (vKeycode > 64 && vKeycode < 91) {//'A Z'\n return true;\n }\n if (vKeycode > 96 && vKeycode < 123) {//'a z'\n return true;\n }\n if (vKeycode > 47 && vKeycode < 58) { //'0 9'\n return true;\n }\n if (vKeycode == 45) {//'-'\n return true;\n }\n if (vKeycode == 40) {//'('\n return true;\n }\n if (vKeycode == 41) {//')'\n return true;\n }\n if (vKeycode == 44) {//','\n return true;\n }\n if (vKeycode == 47) {//'/'\n return true;\n }\n if (vKeycode == 46) {//'.'\n return true;\n }\n if (vKeycode == 95) {//'_'\n return true;\n }\n if (vKeycode == 32) {//Speace Key\n return true;\n }\n window.event.keyCode = 000;\n return false;\n}", "title": "" }, { "docid": "5be29c0f236ac49aa748f8d069a5da2c", "score": "0.5186494", "text": "function ee(e){return(e.match(He)||[]).join(\" \")}", "title": "" }, { "docid": "a7ecc00d4730065923e497e4f90bf127", "score": "0.51807755", "text": "function addListAfterKeypress(event) {\n if (inputLength() > 0 && event.keyCode === 13) {\n createListElement();\n }\n}", "title": "" }, { "docid": "8e147ab772b463a0423a354da0b053ca", "score": "0.5179751", "text": "function keyRestrict(e, validchars_code) \n{\n var strCheckOK = new Array();\n strCheckOK[0] = \"0123456789\"; // numbers only\n strCheckOK[1] = \"0123456789.\"; // positive numbers only\n strCheckOK[2] = \"0123456789.-\"; // for float with negative\n strCheckOK[3] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz \"+ String.fromCharCode(241); // alpha only\n strCheckOK[4] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&(),:;.-'/\\\"\\\\ \"+ String.fromCharCode(241); // alpha with basic esp char only\n strCheckOK[5] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 \"+ String.fromCharCode(241);\t// alpha num only\n strCheckOK[6] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789&,:;.-#/'\\\"\\\\ \"+ String.fromCharCode(241);\t// alpha num with basic esp char only\n strCheckOK[7] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_&,:;-./!@#$%^*()?'\\\"\\\\ \"+ String.fromCharCode(241); // with special chars\t\n strCheckOK[8] = \"0123456789/\"; // for dates\n strCheckOK[9] = \"0123456789-/ \"; // mobile phone\n strCheckOK[10] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789#*-/ \"+ String.fromCharCode(241); // fax/telephone phone\n strCheckOK[11] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_@.\"; // email address\n strCheckOK[12] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.- \"+ String.fromCharCode(241); // name of a person\n strCheckOK[13] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789&,:;.-#/'\\\"\\\\ \";\t// alpha num with basic esp char only\n strCheckOK[14] = \"0123456789-/\"; // id numbers\n strCheckOK[15] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789&,:;.-#/'\\\"\\\\ ()\"+ String.fromCharCode(241);\t// for descriptive title\n strCheckOK[16] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.\";\t// for grades ex. 1.5, NC, DR\n strCheckOK[17] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789. \";\t// for grades ex. 1.5, NC, DR\n strCheckOK[18] = \"\"; // readonly\n \n var key='', keychar='';\n \n key = getKeyCode(e);\n \n if (validchars_code==-1) {\n \tif (key>0) return false;\n \telse\t return true;\n }\n if (key == null) return true;\n\n if (key==13) return false;\n \n \n keychar = String.fromCharCode(key);\n keychar = keychar.toLowerCase();\n validchars = strCheckOK[validchars_code];\n \n validchars=validchars.toLowerCase();\n \n if (validchars.indexOf(keychar) != -1)\n \treturn true;\n if ( key==null || key==0 || key==8 || key==9 || key==13 || key==27 )\n \treturn true;\n \n return false;\n}", "title": "" }, { "docid": "ebace739c7e842f6c4adadb3f562ca53", "score": "0.5178059", "text": "function editOnBeforeInput(e) {\n\t var chars = e.data;\n\n\t // In some cases (ex: IE ideographic space insertion) no character data\n\t // is provided. There's nothing to do when this happens.\n\t if (!chars) {\n\t return;\n\t }\n\n\t // Allow the top-level component to handle the insertion manually. This is\n\t // useful when triggering interesting behaviors for a character insertion,\n\t // Simple examples: replacing a raw text ':)' with a smile emoji or image\n\t // decorator, or setting a block to be a list item after typing '- ' at the\n\t // start of the block.\n\t if (this.props.handleBeforeInput && isEventHandled(this.props.handleBeforeInput(chars))) {\n\t e.preventDefault();\n\t return;\n\t }\n\n\t // If selection is collapsed, conditionally allow native behavior. This\n\t // reduces re-renders and preserves spellcheck highlighting. If the selection\n\t // is not collapsed, we will re-render.\n\t var editorState = this.props.editorState;\n\t var selection = editorState.getSelection();\n\n\t if (!selection.isCollapsed()) {\n\t e.preventDefault();\n\t this.update(replaceText(editorState, chars, editorState.getCurrentInlineStyle(), getEntityKeyForSelection(editorState.getCurrentContent(), editorState.getSelection())));\n\t return;\n\t }\n\n\t var mayAllowNative = !isSelectionAtLeafStart(editorState);\n\t var newEditorState = replaceText(editorState, chars, editorState.getCurrentInlineStyle(), getEntityKeyForSelection(editorState.getCurrentContent(), editorState.getSelection()));\n\n\t if (!mayAllowNative) {\n\t e.preventDefault();\n\t this.update(newEditorState);\n\t return;\n\t }\n\n\t var anchorKey = selection.getAnchorKey();\n\t var anchorTree = editorState.getBlockTree(anchorKey);\n\n\t // Check the old and new \"fingerprints\" of the current block to determine\n\t // whether this insertion requires any addition or removal of text nodes,\n\t // in which case we would prevent the native character insertion.\n\t var originalFingerprint = BlockTree.getFingerprint(anchorTree);\n\t var newFingerprint = BlockTree.getFingerprint(newEditorState.getBlockTree(anchorKey));\n\n\t if (mustPreventDefaultForCharacter(chars) || originalFingerprint !== newFingerprint || nullthrows(newEditorState.getDirectionMap()).get(anchorKey) !== nullthrows(editorState.getDirectionMap()).get(anchorKey)) {\n\t e.preventDefault();\n\t } else {\n\t // The native event is allowed to occur.\n\t newEditorState = EditorState.set(newEditorState, {\n\t nativelyRenderedContent: newEditorState.getCurrentContent()\n\t });\n\t }\n\n\t this.update(newEditorState);\n\t}", "title": "" }, { "docid": "ebace739c7e842f6c4adadb3f562ca53", "score": "0.5178059", "text": "function editOnBeforeInput(e) {\n\t var chars = e.data;\n\n\t // In some cases (ex: IE ideographic space insertion) no character data\n\t // is provided. There's nothing to do when this happens.\n\t if (!chars) {\n\t return;\n\t }\n\n\t // Allow the top-level component to handle the insertion manually. This is\n\t // useful when triggering interesting behaviors for a character insertion,\n\t // Simple examples: replacing a raw text ':)' with a smile emoji or image\n\t // decorator, or setting a block to be a list item after typing '- ' at the\n\t // start of the block.\n\t if (this.props.handleBeforeInput && isEventHandled(this.props.handleBeforeInput(chars))) {\n\t e.preventDefault();\n\t return;\n\t }\n\n\t // If selection is collapsed, conditionally allow native behavior. This\n\t // reduces re-renders and preserves spellcheck highlighting. If the selection\n\t // is not collapsed, we will re-render.\n\t var editorState = this.props.editorState;\n\t var selection = editorState.getSelection();\n\n\t if (!selection.isCollapsed()) {\n\t e.preventDefault();\n\t this.update(replaceText(editorState, chars, editorState.getCurrentInlineStyle(), getEntityKeyForSelection(editorState.getCurrentContent(), editorState.getSelection())));\n\t return;\n\t }\n\n\t var mayAllowNative = !isSelectionAtLeafStart(editorState);\n\t var newEditorState = replaceText(editorState, chars, editorState.getCurrentInlineStyle(), getEntityKeyForSelection(editorState.getCurrentContent(), editorState.getSelection()));\n\n\t if (!mayAllowNative) {\n\t e.preventDefault();\n\t this.update(newEditorState);\n\t return;\n\t }\n\n\t var anchorKey = selection.getAnchorKey();\n\t var anchorTree = editorState.getBlockTree(anchorKey);\n\n\t // Check the old and new \"fingerprints\" of the current block to determine\n\t // whether this insertion requires any addition or removal of text nodes,\n\t // in which case we would prevent the native character insertion.\n\t var originalFingerprint = BlockTree.getFingerprint(anchorTree);\n\t var newFingerprint = BlockTree.getFingerprint(newEditorState.getBlockTree(anchorKey));\n\n\t if (mustPreventDefaultForCharacter(chars) || originalFingerprint !== newFingerprint || nullthrows(newEditorState.getDirectionMap()).get(anchorKey) !== nullthrows(editorState.getDirectionMap()).get(anchorKey)) {\n\t e.preventDefault();\n\t } else {\n\t // The native event is allowed to occur.\n\t newEditorState = EditorState.set(newEditorState, {\n\t nativelyRenderedContent: newEditorState.getCurrentContent()\n\t });\n\t }\n\n\t this.update(newEditorState);\n\t}", "title": "" }, { "docid": "6a268fbd232cf694d3ed15979d2fe669", "score": "0.5173328", "text": "function _allowAlphaNumeric(e)\n{\n\tvar keyp;\n\tkeyp = getKeyCode(e);\n\tif((keyp>=65 && keyp<=90) || (keyp>=97 && keyp<=122) || keyp==8 || keyp==0 ||(keyp>=48 && keyp<=57) || (keyp==95))\n\t{\n\t\treturn true;\n\t}\n\telse if(keyp == null)\n\t{\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "2370ef075794ba47f2f3fc5051afe5f6", "score": "0.5170653", "text": "function SplNumbers(Val) {\n\nvar alp = \"0123456789- \";\n\nfor (var i=0;i<Val.value.length;i++){\ntemp=Val.value.substring(i,i+1);\nif (alp.indexOf(temp)==-1){\nalert(\"No special characters \\nValid entries are [0-9][single space, - ]\");\nVal.focus();\nreturn 0;\n}\n} // closing the for loop\n\n}", "title": "" }, { "docid": "af485e4f24a630a5f8fa17eb111ec7eb", "score": "0.5167484", "text": "function actionEql() {\n let input = res.innerHTML;\n let output = [];\n let str = \"\";\n\n for(let i = 0; i < input.length; i++){\n if(input.charAt(i) === '+' || input.charAt(i) === '-' || input.charAt(i) === '*' || input.charAt(i) === '/'){\n //convert binary to decimal then push to array\n output.push(parseInt(str, 2));\n output.push(input.charAt(i));\n str = \"\";\n }else if(i == input.length - 1){\n str += input.charAt(i) + input.charAt(i+1);\n //convert binary to decimal then push to array\n output.push(parseInt(str, 2));\n }else{\n str += input.charAt(i);\n }\n }\n\n //do the caculation\n actionResult(output);\n}", "title": "" }, { "docid": "47cb7cb2dd96ffb6a560d4ae1835b68a", "score": "0.5167408", "text": "function addToInput(charToAdd){\n\n //if . is already added\n if(charToAdd === '.'){\n if(userInput.includes('.')){\n return;\n }\n }\n\n setuserInput(userInput + charToAdd);\n }", "title": "" }, { "docid": "3f42d84c7cc3abf719b02a262b47f09c", "score": "0.5159931", "text": "function retnums(val,nums,event){\r\n var len=typenums(\"#\"+val);\r\n if (len<0) {\r\n $(\"#\"+nums).html(langjs['word_exceed']+'<font color=\"red\"><em>'+(-len)+'</em></font>'+langjs['word']);\r\n } else {\r\n $(\"#\"+nums).html(langjs['can_input']+'<em>'+len+'</em>'+langjs['word']);\r\n }\r\n atuserlist(val,event);\r\n}", "title": "" }, { "docid": "9f5f3cf9a3b864e948dfbe8b731bd297", "score": "0.5159447", "text": "function doKeypressforAllowChar(e, control, hyphenCount, allowedCharacter, txtType) {\n value = control.value;\n var asciiCode = e.keyCode ? e.keyCode : e.charCode;\n var keyCode = String.fromCharCode(e.keyCode ? e.keyCode : e.charCode)\n txtType = parseInt(txtType);\n if ((txtType==3 || txtType==4) && keyCode == \" \")\n e.preventDefault();\n var matchedAlpha = (/[a-z]/i).test(String.fromCharCode(e.keyCode || e.which));\n var matchedNumber = (/[0-9]/i).test(String.fromCharCode(e.keyCode || e.which));\n hyphenCount = parseInt(hyphenCount); \n if (allowedCharacter == undefined || allowedCharacter == null)\n allowedCharacter = \"\";\n if (hyphenCount > 0)\n allowedCharacter = allowedCharacter.replace(\"-\", \"\");\n var specialCharacter = allowedCharacter.indexOf(keyCode);\n var trueKey = ((asciiCode >= 37 && asciiCode <= 40) || asciiCode == 8 || asciiCode == 46 || asciiCode == 9);\n\n if (e.shiftKey && !trueKey) {\n if (specialCharacter < 0)\n e.preventDefault();\n }\n if (hyphenCount > 0) {\n var valueArray = value.split('-');\n if (txtType == 3) {\n trueKey = true; // Add To Allow Copy/Paste\n if (!(matchedNumber || keyCode == \"-\" || trueKey))\n e.preventDefault();\n if (valueArray.length >= hyphenCount + 1 && keyCode == \"-\" && !matchedNumber && specialCharacter < 0) {\n e.preventDefault();\n }\n }\n // Add To Allow Copy/Paste\n else if (txtType == 4) {\n return true;\n }\n else if (valueArray.length >= hyphenCount + 1 && keyCode == \"-\" && specialCharacter < 0) {\n e.preventDefault();\n }\n }\n else {\n if (txtType == 4) {\n if (!(matchedAlpha || matchedNumber || specialCharacter >=0 || trueKey))\n e.preventDefault();\n if (!matchedAlpha && !matchedNumber && specialCharacter < 0 && !trueKey) {\n e.preventDefault();\n }\n }\n else if (txtType == 3) {\n if (!matchedNumber && specialCharacter < 0 && !trueKey) {\n e.preventDefault();\n }\n }\n }\n //return (value.length <= maxLength);\n\n}", "title": "" }, { "docid": "a9208a9e716491a572e210736fcac71d", "score": "0.5146351", "text": "function keyRestrict1(e, validchars_code) \n{\n var strCheckOK = new Array();\n strCheckOK[0] = \"0123456789\"; // numbers only\n strCheckOK[1] = \"0123456789.\"; // positive numbers only\n strCheckOK[2] = \"0123456789.-\"; // for float with negative\n strCheckOK[3] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz \"+ String.fromCharCode(241); // alpha only\n strCheckOK[4] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&(),:;.-'/\\\"\\\\ \"+ String.fromCharCode(241); // alpha with basic esp char only\n strCheckOK[5] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 \"+ String.fromCharCode(241);\t// alpha num only\n strCheckOK[6] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789&,:;.-#/'\\\"\\\\ \"+ String.fromCharCode(241);\t// alpha num with basic esp char only\n strCheckOK[7] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_&,:;-./!@#$%^*()?'\\\"\\\\ \"+ String.fromCharCode(241); // with special chars\t\n strCheckOK[8] = \"0123456789/\"; // for dates\n strCheckOK[9] = \"0123456789-/ \"; // mobile phone\n strCheckOK[10] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789#*-/ \"+ String.fromCharCode(241); // fax/telephone phone\n strCheckOK[11] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_@.\"; // email address\n strCheckOK[12] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.- \"+ String.fromCharCode(241); // name of a person\n strCheckOK[13] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789&,:;.-#/'\\\"\\\\ \";\t// alpha num with basic esp char only\n strCheckOK[14] = \"0123456789-/\"; // id numbers\n strCheckOK[15] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789&,:;.-#/'\\\"\\\\ ()\"+ String.fromCharCode(241);\t// for descriptive title\n strCheckOK[16] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.\";\t// for grades ex. 1.5, NC, DR\n strCheckOK[17] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789. \";\t// for grades ex. 1.5, NC, DR\n strCheckOK[18] = \"\"; // readonly\n \n var key='', keychar='';\n \n key = getKeyCode(e);\n \n if (validchars_code==-1) {\n \tif (key>0) return false;\n \telse\t return true;\n }\n if (key == null) return true;\n\n keychar = String.fromCharCode(key);\n keychar = keychar.toLowerCase();\n validchars = strCheckOK[validchars_code];\n \n validchars=validchars.toLowerCase();\n \n if (validchars.indexOf(keychar) != -1)\n \treturn true;\n if ( key==null || key==0 || key==8 || key==9 || key==13 || key==27 )\n \treturn true;\n \n return false;\n}", "title": "" }, { "docid": "6242df0a7ab266065d8520a23e5a35f9", "score": "0.5140174", "text": "function numerosLetras(e, id) {\n key = e.keyCode || e.which;\n tecla = String.fromCharCode(key).toLowerCase();\n letras = \" (),/.-0123456789áéíóúabcdefghijklmnñopqrstuvwxyz'\\u00E1''\\u00E9''\\u00ED''\\u00F3''\\u00FA''\\u00F1''\\u00C1''\\u00C9''\\u00CD''\\u00D3''\\u00DA''\\u00D1'\";\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 $(document.getElementById(id)).notify(\"Solo N\\u00FAmeros, Letras, /.,-()\", { position: \"right\" });\n return false;\n }\n}", "title": "" }, { "docid": "6242df0a7ab266065d8520a23e5a35f9", "score": "0.5140174", "text": "function numerosLetras(e, id) {\n key = e.keyCode || e.which;\n tecla = String.fromCharCode(key).toLowerCase();\n letras = \" (),/.-0123456789áéíóúabcdefghijklmnñopqrstuvwxyz'\\u00E1''\\u00E9''\\u00ED''\\u00F3''\\u00FA''\\u00F1''\\u00C1''\\u00C9''\\u00CD''\\u00D3''\\u00DA''\\u00D1'\";\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 $(document.getElementById(id)).notify(\"Solo N\\u00FAmeros, Letras, /.,-()\", { position: \"right\" });\n return false;\n }\n}", "title": "" }, { "docid": "ef006f320d21b42da53fec81dc2a2a8e", "score": "0.51351064", "text": "function plusMinus() {\n if (lastKeyPressed === 'equal') {\n result = oldResult;\n oldResult = '';\n }\n if (result != '') {\n result = Number(result);\n result = 0 - result;\n resultDisplay.innerHTML = result;\n lastKeyPressed = 'number';\n }\n}", "title": "" }, { "docid": "c4b2bef821559e9d74bd0a4a926758a3", "score": "0.5125436", "text": "function supressNonNumericalInput(event) {\n if (!event || !'which' in event) {\n return;\n }\n\n /* decimal point */\n if (\n event.which === 46 &&\n 'currentTarget' in event &&\n 'step' in event.currentTarget\n ) {\n /* prevent decimals in numbers with a non-decimal step value */\n const step = parseFloat(event.currentTarget.step);\n console.log(step);\n if (!isNaN(step) && step >= 1) {\n event.preventDefault();\n }\n\n return;\n }\n\n /* reject non-numbers */\n if (event.which < 48 || event.which > 57) {\n event.preventDefault();\n }\n}", "title": "" }, { "docid": "d16a55c11c7a3100506f8f11b031491d", "score": "0.51147413", "text": "onAdd() {\n this.currentResult = parseInt(this.firstNumber) + parseInt(this.secondNumber);\n this.operatorUsed = '+';\n //Check if both numbers are okay and operable \n }", "title": "" }, { "docid": "c5ddae68e90d331d2d657e5265eb56e3", "score": "0.5107401", "text": "function add() \r\n{\r\n display.value += \"+\";\r\n secondDispaly.value+=display.value;\r\n toEval+=secondDispaly.value;\r\n display.value=\"\";\r\n dot_status = false;\r\n}", "title": "" }, { "docid": "48364b85f158de81593b01befd2d9bc7", "score": "0.5106532", "text": "function esCaracterEspecial(event)\n{\n var whichCode = !event.charCode ? event.which : event.charCode;\n\n if(whichCode == 0) return true;\n if(whichCode == 8) return true;\n if(whichCode == 9) return true;\n if(whichCode == 13) return true;\n if(whichCode == 16) return true;\n if(whichCode == 17) return true;\n if(whichCode == 27) return true;\n return false;\n}", "title": "" }, { "docid": "54f7249243efb905ed44ef5cda931c58", "score": "0.51033074", "text": "function esNumericoConSNoSlashEspacios(event) {\r\n \tvar ok;\r\n \tvar key;\r\n\tif (type==\"IE\") { \r\n\t\tkey = event.keyCode;\r\n\t}\r\n\tif (type==\"MO\" || type==\"OP\") {\r\n\t\tkey = event.which;\t\t \r\n\t}\r\n\r\n\tif ((key >8 && key < 32) || (key >32 && key < 47) || (key > 57 && key != 115 && key != 83 && key != 110 && key != 78)) {\r\n\t\tstop(event);\r\n\t}else{\r\n\t\tevent.returnValue = true;\r\n\t}\r\n}", "title": "" }, { "docid": "81c01b41544cab8812e9fb8320dbfc79", "score": "0.51032406", "text": "_inputKeydownHandler(e) {\n const that = this,\n keyCode = !e.charCode ? e.which : e.charCode;\n\n if (keyCode === 40 && that._isIncrementOrDecrementAllowed()) {\n // decrement when Down Arrow is pressed\n that._incrementOrDecrement('subtract');\n }\n else if (keyCode === 38 && that._isIncrementOrDecrementAllowed()) {\n // increment when Up Arrow is pressed\n that._incrementOrDecrement('add');\n }\n }", "title": "" }, { "docid": "0c4c75eccd25e939c52d2133767df38e", "score": "0.5098616", "text": "function add_Ingredient()\n{ \n if(ingredient.value==\"\")\n {\n throw \"please enter ingredient\";\n }else{\n item_ingredients.push(ingredient.value);\n document.getElementById(\"ing_data\").value=item_ingredients.join(\",\");\n console.log(\"Ingredient are :\"+item_ingredients.join(\",\"))\n\n } \n}", "title": "" }, { "docid": "766ad9981a2c94d2d3436d89331f17bc", "score": "0.50974643", "text": "function lstKeyPress(e, listType, inputField)\n{\n\ttextBox = document.getElementById(inputField);\t\n\n\tif(window.event) // IE\n\t{\n\t\tkeynum = event.keyCode;\n\t}\n\telse if(e.which) // Netscape/Firefox/Opera\n\t{\t\t\n\t\tkeynum = e.which;\n\t}\n\t\n\tif(keynum != 115)\n\t{\t\t\t\n\t\tlistKeyPress(e,textBox,listType, inputField);\n\t}\n}", "title": "" }, { "docid": "2b17c26aafd71517290c21cc4f47d42b", "score": "0.5089018", "text": "function addOperand(event) {\n if (!isTyping) { // if the user is starting a new #,\n display.textContent = \"\"; // clear the display,\n display.textContent += event.target.id; // add the new digit,\n isTyping = true; // set the flag to allow more digits to be entered\n } else {\n display.textContent += event.target.id; // user is still adding digits\n }\n // console.log(event.target.id);\n}", "title": "" }, { "docid": "9b595c44976deeb5ec1e3271d77b8c18", "score": "0.50841314", "text": "input(event) {\n\t\t// entered value (pressed key)\n\t\tlet key = event.data;\t\t\n\t\t\n\t\t/*\n\t\tValidation - input element should always contain only one digit(1 to 9) \n\t\t*/\n\t\tif(key >= 1 && key <= 9) {\n\t\t\tplayer.tempInput.value = key;\t\t\t\n\t\t} else if(key === ','){\n\t\t\tplayer.tempInput.value = '';\n\t\t} else {\n\t\t\tlet newValue = '';\n\t\t\tfor( let digit of player.tempInput.value ) {\t\t\t\t\n\t\t\t\tif(digit != 0) {newValue = digit;}\n\t\t\t}\n\t\t\tplayer.tempInput.value = newValue;\t\t\n\t\t}\n\t}", "title": "" }, { "docid": "3ffebafd339e3b6e38f305f4c541f038", "score": "0.507732", "text": "function _allowAlpha(e)\n{\n\tvar keyp;\n\tkeyp = getKeyCode(e);\n\tif((keyp>=65 && keyp<=90) || (keyp>=97 && keyp<=122) || keyp==32 || keyp==8 || keyp==0)\n\t{\n\t\treturn true;\n\t}\n\telse if(keyp == null)\n\t{\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "83bb8239e86b655c2e39e48bf9c80d1a", "score": "0.5073381", "text": "function re(e){return mn.type===Ht.Punctuator&&mn.value===e}", "title": "" }, { "docid": "b33eed98f930b55e8d85c7bb5037eaf1", "score": "0.50664985", "text": "function getText(event) {\n\tvar text = event.target.innerText;\n\tif (text !== \"+\" && text !== \"-\" && text !== \"=\") {\n\t\tdisplayNum(text);\n\t} else calculate(text);\n}", "title": "" }, { "docid": "6c2d7225f9f49381f517b3df198d918c", "score": "0.5065348", "text": "function removeNonNum(e) {\n\te.value = e.value.replace(/[^\\-\\+\\(\\)\\.\\*\\/0-9]+/g,'');\n}", "title": "" }, { "docid": "3408d88b763f0d3c59b477c0a50fe8fc", "score": "0.50645196", "text": "function LP_data(e)\n{\n\tkey=(document.all) ? e.keyCode : e.which;\n\tif (key < 48 || key > 57 ){\n\t\tif (key==8){\t\t\t\n\t\t\treturn true;\n\t\t}else{\n\t\t\tif(e.preventDefault) e.preventDefault();\n\t\t\te.returnValue = false;\n\t\t\treturn false;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a7b5dc725c284cb7468f891c998814c5", "score": "0.50573915", "text": "function prevent_repeating() {\n //vars\n var input = this.innerHTML, // clicked btn val\n calc_screen = document.getElementById(\"demo\").innerHTML, // calculator screen value\n signs = [\"-\", \"+\", \"÷\", \"x\"]; // signs array\n\n // deleting last letter if this letter is a sign and the input is a sign also\n if (signs.indexOf(calc_screen[calc_screen.length - 1]) >= 0 && signs.indexOf(input) >= 0) {\n remove_last();\n }\n\n // add 0 to last character if . exists\n if (calc_screen[calc_screen.length - 1] === '.') {\n //delete the last letter\n document.getElementById(\"demo\").innerHTML = calc_screen + '0';\n }\n // green light to add dot after writing any sign .\n dot_flag = true;\n}", "title": "" }, { "docid": "ee67fc339206bd19f52abb135a2b1b1b", "score": "0.50556946", "text": "function num_key(evt) {\n evt = evt || window.event;\n var code = evt.keyCode;\n var keychar = String.fromCharCode(evt.which || evt.keyCode);\n var numre = /[0-9\\-\\.eE]/;\n // only allow 0-9, - and various control characters\n if (code != 8 && // backspace\n code != 9 && // tab\n code != 13 && // enter\n code != 37 && // left arrow\n code != 38 && // up arrow\n code != 39 && // right arrow\n code != 40 && // down arrow\n code != 46 && // delete\n !numre.test(keychar)) {\n evt.preventDefault();\n }\n}", "title": "" }, { "docid": "4286774bec71be84d264ea9c052e2b5a", "score": "0.505543", "text": "function keyIs(e, list) {\n\t\tlet code = e.charCode || e.keyCode;\n\t\tfor (i of list) {\n\t\t\tif (Array.isArray(i) && i.length == 2) {\n\t\t\t\tif (code >= i[0] && code <= i[1])\n\t\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\tif (code == i)\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "723be1828fc37f9d2ff1e8d64dc41c0d", "score": "0.50506455", "text": "function makeAlphaNum()\r\n{\r\n //***if ((event.keyCode<48 || event.keyCode>57) && (event.keyCode<65 || event.keyCode>90) && (event.keyCode<97 || event.keyCode>122) && (event.keyCode!=32))\r\n if ((event.keyCode<48 || event.keyCode>57) && (event.keyCode<65 || event.keyCode>90) && (event.keyCode<97 || event.keyCode>122) && (event.keyCode!=32) && (event.keyCode!=39) && (event.keyCode!=35) && (event.keyCode!=45) && (event.keyCode!=60) && (event.keyCode!=62))\r\n {\r\n event.returnValue = false;\r\n }\r\n else if (event.keyCode>=97 && event.keyCode<=122)\r\n {\r\n\tevent.keyCode = event.keyCode - 32;\r\n }\r\n}", "title": "" }, { "docid": "21b05028d2474f2b9c66629495307cde", "score": "0.5049004", "text": "onInputChange(){\n\t\t\t\n\t\t\tlet len = $('#input .letter').length;\n\t\t\tlet newInput = App.getInput().replace(/\\s+/g, '');;\n\t\t\t\n\t\t\tfor (let i = 1; i < len; i++) {\n\t\t\t\t\n\t\t\t\tlet $letter = $('#input .letter').eq(i); \n\t\t\t\tlet newC = newInput.charAt(i) || null;\n\t\t\t\tlet curC = $letter.text();\n\n\t\t\t\tif (newC != curC) {\n\t\t\t\t\t\n\t\t\t\t\tif (newC) $letter.text(newC);\n\t\t\t\t\telse $letter.html('&nbsp;');\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "64c70c96b4c8df1b4170c91c2aad05c4", "score": "0.50487816", "text": "function letterOnly(event){\n\t//watching for the key codes of all number keys\n\tvar x = event.keyCode;\n\tif(event.keyCode >= 48 && event.keyCode <= 57){\n\t\tinputType.value = \"\";\n\t\talert(\"Please enter a string of letters!\");\n\t\tinputType[0].focus(); //again, need to reference by index\n\t}\n}", "title": "" }, { "docid": "84f126e302fa908cb875f0ff73ead81f", "score": "0.5045046", "text": "function onInnerInputKeyDown(e) {\n const pressedKey = e.key || e.keyCode;\n /// if pressed key is not the valid operation key (e.g. comma, enter, etc...) or inner input is empty, do nothing\n if(!isValidKey(defaultOptions.delimeters, pressedKey) || !tagifyInput.value.trim()) { return; }\n\n resetFocusedTag()\n \n insertTag();\n \n e.preventDefault(); /// prevents delimeter from staying in inner input as value\n }", "title": "" }, { "docid": "c5b64c541a348b02fd72dcc06e2dbce0", "score": "0.50414705", "text": "function Easings() {}", "title": "" } ]
3c120c351782bdebdef4a2e39e424f87
A special extend for ajax options that takes "flat" options (not to be deep extended) Fixes 9887
[ { "docid": "ed092e36cd4413b2f506d96332f3c904", "score": "0.0", "text": "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\n\t\treturn target;\n\t}", "title": "" } ]
[ { "docid": "4ad4453514dbe6e35081645d4aa5d7bc", "score": "0.779069", "text": "function nt(t,e){var n,i,o=_t.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((o[n]?t:i||(i={}))[n]=e[n]);return i&&_t.extend(!0,t,i),t}", "title": "" }, { "docid": "561b8ede817869859a1880447cfac990", "score": "0.76101995", "text": "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions || {};for(key in src) {if(src[key] !== undefined){(flatOptions[key]?target:deep || (deep = {}))[key] = src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "title": "" }, { "docid": "561b8ede817869859a1880447cfac990", "score": "0.76101995", "text": "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions || {};for(key in src) {if(src[key] !== undefined){(flatOptions[key]?target:deep || (deep = {}))[key] = src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "title": "" }, { "docid": "561b8ede817869859a1880447cfac990", "score": "0.76101995", "text": "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions || {};for(key in src) {if(src[key] !== undefined){(flatOptions[key]?target:deep || (deep = {}))[key] = src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "title": "" }, { "docid": "9c8e767694194ff04964d2c420742ac2", "score": "0.7586866", "text": "function ajaxExtend(target,src){var deep,key,flatOptions=jQuery.ajaxSettings.flatOptions || {};for(key in src) {if(src[key] !== undefined){(flatOptions[key]?target:deep || (deep = {}))[key] = src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "title": "" }, { "docid": "7a328a6da536db54c9dc0abe7dd335d6", "score": "0.7575895", "text": "function ajaxExtend(target,src){var deep,key,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key]}}if(deep){jQuery.extend(true,target,deep)}return target}", "title": "" }, { "docid": "23f0c86d328059017db687ebf3b6f5c8", "score": "0.75659895", "text": "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "title": "" }, { "docid": "23f0c86d328059017db687ebf3b6f5c8", "score": "0.75659895", "text": "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "title": "" }, { "docid": "23f0c86d328059017db687ebf3b6f5c8", "score": "0.75659895", "text": "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "title": "" }, { "docid": "23f0c86d328059017db687ebf3b6f5c8", "score": "0.75659895", "text": "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "title": "" }, { "docid": "23f0c86d328059017db687ebf3b6f5c8", "score": "0.75659895", "text": "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "title": "" }, { "docid": "23f0c86d328059017db687ebf3b6f5c8", "score": "0.75659895", "text": "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "title": "" }, { "docid": "23f0c86d328059017db687ebf3b6f5c8", "score": "0.75659895", "text": "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "title": "" }, { "docid": "e6d1c60a94945cbbfea6dddc560af5a1", "score": "0.75467634", "text": "function ajaxExtend(target,src){var deep,key,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "title": "" }, { "docid": "14e2131b34c2044788f4313dc132da3e", "score": "0.7247182", "text": "function ajaxExtend(target, src) {\n var key,\n deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n for (key in src) {\n if (src[key] !== undefined) {\n (flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];\n }\n }\n if (deep) {\n jQuery.extend(true, target, deep);\n }\n return target;\n }", "title": "" }, { "docid": "6951eaef823787bf4e5bb6ba8f72f25d", "score": "0.7240038", "text": "function ajaxExtend( target, src ) {\r\n\tvar key, deep,\r\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\r\n\r\n\tfor ( key in src ) {\r\n\t\tif ( src[ key ] !== undefined ) {\r\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\r\n\t\t}\r\n\t}\r\n\tif ( deep ) {\r\n\t\tjQuery.extend( true, target, deep );\r\n\t}\r\n\r\n\treturn target;\r\n}", "title": "" }, { "docid": "6951eaef823787bf4e5bb6ba8f72f25d", "score": "0.7240038", "text": "function ajaxExtend( target, src ) {\r\n\tvar key, deep,\r\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\r\n\r\n\tfor ( key in src ) {\r\n\t\tif ( src[ key ] !== undefined ) {\r\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\r\n\t\t}\r\n\t}\r\n\tif ( deep ) {\r\n\t\tjQuery.extend( true, target, deep );\r\n\t}\r\n\r\n\treturn target;\r\n}", "title": "" }, { "docid": "6951eaef823787bf4e5bb6ba8f72f25d", "score": "0.7240038", "text": "function ajaxExtend( target, src ) {\r\n\tvar key, deep,\r\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\r\n\r\n\tfor ( key in src ) {\r\n\t\tif ( src[ key ] !== undefined ) {\r\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\r\n\t\t}\r\n\t}\r\n\tif ( deep ) {\r\n\t\tjQuery.extend( true, target, deep );\r\n\t}\r\n\r\n\treturn target;\r\n}", "title": "" }, { "docid": "6951eaef823787bf4e5bb6ba8f72f25d", "score": "0.7240038", "text": "function ajaxExtend( target, src ) {\r\n\tvar key, deep,\r\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\r\n\r\n\tfor ( key in src ) {\r\n\t\tif ( src[ key ] !== undefined ) {\r\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\r\n\t\t}\r\n\t}\r\n\tif ( deep ) {\r\n\t\tjQuery.extend( true, target, deep );\r\n\t}\r\n\r\n\treturn target;\r\n}", "title": "" }, { "docid": "6951eaef823787bf4e5bb6ba8f72f25d", "score": "0.7240038", "text": "function ajaxExtend( target, src ) {\r\n\tvar key, deep,\r\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\r\n\r\n\tfor ( key in src ) {\r\n\t\tif ( src[ key ] !== undefined ) {\r\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\r\n\t\t}\r\n\t}\r\n\tif ( deep ) {\r\n\t\tjQuery.extend( true, target, deep );\r\n\t}\r\n\r\n\treturn target;\r\n}", "title": "" }, { "docid": "bf891d8a093ac2e27c9b04278c60d1af", "score": "0.7235596", "text": "function ajaxExtend(target, src) {\n var deep,\n key,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for (key in src) {\n if (src[key] !== undefined) {\n (flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];\n }\n }\n\n if (deep) {\n jQuery.extend(true, target, deep);\n }\n\n return target;\n }", "title": "" }, { "docid": "0d48b5213f62417998399663759be3fb", "score": "0.72339207", "text": "function ajaxExtend( target, src ) {\r\n\tvar key, deep,\r\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\r\n\r\n\tfor ( key in src ) {\r\n\t\tif ( src[ key ] !== undefined ) {\r\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\r\n\t\t}\r\n\t}\r\n\tif ( deep ) {\r\n\t\tjQuery.extend( true, target, deep );\r\n\t}\r\n\r\n\treturn target;\r\n}", "title": "" }, { "docid": "24f2f56105e2a4599578496ceb59b922", "score": "0.72324926", "text": "function ajaxExtend(target, src) {\r\n var key, deep,\r\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\r\n for (key in src) {\r\n if (src[key] !== undefined) {\r\n (flatOptions[key] ? target : (deep || (deep = {})))[key] = src[key];\r\n }\r\n }\r\n if (deep) {\r\n jQuery.extend(true, target, deep);\r\n }\r\n }", "title": "" }, { "docid": "abb17cb83c17b7ff1ea3f75e637c002a", "score": "0.7219781", "text": "function ajaxExtend( target, src ) {\n var key, deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n\n return target;\n }", "title": "" }, { "docid": "48f4806d5d311ddc0723d193972f072b", "score": "0.72190213", "text": "function ajaxExtend( target, src ) {\r\n\tvar deep, key,\r\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\r\n\r\n\tfor ( key in src ) {\r\n\t\tif ( src[ key ] !== undefined ) {\r\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\r\n\t\t}\r\n\t}\r\n\tif ( deep ) {\r\n\t\tjQuery.extend( true, target, deep );\r\n\t}\r\n\r\n\treturn target;\r\n}", "title": "" }, { "docid": "e9d5398fafafc97c4dbb97a0129e28a2", "score": "0.7217802", "text": "function ajaxExtend(target, src) {\n\t\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\tfor (key in src) {\n\t\t\tif (src[key] !== undefined) {\n\t\t\t\t(flatOptions[key] ? target : (deep || (deep = {})))[key] = src[key];\n\t\t\t}\n\t\t}\n\t\tif (deep) {\n\t\t\tjQuery.extend(true, target, deep);\n\t\t}\n\t\treturn target;\n\t}", "title": "" }, { "docid": "e0cba2c026311e648a6b00376b17f410", "score": "0.72165483", "text": "function ajaxExtend(target, src) {\n\t\t\tvar key,\n\t\t\t deep,\n\t\t\t flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\t\t\tfor (key in src) {\n\t\t\t\tif (src[key] !== undefined) {\n\t\t\t\t\t(flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (deep) {\n\t\t\t\tjQuery.extend(true, target, deep);\n\t\t\t}\n\n\t\t\treturn target;\n\t\t}", "title": "" }, { "docid": "e0cba2c026311e648a6b00376b17f410", "score": "0.72165483", "text": "function ajaxExtend(target, src) {\n\t\t\tvar key,\n\t\t\t deep,\n\t\t\t flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\t\t\tfor (key in src) {\n\t\t\t\tif (src[key] !== undefined) {\n\t\t\t\t\t(flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (deep) {\n\t\t\t\tjQuery.extend(true, target, deep);\n\t\t\t}\n\n\t\t\treturn target;\n\t\t}", "title": "" }, { "docid": "e0cba2c026311e648a6b00376b17f410", "score": "0.72165483", "text": "function ajaxExtend(target, src) {\n\t\t\tvar key,\n\t\t\t deep,\n\t\t\t flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\t\t\tfor (key in src) {\n\t\t\t\tif (src[key] !== undefined) {\n\t\t\t\t\t(flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (deep) {\n\t\t\t\tjQuery.extend(true, target, deep);\n\t\t\t}\n\n\t\t\treturn target;\n\t\t}", "title": "" }, { "docid": "00ee32c362978763ea722801bfda9c0e", "score": "0.72157025", "text": "function ajaxExtend( target, src ) {\n \tvar key, deep,\n \t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n \tfor ( key in src ) {\n \t\tif ( src[ key ] !== undefined ) {\n \t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n \t\t}\n \t}\n \tif ( deep ) {\n \t\tjQuery.extend( true, target, deep );\n \t}\n }", "title": "" }, { "docid": "8c375a03b4ab6dec79487d9f968345e6", "score": "0.7215616", "text": "function ajaxExtend(target, src) {\n var key, deep, flatOptions = jQuery.ajaxSettings.flatOptions || {};\n for (key in src) {\n if (src[key] !== undefined) {\n (flatOptions[key] ? target : (deep || (deep = {})))[key] = src[key];\n }\n }\n if (deep) {\n jQuery.extend(true, target, deep);\n }\n return target;\n }", "title": "" }, { "docid": "bebab1bc88295bbfb5d21b8b8735b738", "score": "0.7213483", "text": "function ajaxExtend( target, src ) {\n \tvar key, deep,\n \t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n \tfor ( key in src ) {\n \t\tif ( src[ key ] !== undefined ) {\n \t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n \t\t}\n \t}\n \tif ( deep ) {\n \t\tjQuery.extend( true, target, deep );\n \t}\n\n \treturn target;\n }", "title": "" }, { "docid": "bebab1bc88295bbfb5d21b8b8735b738", "score": "0.7213483", "text": "function ajaxExtend( target, src ) {\n \tvar key, deep,\n \t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n \tfor ( key in src ) {\n \t\tif ( src[ key ] !== undefined ) {\n \t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n \t\t}\n \t}\n \tif ( deep ) {\n \t\tjQuery.extend( true, target, deep );\n \t}\n\n \treturn target;\n }", "title": "" }, { "docid": "27d82d882d4468f692be237a1873a584", "score": "0.72059995", "text": "function ajaxExtend( target, src ) {\n var key, deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n }", "title": "" }, { "docid": "27d82d882d4468f692be237a1873a584", "score": "0.72059995", "text": "function ajaxExtend( target, src ) {\n var key, deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n }", "title": "" }, { "docid": "cbec765320faf6eddc9581f810a0dc4f", "score": "0.72023183", "text": "function ajaxExtend( target, src ) {\n \tvar key, deep,\n \t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n \tfor ( key in src ) {\n \t\tif ( src[ key ] !== undefined ) {\n \t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n \t\t}\n \t}\n \tif ( deep ) {\n \t\tjQuery.extend( true, target, deep );\n \t}\n\n \treturn target;\n }", "title": "" }, { "docid": "92fc44608dfb930d9fc809bf506104ee", "score": "0.7199126", "text": "function ajaxExtend( target, src ) {\n var key, deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n}", "title": "" }, { "docid": "6b4ff05f8c45f6860afd9f309d2f6992", "score": "0.71911293", "text": "function ajaxExtend( target, src ) {\n var key, deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n\n return target;\n }", "title": "" }, { "docid": "4d243545827a8c1303648b97852fa8ce", "score": "0.7185084", "text": "function ajaxExtend(target, src) {\n var key, deep, flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for (key in src) {\n if (src[key] !== undefined) { (flatOptions[key] ? target: (deep || (deep = {})))[key] = src[key];\n }\n }\n if (deep) {\n jQuery.extend(true, target, deep);\n }\n\n return target;\n }", "title": "" }, { "docid": "840df7369531ef71657a5d57cf98b3e4", "score": "0.717426", "text": "function ajaxExtend( target, src ) {\n\t\t\tvar key, deep,\n\t\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\t\t\tfor ( key in src ) {\n\t\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( deep ) {\n\t\t\t\tjQuery.extend( true, target, deep );\n\t\t\t}\n\n\t\t\treturn target;\n\t\t}", "title": "" }, { "docid": "0503ff3e248cf2333da2e2bea990061b", "score": "0.7167971", "text": "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "title": "" }, { "docid": "0503ff3e248cf2333da2e2bea990061b", "score": "0.7167971", "text": "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "title": "" }, { "docid": "0503ff3e248cf2333da2e2bea990061b", "score": "0.7167971", "text": "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "title": "" }, { "docid": "0503ff3e248cf2333da2e2bea990061b", "score": "0.7167971", "text": "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "title": "" }, { "docid": "0503ff3e248cf2333da2e2bea990061b", "score": "0.7167971", "text": "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "title": "" }, { "docid": "0503ff3e248cf2333da2e2bea990061b", "score": "0.7167971", "text": "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "title": "" }, { "docid": "0503ff3e248cf2333da2e2bea990061b", "score": "0.7167971", "text": "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "title": "" }, { "docid": "0503ff3e248cf2333da2e2bea990061b", "score": "0.7167971", "text": "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "title": "" }, { "docid": "0503ff3e248cf2333da2e2bea990061b", "score": "0.7167971", "text": "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "title": "" }, { "docid": "0503ff3e248cf2333da2e2bea990061b", "score": "0.7167971", "text": "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "title": "" }, { "docid": "6e3658422a82bf5050a1b307a3179714", "score": "0.71661294", "text": "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "title": "" }, { "docid": "6e3658422a82bf5050a1b307a3179714", "score": "0.71661294", "text": "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "title": "" }, { "docid": "6e3658422a82bf5050a1b307a3179714", "score": "0.71661294", "text": "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "title": "" }, { "docid": "8f186fd1d14525f6b70215709a4d1b91", "score": "0.7166099", "text": "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "7981c1179daab69e210ad62c8ad0e57a", "score": "0.71628773", "text": "function ajaxExtend( target, src ) {\n\t\tvar deep, key,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "title": "" }, { "docid": "941e5206e690d8898263418d9dcbcda9", "score": "0.7152951", "text": "function ajaxExtend( target, src ) {\n var deep, key,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n\n return target;\n}", "title": "" }, { "docid": "941e5206e690d8898263418d9dcbcda9", "score": "0.7152951", "text": "function ajaxExtend( target, src ) {\n var deep, key,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n\n return target;\n}", "title": "" }, { "docid": "1be32608c52577ea40c1fe4f3410bb78", "score": "0.7151372", "text": "function ajaxExtend( target, src ) {\n var key, deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n\n return target;\n}", "title": "" }, { "docid": "1be32608c52577ea40c1fe4f3410bb78", "score": "0.7151372", "text": "function ajaxExtend( target, src ) {\n var key, deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n\n return target;\n}", "title": "" }, { "docid": "1be32608c52577ea40c1fe4f3410bb78", "score": "0.7151372", "text": "function ajaxExtend( target, src ) {\n var key, deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n\n return target;\n}", "title": "" }, { "docid": "1491403e56be077e638b143e5db4ea67", "score": "0.7148089", "text": "function ajaxExtend(target, src) {\n var deep, key,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for (key in src) {\n if (src[key] !== undefined) {\n ( flatOptions[key] ? target : ( deep || (deep = {}) ) )[key] = src[key];\n }\n }\n if (deep) {\n jQuery.extend(true, target, deep);\n }\n\n return target;\n }", "title": "" }, { "docid": "f3cdab080c8aaac8fc1c1ca77194ea95", "score": "0.71438056", "text": "function ajaxExtend(target, src) {\n var key,\n deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for (key in src) {\n if (src[key] !== undefined) {\n (flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];\n }\n }\n\n if (deep) {\n jQuery.extend(true, target, deep);\n }\n\n return target;\n }", "title": "" }, { "docid": "f3cdab080c8aaac8fc1c1ca77194ea95", "score": "0.71438056", "text": "function ajaxExtend(target, src) {\n var key,\n deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for (key in src) {\n if (src[key] !== undefined) {\n (flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];\n }\n }\n\n if (deep) {\n jQuery.extend(true, target, deep);\n }\n\n return target;\n }", "title": "" }, { "docid": "f3cdab080c8aaac8fc1c1ca77194ea95", "score": "0.71438056", "text": "function ajaxExtend(target, src) {\n var key,\n deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for (key in src) {\n if (src[key] !== undefined) {\n (flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];\n }\n }\n\n if (deep) {\n jQuery.extend(true, target, deep);\n }\n\n return target;\n }", "title": "" }, { "docid": "f3cdab080c8aaac8fc1c1ca77194ea95", "score": "0.71438056", "text": "function ajaxExtend(target, src) {\n var key,\n deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for (key in src) {\n if (src[key] !== undefined) {\n (flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];\n }\n }\n\n if (deep) {\n jQuery.extend(true, target, deep);\n }\n\n return target;\n }", "title": "" }, { "docid": "f3cdab080c8aaac8fc1c1ca77194ea95", "score": "0.71438056", "text": "function ajaxExtend(target, src) {\n var key,\n deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for (key in src) {\n if (src[key] !== undefined) {\n (flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];\n }\n }\n\n if (deep) {\n jQuery.extend(true, target, deep);\n }\n\n return target;\n }", "title": "" }, { "docid": "8cb634e8c857dd6f3bab2310f0c870f6", "score": "0.71401554", "text": "function ajaxExtend( target, src ) {\n var key, deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n\n return target;\n }", "title": "" }, { "docid": "8cb634e8c857dd6f3bab2310f0c870f6", "score": "0.71401554", "text": "function ajaxExtend( target, src ) {\n var key, deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n\n return target;\n }", "title": "" }, { "docid": "18bb8daf970e94797e3c0d4b6781d134", "score": "0.71395385", "text": "function ajaxExtend(target, src) {\n var deep, key,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for (key in src) {\n if (src[key] !== undefined) {\n ( flatOptions[key] ? target : ( deep || ( deep = {} ) ) )[key] = src[key];\n }\n }\n if (deep) {\n jQuery.extend(true, target, deep);\n }\n\n return target;\n }", "title": "" }, { "docid": "18bb8daf970e94797e3c0d4b6781d134", "score": "0.71395385", "text": "function ajaxExtend(target, src) {\n var deep, key,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for (key in src) {\n if (src[key] !== undefined) {\n ( flatOptions[key] ? target : ( deep || ( deep = {} ) ) )[key] = src[key];\n }\n }\n if (deep) {\n jQuery.extend(true, target, deep);\n }\n\n return target;\n }", "title": "" }, { "docid": "1e4dd65a3e3a75b8ea5254c0a4093f4d", "score": "0.71391225", "text": "function ajaxExtend( target, src ) {\n var deep, key,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n\n return target;\n }", "title": "" }, { "docid": "466eacb2f861fc5429b6d169d4c7cddf", "score": "0.71339726", "text": "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "466eacb2f861fc5429b6d169d4c7cddf", "score": "0.71339726", "text": "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "466eacb2f861fc5429b6d169d4c7cddf", "score": "0.71339726", "text": "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "466eacb2f861fc5429b6d169d4c7cddf", "score": "0.71339726", "text": "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "466eacb2f861fc5429b6d169d4c7cddf", "score": "0.71339726", "text": "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "466eacb2f861fc5429b6d169d4c7cddf", "score": "0.71339726", "text": "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "466eacb2f861fc5429b6d169d4c7cddf", "score": "0.71339726", "text": "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "466eacb2f861fc5429b6d169d4c7cddf", "score": "0.71339726", "text": "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "466eacb2f861fc5429b6d169d4c7cddf", "score": "0.71339726", "text": "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "466eacb2f861fc5429b6d169d4c7cddf", "score": "0.71339726", "text": "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "466eacb2f861fc5429b6d169d4c7cddf", "score": "0.71339726", "text": "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "466eacb2f861fc5429b6d169d4c7cddf", "score": "0.71339726", "text": "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "466eacb2f861fc5429b6d169d4c7cddf", "score": "0.71339726", "text": "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "466eacb2f861fc5429b6d169d4c7cddf", "score": "0.71339726", "text": "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "466eacb2f861fc5429b6d169d4c7cddf", "score": "0.71339726", "text": "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "466eacb2f861fc5429b6d169d4c7cddf", "score": "0.71339726", "text": "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "466eacb2f861fc5429b6d169d4c7cddf", "score": "0.71339726", "text": "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "466eacb2f861fc5429b6d169d4c7cddf", "score": "0.71339726", "text": "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "466eacb2f861fc5429b6d169d4c7cddf", "score": "0.71339726", "text": "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "466eacb2f861fc5429b6d169d4c7cddf", "score": "0.71339726", "text": "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "466eacb2f861fc5429b6d169d4c7cddf", "score": "0.71339726", "text": "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "466eacb2f861fc5429b6d169d4c7cddf", "score": "0.71339726", "text": "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "466eacb2f861fc5429b6d169d4c7cddf", "score": "0.71339726", "text": "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "466eacb2f861fc5429b6d169d4c7cddf", "score": "0.71339726", "text": "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "466eacb2f861fc5429b6d169d4c7cddf", "score": "0.71339726", "text": "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "466eacb2f861fc5429b6d169d4c7cddf", "score": "0.71339726", "text": "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "466eacb2f861fc5429b6d169d4c7cddf", "score": "0.71339726", "text": "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "466eacb2f861fc5429b6d169d4c7cddf", "score": "0.71339726", "text": "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "466eacb2f861fc5429b6d169d4c7cddf", "score": "0.71339726", "text": "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "466eacb2f861fc5429b6d169d4c7cddf", "score": "0.71339726", "text": "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" } ]
558f365cfd8848979a2044e342d9feee
Send POST to API to add place
[ { "docid": "632f32eb6118c3315f77fbea38d18677", "score": "0.6401506", "text": "async function addMCenter(e) {\n e.preventDefault();\n\n if (place.value === '') {\n place.placeholder = 'Please fill in an address';\n return;\n }\n \n\n var cordinateObject = localStorage.getItem('cordinateObject');\n console.log('cordinateObject geometry');\n console.log(JSON.parse(cordinateObject));\n console.log(place.value);\n const sendBody = {\n name: place.value,\n address: place.value,\n location: {\n type: 'Point',\n //coordinates: [JSON.parse(cordinateObject).coordinates[0], JSON.parse(cordinateObject).coordinates[1]],\n coordinates: [(JSON.parse(cordinateObject).coordinates[0]+(((Math.random() * 5) - 5)/100000)).toFixed(6), (JSON.parse(cordinateObject).coordinates[1]+(((Math.random() * 2) - 2)/100000)).toFixed(6)],\n city: place.value,\n formattedAddress: JSON.parse(localStorage.getItem('addressObject'))\n }\n };\n\n try {\n place.value = '';\n place.placeholder = 'Loading...';\n\n const res = await fetch('/api/medical', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(sendBody)\n });\n\n if (res.status === 400) {\n throw Error;\n }\n \n if (res.status === 200) {\n place.style.border = 'none';\n place.placeholder = 'Succesfully added!';\n \n // Retrieve updated data\n //places = await getPlaces();\n\n // map.getSource('api').setData({\n // type: 'FeatureCollection',\n // features: places\n //});\n }\n } catch (err) {\n place.placeholder = err;\n return;\n }\n}", "title": "" } ]
[ { "docid": "baec0193af8d906c91d4ce0029e79cbd", "score": "0.73559934", "text": "async function addPlace(e) {\n e.preventDefault();\n const data = {\n storeId: placeId.value,\n address: placeAddress.value\n };\n try {\n const res = await fetch(\"/api/v1/stores\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(data)\n });\n if (res.status === 400) {\n throw Error(\"Try With another Place Id !\");\n }\n alert(\"Place Added !\");\n window.location.href = \"/index.html\";\n } catch (error) {\n alert(error);\n return;\n }\n}", "title": "" }, { "docid": "2396e5fcd86e45a2be5a8a3318f5a85c", "score": "0.6688751", "text": "function addPlaceData(req, res){\n let data = req.body;\n\tprojectData[\"lat\"] = data.lat;\n\tprojectData[\"long\"] = data.long;\n projectData[\"country\"] = data.country;\n projectData[\"city\"] = data.city\n res.send({message: \"POST received\"});\n}", "title": "" }, { "docid": "b68ef4d1fca867a684c3a29b03fcce9b", "score": "0.6455982", "text": "function handleAddClick(evt){\n console.log(\"clicked\");\n //prevent the form from carrying out its default action\n evt.preventDefault();\n //create a URLencoded string to be sent in the request body\n var urlString = \"\";\n //get the location data from the form by document id\n var name = document.getElementById('place_name').value;\n var type = document.getElementById('type').value;\n var google_maps_id = document.getElementById('google_maps_id').value;\n var description = document.getElementById('description').value;\n //concatenate urlencoded string\n urlString = 'name=' + name + '&' + 'type=' + type + '&' + 'google_maps_id=' + google_maps_id + '&' + 'description=' + description;\n //create new XMLHttpRequest\n var req = new XMLHttpRequest();\n //specify url\n var url = 'https://laflocate.herokuapp.com';\n //open a post based on the above url\n req.open('POST', url, true);\n //set the request header content type to urlencoded\n req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); \n //on load of the request\n req.addEventListener('load', function(){\n //if the request succeeds\n if (req.status >= 200 && req.status < 400) {\n //if the location has been added\n if(req.responseText === \"success\"){\n console.log('location added');\n \n }\n //if the location is not successfully added, say so\n else{\n console.log('location NOT added');\n }\n\n }\n });\n //send the request with the URLEncoded string\n req.send(urlString);\n}", "title": "" }, { "docid": "c8ca76b6d2d23bfbde5b27832ef8a4b6", "score": "0.6410432", "text": "function add_location(event) {\n event.preventDefault();\n let data = get_form_data(event.target);\n\n fetch(\"/api/locations.php\", {\n body: JSON.stringify(data),\n credentials: \"include\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n method: \"PUT\"\n }).then(response => {\n if(response.ok) {\n return response.json();\n } else if(403 == response.status) {\n\t\t\tthrow new SessionTimeOutError();\n\t\t}\n\n throw \"API was unable to save new location\";\n }).then(_data => {\n moostaka.navigate(\"/locations\");\n // notify user of success\n }).catch(handleError);\n}", "title": "" }, { "docid": "15229c13f30019ed0c79a2ccb09f6708", "score": "0.63985837", "text": "function handleAddPlaceSaveButton(){\n\tif(validatePlaceForm()){\n\t\tTi.API.info('Add place form is valid');\n\t\tdoSavePlaceOnline(addPlaceObject);\n\t}else{\n\t\tTi.API.info('Add place form is not valid');\n\t}\n}", "title": "" }, { "docid": "992f16225f96c57514ef2cff3f3d778e", "score": "0.63422406", "text": "create(req, res) {\n\n return Place.create({\n name: req.body.name,\n })\n .then(place => res.status(201).send(place))\n .catch(error => res.status(400).send(error));\n }", "title": "" }, { "docid": "6a50686c1f528f80f007721c54658b89", "score": "0.6285631", "text": "function addNew() {\n fetch(\"https://apartments-hunt.herokuapp.com/apartment\", {\n method: \"POST\",\n headers: {'Content-type': 'application/json'},\n body: JSON.stringify(newHouse)\n })\n .then(() => {\n document.getElementById('addhouseform').reset();\n document.getElementById('success').innerHTML = \"Added Successfully\"\n });\n }", "title": "" }, { "docid": "cbe2d83fbd53c0a84e49d3a314dac3c6", "score": "0.618661", "text": "function onAddTownClick() {\n const $townName = $('input.addTown.townName');\n const $countryName = $('input.addTown.countryName');\n const townName = $townName.val();\n const countryName = $countryName.val();\n\n if (!townName || !countryName) {\n return;\n }\n\n showMessage();\n $.ajax({\n method: 'POST',\n url: baseUrl + 'towns',\n headers: {\n Authorization: authString\n },\n data: {\n townName,\n countryName\n },\n success: () => {\n $townName.val('');\n $countryName.val('');\n },\n error: err => console.log(err)\n });\n }", "title": "" }, { "docid": "bfdb5ea0b7eeedc8d76f91a7bfb5ac35", "score": "0.6162209", "text": "add() {\n rentalService.getAreaID(this.curArea, result => {\n this.curAreaID = result.id;\n\n rentalService.addLocation(\n this.name,\n this.streetAddress,\n this.streetNum,\n this.postalNum,\n this.place,\n this.curAreaID\n );\n });\n this.handleClose();\n history.push('/area/1/1');\n }", "title": "" }, { "docid": "2c7838adbd45693006621a20eb2f4b03", "score": "0.6158521", "text": "async savePlace({commit,state},payload){\n let url = ''\n if(payload.editing_mode)\n {\n url = API.DASHBORD_PLACE_EDIT_URL(payload.slug)\n }else{\n url = API.DASHBORD_PLACE_CREATE_URL\n }\n commit(\"reset\",\"PLACES\")\n return await this.$axios.post(url,payload)\n \n\n }", "title": "" }, { "docid": "9b1d319b19cf362fd295ae56ec02afc0", "score": "0.613032", "text": "function create(params, callback) {\n core.api('POST', '/locations', params, callback);\n }", "title": "" }, { "docid": "3b69accad0518b4020d98293cf7e2e7d", "score": "0.61222136", "text": "putExistingPlace(placeId, placeToEdit) {\n return fetch(`http://localhost:8088/places/${placeId}`, {\n method: \"PUT\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(placeToEdit)\n })\n }", "title": "" }, { "docid": "f375058bb4367f9f15c112de7455e078", "score": "0.60533273", "text": "function spotCreate(defaultLat,defaultLng){\n\n\tif (jQuery.isEmptyObject($(\"#placeName\").val())) {\n alertify.error('Please provide a place name');\n\t\treturn;\n\t}else{\n\t\tspotData[\"placeName\"]=$(\"#placeName\").val();\n\t\tspotData[\"tagList\"]=$(\"#jQuerytagEditorModalGet\").val()\n\n\t\t$.ajax({\n\t\t url:'/spot/create/',\n\t\t type: 'POST',\n\t\t data: {\n\t\t \taction: \"create_spot\",\n\t\t\t\tcountry: spotData.country,\n\t\t\t\tcountryCode: spotData.countryCode,\n\t\t\t\tstate_name: spotData.state_name,\n\t\t\t\tcity: spotData.city,\n\t\t\t\tpostalCode: spotData.postalCode,\n\t\t\t\tfullAddress: spotData.fullAddress,\n\t\t\t\tlatitude: spotData.latitude,\n\t\t\t\tlength: spotData.length,\n\t\t\t\tplaceName: spotData.placeName,\n\t\t\t\ttagList: spotData.tagList\t\t \n\t\t\t},success: function showAnswer(data) {\n\t\t\t if (data.code==200) {\n\t\t\t //console.log(\"success\",data);\n\t\t alertify.success('Spot saved successfully');\n\t\t var delayInMilliseconds = 2000; // 2 second\n\t\t setTimeout(function() {\n\t\t location.reload(true);\n\t\t }, delayInMilliseconds);\n\t\t\t }else{\n\t\t\t console.log('Error, status:',data.code);\n\t\t alertify.error('An error happened saving the spot, please try again.');\n\t\t\t }\n\t\t\t}\n\t\t})\n\t}\n}", "title": "" }, { "docid": "311e2778e56231fa940cd3d7499f4fff", "score": "0.60289174", "text": "function insertLocation(event) {\n event.preventDefault();\n\n var location = {\n locate_name: $(\"#locate_name\").val().trim(),\n street: $(\"#street\").val().trim(),\n city: $(\"#city\").val().trim(),\n state: $(\"#state\").val().trim(),\n zip_code: $(\"#zip_code\").val().trim(),\n phone_num: $(\"#phone_num\").val().trim(),\n bought: $(\"#bought\").val().trim(),\n price: $(\"#price\").val().trim()\n };\n\n // Posting the new insurance, calling displayInsurance when done\n $.post(\"/api/location\", location, function() {\n displayLocation();\n });\n //clearing out form after adding to database\n $(\"#locate_name\").val(\"\"),\n $(\"#street\").val(\"\");\n $(\"#city\").val(\"\");\n $(\"#state\").val(\"\");\n $(\"#zip_code\").val(\"\");\n $(\"#phone_num\").val(\"\");\n $(\"#bought\").val(\"\");\n $(\"#price\").val(\"\");\n \n }", "title": "" }, { "docid": "bc6696bfa640a54382a985c395962fa6", "score": "0.60110897", "text": "function addTrip() {\n const data = { tripname: tripName, tripStatus: true };\n /** If tripname is empty , function does not work. */\n /** Putting url in the fetch and sending it with body and with token in the header */\n if (tripName) {\n fetch(\"http://localhost:8080/trip/add\", {\n method: \"POST\", //This is a Post request\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: \"Bearer \" + token,\n },\n body: JSON.stringify(data),\n })\n .then((response) => response.text()) //After adding the trip, response will return as text\n .then((result) => alert(result))\n .catch((error) => {\n console.log(\"Error:\", error);\n });\n } else {\n alert(\"All fields are mandatory\");\n }\n }", "title": "" }, { "docid": "a935f05c4aa62d5806c7de0690a856e6", "score": "0.6010815", "text": "function savePlace() {\n\n $scope.saving = true;\n $scope.error = false;\n\n // Convert this place data to a Udb-place.\n var eventTypeLabel = '';\n for (var i = 0; i < $scope.categories.length; i++) {\n if ($scope.categories[i].id === $scope.newPlace.eventType.id) {\n eventTypeLabel = $scope.categories[i].label;\n break;\n }\n }\n\n var udbPlace = new UdbPlace();\n udbPlace.name = $scope.newPlace.name;\n udbPlace.calendar.calendarType = 'permanent';\n udbPlace.type = {\n id : $scope.newPlace.eventType.id,\n label : eventTypeLabel,\n domain : 'eventtype'\n };\n udbPlace.address = {\n addressCountry : $scope.newPlace.address.addressCountry,\n addressLocality : $scope.newPlace.address.addressLocality,\n postalCode : $scope.newPlace.address.postalCode,\n streetAddress : $scope.newPlace.address.streetAddress\n };\n udbPlace.mainLanguage = $translate.use() || 'nl';\n\n function showError() {\n $scope.saving = false;\n $scope.error = true;\n }\n\n function passOnPlaceData(eventFormData) {\n udbPlace.id = eventFormData.id;\n selectPlace(udbPlace);\n $scope.saving = true;\n $scope.error = false;\n }\n\n eventCrud\n .createOffer(udbPlace)\n .then(passOnPlaceData, showError);\n }", "title": "" }, { "docid": "d064a7c646d2f7bf07768582b78f299f", "score": "0.60091585", "text": "function handlePlaceSubmit(e) {\n e.preventDefault();\n\n addPopup.toggleButtonText();\n\n const {title: name, link} = addPopup.getInputValues();\n api.addCard({name, link})\n .then(data => gallerySection.addItem(data))\n .then(() => {\n addPopup.close();\n })\n .finally(addPopup.toggleButtonText)\n .catch(handleApiError);\n}", "title": "" }, { "docid": "20b971ab2bf93929ee0ba119aec752fc", "score": "0.5972881", "text": "function btnAddCity() {\n console.log(\"btn click\");\n // TODO: -> validate name makesure they type a good string\n var name = $(\"#city-name\").val();\n var formdata = {city_name : name};\n $.ajax({\n type: 'POST',\n url: 'http://localhost:8090/add-city',\n data: JSON.stringify(formdata),\n success: function (data) {\n console.log(data);\n $(\"#outputDELETE\").html(\"city was added\");\n }\n });\n}", "title": "" }, { "docid": "e8aa12db965c5093ce52f5472b1ba752", "score": "0.59716195", "text": "function submit() {\r\n let url = TRAVEL_URL;\r\n let fields = qsa(\"#add input\");\r\n let place = fields[0].value;\r\n let country = fields[1].value;\r\n let interests = qs(\"textarea\").value;\r\n if (place && country && interests) {\r\n let params = new FormData();\r\n params.append(\"place\", place);\r\n params.append(\"country\", country);\r\n params.append(\"interests\", interests);\r\n fetch(url, {method: \"POST\", body: params})\r\n .then(checkStatus)\r\n .catch(console.error);\r\n }\r\n getTable(\"all\");\r\n }", "title": "" }, { "docid": "e36561b32f3398b82ffa1cfcbbaadd78", "score": "0.5912291", "text": "function submit_addhike() {\n //need to change some of the variable names so that the post request will work\n var formData = $('#addhikeform').serialize();\n console.log(formData);\n $.post( \"http://ancient-lake-4187.herokuapp.com/sendLocation\", formData, function( data ) {\n console.log( \"data is back!\");\n console.log( data );\n }, \"json\");\n clearUserMarker();\n}", "title": "" }, { "docid": "2583577242f3a299f9cc78d00db47146", "score": "0.59113336", "text": "postCords() {\n const { lat, long } = this.state;\n const loc = { lat, long };\n const url = \"https://fierce-crag-41814.herokuapp.com/add\";\n const conf = {\n method: \"post\",\n body: JSON.stringify(loc),\n headers: new Headers({ \"Content-Type\": \"application/json\" })\n };\n if (loc.lat === null || loc.long === null) {\n alert(\"You haven't accepted the geo request!\");\n } else {\n if (window.confirm(\"Please Confirm Coordinate Submission\")) {\n fetch(url, conf).then(response => console.log(response)),\n this.refs.btn.setAttribute(\"disabled\", \"disabled\");\n }\n }\n }", "title": "" }, { "docid": "129c6c7c4d50aab7fb4aabba7035c0bf", "score": "0.58689374", "text": "function postLocation(geoLocationObj) {\n console.log(\"postLocations = \" + geoLocationObj);\n console.log(\"postLocations.place = \" + geoLocationObj.place);\n console.log(\"postLocations.lat = \" + geoLocationObj.lat);\n console.log(\"postLocations.lang = \" + geoLocationObj.lang);\n\n const place = geoLocationObj.place;\n const latitude = geoLocationObj.lat;\n const longitude = geoLocationObj.lang;\n\n $.post(\"/api/location\", {\n place: place,\n latitude: latitude,\n longitude: longitude\n })\n .then(function (data) {\n // window.location.replace(\"/user_journal\");\n });\n}", "title": "" }, { "docid": "a6d6b016704e7cce6d1b7e789b282f32", "score": "0.5847463", "text": "function addData(coords) {\n fetch('/addData', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(coords)\n });\n}", "title": "" }, { "docid": "0616e7eb7db087f0edf1979e2ad87de3", "score": "0.58230305", "text": "function sendRequest(){\n const values = getValues();\n\n const name = values[0].value;\n const type = values[1].value;\n /*const lat = values[2].value;\n const long = values[3].value;*/\n\n routes.postData('http://localhost:3000/api/postFood', {\n name,\n type\n /*lat,\n long*/\n });\n}", "title": "" }, { "docid": "0cad1cf22e927d12b2c74d5c0634318d", "score": "0.5782413", "text": "async function addPoint(){\n const lat = markerTemp[0].latitude;\n const lng = markerTemp[0].longitude;\n const name = markerName;\n const apiCClient = create({\n baseURL:\n \"https://www.google.com/url?sa=i&url=https%3A%2F%2Fwww.nu.ac.th%2F%3Fpage_id%3D6297&psig=AOvVaw0EKVnsMbcReiaVPMtuUEFL&ust=1607325328545000&source=images&cd=vfe&ved=0CAIQjRxqFwoTCPDXq83nuO0CFQAAAAAdAAAAABAD\" + lat + \"&lng=\" + lng + \"&name=\" + name,\n });\n const sendPoint = () => apiCClient.get();\n const response = await sendPoint();\n showCollectPoint();\n }", "title": "" }, { "docid": "949c2eb46bcf190cc9731254c5809dab", "score": "0.5776837", "text": "function saveResult(place) {\n // console.log(place.name);\n // console.log(place.website);\n const saveUrl = document.createElement(\"a\");\n let website = place.website;\n saveUrl.textContent = place.name;\n saveUrl.setAttribute(\"href\", website);\n const saveLi = document.createElement(\"li\");\n saveLi.append(saveUrl);\n savedList.append(saveLi);\n\n let saveData = {\n name: place.name,\n website: website,\n }\n console.log(saveData);\n // calling post function\n postData(saveData);\n}", "title": "" }, { "docid": "751a8a45530fd1cbb55e9ca869439c26", "score": "0.5766502", "text": "function addItem(resource, url) {\n $.ajax({\n type: 'POST',\n url: getApiURL(resource),\n data: JSON.stringify({ \"url\" : url, \"user\" : getResourceURI()}),\n contentType:'application/json',\n dataType: 'application/json',\n processData: false,\n });\n}", "title": "" }, { "docid": "4ee7d95b0d9f42e9d6b60dc93e824fbc", "score": "0.57557875", "text": "function findOrCreateLocation(locName, lat, long, tide, tideHeight){\n fetch(`http://localhost:3000/locations`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Accepts': 'application/json'\n },\n body: JSON.stringify( {\n name: locName,\n lat: lat,\n long: long\n })\n })\n .then(resp => resp.json())\n .then(json => fetchTides(json, tide, tideHeight))\n //add step to confirm id isn't null in the json data\n}", "title": "" }, { "docid": "a9eb632d9dd1558b92dd81dd73df5b72", "score": "0.57450366", "text": "function submit(){\n const loc = document.getElementById('up-c-dropdown_elem').value;\n const search = document.getElementById('up-c-search_elem').value;\n const placeUrl = url + \"?location=\" + loc + \"&search=\" + search;\n\n removeBoxes();\n loadPlaces(placeUrl);\n}", "title": "" }, { "docid": "182ae8b2b0ef3e57da2f884850d1a480", "score": "0.5731057", "text": "function sendRequest (place) {\n\tvar placeName = place;\n\tcreateXMLHttpRequest();\n\tvar url = \"place.do\";\n\tXMLHttpReq.open(\"POST\",url,true);\n\tXMLHttpReq.setRequestHeader(\"Content-Type\",\"application/x-www-form-urlencoded\");\n\tXMLHttpReq.onreadystatechange=processResponse;\n\tXMLHttpReq.send(\"placeName=\"+placeName);\n}", "title": "" }, { "docid": "bd5818e94cac9b0a5af5f8cc7d777254", "score": "0.5727877", "text": "function addLocation() {\n // Hide the dialog\n toggleAddDialog();\n // Get the selected city\n const select = document.getElementById('selectCityToAdd');\n const selected = select.options[select.selectedIndex];\n const geo = selected.value;\n const label = selected.textContent;\n const location = {label: label, geo: geo};\n // Create a new card & get the weather data from the server\n const card = getForecastCard(location);\n getForecastFromNetwork(geo).then((forecast) => {\n renderForecast(card, forecast);\n });\n // Save the updated list of selected cities.\n thisApp.selectedLocations[geo] = location;\n saveLocationList(thisApp.selectedLocations);\n}", "title": "" }, { "docid": "84f7df40b6800f713d65d9f14201d4e4", "score": "0.5698534", "text": "function insertPoints(){\n var polygonArea = $('#polygonArea').val();\n if(pointsMaker.length > 2){\n pointsMaker.push(pointsMaker[0]);\n var all_points = 'POLYGON((' + pointsMaker[0].lat + ' ' + pointsMaker[0].lng;\n for (var i = 1, len = pointsMaker.length; i < len; i++) {\n all_points += ','+pointsMaker[i].lat+' '+pointsMaker[i].lng\n }\n all_points += '))';\n console.log(all_points);\n $.ajax({\n url: 'map/zone/store',\n type: \"POST\",\n data: {polygon: all_points,area: polygonArea},\n success: function (response) {\n console.log(response);\n },\n error: function (e) {\n console.log(e);\n }\n });\n }\n}", "title": "" }, { "docid": "cb5eb27f0ec692ccc7cea23aac5bae51", "score": "0.5673331", "text": "postLocation() {\n fetch('/coordinates', {\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n method: 'POST',\n body: JSON.stringify({\n longitude: this.state.longitude,\n latitude: this.state.latitude,\n trackID: this.state.trackID\n })\n })\n .then(function(body) {\n console.log(body);\n });\n }", "title": "" }, { "docid": "7b904377187264bc0fd1c6814fbb75b5", "score": "0.56578", "text": "function addProductArea() {\n\tvar xhttp = new XMLHttpRequest();\n\tvar params = \"productArea=\" + arguments[0]\n\t\n\txhttp.open(\"POST\", baseAPI + \"/ProductAreas\", true);\n\txhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n\n\txhttp.onload = function(){ \n\t\talert (\"Success!\"); \n\t\tlocation.reload(); } // success case\n\txhttp.onerror = function(){ alert (xhttp.responseText); } // failure case\n\n\n\txhttp.send(params);\n}", "title": "" }, { "docid": "fc8199fae97c393638cdf12847d299c0", "score": "0.56432736", "text": "function postData(keywords, range, position) {\n var data = {\n keywords: keywords,\n range: range,\n position: {\n long: position.coords.longitude,\n lat: position.coords.latitude\n }\n }\n\n fetch('http://localhost:5000/api/sendDetails',\n {\n method: 'POST',\n body: JSON.stringify(data),\n headers:{\n 'Content-Type': 'application/json'\n }\n }).then(res => res.json())\n .then(response => handleResponse(response))\n .catch(error => handleResponse({\"restaurants\":[]}));\n}", "title": "" }, { "docid": "3a611ab22d88a947d4f1c14d45d2116d", "score": "0.5626821", "text": "handleClick() {\n let url = '/nearby';\n let dataToSend = {\n latLng: this.state.locationTrue,\n type: 'bar'\n };\n Axios.post(url, dataToSend)\n .then( (response) => {\n console.log(\"/nearby post succeeded: \", response.data);\n this.clickToMap(response.data);\n })\n .catch( (response) => {\n console.log(\"Error getting nearby!\");\n });\n }", "title": "" }, { "docid": "eed43e10707254646de3a76af9f7f21d", "score": "0.5594452", "text": "function addToDb(id) {\n num = id.split(\"_\")[0];\n if(clicks.get(\"quote_\" + num) === true){\n return\n }\n let quote = document.getElementById(num + \"_quote\").value\n let author = document.getElementById(num + \"_author\").value\n let json = {\"author\" : author, \"quote\": quote};\n quotes.set(\"quote_\" + num, json);\n http.open(\"POST\", \"https://www.erikgolke.com/admin/add\")\n http.setRequestHeader('Access-Control-Allow-Headers', '*');\n http.setRequestHeader('Content-type', 'application/json');\n http.setRequestHeader('Access-Control-Allow-Origin', '*');\n http.send(JSON.stringify(json));\n clicks.set(\"quote_\" + num, true);\n}", "title": "" }, { "docid": "9a9b35a3f37935e446b7395e993a8f7b", "score": "0.559246", "text": "create({ body }, res) {\n\t\tbody.id = addresses.length.toString(36);\n\t\taddresses.push(body);\n\t\tres.json(body);\n\t}", "title": "" }, { "docid": "97002c56f2f4cd81d5032cabce74c33d", "score": "0.5590182", "text": "handleSubmit(e) {\n let type = \"\";\n switch (this.state.type) {\n case \"Foodbank\":\n type = \"foodbank\";\n break;\n case \"Store\":\n type = \"store\";\n break;\n case \"Testing Center\":\n type = \"testing_site\";\n break;\n default:\n break;\n }\n\n e.preventDefault();\n\n fetch(\"./api/add_resource\", {\n method: \"POST\",\n headers: {\n \"Content-type\": \"application/json\",\n },\n body: JSON.stringify({\n name: this.state.name,\n type: type,\n address: this.state.address,\n }),\n })\n .then((response) => {\n if (response[\"ok\"] === false) {\n alert(\"Please enter a valid name and address.\");\n return;\n }\n this.props.getLoc();\n this.props.onClick();\n })\n .catch((error) => {\n console.log(error);\n });\n }", "title": "" }, { "docid": "a2697aac5fc7bf0bd1055cafa0c40390", "score": "0.55898476", "text": "function addShoe() {\n const itemData = {\n status: \"AVAILABLE\",\n askingPrice: askingPrice,\n boughtPrice: boughtPrice,\n name: name,\n model: model,\n category: \"SHOE\",\n brand: brand,\n size: size,\n seller: id,\n };\n\n const api = axios.create({\n baseURL: \"http://127.0.0.1:8000/api\",\n headers: {\n \"Content-type\": \"application/json\",\n },\n });\n\n api\n .post(`/shoes/`, itemData)\n .then((response) => {\n retrieveItems();\n })\n .catch((e) => console.log(e));\n }", "title": "" }, { "docid": "6baa0c4f1ad4a1507d6daecc52b8d8ec", "score": "0.5585767", "text": "function addLocation() {\n var newLocationName = prompt(\"Wie heisst der neue Ort\", \"\");\n if (!(newLocationName == null || \"\")) {\n addCheckboxes([newLocationName]);\n let id = storage.addLocation(newLocationName);\n storageService.addNewPlace(id, newLocationName);\n }\n}", "title": "" }, { "docid": "129110134ac7bde4239cf2d373eb29ae", "score": "0.5584134", "text": "function addRout(request, response) {\r\n let search_query = request.query.city;\r\n let formatted_query = request.query.formatted_query;\r\n let latitude = request.query.lat;\r\n let longitude = request.query.lon;\r\n let SQL = 'INSERT INTO locations (search_query,formatted_query,latitude,longitude) VALUES ($1,$2,$3,$4);';\r\n let safeValues = [search_query, formatted_query, latitude, longitude];\r\n client.query(SQL, safeValues)\r\n .then(results => {\r\n response.status(200).json(results.rows);\r\n })\r\n .catch(() => server.use((error, req, res) => {\r\n res.status(500).send(error);\r\n }));\r\n}", "title": "" }, { "docid": "34f265bd25eb69c9937676ed1d0d17e3", "score": "0.55465573", "text": "function postRestaurant(restaurantObj) {\n $.ajax({\n url: \"/restaurants\",\n method: \"POST\",\n data: restaurantObj\n }).done(function() {\n console.log(\"restaurant added\")\n });\n}", "title": "" }, { "docid": "a77a84827b99797dbb6439308bbe98ee", "score": "0.5531693", "text": "function doAddPlaceClick() {\n\t// load the table controller and call the index method\n\tvar placeController = Alloy.getController('place');\n\n\t// pass in the tab since we are faking a navigation controller\n\tplaceController.create($.tab1);\n}", "title": "" }, { "docid": "b693dae062a910373650c40e29b344ea", "score": "0.55054116", "text": "function addData(req, res){\n //projectData.latitude = req.body.latitude[0];\n //projectData.longitude = req.body.latitude[1];\n projectData.latitude = req.body.latitude;\n projectData.longitude = req.body.longitude;\n projectData.country = req.body.country;\n res.send(projectData);\n}", "title": "" }, { "docid": "c488957f968815788cadc0b4c2c295c8", "score": "0.5504726", "text": "function addwine(name,variety,year,description,price,id){\n console.log(\"Wine Submitted\");\n $.post(\"/api/addwine/\", {\n winename:name,\n variety:variety,\n year:year,\n description: description,\n price: price,\n WineryId: id,\n }).then(function(data){\n console.log(data)\n window.location.reload();\n }).catch(function(){\n console.log(\"API failure\")\n });\n }", "title": "" }, { "docid": "a3463aed1fe894355513d2d5173308ee", "score": "0.54955757", "text": "async saveFeatures({commit},payload){\n\n return await this.$axios.post(API.DASHBORD_PLACE_FEATURE_SAVE_URL(payload.place_slug),payload)\n \n }", "title": "" }, { "docid": "f271bb36adcec7ac96d4722c8550efc1", "score": "0.5495525", "text": "function createPoint(mapid, pointInfo) {\n $.ajax({\n method: 'POST',\n url: '/api/maps/' + mapid +'/points',\n data: pointInfo\n }).done(checkMap(mapid));\n}", "title": "" }, { "docid": "fa14920eabffd311e013f3f4f66fa9c6", "score": "0.5495287", "text": "function addNewDestination() {\n\n var locationID = document.getElementById(\"locationID\").value;\n var nameD = document.getElementById(\"nameD\").value;\n var descriptionD = document.getElementById(\"descriptionD\").value;\n var latD = document.getElementById(\"latD\").value;\n var longD = document.getElementById(\"longD\").value;\n\n $(\"#addNewDestination\").modal(\"hide\");\n showLoadingOverlay();\n jQuery.ajax({\n type: \"GET\",\n url: 'http://travelsl.herokuapp.com/user/addNewDestination',\n dataType: 'jsonp',\n data: { locationID:locationID , nameD:nameD, descriptionD:descriptionD , latD:latD , longD:longD },\n success: function (obj, textstatus) {\n\n //hide ladd new location window\n $(\"#addNewDestination\").modal(\"hide\");\n\n hideLoadingOverlay();\n window.location.href = \"destination.html\";\n\n\n }\n });\n}", "title": "" }, { "docid": "341b4c52751bd3032808ee7118f2af94", "score": "0.549423", "text": "static async add(data) {\n\n const result = await fetch(`${BASE_API_URL}/${data.type}s`, {\n method: \"POST\",\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(data)\n });\n if (!result.ok) {\n throw new Error(`An error has occured: ${result.status}`);\n }\n const json = await result.json();\n return json;\n }", "title": "" }, { "docid": "a5e82c21d9cd0cbd91562dd8b46a8598", "score": "0.5491858", "text": "function createParish() {\n\n const parishObject = {\n \"parishName\": \"Rud\",\n \"parishCode\": 8144,\n \"parishInhabitants\": 314,\n \"parishNumberOfIncidents\": 955.41,\n \"parishNumberOfNewInfected\": 3,\n \"parishPercentageOfInfected\": 7.69,\n \"parishUnderAutomaticLockdown\": false,\n \"parishDateOfAutomaticLockdown\": null,\n \"municipality\": {\n \"municipalityName\": \"Favrskov\",\n \"municipalityCode\": 710\n }\n }\n const parishBody = JSON.stringify(parishObject);\n\n const insertParishUrl = \"/api/create-parish\";\n\n const requestObject = {\n headers:{\n 'Content-Type':'application/json',\n },\n method:'POST',\n body: parishBody\n };\n\n fetch(insertParishUrl, requestObject)\n .then(response => response.json());\n}", "title": "" }, { "docid": "860e224fd5eecf8c2d2829a784db7e1c", "score": "0.548947", "text": "submitForm(e) {\n e.preventDefault();\n const data = {\n species: $('#speciesSelect').val(),\n description: $('#descriptionText').val(),\n dateTime: new Date($('#dateInput').val() + 'T' + $('#timeInput').val()).toISOString(),\n count: parseInt($('#countNumber').val(), 10),\n latitude: ($('#latitudeInput').val() !== \"\") ? $('#latitudeInput').val() + $('#latitudeChar').val() : null,\n longitude: ($('#longitudeInput').val() !== \"\") ? $('#longitudeInput').val() + $('#longitudeChar').val() : null,\n };\n fetch('http://localhost:8080/sightings', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(data),\n }).then(response => this.onSubmitSuccess(response));\n }", "title": "" }, { "docid": "a12ba1252073ae6bb84d39752b9f982b", "score": "0.5483869", "text": "addTraining(training) {\n fetch('https://customerrest.herokuapp.com/api/trainings',\n {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(training)\n })\n .then(\n toast.success(\"New training added!\", {\n position: toast.POSITION.TOP_LEFT\n })\n )\n \n .catch(err => console.error(err))\n }", "title": "" }, { "docid": "3ddcd52564c182bf5eaaaf5f58065317", "score": "0.54825586", "text": "function postData() {\n geodude.query(getVal('postLoc'), function(error, result){\n if (!error){\n var location = {lat: result.latlng[1], lng: result.latlng[0]};\n var fd = new FormData();\n var req = new XMLHttpRequest();\n fd.append(\"name\", getVal(\"postName\"));\n fd.append(\"location\", JSON.stringify(location));\n fd.append(\"city\", getVal('postLoc'));\n fd.append(\"url\", getVal('postLink'));\n fd.append(\"desc\", getVal('postDescrip'));\n fd.append(\"grabbers\", getVal('postGrabbers'));\n fd.append(\"resistance\", getVal('postResistance'));\n fd.append(\"user\", getVal('postEmail'));\n //TODO: this is right now sending to public insert - whenever admin insert is handled it's slightly different and published needs to be validated\n req.open('POST', '/publicInsert', true);\n req.addEventListener('load', function(e){\n //error_handle\n if(e.currentTarget.status == 200){\n window.alert(\"Thank you for your submission\");\n clearVal('postName');\n clearVal('postLink');\n clearVal('postLoc');\n clearVal('postDescrip');\n clearVal('postGrabbers');\n clearVal('postResistance');\n clearVal('postEmail');\n document.getElementById(\"share\").innerHTML = \"share\";\n $(actionBox).slideToggle(100, function(){\n document.getElementById('shareBox').style.display = \"none\";\n });\n\n } else {\n window.alert(e.srcElement.response);\n return;\n }\n });\n req.send(fd);\n } else {\n console.log(error);\n window.alert('Please enter a valid location');\n document.getElementById('postLoc').value = \"\";\n }\n });\n}", "title": "" }, { "docid": "df88104adf6d948ab955a09ab18dcb66", "score": "0.5481147", "text": "function postAPI() {\n console.log(amount, description, trip, username);\n fetch(\n `http://localhost:8080/postexpense?amount=${amount}&description=${description}&trip=${trip}&user=${username}`,\n {\n mode: \"no-cors\",\n method: \"POST\",\n }\n ).then((body) => {\n setExpenseposted(\"Expense posted.\");\n });\n }", "title": "" }, { "docid": "decbcadb7537ae42768cf448e3e7e873", "score": "0.54796845", "text": "function findPlaces() {\n\n // prepare variables (filter)\n var type = document.getElementById(\"gmap_type\").value;\n\n var lat = document.getElementById(\"lat\").value;\n var lng = document.getElementById(\"lng\").value;\n var cur_location = new google.maps.LatLng(lat, lng);\n\n // prepare request to Places\n var request = {\n location: cur_location,\n radius: 500,\n types: [type]\n };\n // prepare request to Firebase\n var request2 = {\n location: document.getElementById(\"map_loc\").value,\n types: document.getElementById(\"gmap_type\").value\n };\n // send request to Google \n service = new google.maps.places.PlacesService(map);\n service.search(request, createMarkers);\n //\"Firebase\"\n // Send new data to Firebase database\n database.ref().push(request2);\n //\"Firebase\"\n}", "title": "" }, { "docid": "06456de513ff0317e5ebb7b3a466b861", "score": "0.54597706", "text": "function postFeature(featureData, success, error) {\n\n var postData = {\n feature: featureData,\n datasetId: \"cj0ldpqfa00022xphwg2k355z\"\n }\n\n $.ajax({\n url:'http://lostplacesmap.org/api/dataset',\n type:\"POST\",\n data:JSON.stringify(postData),\n contentType:\"application/json\",\n dataType:\"json\",\n success: success,\n error: error\n })\n}", "title": "" }, { "docid": "a59ed81919f1cc08cf5248eb5205976e", "score": "0.54573", "text": "handleSubmit(event){\n console.log(\"aaaa\",1111)\n event.preventDefault();\n fetch('http://localhost:5000/api/station/',{\n method:'POST',\n headers:{\n 'Accept':'application/json',\n 'Content-Type':'application/json'\n },\n body:JSON.stringify({\n Latitude:event.target.Latitude.value,\n Longitude:event.target.Longitude.value,\n capacity: event.target.capacity.value,\n })\n })\n\n .then(function (response) {\n console.log(\"bbbb\",2222)\n alert(\"added successfully\");\n })\n .catch(function (error) {\n console.log(error);\n }); \n }", "title": "" }, { "docid": "39de89812a681d2f06d1facb5ee9491c", "score": "0.5456817", "text": "function setupForGetCoords() {\n var address = document.getElementById(\"address\").value;\n postParams = {\n 'address' : address\n }\n sendJsonRequest(postParams,'/get-coords', saveGarage)\n}", "title": "" }, { "docid": "3124b82b5e3cd9b0be66dbfda427c0b7", "score": "0.5451851", "text": "postLocations() {\n return; //remove this\n let seekerPos = this.board.seeker.getGeoPosition();\n let matchPos = this.board.match.getGeoPosition();\n axios.post(\"serverURL\", seekerPos);\n axios.post(\"serverURL\", matchPos);\n }", "title": "" }, { "docid": "24315910675e0f0c6f32c1bc107d8661", "score": "0.544615", "text": "add(newEmployee) {\n let me = this;\n try {\n $.ajax({\n url: `http://${me.Host}/${me.ApiName}`,\n method: 'POST',\n contentType: \"application/json ; charset=utf-8\",\n data: JSON.stringify(newEmployee), \n }).done(function (res) {\n $('.close-btn').trigger('click');\n me.loadData();\n }).fail(function () {\n err\n console.log(err);\n });\n } catch (e) {\n console.log(e);\n }\n }", "title": "" }, { "docid": "4d233b64acfaf51861db727c30493556", "score": "0.5430694", "text": "static placeOrder(obj) {\n\n const url = endPoint+\"mobilesalesapp_my_orders\";\n return axios.post(url, obj, { headers: { 'Authorization': basicAuth } });\n }", "title": "" }, { "docid": "c561cb1c59585177dcaa976436b8390e", "score": "0.54297346", "text": "async function addStore(e) {\n e.preventDefault();\n\n if (storeId.value === '' || storeAddress.value === '') {\n alert('Please fill in fields');\n }\n\n const sendBody = {\n storeId: storeId.value,\n address: storeAddress.value\n };\n\n try {\n const res = await fetch('/api/v1/stores', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(sendBody)\n });\n\n if (res.status === 400) {\n throw Error('Store already exists!');\n }\n\n alert('Store added!');\n window.location.href = '/index.html';\n } catch (err) {\n alert(err);\n return;\n }\n}", "title": "" }, { "docid": "381e4d3ddd3b6c4896289c58420252e9", "score": "0.5429538", "text": "function addItem() {\r\n\r\n const item = {\r\n name: $(\"#add-name\").val(),\r\n isComplete: false\r\n };\r\n\r\n $.ajax({\r\n type: \"POST\",\r\n accepts: \"application/json\",\r\n url: uri,\r\n contentType: \"application/json\",\r\n data: JSON.stringify(item),\r\n error: function (jqXHR, textStatus, errorThrown) {\r\n alert(\"Something went wrong!\");\r\n },\r\n success: function (result) {\r\n getData();\r\n $(\"#add-name\").val(\"\");\r\n }\r\n });\r\n}", "title": "" }, { "docid": "7e2344479aa6ddc71c9993bdd0c34a5e", "score": "0.5420314", "text": "function addElectronic() {\n const itemData = {\n status: \"AVAILABLE\",\n askingPrice: parseFloat(askingPrice).toFixed(2),\n boughtPrice: parseFloat(boughtPrice).toFixed(2),\n name: name,\n model: model,\n category: \"ELECTRONICS\",\n brand: brand,\n seller: parseInt(id),\n };\n\n const api = axios.create({\n baseURL: \"http://127.0.0.1:8000/api\",\n headers: {\n \"Content-type\": \"application/json\",\n },\n });\n\n api\n .post(`/electronics/`, itemData)\n .then((response) => {\n retrieveItems();\n })\n .catch((e) => console.log(e));\n }", "title": "" }, { "docid": "bb543f60bed00216d4867c729bf714fd", "score": "0.54091126", "text": "function saveAddressAndRender(latLng, addr, map) {\n var [lat, lng, address] = [addr.geometry.location.lat(), addr.geometry.location.lng(), addr.formatted_address];\n $.ajax({\n url: '/address/',\n data: {'lat':lat, 'lng': lng, 'address': address, 'place_id': addr.place_id},\n dataType: 'json',\n type: \"POST\",\n beforeSend: function(request) {\n request.setRequestHeader(\"X-CSRFToken\", csrf_token);\n },\n success: function (data, statusText, xhr) {\n console.log(xhr.status);\n if (xhr.status === 201) { // set marker if not a duplicate\n renderMarker(latLng, map)\n renderAddress(lat, lng, address);\n insertRowIntoGoogleFusionTable(lat, lng, address);\n }\n else if (xhr.status == 200) { console.log(\"Duplicate. Not created.\")}\n },\n });\n}", "title": "" }, { "docid": "8f9cb2ddafaaa602031a777a070c8243", "score": "0.5407723", "text": "function handleAddPlace() {\n $('main').on('click', '.js-trip-item-addPlace, .trip-item-add', function (e) {\n e.preventDefault();\n $('.popup-overlay-view-addPlaceForm, .popup-content-view-addPlaceForm').removeClass(\"active\");\n $('.popup-overlay-add-place, .popup-content-add-place').addClass(\"active\");\n $(\".box-parent\").addClass(\"inactive\");\n addPlaceForm();\n });\n\n}", "title": "" }, { "docid": "3e5b47923a50a63f15265dfb9876db6f", "score": "0.53970957", "text": "function addPokemon(e){\n const trainerId = e.target.dataset.trainerId\n\n fetch(POKEMONS_URL,{\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Accept': 'application/json'\n },\n body: JSON.stringify({ trainer_id: trainerId })\n })\n .then(function(res){\n return res.json()\n })\n .then(function(pokemon){\n const ul = e.target.parentElement.querySelector('ul')\n const li = createPokemonListItem(pokemon)\n ul.appendChild(li)\n })\n}", "title": "" }, { "docid": "5d290d2e504fda770bac95e32f0863dd", "score": "0.539684", "text": "function saveCar() {\n let values = {};\n values['make'] = document.getElementById(\"Make\").value;\n values['model'] = document.getElementById(\"Model\").value;\n values['plate'] = document.getElementById(\"Plate\").value;\n console.log(values);\n sendJsonRequest(values, '/add-car', saveCarCallback);\n}", "title": "" }, { "docid": "d637e8fd7fd7b41014ba7e9a53bb7c61", "score": "0.53926", "text": "function submitNewVenue(e) {\n e.preventDefault();\n\n let vname = document.getElementById('vname').value.toUpperCase();\n let postcode = document.getElementById('postcode').value.toUpperCase();\n if(vname === \"\" || postcode === \"\"){\n addVenueAlerter.alertError(\"All fields are required\")\n }\n else {\n sendRequestToAzure('https://cloudindividualprojectfa.azurewebsites.net/api/InsertNewVenue',\n (res) => res.status === 200 ? addUserAlerter.alertSuccess(\"Successfully added venue\") : res.status === 400 ? addUserAlerter.alertError(\"That is not a valid UK Postcode\") : addUserAlerter.alertError(\"Failed to add venue (\" + res.status + \")\"),\n JSON.stringify({\n vname: vname,\n postcode: postcode,\n }), false)\n }\n refreshVenueInputs();\n}", "title": "" }, { "docid": "7046e9c52c9e4a9705bd765d67ca3608", "score": "0.5392563", "text": "function storePlaces(keyword) {\n\n //find place from text\n //url = \"https://maps.googleapis.com/maps/api/place/findplacefromtext/json?input=The%20Peaks%20Hongkong&inputtype=textquery&fields=photos,formatted_address,name,rating,opening_hours,geometry&locationbias&key=AIzaSyASRZUnw8T0CsDlOI92HxIuyYglJRmPauQ\"\n\n\n //find places nearby\n radius = \"radius=5000\";\n type = \"type=store\";\n keyword = `keyword=${keyword}`;\n apiKey = \"key=AIzaSyASRZUnw8T0CsDlOI92HxIuyYglJRmPauQ\";\n\n\n placesUrl = \"https://cors-anywhere.herokuapp.com/https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=\" + lattitude + \",\" + longitude + \"&\" + radius + \"&\" + type + \"&\" + keyword + \"&\" + apiKey;\n // console.log(url);\n //console.log(placesUrl);\n //get data object\n $.ajax({\n url: placesUrl,\n method: \"GET\",\n // headers: { 'origin': null }\n }).then(function (response) {\n console.log(response);\n //console.log(response.results[0].geometry.location);\n //get names and locations of places\n for (var i = 0; i < response.results.length; i++) {\n //get locations from data\n var name = response.results[i].name;\n console.log(name);\n var location = response.results[i].geometry.location;\n console.log(location);\n\n\n //set marker position and name\n var marker = new google.maps.Marker({\n position: location,\n map: map,\n title: name\n });\n\n\n //add the marker to the map\n marker.setMap(map);\n\n }\n\n $(\".map-loader\").removeClass(\"active\");\n }).fail(function (error) {\n $('.map-modal')\n .modal({\n centered: false\n })\n .modal('show')\n ;\n // error handling\n });\n\n\n}", "title": "" }, { "docid": "a171d33d8f0be44f6721c8ff875a9898", "score": "0.53911227", "text": "function saveNewData(user, restaurants) {\n // Check to see how often this is clicked\n if (typeof ens_specialEvent != \"undefined\"){\n ens_specialEvent(\"Top 100 Restaurants 2018\",\"Button Click\",\"Save To List\");\n }\n \n var newSavedData = {\n \"edbId\":user,\n \"restaurants\":restaurants\n };\n $.ajax({\n method: \"POST\",\n data: JSON.stringify(newSavedData),\n contentType: \"application/json\",\n error: function(msg) { \n // console.log(\"Failed to save data\"); \n },\n url: \"https://hcyqzeoa9b.execute-api.us-west-1.amazonaws.com/v1/top100/2018/checklist\"\n });\n}", "title": "" }, { "docid": "28df54f6b7bcb12d12344e8473d8973e", "score": "0.53843707", "text": "function addVehicle(e) {\n e.preventDefault();\n\n const addVehicle = { auctionDate, vehicleType, brand, model, color, condition, Showroom, BranchContact }\n\n axios.post(global.APIUrl + \"/vehicle_add/addVehicles\", addVehicle).then(() => {\n\n Swal.fire({\n title: \"Success!\",\n text: \"Vehicle Request Added Successfully!\",\n icon: 'success',\n confirmButtonText: \"OK\",\n type: \"success\"\n }).then(okay => {\n if (okay) {\n window.location.href = \"/VehicleAdd\";\n }\n });\n\n\n }).catch((err) => {\n\n Swal.fire({\n title: \"Error!\",\n text: \"Please fill all the field!\",\n icon: 'error',\n confirmButtonText: \"OK\",\n type: \"success\"\n })\n })\n\n }", "title": "" }, { "docid": "ba6b74dd9de25a60b6d6d12b2ee371ff", "score": "0.5375215", "text": "function newRouteSubmit(e) {\n e.preventDefault();\n var $modal = $(\"#routeForm\");\n var $routeNameField = $modal.find(\"#routeName\");\n var $startLatField = $modal.find(\"#startLat\");\n var $startLonField = $modal.find(\"#startLon\");\n var $endLatField = $modal.find(\"#endLat\");\n var $endLonField = $modal.find(\"#endLon\");\n var $prosField = $modal.find(\"#pros\");\n var $consField = $modal.find(\"#cons\");\n\n var routeToPost = {\n route_name: $routeNameField.val(),\n start_point: $startLatField.val(),\n end_point: $startLonField.val(),\n waypointOne: $endLatField.val(),\n waypointTwo: $endLonField.val(),\n pros: $prosField.val(),\n cons: $consField.val()\n };\n\n console.log(\"route to post\", routeToPost);\n\n var routePostToServer = \"/api/routes\";\n\n $.post(routePostToServer, routeToPost, function(data) {\n console.log(\"Received data from post to /routes\", data);\n\n //Clear form\n $routeNameField.val(\"\");\n $startLatField.val(\"\");\n $startLonField.val(\"\");\n $endLatField.val(\"\");\n $endLonField.val(\"\");\n $prosField.val(\"\");\n $consField.val(\"\");\n\n $(\"#routeModal\").modal();\n });\n}", "title": "" }, { "docid": "57d085b458924e8ed545eecab93d53ad", "score": "0.5374547", "text": "addItem(item_id_fk,customer_id_fk){\n return fetch(`${config.API_ENDPOINT}/newitem`,{\n method: 'POST',\n headers: {\n 'content-type': 'application/json',\n },\n body: JSON.stringify({\n item_id_fk,\n customer_id_fk\n }),\n })\n .then(res =>\n (!res.ok)\n ? res.json().then(e => Promise.reject(e))\n : res.json()\n )\n }", "title": "" }, { "docid": "56576b08a009aba8ef67c5db5785bdf4", "score": "0.53743905", "text": "function postAI(AI){\n $.ajax({\n url: \"http://128.52.173.90/Tron/sprint_ec_openedx/EC/python/tron_adversarial_dist/register_results.py\",\n data: {operation: 'add_AI', data: JSON.stringify(AI)}\n })\n .done(function(data){\n console.log(data);\n });\n}", "title": "" }, { "docid": "6ecb49f5cf4982049fd2ee8c05a31ab7", "score": "0.5373673", "text": "function placeOrder(id) {\n // get the book info\n var book = bookshelf[id];\n var quantity = $('#num-' + id).val();\n const item = {\n 'item': book.title,\n 'quantity': quantity,\n 'cost': Math.round((book.price * quantity) * 100) / 100,\n 'pending': true\n };\n // send request\n $.ajax({\n type: 'POST',\n accepts: 'application/json',\n url: uri,\n contentType: 'application/json',\n data: JSON.stringify(item),\n error: function (jqXHR, textStatus, errorThrown) {\n alert(errorThrown);\n },\n success: function (result) {\n // if request was successfull, reload data\n getData();\n }\n });\n}", "title": "" }, { "docid": "096343fa05a3021d63a01720f870a24e", "score": "0.5373114", "text": "function postToDom(places) {\n const placesList = document.querySelector(\"#container2\");\n places.forEach(place => {\n placesList.innerHTML += `<li>${place.id} ${place.name} ${\n place.visa_required\n }\n <button id=\"editBtn\">Edit</button>\n <button id=\"deleteBtn\">Delete</button></li>`;\n });\n}", "title": "" }, { "docid": "50d0e3071d6198953bd015fcb59800b5", "score": "0.53709877", "text": "function placesURLBuilder(lat, long){\n var queryURL = \"https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=\"\n queryURL = queryURL+lat+\",\"+long+\"&radius=2000&type=movie_theater&key=\"+apiKey;\n placesAJAXCall(queryURL);\n }", "title": "" }, { "docid": "f629c887f1196c76a79e11e9ecfb8534", "score": "0.53648615", "text": "static post(url, data) {\n return api.fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8'\n },\n body: JSON.stringify(data)\n });\n }", "title": "" }, { "docid": "596429893b5dde05cc96668320aaf6c4", "score": "0.5363111", "text": "addNewSubmit() {\n axios.post('/memories/add', {\n title: this.state.title,\n description: this.state.description,\n latitude:this.props.latitude,\n longitude:this.props.longitude\n }).then(res => {\n this.setState({\n currentPage: 'home',\n })\n }).catch(err => console.log(err));\n }", "title": "" }, { "docid": "7df8e1e0501944062566f71b6ac77eef", "score": "0.5341817", "text": "function add(value){\n // let url = `/list`;\n // fetch(url,{\n // method:'POST',\n // body: taskArray\n // }) \n $.post(`/add`,{'body': value})\n}", "title": "" }, { "docid": "2f43199a97419689fb37d50d12ef244e", "score": "0.53405297", "text": "function setPostFeature(url, details)\n {\n\n var data = {'details': details};\n // calling ajax\n $.ajax({\n url: url,\n method: 'post',\n data: data,\n success: function(data)\n {\n // Takes a well-formed JSON string and returns the resulting JavaScript value.\n data = $.parseJSON(data);\n\n if(data.success !== undefined)\n {\n window.location.href = window.location;\n }\n },\n error: function()\n {\n alert('Something went wrong!');\n }\n });\n }", "title": "" }, { "docid": "83bfaf425a8e58127381c8231c4b9b26", "score": "0.53400844", "text": "static add(room) {\n return api.post(api.room.url, room);\n }", "title": "" }, { "docid": "d27c9ead6de1b6fac9f86f556ef0682b", "score": "0.53392005", "text": "static createFavorite(yelpApiId, callback) {\n var dataToSend = {\n 'yelpApiId': yelpApiId\n };\n\n //Ajax request to create new vacation for current user\n $.ajax({\n url: '/entertainment/createFavorite',\n method: 'POST',\n contentType: 'application/json',\n data: JSON.stringify(dataToSend)\n })\n .done(function(response) {\n response = JSON.parse(response);\n if (response.error) {\n callback(response.error, {});\n }\n else {\n // console.log(\"Response to createFavorite Function: \" + JSON.stringify(response));\n var newLocation = new Location(response);\n callback(null, newLocation);\n }\n })\n .fail(function(err) {\n callback(\"Ajax error\", {});\n })\n .always(function() {\n // console.log( \"Completed\" );\n });\n }", "title": "" }, { "docid": "06953b69de54430e6299f15e997a3444", "score": "0.53377634", "text": "function newLostItem() {\n title = document.getElementById('lostTitleField').value;\n c1 = document.getElementById('lostCat1Field');\n cat1 = c1.options[c1.selectedIndex].text;\n c2 = document.getElementById('lostCat2Field');\n cat2 = c2.options[c2.selectedIndex].text;\n desc = document.getElementById('lostItemDescField').value;\n date = document.getElementById('lostDateField').value;\n time = document.getElementById('lostTimeField').value;\n place = document.getElementById('lostPlaceField').value;\n\n dataToStore = {title:title,cat1:cat1,cat2:cat2,\n desc:desc,date:date,time:time,place:place,\n latitude:generalLat,longitude:generalLng,\n status:'lost'};\n\n $.ajax( \"/items/lost\", {\n type: \"post\",\n data: dataToStore,\n success: function(data){\n }\n });\n closeDynamicDiv();\n generalMarker.setMap(null);\n loadMarkers();\n}", "title": "" }, { "docid": "a2dcaf8be1be9b996b750d71d128f8c3", "score": "0.533083", "text": "function createNewTeam(newTeamName){\n fetch(`http://spotlight-api.local/addteam/${newTeamName}`);\n }", "title": "" }, { "docid": "405b864d61f83384cb6a0ac56e730f61", "score": "0.5327212", "text": "function handleSubmit() {\n // the new data getting pushed\n const newPlant = {\n name: formData.name,\n image: formData.image,\n price: parseFloat(formData.price)\n }\n\n fetch('http://localhost:6001/plants', {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(newPlant)\n })\n .then(resp => resp.json())\n .then(data => addPlant(data))\n }", "title": "" }, { "docid": "25d74ac56627d370c4481f167b868ac2", "score": "0.53265357", "text": "function place(data) {\n this.title = data.title;\n this.coordinates = data.coordinates;\n this.marker = addMarker(map, this.coordinates);\n this.content = data.content;\n this.venueId = data.venueId;\n}", "title": "" }, { "docid": "0c2cc8df2a4303661b060a008bc0bfb9", "score": "0.53263867", "text": "function createBooking(serviceAssetData) {\n // first create a booking\n var url = \"/booking\";\n var data = {\n booked_by: emailAddr\n };\n ajaxCallWithAuth(\"POST\", url, data, function(bookingData) {\n console.log(\"GET _SERVICE\");\n console.log(data);\n\n // Now create booking details\n getCurrentPosition(bookingData, serviceAssetData);\n }, \"return=representation\");\n\n\n}", "title": "" }, { "docid": "c8746bbf7943004d9c1e2fdbbdf3c19c", "score": "0.5323297", "text": "function postRooftop(name, address, image_url, website_url, description, neighborhood_id) {\n const bodyData = {name, address, image_url, website_url, description, neighborhood_id}\n\n fetch(endPoint, {\n method: \"POST\",\n headers: {\"Content-Type\": \"application/json\"},\n body: JSON.stringify(bodyData)\n })\n .then(response => response.json())\n .then(rooftop => {\n console.log(rooftop);\n\n const rooftopData = rooftop.data\n console.log(rooftopData)\n\n const newRooftop = new Rooftop(rooftopData, rooftopData.attributes)\n console.log(newRooftop)\n\n document.querySelector('#rooftop-container').innerHTML += newRooftop.render()\n\n createRooftopForm.reset();\n slowScroll()\n })\n}", "title": "" }, { "docid": "097a775b5e4688c0487daa34a316b834", "score": "0.53186524", "text": "function save_location(street_view)\n{\n obj = {\n \"latitude\": street_view.latitude,\n \"longitude\": street_view.longitude,\n \"heading\": street_view.heading,\n \"pitch\": street_view.pitch\n };\n dbParam = JSON.stringify(obj);\n xmlhttp = new XMLHttpRequest();\n xmlhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n return null;\n }\n }\n xmlhttp.open(\"POST\", \"save_street_view.php\", true);\n xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n xmlhttp.send(\"z=\" + dbParam);\n}", "title": "" }, { "docid": "fd11fbefb327145bcba63a36e9e445ae", "score": "0.5312945", "text": "async function addWeather() {\n const response = await fetch('/weather-add');\n const data = await response.text();\n }", "title": "" }, { "docid": "24f9c566c7226f099c0a185979330bb8", "score": "0.530904", "text": "function handleSubmit() {\n event.preventDefault()\n axios\n .get(`https://api.mapbox.com/geocoding/v5/mapbox.places/${searchText}.json?access_token=${process.env.MapBoxKey}`)\n .then(resp => {\n const postCodeViewPort = {\n ...viewPort,\n longitude: resp.data.features[0].center[0],\n latitude: resp.data.features[0].center[1]\n }\n setViewPort(postCodeViewPort)\n\n })\n }", "title": "" }, { "docid": "17bf4591f445d97d2381265c0b2c6388", "score": "0.52997845", "text": "async function PutAddress() {\n var mydata = {\n \"add1\": document.getElementById('input-payment-address-1').value,\n \"add2\": document.getElementById('input-payment-address-2').value,\n \"pincode\": document.getElementById('input-payment-postcode').value,\n \"city\": document.getElementById('input-payment-city').value,\n \"landmark\": document.getElementById('input-payment-landmark').value,\n \"mobile\" : document.getElementById('input-payment-phone').value\n }\n \n const proxyurl = \"\";\n const url = \"https://api.kitchenkartapp.in/api/users/address/\"+localStorage.getItem('UserId');\n $.ajax({\n url : proxyurl+url,\n type : 'PUT',\n data : JSON.stringify(mydata),\n contentType: 'application/json',\n success : function(result, status) {\n alert('Data Updated');\n },\n beforeSend: function(){\n console.log(\"Sending...\");\n }\n });\n}", "title": "" }, { "docid": "afae4e5600fd62f2feafa7122c5500ab", "score": "0.5295709", "text": "function insertRoomInfo(roomInfo) {\n var options = {\n uri: 'https://sizzling-heat-271.firebaseio.com/rooms.json',\n method: 'POST',\n json: roomInfo\n };\n\n request(options, function(error, response, body) {\n if (!error && response.statusCode == 200) {\n console.log(body.id) // Print the shortened url.\n }\n });\n}", "title": "" }, { "docid": "cfaa83e0b7f79e8e825dc07d042965e2", "score": "0.5294225", "text": "_newPlace() {\n setTimeout(() => {\n let combobox = this.shadowRoot.querySelector('#placeSelection');\n\n if (combobox) {\n combobox.selectedItem = this.place.name;\n\n const url = this.place.name;\n\n this._changeUrl('place', url);\n this._store('place', this.place.name, this.place.coordinates);\n\n combobox.items = this._placeList();\n } else {\n // TODO: not sure if this is needed\n this._newPlace();\n }\n }, 0);\n }", "title": "" }, { "docid": "4d619ab49cc33723a70be41814a3e837", "score": "0.52937526", "text": "function WP_GEO_save_map()\n{\n\n\tvar params = WP_GEO_get_params_from_html();\n\t\n\tparams.id = 1;\n\n\tvar JSON_params = JSON.stringify(params);\n\t\n\tvar name = document.getElementById(\"geomap_map_name\").value;\n\t\n\tjQuery.post(\n\t\t\tajaxurl,\n\t\t\t{\n\t\t\t\t'action':'save_map',\n\t\t\t\t'data':JSON_params,\n\t\t\t\t'name':name\n\t\t\t},\n\t\t\tfunction(response)\n\t\t\t{\n\t\t\t\t\tWP_GEO_on_save_map_reponse(response,name);\n\t\t\t}\n\t);\n}", "title": "" }, { "docid": "55c13f45109a70917858269dc412e5dc", "score": "0.5291919", "text": "function savePlace(xhttp, i) {\n //parse answer\n var answer = JSON.parse(xhttp.responseText);\n //write answer into table\n places[i] = answer;\n}", "title": "" }, { "docid": "6a488d493788445a162b79902ebd31fa", "score": "0.5283817", "text": "function _addAddress() {\n console.log(vm.newAddress);\n vm.$AddressesService.createAddress(vm.newAddress, _createAddressSucccess, _createAddressfail)\n\n }", "title": "" } ]
c19ecd805105f7815778c2447a6c0e0c
send vote to the server
[ { "docid": "928b4e7ac25b4f013982b1c801c243ff", "score": "0.6841725", "text": "function sendScore() {\n\tif (this === votes[0]) {\n\t\tscoreObj = {\n\t\t\tleftUpVotes: 1\n\t\t};\n\t\tsocket.emit('upVote', scoreObj);\n\t} else {\n\t\tscoreObj = {\n\t\t\trightUpVotes: 1\n\t\t};\n\t\tsocket.emit('upVote', scoreObj);\n\t}\n}", "title": "" } ]
[ { "docid": "66dd9b69346bb2a016ffca0fec86ac2c", "score": "0.77384317", "text": "function sendVotes() {\n\tconsole.log('Emitting votes');\n\tsio.sockets.emit('liveVote', { 'votes': votes,\n\t 'title': title });\n}", "title": "" }, { "docid": "e04a3716219d6be94cbad11dc70e6257", "score": "0.73708755", "text": "function onVoteSuccess(data) {\n}", "title": "" }, { "docid": "0a642c0043d39d800647212e0052a706", "score": "0.7291545", "text": "function vote(){\n\tvar user = document.getElementById('user').innerText.trim();\n\tvar content = {};\n\tcontent[\"user\"] = user;\n\tvar xmlhttp;\n\tif (window.XMLHttpRequest) {\n\t\txmlhttp = new XMLHttpRequest();\n\t}else{\n\t\txmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t}\n\txmlhttp.onreadystatechange = function(){\n\t\tif (xmlhttp.readyState==4 && xmlhttp.status==200) {\n\t\t\tvar res = xmlhttp.responseText;\n\t\t\tvar res_dict = eval(\"(\" + res + \")\");\n\t\t\tvar available = res_dict[\"data\"][\"available\"];\n\t\t\tvar admin = res_dict[\"data\"][\"admin\"]\n\t\t\t// if there is no vote event\n\t\t\tif(available == 0){\n\t\t\t\tvar data = res_dict[\"data\"][\"data\"];\n\t\t\t\tmy_alert(data);\n\t\t\t\tvote_interactive(available, data, admin);\n\t\t\t}\n\t\t\t// if there is a current vote event\n\t\t\t// return the current and other votes' information\n\t\t\telse if(available == 1){\n\t\t\t\tvar data = res_dict[\"data\"][\"data\"];\n\t\t\t\t// my_alert(data);\n\t\t\t\tvote_interactive(available, data, admin);\n\t\t\t\treturn ;\n\t\t\t}else{\n\t\t\t\treturn ;\n\t\t\t}\n\t\t};\n\t}\n\txmlhttp.open(\"POST\", server+\"/vote\", false);\n\txmlhttp.setRequestHeader(\"Content-type\", \"application/json;charset=UTF-8\");\n\txmlhttp.send(JSON.stringify(content));\n}", "title": "" }, { "docid": "eefd63af2083942e0c1d541967befd83", "score": "0.7255813", "text": "function sendVote(card_id) {\n const vote = {\n type: MESSAGE_TYPE.VOTE,\n payload: {\n user_id: getElementFromCookies(\"userid\"),\n card_id: card_id\n }\n }\n conn.send(JSON.stringify(vote));\n \n // stop the timer once a vote has been made\n stopTimer();\n $(\".formSubmit\").val(\"Guess\");\n $(\"#stopwatchvalue\").html(\"Voted!\");\n}", "title": "" }, { "docid": "f188fb769a9206d893d9aaf8ffb12326", "score": "0.72282827", "text": "function vote(input_id) {\n\n $.get('server/voting_logic.php?id=' + input_id, function(result) {\n if (result) {\n console.log('Vote Logged! (+1)');\n getAllSnacks();\n } else {\n console.log('Error casting vote! :()');\n }\n }).catch(function(error) {\n console.log(\"Error\" + error.status);\n });\n\n\n}", "title": "" }, { "docid": "aba594bddbc200a3a9b00a12ecc113c5", "score": "0.70511436", "text": "function logVote(){}", "title": "" }, { "docid": "696b47a82f92afc3892d50cc8b7d43d4", "score": "0.704514", "text": "function _emitVote(answer) {\n\t\tsendMessage('PLAYER vote', {\n\t\t\tanswer: answer,\n\t\t});\n\t}", "title": "" }, { "docid": "6141bf6d88d90bd8870cdf2ba7f5feed", "score": "0.70440537", "text": "function ioSendVote(faker) {\n voted++;\n if (voted === 1) {\n document.querySelector(\"#\" + faker).style.outline = \"4px solid \" + cssColor;\n let voteData = {\n room: myRoom,\n voter: username,\n faker: faker\n };\n socket.emit(\"vote\", voteData);\n } else if (voted === 2) {\n templateCol(1, 7, 12, `<h4>${ifc.ingame.alreadyvoted[lang]}</h4>`);\n }\n}", "title": "" }, { "docid": "eb9034a496c766b7fe669ba4de412584", "score": "0.70378345", "text": "function vote (req, res) {\n var voteValue = req.body.vote > 0 ? 1 : req.body.vote < 0 ? -1 : 0;\n var promise = resStore.vote({\n resId: req.params.id,\n userId: req.user.userId,\n vote: voteValue\n });\n\n promiseResponse(promise, res);\n}", "title": "" }, { "docid": "84d304ac7d9d8f10d9a25ffe30252272", "score": "0.69825065", "text": "function register_vote(srcElem, vote_type, user_id, vote_id, vote_value)\n{\n\t\t\n\t// Send data to server side\n\t// Start the XMLHttpRequest\n\tvar xml = new XMLHttpRequest();\n\tvar method = \"POST\";\n\tvar url;\n\t\n\tif (vote_type === \"a\")\n\t\turl = \"/vote/answer-vote\";\n\telse if (vote_type === \"q\")\n\t\turl = \"/vote/question-vote\";\n\t\n\txml.open(method, url, true);\n\txml.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\t\n\t// Set the outbound values \n\tvar urlout = new URLSearchParams();\n\t\n\t// The outbound message\n\turlout.append('user_id', user_id);\n\t\n\tif (vote_type === \"a\")\n\t\turlout.append('answer_id', vote_id);\n\telse if (vote_type === \"q\")\n\t\turlout.append('question_id', vote_id);\n\t\n\turlout.append('vote', vote_value);\n\t\n\t// Send the message\n\txml.send(urlout);\n\t\n\tconsole.log(\"Sent \" + urlout + \" !\");\n\t\n\t// Wait for response\n\txml.onreadystatechange = function()\n\t{\n\t\tif (this.readyState == 4 && this.status == 200)\n\t\t{\n\t\t\tresponse(this, vote_id, vote_type);\n\t\t}\n\t};\n\t\t\n\n\t\n}", "title": "" }, { "docid": "c0c3e4fc8d94fb5a82f577ea015cb0b2", "score": "0.6975562", "text": "voteUp(e, myvote, rantid, userToken){\t\t\n\t\tif(typeof userToken !== 'undefined' && userToken !== \"\"){\n\t\t\tif(myvote == \"1\"){\n\t\t\t\tconsole.log(\"vote up\" , myvote, rantid, userToken);\n\n\t\t\t\tlet voteObj = {\n\t\t\t\t\t\"postId\": rantid,\n\t\t\t\t\t\"direction\": \"up\" \n\t\t\t\t}\n\n\t\t\t\tconst requestVoteUp = async () => {\n\t\t\t\t const response = await postActions.rantVote(userToken,voteObj);\n\t\t\t\t console.log(response);\n\t\t\t\t \n\t\t\t\t}\n\t\t\t\trequestVoteUp();\n\n\t\t\t}else{\n\t\t\t\tconsole.log(\"no vote up\");\n\t\t\t}\n\t\t}else{\n\t\t\tthis.props.dispatchShowLoginPopup();\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "028df8ed1fb935c3b77bc4ce2b1d57f7", "score": "0.6921551", "text": "submitVote() {\n if (!this.props.disabled && this.state.selected != \"\") {\n this.props.connection.send(JSON.stringify({Code: \"Submit Vote\", Pin: this.props.pin, Vote: this.state.selected,\n PlayerName: this.props.CurrentPlayer.Name, QuestionNumber: this.questionNumber}));\n }\n\n }", "title": "" }, { "docid": "b6b33758524c9b39a84ffb914d36474d", "score": "0.68585795", "text": "submitVote(event,index,name,socketID){\n\n\t\t// Prevent the button from performing regular functionality\n\t\tevent.preventDefault();\n\n\t\t// Emit to host about the vote that was just submitted\n\t\tsocket.emit('player:submit-vote',this.state.roomCode,index,name,socketID);\n\t}", "title": "" }, { "docid": "add173083183c9f58eac1e414a22782c", "score": "0.6854312", "text": "function submitVote(enteredAnswer) {\n\t\t_emitVote(enteredAnswer);\n\t}", "title": "" }, { "docid": "e8fc10f8311e3c1c8de642f4b783cb43", "score": "0.67872506", "text": "function vote(postID, bewertung) {\n\tlog(\"vote\", \"postID\", postID);\n\tlog(\"vote\", \"bewertung\", bewertung);\n\n// get the article reference number from the document.URL\n var arrayOfStrings = document.URL.split('/');\n\tlog(\"vote\", \"ref\", arrayOfStrings[3]);\n\tvar ref = arrayOfStrings[3];\n\n// construct the URL we will use to POST our vote\n\tvar url = \"http://\"+window.location.host+\"/?page=postbewerten&postID=\"+postID+\"&ref=\"+ref+\"&act=send\";\n\tlog(\"vote\", \"url\", url);\n\n var req = new XMLHttpRequest(); \n\n// votingComplete will be called, when we get our result (html-page, which closes the window).\n req.addEventListener(\"load\", function() {votingComplete(req,postID);}, false);\n\n req.open(\"POST\", url, true)\n\treq.setRequestHeader(\"Content-Length\", \"11\");\n\treq.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\n\treq.send(\"bewertung=\"+bewertung)\n\n}", "title": "" }, { "docid": "c895a9234bac149ddd9f8135f0431c54", "score": "0.672619", "text": "function vote(points){ \n var xhttp = new XMLHttpRequest();\n\t\n xhttp.onreadystatechange = function (){\t\n\tif(this.readyState === 4 && this.status === 200){\n processing.style.visibility= \"visible\"; \n setPoints();\n\t}\n };\n xhttp.open(\"POST\",\n\t\"http://localhost:8080/RecipeAPI/recipe-service/recipes/30/\"+points,\n\ttrue);\n \n // xhttp.open(\"GET\",\n//\t\"https://edu.oscarb.se/sjk15/api/recipe/?api_key=736ccc4bedd63f0c&recipe=kladdkaka&rating=\"+points,\n//\ttrue);\n xhttp.send();\n}", "title": "" }, { "docid": "d3b9e87a57d124d7395b6a1f38f95cef", "score": "0.671436", "text": "function updateVotes(e) {\n\t\t// retrieve song data\n\t\tvar song_id = _room.currentSong._id;\n\t\tvar song = _room.currentSong.metadata;\n\n\t\t// update the counters\n\t\tvar updateCounters = function(data) {\n\t\t\tvotes.current.score = 100 * (data.upvotes / (data.downvotes + data.upvotes));\n\t\t\tvotes.current.votes = data.upvotes + data.downvotes;\n\n\t\t\t// update current stats\n\t\t\t$('#tt2_stats_current_upvotes').text(data.upvotes);\n\t\t\t$('#tt2_stats_current_downvotes').text(data.downvotes);\n\t\t\t$('#tt2_stats_current_rating').text(votes.current.score + '%');\n\t\t\t$('#tt2_stats_current_votes').text(votes.current.votes);\n\n\t\t\t// update overall stats\n\t\t\t$('#tt2_stats_overall_upvotes').text(votes.upvotes);\n\t\t\t$('#tt2_stats_overall_downvotes').text(votes.downvotes);\n\t\t\t$('#tt2_stats_overall_rating').text(votes.score + '%');\n\n\t\t\t// update personal stats\n\t\t\t$('#tt2_stats_mine_votes').text(votes.mine.votes);\n\t\t\t$('#tt2_stats_mine_upvotes').text(votes.mine.upvotes);\n\t\t\t$('#tt2_stats_mine_downvotes').text(votes.mine.downvotes);\n\t\t\t$('#tt2_stats_mine_rating').text(votes.mine.score + '%');\n\t\t};\n\n\t\t// record a vote\n\t\tvar recordVote = function(data) {\n\t\t\t// the room users\n\t\t\tvar users = _room.users;\n\n\t\t\t// the voting user\n\t\t\tvar uid = data[0];\n\n\t\t\t// add to overall votes\n\t\t\tvotes.votes += 1;\n\n\t\t\t// ensure we have an object to track user voting\n\t\t\tif (!votes.user[uid]) {\n\t\t\t\tvotes.user[uid] = {\n\t\t\t\t\tsongs: 0,\n\t\t\t\t\tscore: 0,\n\t\t\t\t\tupvotes: 0,\n\t\t\t\t\tdownvotes: 0\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// if an upvote was cast\n\t\t\tif (data[1] == 'up') {\n\t\t\t\t// add to current upvoters\n\t\t\t\tvotes.current.upvoters[uid] = users[uid].name;\n\n\t\t\t\t// add to the user\n\t\t\t\tvotes.user[uid].songs += 1;\n\t\t\t\tvotes.user[uid].upvotes += 1;\n\t\t\t\tvotes.user[uid].score = Math.round(10000 * (votes.user[uid].upvotes / (votes.user[uid].downvotes + votes.user[uid].upvotes))) / 100;\n\n\t\t\t\t// add to overall\n\t\t\t\tvotes.upvotes += 1;\n\t\t\t\tvotes.score = Math.round(10000 * (votes.upvotes / votes.votes)) / 100;\n\n\t\t\t\t// if im djing\n\t\t\t\tif (isCurrentDj()) {\n\t\t\t\t\t// increment my total upvotes\n\t\t\t\t\tvotes.mine.votes += 1;\n\t\t\t\t\tvotes.mine.upvotes += 1;\n\t\t\t\t\tvotes.mine.score = Math.round(10000 * (votes.mine.upvotes / (votes.mine.downvotes + votes.mine.upvotes))) / 100;\n\n\t\t\t\t\t// add upvoter to my song\n\t\t\t\t\tvotes.mine.songs[song_id].upvoters[uid] = users[uid].name;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// add to current downvoters\n\t\t\t\tvotes.current.downvoters[uid] = users[uid].name;\n\n\t\t\t\t// add to the user\n\t\t\t\tvotes.user[uid].songs += 1;\n\t\t\t\tvotes.user[uid].downvotes += 1;\n\t\t\t\tvotes.user[uid].score = Math.round(10000 * (votes.user[uid].upvotes / (votes.user[uid].downvotes + votes.user[uid].upvotes))) / 100;\n\n\t\t\t\t// add to overall\n\t\t\t\tvotes.downvotes += 1;\n\t\t\t\tvotes.score = Math.round(10000 * (votes.upvotes / votes.votes)) / 100;\n\n\t\t\t\t// if im djing\n\t\t\t\tif (isCurrentDj()) {\n\t\t\t\t\t_log('I must be djing...');\n\n\t\t\t\t\t// increment my total downvotes\n\t\t\t\t\tvotes.mine.votes += 1;\n\t\t\t\t\tvotes.mine.downvotes += 1;\n\t\t\t\t\tvotes.mine.score = votes.mine.upvotes / (votes.mine.downvotes + votes.mine.upvotes);\n\n\t\t\t\t\t// add downvoter to my song\n\t\t\t\t\tvotes.mine.songs[song_id].downvoters[uid] = users[uid].name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// retrieve voters\n\t\tvar updateVotersList = function() {\n\t\t\tif (votes.current.upvoters.length) {\n\t\t\t\t$('#tt2_stats_current_upvoters').html('<li>' + votes.current.upvoters.join('</li><li>') + '</li>');\n\t\t\t}\n\t\t\tif (votes.current.downvoters.length) {\n\t\t\t\t$('#tt2_stats_current_downvoters').html('<li>' + votes.current.downvoters.join('</li><li>') + '</li>');\n\t\t\t}\n\t\t}\n\n\t\t_log('Performing vote updating actions.');\n\n\t\t// perform actions\n\t\tupdateCounters(e.room.metadata);\n\t\trecordVote(e.room.metadata.votelog[0]);\n\n\t\t// update list of voters\n\t\tupdateVotersList();\n\t}", "title": "" }, { "docid": "9efbd3f4d8e46f9444791bcdfac9d0c3", "score": "0.67091465", "text": "function postVote(req, res) {\n\t \tlet vote = new Vote();\n\t \tvote.voterID \t = req.body.voterID;\n\t \tvote.candidateID = req.body.candidateID;\n\t\tvote.electionID = req.body.electionID;\n\t\tvote.save(function(err) {\n\t\t\tif(err) {\n\t\t\t\tres.send(err);\n\t\t\t}\n\t\tres.json({ vote });\n\t});\n}", "title": "" }, { "docid": "70bb28c4e174302129f5006f0290512a", "score": "0.6699548", "text": "async function post_votes_to_server() {\n\n console.log(\"Posting votes server\");\n\n\n let votesObject = {votes: userVotes}\n console.log(votesObject);\n\n let endpoint = window.location.href + \"/submit_vote\";\n let response = await fetch(endpoint,{\n method:\"POST\",\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(votesObject)\n });\n\n let result = response.text();\n\n console.log(result);\n}", "title": "" }, { "docid": "42575217554948980b3f23e532f24436", "score": "0.6681136", "text": "function voteCallback(event) {\n var voteButton = event.currentTarget,\n otherId = voteButton.id.replace('up', '^^');\n otherId = otherId.replace('down', 'up');\n otherId = otherId.replace('^^vote', 'downvote');\n $('#' + voteButton.id).toggleClass(\"voted\");\n var otherButton = $(\"#\" + otherId);\n if (otherButton.hasClass('voted')) {\n otherButton.removeClass('voted');\n }\n\n $.ajax({\n url: '/vote/',\n method: \"POST\",\n data: {\n 'button': voteButton.id,\n },\n dataType: 'json',\n success: function (data) {\n $('#' + data.id).text(data.new_score);\n }\n });\n}", "title": "" }, { "docid": "5e47fab0ef419f1d9c61e1fd5573a7d1", "score": "0.6641217", "text": "function upvoted(id){\n console.log(loggedUser.uid);\n let element = document.querySelector(\"#\" + id);\n if (loggedUser.uid){\n // if user logged in send the server the data\n let datatosend = {\n remove: null, // what to remove\n add: null, // what to add\n score: 0 // score of that link\n }\n console.log(element.firstChild.style.borderColor)// == 'rgba(255, 0, 0, 0.822) transparent');\n if (element.firstChild.style.borderColor == 'rgba(255, 0, 0, 0.824) transparent'){\n // if arrow voted, then we need to remove the vote\n element.firstChild.style.borderColor = 'rgb(87, 87, 87) transparent';\n datatosend.remove = id;\n let score = parseInt(element.childNodes[1].textContent.split(' ')[2]);\n element.childNodes[1].textContent = 'Score : ' + (score - 1);\n datatosend.score = score - 1;\n }\n else {\n // else we need to add a vote\n element.firstChild.style.borderColor = 'rgba(255, 0, 0, 0.824) transparent'\n datatosend.add = id;\n let score = parseInt(element.childNodes[1].textContent.split(' ')[2]);\n element.childNodes[1].textContent = 'Score : ' + (score + 1);\n datatosend.score = score + 1;\n }\n $.ajax({\n // send the data as a POST request\n type: 'POST',\n url: 'changeVotes',\n data: datatosend,\n success: (res) => {\n console.log(res);\n }\n })\n }\n else {\n // Unlogged users can't use voting system\n alert('Log in first');\n }\n}", "title": "" }, { "docid": "6a95de72a4de4745b41cea4cb0fc5105", "score": "0.6622804", "text": "function upvote(id_comment)\n{\n $.post('vote.php', {id_comment : id_comment, vote : \"1\"});\n update();\n}", "title": "" }, { "docid": "3e6a56db0d968ad6b159b64d994e78fe", "score": "0.66096216", "text": "updateVotes(vote){\n\t\tif(vote == \"up\"){\n\t\t\tapplicationUsage.push({\n\t\t\t\t\"type\": \"Upvote\",\n\t\t\t\t\"postID\": 1,\n\t\t\t\t\"user\": \"ApplicationUser\"\n\t\t\t});\n\t\t}\n\t\telse {\n\t\t\tapplicationUsage.push({\n\t\t\t\t\"type\": \"Downvote\",\n\t\t\t\t\"postID\": 1,\n\t\t\t\t\"user\": \"ApplicationUser\"\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "1add9999dd51cacf553dc175e41aaf4e", "score": "0.6599472", "text": "async voteOnPost(value) {\n if (this.state.voteStatus === \"upvote\") {\n if (value === \"upvote\") {\n this.setState({ upvotes: this.state.upvotes - 1, voteStatus: \"none\" })\n } else {\n this.setState({ upvotes: this.state.upvotes - 1, downvotes: this.state.downvotes + 1, voteStatus: \"downvote\" })\n }\n } else if (this.state.voteStatus === \"downvote\") {\n if (value === \"upvote\") {\n this.setState({ upvotes: this.state.upvotes + 1, downvotes: this.state.downvotes - 1, voteStatus: \"upvote\" })\n } else {\n this.setState({ downvotes: this.state.downvotes - 1, voteStatus: \"none\" })\n }\n } else {\n if (value === \"upvote\") {\n this.setState({ upvotes: this.state.upvotes + 1, voteStatus: \"upvote\" })\n } else {\n this.setState({ downvotes: this.state.downvotes + 1, voteStatus: \"downvote\" })\n }\n }\n\n await authFetch('/api/post-vote/' + this.state.postId + \"?vote=\" + value);\n }", "title": "" }, { "docid": "050b139415b00f8eab2eeca12d4c35df", "score": "0.65463644", "text": "function yotpoReviewVote(review_id, vote_type) {\n\t\t\t$.ajax({\n\t\t\t\turl: 'https://api.yotpo.com/reviews/'+review_id+'/vote/'+vote_type+'',\n\t\t\t\ttype: 'POST',\n\t\t\t\tdata: JSON.stringify(data),\n\t\t\t\tdataType: 'json',\n\t\t\t\tcontentType: 'application/json',\n\t\t\t\tsuccess: function() {\n\t\t\t\t\tconsole.log('Review id: '+review_id+', Voted: '+vote_type+'');\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "7aae4dc2ec90790c9a18370d89729182", "score": "0.653585", "text": "function upvote() {\n $('.downvote-button').removeClass(\"highlighted\");\n $(this).addClass(\"highlighted\");\n $.ajax({\n type: \"POST\",\n url: \"/upvote\",\n data: { chop: $(this).attr('value') }\n }).done(function(msg) {\n //alert( \"Data Saved: \" + msg );\n if (msg == \"upvoted\"){\n $('span.votes').html(votes + 1);\n } else if (msg === \"upvoted2\") {\n $('span.votes').html(votes + 2);\n } else if (msg === \"not logged in\") {\n $('.upvote-button').removeClass(\"highlighted\");\n alert( \"You must be logged in to upvote\");\n }\n });\n}", "title": "" }, { "docid": "f5b2928194786f7fb258cb23a5f7bb60", "score": "0.6501688", "text": "function handleUpvote() {\n if (!isLoggedIn) {\n alert('You need to be logged in to vote');\n return;\n }\n if (myVote == 1) {\n myVote = 0;\n postVote(0);\n } else {\n myVote = 1;\n postVote(1);\n }\n updateMyVote();\n}", "title": "" }, { "docid": "17b24e5454786f34f5ba8ca91fe4845a", "score": "0.64938563", "text": "function set_vote(data){\n var set_flag = false;\n for (var userid in DB.clients){\n if (data.url in DB.clients[userid].favs){\n\t var voter = DB.clients[data.userid].username;\n DB.clients[userid].favs[data.url].votes[data.userid] = {'vote':data.vote,'username':voter};\n set_flag = true;\n }\n }\n\n if (set_flag){\n\tvar username = DB.clients[data.userid].username;\n return {'type':'vote_set', 'msg': username+' voted ('+data.vote+') for '+data.title+' from the favourites list.' , 'target': 'BROADCAST', 'orig_msg':data}; \n }\n else{\n return {'type':'error', 'msg':'cannot vote for the given url','target':data.userid,'orig_msg':data}; \n }\n}", "title": "" }, { "docid": "23d58c9eae38a9cf657c71bdb53914b1", "score": "0.64928854", "text": "function voteNoForReset() {\n tunnel.sendMessage(\"vote\", \"0\");\n}", "title": "" }, { "docid": "c5bbb8787f24b30ef44f64f472c1ff41", "score": "0.6475497", "text": "function vote(idClient, myChoice, idPoll, lang) {\n\n $.ajax({\n url: './ws/ajax_poll_vote.php',\n type: 'POST',\n data: {\n // MyChoice-1 because position start to 0 and button to 1\n choice: myChoice,\n idClient: idClient,\n idPoll: idPoll,\n lang: lang,\n action: 'client_vote',\n sesskey: $(\"#sesskey\").val()\n },\n beforeSend: function () {\n // Show loading message\n $('#loader').show();\n $('.toastBg').fadeIn(400)\n $('#myToast').fadeIn(400);\n $('#myToast').removeClass('toast');\n $('#myToast').addClass('toastLoading');\n $(\"#myToast span\").hide();\n },\n success: function (data, statut) {\n // Show sucess message\n $('#myToast span').html(\"\");\n $('#myToast span').text((data));\n $('#myToast').addClass('toast');\n $('#myToast').removeClass('toastLoading');\n $(\"#myToast span\").show();\n $('.toastBg').delay(1000).fadeOut(400);\n $('#myToast').delay(1000).fadeOut(400);\n },\n\n error: function (resultat, statut, erreur) {\n // Show error message\n $('#myToast span').html(\"\");\n $('#myToast span').text(\"Error\");\n $('#myToast').addClass('toast');\n $('#myToast').removeClass('toastLoading');\n $(\"#myToast span\").show();\n $('.toastBg').delay(1000).fadeOut(400);\n $('#myToast').delay(1000).fadeOut(400);\n },\n\n complete: function (resultat, statut) {\n }\n });\n}", "title": "" }, { "docid": "8ef866c602d29b40f98b5e1b121b6768", "score": "0.6465712", "text": "function vote($el) {\n var entryId = $el.data('entryid');\n var voteSpan = $el.parent().prev().children().last(); //Mmmm good 'ol jquery\n\n $.ajax(\"/api/v1/vote/\" + entryId, {\n type: \"POST\",\n\n success: function(response) {\n if(response.status === 1) {\n\n console.log(\"Yay\", response);\n var votes = parseInt(voteSpan.text()) + 1;\n voteSpan.text(votes);\n\n } else if (response.status === 0) {\n console.log(\"Oh no\" , response);\n }\n }\n })\n}", "title": "" }, { "docid": "b2847c37bd5bd0c94ac8d639327a4204", "score": "0.643995", "text": "function vote(voteInput) {\n //Return automatically if the database isn't ready yet\n if (!Session.get(\"dbReady\")) {\n return;\n }\n\n //register the user and input vote if the user hasn't registered in the\n //DB yet\n if (!REGISTERED) {\n initialUserRegistration(voteInput);\n Session.set(\"myVote\", voteInput);\n return;\n }\n\n mySavedVote = getUserVote( MY_USER_ID );\n\n //If user exists, but the vote was deleted by server, re-insert it\n if (!mySavedVote) {\n Votes.insert({\n user: MY_USER_ID, \n vote: voteInput, \n color: SERVER_COLOR\n });\n return;\n }\n\n\n //If user and vote exist, update the vote with the user's input\n if (voteInput != Session.get(\"myVote\")) {\n console.log(\"user and vote exist, updating vote to \" + voteInput);\n var dbID = Votes.findOne({user: MY_USER_ID})._id;\n Votes.update( \n {_id: dbID}, \n {$set: {\n vote: voteInput, \n color: SERVER_COLOR\n }\n }\n );\n Session.set(\"myVote\", voteInput);\n }\n}", "title": "" }, { "docid": "de698ec9ebdb59b641fafe24dc3c8b7e", "score": "0.6417642", "text": "upvoteComment(commentId, uid, articleId){\n this.socket.emit(\"upvote_comment\", {commentId: commentId, uid: uid, articleId: articleId})\n }", "title": "" }, { "docid": "f01e285b27b313532d1ccb837ebe2764", "score": "0.64065856", "text": "vote(rating) {\n if (!this.state.items.has_voted) {\n fetch('https://hello-swanson.herokuapp.com/api/rating', {\n //fetch('http://127.0.0.1:5000/api/rating', {\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n user_rating: rating,\n quote_id: this.state.items.id,\n has_voted: this.state.items.has_voted\n })\n });\n }\n this.setState({displayVoteMessage: true});\n }", "title": "" }, { "docid": "8dcab42b4de504c865c028ed77607a39", "score": "0.6399378", "text": "function vote(msg,voteAction){\r\n\tif(!votes[voteAction]){\r\n\t\tvotes[voteAction] = [msg.author.id];\r\n\t} else {\r\n\t\tvotes[voteAction].push(msg.author.id);\r\n\t}\r\n\t\r\n\tif(evaluteVote(msg, voteAction)){\r\n\t\tvotes[voteAction] = [];\r\n\t\treturn true;\r\n\t} else {\r\n\t\treturn false;\r\n\t}\t\r\n}", "title": "" }, { "docid": "73009a32bcf81b384142ab24efdd8e2f", "score": "0.6382426", "text": "static async changeVote(postId, direction) {\n try {\n const result = await axios.post(\n `${BASE_URL}/${postId}/vote/${direction}`,\n );\n return result.data.votes;\n } catch (err) {\n console.error(err);\n }\n }", "title": "" }, { "docid": "c31012e2aa09b7a76117b57a315b40f5", "score": "0.6377641", "text": "function handleVoteClick( e )\n{\n $.post( $( this ).attr( \"href\" ) , { \"qid\" : $( this ).data( \"qid\" ) } , function( data, status )\n {\n if ( data.qid == undefined )\n {\n console.log( \"BAD REQUEST,NO QID\" );\n return;\n }\n\n allQuotes[ data.qid ] = data;\n updateQuoteByScore( allQuotes, quotesByScore, data.qid );\n updateQuotesView( allQuotes, quotesByScore ); \n });\n\n e.preventDefault();\n return false;\n}", "title": "" }, { "docid": "25d8fcdfdeb203c2942725cfcc197ba9", "score": "0.63746446", "text": "function vote(req, res){\n\t\t// define the path logic for incrementing wins and loses\n\t\tvar def = {\n\t\t\t'/wins': {wins:1},\n\t\t\t'/loses': {loses:1}\n\t\t};\n\t\t// find image in the database to apply data\n\t\timages.find({name:req.body.image}, function(err, found){\n\t\t\t// if an entry is found update the image metadata and user information. Then redirect.\n console.log(found);\n\t\t\tif(found.length == 1){\n\t\t\t\timages.update(found[0], {$inc: def[req.path]});\n\t\t\t\tusers.update({ip:req.ip}, {$addToSet: {votes: found[0]._id}}, function(){\n\t\t\t\t\tres.redirect('../');\n\t\t\t\t});\n\t\t\t}\n\t\t\t// on error or null photo redirect\n\t\t\telse(res.redirect('../'));\n\t\t});\n\t}", "title": "" }, { "docid": "d1ac117e3ce3510e2dfed64b670f37e1", "score": "0.63698196", "text": "function vote() {\n let newVotedPosts = votedPosts.map(votedPost => {\n if(edge.node.slug === votedPost.id) {\n if(votedPost.isVoted) {\n votedPost.isVoted = false;\n votedPost.votes -= 1;\n }else {\n votedPost.isVoted = true;\n votedPost.votes += 1;\n }\n }\n return votedPost\n })\n setVotedPosts(newVotedPosts)\n }", "title": "" }, { "docid": "8fd4a9c3056a0071fb668bd29c74fdf9", "score": "0.63661766", "text": "function handleUpvote(event) {\n\n console.log('COUNT', count)\n event.preventDefault();\n const id = event.target.id;\n console.log(id);\n // const parent = document.getElementById(id);\n // const teamid = parent.getAttribute(\"value\");\n // const link = parent.getAttribute(\"link\");\n // const votes = Number(parent.getAttribute(\"votes\"));\n const votes = Number(event.target.getAttribute('votes'));\n // console.log('HERE',teamid);\n const payload = {\n \"_id\": id,\n \"votes\": votes,\n \"upvote\": true\n }\n console.log('payload:', payload)\n // POST the payload to database\n fetch(\"http://localhost:3000/resource/upvote\", {\n method: \"POST\",\n headers: {\n Accept: \"application/json, text/plain, */*\",\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(payload),\n })\n .then((response) => {\n return response.json();\n })\n .then((data) => {\n console.log('data sent back:', data);\n const newResource = _resource;\n for (let i = 0; i < newResource.length; i++) {\n if (newResource[i].link === data.link) {\n newResource[i] = data;\n }\n }\n setCount(count + 1);\n setResource(newResource)\n })\n .catch((err) => {\n console.log(\"Post Fail\", err);\n });\n }", "title": "" }, { "docid": "e968d995af988fb5a0f07a284748525d", "score": "0.63614017", "text": "function evaluteVote(msg, voteAction){\r\n\trefreshUser();\r\n\tvar all = user.length;\r\n\tvar voted = 0;\r\n\tuser.forEach(function(currentUser){\r\n\t\tif(votes[voteAction].indexOf(currentUser.id) > -1){\r\n\t\t\tvoted += 1;\r\n\t\t}\r\n\t});\r\n\tmsg.channel.sendMessage(voteAction + \": \" + voted + \" / \" + all);\r\n\treturn ((voted / all) >= 0.5);\r\n}", "title": "" }, { "docid": "4d5cfe59ebdf65e231304e113e57615b", "score": "0.63195294", "text": "function setVotes(currentsongid) {\r\n\r\n\r\n $.ajax({\r\n url: 'sql/setvote.php',\r\n type: 'POST',\r\n data: {currentsongid: currentsongid}//, \r\n });\r\n}", "title": "" }, { "docid": "53419036d65cfd843fea0231fc798621", "score": "0.6311742", "text": "function updateMyVote() {\n const upvoteBtn = document.getElementById('upvote-btn');\n const downvoteBtn = document.getElementById('downvote-btn');\n upvoteBtn.classList.remove('active');\n downvoteBtn.classList.remove('active');\n if (myVote > 0) {\n upvoteBtn.classList.add('active');\n } else if (myVote < 0) {\n downvoteBtn.classList.add('active');\n }\n const voteElement = document.getElementById('votes-num');\n voteElement.innerText = votes + myVote;\n}", "title": "" }, { "docid": "ec501b3a352a005f1377432655501d38", "score": "0.63059014", "text": "VoteHandler(animal){\n fetch(\"http://localhost:8080/vote\", {\n method: 'post',\n headers: {'Content-Type':'application/json'},\n body: JSON.stringify({\n \"animal\": animal\n })\n }).then(data => console.log(data));\n }", "title": "" }, { "docid": "763c40b1aefefba4f5c2bff1139e3c9b", "score": "0.6289982", "text": "function vote(obj){\n\t//console.log(this_inside)\n\t\t$.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: \"/vote/\",\n\t\t\tdata: obj[0],\n\t\t\tsuccess: function(post) {\n\t\t\t\t\n\t\t\t\tfunction confirmedVote(){\n\t\t\t\t\t////reset vote on ul data tag, reset all backgrounds to grey\n\t\t\t\t\tobj[1].parent().data(\"bind\", post.option);\n\t\t\t\t\tobj[1].parent().children('li').each(function(){\n\t\t\t\t\t\t $(this).children(\"div:first\").css({background:'#e6e6e6', color:'#b3b3b3'});\n\t\t\t\t\t});\n\n\t\t\t\t\t///check if post is deleted or not, style accordingly, set ul data tag to '' if deleted \n\t\t\t\t\tif(post.num < 0){\n\t\t\t\t\t\tobj[1].children(\"div:first\").css({background:'#e6e6e6', color:'#b3b3b3'}); //rgba(247, 245, 237,0.96)\n\t\t\t\t\t\tobj[1].parent().data(\"bind\", '');\n\n\t\t\t\t\t}else{\n\t\t\t\t\t\tobj[1].children(\"div:first\").css({background:'#f28c8c', color:'#ffffff'});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t\tif(post.t_check == \"warning\" && post.option == \"TR\" && post.num > 0){\n\t\t\t\t\talert_array = ['alert', post.message]\n\t\t\t\t\tmyAlert(alert_array)\n\t\t\t\t\tconfirmedVote()\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t}else if(post.t_check == \"restricted\" && post.option == \"TR\" && post.num > 0){\n\t\t\t\t\talert_array = ['alert', post.message]\n\t\t\t\t\tmyAlert(alert_array)\n\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\tconfirmedVote()\n\t\t\t\t}\n\t\t\t\t\n\t\t\t},\n\t\t\terror: function(XMLHttpRequest, textStatus, errorThrown) { \n\t\t\t\tconsole.log(XMLHttpRequest.responseText.slice(0,34));\n\t\t\t\t///////////this will return string 'IntegrityError' when the voter has voted for post already\n\n\t\t\t}\n\t\t});\n\t\n\t}//////////end of vote\t", "title": "" }, { "docid": "de0e3155503d1be3566acb71baf4b62a", "score": "0.6264511", "text": "function postVotingResults(){\n var request = new XMLHttpRequest();\n let requestURL = \"/dataComm/declareWinner\"\n request.open(\"POST\", requestURL);\n request.onreadystatechange = function () {\n // reload to get most recent state of the session\n window.location.reload();\n }\n request.onerror = function () {\n console.log('A post error is happening')\n }\n request.send(questionID);\n}", "title": "" }, { "docid": "f59f5c06c592336e853fee9251648658", "score": "0.62335724", "text": "function updateVotes() {\n // Cancel if updated during last 5 seconds\n if (Date.now() - votesLastUpdated < 5000) {\n return false;\n }\n\n console.log(\"Updating vote tally...\");\n jQuery.get(\"/robin/\", function(a) {\n var start = \"{\" + a.substring(a.indexOf(\"\\\"robin_user_list\\\": [\"));\n var end = start.substring(0, start.indexOf(\"}]\") + 2) + \"}\";\n list = JSON.parse(end).robin_user_list;\n votes.grow = list.filter(function(voter) {\n return voter.vote === \"INCREASE\";\n }).length;\n votes.stay = list.filter(function(voter) {\n return voter.vote === \"CONTINUE\";\n }).length;\n votes.abandon = list.filter(function(voter) {\n return voter.vote === \"ABANDON\";\n }).length;\n votes.abstain = list.filter(function(voter) {\n return voter.vote === \"NOVOTE\";\n }).length;\n\n var majority = userCount / 2;\n if (votes.grow > majority) {\n votes.action = \"Grow\";\n } else if (votes.stay > majority) {\n votes.action = \"Stay\";\n } else if (votes.abandon > majority) {\n votes.action = \"Abandon\";\n } else if (votes.abstain > majority) {\n votes.action = \"Abstain\";\n } else {\n vote.action = \"No majority\";\n }\n $('#robinVoteWidget .robin--vote-class--increase .robin-chat--vote-label').html('grow<br>(' + votes.grow + ')');\n $('#robinVoteWidget .robin--vote-class--abandon .robin-chat--vote-label').html('abandon<br>(' + votes.abandon + ')');\n $('#robinVoteWidget .robin--vote-class--novote .robin-chat--vote-label').html('no vote<br>(' + votes.abstain + ')');\n $('#robinVoteWidget .robin--vote-class--continue .robin-chat--vote-label').html('stay<br>(' + votes.stay + ')');\n $(\".usercount\").html('' + userCount + ' users in chat');\n $(\".timeleft\").html('' + howLongLeft() + '');\n $(\".nextround\").html('Next round we will ' + votes.action + '');\n //<br><span style=\\\"font-size: 14px;\\\">Users here: <span id=\\\"user-count\\\">0</span></span>\n //<br><span style=\\\"font-size: 14px;\\\">Time Left: <span id=\\\"time-left\\\">0</span></span>\n \n });\n \n votesLastUpdated = Date.now();\n return true;\n}", "title": "" }, { "docid": "306f1c0458c699bc3e1419149cbe1584", "score": "0.6231822", "text": "function addVote(type) {\n if (!voteTimeout) {\n voteTimeout = setTimeout(clearVoteTimeout, 500);\n if (type === 'positive') {\n p = p + 1;\n // firebase.database().ref('/positive/').set(p);\n } else if (type === 'negative') {\n n = n + 1;\n // firebase.database().ref('/negative/').set(n);\n }\n } else {\n console.log('vote ignored, too soon');\n }\n}", "title": "" }, { "docid": "2aa700fddb74f4c525600b133bfcd3b2", "score": "0.62219477", "text": "function voteForSong(song, playlist, vote) {\n var jsonDataObj = {\n 'playlist': playlist,\n 'songName': song,\n 'vote': vote\n };\n request.put({\n url: 'http://songapp.ddns.net:8000/api/vote',\n body: jsonDataObj,\n json: true\n }, function(error, response, body) {\n });\n}", "title": "" }, { "docid": "7e40e2efeb41554aede8c0ed7fcd47ed", "score": "0.62184566", "text": "function voteOnKitty(req, res) {\n\n const me = req.body.idme;\n const mate = req.body.idmate;\n const vote = parseInt(req.body.vote) > 0 ? 'liked' : 'disliked';\n\n Cat.findByIdAndUpdate(me, {vote: mate})\n}", "title": "" }, { "docid": "8ca932464a158bcafcc6187266eed05d", "score": "0.6216679", "text": "function submit(msgData, args){\n var user = msgData.author;\n\n //Get the id of the poll\n var ID = args.split(\" \")[1];\n\n //Get selected option\n var option = args.split(\" \")[0]\n\n //Submit vote\n votes.submit(ID,user.id, option);\n console.log(args+\"\\t\"+user.id);\n}", "title": "" }, { "docid": "f41ad0e1dfca8b134a030863bce2ed5d", "score": "0.620618", "text": "setVote(num) {\n this.elem.querySelector('.vote').textContent = num;\n const changeEvnt = new CustomEvent('change', {\n bubbles: true,\n detail: num,\n });\n this.elem.dispatchEvent(changeEvnt);\n }", "title": "" }, { "docid": "8d81cee8751bb96f8b8a2256c3316ab6", "score": "0.6199519", "text": "function vote() {\n let vote = new Array();\n for (let i = 0; i < checkboxes.length; i++) {\n if (checkboxes[i].checked) {\n vote.push(i);\n }\n }\n storageService.registerVoting(storage.getUsername(), vote);\n resultBtn.style.display = \"block\";\n voteBtn.style.transition = \"0s\";\n voteBtn.style.width = \"50%\";\n voteBtn.style.backgroundColor = \"var(--positive-background)\"\n setTimeout(hideGreen, 1000);\n}", "title": "" }, { "docid": "5b85aadcd11fa4af754d39077ad36b7d", "score": "0.61775994", "text": "function postEndVoting(){\n var request = new XMLHttpRequest();\n let requestURL = \"/dataComm/endVoting\"\n request.open(\"POST\", requestURL);\n request.onreadystatechange = function () {\n postVotingResults() //\n // reload to get most recent state of the session\n window.location.reload();\n }\n request.onerror = function () {\n console.log('A post error is happening')\n }\n request.send(questionID);\n}", "title": "" }, { "docid": "69bd71fbcab38b425272337f23a67509", "score": "0.61627835", "text": "function upvotecomment(temp, vote) {\n\n document.getElementById('up_vote_comment' + temp).innerHTML = vote + 1;\n\n var commentid = temp;\n\n $.ajax({\n method: \"POST\",\n url: 'http://127.0.0.1:8000/incrementvote',\n headers: {\n 'X-CSRF-TOKEN': $('meta[name=\"csrf-token\"]').attr('content')\n },\n data: {commentid: commentid}\n })\n .done(function (msg) {\n console.log(msg['message']);\n });\n}", "title": "" }, { "docid": "737466b500d54efaffc9eff9362f2f1a", "score": "0.6157213", "text": "function upvotePieps(piepsid) {\n\tconsole.log(\"Upvote\" + piepsid);\n\t$.ajax({\n\t\ttype : \"POST\",\n\t\turl : SERVER_URL + \"/lectures/\" + $('#currentLec').text() + \"/guesses/admin/\" + piepsid,\n\t\tdataType : \"json\",\n\t\tcontentType : \"application/json; charset=utf-8\"\n\t}).success(function(data, textStatus, jqXHR) {\n\t});\n}", "title": "" }, { "docid": "f1853b7461c79cd24ee8daf7546fc980", "score": "0.61538094", "text": "function voteSubmitter(data, callback) {\n callback(data);\n}", "title": "" }, { "docid": "cbcc62aa9ce5c618bffec3c6826ea119", "score": "0.6135134", "text": "function autovote(bot) {\n this.bot = bot;\n createdListener();\n}", "title": "" }, { "docid": "cf4a7bab84c192612c27b795b2e6937c", "score": "0.6125504", "text": "async function handleVote(choice) {\n\t\tconst voteBody = editingPollVote\n\t\t\t? {\n\t\t\t\t\tpollId: props.poll._id,\n\t\t\t\t\teditingPollVote,\n\t\t\t\t\toldIndex: parseInt(\n\t\t\t\t\t\tuser.votes.find(vote => vote.pollId === props.poll._id).pointValueIndex\n\t\t\t\t\t),\n\t\t\t\t\tnewIndex: choice.index,\n\t\t\t\t\tuserToken: props.token\n\t\t\t }\n\t\t\t: {\n\t\t\t\t\tpollId: props.poll._id,\n\t\t\t\t\teditingPollVote,\n\t\t\t\t\tnewIndex: choice.index,\n\t\t\t\t\tuserToken: props.token\n\t\t\t };\n\n\t\ttry {\n\t\t\tconst response = await fetch('/api/pollVote', {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: {\n\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t},\n\t\t\t\tbody: JSON.stringify(voteBody)\n\t\t\t});\n\n\t\t\tconst { user } = await response.json();\n\n\t\t\tcookie.set('user', JSON.stringify(user), { expires: 1 });\n\t\t\tsetExistingVote(true);\n\t\t\tsetEditingPollVote(false);\n\t\t\tsetUser(user);\n\n\t\t\tawait refreshPollData();\n\t\t} catch (error) {\n\t\t\tconsole.error(error);\n\t\t}\n\t}", "title": "" }, { "docid": "0587fd711aadcdf2d2d8af111e883cd0", "score": "0.6098696", "text": "voteNumber(number, cb) {\n\n }", "title": "" }, { "docid": "9256ed12c52f4af417bf09f2e3e95e8e", "score": "0.6090248", "text": "function ajaxVote(num, direction) {\t\t\r\n\tvar direc = '';\r\n\tif(direction == 1) {\r\n\t\tdirec = 'Up';\r\n\t} else {\r\n\t\tdirec = 'Down';\r\n\t}\r\n\t\r\n\t$('#msg'+direc+num).html('...');\r\n\t$.ajax({\r\n\t\ttype:\"post\",\r\n\t\turl: \"recieveVote.php\",\r\n\t\tdata: {'commid':num, 'direc':direction},\r\n\t\tcache: false,\r\n\t\tsuccess: function(html){\r\n\t\t\t$('#msg'+direc+num).html(html);\r\n\t\t\t$('#buttonUp'+num).attr(\"disabled\", true);\r\n\t\t\t$('#buttonDown'+num).attr(\"disabled\", true);\r\n\t\t}\r\n\t});\r\n\r\n\treturn false;\r\n\t}", "title": "" }, { "docid": "cbd7563e8ff31c363431110c31c62782", "score": "0.6063617", "text": "function vote(pid, is_retrieve, go_redirect, table_id){\n\n if(!logged_in) {\n loginPrompt();\n return;\n }\n\n\t$.ajax({\n\t\ttype: \"POST\",\n\t\tdataType: \"json\",\n\t\turl: api_base + \"/\",\n\t\tdata: 'pid=' + pid + '&is_retrieve=' + is_retrieve,\n\t\txhrFields: {\n\t\t\twithCredentials: true\n\t\t},\n\t\terror: function(data){\n\t\t\tconsole.log(data);\n\t\t\tconsole.log(data.responseJSON.message);\n if( data['status'] == 401 ) {\n $('#login_dialog').modal('show');\n } else {\n networkError();\n }\n\t\t},\n\t\tsuccess: function(data){\n\n if(go_redirect) {\n window.location.replace(\"/?p=\"+pid);\n return;\n }\n\n if(is_retrieve == 1) {\n\n var count = parseInt($('#count_'+table_id+pid).html());\n $('#count_'+table_id+pid).html(count-1 + '&nbsp;票');\n $('#btn_'+table_id+pid).attr('class','btn btn-default');\n $('#btn_'+table_id+pid).attr('onclick','vote(' + pid + ',0, 0, \\''+table_id+'\\')');\n $('#btn_'+table_id+pid).html('<img width=\"30\" width=\"20\" src=\"assets/img/heart-unpressed.png\"/>');\n\n } else if(is_retrieve ==0) {\n\n var count = parseInt($('#count_'+table_id+pid).html());\n $('#count_'+table_id+pid).html(count+1 + '&nbsp;票');\n $('#btn_'+table_id+pid).attr('class','btn btn-default');\n $('#btn_'+table_id+pid).attr('onclick','vote(' + pid + ',1, 0, \\''+table_id+'\\')');\n $('#btn_'+table_id+pid).html('<img width=\"30\" width=\"20\" src=\"assets/img/heart-pressed.png\"/>');\n\n }\n\t\t}\n\t});\n}", "title": "" }, { "docid": "21f347218b0661238f9b84ba0e4ebea5", "score": "0.6059573", "text": "function postNewUpvote(req, res) {\n Vote.create({\n upvote: +1\n })\n .then(function(vote) {\n console.log('upvote created');\n res.send('upvote created');\n })\n}", "title": "" }, { "docid": "5051284fc71367758162123874e090dd", "score": "0.60594463", "text": "function sendToNodeVoting(neededDataForVoting, res, callback){\n var HOST = neededDataForVoting.node.ip;\n var PORT = neededDataForVoting.node.port;\n console.log(neededDataForVoting.node.ip + \", == \" + neededDataForVoting.node.port);\n\n console.log(\"neededDataForVoting.vote\");\n console.log(neededDataForVoting.vote);\n //console.log(\"HOST : \" + HOST + \", PORT : \" + PORT);\n\n var client = new net.Socket();\n client.connect(PORT, HOST, function() {\n\n log.info('Socket. Connected to: ' + HOST + ':' + PORT);\n // Write a message to the socket as soon as the client is connected, the server will receive it as message from the client\n client.write(JSON.stringify(neededDataForVoting));\n callback.data(\"START VOTING!\", res, {status: 1});\n });\n\n // Add a 'data' event handler for the client socket\n // data is what the server sent to this socket\n client.on('data', function(data) {\n\n log.info('Socket. Data: ' + data);\n // Close the client socket completely\n client.destroy();\n\n });\n\n // Add a 'close' event handler for the client socket\n client.on('close', function() {\n log.info('Socket. Connection closed');\n });\n\n client.on('error', function(err){\n log.log('Error occured:', err);\n callback.data(\"Socket. Bad connection with nodes\", res);\n });\n}", "title": "" }, { "docid": "1cf7e35c7d405a3896c1251d944aea35", "score": "0.6049911", "text": "function giveVote(roomName, playerId) {\n \t\tvar room = getRoom(roomName);\n \t\tfor(var i = 0; i < room.players.length; i++) {\n \t\t\tif(playerId == room.players[i].id) {\n \t\t\t\troom.players[i].votes++;\n \t\t\t}\n \t\t}\n \t}", "title": "" }, { "docid": "ddfb1461be4f5dcf16a73f6621aa1163", "score": "0.60491306", "text": "function upvote(e, csrf) {\n document.getElementById(\"upvote\" + e).classList.contains(\"active\") ? (document.getElementById(\"upvote\" + e).classList.remove(\"active\"), document.getElementById(\"vote\" + e).classList.add(\"animatedown\"), document.getElementById(\"vote\" + e).classList.remove(\"red\"), document.getElementById(\"vote\" + e).classList.remove(\"main-color\"), document.getElementById(\"vote\" + e).innerHTML = (parseInt(document.getElementById(\"vote\" + e).innerHTML) - 1).toString(), setTimeout(function() {\n document.getElementById(\"vote\" + e).classList.remove(\"animatedown\")\n }, 300)) : (document.getElementById(\"vote\" + e).classList.add(\"animateup\"), document.getElementById(\"upvote\" + e).classList.add(\"active\"), document.getElementById(\"vote\" + e).classList.remove(\"red\"), document.getElementById(\"vote\" + e).classList.add(\"main-color\"), document.getElementById(\"downvote\" + e).classList.contains(\"active\") ? (document.getElementById(\"downvote\" + e).classList.remove(\"active\"), document.getElementById(\"vote\" + e).innerHTML = (parseInt(document.getElementById(\"vote\" + e).innerHTML) + 2).toString()) : document.getElementById(\"vote\" + e).innerHTML = (parseInt(document.getElementById(\"vote\" + e).innerHTML) + 1).toString(), setTimeout(function() {\n document.getElementById(\"vote\" + e).classList.remove(\"animateup\")\n }, 300))\n if (document.getElementById(\"upvote\" + e).classList.contains(\"active\")) {\n j.ajax({\n url:\"postrating/\",\n type : \"POST\", // http method\n data : {csrfmiddlewaretoken: csrf, redirect: window.location.href, post_id : e, opinion : \"like\", operation: \"add\"}, // data sent with the post request\n // handle a successful response\n success : function(json) {\n // log the returned json to the console\n console.log(\"success\"); // another sanity check\n }\n });\n }else{\n j.ajax({\n url:\"postrating/\",\n type : \"POST\", // http method\n data : {csrfmiddlewaretoken: csrf, redirect: window.location.href, post_id : e, opinion : \"like\", operation: \"remove\"}, // data sent with the post request\n // handle a successful response\n success : function(json) {\n // log the returned json to the console\n console.log(\"success\"); // another sanity check\n }\n });\n }\n }", "title": "" }, { "docid": "2b5bf0dfdd0a06211c4a09920015517a", "score": "0.60453385", "text": "function vote_on_post(post) {\n return {\n type: types.VOTE_POST,\n post\n }\n}", "title": "" }, { "docid": "fb638dfa7ebef20ea30faa4066e9df4a", "score": "0.6045183", "text": "static async addVote(id, direction) {\n let res = await this.request(`posts/${id}/vote/${direction}`, {}, \"post\");\n return res;\n }", "title": "" }, { "docid": "aa9b58a884dd647615b050ae9e4dacca", "score": "0.6042513", "text": "function changeVote(postID, method) {\n // Gets the element for the upvote arrow.\n let arrow = document.getElementById(postID);\n arrow.classList.toggle(\"post-arrow-click\");\n\n // Extracts the post ID.\n let id = postID.substring(12, postID.length);\n\n // Sets options to get post details.\n let tokenString = \"Token \" + localStorage.token;\n const options = {\n method: method,\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': tokenString\n }\n }\n\n // The url for changing an upvote to a post.\n let upVote = localStorage.getItem(\"api\") + \"/post/vote/?id=\" + id;\n // Fetches the post, to add upvote.\n fetch(upVote, options)\n .then(response => response.json())\n .then(response => {\n // Gets the element for vote number for post.\n let numVotes = document.getElementById(\"vote-\" + id);\n // If adding a vote.\n if (method == \"PUT\") {\n numVotes.innerText = Number(numVotes.innerText) + 1;\n // If removing a vote.\n } else {\n numVotes.innerText = Number(numVotes.innerText) - 1;\n }\n });\n}", "title": "" }, { "docid": "2fb46796ffcfba4c243fb5177eab0cfd", "score": "0.60296386", "text": "voteDown(e, myvote,rantid, userToken){\t\t\n\t\tif(typeof userToken !== 'undefined' && userToken !== \"\"){\n\t\t\tif(myvote == \"1\"){\n\t\t\t\tconsole.log(\"vote up\");\n\n\t\t\t\tlet voteObj = {\n\t\t\t\t\t\"postId\": rantid,\n\t\t\t\t\t\"direction\": \"down\" \n\t\t\t\t}\n\n\t\t\t\tconst requestVoteUp = async () => {\n\t\t\t\t const response = await postActions.rantVote(userToken,voteObj);\n\t\t\t\t console.log(response);\n\t\t\t\t \n\t\t\t\t}\n\t\t\t\trequestVoteUp();\n\n\t\t\t}else{\n\t\t\t\tconsole.log(\"no vote down\");\n\t\t\t}\n\t\t}else{\n\t\t\tthis.props.dispatchShowLoginPopup();\n\t\t}\n\t}", "title": "" }, { "docid": "ed08a2781c4477e4244bd35a9a9a8a7b", "score": "0.59689754", "text": "addVote(voter, voted) {\n this.elections.length = this.elections.votes[voter] === undefined ? this.elections.length + 1 : this.elections.length;\n this.elections.votes[voter] = voted;\n }", "title": "" }, { "docid": "eb792ddcbf23b577d94a7c3dbb8a2801", "score": "0.596247", "text": "function postNewVote(){\n if (document.getElementById(\"voteFormName\").value.trim() !== \"\") {\n let newVote = {};\n newVote.name = document.getElementById(\"voteFormName\").value.trim();\n document.getElementById(\"voteFormName\").value = \"\";\n newVote.firstVote = document.getElementById(\"voteFirstSelection\").value;\n document.getElementById(\"voteFirstSelection\").value=\"random\";\n newVote.secondVote = document.getElementById(\"voteSecondSelection\").value;\n document.getElementById(\"voteSecondSelection\").value=\"random\";\n newVote.thirdVote = document.getElementById(\"voteThirdSelection\").value;\n document.getElementById(\"voteThirdSelection\").value=\"random\";\n newVote.noVote = document.getElementById(\"voteNo\").value;\n document.getElementById(\"voteNo\").value=\"No\";\n\n // set up request\n var request = new XMLHttpRequest();\n let requestURL = \"/dataComm/newVote\"\n request.open(\"POST\", requestURL);\n request.onreadystatechange = function () {\n // reload to get most recent state of the session\n window.location.reload();\n }\n request.onerror = function () {\n console.log('A post error is happening')\n }\n let requestString = JSON.stringify({id: questionID, vote: newVote});\n request.send(requestString);\n }\n}", "title": "" }, { "docid": "678cde0dc7b75aa1f4d3962afa0a6322", "score": "0.5962439", "text": "voteHandler(e) {\n\t\tconst status = this.state.voted\n\t\tif(status) {\n\t\t\tthis.setState({voteCount: this.state.voteCount - 1})\n\t\t\tthis.setState({voted: false})\n\t\t\te.target.style.color = '#000'\n\t\t} else {\n\t\t\tthis.setState({voteCount: this.state.voteCount + 1})\n\t\t\tthis.setState({voted: true})\n\t\t\te.target.style.color = 'red'\n\t\t}\n\t}", "title": "" }, { "docid": "a466e93158d8a9c2f381f8692e0b649b", "score": "0.59611946", "text": "function voteButtonClick(web3, contractAddress, e, $this) {\n\t\t\t$(\".loading-container\").show();\n\t\t\tvar voteFor = $this.hasClass(\"vote-rating-yes\")?true:false;\n\n\t\t\tvar ballotID = $this.closest(\".vote-i\").attr(\"ballot-id\");\n\n\t\t\tvote(web3, \n\t\t\t\t\"vote(uint256,bool)\", \n\t\t\t\tballotID,\n\t\t\t\tvoteFor,\n\t\t\t\tvotingKey,\n\t\t\t\tcontractAddress,\n\t\t\t\tfunction(txHash, err) {\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\t$(\".loading-container\").hide();\n\t\t\t\t\t\tshowAlert(err, \"You are already voted or have no rights to vote\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tgetTxCallBack(txHash, function() {\n\t\t\t\t\t\t$(\".loading-container\").hide();\n\t\t\t\t\t\t$(\".back\").trigger(\"click\");\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t);\n\t\t}", "title": "" }, { "docid": "8a47a0ebbc7bb3d4efed10bf736edd4d", "score": "0.59586656", "text": "function rateing(){\n\n\t\tconsole.log(ID);\n\t\tconst data = {};\n\t\tdata[\"id\"] = ID;\n\t\tdata[\"rating\"] = this.id;\n\n\n\n\t\tconst fetchOptions = {\n\t\tmethod : 'POST',\n\t\theaders : {\n\t\t\t'Accept': 'application/json',\n\t\t\t'Content-Type' : 'application/json'\n\t\t},\n\t\tbody : JSON.stringify(data)\n\t\t};\n\n\t\tvar url = \"http://localhost:3000/update_rating\";\n\n\t\t// This fetch post the total number of votes the post has got\n\t\tfetch(url, fetchOptions)\n\t\t\t.then(checkStatus)\n\t\t\t.then(function(responseText) {\n\t\t\t\tconsole.log(responseText);\t\t\t\n\t\t\t})\n\t\t\t.catch(function(error) {\n\t\t\t\tconsole.log(error);\n \t\t});\n\t\n\t}", "title": "" }, { "docid": "44552b04ab83133b17d6bdbafdac8d06", "score": "0.5932554", "text": "function increaseVoteAction(post) {\n return {\n type: INCREASE_VOTE_POST,\n post\n };\n}", "title": "" }, { "docid": "873d0765514f6067fcbe40ea2e6f2401", "score": "0.5913517", "text": "voteMeme(response, memeId, voteValue) {\n this.model\n .findByIdAndUpdate(memeId, { $inc: { totalVotes: voteValue } }, { new: true })\n .then((result) => {\n response.json(result);\n })\n .catch((err) => {\n response.json(err);\n });\n }", "title": "" }, { "docid": "7883e516b06733557d0df8809dd75367", "score": "0.5874773", "text": "getVote (openId, voteId, detail, child) {\n return request.post(this.baseurl + 'getVote', Qs.stringify({ openId: openId, voteId: voteId, detail: detail, child: child }))\n }", "title": "" }, { "docid": "19540589721fcc25a141cbbf35211ff2", "score": "0.5873597", "text": "function handleDownvote() {\n if (!isLoggedIn) {\n alert('You need to be logged in to vote');\n return;\n }\n if (myVote == -1) {\n myVote = 0;\n postVote(0);\n } else {\n myVote = -1;\n postVote(-1);\n }\n updateMyVote();\n}", "title": "" }, { "docid": "6e6e86733739fa58156cf9e11731b9bb", "score": "0.58614415", "text": "function vote() {\n $.ajax({\n method: \"POST\",\n dataType: \"json\",\n url: \"../php/vote.php\",\n data: {\n \"personal\": $('#personal').val(),\n \"first\": $('#first').val(),\n \"second\": $('#second').val(),\n }\n }).done(function (obj) {\n //Make the user go back to the page of the selected ballot\n CreateBallotPageCheck(obj);\n }).fail(function(e) {\n console.log(e);\n $(\"#message\").html(\"<span class='ko'> Error: network problem </span>\");\n }); \n}", "title": "" }, { "docid": "da2698060d0bc9146e20b319ed6c1ebf", "score": "0.58314925", "text": "async function vote(kill, message, pollfile, voterslistfile) {\n if (isvoted(message, voterslistfile)) {\n await kill.reply(message.chatId, mylang().polliv(), message.id, true);\n return;\n }\n let data = readJsonFile(pollfile)\n if (data['candis'] === 'null') {\n await kill.reply(message.chatId, mylang().nocand(), message.id, true);\n return;\n }\n let arr = data['candis']\n for (let i = 0; i < arr.length; i++) {\n if (message.body.includes((i + 1).toString())) {\n addvote(kill, message, i, pollfile);\n return;\n }\n }\n await kill.reply(message.chatId, mylang().fail(), message.id, true);\n}", "title": "" }, { "docid": "485f5cef5a4a68e1cb6640dfbefc5c3e", "score": "0.58120626", "text": "upvote (submissionId) {\n const single_sub = this.submissions.find (\n single_sub => single_sub.id === submissionId\n );\n\n single_sub.votes++;\n }", "title": "" }, { "docid": "4ce11972cedffdd730c882d8c06802bc", "score": "0.5800619", "text": "function AjaxUpdateArticleVote(pArticleId, vote) {\n $.ajax({\n url: \"/Article/AsyncUpdateArticleVote\",\n type: \"POST\",\n data: { articleId: (pArticleId), typeId: (vote) },\n error: function (xhr) {\n alert(\"error processing request\")\n },\n success: function (xhr) {\n if (xhr.inserted) {\n var voteScore = $(\"#voteScore\").text();\n var newVote = parseInt(voteScore) + vote;\n updateArticleVotePV(newVote, pArticleId);\n }\n }\n })\n}", "title": "" }, { "docid": "a5bf6096a755c42ee8547cf5f18a718c", "score": "0.5799616", "text": "function sendScore() {\r\n\tif (best <= lastSentScore)\r\n\t\treturn;\t\r\n\tvar url = \"https://maker.ifttt.com/trigger/npigs/with/key/dMvIEBpoWgEJpP2eyJj6FP?value1=\" + best + \"&value2=\" + username;\r\n\tvar xhr = new XMLHttpRequest();\r\n\txhr.open(\"POST\", url, true);\r\n\txhr.send();\r\n\tlastSentScore = best;\r\n}", "title": "" }, { "docid": "27dca290b2f6437c52ab5ba60f5b194d", "score": "0.5796446", "text": "function addVote(rid,response)\r\n{\r\n\t//find the top root for this reply\r\n\tvar findFlg;\r\n\tfindFlg = true;\r\n\tvar topicID;//the root for rid\r\n\tvar i;\r\n\ti=0;\r\n\tvar ridTmp;\r\n\tridTmp = rid;\r\n\twhile(findFlg)\r\n\t{\r\n\t\tfor(i=0;i<repliesNum;i++)\r\n\t\t{\r\n\t\t\tif(assReplyArr[i].id == ridTmp){\r\n\t\t\t\t//console.log(ridTmp);\r\n\t\t\t\tridTmp = assReplyArr[i].upid;//upper level\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(i == repliesNum)\r\n\t\t{\r\n\t\t\tfindFlg = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//now ridTmp is the id of topic\r\n\tfor(i=0;i<topicsNum;i++)\r\n\t{\r\n\t\tif(assTopicArr[i].id == ridTmp){\r\n\t\t\tassTopicArr[i].votes = assTopicArr[i].votes +1 ;//upper level\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "4ad7be7e0b02c1c0589a101f93b72d8b", "score": "0.57951236", "text": "function toggleVote(voteButton) {\n\t\tvar delta = voteButton.hasClass(\"pressed\") ? -1 : 1;\n\t\tvotes = voteButton.find(\"span\");\n\t\tvotes.text(parseInt(votes.text()) + delta);\n\t\tvoteButton.toggleClass(\"pressed\");\n\n\t\tif(!voteButton.hasClass(\"uglyHack\")) {\n\t\t\tvoteButton.addClass(\"uglyHack\");\n\t\t\tvar voteType = voteButton.hasClass(\"up-section\") ? \"upvote\" : \"downvote\";\n\t\t\t$.post(\"/votes/\"+$.base64.encode(voteButton.attr('data-url'))+\n\t\t\t\t\t\"/\"+voteType);\n\t\t}\n\t}", "title": "" }, { "docid": "c0db47249af771cd9c786133332d19a8", "score": "0.57920957", "text": "async function setVote(uidConcourse, uidCandidate, vote) {\n var response = await concourseRef\n .doc(uidConcourse)\n .collection(\"candidates\")\n .doc(uidCandidate)\n .collection(\"votes\")\n .doc(vote.uid+\"\")\n .set(vote)\n .then(() => {\n return {status: 200, message: \"Vote successfully created\"}\n }).catch((error) => {\n return {status: 500, message: `error: ${error}`}\n })\n return response\n }", "title": "" }, { "docid": "8c6488dd939082d973750e4c3e1608f6", "score": "0.5762008", "text": "function voteMessage(p_messageId, p_voteType, p_voteValue,p_dataAttrVotedUp, p_dataAttrVotedDown)\n{\n\t// IN EEN COOKIE SCHRIJVEN OP WELKE MESSAGES WE AL GEVOTED HEBBEN\n\t/*if(cookiesAreEnabled)\n\t{\n\t\t$.cookie.json = true;\n\t var allMyvotes = $.cookie('myVotesIMDWALL');\n\t var id = p_messageId.substr(1,p_messageId.length);\n\n\t $.each(allMyvotes, function (index, value) {\n\t\t\tvar dupMEsId = index;\n\n\t\t\tif(id == dupMEsId)\n\t\t\t{\n\t\t\t\tdelete allMyvotes[id];\n\t\t\t}\n\t\t});\n\n\t var test = {\"messageId\" : id, \"messageValue\" : p_voteValue,votedUp : p_dataAttrVotedUp,votedDown : p_dataAttrVotedDown};\n\t allMyvotes[id ] = test;\n\t messageId++;\n\t $.cookie('myVotesIMDWALL',allMyvotes, { expires: 365 });\n\n\t}*/\n\n\t\n\t// BETER MET LOCALSTORAGE DAN MET COOKIE\n/*\tif(localStorageAvailable)\n\t{\n\t\t\t var allMyvotes = JSON.parse(localStorage.getItem('savedVotes'));\n\t\t\t var id = p_messageId.substr(1,p_messageId.length);\n\n\t\t\t $.each(allMyvotes, function (index, value) {\n\t\t\t\tvar dupMEsId = index;\n\n\t\t\t\tif(id == dupMEsId)\n\t\t\t\t{\n\t\t\t\t\tdelete allMyvotes[id];\n\t\t\t\t}\n\t\t\t});\n\n\t var test = {\"messageId\" : id, \"messageValue\" : p_voteValue,votedUp : p_dataAttrVotedUp,votedDown : p_dataAttrVotedDown};\n\t allMyvotes[id ] = test;\n\t messageId++;\n\t localStorage.setItem('savedVotes',JSON.stringify(allMyvotes));\n\t //console.log(JSON.parse(localStorage.getItem('savedVotes')));\n\t}*/\n\n var publicationVote = client.publish('/vote', {chosenQuestion : p_messageId, voteType : p_voteType, voteValue : p_voteValue, votedUp : p_dataAttrVotedUp, votedDown : p_dataAttrVotedDown});\n \n \n}", "title": "" }, { "docid": "ce0af7e44c5eabebf9e35e8fc196d991", "score": "0.5761872", "text": "function vote(comment_id, direction) {\r url = '/ajax/c/vote';\r var vote = -1;\r if(direction == 'up') {\r vote = 1;\r }\r $.ajax({\r type: 'GET',\r dataType: \"html\",\r url: url,\r data: {post_id: $('#post_id').val(), comment_id: comment_id, direction: vote},\r success: function(data) { \r get_ajax_comments($('#post_id').val(), SORT_TYPE, SORT_DIRECTION);\r },\r contentType: \"application/html\",\r dataType: 'html'\r }); \r}", "title": "" }, { "docid": "8dee541b9c58faccd536498f29517778", "score": "0.57476795", "text": "function postResetVoting() {\n var request = new XMLHttpRequest();\n let requestURL = \"/dataComm/resetVotes\"\n request.open(\"POST\", requestURL);\n request.onreadystatechange = function () {\n // reload to get most recent state of the session\n window.location.reload();\n }\n request.onerror = function () {\n console.log('A post error is happening')\n }\n request.send(questionID);\n}", "title": "" }, { "docid": "927a82dad04f7aa8508d8a05612b6595", "score": "0.5723544", "text": "function setVote(voteStatus) {\n if (voteStatus) {\n $(`#o-editor-voteup-${currentItem.layer.get('name')}`).addClass('o-voter-true');\n } else {\n $(`#o-editor-voteup-${currentItem.layer.get('name')}`).removeClass('o-voter-true');\n }\n}", "title": "" }, { "docid": "9916e3862d3b475e092dac475af9314e", "score": "0.57144177", "text": "function initVotes() {\n if (!isLoggedIn) {\n return;\n }\n $.ajax('/api/vote/' + dealId)\n .done((dir) => {\n myVote = parseInt(dir);\n votes -= myVote; // exclude myVote from global vote count\n updateMyVote();\n });\n}", "title": "" }, { "docid": "2af8d80d26d48d184d1026a412e7fc5c", "score": "0.57115006", "text": "function sendTheMessage() {\n\n // Send Data to the server to draw it in all other canvases\n dataServer.publish(\n {\n channel: channelName,\n message: \n {\n vote: choice, //get the value from the text box and send it as part of the message\n }\n });\n\n}", "title": "" }, { "docid": "b38873bd8db3e5db529bc0ed1a1d6c55", "score": "0.5669126", "text": "function voteFor(el) {\n\t// find vote to grow\n\tconst voteEl = el.querySelector('span.votes');\n\t\n\t// increase the innerVote\n\tvoteEl.innerText = +voteEl.innerText + 1;\n}", "title": "" }, { "docid": "d32212c6476500cfd5266466fa936ddc", "score": "0.5662894", "text": "function upvoteIncrease() {\n fetch(`http://localhost:4002/articles/${blog.id}`, {\n method: \"PATCH\",\n headers: {\n \"content-type\": \"application/json\",\n },\n body: JSON.stringify({\n blogUpVote: currentUpvote + 1,\n }),\n })\n .then((res) => res.json())\n .then((data) => setCurrentUpvote(data.blogUpVote));\n }", "title": "" }, { "docid": "086904d0cb2498d2e59cfa6a07e02d93", "score": "0.5658846", "text": "handleVote(post, voteDirection) {\n const id = post.id;\n // If it's a post we are voting on...\n if(post.hasOwnProperty('commentCount')){\n this.props.voteOnPost(id, voteDirection);\n } else {\n // Else if it's a comment\n console.log('voting on comment eh chief');\n this.props.voteOnComment(id, voteDirection);\n }\n }", "title": "" }, { "docid": "71f155fc22afe82cdff8ac4862f40981", "score": "0.5643341", "text": "vote(type, movieId) {\n const { token, movies } = this.state\n const form = {\n id: movieId,\n type\n }\n // TODO: move this request to libraries\n axios({\n method: 'post',\n url: '/movie/vote',\n data: { authenticity_token: token, movie: form }\n }).then((response) => {\n const { movie } = response.data\n\n let index = movies.findIndex(x => x.id == movie.id)\n movies[index] = movie\n this.setState({ movies: movies })\n }).catch((err) => {\n })\n }", "title": "" }, { "docid": "89bc7e89dcf0bc19b924af3721bee34b", "score": "0.564147", "text": "function handleVoteResponse(sketchCard, responseData){\n sketchCard.setScore(responseData.votes);\n sketchCard.resetButtons();\n //colorize upvotebutton\n if(responseData.userUpvote){\n sketchCard.setLikeActive();\n }\n //colorize downvotebutton\n if(responseData.userDownvote){\n sketchCard.setDislikeActive();\n }\n}", "title": "" }, { "docid": "378cf9b2ef8918c9ff7ac6e0a0f26a7c", "score": "0.5641139", "text": "function isVoted(index,senators){\n\n return senators[index].voted; \n}", "title": "" }, { "docid": "efff5fa3f8fe18a24bc41bb804c633b6", "score": "0.56260526", "text": "function VoteHandler(button)\n{\n var playername = jQuery(button).attr('player');\n jQuery('#playervote').html(playername);\n jQuery('#confirmvote').attr('player',playername);\n $.mobile.changePage( \"#confirm_vote\", { role: \"dialog\" } );\n}", "title": "" } ]
1c9479c432acddf16822073cd6271879
Public Properties //////////////////////////////////////////////////////////////////////////// Container
[ { "docid": "5cbf7792a83fcf4ed0b21e3fe8e9a0b5", "score": "0.0", "text": "constructor() {\n if (!instance) {\n this._dependencies = [];\n instance = this; // eslint-disable-line consistent-this\n }\n return instance;\n }", "title": "" } ]
[ { "docid": "67f3464c0a6b4d9b0a5ecfa288ce0631", "score": "0.781342", "text": "constructor() {\r\n this._container = {};\r\n }", "title": "" }, { "docid": "8bacc15ec25dad319287fba59ab8b230", "score": "0.73771524", "text": "get container() {\n\t\treturn this.__container;\n\t}", "title": "" }, { "docid": "a697a7ce25bfe90e5513bad6a70f0294", "score": "0.7233023", "text": "function ObjectContainer() {\n\t\t\n\t\tthis.Container_constructor();\n\t\n\t}", "title": "" }, { "docid": "015a4e1ff14b4ebbb635c78f440ad106", "score": "0.7140806", "text": "get container() {\n return this._container;\n }", "title": "" }, { "docid": "8d5e2ee94d96edda42398d162187f31a", "score": "0.7118811", "text": "function LContainer() { }", "title": "" }, { "docid": "8d5e2ee94d96edda42398d162187f31a", "score": "0.7118811", "text": "function LContainer() { }", "title": "" }, { "docid": "f6b9e5d2089ce1e1e0245d789a7e8f67", "score": "0.68590486", "text": "getContainer() {\n return this.container;\n }", "title": "" }, { "docid": "09032767b0b46900bce04425d154e66d", "score": "0.6801994", "text": "function MapContainer() {\n this.data = new std.List();\n }", "title": "" }, { "docid": "477153d9a8f023f65574ae84a6099681", "score": "0.67722505", "text": "get container(){\n\t\t\treturn this._renderer.container;\n\t\t}", "title": "" }, { "docid": "0f1743370c9c3d901b1d0ecd9d99205b", "score": "0.6729031", "text": "containers() {\n this.map(cursor => !!cursor[Backer.parent], cursor => cursor[Backer.parent]);\n }", "title": "" }, { "docid": "74cde595f827cae8a595c6dec9e2c8b0", "score": "0.67057335", "text": "function ExportContainer() {\r\n this._container = new Array();\r\n }", "title": "" }, { "docid": "d5974f65b0886e6598ae3a5e5f4d5952", "score": "0.6616306", "text": "function Container()\n{\n DisplayObject.call(this);\n\n /**\n * The array of children of this container.\n *\n * @member {DisplayObject[]}\n * @readonly\n */\n this.children = [];\n}", "title": "" }, { "docid": "2df5f90e14b8585c5ac65101409ae65b", "score": "0.65900457", "text": "function Container()\n{\n DisplayObject.call(this);\n\n /**\n * The array of children of this container.\n *\n * @member {PIXI.DisplayObject[]}\n * @readonly\n */\n this.children = [];\n}", "title": "" }, { "docid": "2df5f90e14b8585c5ac65101409ae65b", "score": "0.65900457", "text": "function Container()\n{\n DisplayObject.call(this);\n\n /**\n * The array of children of this container.\n *\n * @member {PIXI.DisplayObject[]}\n * @readonly\n */\n this.children = [];\n}", "title": "" }, { "docid": "45210f5b05db5adf11b8ab3a86812847", "score": "0.6584941", "text": "get container(){\n\t\treturn CardPileView.CARD_CONTAINERS[this.#id];\n\t}", "title": "" }, { "docid": "8d1af078c0e8a9c9fe51ea2c57781b0a", "score": "0.6576919", "text": "constructor() {\n this._container = document.createElement(\"div\");\n }", "title": "" }, { "docid": "9c72225493602566fe16ea6424f16e27", "score": "0.65203375", "text": "function TContainerNode() { }", "title": "" }, { "docid": "9c72225493602566fe16ea6424f16e27", "score": "0.65203375", "text": "function TContainerNode() { }", "title": "" }, { "docid": "571690d06d65ab0d162a279818a3c382", "score": "0.651581", "text": "function SetContainer() {\n _super.call(this);\n // INITIALIZATION\n this.data = new std.List();\n //// OVERLOADINGS\n //if (args.length == 1 && args[0] instanceof Array && args[0] instanceof Vector == false)\n //{\n //\tthis.constructByArray(args[0]);\n //}\n //else if (args.length == 1 && args[0] instanceof Container)\n //{\n //\tthis.constructByContainer(args[0]);\n //}\n //else if (args.length == 2 && args[0] instanceof Iterator && args[1] instanceof Iterator)\n //{\n //\tthis.constructByRange(args[0], args[1]);\n //}\n }", "title": "" }, { "docid": "03115508e832c3ed9f56fd4863011525", "score": "0.65146947", "text": "constructor() {\n this._container = document.createElement(\"div\");\n }", "title": "" }, { "docid": "37e17bd54264f066ba994df601854c7b", "score": "0.64966303", "text": "function drawContainer()\n\t{\n\t\t// Construct the container\n\t\tcontainer = that.add('pagedCollection', {\n\t\t\tbgColor: style.sectionBGColor,\n\t\t\tbuttonAsset: 'TOCArrows',\n\t\t\tbuttonFrames: ['Down', 'Up'],\n\t\t\tbuttonOffset: [style.pageButtonOffsetX, style.pageButtonOffsetY],\n\t\t\tbuttonGap: style.pageButtonGap,\n\t\t\tgap: style.unitGap,\n\t\t\ttopMargin: style.sectionTopGap,\n\t\t\tbottomMargin: style.sectionBottomGap\n\t\t}, fw.dockTo(that));\n\t}", "title": "" }, { "docid": "e725082bb651f4797ccfe3153cc81c6f", "score": "0.6487576", "text": "function containerOfThings() {\n // private members\n const container = [];\n\n function getAllItems() {\n return console.log(\"container: \", container);\n }\n\n function addItem(item) {\n container.push(item);\n }\n\n function removeItem(item) {\n let index = container.indexOf(item);\n\n if (index < 1) throw new Error(\"Item is not found in container\");\n\n container.splice(index, 1);\n }\n\n // public members\n return {\n get: getAllItems,\n add: addItem,\n delete: removeItem,\n };\n}", "title": "" }, { "docid": "830e59ec15dfb4109ee51ff2732dcbbf", "score": "0.63994235", "text": "function Container(parent) {\n this.parent = parent;\n this.children = [];\n\n this.resolver = parent && parent.resolver || function() {};\n\n this.registry = dictionary(parent ? parent.registry : null);\n this.cache = dictionary(parent ? parent.cache : null);\n this.factoryCache = dictionary(parent ? parent.factoryCache : null);\n this.resolveCache = dictionary(parent ? parent.resolveCache : null);\n this.typeInjections = dictionary(parent ? parent.typeInjections : null);\n this.injections = dictionary(null);\n this.normalizeCache = dictionary(null);\n\n this.factoryTypeInjections = dictionary(parent ? parent.factoryTypeInjections : null);\n this.factoryInjections = dictionary(null);\n\n this._options = dictionary(parent ? parent._options : null);\n this._typeOptions = dictionary(parent ? parent._typeOptions : null);\n }", "title": "" }, { "docid": "782151387c3518349186245e37aef373", "score": "0.63269395", "text": "get container() {\n this._logService.debug(\"gsDiggStoryDTO.container[get]\");\n return this._container;\n }", "title": "" }, { "docid": "0dd1174492f24c49ed781ca50997abd5", "score": "0.6303446", "text": "function TIcuContainerNode() { }", "title": "" }, { "docid": "0dd1174492f24c49ed781ca50997abd5", "score": "0.6303446", "text": "function TIcuContainerNode() { }", "title": "" }, { "docid": "e9f3f63ed0b92282b9c972174e15f4d5", "score": "0.6263993", "text": "newContainer() {\n return new pixi_js_1.Container();\n }", "title": "" }, { "docid": "00ca7cb4a2d89097418285297a7704a6", "score": "0.62172943", "text": "function UniformContainer() {\n\n\tthis.seq = [];\n\tthis.map = {};\n\n}", "title": "" }, { "docid": "00ca7cb4a2d89097418285297a7704a6", "score": "0.62172943", "text": "function UniformContainer() {\n\n\tthis.seq = [];\n\tthis.map = {};\n\n}", "title": "" }, { "docid": "00ca7cb4a2d89097418285297a7704a6", "score": "0.62172943", "text": "function UniformContainer() {\n\n\tthis.seq = [];\n\tthis.map = {};\n\n}", "title": "" }, { "docid": "00ca7cb4a2d89097418285297a7704a6", "score": "0.62172943", "text": "function UniformContainer() {\n\n\tthis.seq = [];\n\tthis.map = {};\n\n}", "title": "" }, { "docid": "00ca7cb4a2d89097418285297a7704a6", "score": "0.62172943", "text": "function UniformContainer() {\n\n\tthis.seq = [];\n\tthis.map = {};\n\n}", "title": "" }, { "docid": "00ca7cb4a2d89097418285297a7704a6", "score": "0.62172943", "text": "function UniformContainer() {\n\n\tthis.seq = [];\n\tthis.map = {};\n\n}", "title": "" }, { "docid": "00ca7cb4a2d89097418285297a7704a6", "score": "0.62172943", "text": "function UniformContainer() {\n\n\tthis.seq = [];\n\tthis.map = {};\n\n}", "title": "" }, { "docid": "00ca7cb4a2d89097418285297a7704a6", "score": "0.62172943", "text": "function UniformContainer() {\n\n\tthis.seq = [];\n\tthis.map = {};\n\n}", "title": "" }, { "docid": "00ca7cb4a2d89097418285297a7704a6", "score": "0.62172943", "text": "function UniformContainer() {\n\n\tthis.seq = [];\n\tthis.map = {};\n\n}", "title": "" }, { "docid": "00ca7cb4a2d89097418285297a7704a6", "score": "0.62172943", "text": "function UniformContainer() {\n\n\tthis.seq = [];\n\tthis.map = {};\n\n}", "title": "" }, { "docid": "00ca7cb4a2d89097418285297a7704a6", "score": "0.62172943", "text": "function UniformContainer() {\n\n\tthis.seq = [];\n\tthis.map = {};\n\n}", "title": "" }, { "docid": "00ca7cb4a2d89097418285297a7704a6", "score": "0.62172943", "text": "function UniformContainer() {\n\n\tthis.seq = [];\n\tthis.map = {};\n\n}", "title": "" }, { "docid": "ce98452ab99f4b4af00708bffe2812f7", "score": "0.61709654", "text": "function TElementContainerNode() { }", "title": "" }, { "docid": "ce98452ab99f4b4af00708bffe2812f7", "score": "0.61709654", "text": "function TElementContainerNode() { }", "title": "" }, { "docid": "50da61edfbbe4ba3bcafda36b01c81cc", "score": "0.6157502", "text": "function UniformContainer() {\n\t\n\t\t\tthis.seq = [];\n\t\t\tthis.map = {};\n\t\n\t\t}", "title": "" }, { "docid": "50da61edfbbe4ba3bcafda36b01c81cc", "score": "0.6157502", "text": "function UniformContainer() {\n\t\n\t\t\tthis.seq = [];\n\t\t\tthis.map = {};\n\t\n\t\t}", "title": "" }, { "docid": "8d06950c68e6d8ac19a9bd3fd02e41d4", "score": "0.6128894", "text": "function UniformContainer() {\n\n\t\tthis.seq = [];\n\t\tthis.map = {};\n\n\t}", "title": "" }, { "docid": "8d06950c68e6d8ac19a9bd3fd02e41d4", "score": "0.6128894", "text": "function UniformContainer() {\n\n\t\tthis.seq = [];\n\t\tthis.map = {};\n\n\t}", "title": "" }, { "docid": "8d06950c68e6d8ac19a9bd3fd02e41d4", "score": "0.6128894", "text": "function UniformContainer() {\n\n\t\tthis.seq = [];\n\t\tthis.map = {};\n\n\t}", "title": "" }, { "docid": "8d06950c68e6d8ac19a9bd3fd02e41d4", "score": "0.6128894", "text": "function UniformContainer() {\n\n\t\tthis.seq = [];\n\t\tthis.map = {};\n\n\t}", "title": "" }, { "docid": "8d06950c68e6d8ac19a9bd3fd02e41d4", "score": "0.6128894", "text": "function UniformContainer() {\n\n\t\tthis.seq = [];\n\t\tthis.map = {};\n\n\t}", "title": "" }, { "docid": "c6ab012b8569db456a6e6c7df06b07df", "score": "0.61201555", "text": "function UniformContainer() {\n\n this.seq = [];\n this.map = {};\n\n }", "title": "" }, { "docid": "c6ab012b8569db456a6e6c7df06b07df", "score": "0.61201555", "text": "function UniformContainer() {\n\n this.seq = [];\n this.map = {};\n\n }", "title": "" }, { "docid": "c6ab012b8569db456a6e6c7df06b07df", "score": "0.61201555", "text": "function UniformContainer() {\n\n this.seq = [];\n this.map = {};\n\n }", "title": "" }, { "docid": "ee5e76702d9b665773304336de963130", "score": "0.6088672", "text": "function UniformContainer() {\n\n this.seq = [];\n this.map = {};\n\n }", "title": "" }, { "docid": "c9dd3e4f832c7fb0a365897ac86ec73d", "score": "0.6077939", "text": "function Collection () {}", "title": "" }, { "docid": "c9dd3e4f832c7fb0a365897ac86ec73d", "score": "0.6077939", "text": "function Collection () {}", "title": "" }, { "docid": "c9dd3e4f832c7fb0a365897ac86ec73d", "score": "0.6077939", "text": "function Collection () {}", "title": "" }, { "docid": "604435efc7b6d4d64a699511b12cb8b9", "score": "0.60726917", "text": "getContainerAttributes() {\n return {};\n }", "title": "" }, { "docid": "182309da07c158dde316ca8eca8116f1", "score": "0.6072635", "text": "function Container(client) {\n this.client = client;\n }", "title": "" }, { "docid": "effa4ff30e5742a57c560ba3a3d9c469", "score": "0.6020439", "text": "function UniformContainer(){this.seq=[];this.map={};}// --- Utilities ---", "title": "" }, { "docid": "effa4ff30e5742a57c560ba3a3d9c469", "score": "0.6020439", "text": "function UniformContainer(){this.seq=[];this.map={};}// --- Utilities ---", "title": "" }, { "docid": "fc975c491a83ea58356addd92ac1ab10", "score": "0.6020097", "text": "getContainer() {\n\n\t\t\tif ( !this.threeOBJ && this.parent ) {\n\n\t\t\t\treturn this.parent.getContainer();\n\n\t\t\t} else if ( this.threeOBJ ) {\n\n\t\t\t\treturn this;\n\n\t\t\t}\n\n\t\t\treturn Defaults.container;\n\n\n\t\t}", "title": "" }, { "docid": "da700f2954aaf0124dc78071acfb21e8", "score": "0.60169965", "text": "function calculateContainer () {\n // Get the containing dimensions to base our calculations from.\n container.height = container.el.prop('clientHeight');\n container.width = container.el.prop('clientWidth');\n }", "title": "" }, { "docid": "60c08fdd0bdf7f25e90742eb034f5223", "score": "0.6009322", "text": "getContainer() { return this._backend.getContainer(); }", "title": "" }, { "docid": "9b841f282e48c6ddfccc142ac7604e72", "score": "0.60034704", "text": "get container() {\n if(this.containerBehavior) {\n return this.containerBehavior.container;\n }\n }", "title": "" }, { "docid": "3a478aceb6c52f3363b3f89fdaba21f4", "score": "0.5996645", "text": "function C_() {\n // Container of instances of particular id\n this.con = {};\n }", "title": "" }, { "docid": "f55561f10241306288e57899185b6dd1", "score": "0.599603", "text": "get() {\n return this.findCached('containers', room => room.find(FIND_STRUCTURES, {\n filter: structure => structure.structureType == STRUCTURE_CONTAINER\n }), recache);\n }", "title": "" }, { "docid": "1eb96232f899cc1ce76bc85edf75d4f0", "score": "0.59916013", "text": "function secureContainer (arr)\n {\n container.call(this, arr);\n }", "title": "" }, { "docid": "94da351836225b5ef39883ea0b7bf531", "score": "0.598987", "text": "isContainer() { return false; }", "title": "" }, { "docid": "6b98c9c0e0a3eaf0be194c171d775480", "score": "0.5927204", "text": "function Collection() {}", "title": "" }, { "docid": "d43ad5068473ae9aae9587f644d9e259", "score": "0.5866244", "text": "constructor() {\n // declaration of storage container\n this.data = {};\n this.start = 0;\n this.end = 0;\n }", "title": "" }, { "docid": "9703f8c760c8dee4672983e023e00a89", "score": "0.5854279", "text": "buildContainer() {\n this.container = document.createElement('div');\n this.container.setAttribute('id', this.containerId)\n this.container.classList.add('tooltip');\n this.container.setAttribute('aria-hidden', 'true');\n document.body.appendChild(this.container);\n }", "title": "" }, { "docid": "d1ee502b52c8f910f65b24c0c8ad53da", "score": "0.584863", "text": "function BlisterContainer() {\n this._deps = Object.create(null);\n}", "title": "" }, { "docid": "bf23363cd2acf7641c6abb24cdc93c7d", "score": "0.5836398", "text": "constructor(container) {\n this.container = container;\n\n // a WhiteboardCursorModel\n this.cursor = null;\n\n // all slides in the presentation indexed by url\n this.slides = {};\n this.panX = null;\n this.panY = null;\n this.current = {};\n\n // the slide being shown\n this.current.slide = null;\n\n // a raphaeljs set with all the shapes in the current slide\n this.current.shapes = null;\n\n // a list of shapes as passed to this client when it receives `all_slides`\n // (se we are able to redraw the shapes whenever needed)\n this.current.shapeDefinitions = [];\n this.zoomLevel = 1;\n this.shiftPressed = false;\n this.currentPathCount = 0;\n this._updateContainerDimensions();\n this.zoomObserver = null;\n this.adjustedWidth = 0;\n this.adjustedHeight = 0;\n this.widthRatio = 100;\n this.heightRatio = 100;\n }", "title": "" }, { "docid": "dd185de5899b9caac427784c1bb43cd9", "score": "0.5806937", "text": "getContainerElement() {\n if (!this._containerElement) {\n this._createContainer();\n }\n return this._containerElement;\n }", "title": "" }, { "docid": "dd185de5899b9caac427784c1bb43cd9", "score": "0.5806937", "text": "getContainerElement() {\n if (!this._containerElement) {\n this._createContainer();\n }\n return this._containerElement;\n }", "title": "" }, { "docid": "dd185de5899b9caac427784c1bb43cd9", "score": "0.5806937", "text": "getContainerElement() {\n if (!this._containerElement) {\n this._createContainer();\n }\n return this._containerElement;\n }", "title": "" }, { "docid": "fb67d8489bf8ecb67b55e32ae6edbdb2", "score": "0.58022404", "text": "get ContainerAtlas() { return null; }", "title": "" }, { "docid": "f9b2be8d405daafa93a8b4c11d7150df", "score": "0.5798516", "text": "function Container(game, parent, containerId, backgroundSpriteId) {\n this.game = game;\n this.UI = OAX6.UI;\n this.id = containerId;\n this.sprite = this.game.add.image(0, 0, backgroundSpriteId);\n\n this.group = this.game.add.group(parent);\n this.group.name = 'Container.' + containerId;\n this.group.add(this.sprite);\n this.group.visible = false;\n\n this.sprite.inputEnabled = true;\n\tthis.sprite.events.onInputDown.add(() => {});\n\n this.cursor = {\n x: 0,\n y: 0,\n status: CURSOR_STATUS.IDLE,\n dragAnchor: { x: 0, y: 0 }\n };\n\n this.marker = this.game.add.sprite(0, 0, 'ui', 0, this.group);\n this.marker.visible = false;\n this.marker.anchor.set(0.5);\n\n this.UI.UILayer.add(this.group);\n}", "title": "" }, { "docid": "fafa4bbdb72d923cba2825e9c5ac11d9", "score": "0.5782221", "text": "get viewContainer() { return this._viewContainer_DOM; }", "title": "" }, { "docid": "b20bd151f2cd00900980a6edae03e3f5", "score": "0.57776105", "text": "constructor( container ) {\n this._selected = null\n this._container = container\n this._databases = new Map()\n }", "title": "" }, { "docid": "4ea6fdd7ca5d816b588c2a2bf2fef021", "score": "0.577761", "text": "function PlaceholderContainer() {\n\t\tthis.placeholderA = new PlaceholderElement();\n\t\tthis.placeholderB = new PlaceholderElement();\n\t}", "title": "" }, { "docid": "32f70d19ef4a130ab13fe4eb562a4455", "score": "0.5759117", "text": "buildElements () {\n this.keyMapper = new KeyboardMapper()\n this.showControls = new ShowControls(this.childrenElements.controls, this.keyMapper)\n this.slides = new Slides(this, this.childrenElements.slideshow, this.jsonData.slides, this.showControls, this.keyMapper)\n }", "title": "" }, { "docid": "74d13d22b53821b2988207955eb8172e", "score": "0.57547146", "text": "constructor() {\n this.container = document.body\n this.setup()\n this.addEventListeners()\n }", "title": "" }, { "docid": "408be89495a0e847fe8847be64acb178", "score": "0.5753047", "text": "function EntityGroupsContainer() {\n this.groups = [];\n for (var i = 0; i < 10; ++i) this.groups[i] = new EntityGroups();\n}", "title": "" }, { "docid": "415066970b2a02b6efeafaf6f3b6eed8", "score": "0.5751028", "text": "constructor() {\n this.elements = new Object();\n this.____length = 0;\n }", "title": "" }, { "docid": "368bec4313e9015b5fb2ab78538b6e5a", "score": "0.5741245", "text": "get parentContainer(){\n return this.parentContainerId;\n }", "title": "" }, { "docid": "87b951b2dd8fa9c01dbc82c88eefb816", "score": "0.5737399", "text": "function typedContainer (arr, type)\n {\n container.call(this, arr);\n this.type = type;\n }", "title": "" }, { "docid": "29645ebefbf469279b9a38db9f555c76", "score": "0.5707907", "text": "constructor() {\n this._componentTypes = [];\n this._components = [];\n }", "title": "" }, { "docid": "795bbbb9d65e32a1475921fc7d983775", "score": "0.56996477", "text": "static container() {\n return this.c ||= document.querySelector(\"#todoListsContainer\")\n }", "title": "" }, { "docid": "1a22b52c93d068c34ea5ab053e8ce653", "score": "0.5672832", "text": "get children () {\n return new Map()\n }", "title": "" }, { "docid": "acf6ab83f4f5f6301c87b9437c0c1c6b", "score": "0.56721234", "text": "function BottomContainer()\n\t{\n\t\t// Global variables\n\t\tvar _dic,\n\t\t\t_instance,\n\t\t\t_utils = be.marlon.utils,\n\t\t\t\n\t\t\t_step = -1,\n\t\t\t\n\t\t\t_hasPromo = false,\n\t\t\t\n\t\t\t_mainContainer,\n\t\t\t_secondaryContainer, // Contains logic for navigating between hte submodels, bodytypes, enginegrades\n\t\t\t_engineGrades,\n\t\t\t_specContainer,\n\t\t\t_financing,\n\t\t\t_insurance,\n\t\t\t_header,\n\t\t\t_filterStep,\n\t\t\t_proAceStep;\n\t\t\n\t\t// ###########################\n\t\t// Private methods\n\t\t// ###########################\n\t\t\t\t\n\t\t/**\n\t\t * Method called when the header has been mounted \n\t\t */\n\t\tfunction headerMountHandler(item)\n\t\t{\n\t\t\t_header = item;\n\t\t}\n\t\t\n\t\t/**\n\t\t * Method which handles the mounting of the filterstep \n\t\t */\n\t\tfunction filterStepMountHandler(item)\n\t\t{\n\t\t\t_filterStep = item;\n\t\t}\n\t\t\n\t\t/**\n\t\t * Method which handles the mounting of the proace step \n\t\t */\n\t\tfunction proaceStepMountHandler(item)\n\t\t{\n\t\t\t_proAceStep = item;\n\t\t}\n\t\t\n\t\t/**\n\t\t * Method called when the main container has been mounted \n\t\t */\n\t\tfunction mainContainerMountHandler(item)\n\t\t{\n\t\t\t_mainContainer = item;\n\t\t}\n\t\t\n\t\t/**\n\t\t * Method called when the hContainer has been mounted \n\t\t */\n\t\tfunction secondaryContainerMountHandler(item)\n\t\t{\n\t\t\t_secondaryContainer = item;\n\t\t}\n\t\t\n\t\t/**\n\t\t * Method which handles the mounting of the engineGrades container \n\t\t */\n\t\tfunction engineGradesMountHandler(item)\n\t\t{\n\t\t\t_engineGrades = item;\n\t\t}\n\t\t\n\t\t/**\n\t\t * Method which handles the mounting of the specification sheet \n\t\t */\n\t\tfunction specContainerMountHandler(item)\n\t\t{\n\t\t\t_specContainer = item;\n\t\t}\n\t\t\n\t\t/**\n\t\t * Method which handles the mounting of the financing container \n\t\t */\n\t\tfunction financingMountHandler(item)\n\t\t{\n\t\t\t_financing = item;\n\t\t}\n\t\t\n\t\t/**\n\t\t * Method which handles the mounting of the insurance calculator \n\t\t */\n\t\tfunction insuranceMountHandler(item)\n\t\t{\n\t\t\t_insurance = item;\n\t\t}\n\t\t\n\t\t/**\n\t\t * Method which handles the clicking on the compare grades button \n\t\t */\n\t\tfunction compareGradesClickHandler(e)\n\t\t{\n\t\t\t// Show the compare grades\n\t\t\t_engineGrades.showCompareGrades();\n\n\t\t\t//console.log('compare grades clicked');\n\n\t\t\t// Track click on compare grades button\n bt.track({\n componentname: 'carconfig',\n action: 'cc_action',\n value: 'compare-grade'\n });\n\t\t}\n\t\t\n\t\t/**\n\t\t * Method which handles clicking on the reset button of the pro ace filterstep \n\t\t */\n\t\tfunction resetProAceFiltersClickHandler(e)\n\t\t{\n\t\t\t// TODO RESET\n\t\t\t_proAceStep.reset(_proAceStep.getDefaultCar());\n\t\t}\n\t\t\n\t\t/**\n\t\t * Method which handles the updating of the container height \n\t\t */\n\t\tfunction containerHeightUpdated()\n\t\t{\n\t\t\t_instance.props.heightUpdated($(_instance.getDOMNode()).outerHeight());\n\t\t}\n\t\t\n\t\tfunction handleSimulateProAceSlider(msg, data) {\n var parts = data.split(\".\"),\n sliderCode = parts[0],\n sliderKey = parts[1],\n sliderValueInternalID = parts[2],\n carIndex = parts[3];\n if (carIndex !== \"\") {\n carIndexStrings = carIndex.split(',');\n carIndex = [];\n $.each(carIndexStrings, function(i, cis) {\n carIndex.push(parseInt(cis));\n });\n } else {\n carIndex = \"\";\n }\n _proAceStep.simulateUpdateSlider(sliderCode, parseInt(sliderKey), sliderValueInternalID, carIndex);\n }\n \n /**\n * Method which handles the event when the iFrame is resized \n */\n function iFrameResizeHandler(data)\n {\n \tvar r;\n \t// Check which iFrame did update\n \tif(data.iframe == _financing.getIFrame()[0])\n \t{\n \t\tr = _financing;\n \t}\n \telse if(data.iframe == _insurance.getIFrame()[0])\n \t{\n \t\tr = _insurance;\n \t}\n \t//r.setHeight(data.height);\n \t\n \t//console.log(\"iFrameResizeHandler: \", data.height, \" || \", r.getIFrame().height(), \" || \", $(\"body\").height());\n }\n \n /**\n * Method which handles the callback from within the iFrame \n */\n function iFrameMessageCallback(data)\n {\n \t//console.log(\"iFrameMessageCallback: \", data);\n \t\n \tvar msg = data.message,\n \t\tr;\n \t// Check which iFrame did update\n \tif(data.iframe == _financing.getIFrame()[0])\n \t{\n \t\tr = _financing;\n \t}\n \telse if(data.iframe == _insurance.getIFrame()[0])\n \t{\n \t\tr = _insurance;\n \t}\n \t\n \t// Check which action should be done\n \tif(msg.indexOf(\"height:\") !== -1)\n \t{\n \t\tvar h = Number(data.message.replace(\"height:\",\"\"));\n\t \tr.setHeight(h);\n \t}\n \telse if(msg.indexOf(\"scroll:\") !== -1)\n \t{\n \t\tvar anch = Number(msg.replace(\"scroll:\",\"\")),\n \t\t\ttop = anch + $(r.getDOMNode()).offset().top;\n \t\t// If the carconfig is also in an iFrame, propagate the scroll to position\n \t\tif('parentIFrame' in window)\n\t\t\t\t{\n\t\t\t\t\twindow.parentIFrame.sendMessage(\"scroll:\" + top, '*');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\twindow.scrollTo(0, top - 158); // 158 is the height of the top flap which would else overlap the element\n\t\t\t\t}\n \t}\n }\n \n /**\n \t * Retrieve the disclaimer from the array with objects \n \t\t * @param o:Object\n \t */\n \tfunction getDisclaimer(o)\n\t\t{\n\t\t\tvar i = 0,\n\t\t\t\tiLength = o.Labels.length;\n\t\t\tfor(i; i < iLength; i++)\n\t\t\t{\n\t\t\t\tif(o.Labels[i].Code === \"DISCLAIMER\")\n\t\t\t\t{\n\t\t\t\t\treturn o.Labels[i].Value;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn \"\";\n\t\t}\n\t\t\t\n\t\t// ###########################\n\t\t// Public methods\n\t\t// ###########################\n\t\t\n\t\t/**\n\t\t * Method which resets the submodels \n\t\t */\n\t\tthis.resetSubModels = function()\n\t\t{\n\t\t\tif(!this.props.hasSubmodels)return;\n\t\t\tvar ref = \"submodels\";\n\t\t\tthis.refs[ref].reset();\n\t\t};\n\t\t\n\t\t/**\n\t\t * Method which hides all CTA loaders \n\t\t */\n\t\tthis.hideCTALoaders = function()\n\t\t{\n\t\t\t_specContainer.hideCTALoaders();\n\t\t};\n\t\t\n\t\t/**\n\t\t * Method which resets the CTA loaders to their original value \n\t\t */\n\t\tthis.resetCTALoaders = function()\n\t\t{\n\t\t\t_specContainer.resetCTALoaders();\n\t\t};\n\t\t\n\t\t/**\n\t\t * Method which prepares the qr code \n\t\t */\n\t\tthis.prepareQRC = function()\n\t\t{\n\t\t\t_specContainer.prepareQRC();\n\t\t};\n\t\t\n\t\t/**\n\t\t * Method which updates the qr code \n\t\t */\n\t\tthis.updateQRC = function(url, code)\n\t\t{\n\t\t\t_specContainer.updateQRC(url, code);\n\t\t};\n\t\t\n\t\t/**\n\t\t * Returns if the proace filterstep is present \n\t\t */\n\t\tthis.hasProAce = function()\n\t\t{\n\t\t\tvar filterInfo = this.props.proAceFilterInfo;\n\t\t\treturn (filterInfo.Filters.length > 0 && filterInfo.Cars.length > 0);\n\t\t};\n\t\t\n\t\t/**\n\t\t * Returns the current selected filterstep model object \n\t\t */\n\t\tthis.getSelectedFilterStepModel = function()\n\t\t{\n\t\t\treturn _filterStep.getSelectedModel();\n\t\t};\n\t\t\n\t\t/**\n\t\t * Method which resets the selected model \n\t\t */\n\t\tthis.resetSelectedModel = function()\n\t\t{\n\t\t\treturn _filterStep.resetSelectedModel();\n\t\t};\n\t\t\n\t\t/**\n\t\t * Method which prepares a screen for load, basically visualizing the preloader \n\t\t */\n\t\tthis.prepareForLoad = function(step)\n\t\t{\n\t\t\tvar control;\n\t\t\tswitch(step)\n\t\t\t{\n\t\t\t\tcase _utils.ENGINE_GRADES:\n\t\t\t\t\tcontrol = _engineGrades;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcontrol.showPreLoader();\n\t\t};\n\t\t\n\t\t/**\n\t\t * Method which animates in the correct control \n\t\t */\n\t\tthis.navigate = function(step, animate, force)\n\t\t{\n\t\t\tif(step == _step && !force)return;\n\t\t\t_step = step;\n\t\t\tvar style,\n\t\t\t\tmainStep,\n\t\t\t\tsecondaryStep,\n\t\t\t\tshowCompareGrades = false,\n\t\t\t\tshowResetFilters = false;\n\t\t\t\t\n\t\t\tif(step !== _utils.FINANCING)_financing.clear();\n\t\t\tif(step !== _utils.INSURANCE)_insurance.clear();\n\t\t\tvar hasSubmodels = this.props.hasSubmodels;\n\t\t\tswitch(step)\n\t\t\t{\n\t\t\t\tcase _utils.FILTERSTEP:\n\t\t\t\t \tmainStep = 0;\n\t\t\t\t \tsecondaryStep = 0;\n\t\t\t\tbreak;\n\t\t\t\tcase _utils.PROMOTIONS:\n \t\t\t\tmainStep = 1;\n\t\t\t\t \tsecondaryStep = 0;\n \t\t\tbreak;\n\t\t\t\tcase _utils.SUBMODELS:\n\t\t\t\t\tmainStep = _hasPromo?2:1;\n\t\t\t\t\tsecondaryStep = 0;\n\t\t\t\t\thasSubmodels = false;\n\t\t\t\tbreak;\n\t\t\t\tcase _utils.BODYTYPES:\n\t\t\t\t\tmainStep = _hasPromo?2:1;\n\t\t\t\t\tsecondaryStep = this.props.hasSubmodels?1:0;\n\t\t\t\t\tif(_proAceStep)showResetFilters = true;\n\t\t\t\tbreak;\n\t\t\t\tcase _utils.ENGINE_GRADES:\n\t\t\t\t\tmainStep = _hasPromo?2:1;\n\t\t\t\t\t// Navigate to the last element in the list\n\t\t\t\t\tsecondaryStep = _secondaryContainer.getTotalElements() - 1;\n\t\t\t\t\tshowCompareGrades = true;\n\t\t\t\tbreak;\n\t\t\t\tcase _utils.FINANCING:\n\t\t\t\t\tmainStep = _hasPromo?4:3;\n\t\t\t\t\tsecondaryStep = _secondaryContainer.getTotalElements() - 1;\n\t\t\t\t\t// Load the external frame\n\t\t\t\t\t_financing.loadExternal();\n\t\t\t\tbreak;\n\t\t\t\tcase _utils.INSURANCE:\n\t\t\t\t\tmainStep = _hasPromo?5:4;\n\t\t\t\t\tsecondaryStep = _secondaryContainer.getTotalElements() - 1;\n\t\t\t\t\t// Load the external frame\n\t\t\t\t\t_insurance.loadExternal();\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tmainStep = _hasPromo?3:2;\n\t\t\t\t\tsecondaryStep = _secondaryContainer.getTotalElements() - 1;\n\t\t\t}\n\t\t\t\n\t\t\t// If the shown step is not the specification sheet, reset its navigation\n\t\t\tif(mainStep !== (_hasPromo?3:2))\n\t\t\t{\n\t\t\t\t_specContainer.resetNavigatedContainer();\n\t\t\t}\n\t\t\t\n\t\t\t// If it's the summary, navigate in the summary elements in the specification sheet\n\t\t\tif(step === _utils.SUMMARY)\n\t\t\t{\n\t\t\t\t_specContainer.expandSummaryContent();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t_specContainer.collapseSummaryContent();\n\t\t\t}\n\t\t\t\n\t\t\t//console.log(\"BottomContainer navigate: \", step, \" -- \", mainStep, \" -- \", secondaryStep, \" container elements: \", _secondaryContainer.props.elements.length);\n\t\t\t\n\t\t\t_mainContainer.navigate(mainStep, animate);\n\t\t\t_secondaryContainer.navigate(secondaryStep, animate);\n\t\t\t_header.setState({showCompareGrades:showCompareGrades, showResetFilters:showResetFilters, hasSubmodels:hasSubmodels});\n\t\t\t\n\t\t\t// Since the maincontainer does not necessarely update it's height when navigating to the proace filterstep, force it here\n\t\t\tif(showResetFilters)\n\t\t\t{\n\t\t\t\t_mainContainer.updateHeight();\n\t\t\t}\n\t\t};\n\t\t\t\t\t\n\t\t// ###########################\n\t\t// Required react methods\n\t\t// ###########################\n\t\t\n\t\t/**\n\t\t * Method called when the component is about to be rendered \n\t\t */\n\t\tthis.componentWillMount = function()\n\t\t{\n\t\t\t// Save the instance reference\n\t\t\tif(!_instance)_instance = this;\n\t\t\tif(!_dic)_dic = be.marlon.utils.Dictionary;\n\t\t};\n\t\t\n\t\t/**\n\t\t * Method called when the component did mount \n\t\t */\n\t\tthis.componentDidMount = function()\n\t\t{\n PubSub.subscribe(\"cc_simulate_proaceslider\", handleSimulateProAceSlider);\n \n // Check the iFrame resize handler\n // TODO Fix iFrame resizer!\n\t\t\tif(typeof iFrameResize !== \"undefined\")\n\t\t\t{\n\t\t\t\tvar opts = {\n\t\t\t\t\tcheckOrigin:false,\n\t\t\t\t\tlog:false,\n\t\t\t\t\tenablePublicMethods:true,\n\t\t\t\t\tautoResize:false,\n\t\t\t\t\t//heightCalculationMethod:\"documentElementOffset\",\n\t\t\t\t\t//resizedCallback:iFrameResizeHandler,//_.debounce(iFrameResizeHandler, 300)\n\t\t\t\t\tmessageCallback:iFrameMessageCallback\n\t\t\t\t};\n\t\t\t\t// The resizedCallback is shared between all iFrames which might resize their content, thus we implement this logic\n\t\t\t\t_financing.getIFrame().iFrameResize(opts);\n\t\t\t\t_insurance.getIFrame().iFrameResize(opts);\n\t\t\t}\n\t\t};\n\t\t\n\t\t/**\n\t\t * Method called when the component did update \n\t\t */\n\t\tthis.componentDidUpdate = function(prevProps, prevState)\n\t\t{\n\t\t\t//console.log(\"BottomContainer did update\");\n\t\t\t// if _step is bigger than 0, it means the control has been used/initialized\n\t\t\tif(prevProps.hasBodytype !== this.props.hasBodytype && _step > -1)\n\t\t\t{\n\t\t\t\t// Force the step\n\t\t\t\tthis.navigate(_step, false, true);\n\t\t\t}\n\t\t\telse if(_step > -1)\n\t\t\t{\n\t\t\t\t// Force the step\n\t\t\t\tthis.navigate(_step, false, true);\n\t\t\t}\n\t\t};\n\t\t\n\t\t/**\n\t\t * Default the props \n\t\t */\n\t\tthis.getDefaultProps = function()\n\t\t{\n\t\t\treturn {\n\t\t\t\tsubmodels:[],\n\t\t\t\tbodytypes:[],\n\t\t\t\tmotorizations:[],\n\t\t\t\tgrades:[],\n\t\t\t\tenginePromos:[],\n\t\t\t\tgradePromos:[],\n\t\t\t\tmodelData:null,\n\t\t\t\tfilterData:null,\n\t\t\t\tspecProps:null,\n\t\t\t\tproAceFilterInfo:{\n\t\t\t\t\tFilters:[],\n\t\t\t\t\tCars:[]\n\t\t\t\t},\n\t\t\t\teco:[],\n\t\t\t\tshowMonthlyRate:false\n\t\t\t};\n\t\t};\n\t\t\n\t\t/**\n\t\t * The react render function for this class \n\t\t */\n\t\tthis.render = function()\n\t\t{\n\t\t\tvar elements = [],\n\t\t\t\tsElements = [],\n\t\t\t\tpromos = this.props.promotions,\n\t\t\t\tSubmodels = ui.Submodels,\n\t\t\t\tBodyTypes = ui.BodyTypes,\n\t\t\t\tProAce = ui.ProAce,\n\t\t\t\tEngineGrades = ui.EngineGrades,\n\t\t\t\tFilterTool = ui.Filtertool,\n\t\t\t\tSpecContainer = ui.SpecContainer,\n\t\t\t\tPromoScreen = ui.PromoScreen,\n\t\t\t\tHContainer = ui.HContainer,\n\t\t\t\tDisclaimerSection = ui.DisclaimerSection,\n\t\t\t\tExternalFrame = ui.ExternalFrame,\n\t\t\t\tdisclaimerData,\n\t\t\t\tsecondaryContainerFooter = null;\n\t\t\t\n\t\t\t// Create the array for the first HContainer\n\t\t\telements.push(FilterTool( {key:\"filtertool\", errorHandler:this.props.errorHandler, componentDidMount:filterStepMountHandler, filterData:this.props.filterData, modelData:this.props.modelData, settings:this.props.settings, controller:this.props.controller, modelSelected:this.props.modelSelected, gradeSelected:this.props.gradeSelected}));\n\t\t\t\n\t\t\tif(promos && promos.length > 0)\n\t\t\t{\n\t\t\t\t_hasPromo = true;\n\t\t\t\telements.push(PromoScreen( {key:\"promoscreen\", promoData:promos, promoCallback:this.props.promoSelectHandler, settings:this.props.settings, controller:this.props.controller}));\n\t\t\t\tdisclaimerData = promos.map(\n\t\t\t\t\tfunction(item)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tid:\"q\" + item.ID,\n\t\t\t\t\t\t\tdescription:getDisclaimer(item),\n\t\t\t\t\t\t\tindex:item.Index,\n\t\t\t\t\t\t\tfrom:item.From,\n\t\t\t\t\t\t\tuntil:item.Until,\n\t\t\t\t\t\t\tname:item.Name\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t_hasPromo = false;\n\t\t\t}\n\t\t\t\n\t\t\t// If the disclaimerdata exists, create the appropriate section\n\t\t\tif(disclaimerData)\n\t\t\t{\n\t\t\t\tsecondaryContainerFooter = (DisclaimerSection( {data:disclaimerData.concat(), className:\"cc-border\"}));\n\t\t\t}\n\t\t\t\n\t\t\t// Add the submodels, bodytypes and engine grades\n\t\t\tvar header = Header( \n\t\t\t\t\t\t\t{hasPromo:this.props.hasPromo, \n\t\t\t\t\t\t\tcompareGradesClickHandler:compareGradesClickHandler, \n\t\t\t\t\t\t\tresetProAceFiltersClickHandler:resetProAceFiltersClickHandler, \n\t\t\t\t\t\t\tnavigate:this.props.navigate, \n\t\t\t\t\t\t\ttitle:this.props.title, \n\t\t\t\t\t\t\tcomponentDidMount:headerMountHandler,\n\t\t\t\t\t\t\thasSubmodels:this.props.hasSubmodels,\n\t\t\t\t\t\t\tsettings:this.props.settings});\n\t\t\tif(this.props.hasSubmodels)\n\t\t\t{\n\t\t\t\tsElements.push(Submodels( {key:\"submodels\", ref:\"submodels\", imgPath:this.props.settings.ccisPath, submodels:this.props.submodels, promotions:this.props.promotions, submodelSelectedHandler:this.props.submodelSelectedHandler}));\n\t\t\t}\n\t\t\t\n\t\t\t// Regarding bodytypes step, OR it is the pro ace OR it is the bodytypes step\n\t\t\tif(this.hasProAce())\n\t\t\t{\n\t\t\t\tsElements.push(ProAce( {key:\"proace\", settings:this.props.settings, data:this.props.proAceFilterInfo, componentDidMount:proaceStepMountHandler, selectHandler:this.props.proAceSelectHandler, nextHandler:this.props.nextHandler}));\n\t\t\t}\n\t\t\telse if(this.props.hasBodytype)\n\t\t\t{\n\t\t\t\tsElements.push(BodyTypes( {key:\"bodytypes\", imgPath:this.props.settings.ccisPath, configuration:this.props.configuration, bodytypes:this.props.bodytypes, bodytypeSelectHandler:this.props.bodytypeSelectHandler}));\n\t\t\t}\n\t\t\tsElements.push(EngineGrades( {key:\"enginegrades\", componentDidMount:engineGradesMountHandler, settings:this.props.settings, configuration:this.props.configuration, grades:this.props.grades, enabledGrades:this.props.enabledGrades, gradeSelectHandler:this.props.gradeSelectHandler, motorizations:this.props.motorizations, motorizationSelectHandler:this.props.motorizationSelectHandler, controller:this.props.controller, enginePromos:this.props.enginePromos, gradePromos:this.props.gradePromos}));\n\t\t\telements.push(HContainer( {absolute:true, id:\"SecondaryContainer\", key:\"secondarycontainer\", top:header, bottom:secondaryContainerFooter, elements:sElements, componentDidMount:secondaryContainerMountHandler}));\n\t\t\t\n\t\t\t// Add the specification sheet\n\t\t\telements.push(\n\t\t\t\tSpecContainer( \n\t\t\t\t\t{key:\"speccontainer\", \n\t\t\t\t\tmonthlyRateToggleHandler:this.props.monthlyRateToggleHandler, \n\t\t\t\t\tshowMonthlyRate:this.props.showMonthlyRate, \n\t\t\t\t\tmonthlyRateToggleDefaultValue:this.props.monthlyRateToggleDefaultValue,\n\t\t\t\t\tsettings:this.props.settings, \n\t\t\t\t\teco:this.props.eco, \n\t\t\t\t\tdisclaimerData:disclaimerData?disclaimerData:null, \n\t\t\t\t\tcomponentDidMount:specContainerMountHandler, \n\t\t\t\t\tnavigate:this.props.navigate, \n\t\t\t\t\tspecProps:this.props.specProps, \n\t\t\t\t\tsummaryContent:this.props.summaryContent, \n\t\t\t\t\tconfiguration:this.props.configuration, \n\t\t\t\t\tcontroller:this.props.controller,\n\t\t\t\t\thasSubmodels:this.props.hasSubmodels}));\n\t\t\t\n\t\t\t// Add the financing\n\t\t\telements.push(ExternalFrame( {key:\"financing\", target:\"cc-financing-iframe\", componentDidMount:financingMountHandler, src:this.props.settings.financing, configuration:this.props.configuration, controller:this.props.controller}));\n\t\t\t\n\t\t\t// Add the insurance\n\t\t\telements.push(ExternalFrame( {key:\"insurance\", target:\"cc-insurance-iframe\", componentDidMount:insuranceMountHandler, src:this.props.settings.insurance, configuration:this.props.configuration, controller:this.props.controller}));\n\t\t\t\n\t\t\treturn(\n\t\t\t\tReact.DOM.section( {className:\"cc-bottomcontainer\"}, \n\t\t\t\t\tReact.DOM.div( {className:\"container cc-container\"}, \n\t\t\t\t\t\tReact.DOM.div( {className:\"clearfix\"}, \n\t\t\t\t\t\t\tHContainer( {updateHeight:containerHeightUpdated, elements:elements, id:\"MainContainer\", componentDidMount:mainContainerMountHandler})\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t};\n\t}", "title": "" }, { "docid": "dff1381f76a3f9a54d22f5427317fe5a", "score": "0.56709576", "text": "function ImageContainer(parentContainer) {\n\t// sets the objects parent container to the passed in parent container \n\tthis.parentContainer = $(parentContainer);\n\t// creates a new div element that will be appended to the objects parent container\n\tthis.element = $('<div>', {\n\t\tclass: 'image-container'\n\t});\n\t// creates a new image layout to handle the layout of the images\n\tthis.layout = new ImageLayout(this),\n\t// init function that runs on object creation after all variables have been set\n\tthis.init()\n}", "title": "" }, { "docid": "fa4a311646a7bea1e07714b7b150d737", "score": "0.56689066", "text": "constructor() {\n this._children = {};\n }", "title": "" }, { "docid": "60d1e79e0bec716c68b5682b11771a90", "score": "0.5660368", "text": "constructor() {\n super();\n this._items = [];\n }", "title": "" }, { "docid": "a91ef3f0390948d8a363ebc37bf094ba", "score": "0.5657419", "text": "getContainerStyle() {\n return {};\n }", "title": "" }, { "docid": "ec00233a273c11dc584ffbda484d0666", "score": "0.5646333", "text": "function DomContainer(element) {\n Container.call(this);\n this.element = element;\n this.reset();\n}", "title": "" }, { "docid": "1446d10e87172882ff7e8aa32c646796", "score": "0.5645329", "text": "_addSymbolContainer() {\n this._generateNewField();\n this._resizeField();\n }", "title": "" }, { "docid": "e9ea0ed08624dcc0dcdfa7afaa675067", "score": "0.5642098", "text": "function GlobalOperation() {\n this.mainContainer = [];\n}", "title": "" }, { "docid": "17de2455199e1c9fbaaa29b770ec9253", "score": "0.56374246", "text": "getContainer() {\n\n return this.domNode;\n\n }", "title": "" }, { "docid": "08889651bd13b0b6cf28e8de140c9589", "score": "0.5634043", "text": "function addNewContainer() {\n containers.push(new Container(contSize, contSize, contSize));\n}", "title": "" }, { "docid": "442beded96a592c345e1fbf63a04f51d", "score": "0.5632195", "text": "function ChildrenCollection(e) {\n this.element = e;\n this.updateCache();\n }", "title": "" }, { "docid": "bc32eabeba04d67145167515b4f3384b", "score": "0.56319785", "text": "constructor() {\n this.objects = {}\n }", "title": "" } ]
adca25a4e8a87f7ffef96e0afdaaf448
Fill the error object
[ { "docid": "85d6d11bab879b8d78a5b5b07e2e0aae", "score": "0.7473488", "text": "fill(errors = {}) {\n this.errors = errors;\n }", "title": "" } ]
[ { "docid": "d108e7d80dc796a0285a047067e48e2c", "score": "0.7259931", "text": "constructor() {\n this.errors = {}\n }", "title": "" }, { "docid": "7ed2c383a389cd6d790acaa8402de983", "score": "0.72236925", "text": "constructor() {\n this.errors = {};\n }", "title": "" }, { "docid": "26e76e30b56cb98ec1af6bee5a3d3111", "score": "0.72053456", "text": "fill(errors) {\n for (const error in errors) {\n if (!Object.prototype.hasOwnProperty.call(errors, error)) {\n continue\n }\n if (!(errors[error] instanceof Array)) {\n errors[error] = [errors[error]]\n }\n }\n this.errors = errors\n }", "title": "" }, { "docid": "5bb15134ded947016174885c5d7ed384", "score": "0.67506623", "text": "function setError_(result, error) {\n for (var k in error) {\n result[k] = error[k];\n }\n}", "title": "" }, { "docid": "decdd00a1896ea44b7014c71e1317289", "score": "0.67027336", "text": "function errorData(){ \n this.code= 0;\n this.message= null;\n}", "title": "" }, { "docid": "9dc2a09cfd20399db27c99f6db552e58", "score": "0.6566576", "text": "error(msg) { this.errors.push(new Error(msg, this)); }", "title": "" }, { "docid": "4a598741638d7ce5b27cfe803255265c", "score": "0.6489304", "text": "putError() {\n this.flag = true;\n this.error_list.push({\"msg\" : this.message, \"line\" : this.line});\n return;\n }", "title": "" }, { "docid": "1344eb3a0674259f050660d416e927bc", "score": "0.64829844", "text": "setError(fieldName, errors) {\n this.errors = Object.assign({}, this.errors, { [fieldName]: errors });\n }", "title": "" }, { "docid": "5b22dd860c8915bc7532feb19d07a637", "score": "0.63339484", "text": "static get errors() { return _e; }", "title": "" }, { "docid": "3e1f6602146c2d5662262775968f34c2", "score": "0.622362", "text": "initErrors (fields) {\n fields.forEach((field) => {\n this.errors[field] = []\n })\n }", "title": "" }, { "docid": "d82c34ef1380e704960cb334ed0259f2", "score": "0.6183218", "text": "clearError() {\n this.error = false;\n this._errortext = this.__initalErrorText;\n }", "title": "" }, { "docid": "1ee3b107be71ff1c2134ac0470e64df7", "score": "0.6153512", "text": "constructor(message, options = {}) {\n super(message);\n //Here I can add any additional information I want included with the error\n\n for (const [key, value] of Object.entries(options)) {\n this[key] = value; \n }\n }", "title": "" }, { "docid": "2462c7e5f76575b2d9558874656f5328", "score": "0.61100334", "text": "function errorInit(msg) {\r\n this._super(msg);\r\n }", "title": "" }, { "docid": "0c8f9c273e27d8ccf6320d10f3a6e8d9", "score": "0.6108573", "text": "constructor(error) {\n this.error = error; //holds the error object in its entirety\n this.message = null; //reassigned when res.send() is triggered with given message\n this.code = null; //reassigned when res.status() is triggered with given error code \n }", "title": "" }, { "docid": "254ab61266431bcf01a7fb2723ac63d6", "score": "0.6060395", "text": "get error() {\n return this._error;\n }", "title": "" }, { "docid": "254ab61266431bcf01a7fb2723ac63d6", "score": "0.6060395", "text": "get error() {\n return this._error;\n }", "title": "" }, { "docid": "56a99ecf8503eddf81d8dbfdcff75412", "score": "0.6056182", "text": "function myError(error) {\n this.error = error;\n }", "title": "" }, { "docid": "9505c01e12327c990063724b682dec63", "score": "0.6050037", "text": "function getError(obj) {\r\n var rtn = {};\r\n\r\n rtn.title = \"Error\";\r\n rtn.message = (obj.message||\"\");\r\n rtn.code = (obj.code||\"\");\r\n rtn.url = (obj.url||\"\");\r\n \r\n return rtn;\r\n}", "title": "" }, { "docid": "b819f986406efdb14b77ee38d105c7c6", "score": "0.60205585", "text": "function initError(msg) {\n\tvar errMsg;\n\ttry {\n\t\terrMsg = JSON.parse(msg[3]);\n\t} catch(err) {\n\t\treturn new Error('Error requesting procedure listing');\n\t}\n\treturn new Error(errMsg);\n}", "title": "" }, { "docid": "97274105385574a7f36bc31385d80926", "score": "0.6004992", "text": "function getErrorInfoObject() {\n return {\n Message: \"A JavaScript error has occured inside Compass.\",\n UserId: null,\n LoanSkey: null,\n FileName: null,\n LineNo: null,\n ColNo: null,\n XhrUrl: null,\n XhrData: null,\n Error: null,\n ExceptionType: null,\n StackTrace: null,\n CallingFunction: null,\n Misc: null,\n isXhrError: false, // Error source is Xhr (ie. jquery ajax) or JavaScript (ie. window onerror)\n BrowserInfo: null,\n Url: null\n }\n }", "title": "" }, { "docid": "50cc1475ba02e6ffe8476774d5a016be", "score": "0.59453917", "text": "function resetError() {\n vm.error = false;\n vm.success = false;\n vm.validationError = {};\n }// end of resetError function", "title": "" }, { "docid": "eefe45efd35851260b92c9798c06a119", "score": "0.5944682", "text": "function replaceErrors(key, value) {\r\n if (value instanceof Error) {\r\n return Object.getOwnPropertyNames(value).reduce(function(\r\n error,\r\n key\r\n ) {\r\n error[key] = value[key];\r\n return error;\r\n },\r\n {});\r\n }\r\n return value;\r\n }", "title": "" }, { "docid": "fa0e774f66154d609f0c49a3f6a1918b", "score": "0.5941552", "text": "setError(error) {\n var message;\n // add error messages for invalid properties value\n if (_.indexOf(['required', 'additionalProperties', 'const', 'enum', 'maxLength', 'minLength', 'type', 'pattern', 'format', 'minimum', 'maximum', 'dependencies', 'anyOf', 'oneOf'], error.keyword) !== -1) {\n message = this.getPreDefinedErrorMessage(error);\n }\n if (message) {\n return this.addError({\n \"type\": error.keyword,\n \"property\": this.getPropertyName(error),\n \"message\": message\n });\n }\n }", "title": "" }, { "docid": "abdd8a99cdaf1952a8358dbd553335b3", "score": "0.59413034", "text": "addErrors(mission) {\n //Object.assign(this.allErrors, mission.allErrors)\n }", "title": "" }, { "docid": "8cec594f6de8d953c4ca97ae4911b47b", "score": "0.5936039", "text": "function errorInit(gl) {\n errorBuild()\n errorUploadData(gl);\n}", "title": "" }, { "docid": "81aa203d318aff76541a175d968e0a65", "score": "0.59285694", "text": "updateError() {\n if (this._error === null) return;\n\n this._error.innerHTML = this._field.validationMessage;\n }", "title": "" }, { "docid": "9659a5771112a13857cc223fc40cb07e", "score": "0.59189594", "text": "function setError(error) {\n\t\t\tself.error = error;\n\t\t}", "title": "" }, { "docid": "9659a5771112a13857cc223fc40cb07e", "score": "0.59189594", "text": "function setError(error) {\n\t\t\tself.error = error;\n\t\t}", "title": "" }, { "docid": "7006d7826f3836be5a194a400f684533", "score": "0.59182435", "text": "function initError() {\n $scope.status[\"generalView\"] = \"error\"; //console.log(\"error\")\n }", "title": "" }, { "docid": "9fe540b51bdbebd7d92637891adc1517", "score": "0.5917756", "text": "function e(A,t){this.name=\"OAuthError\",this.message=t,this.errorCode=A,this.errorSummary=t}", "title": "" }, { "docid": "9fe540b51bdbebd7d92637891adc1517", "score": "0.5917756", "text": "function e(A,t){this.name=\"OAuthError\",this.message=t,this.errorCode=A,this.errorSummary=t}", "title": "" }, { "docid": "5511a612aadecb97893437db07ea2245", "score": "0.59134555", "text": "constructor(value = {}) {\n this.value = value\n this.errors = []\n this.warnings = []\n }", "title": "" }, { "docid": "68bf916e799f8bf7de6fea233069d598", "score": "0.59080666", "text": "get error() {\n\t\treturn this.__error;\n\t}", "title": "" }, { "docid": "8f67124176b149416ef6835fd2bea135", "score": "0.5886501", "text": "clearError() {\n this.alert = {};\n }", "title": "" }, { "docid": "82b3f92f2b9b06b8310ed84c25780351", "score": "0.58795345", "text": "function replaceErrors(key, value) {\n if (value instanceof Error) {\n return Object.getOwnPropertyNames(value).reduce(function(\n error,\n key\n ) {\n error[key] = value[key];\n return error;\n },\n {});\n }\n return value;\n }", "title": "" }, { "docid": "82b3f92f2b9b06b8310ed84c25780351", "score": "0.58795345", "text": "function replaceErrors(key, value) {\n if (value instanceof Error) {\n return Object.getOwnPropertyNames(value).reduce(function(\n error,\n key\n ) {\n error[key] = value[key];\n return error;\n },\n {});\n }\n return value;\n }", "title": "" }, { "docid": "e6450f2647a176e27efd00f44208808d", "score": "0.58775914", "text": "error(message) {\r\n const err = new Error(`${message} at offset ${this.pos}`);\r\n return err;\r\n }", "title": "" }, { "docid": "3a28567a15162813f1d2b52b7bc9a941", "score": "0.5877092", "text": "get error() {\n const prop = this.property;\n\n return class ErrorWrapper {\n static as(msg, code) {\n return errorGen.createErrorMsg(prop, msg, code);\n }\n\n static asCode(code) {\n return errorGen.createErrorMsg(prop, null, code);\n }\n\n static get notNull() {\n return errorGen.createNotNullMsg(prop);\n }\n\n static get invalidValue() {\n return errorGen.createInvalidValue(prop);\n }\n\n static get maxSize() {\n return errorGen.createMaxSizeMsg(prop);\n }\n\n static get minSize() {\n return errorGen.createMinSizeMsg(prop);\n }\n\n static get maxValue() {\n return errorGen.createMaxValueMsg(prop);\n }\n\n static get minValue() {\n return errorGen.createMinValueMsg(prop);\n }\n };\n }", "title": "" }, { "docid": "23f89cdeaeb40e7639b03be6f09436f3", "score": "0.58727026", "text": "formatError(error) {\n // Error is already formatted ?\n if (typeof error.code === 'undefined') {\n const newError = new errors_1.InternalError(error.message);\n newError.stack = error.stack;\n return newError;\n }\n return error;\n }", "title": "" }, { "docid": "c35fd301ecba43bec96bd95e953c86f6", "score": "0.58723694", "text": "function makeErr(err, seq) {\n err._bulk_seq = seq;\n return err;\n }", "title": "" }, { "docid": "c35fd301ecba43bec96bd95e953c86f6", "score": "0.58723694", "text": "function makeErr(err, seq) {\n err._bulk_seq = seq;\n return err;\n }", "title": "" }, { "docid": "d5405f6ed26af1532c359ee915d2e19d", "score": "0.58685505", "text": "error(message) {\n const err = new Error(`${message} at offset ${this.pos}`);\n return err;\n }", "title": "" }, { "docid": "e0260c8bf48ba7ebf2775442145d7102", "score": "0.5867977", "text": "error(error) {}", "title": "" }, { "docid": "bb4ae5c3514af70513d0f90cf576f588", "score": "0.5837976", "text": "function Etask_err(err){ this.error = err || new Error(); }", "title": "" }, { "docid": "bb4ae5c3514af70513d0f90cf576f588", "score": "0.5837976", "text": "function Etask_err(err){ this.error = err || new Error(); }", "title": "" }, { "docid": "27051be26116701c2f18f88db6ccaa24", "score": "0.58335024", "text": "function createError(err){\n store.error = (err)\n}", "title": "" }, { "docid": "97b8fbb4893b62d212b5e766448aa2ee", "score": "0.5801975", "text": "clearSignUpError() {\n Object.entries(this.errorObj.signUp).forEach(([key, val]) => {\n this.errorObj.signUp[key] = null;\n });\n this.errorSubject.next(this.errorObj);\n }", "title": "" }, { "docid": "ac3bdb8dc9c3bc7b459200da6d1b0290", "score": "0.579994", "text": "function n(e,t){this.name=\"OAuthError\",this.message=t,this.errorCode=e,this.errorSummary=t}", "title": "" }, { "docid": "77cb5dcc842a32d4716d4b56a4bd04f1", "score": "0.5798298", "text": "createError(key, e, label) {\n let locale = this.options.locale || 'en';\n let name = label ? label : this.buildPath(this.path, key || '');\n let errorMsg = magico.get(this.schema._error, locale);\n e = e || new Error('validation failed');\n\n if (errorMsg) {\n this.errors = this.errors.reset().add(name, errorMsg);\n } else {\n this.errors.add(name, e);\n }\n }", "title": "" }, { "docid": "d2837a8b10a7c4bfb8bce8797d7838a8", "score": "0.57959104", "text": "function replaceErrors(key, value) {\n if (value instanceof Error) {\n return Object.getOwnPropertyNames(value).reduce(function(error, key) {\n error[key] = value[key];\n return error;\n }, {});\n }\n return value;\n }", "title": "" }, { "docid": "ab4b9546afefa69175a2180560a50c02", "score": "0.57955223", "text": "reset () {\n Object.keys(this.errors).forEach((field) => {\n this.errors[field] = []\n })\n }", "title": "" }, { "docid": "96d294f3e2611f48950d13282edf5407", "score": "0.5793241", "text": "function errorModel(app, values={}, errors={}) {\n return {\n base: app.locals.ws.url,\n errors: errors._,\n fields: fieldsWithValues(values, errors)\n };\n}", "title": "" }, { "docid": "7089c6598a364bf376d2dfd46ead11eb", "score": "0.5790121", "text": "setErrorInfo ({commit}, errorObj) {\n\t\tconsole.log(' the errorObj is : ------- ', errorObj);\n\t\tcommit('SET_ERROR_DATA_INFO', errorObj);\n\t}", "title": "" }, { "docid": "be178d9fe198d0e2d14828faadaa1c86", "score": "0.5781114", "text": "function errors() {}", "title": "" }, { "docid": "cbbba19f50fd66c50512366fcabc2413", "score": "0.5778345", "text": "function setFieldErrors(name, newErrors) {\n _setErrors(_objectSpread(_objectSpread({}, errors), {}, _defineProperty({}, name, newErrors)));\n }", "title": "" }, { "docid": "f960f60c9cbf552fd221b1ddf1db823f", "score": "0.57772833", "text": "setError(key, error) {\n let errors = this.state.errors;\n if (this.state.errors[key] !== error) {\n errors[key] = error;\n return errors;\n }\n return errors;\n }", "title": "" }, { "docid": "cec29a5fedbef067d6b16eb2dfcf12f0", "score": "0.57758623", "text": "function makeErr(err, seq) {\n err._bulk_seq = seq;\n return err;\n }", "title": "" }, { "docid": "cec29a5fedbef067d6b16eb2dfcf12f0", "score": "0.57758623", "text": "function makeErr(err, seq) {\n err._bulk_seq = seq;\n return err;\n }", "title": "" }, { "docid": "677a7db1219beab9c31b746300bcc69a", "score": "0.57542497", "text": "reset () {\n for (let field in this.originalData) {\n this[field] = ''\n }\n this.errors.reset()\n }", "title": "" }, { "docid": "2afc934c4557178fad55c6808a8a728f", "score": "0.5742027", "text": "constructor({ response: { data, status, statusText } }) {\n super();\n\n Object.assign(this, {\n data,\n name: 'RequestError',\n status,\n statusText,\n });\n }", "title": "" }, { "docid": "61506f440b9b82c1ebc144736362d308", "score": "0.573706", "text": "function Errors() {\n _classCallCheck(this, Errors);\n\n this.errors = {};\n }", "title": "" }, { "docid": "61506f440b9b82c1ebc144736362d308", "score": "0.573706", "text": "function Errors() {\n _classCallCheck(this, Errors);\n\n this.errors = {};\n }", "title": "" }, { "docid": "61506f440b9b82c1ebc144736362d308", "score": "0.573706", "text": "function Errors() {\n _classCallCheck(this, Errors);\n\n this.errors = {};\n }", "title": "" }, { "docid": "5cf9bbc643a21269c90365a42fb046d8", "score": "0.57239395", "text": "clearErrorMessage () {\n this.error = null\n }", "title": "" }, { "docid": "97666459492d992fa9f596266b6c9d4a", "score": "0.5696457", "text": "error(message) {\n records.push({\n message,\n dateTime: new Date(),\n type: 'error'\n });\n }", "title": "" }, { "docid": "a41326e30733fcf7bb8d17a42ca49c7a", "score": "0.56905645", "text": "fetchDataErrorMsg(error){\n return error.response.data.errors.message[0];\n }", "title": "" }, { "docid": "49ceadc34de73c7e3004155aa3a3650b", "score": "0.5682719", "text": "function QPErrorReporter() {\n this.errors = [];\n }", "title": "" }, { "docid": "366d0bde0f22076c942db8f9ecdcd02a", "score": "0.56742626", "text": "fetchErrorMsg(error){\n return error.errors.message[0];\n }", "title": "" }, { "docid": "b580cab31d5ff717b34aa3f0dd0fb49d", "score": "0.5673402", "text": "function replaceErrors(key, value) {\n if (value instanceof Error) {\n return Object.getOwnPropertyNames(value).reduce(function(error, key) {\n error[key] = value[key];\n return error;\n }, {});\n }\n return value;\n}", "title": "" }, { "docid": "35267f4c8e5c94648f4667d82576644a", "score": "0.5667385", "text": "function e(A,t){this.name=\"AuthApiError\",this.message=A.errorSummary,this.errorSummary=A.errorSummary,this.errorCode=A.errorCode,this.errorLink=A.errorLink,this.errorId=A.errorId,this.errorCauses=A.errorCauses,t&&(this.xhr=t)}", "title": "" }, { "docid": "35267f4c8e5c94648f4667d82576644a", "score": "0.5667385", "text": "function e(A,t){this.name=\"AuthApiError\",this.message=A.errorSummary,this.errorSummary=A.errorSummary,this.errorCode=A.errorCode,this.errorLink=A.errorLink,this.errorId=A.errorId,this.errorCauses=A.errorCauses,t&&(this.xhr=t)}", "title": "" }, { "docid": "1b7c38bcd32161057a1d7785e1cb17c6", "score": "0.56544906", "text": "function normalizeError(err_like = {}) {\n // Erro-like objects are sometime fancy!\n // - seen: in browser, sometimes, an error-like, un-writable object is thrown\n // - seen: frozen\n // - seen: non-enumerable props\n // So we want to ensure a true, safe, writable error object.\n var _a, _b; // Yes, we always re-create in case\n\n\n const p = Object.getPrototypeOf(err_like); // should we restrict to global standard constructors? TBD\n\n const constructor = ((_b = (_a = p === null || p === void 0 ? void 0 : p.constructor) === null || _a === void 0 ? void 0 : _a.name) === null || _b === void 0 ? void 0 : _b.endsWith('Error')) ? p.constructor : Error; // https://stackoverflow.com/questions/1606797/use-of-apply-with-new-operator-is-this-possible\n\n const true_err = new (Function.prototype.bind.call(constructor, null, err_like.message || `(non-error caught: \"${err_like}\")`))();\n /*const true_err: XXError = new Error(\n err_like.message || `(non-error caught: \"${err_like}\")`,\n )*/\n // properly attach fields if they exist\n\n _fields__WEBPACK_IMPORTED_MODULE_0__[/* COMMON_ERROR_FIELDS_EXTENDED */ \"b\"].forEach(prop => {\n //if (prop in err_like)\n if (err_like[prop]) true_err[prop] = err_like[prop];\n });\n return true_err;\n}", "title": "" }, { "docid": "edec8532ae7b13573a5f6dd1c54fd907", "score": "0.564524", "text": "function e(A,t){this.name=\"AuthSdkError\",this.message=A,this.errorCode=\"INTERNAL\",this.errorSummary=A,this.errorLink=\"INTERNAL\",this.errorId=\"INTERNAL\",this.errorCauses=[],t&&(this.xhr=t)}", "title": "" }, { "docid": "edec8532ae7b13573a5f6dd1c54fd907", "score": "0.564524", "text": "function e(A,t){this.name=\"AuthSdkError\",this.message=A,this.errorCode=\"INTERNAL\",this.errorSummary=A,this.errorLink=\"INTERNAL\",this.errorId=\"INTERNAL\",this.errorCauses=[],t&&(this.xhr=t)}", "title": "" }, { "docid": "76ccd3aa1cf939445988fae1b8bc2082", "score": "0.5644218", "text": "function replaceErrors(key, value) {\n if (value instanceof Error) {\n return Object.getOwnPropertyNames(value).reduce(function(error, key) {\n error[key] = value[key];\n return error;\n }, {});\n }\n return value;\n}", "title": "" }, { "docid": "0e167b3a145bce1678ef67766a8d947e", "score": "0.5640414", "text": "function setError(idx) {\n if (!idx) {\n idx = _idx;\n }\n setPositionAsError(idx);\n}", "title": "" }, { "docid": "fad7f84687f139735ba068a785e5b1af", "score": "0.5633589", "text": "function apiError() {\n $this.message = $this.config.msgAPIError || $this.defaultconfig.msgAPIError;\n $this.messageClass = \"alert alert-warning\";\n }", "title": "" }, { "docid": "397b60735ba325fb499c30f0ff751773", "score": "0.5623448", "text": "refreshValidationState() {\n super.refreshValidationState()\n this._errors = {}\n }", "title": "" }, { "docid": "6c498782aa81b3f993c8f28ccad65c7b", "score": "0.5622287", "text": "constructor(message,statusCode){ //constructor called each time we create an obj\n super(message);//bcz we extend so need to call the parent class constructor,bnuiltin error only accepts message.\n this.statusCode = statusCode;\n //status may be either fail or error, if 400 then status fail else if 500 then error\n this.status = `${statusCode}`.startsWith('4') ? 'fail' : 'error';\n this.isOpeational = true; //predict the operational errors, e.g user create tour withour required fields\n //When a new obj is created and a function constructor is called, that function call does't appear \n //in the stack trace and will not pollute it.\n Error.captureStackTrace(this,this.constructor); //Don't want to add this class in the err stack, \n //1sat para is this is current obj, 2nd para is AppError class itself\n }", "title": "" }, { "docid": "c858e5d68bcc6ea0d31ebcb426caad32", "score": "0.56112266", "text": "function CustomError() {}", "title": "" }, { "docid": "c858e5d68bcc6ea0d31ebcb426caad32", "score": "0.56112266", "text": "function CustomError() {}", "title": "" }, { "docid": "8b43ff7d829a71630f6a82429780c61e", "score": "0.5610821", "text": "function handleUploadErrors(index, data) {\n if (_.undefined(data.data)) {\n $scope.uploadInfos[index].otherError = {};\n $scope.uploadInfos[index].otherError.code = data.error.code;\n $scope.uploadInfos[index].otherError.message = data.error.message;\n } else if (_.defined(data.data.errors) && _.size(data.data.errors) > 0) {\n $scope.uploadInfos[index].errors = data.data.errors;\n }\n }", "title": "" }, { "docid": "c5182073d03941be64c1ff6d89234b9a", "score": "0.5606789", "text": "reset() {\n this.errors.clear();\n\n for(let field in this.originalData) {\n this[field] = '';\n }\n }", "title": "" }, { "docid": "9aa12aa2e9091f500145b0f980b45df8", "score": "0.5602548", "text": "function handleError(error) {\n var tempErrObj = { type: \"ERROR\", message: error };\n console.log(tempErrObj);\n}", "title": "" }, { "docid": "2b1dc992060cd935097d18eeb1cd5f54", "score": "0.56007314", "text": "function Error( message ) {\n\t\tthis.message=message;\n\t\tthis.name=new String;\n\t}", "title": "" }, { "docid": "0e6b83ad937e9fdfcb2b16fb17c7482e", "score": "0.5599604", "text": "getError() {\r\n return this.err;\r\n }", "title": "" }, { "docid": "1060a911d8023553e9ee8b639d8314db", "score": "0.5595446", "text": "function resetErrors() {\n const { ...newFields } = state.fields;\n\n Object.keys(newFields).forEach(field => {\n newFields[field] = updateFieldData(newFields[field], { error: null });\n });\n\n setState({\n fields: newFields,\n });\n }", "title": "" }, { "docid": "a5849210f195f8f3267051a71920e60b", "score": "0.55904466", "text": "get errors() {\n return this._errors;\n }", "title": "" }, { "docid": "aeb70815ee7af31f6cd88e9f6a8983c5", "score": "0.55902916", "text": "function createErrorMessage (error) {\n return {\n ...baseMsg,\n text: 'Error',\n blocks: [ createSection(`:no_entry: ${error.toString() || 'Internal server error'}`) ]\n }\n}", "title": "" }, { "docid": "04fbd765589a92b98d717364d8b141cc", "score": "0.559", "text": "function extrapolateDeviceErrorData(data) {\n var compiledMessage = '';\n\n // Get the error description (if it exists);\n var description = modbus_map.getErrorInfo(data.code).description;\n data.description = description;\n\n // Format the \"caller\" information\n var callInfo = [];\n var callKeys = Object.keys(data.data);\n callKeys.forEach(function(callKey) {\n callInfo.push(\n // '\"' + callKey + '\": ' + data.data[callKey].toString()\n callKey + ': ' + JSON.stringify(data.data[callKey])\n );\n });\n callInfo = callInfo.join(', ');\n data.callInfo = callInfo;\n return data;\n}", "title": "" }, { "docid": "1e17955cfd2d646f0bfe70269d69f52d", "score": "0.55886483", "text": "function onError(data) {\n error = data;\n }", "title": "" }, { "docid": "0f51cd39b1315af1735c34fba3bb766e", "score": "0.55652905", "text": "error() {\n this.set('_state', 'error');\n }", "title": "" }, { "docid": "162c70bf3a3ded98d2ac10a96747cd5a", "score": "0.55645", "text": "function saveError(error) {\n this.status.error = error;\n}", "title": "" }, { "docid": "73a59968f61d448a5324287011dbb988", "score": "0.55622023", "text": "function enrichValidateError (e, meta) {\n // ensure e is throw by egg-validate\n if (e.code === 'invalid_param') {\n for (const error of e.errors) {\n Object.assign(error, meta)\n }\n }\n}", "title": "" }, { "docid": "c57d57631029c737741ecb2c41feb234", "score": "0.5561913", "text": "genErrorMessage(error) {\n this.clearLoadingIndicator();\n if (error.message && error.message.indexOf('JSON.parse') !== -1) {\n console.error('Error:', error);\n } else if (error.message && error.message.indexOf('Unexpected token') !== -1) {\n this.errorMsg = 'Error 404: Resource not found';\n this.requestUpdate();\n console.error(this.errorMsg);\n } else {\n if (error.status) {\n if (error.statusText !== '') {\n this.errorMsg = `Error ${error.status}: ${error.statusText}`;\n } else if (error.status === 401) {\n this.errorMsg = 'Error 401: Authentication error';\n } else if (error.status === 500) {\n this.errorMsg = 'Error 500: Internal server error';\n } else {\n this.errorMsg = `Error ${error.status}`;\n }\n } else if (error.name && error.message) {\n this.errorMsg = `Error ${error.name}: ${error.message}`;\n } else if (typeof error === 'string') {\n this.errorMsg = error;\n } else {\n this.errorMsg = 'Critical error';\n }\n this.requestUpdate();\n console.error('Error:', error);\n }\n }", "title": "" }, { "docid": "36c55aaaf2cc1e0c2ff40b3a58354906", "score": "0.5557", "text": "function errorMissingMessage () {\n return {\n status: true,\n message: 'Missing required values'\n };\n}", "title": "" }, { "docid": "6d7fe6f31dbd31eb2bac333bb0df4117", "score": "0.5552446", "text": "_setErrorContext(ex, node) {\n // $FlowFixMe[prop-missing]\n ex.currentNode = {\n type: node.type,\n range: node.range,\n loc: node.loc\n };\n }", "title": "" }, { "docid": "ebe7fb745564f57892ed42688be86639", "score": "0.5548099", "text": "getValidationErrors() {\n return {};\n }", "title": "" }, { "docid": "78132c944ba1469681e216dfe57036ec", "score": "0.55474156", "text": "resetErrors() {\n this._errorCollection = new ErrorCollection(\"formobject\");\n this.attributeCollection.forEach((attribute) => attribute.resetErrors());\n }", "title": "" }, { "docid": "fecd7b9bc4e2692348c639b9e9cb818f", "score": "0.5542582", "text": "function n(e,t){this.name=\"AuthApiError\",this.message=e.errorSummary,this.errorSummary=e.errorSummary,this.errorCode=e.errorCode,this.errorLink=e.errorLink,this.errorId=e.errorId,this.errorCauses=e.errorCauses,t&&(this.xhr=t)}", "title": "" } ]
324502127fbe2907548c20288e3767d4
[Please add a description.]
[ { "docid": "5d355ace0bfa5edffebf5a000efc79d4", "score": "0.0", "text": "function cleanJSXElementLiteralChild(child, args) {\n var lines = child.value.split(/\\r\\n|\\n|\\r/);\n\n var lastNonEmptyLine = 0;\n\n for (var i = 0; i < lines.length; i++) {\n if (lines[i].match(/[^ \\t]/)) {\n lastNonEmptyLine = i;\n }\n }\n\n var str = \"\";\n\n for (var i = 0; i < lines.length; i++) {\n var line = lines[i];\n\n var isFirstLine = i === 0;\n var isLastLine = i === lines.length - 1;\n var isLastNonEmptyLine = i === lastNonEmptyLine;\n\n // replace rendered whitespace tabs with spaces\n var trimmedLine = line.replace(/\\t/g, \" \");\n\n // trim whitespace touching a newline\n if (!isFirstLine) {\n trimmedLine = trimmedLine.replace(/^[ ]+/, \"\");\n }\n\n // trim whitespace touching an endline\n if (!isLastLine) {\n trimmedLine = trimmedLine.replace(/[ ]+$/, \"\");\n }\n\n if (trimmedLine) {\n if (!isLastNonEmptyLine) {\n trimmedLine += \" \";\n }\n\n str += trimmedLine;\n }\n }\n\n if (str) args.push(t.literal(str));\n}", "title": "" } ]
[ { "docid": "824ab99a5ec7c7123dda9c34f71f4e9c", "score": "0.54873186", "text": "[foo ()] () { //what's going on with this syntax?!\n\t\treturn 'foo';\n\t}", "title": "" }, { "docid": "7006832e646e4b2214ae75621a32624e", "score": "0.5394402", "text": "\n (){}", "title": "" }, { "docid": "634b597f7bda1d19ac7bc83d724dafd7", "score": "0.5392266", "text": "*[c + 'gn']() {}", "title": "" }, { "docid": "77b1e9ef34467b46fd16fe609200e201", "score": "0.529372", "text": "function isIdentifierNameContext(node) {\n var type = node.type;\n // property initializer nodes have no .type; they have a .kind but so do\n // labels\n return type === 'MemberExpression' || !!(node.kind && node.key);\n }", "title": "" }, { "docid": "c3e284c144eee132203d9b82ab745355", "score": "0.52657306", "text": "function ExampleFlatNode() { }", "title": "" }, { "docid": "745871125edca45a26cb03b19a56501e", "score": "0.5255753", "text": "function foo() { /* */}", "title": "" }, { "docid": "5d75455381bc15e53aef245a07ed0af8", "score": "0.52350575", "text": "method0() {\n /**\n * This is a property1.\n * @member {string}\n */\n this.property1 = \"value1\";\n\n /**\n * This is a class inside a method. It should have an inner scope.\n */\n class MethodClass {\n\n }\n\n /**\n * This exposes MethodClass as a member of TestClass.\n * @member {Class}\n */\n OtherClass.AliasClass = MethodClass;\n }", "title": "" }, { "docid": "bb014bd0eae00d9ac29a189db451b3e9", "score": "0.52263594", "text": "function canHaveVariableDeclarationOrExpression(){return (this.key === \"init\" || this.key === \"left\") && this.parentPath.isFor();}", "title": "" }, { "docid": "b38d757a4e444e35523d5e34a0a31160", "score": "0.5214248", "text": "function anonOperationNotAloneMessage() {\n return 'This anonymous operation must be the only defined operation.';\n}", "title": "" }, { "docid": "b38d757a4e444e35523d5e34a0a31160", "score": "0.5214248", "text": "function anonOperationNotAloneMessage() {\n return 'This anonymous operation must be the only defined operation.';\n}", "title": "" }, { "docid": "b38d757a4e444e35523d5e34a0a31160", "score": "0.5214248", "text": "function anonOperationNotAloneMessage() {\n return 'This anonymous operation must be the only defined operation.';\n}", "title": "" }, { "docid": "b38d757a4e444e35523d5e34a0a31160", "score": "0.5214248", "text": "function anonOperationNotAloneMessage() {\n return 'This anonymous operation must be the only defined operation.';\n}", "title": "" }, { "docid": "b38d757a4e444e35523d5e34a0a31160", "score": "0.5214248", "text": "function anonOperationNotAloneMessage() {\n return 'This anonymous operation must be the only defined operation.';\n}", "title": "" }, { "docid": "b38d757a4e444e35523d5e34a0a31160", "score": "0.5214248", "text": "function anonOperationNotAloneMessage() {\n return 'This anonymous operation must be the only defined operation.';\n}", "title": "" }, { "docid": "2946e9bf22d0ecc80c255d6a7cd2d474", "score": "0.5209973", "text": "function test0() {\r\n (function () {\r\n function foo() {\r\n eval(\"\");\r\n };\r\n })();\r\n {\r\n var x = 1;/**bp:locals();**/\r\n function bar() {}\r\n function bar() { return 1;}\r\n }\r\n}", "title": "" }, { "docid": "2f556423b29e3648637982e9e939045f", "score": "0.51474625", "text": "function visitIdentifier(context, node, scope, state) {\n // check if this node matches our function id\n if (node.name !== state.name) return;\n\n // check that we don't have a local variable declared as that removes the need\n // for the wrapper\n var localDeclar = scope.getBindingIdentifier(state.name);\n if (localDeclar !== state.outerDeclar) return;\n\n state.selfReference = true;\n context.stop();\n}", "title": "" }, { "docid": "993afa2a9800018e3c07d351fe74512c", "score": "0.51350313", "text": "function F(i){return(t,e)=>e!==void 0?((o,s,r)=>{s.constructor.createProperty(r,o)})(i,t,e):Ia(i,t)}", "title": "" }, { "docid": "996bdd30748207dc6b4cf3cd1005e590", "score": "0.5126621", "text": "function jh1037638() { return 'a.op'; }", "title": "" }, { "docid": "97bed369aaefb2f3cd957812579ea7fb", "score": "0.507101", "text": "function i(e){return void 0===e&&(e=null),Object(r[\"n\"])(null!==e?e:o)}", "title": "" }, { "docid": "ff2f2c5f1807a7984d5c740a469fb449", "score": "0.50548506", "text": "function inner() {\r\n\t\t\tvar i2 = 1,\r\n\t\t\t\tj2 = 1;\r\n\r\n\t\t\treturn i2 + j2;\r\n\t\t}", "title": "" }, { "docid": "4774298395adb78824f1b26e6ba789e9", "score": "0.50541866", "text": "function ni(t){var e=ii();return function(){var n,i=Object(ht[\"a\"])(t);if(e){var r=Object(ht[\"a\"])(this).constructor;n=rt()(i,arguments,r)}else n=i.apply(this,arguments);return Object(vt[\"a\"])(this,n)}}", "title": "" }, { "docid": "aa2086d8c1c571627c4fbbb92a0ba358", "score": "0.5042813", "text": "static BeginProperty() {}", "title": "" }, { "docid": "c72bc666c6436514b24eec925e3233db", "score": "0.50424665", "text": "expand(node) {}", "title": "" }, { "docid": "b0ab7013cdb5b4c55b50f70ab9c5f182", "score": "0.503996", "text": "function isReferenced(node,parent){switch(parent.type){ // yes: PARENT[NODE]\n// yes: NODE.child\n// no: parent.NODE\ncase \"MemberExpression\":case \"JSXMemberExpression\":if(parent.property === node && parent.computed){return true;}else if(parent.object === node){return true;}else {return false;} // no: new.NODE\n// no: NODE.target\ncase \"MetaProperty\":return false; // yes: { [NODE]: \"\" }\n// yes: { NODE }\n// no: { NODE: \"\" }\ncase \"Property\":if(parent.key === node){return parent.computed;} // no: var NODE = init;\n// yes: var id = NODE;\ncase \"VariableDeclarator\":return parent.id !== node; // no: function NODE() {}\n// no: function foo(NODE) {}\ncase \"ArrowFunctionExpression\":case \"FunctionDeclaration\":case \"FunctionExpression\":var _arr=parent.params;for(var _i=0;_i < _arr.length;_i++) {var param=_arr[_i];if(param === node)return false;}return parent.id !== node; // no: export { foo as NODE };\n// yes: export { NODE as foo };\n// no: export { NODE as foo } from \"foo\";\ncase \"ExportSpecifier\":if(parent.source){return false;}else {return parent.local === node;} // no: <div NODE=\"foo\" />\ncase \"JSXAttribute\":return parent.name !== node; // no: import NODE from \"foo\";\n// no: import * as NODE from \"foo\";\n// no: import { NODE as foo } from \"foo\";\n// no: import { foo as NODE } from \"foo\";\n// no: import NODE from \"bar\";\ncase \"ImportDefaultSpecifier\":case \"ImportNamespaceSpecifier\":case \"ImportSpecifier\":return false; // no: class NODE {}\ncase \"ClassDeclaration\":case \"ClassExpression\":return parent.id !== node; // yes: class { [NODE](){} }\ncase \"MethodDefinition\":return parent.key === node && parent.computed; // no: NODE: for (;;) {}\ncase \"LabeledStatement\":return false; // no: try {} catch (NODE) {}\ncase \"CatchClause\":return parent.param !== node; // no: function foo(...NODE) {}\ncase \"RestElement\":return false; // yes: left = NODE;\n// no: NODE = right;\ncase \"AssignmentExpression\":return parent.right === node; // no: [NODE = foo] = [];\n// no: [foo = NODE] = [];\ncase \"AssignmentPattern\":return false; // no: [NODE] = [];\n// no: ({ NODE }) = [];\ncase \"ObjectPattern\":case \"ArrayPattern\":return false;}return true;}", "title": "" }, { "docid": "dad95b9b3cf1cadfdbefd0c0ce6cc329", "score": "0.5018254", "text": "function getOuterFnExpr(funPath){var node=funPath.value;n.Function.assert(node);if(node.generator && // Non-generator functions don't need to be marked.\nn.FunctionDeclaration.check(node)){var pp=funPath.parent;while(pp && !(n.BlockStatement.check(pp.value) || n.Program.check(pp.value))) {pp = pp.parent;}if(!pp){return node.id;}var markDecl=getRuntimeMarkDecl(pp);var markedArray=markDecl.declarations[0].id;var funDeclIdArray=markDecl.declarations[0].init.callee.object;n.ArrayExpression.assert(funDeclIdArray);var index=funDeclIdArray.elements.length;funDeclIdArray.elements.push(node.id);return b.memberExpression(markedArray,b.literal(index),true);}return node.id || (node.id = funPath.scope.parent.declareTemporary(\"callee$\"));}", "title": "" }, { "docid": "6f051c14064c39b46d1da17263fac28e", "score": "0.501413", "text": "function Fn\n\n //iian iaouns\n /* aaain ob skubz\n\n\n */\n\n () {\n console.log(\"Foo\");\n }", "title": "" }, { "docid": "06fba9fcbcbfc240510b808e8e633575", "score": "0.501192", "text": "[[\"ObjectExpression > Property[computed!=true] > Identifier.key\", \"MethodDefinition[computed!=true] > Identifier.key\", \"PropertyDefinition[computed!=true] > Identifier.key\", \"MethodDefinition > PrivateIdentifier.key\", \"PropertyDefinition > PrivateIdentifier.key\"]](node) {\n if (properties === \"never\" || isGoodName(node.name)) {\n return;\n }\n\n report(node);\n }", "title": "" }, { "docid": "b10e7600c749520d99289db4c288a07d", "score": "0.50077695", "text": "function innerLayer() {\n return privateVar + 4;\n }", "title": "" }, { "docid": "1d74fbcbefd9ac300a506f8cb93b957e", "score": "0.5000641", "text": "function memberExpr() {\n var obj = {func: dummy};\n return obj.func`hello world!`;\n}", "title": "" }, { "docid": "54748bf098b866c138286f64a2389a28", "score": "0.4974491", "text": "FunctionExpression( ...args ) { \n if( args[ 0 ].processed === true ) return \n Marker.patternMarkupFunctions.Identifier( ...args )\n }", "title": "" }, { "docid": "8705ecd848d148bdcd30666489e3ff23", "score": "0.49732742", "text": "function outer() {\n function inner() {}\n return inner();\n} //[Fig7a]", "title": "" }, { "docid": "edf094e2ab7c7a6460bfe5ad8206e71d", "score": "0.49559456", "text": "function label(node) {\n var type = node.referenceType;\n\n if (type === shortcut$2) {\n return ''\n }\n\n return (\n leftSquareBracket$6 +\n (type === collapsed$1 ? '' : node.label || node.identifier) +\n rightSquareBracket$6\n )\n }", "title": "" }, { "docid": "0204ba7f1f185ec4fc6be774dfbbc707", "score": "0.49465555", "text": "function a$iter_jump(r,s)\n{\n this.a$return_value = r;\n this.a$scope = s; \n return this;\n}", "title": "" }, { "docid": "5261f577300a5f7102f4ccb8d4272842", "score": "0.493398", "text": "function foo(){\n function bar(){\n\n }\n}", "title": "" }, { "docid": "f18d61c1edaca5552c088646ee5e68c2", "score": "0.49245203", "text": "*[Symbol.iterator]() {\n yield* this.layers[Symbol.iterator]();\n }", "title": "" }, { "docid": "5787b72acca896b9a031b305e033fff2", "score": "0.4918712", "text": "*[Symbol.iterator]() {\n for (let node = this.#head; node; node = node.next) {\n yield node.value;\n }\n }", "title": "" }, { "docid": "549083219b393b42a0d99824d9ecc86f", "score": "0.49178156", "text": "expandNextToken(){for(;;){const expanded=this.expandOnce();// expandOnce returns Token if and only if it's fully expanded.\nif(expanded instanceof Token){// \\relax stops the expansion, but shouldn't get returned (a\n// null return value couldn't get implemented as a function).\nif(expanded.text===\"\\\\relax\"){this.stack.pop();}else{return this.stack.pop();// === expanded\n}}}// Flow unable to figure out that this pathway is impossible.\n// https://github.com/facebook/flow/issues/4808\nthrow new Error();// eslint-disable-line no-unreachable\n}", "title": "" }, { "docid": "a829f4302195bc5d0f9cb932465d6711", "score": "0.49133375", "text": "function F() {\n ;\n}", "title": "" }, { "docid": "06443ae2e90a595a261241b9a0ae3646", "score": "0.49078494", "text": "function foo() {\r\n var i = 30;\r\n i++; /**bp:evaluate(\"var k = i; eval('k')\")**/\r\n}", "title": "" }, { "docid": "4f1b399154edaf560218b25a2834fdc3", "score": "0.4905259", "text": "function __b_aPxD_aAgzT_aoP7hbI6qzoA(){}", "title": "" }, { "docid": "e57cd87b06f69a438f39b90ce2137e31", "score": "0.4905151", "text": "function label(node) {\r\n var type = node.referenceType\r\n\r\n if (type === shortcut) {\r\n return ''\r\n }\r\n\r\n return (\r\n leftSquareBracket +\r\n (type === collapsed ? '' : node.label || node.identifier) +\r\n rightSquareBracket\r\n )\r\n}", "title": "" }, { "docid": "50ef0844a61cb5053bbcecf70c45ead9", "score": "0.48947316", "text": "function _getTypeAnnotation(){var node=this.node;if(!node){ // handle initializerless variables, add in checks for loop initializers too\nif(this.key === \"init\" && this.parentPath.isVariableDeclarator()){var declar=this.parentPath.parentPath;var declarParent=declar.parentPath; // for (var NODE in bar) {}\nif(declar.key === \"left\" && declarParent.isForInStatement()){return t.stringTypeAnnotation();} // for (var NODE of bar) {}\nif(declar.key === \"left\" && declarParent.isForOfStatement()){return t.anyTypeAnnotation();}return t.voidTypeAnnotation();}else {return;}}if(node.typeAnnotation){return node.typeAnnotation;}var inferer=inferers[node.type];if(inferer){return inferer.call(this,node);}inferer = inferers[this.parentPath.type];if(inferer && inferer.validParent){return this.parentPath.getTypeAnnotation();}}", "title": "" }, { "docid": "51623e8881af059c353c8ce8ade46e5a", "score": "0.48944753", "text": "function n(e){return function(){return e}}", "title": "" }, { "docid": "51623e8881af059c353c8ce8ade46e5a", "score": "0.48944753", "text": "function n(e){return function(){return e}}", "title": "" }, { "docid": "51623e8881af059c353c8ce8ade46e5a", "score": "0.48944753", "text": "function n(e){return function(){return e}}", "title": "" }, { "docid": "51623e8881af059c353c8ce8ade46e5a", "score": "0.48944753", "text": "function n(e){return function(){return e}}", "title": "" }, { "docid": "ae542d1758f121add47542aadef83700", "score": "0.48828968", "text": "function $i(){return function(r){return r}}", "title": "" }, { "docid": "3d8214f530ae47690388e19334f4f9f2", "score": "0.48821986", "text": "function VN(e,t){var r=ct()(e);if(it.a){var n=it()(e);t&&(n=st()(n).call(n,(function(t){return rt()(e,t).enumerable}))),r.push.apply(r,n)}return r}", "title": "" }, { "docid": "744683bb549487f1e877bff548676080", "score": "0.48791862", "text": "function indentityf(x) {\n return function () {\n return x;\n };\n}", "title": "" }, { "docid": "3a5cd32a81c061f975af3039b337f73c", "score": "0.4879029", "text": "function tn(e){var t=rn();return function(){var r,n=Object(ue[\"a\"])(e);if(t){var s=Object(ue[\"a\"])(this).constructor;r=se()(n,arguments,s)}else r=n.apply(this,arguments);return Object(pe[\"a\"])(this,r)}}", "title": "" }, { "docid": "4f2487e454f66ffc9f0699847878c585", "score": "0.48780724", "text": "function OperatorNode() {\n}", "title": "" }, { "docid": "2ebdc7a95e2de55540b762699767c15a", "score": "0.48663676", "text": "function exFuncDeclVsExpr() {\r\n function foo() {\r\n function bar() {\r\n return 3;\r\n }\r\n return bar();\r\n function bar() {\r\n return 8;\r\n }\r\n }\r\n console.log(foo());\r\n}", "title": "" }, { "docid": "bf955e71c5e6f3d49b52d1c781b963de", "score": "0.4865068", "text": "function Node() {\n\n}", "title": "" }, { "docid": "167d1d299ea5816b8aec4961bb517f8c", "score": "0.48596755", "text": "function isFunctionNotation(node){return isGetterOrSetter(node)||sameLocStart(node,node.value);}", "title": "" }, { "docid": "633d006c473178f0f540c821e1ded105", "score": "0.48564738", "text": "function label(node) {\n var type = node.referenceType\n\n if (type === shortcut) {\n return ''\n }\n\n return (\n leftSquareBracket +\n (type === collapsed ? '' : node.label || node.identifier) +\n rightSquareBracket\n )\n}", "title": "" }, { "docid": "633d006c473178f0f540c821e1ded105", "score": "0.48564738", "text": "function label(node) {\n var type = node.referenceType\n\n if (type === shortcut) {\n return ''\n }\n\n return (\n leftSquareBracket +\n (type === collapsed ? '' : node.label || node.identifier) +\n rightSquareBracket\n )\n}", "title": "" }, { "docid": "633d006c473178f0f540c821e1ded105", "score": "0.48564738", "text": "function label(node) {\n var type = node.referenceType\n\n if (type === shortcut) {\n return ''\n }\n\n return (\n leftSquareBracket +\n (type === collapsed ? '' : node.label || node.identifier) +\n rightSquareBracket\n )\n}", "title": "" }, { "docid": "b1c4575afdf606853902658b81820ee2", "score": "0.48555887", "text": "function ex06_3() {\n // Too soon! ... update : unsupport inundated browser even Safari-\n // If you want to use, USE IT via BABEL.\n // Atom-JavaScript-RUN not support, yet! ... Syntax Error occured\n // Check result on Chrome browser, via main.html\n\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference\n\n class Experiment {\n publicField = 'public field! == VISIBLE OUTSIDE';\n #privateField = \"private field == CAN'T BE SEEN OUTSIDE\";\n }\n\n const experiment = new Experiment();\n console.log(experiment.publicField);\n console.log(experiment.privateField); // undefined ... CAN'T SEE OUTSIDE!\n}", "title": "" }, { "docid": "3554a0df53be551c2c59ad390ba41b18", "score": "0.4843594", "text": "function Nf(t,e){var i=Ii()(t);if(Ci.a){var n=Ci()(t);e&&(n=Ei()(n).call(n,(function(e){return Oi()(t,e).enumerable}))),i.push.apply(i,n)}return i}", "title": "" }, { "docid": "45b9017ae7d5d429ed7b851adbc4d7b4", "score": "0.48429552", "text": "*[Symbol.iterator]() {\n let node = this.head;\n while (node) {\n yield node;\n node = node.next;\n }\n }", "title": "" }, { "docid": "3a806dc2fe2d5fc7cb4d31cf79fd76a5", "score": "0.48401695", "text": "function\nx\n(\n)\n{\n}", "title": "" }, { "docid": "959952a8e203b58041994a73074e57ff", "score": "0.4830209", "text": "function i(e){return void 0===e&&(e=null),Object(o[\"l\"])(null!==e?e:r)}", "title": "" }, { "docid": "969f26485513f45725d4492ff76f0099", "score": "0.48294723", "text": "function defaultOnlyIn(node) {\n return node.object === 'block' && node.type === 'code_block';\n}", "title": "" }, { "docid": "e9195f82fc9eb267795d4a783e5d4606", "score": "0.48292828", "text": "*[Symbol.iterator](){\n let node = this.head;\n while(node){\n yield node;\n node = node.next;\n }\n }", "title": "" }, { "docid": "60c55dae7b3ac20a86a107343f5bc222", "score": "0.48067737", "text": "modifier() {}", "title": "" }, { "docid": "dac3d73937103347991dd3c3ee9fa790", "score": "0.47961155", "text": "function i(e){return void 0===e&&(e=null),Object(r[\"l\"])(null!==e?e:o)}", "title": "" }, { "docid": "762166ebfd7aeefb05c89e8ba90686f8", "score": "0.47954288", "text": "_functionNode() {\n return this.lambdaFunction.node;\n }", "title": "" }, { "docid": "bce951297c5b319f0d534706bec70de7", "score": "0.4791727", "text": "function inner() {\n\n }", "title": "" }, { "docid": "f6a0922f08da9967387382778fefd6e3", "score": "0.47896183", "text": "function Attribute$1() { }", "title": "" }, { "docid": "f6a0922f08da9967387382778fefd6e3", "score": "0.47896183", "text": "function Attribute$1() { }", "title": "" }, { "docid": "04a783e41ac30420ea48c3e623935cdd", "score": "0.47889358", "text": "[[\"LabeledStatement > Identifier.label\",\n /*\n * For backward compatibility, report references as well.\n * It looks unnecessary because declarations are reported.\n */\n \"BreakStatement > Identifier.label\", \"ContinueStatement > Identifier.label\"]](node) {\n if (isGoodName(node.name)) {\n return;\n }\n\n report(node);\n }", "title": "" }, { "docid": "e29c9690d013a1b7b24564293afe86fd", "score": "0.47880334", "text": "get e() {}", "title": "" }, { "docid": "e4cdf558ee98f9943ce24ab2e168aad9", "score": "0.4786584", "text": "function $n(e,t){var r=j()(e);if(H.a){var n=H()(e);t&&(n=k()(n).call(n,(function(t){return I()(e,t).enumerable}))),r.push.apply(r,n)}return r}", "title": "" }, { "docid": "0d45d7b668e5b81620a3e706a753c55f", "score": "0.47863337", "text": "get constructedPrettyName() {\n return \"constructedPrettyName FIXME\";\n }", "title": "" }, { "docid": "751860545e54d5327bd7164aa29a90b0", "score": "0.47847545", "text": "showArrowThis() {\n ((tag) => {\n console.log(\"Arrow this\", this.runs);\n })();\n }", "title": "" }, { "docid": "ded2c85e354bf4c23146bba94f32c163", "score": "0.4784442", "text": "* [Symbol.iterator]() {\n yield* this.tree.inOrderTraversal(); // <1>\n }", "title": "" }, { "docid": "6da7dee2dd1d72769ae38df5b9aec0ce", "score": "0.4783917", "text": "function node(signature, run) { return function () { return new _CodeNode(signature, run); }; }", "title": "" }, { "docid": "8e8fd74558499e2e9444f36be0fbfc0c", "score": "0.47826925", "text": "[c + 'fn']() {}", "title": "" }, { "docid": "be5aa733bea098284ed76ff07505d175", "score": "0.47741222", "text": "function E() {}", "title": "" }, { "docid": "03f1141f36084fe04916caf524366c8b", "score": "0.47718802", "text": "function LoneAnonymousOperation(context) {\n var operationCount = 0;\n return {\n Document: function Document(node) {\n operationCount = node.definitions.filter(function (definition) {\n return definition.kind === __WEBPACK_IMPORTED_MODULE_1__language_kinds__[\"OPERATION_DEFINITION\"];\n }).length;\n },\n OperationDefinition: function OperationDefinition(node) {\n if (!node.name && operationCount > 1) {\n context.reportError(new __WEBPACK_IMPORTED_MODULE_0__error__[\"a\" /* GraphQLError */](anonOperationNotAloneMessage(), [node]));\n }\n }\n };\n}", "title": "" }, { "docid": "53ab2e25dea57be8d94cb924039cae72", "score": "0.47672895", "text": "function Dummy() {}", "title": "" }, { "docid": "8adb0f1aed63cbdd693532dd7395d0ce", "score": "0.4767084", "text": "getExpression(){return this.__symbol.getExpression()}", "title": "" }, { "docid": "e8afa25e07bcced5fe1ee00abd0fefc3", "score": "0.4759097", "text": "function EBX_NodeDocumentation() {}", "title": "" }, { "docid": "e8afa25e07bcced5fe1ee00abd0fefc3", "score": "0.4759097", "text": "function EBX_NodeDocumentation() {}", "title": "" }, { "docid": "4b90029031f89a9c2a531c786091929b", "score": "0.47580472", "text": "function canHaveVariableDeclarationOrExpression() {\n\t return (this.key === \"init\" || this.key === \"left\") && this.parentPath.isFor();\n\t}", "title": "" }, { "docid": "4b90029031f89a9c2a531c786091929b", "score": "0.47580472", "text": "function canHaveVariableDeclarationOrExpression() {\n\t return (this.key === \"init\" || this.key === \"left\") && this.parentPath.isFor();\n\t}", "title": "" }, { "docid": "103870a7b831e996f6227eb7b6de7cd1", "score": "0.47538882", "text": "function i(e,t){return null==t?null==e:null==e||n(e,t)}", "title": "" }, { "docid": "a2ae8a9130a6b37e5301c6974eea95d7", "score": "0.475002", "text": "function C(g,I){0}", "title": "" }, { "docid": "4980e2928a9a701e98d6cda5caf35c43", "score": "0.4749353", "text": "function Cl(a,b){function c(e){for(var g=[],h=0;h<arguments.length;++h)g[h-0]=arguments[h];h=function(n,p,v){for(p=Reflect.getMetadata(\"parameters\",n)||[];p.length<=v;)p.push(null);p[v]=p[v]||[];p[v].push(m);Reflect.defineMetadata(p,n);return n};\nif(this instanceof c)return d.apply(this,g),this;var m=new(Function.prototype.bind.apply(c,[null].concat(ka(g))));h.annotation=m;return h}\nvar d=Hca(b);c.prototype.toString=function(){return\"@\"+a};\nreturn c.annotationCls=c}", "title": "" }, { "docid": "aa4c27829a27baf68ffdf59acead504c", "score": "0.47482073", "text": "function LoneAnonymousOperation(context) {\n var operationCount = 0;\n return {\n Document: function Document(node) {\n operationCount = node.definitions.filter(function (definition) {\n return definition.kind === __WEBPACK_IMPORTED_MODULE_1__language_kinds__[\"a\" /* Kind */].OPERATION_DEFINITION;\n }).length;\n },\n OperationDefinition: function OperationDefinition(node) {\n if (!node.name && operationCount > 1) {\n context.reportError(new __WEBPACK_IMPORTED_MODULE_0__error__[\"a\" /* GraphQLError */](anonOperationNotAloneMessage(), [node]));\n }\n }\n };\n}", "title": "" }, { "docid": "750daf5ec4ab8831554d7defc2382a2c", "score": "0.47478062", "text": "*[Symbol.iterator]() {\n yield 1;\n yield 2;\n yield 3;\n }", "title": "" }, { "docid": "0c7fc860314cf6a91ec97055bf8a5883", "score": "0.47460884", "text": "function foo () {\r\n return bar();\r\n function bar() {\r\n return \"Poppin' bottles\";\r\n }\r\n }", "title": "" }, { "docid": "9bbda7cbe53d1d282dee88ef88e96cc5", "score": "0.47423205", "text": "[Symbol.iterator]() {\n return this.children[Symbol.iterator]();\n }", "title": "" }, { "docid": "5ceaf0dc660e5a9fdde75699164f792e", "score": "0.47305712", "text": "ObjectExpression() {\n stack = {\n prevName: null,\n prevProp: null,\n upper: stack,\n };\n }", "title": "" }, { "docid": "f62ef0de54453687afbe7365fcb7dbda", "score": "0.47267964", "text": "function o(e){return void 0===e&&(e=null),Object(r[\"n\"])(null!==e?e:i)}", "title": "" }, { "docid": "ae92ded1968a74042af106c878dc3859", "score": "0.4720889", "text": "function f0() {\n return this;\n}", "title": "" }, { "docid": "420ecd4417ebca5c55499ca7a5a952d1", "score": "0.47196925", "text": "function jn(a,b){function c(e){for(var g=[],l=0;l<arguments.length;++l)g[l-0]=arguments[l];l=function(n,p,u){for(p=Reflect.getMetadata(\"parameters\",n)||[];p.length<=u;)p.push(null);p[u]=p[u]||[];p[u].push(m);Reflect.defineMetadata(p,n);return n};\nif(this instanceof c)return d.apply(this,g),this;var m=new(Function.prototype.bind.apply(c,[null].concat(ka(g))));l.annotation=m;return l}\nvar d=ada(b);c.prototype.toString=function(){return\"@\"+a};\nreturn c.annotationCls=c}", "title": "" }, { "docid": "3bc597064d8a99be2aff796cbb6eb796", "score": "0.47164977", "text": "function LoneAnonymousOperation(context) {\n var operationCount = 0;\n return {\n Document: function Document(node) {\n operationCount = node.definitions.filter(function (definition) {\n return definition.kind === kinds[\"Kind\"].OPERATION_DEFINITION;\n }).length;\n },\n OperationDefinition: function OperationDefinition(node) {\n if (!node.name && operationCount > 1) {\n context.reportError(new GraphQLError[\"a\" /* GraphQLError */](anonOperationNotAloneMessage(), node));\n }\n }\n };\n}", "title": "" }, { "docid": "06be7761c72fe6c27e50fc0cdffeaac4", "score": "0.47155786", "text": "function dummy() {\n return;\n}", "title": "" }, { "docid": "8439e246339c8eaa385cc94cbe5f2e10", "score": "0.47125", "text": "function Nf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}", "title": "" }, { "docid": "2f3674adb1d654851109f2551f7615de", "score": "0.4709054", "text": "function ThisTypeAnnotation() {\n this.push(\"this\");\n}", "title": "" } ]
9e44c95a218cac093ac873d44b64f0c9
applica lo scenario scelto
[ { "docid": "da2aca7e511d73960befa38903d45f3d", "score": "0.0", "text": "function _apply(info, cb) {\n function __update(current) {\n _validateInfo(current);\n _saveFile(current, current_json, function (err) {\n if (err) return cb(err);\n const result = _.clone(version.infos);\n _.extend(result, current);\n Cache.refresh();\n cb(null, result);\n });\n }\n io.onFile(io.storePath, info.folder, SCENARIO_JSON, function (file) {\n const current = {\n scenario: _.omitBy(info, function(p, n) {\n return _.isArray(p) || _.startsWith(n, '_');\n })\n };\n if (file) {\n io.loadSingleFile(file, function (err, json) {\n _extend_scenario(current.scenario, json);\n __update(current);\n });\n } else {\n __update(current);\n }\n });\n}", "title": "" } ]
[ { "docid": "7084b9d3964ff0a96b9dd3d72790d55a", "score": "0.5497101", "text": "function ts_psr_treatment()\n\n{\n\n//Opens INRstar\n open_application(\"INRstar\");\n\n//Test cases to be run within the Test Suite\n\n//parameters ()\n tc_add_historic\n \n//Closes INRstar\n close_application();\n\n}", "title": "" }, { "docid": "6e2892ad4846738531f983a5eda6c7c1", "score": "0.5285612", "text": "function scenario(name, func) {\n suite.push({\n name: name,\n run: func\n });\n }", "title": "" }, { "docid": "aed8f0e6c6227827fc47c95508d8b385", "score": "0.528276", "text": "function main() {\n let config = {\n \"timeBegin\": new Date(Date.UTC(2016, 8, 17, 0, 0, 0)),\n \"timeEnd\": new Date(Date.UTC(2016, 8, 17, 23, 0, 0)),\n \"goalPattern\": {\n \"metric\": \"invidi.webapp.localhost_localdomain.request.total_response_time.mean\",\n \"timeBegin\": 1474106851,\n \"timeEnd\": 1474153707\n },\n \"iterationCount\": 10000,\n \"initialReward\": -1000.0,\n \"reinforcementLearning\": {\n \"stepSize\": 0.1,\n \"discountRate\": 0.9\n },\n \"resultFile\": \"/tmp/result.json\"\n };\n\n let result = (new RLAdapter).train(config);\n\n // todo: move this job to c++\n result = result.filter(r => r.reward != null);\n result = result.sort((a, b) => {\n return b.reward - a.reward;\n });\n\n result = result.slice(0, 40);\n\n var timeBeginUTC = moment(timeBegin).utc().format('YYYY-MM-DD HH:mm:ss');\n var timeEndUTC = moment(timeEnd).utc().format('YYYY-MM-DD HH:mm:ss');\n let dashboardOptions = {\n title: 'Reinforcement Learning Model for response time',\n from: timeBeginUTC,\n to: timeEndUTC,\n rows: []\n };\n dashboardOptions.rows = result.map(r => {\n return {\n title: `${r.sourcePattern.metric} - ${r.reward}`,\n targetName: r.sourcePattern.metric\n };\n });\n\n dashboardOptions.rows.unshift({\n title: \"invidi.webapp.localhost_localdomain.request.total_response_time.mean\",\n targetName: \"invidi.webapp.localhost_localdomain.request.total_response_time.mean\"\n });\n\n fs.writeFileSync(\n 'dashboard.json',\n JSON.stringify(generateDashboard(dashboardOptions))\n );\n}", "title": "" }, { "docid": "eefa9826af93edae74bbd5ecde42275c", "score": "0.5177486", "text": "static lancerScenario(){\n Plateau.message = \"Début de la partie\";\n Plateau.initDisplay();\n Plateau.currentPlayer=-1;\n }", "title": "" }, { "docid": "e24724f4b100b517b4cc4c9e1fee6f41", "score": "0.51415366", "text": "constructor(container,Scenarios) {\n this.container = container;\n this.dataset = Scenarios;\n\n this.home_page();\n this.menu_page();\n this.create_scenery();\n\n \n }", "title": "" }, { "docid": "043c933f7b64c1d6d7c835d2fffd7a10", "score": "0.5092615", "text": "function workshop() {\n\n end = shapeact.length\n start = end - 20\n // pts = shapechange.slice(start, end)\n actpts = shapeact.slice(start, end)\n\n //if shape has been added recently wait 25 iterations before finding a new one. prevent over crowding and counteractive shape reports\n //if at 10 point after the shape was determined (end of linear forecast) then output live data results to determine if profit or loss occured.\n //exports data to profit.js\n if (wait[0] == 1) {\n\n var arrayout1 = []\n arrayout2 = outdata()\n pipchange = mvmt[0]\n gold = profit[0]\n\n if (color[0] == 'green') {\n reco = \"Buy\"\n }\n else if (color[0] == 'red') {\n reco = \"Sell\"\n }\n\n arrayout1 = [pipchange, reco, gold]\n output = arrayout1.concat(arrayout2)\n\n console.log(output)\n\n newresult() \n \n mvmt.shift()\n profit.shift()\n }\n bors()\n}", "title": "" }, { "docid": "d471d9659ac1bcbe378e059b1a8e7542", "score": "0.50854594", "text": "function new_scenario() {\n\t\tselect_functions(f_type_target,f_type_hypothesis);\n\t let target_function = f_target(true_weight),\n\t predicted_function = f_hypothesis(w_hat);\n\n\t let target = gen_function_data(target_function,NTARGET,XMIN,XMAX),\n\t noisefree_data = gen_function_data_random_x(target_function,nData,XMAX,XMIN),\n\t noise = gen_noise(nData),\n\t data = corrupt_data(noisefree_data, noise);\n\t weights = linspace(WMIN,WMAX,NWEIGHT),\n\t error_data = mse(weights,data),\n\t\t\tpointwise_error = square_error(data, predicted_function)\n\t hypothesis = [] ;\n\t if (w_hat !== '') {\n\t hypothesis = gen_function_data(predicted_function,NTARGET,XMIN,XMAX);\n\t\t\t}\n\t\t\t\n\t return {target:target, \n\t noisefree_data:noisefree_data,\n\t noise:noise,\n\t data:data, \n\t weights:weights, \n\t error_data:error_data,\n\t pointwise_error:pointwise_error,\n\t\t\t\thypothesis:hypothesis};\n\t}", "title": "" }, { "docid": "1d8579357c526177bb4bc92fd0b8e9a7", "score": "0.5063231", "text": "function createScenario(def) {\n const finalScenario = { ...scenarioDefaults, ...def };\n finalScenario.url = `${finalScenario.url}?backstop=true`;\n scenariosArr.push(finalScenario);\n}", "title": "" }, { "docid": "17c485d99ac7ee651e7a20a281d24ccf", "score": "0.50337315", "text": "function driver_run()\n{\n ClassRepo.initialize(\"demo_data.json\");\n ScheduleBuilder.initialize(\"ScheduleBuilder\");\n Form.initialize(\"IGETCForm\");\n IGETCTable.initialize(\"IGETCTable\", builder);\n Analytics.initialize();\n}", "title": "" }, { "docid": "19f67ee32b96cf9a19831dbdef6b0502", "score": "0.50240785", "text": "function initScenarii(arr) {\n\t// list current enabled vehicules..\n\tlet i;\n\tlet list = [];\n\tfor (i = 0; i < arr.length; i++) { \n\t\tif (arr[i].isActive){\n\t\t\tlist += \"\\n- (\" + arr[i]._id + \") for Rover \" + arr[i].name;\n\t\t}\n\t}\n\n\t// ask user\n\tvar probe = prompt(\"Please choose a vehicule* :\" + list, \"1\");\n\tvar operator = prompt(\"Please enter your name.\");\n\tvar cmd = prompt(\"Please enter Rover's sequence* :\\n Available commands are :\\n- (f)orward\\n- (b)ackward\\n- (l)eft\\n- (r)ight\", \"zrffrfflfrff\");\n\n\t\n\tif (!cmd) { // if commands is empty, TODO RECURSIVE ??\n\t\tcmd = prompt(\"Command sequence can't be empty...\", \"bbrff\");\n\t}\n\tif (operator.length < 1) {\n\t\toperator = \"GUEST\"; // default user name\n\n\t} if (probe > probe.length || probe / probe != 1) { // probe validation\n\t\tprobe = prompt(\"Please choose a valid probe* :\" + list, \"1\");\n\t\tconsole.log(probe);\n\t\thulla.send(probe);\n\t}\n\n\treadCmd(cmd, focusVehicule(arr, (probe - 1)), operator); // exec when params are ok\n}", "title": "" }, { "docid": "be4045bb5e82c963ce5b594459552f4e", "score": "0.502171", "text": "runTournament() {\n\n }", "title": "" }, { "docid": "16b7a04c9ad93f5456349c81be32945a", "score": "0.5011485", "text": "function genCode1(objType,appEnv,rowData,r1,h){var columns=Object.keys(rowData);var pgm=Object(_optCode__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(objType,appEnv);console.log('in here');var caslStatements=\"\\n\\n\\n\\n\\taction table.loadTable /\\n\\t\\tcasOut={\\n\\t\\tname=\\\"QUANTILES_PREDICTION\\\",\\n\\t\\treplace=TRUE}\\n\\t\\tcaslib='\".concat(appEnv.INPUTLIBNAME,\"'\\n\\t\\tpath=\\\"QUANTILES_PREDICTION.sashdat\\\";\\n\\n\\n\\taction table.update /\\n\\t\\t\\t table= {\\n\\t\\t\\t\\t\\t\\tcaslib = '\").concat(appEnv.INPUTLIBNAME,\"'\\n\\t\\t\\t\\t\\t\\tname = 'QUANTILES_PREDICTION'\\n\\t\\t\\t\\t\\t\\twhere = \\\"Days=-1\\\"\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t set={\\n\\t\\t\\t {var=\\\"Prediction\\\", value='\").concat(r1,\"'}\\n\\t\\t\\t\\t\\t\\t{var=\\\"Months\\\", value='\").concat(h,\"/30'}\\n\\n\\t\\t\\t };\\n\\n\\t\\t\\t\\t\\taction table.save /\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tcaslib='\").concat(appEnv.INPUTLIBNAME,\"'\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tname='QUANTILES_PREDICTION'\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\ttable ={\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tcaslib = '\").concat(appEnv.INPUTLIBNAME,\"'\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tname = 'QUANTILES_PREDICTION'\\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\\treplace=TRUE;\\n\\n\\n\\n\\trun;\\n\\n\\t\");return caslStatements;}", "title": "" }, { "docid": "8c23ab490c0b678e91ddef22e20445b0", "score": "0.49745786", "text": "function CAM_690()\n{\n try\n {\n Log.Message(\"Started TC:- Test to check that minimum and maximum limit for DFR record length with non-Transco licenses \")\n var DataSheetName = Project.ConfigPath +\"TestData\\\\MaxDFR.xlsx\"\n \n //Step1.: Check if iQ-Plus is running or not.\n AssertClass.IsTrue(CommonMethod.IsExist(\"iQ-Plus\"),\"Checking if iQ+ is running or not\")\n \n //Step2.Check whether device exists or not in the topology. \n if(DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\"))!=true)\n {\n GeneralPage.CreateDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceSerialNo\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceIPAdd\"))\n DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\")) \n }\n else\n {\n Log.Message(\"Device exist in the tree topology.\")\n }\n \n //Step3. Retrieve Configuration\n AssertClass.IsTrue(DeviceManagementPage.ClickonRetrieveConfig(),\"Clicked on Retrieve Config\")\n \n //Step4. Click on Fault Recording\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n \n //Step5.0 //Enter PreFault\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetPrefault(CommonMethod.ReadDataFromExcel(DataSheetName,\"PrefaultTime\")),\"Setting Prefault Time\")\n \n //Step5. Enter & Check Max DFR value\n var MaxDFRLength =CommonMethod.ReadDataFromExcel(DataSheetName,\"MaxDFR\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetMaxDFR(MaxDFRLength),\"Setting and checking Max DFR\")\n \n //Step6. Send to Device\n AssertClass.IsTrue(ConfigEditorPage.ClickSendToDevice(),\"Clicked on Send to Device\")\n \n //Step7. Retrieve Configuration\n AssertClass.IsTrue(DeviceManagementPage.ClickonRetrieveConfig(),\"Clicked on Retrieve Config\")\n \n //Step8. Click on Fault Recording\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n \n //Step9. Check for Prefault and Max DFR Value\n AssertClass.CompareString(ConfigEditor_FaultRecordingPage.GetMaxDFR(), MaxDFRLength,\"Checking for Max DFR Value\")\n \n Log.Message(\"Pass:- Test to check that minimum and maximum limit for DFR record length with non-Transco licenses\")\n }\n catch(ex)\n {\n Log.Error(ex.stack)\n Log.Error(\"Fail:-Test to check that minimum and maximum limit for DFR record length with non-Transco licenses\")\n }\n finally\n {\n AssertClass.IsTrue(ConfigEditorPage.ClickOnClose(),\"Clicked on Close in Config Editor\")\n }\n}", "title": "" }, { "docid": "e423c30b0ea05a407c6775a1abf59eb2", "score": "0.4950446", "text": "scenarioOne() {\n const companyPreference = {\n c1: \"s1\",\n c2: \"s2\"\n };\n const studentPreference = {\n s1: \"c1\",\n s2: \"c2\"\n };\n InterviewScheduling.setInterview(companyPreference, studentPreference);\n }", "title": "" }, { "docid": "f44a7163b18c66b4903061169ff8ce94", "score": "0.4944443", "text": "function genCode(objType,appEnv,rowData){var columns=Object.keys(rowData);var pgm=Object(_optCode__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(objType,appEnv);var caslStatements=\"\\n\\n\\taction table.dropTable/\\n\\t\\tcaslib='\".concat(appEnv.WORKLIBNAME,\"' name='\").concat(appEnv.OUTPUTMASTERTABLENAME,\"' quiet=TRUE;\\n\\n\\ttable.save /\\n\\t\\tcaslib='\").concat(appEnv.WORKLIBNAME,\"'\\n\\t\\tname='\").concat(appEnv.OPTABLENAME,\"'\\n\\t\\ttable='\").concat(appEnv.OPTABLENAME,\"'\\n\\t\\treplace=TRUE;\\n\\n\\ttable.loadTable /\\n\\t\\tcasOut={\\n\\t\\tname=\\\"model\\\",\\n\\t\\treplace=TRUE}\\n\\t\\tcaslib='\").concat(appEnv.WORKLIBNAME,\"'\\n\\t\\tpath=\\\"MODEL.sashdat\\\";\\n\\n\\ttable.loadTable /\\n\\t\\tcasOut={\\n\\t\\tname=\\\"model_weights\\\",\\n\\t\\treplace=TRUE}\\n\\t\\tcaslib='\").concat(appEnv.WORKLIBNAME,\"'\\n\\t\\tpath=\\\"MODEL_WEIGHTS.sashdat\\\";\\n\\n\\ttable.loadTable /\\n\\t\\tcasOut={\\n\\t\\tname=\\\"model_weights_attr\\\",\\n\\t\\treplace=TRUE}\\n\\t\\tcaslib='\").concat(appEnv.WORKLIBNAME,\"'\\n\\t\\tpath=\\\"MODEL_WEIGHTS_ATTR.sashdat\\\";\\n\\n\\ttable.attribute /\\n\\t name=\\\"model_weights\\\"\\n\\t table=\\\"model_weights_attr\\\";\\n\\n\\tloadactionset 'deepLearn';\\n\\tdeepLearn.dlScore table={name='\").concat(appEnv.OPTABLENAME,\"'} initWeights={name=\\\"model_weights\\\"}\\n\\t modelTable={name=\\\"model\\\"}\\n\\t\\tcopyVars={'Horizon', 'StartUpDelay', 'Site1StartUpDelay', 'Site1IDDelay', 'Site1Capacity', 'Site2StartUpDelay', 'Site2IDDelay', 'Site2Capacity', 'Site3StartUpDelay', 'Site3IDDelay', 'Site3Capacity', 'Site4StartUpDelay', 'Site4IDDelay', 'Site4Capacity', 'Site5StartUpDelay', 'Site5IDDelay', 'Site5Capacity', 'Site6StartUpDelay', 'Site6IDDelay', 'Site6Capacity', 'Site7StartUpDelay', 'Site7IDDelay', 'Site7Capacity', 'Site8StartUpDelay', 'Site8IDDelay', 'Site8Capacity', 'Site9StartUpDelay', 'Site9IDDelay', 'Site9Capacity', 'Site10StartUpDelay', 'Site10IDDelay', 'Site10Capacity', 'Site1Interarrival', 'Site2Interarrival', 'Site3Interarrival', 'Site4Interarrival', 'Site5Interarrival', 'Site6Interarrival', 'Site7Interarrival', 'Site8Interarrival', 'Site9Interarrival', 'Site10Interarrival', 'Site1ScreenFailP', 'Site2ScreenFailP', 'Site3ScreenFailP', 'Site4ScreenFailP', 'Site5ScreenFailP', 'Site6ScreenFailP', 'Site7ScreenFailP', 'Site8ScreenFailP', 'Site9ScreenFailP', 'Site10ScreenFailP'}\\n\\t\\tcasout={name='\").concat(appEnv.OUTPUTMASTERTABLENAME,\"', caslib='\").concat(appEnv.INPUTLIBNAME,\"', replace=TRUE};\\n\\n\\n\\n\\taction table.save /\\n\\t\\tcaslib = '\").concat(appEnv.INPUTLIBNAME,\"'\\n\\t\\tname = '\").concat(appEnv.OUTPUTMASTERTABLENAME,\"'\\n\\t\\treplace = TRUE\\n\\t\\ttable= {\\n\\t\\t\\tcaslib = '\").concat(appEnv.INPUTLIBNAME,\"'\\n\\t\\t\\tname = '\").concat(appEnv.OUTPUTMASTERTABLENAME,\"'\\n\\t\\t};\\n\\n\\n\\n\\taction table.fetch r=result / to= 1000\\n\\t\\t\\t\\tfetchVars={'_DL_Pred_','Horizon'}\\n\\t\\t\\t\\ttable= {\\n\\t\\t\\t\\t\\tcaslib = '\").concat(appEnv.INPUTLIBNAME,\"'\\n\\t\\t\\t\\t\\tname = '\").concat(appEnv.OUTPUTMASTERTABLENAME,\"'\\n\\t\\t\\t\\t};\\n\\t\\t\\t\\trun;\\n\\n\\n\\n\\tr = {A= result};\\n\\tsend_response( r) ;\\n\\trun;\\n\\n\\t\");return caslStatements;}", "title": "" }, { "docid": "a47af5f71b8325c05a2c376584c991f0", "score": "0.49244308", "text": "function vxlSilo(mode){\n this._mode = mode;\n this._actors = [];\n this.data = {};\n this.cached = {};\n this.added = {};\n this.prepare();\n}", "title": "" }, { "docid": "6835525e172b6c273ba5a32f635b3f13", "score": "0.4908254", "text": "scenarioTwo() {\n const companyPreference = {\n c1: \"s1\",\n c2: \"s2\"\n };\n const studentPreference = {\n s1: \"c1\",\n s2: \"c1\"\n };\n InterviewScheduling.setInterview(companyPreference, studentPreference);\n }", "title": "" }, { "docid": "0f69c087c88a5a2f75a5477ee69800c7", "score": "0.48763925", "text": "function enviataxaaula(percent_aula, id_aula, id_projeto) {\n var envio = {}\n envio.id_contato = get_data('geral').id\n envio.id_aula = id_aula\n envio.percentual = percent_aula\n envio.email = get_data('geral').email \n envio.id_projeto = id_projeto \n\n set_tempo_ondemand(envio, (stst) => {\n //console.log('inserido - ' + id_aula + ' - ' + percent_aula + ' - ' + envio.id_contato)\n })\n}", "title": "" }, { "docid": "08512838e3a81235e81348f14c42011c", "score": "0.4875925", "text": "function CAM_739()\n{\n try\n {\n Log.Message(\"Started TC:-Test to check the import/export functionality for DFR record length.\")\n var DataSheetName = Project.ConfigPath +\"TestData\\\\CAM-739.xlsx\"\n var File_Name = Project.ConfigPath +\"TestData\\\\CAM-739_Export-Import Configuration\\\\Configuration.cfg\"\n \n //Step1.: Check if iQ-Plus is running or not.\n AssertClass.IsTrue(CommonMethod.IsExist(\"iQ-Plus\"),\"Checking if iQ+ is running or not\")\n \n //Step2.Check whether device exists or not in the topology. \n if(DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\"))!=true)\n {\n GeneralPage.CreateDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceSerialNo\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceIPAdd\"))\n DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\")) \n }\n else\n {\n Log.Message(\"Device exist in the tree topology.\")\n }\n \n //Step3. Retrieve Configuration\n AssertClass.IsTrue(DeviceManagementPage.ClickonRetrieveConfig(),\"Clicked on Retrieve Config\")\n \n //Step4. Click on Fault Recording\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n \n //Step3. Set pre-fault for External Triggers\n var prefault =CommonMethod.ReadDataFromExcel(DataSheetName,\"PrefaultTime\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetPrefault(prefault),\"Updated Pre-fault Time\")\n \n //Step4. Set Post-fault time for External Triggers\n var postfault=CommonMethod.ReadDataFromExcel(DataSheetName,\"PostFaultTime\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetPostFault(postfault),\"Updated Post-faulttime\")\n \n //Step5. Enter & Check Max DFR value\n //Step5.1 Set Prefault time\n var prefault =CommonMethod.ReadDataFromExcel(DataSheetName,\"PrefaultTime\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetPrefault(prefault),\"Validating Prefault Time\") \n \n var MaxDFRLength =CommonMethod.ReadDataFromExcel(DataSheetName,\"MaxDFR\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetMaxDFR(MaxDFRLength),\"Setting and checking Max DFR\")\n \n //Step6. Send to Device\n AssertClass.IsTrue(ConfigEditorPage.ClickSendToDevice(),\"Clicked on Send to Device\")\n \n //Step7. Export configuration as a File\n ConfigEditor_Methods.ExportConfigurationAsFile(File_Name)\n Log.Message(\"Exported configuration as a File\")\n ConfigEditorPage.ClickOnClose()\n \n //Step8. Select other device\n DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName2\"))\n \n //Step9.Import Configuration as a File\n ConfigEditor_Methods.ImportConfigurationAsFile(CommonMethod.ReadDataFromExcel(DataSheetName,\"File_Name_Import\"))\n Log.Message(\"Imported configuration as a File\")\n \n \n //Step9.1 Verify Max DFR value\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n AssertClass.CompareDecimalValues(aqConvert.StrToInt64(ConfigEditor_FaultRecordingPage.GetMaxDFR()),aqConvert.StrToInt64(MaxDFRLength),0, \"Max DFR value is properly imported and is equal to the primary device value\")\n ConfigEditorPage.ClickOnClose()\n \n \n //Step10. Select Primary device\n DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\"))\n \n //Step11. Retrieve Configuration\n AssertClass.IsTrue(DeviceManagementPage.ClickonRetrieveConfig(),\"Clicked on Retrieve Config\")\n \n //Step12. Click on Fault Recording\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n \n //Step13. Enter & Check Max DFR value\n var MaxDFRLength1 =CommonMethod.ReadDataFromExcel(DataSheetName,\"MaxDFR1\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetMaxDFR(MaxDFRLength1),\"Setting and checking Max DFR\")\n \n //Step14. Send to Device\n AssertClass.IsTrue(ConfigEditorPage.ClickSendToDevice(),\"Clicked on Send to Device\")\n \n //Step15. Export configuration as a Template\n ConfigEditor_Methods.ExportConfigurationAsTemplate(CommonMethod.ReadDataFromExcel(DataSheetName,\"Template_Name\"))\n Log.Message(\"Exported configuration as a Template\")\n ConfigEditorPage.ClickOnClose()\n \n //Step16. Select other device\n DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName2\"))\n \n //Step17. Import configuration as a Template\n ConfigEditor_Methods.ImportConfigurationAsTemplate(CommonMethod.ReadDataFromExcel(DataSheetName,\"Template_Name\"))\n Log.Message(\"Imported configuration as a Template\")\n \n //Step17.2 Verify Max DFR value after Importing as Template\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n AssertClass.CompareDecimalValues(aqConvert.StrToInt64(ConfigEditor_FaultRecordingPage.GetMaxDFR()),aqConvert.StrToInt64(MaxDFRLength1),0, \"Max DFR value is properly imported and is equal to the primary device value\")\n ConfigEditorPage.ClickOnClose()\n \n //Step18. Select Primary device\n DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\"))\n \n //Step19. Retrieve Configuration\n AssertClass.IsTrue(DeviceManagementPage.ClickonRetrieveConfig(),\"Clicked on Retrieve Config\")\n \n //Step20. Click on Fault Recording\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n \n //Step21. Enter & Check Max DFR value\n var MaxDFRLength2 =CommonMethod.ReadDataFromExcel(DataSheetName,\"MaxDFR2\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetMaxDFR(MaxDFRLength2),\"Setting and checking Max DFR\")\n \n //Step22. Send to device\n AssertClass.IsTrue(ConfigEditorPage.ClickSendToDevice(),\"Clicked on Send to Device\")\n \n //Step23. Select other device\n DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName2\"))\n \n //Step24. Import configuration from other device\n ConfigEditor_Methods.ImportConfigFromOtherDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\"))\n Log.Message(\"Imported configuration from other device\")\n \n \n //Step25 Verify Max DFR value after Importing from other device\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n AssertClass.CompareDecimalValues(aqConvert.StrToInt64(ConfigEditor_FaultRecordingPage.GetMaxDFR()),aqConvert.StrToInt64(MaxDFRLength2),0, \"Max DFR value is properly imported and is equal to the primary device value\")\n }\n catch(ex)\n {\n Log.Error(ex.stack)\n Log.Error(\"Fail:-Test to check the GUI(Text/Editbox) of iQ+ for Maximum DFR record length\")\n }\n finally\n {\n AssertClass.IsTrue(ConfigEditorPage.ClickOnClose(),\"Clicked on Close in Config Editor\")\n }\n}", "title": "" }, { "docid": "fd0b29756521a45275e6ef086f186aa9", "score": "0.48675925", "text": "function new_scenario(){\r\n\t\ttest.log($('<h3>new_scenario</h3>'));\r\n\t\tvar scenario,\r\n\t\tmodels;\r\n\t\t$.when(\r\n\t\t\t// get a scenario from the library\r\n\t\t\tajaxrequest({\r\n\t\t\t\ttype: \"GET\",\r\n\t\t\t\tdataType: \"json\",\r\n\t\t\t\tdata: {},\r\n\t\t\t\turl: test.mandatorRequestStr + '/structure/get_library_scenario_list',\r\n\t\t\t\tstatusCode: {},\r\n\t\t\t\tsuccess: function (json) {\r\n\t\t\t\t\tscenario = json.libraryScenarioInfoList[0];\r\n\t\t\t\t\ttest.log(\"Scenario loaded successful\");\r\n\t\t\t\t},\r\n\t\t\t\terror: errorhandler\r\n\t\t\t}),\r\n\r\n\t\t\t// get models from the library\r\n\t\t\tajaxrequest({\r\n\t\t\t\ttype: \"GET\",\r\n\t\t\t\tdataType: \"json\",\r\n\t\t\t\tdata: {},\r\n\t\t\t\turl: test.mandatorRequestStr + '/structure/get_model_list',\r\n\t\t\t\tstatusCode: {},\r\n\t\t\t\tsuccess: function (json) {\r\n\t\t\t\t\tmodels = json.modelList;\r\n\t\t\t\t\ttest.data.modelList = json.modelList;\r\n\t\t\t\t\ttest.log(\"Models loaded successfull\");\r\n\t\t\t\t},\r\n\t\t\t\terror: errorhandler\r\n\t\t\t})\r\n\t\t)\r\n\t\t.then(function(){\r\n\t\t\tvar time = +new Date();\r\n\t\t\tvar scenario = {\r\n\t\t\t\t\t\"referenceCode\" : \"my_test_scenario\" + time ,\r\n\t\t\t\t\t\"title\" : \"Test Scenario\",\r\n\t\t\t\t\t\"description\" : \"test description for my test scenario\",\r\n\t\t\t\t\t\"avaliable\" : \"NOT_AVAILABLE\",\r\n\t\t\t\t\t\"inputItemType\" : 1,\r\n\t\t\t\t\t\"outputItemTypes\" : [ 1 ],\r\n\t\t\t\t\t\"stages\" : {\r\n\t\t\t\t\t\t\"0\" : {\r\n\t\t\t\t\t\t\t\"useCategoryPath\" : 0,\r\n\t\t\t\t\t\t\t\"xingModels\" : []\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"1\" : {\r\n\t\t\t\t\t\t\t\"useCategoryPath\" : 1,\r\n\t\t\t\t\t\t\t\"xingModels\" : []\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"2\" : {\r\n\t\t\t\t\t\t\t\"useCategoryPath\" : 2,\r\n\t\t\t\t\t\t\t\"xingModels\" : []\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\t\"enabled\" : \"ENABLED\"\r\n\t\t\t\t},\r\n\t\t\tl = models.length,\r\n\t\t\ts = 3,\r\n\t\t\tmax = 1, //maximum number of models per stage\r\n\t\t\tcontext;\r\n\r\n\t\t\t// add some models (all existing models are used and added to the\r\n\t\t\t// three stages of the scenario\r\n\t\t\twhile(l--){\r\n\t\t\t\tcontext = models[l].profileContextSupported ? \"PROFILE\" : \"ITEM\";\r\n//\t\t\t\tconsole.log(s);\r\n//\t\t\t\tconsole.log(scenario);\r\n\t\t\t\tscenario.stages[--s + \"\"].xingModels.push({\r\n\t\t\t\t\t\"contextFlag\" : context,\r\n\t\t\t\t\t\"useSubmodels\" : false,\r\n\t\t\t\t\t\"weight\" : 100,\r\n\t\t\t\t\t\"modelReferenceCode\" : models[l].referenceCode\r\n\t\t\t\t});\r\n\t\t\t\tif(!s){\r\n\t\t\t\t\ts = 3;\r\n\t\t\t\t\tmax--;\r\n\t\t\t\t}\r\n\t\t\t\tif(!max){\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// store the scenario\r\n//\t\t\tconsole.log(scenario);\r\n\t\t\ttest.data.new_scenario = scenario;\r\n//\t\t\tconsole.log(test.data.new_scenario);\r\n\t\t\t// create the adapted scenario\r\n\t\t\tajaxrequest({\r\n\t\t\t\ttype: \"POST\",\r\n\t\t\t\tdataType: \"json\",\r\n\t\t\t\tcontentType: 'application/json',\r\n\t\t\t\tdata: JSON.stringify(scenario),\r\n\t\t\t\turl: test.mandatorRequestStr + '/structure/create_scenario',\r\n\t\t\t\tstatusCode: {},\r\n\t\t\t\tsuccess: function (json) {\r\n\t\t\t\t\ttest.log(\"Create Scenario successfull\");\r\n\t\t\t\t\tdebug('new_scenario', scenario, json.scenario);\r\n\t\t\t\t\ttest.log(debugButton('new_scenario'));\r\n\t\t\t\t\ttest.assert(equals(json.scenario, scenario), 'new scenario match', 'new scenario missmatch');\r\n\t\t\t\t\ttest.next();\r\n\t\t\t\t},\r\n\t\t\t\terror: errorhandler\r\n\t\t\t});\r\n\t\t},\r\n\t\tfunction(){\r\n\t\t\ttest.log('Create Scenario preconditions failed');\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "2075418c608bfbd19a41b3aab918dd93", "score": "0.48586267", "text": "function testImportThreadAppraisal(){\n Reporting.importThreadAppraisal(\"C:/Users/Diaman/Desktop/Appraisal\",\"appraisal.csv\");\n}", "title": "" }, { "docid": "dc4d3fd2eb37c90c02f7de5282b7dde2", "score": "0.484577", "text": "function main() {\n // Setup Applitools\n let eyes = setup();\n\n // Set viewports\n const viewportLandscape = { width: 1920, height: 1200 };\n const viewportPortrait = { width: 600, height: 800 };\n \n // Execute Chrome driver tests\n browserDriver(eyes, Capabilities.chrome(), viewportLandscape, viewportPortrait);\n \n // Execute FireFox driver tests\n browserDriver(eyes, Capabilities.firefox(), viewportLandscape, viewportPortrait);\n}", "title": "" }, { "docid": "67b070ce32c55936e3c64e65cc44b1c4", "score": "0.48423153", "text": "function train() {\n const CREATE_OPTIONS = {\n 'MODEL_TYPE': 'ARIMA',\n 'TIME_SERIES_TIMESTAMP_COL': DATETIME_COLUMN,\n 'TIME_SERIES_DATA_COL': DATA_COLUMN,\n };\n\n const project = getConfiguration()[0];\n const dataset = createDatasetIfNotExists();\n const table = project + '.' + dataset + '.' + createTableIfNotExists();\n const model = project + '.' + dataset + '.' + MODEL_NAME;\n\n const range = SpreadsheetApp.getActiveRange();\n if (!isValidTrainingData(range)) {\n return;\n }\n\n // Populate temporary table in BigQuery with selected data from sheet\n const inputs = SpreadsheetApp.getActiveRange().getValues();\n populateTable(project, table, [DATETIME_COLUMN, DATA_COLUMN], inputs);\n\n // Create a new model using training data in BigQuery\n const request = {\n query: 'CREATE OR REPLACE MODEL `' + model + '` ' +\n getOptionsStr(CREATE_OPTIONS) + ' AS SELECT * FROM `' + table + '`',\n useLegacySql: false,\n };\n\n runQuery(request, project);\n}", "title": "" }, { "docid": "ebbeeae6513372ecac13d0672c33beeb", "score": "0.48311874", "text": "function test_candu_graphs_datastore_vsphere6() {}", "title": "" }, { "docid": "0870f3f3ff1c04f9cb71dc2df3432f00", "score": "0.4830263", "text": "function indovina(){\n\n gino = get(posIniX, posIniY, beholder.width, beholder.height);\n classifier.classify(gino, gotResult);\n mappa = aCheAssimiglia(gino, daMappare);\n\n}", "title": "" }, { "docid": "11a366b93ac63268fe500ef784728563", "score": "0.48265734", "text": "function start_calibration_exp(i, s, f) {\n // Define independent variables for this run\n interaction = i;\n stimuli = s;\n first_validation_task = f;\n\n remaining_tasks = [\"static\", \"pursuit\"];\n paradigm = \"calibration\";\n setup_calibration_html();\n}", "title": "" }, { "docid": "f68936b2491921c6d72cc51ae646b4c3", "score": "0.4826461", "text": "step() {\n }", "title": "" }, { "docid": "97a492769d2109ed231af29c049f7345", "score": "0.48234856", "text": "function step(ev, s0) {\n switch (ev.__ctor) {\n case \"Checkout\": {\n console.log(\"CHECKOUT\");\n s0 = {\n __ctor: \"Checkout\",\n cart: s0.cart,\n page: \"checkout\",\n paymentMethod: lib_1.PaymentMethod.Credit,\n products: s0.products,\n streetAddress: \"\"\n };\n break;\n }\n case \"Load\": {\n console.log(\"LOAD\");\n s0 = {\n __ctor: \"Shopping\",\n cart: new Map(),\n page: \"store\",\n products: ev.products,\n selections: new Map()\n };\n break;\n }\n case \"CartAdd\": {\n console.log(\"CARTADD\");\n if (s0.__ctor === \"Shopping\") {\n var sel = s0.selections.get(ev.product);\n var cartKey = ev.product + \":\" + sel.size;\n if (s0.cart.has(cartKey)) {\n s0.cart.get(cartKey).quantity += sel.quantity;\n }\n else {\n s0.cart.set(cartKey, __assign({}, sel));\n }\n s0.selections.delete(ev.product);\n }\n break;\n }\n case \"ConfirmOk\": {\n console.log(\"CONFIRMOK\");\n s0 = {\n __ctor: \"Shopping\",\n cart: new Map(),\n page: \"store\",\n products: s0.products,\n selections: new Map()\n };\n break;\n }\n case \"Goto\": {\n console.log(\"GOTO\", ev.page);\n s0.page = ev.page;\n break;\n }\n case \"GotOrderId\": {\n console.log(\"GOTORDERID\");\n s0 = {\n __ctor: \"OrderSummary\",\n cart: s0.cart,\n orderId: ev.orderId,\n page: \"confirmation\",\n products: s0.products\n };\n break;\n }\n case \"QuantityClick\": {\n console.log(\"QUANTITYCLICK\");\n if (s0.__ctor === \"Shopping\" && s0.selections.has(ev.product)) {\n var sel = s0.selections.get(ev.product);\n switch (ev.action) {\n case \"up\": {\n sel.quantity += 1;\n break;\n }\n case \"down\": {\n sel.quantity = Math.max(0, sel.quantity - 1);\n }\n }\n }\n break;\n }\n case \"PaymentDetails\": {\n console.log(\"PAYMENTDETAILS\");\n s0 = {\n __ctor: \"BitcoinPayment\",\n amount: ev.amount,\n bitcoinAddress: ev.address,\n cart: s0.cart,\n page: \"payment\",\n products: s0.products\n };\n break;\n }\n case \"UpdateDetails\": {\n console.log(\"UPDATEDETAILS\");\n if (s0.__ctor == \"Checkout\") {\n s0.streetAddress = ev.streetAddress;\n }\n break;\n }\n case \"SizeClick\": {\n console.log(\"SIZECLICK\");\n if (s0.__ctor === \"Shopping\") {\n if (!s0.selections.has(ev.product)) {\n s0.selections.set(ev.product, {\n product: s0.products.get(ev.product),\n quantity: 1,\n size: ev.size\n });\n }\n else {\n s0.selections.get(ev.product).size = ev.size;\n }\n }\n break;\n }\n case \"SubmitOrder\": {\n console.log(\"SUBMITORDER\");\n var ss = Array.from(s0.cart.values());\n var order = {\n __ctor: \"Order\",\n paymentMethod: ev.paymentMethod,\n selections: ss,\n streetAddress: s0.streetAddress\n };\n ws.send(JSON.stringify(order));\n }\n }\n return s0;\n}", "title": "" }, { "docid": "2d356d7b9a5cc09508cfe811e068297a", "score": "0.48101816", "text": "function caricaElencoScrittureIniziale() {\n caricaElencoScrittureFromAction(\"_ottieniListaContiIniziale\");\n }", "title": "" }, { "docid": "a024a57ee91713982195a1eca8a798b6", "score": "0.48089525", "text": "function CAM_689()\n{\n try\n {\n Log.Message(\"Started TC:-Test to check that user tries to set minimum DFR record length equal to Prefault time\")\n var DataSheetName = Project.ConfigPath +\"TestData\\\\CAM_689.xlsx\"\n \n //Step1.: Check if iQ-Plus is running or not.\n AssertClass.IsTrue(CommonMethod.IsExist(\"iQ-Plus\"),\"Checking if iQ+ is running or not\")\n \n //Step2.Check whether device exists or not in the topology. \n if(DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\"))!=true)\n {\n GeneralPage.CreateDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceSerialNo\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceIPAdd\"))\n DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\")) \n }\n else\n {\n Log.Message(\"Device exist in the tree topology.\")\n }\n \n //Step3. Retrieve Configuration\n AssertClass.IsTrue(DeviceManagementPage.ClickonRetrieveConfig(),\"Clicked on Retrieve Config\")\n \n //Step4. Click on Fault Recording\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n \n //Step5.0 //Enter PreFault\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetPrefault(CommonMethod.ReadDataFromExcel(DataSheetName,\"PrefaultTime\")),\"Setting Prefault Time\")\n \n //Step5. Enter & Check Max DFR value\n var MaxDFRLength =CommonMethod.ReadDataFromExcel(DataSheetName,\"MaxDFR\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetMaxDFR(MaxDFRLength),\"Setting and checking Max DFR\")\n \n //Step6. Send to Device\n AssertClass.IsTrue(ConfigEditorPage.ClickSendToDevice(),\"Clicked on Send to Device\")\n \n //Step7. Check Error on Finish Pane\n AssertClass.CompareString(\"DFR maximum record length has to be at least 100ms more than the pre-fault.\",ConfigEditor_FinishPage.GetErrorText(\"Fault Recording\"),\"Checking for Error Validation on Finish Pane.\")\n \n Log.Message(\"Pass:-Test to check that user tries to set minimum DFR record length equal to Prefault time\")\n }\n catch(ex)\n {\n Log.Error(ex.stack)\n Log.Error(\"Fail:-Test to check that user tries to set minimum DFR record length equal to Prefault time\")\n }\n finally\n {\n AssertClass.IsTrue(ConfigEditorPage.ClickOnClose(),\"Clicked on Close in Config Editor\")\n }\n}", "title": "" }, { "docid": "0d7a23e6910fae95001115226d36f793", "score": "0.48076153", "text": "function renderScenarioActions() {\r\n\tlet curScenario = CUR_SCENARIO;\r\n\tlet {more} = scenarios.find(s=> s.desc === curScenario) || {more: '&nbsp;'};\r\n\tmore = more.replace(/<br>/g, \"\\n\");\r\n\tlet str = makeModalButton('explainSc', `Scenario Info\\t - <i>${curScenario}</i>`,\r\n\t\t[div(\"row btn-group-justified\", [\r\n\t\t\tAB([\"Show Add Scenario\",'&nbsp;' ,ico_down],'','','scform1' ), \r\n\t\t\tAB(\"Reset Scenario\",\"resetScenarios()\"),\r\n\t\t\tAB(\"Std Scenario\",\"factoryScenarios()\"),\r\n\t\t\tAB(\"Delete Scenario &nbsp;\"+ico_recycle,'','','','btn-danger')]),\r\n\t\t element('form', {id: \"scform1\", klass: \"row collapse\", style: \"margin-left: 1rem; margin-right: 1rem\"}, [\r\n\t\t\tdiv(\"col-md-12\",inp(\"sctitle\",{value: curScenario, lab: \"Scenario Title\", desc: \"This is the label in the scenario dropdown\"})),\r\n\t\t\tdiv(\"col-md-12\",\r\n\t\t\t\tinp(\"scdesc\",{ lab: \"Scenario Description\", desc: \"A description of the scenario\", rows: 4, cols: 60, value: (more||\"&nbsp;\"), style: \"height: 100px\"}, textarea)\r\n\t\t\t),\r\n\t\t\tdiv(\"row\",[\r\n\t\t\t\tdiv(\"col-md-3\",button({id: 'add_scenario_action1', klass: \"btn btn-primary\", style: \"width: 7rem;\", 'data-dismiss': \"modal\", onclick: \"addScnearioAction()\"},\"Add &nbsp;\"+ico_edit)),\r\n\t\t\t\tdiv(\"col-md-6 text-right \",`<small class=\"link my-tooltip text-muted\" data-toggle=\"collapse\" data-target=\"#option_list\">Scenario Parameters</small>\r\n\t\t\t\t\t&nbsp;<i class=\"fa fa-road\"></i>` ),\r\n\t\t\t\tdiv(\"col-md-3\",button({ klass: \"btn btn-secondary\", style: \"width: 7rem;\", \"data-toggle\":\"collapse\", \"data-target\": \"#scform1\"},\"Close &nbsp;\"+ico_up))\r\n\t\t\t]),\r\n\t\t\tdiv({ id: \"option_list\", klass: \"col-md-12 overflow-auto collapse\", style:\"height: 15rem; width: 50rem;\"}, [\"<br>\",...renderBaseOptions()])\r\n\t\t]),\r\n\t\t'<hr><br><br>',\r\n\t\th2({klass:\"text-muted\"},\"Scenarios\"),\r\n\t\tdiv({id:\"scenario_desc\", klass:\"overflow-auto\", style:\"height: 30rem; width: 50rem;\"},scenarioContent())]); \r\n\r\n\tID(\"scenario_div_explain\").innerHTML = str;\r\n}", "title": "" }, { "docid": "b891af613486a522bb661dabe6860137", "score": "0.4801103", "text": "step() { }", "title": "" }, { "docid": "b32c39775de9609d9cdbce0803eec513", "score": "0.47980958", "text": "caricaFlussi() {\n\t\tthis.serviceFlussi.all(this.riempiFlussi)\n\t}", "title": "" }, { "docid": "6ba3ed4d44a88ef521969a7c2e22676d", "score": "0.47980177", "text": "function consola (){\r\n bienvenida_random();\r\n ayuda();\r\n}", "title": "" }, { "docid": "63e6bc89e83f09d84986f2934b996499", "score": "0.4795572", "text": "function playScenario() {\r\n\r\n loading();\r\n\r\n if(sceIndex < scenario.length) {\r\n \r\n move(columns[scenario[sceIndex][0]], columns[scenario[sceIndex][1]]);\r\n sceIndex ++;\r\n //playScenario();\r\n }\r\n\r\n}", "title": "" }, { "docid": "8a42d2a8e993ca25c87b743e2d284976", "score": "0.47906157", "text": "function CAM_732()\n{\n try\n {\n Log.Message(\"Start:-Test to check DFR record length with continuous FR Trigger within oplimit.\")\n var dataSheetName = Project.ConfigPath +\"TestData\\\\CAM_732.xlsx\"\n //Step0.Check whether device exists or not in the topology. \n if(DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceName\"))!=true)\n {\n GeneralPage.CreateDevice(CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceName\"),CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceSerialNo\"),CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceIPAdd\"))\n DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceName\")) \n }\n else\n {\n Log.Message(\"Device exist in the tree topology.\")\n }\n \n //Step1. Retrieve Configuration\n AssertClass.IsTrue(DeviceManagementPage.ClickonRetrieveConfig(),\"Clicked on Retrieve Config\")\n \n //Step2. Click on Fault Recording\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n \n //Step3. Set pre-fault for External Triggers\n var prefault =CommonMethod.ReadDataFromExcel(dataSheetName,\"PrefaultTime\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetPrefault(prefault),\"Validating Prefault Time\")\n \n //Step3.1. Set Max DFR time\n var maxDFR=CommonMethod.ReadDataFromExcel(dataSheetName,\"MaxDFR\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetMaxDFR(maxDFR),\"Validating Max DFR\") \n \n //Step3.2 Click on FR Sensor\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFRSensor(),\"Clicked on FR Sensor\")\n \n //Step4 Set Post Fault,Oplimit for FR Sensor\n AssertClass.IsTrue(ConfigEditor_FaultRecording_FRSensorPage.OpenFRSensorEditor(0),\"Open up FR Sensor Editor\") //Setting First FR Sensor\n var frsensorNameFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"FRSensorName\")\n var frsensorTypeFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"Type\")\n var frsensorScalingTypeFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"ScalingType\")\n var frsensorUpperThresholdFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"UpperThreshold\")\n var frsensorPostFaultTimeFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"PostFaultTime\")\n var frsensorOplimitFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"Oplimit\")\n var expectedRecordDuration1 = CommonMethod.ReadDataFromExcel(dataSheetName,\"ExpectedRecordDuration_1\") \n \n DFR_Methods.SetFRSensor(frsensorNameFromTestData,frsensorTypeFromTestData,frsensorScalingTypeFromTestData,frsensorUpperThresholdFromTestData,frsensorPostFaultTimeFromTestData,frsensorOplimitFromTestData)\n \n //Step5. Send to Device\n AssertClass.IsTrue(ConfigEditorPage.ClickSendToDevice(),\"Clicked on Send to Device\")\n \n //Step6. Click on DFR Directory under Display Device Directory\n AssertClass.IsTrue(DataRetrievalPage.ClickOnDFRDirectory() ,\"Clicked on DFR Directory\") \n \n //Step7. Find latest Record Number\n var lastDFRRecord= DataRetrievalPage.GetLatestRecordnumber()\n Log.Message(\"Current Record Number is :- \"+lastDFRRecord) \n \n //Step8. Close DFR Directory\n AssertClass.IsTrue(DataRetrievalPage.CloseDFRDirectory() ,\"Close DFR Directory\") \n \n //Step9 Start Omicron Injection\n OmicronStateSeqPage.RunSeqFile(Project.ConfigPath+\"TestData\\\\\"+CommonMethod.ReadDataFromExcel(dataSheetName,\"OmicronFile_1\")) \n AssertClass.IsTrue(DFR_Methods.IsMultipleRecordFound(10,1,lastDFRRecord),\"Checking for new Record\") \n \n //Step11. Click on Download Data Now //This logic is only applicable to this script as it is downloading max length DFR record.\n //Step 11.1 Click on DFR Directory\n AssertClass.IsTrue(DataRetrievalPage.ClickOnDFRDirectory(),\"Clicked on DFR Directory\")\n var REC_DFR=DataRetrievalPage.GetLatestRecordnumber()\n //Step11.2. Click on Download Data Now\n AssertClass.IsTrue(DataRetrievalPage.ClickOnDownloadDataNow(),\"Clicked on Download Data Now\")\n var retryCnt =100\n do\n {\n aqUtils.Delay(60000)\n if(CommonMethod.CheckActivityLog(\"DFR records saved successfully for device\"))\n {\n break \n }\n retryCnt = retryCnt-1\n }\n while (retryCnt>0)\n \n //Step11.3. Click on Close DFR Directory\n DataRetrievalPage.CloseDFRDirectory() \n Log.Message(\"DFR data download\") \n AssertClass.IsTrue(DFR_Methods.ViewDFROnPDP(REC_DFR),\"Checking on PDP\")\n \n //Step12. Check Record Length\n var recordLength= CommonMethod.ConvertTimeIntoms(PDPPage.GetRecordDuration(0))//FirstRow\n AssertClass.CompareDecimalValues(aqConvert.StrToInt64(expectedRecordDuration1),aqConvert.StrToInt64(recordLength),10,\"Validating Record Duration.\")\n \n Log.Message(\"Pass:-Test to check DFR record length with continuous FR Trigger within oplimit.\")\n }\n catch(ex)\n {\n Log.Message(ex.stack)\n Log.Error(\"Fail:-Test to check DFR record length with continuous FR Trigger within oplimit. \")\n }\n finally\n {\n OmicronStateSeqPage.CloseStateSeq()\n }\n}", "title": "" }, { "docid": "d7a22243a66b57f762cd9c32711c62e2", "score": "0.47905394", "text": "function choisir_prochaine_action( sessionId, context, entities ) {\n // ACTION PAR DEFAUT CAR AUCUNE ENTITE DETECTEE\n if(Object.keys(entities).length === 0 && entities.constructor === Object) {\n // Affichage message par defaut : Je n'ai pas compris votre message !\n }\n // PAS DINTENTION DETECTEE\n if(!entities.intent) {\n\n }\n // IL Y A UNE INTENTION DETECTEE : DECOUVRONS LAQUELLE AVEC UN SWITCH\n else {\n switch ( entities.intent && entities.intent[ 0 ].value ) {\n case \"Bonjour\":\n var msg = {\n \"attachment\": {\n \"type\": \"template\",\n \"payload\": {\n \"template_type\": \"generic\",\n \"elements\": [\n {\n \"title\": \"NutriScore\",\n \"image_url\": \"https://mon-chatbot.com/nutribot2018/images/nutriscore-good.jpg\",\n \"subtitle\": \"Recherchez ici un produit alimentaire et ses équivalents plus sains.\",\n \"buttons\": [\n {\n \"type\": \"postback\",\n \"title\": \"❓ Informations\",\n \"payload\": \"INFOS_SUR_LE_NUTRI\"\n },\n\n {\n \"type\": \"postback\",\n \"title\": \"🔍 Rechercher\",\n \"payload\": \"PRODUIT_PLUS_SAIN\"\n },\n {\n \"type\": \"postback\",\n \"title\": \"🍏 Produit + sain\",\n \"payload\": \"ALTERNATIVE_BEST\"\n }\n\n ]\n },\n {\n \"title\": \"Le sucre\",\n \"image_url\": \"https://mon-chatbot.com/nutribot2018/images/sucre.jpg\",\n \"subtitle\": \"Connaissez-vous réellement le Sucre ? Percez ici tous ses mystères !\",\n \"buttons\": [\n {\n \"type\": \"postback\",\n \"title\": \"En Savoir +\",\n \"payload\": \"CAT_SUCRE\"\n }\n ]\n },\n {\n \"title\": \"Les aliments\",\n \"image_url\": \"https://mon-chatbot.com/nutribot2018/images/aliments.jpg\",\n \"subtitle\": \"Quels aliments contiennent du sucre ? Vous allez être surpris !\",\n \"buttons\": [\n {\n \"type\": \"postback\",\n \"title\": \"En Savoir +\",\n \"payload\": \"CAT_ALIMENTS\"\n }\n ]\n },\n {\n \"title\": \"Les additifs\",\n \"image_url\": \"https://mon-chatbot.com/nutribot2018/images/additifs.jpg\",\n \"subtitle\": \"C'est quoi un additif ? Où les trouvent-on ?\",\n \"buttons\": [\n {\n \"type\": \"postback\",\n \"title\": \"En Savoir +\",\n \"payload\": \"CAT_ADDITIFS\"\n }\n ]\n },\n {\n \"title\": \"Les nutriments\",\n \"image_url\": \"https://mon-chatbot.com/nutribot2018/images/nutriments.jpg\",\n \"subtitle\": \"Eléments indispensables à l'Homme ! Découvrez tous les secrets des nutriments.\",\n \"buttons\": [\n {\n \"type\": \"postback\",\n \"title\": \"En Savoir +\",\n \"payload\": \"CAT_NUTRIMENTS\"\n }\n ]\n },\n {\n \"title\": \"La diététique\",\n \"image_url\": \"https://mon-chatbot.com/nutribot2018/images/diet.jpg\",\n \"subtitle\": \"Découvrez ici tous mes conseils concernant la diététique !\",\n \"buttons\": [\n {\n \"type\": \"postback\",\n \"title\": \"En Savoir +\",\n \"payload\": \"CAT_DIETETIQUE\"\n }\n ]\n },\n {\n \"title\": \"L'organisme\",\n \"image_url\": \"https://mon-chatbot.com/nutribot2018/images/organisme.jpg\",\n \"subtitle\": \"Ici vous découvrirez tous les secrets concernant votre corps et le sucre !\",\n \"buttons\": [\n {\n \"type\": \"postback\",\n \"title\": \"En Savoir +\",\n \"payload\": \"CAT_ORGANISME\"\n }\n ]\n }\n\n\n ]\n }\n }\n };\n var response_text = {\n \"text\": \"PS : Si vous voulez je peux vous proposer des sujets pour débuter :\"\n };\n actions.reset_context( entities, context, sessionId ).then(function() {\n actions.getUserName( sessionId, context, entities ).then( function() {\n actions.envoyer_message_text( sessionId, context, entities, 'Bonjour '+context.userName+'. Enchanté de faire votre connaissance. Je suis NutriBot, un robot destiné à vous donner des informations sur le sucre, la nutrition et tout particulièrement le Nutriscore : le logo nutritionel de référence permettant de choisir les aliments pour mieux se nourrir au quotidien.').then(function() {\n actions.timer(entities, context, sessionId, temps_entre_chaque_message).then(function() {\n actions.envoyer_message_text(sessionId, context, entities, \"PS : Si vous voulez je peux vous proposer des sujets pour débuter :\").then(function() {\n actions.timer(entities, context, sessionId, temps_entre_chaque_message).then(function() {\n actions.envoyer_message_bouton_generique(sessionId, context, entities, msg);\n })\n })\n })\n })\n })\n })\n break;\n case \"RETOUR_ACCUEIL\":\n // Revenir à l'accueil et changer de texte\n actions.reset_context( entities,context,sessionId ).then(function() {\n actions.choixCategories_retour( sessionId,context );\n })\n break;\n case \"Dire_aurevoir\":\n actions.getUserName( sessionId, context, entities ).then( function() {\n actions.envoyer_message_text( sessionId, context, entities, \"A bientôt \"+context.userName+\" ! N'hésitez-pas à revenir nous voir très vite !\").then(function() {\n actions.envoyer_message_image( sessionId, context, entities, \"https://mon-chatbot.com/img/byebye.jpg\" );\n })\n })\n break;\n case \"FIRST_USE_OF_TUTO_OK\":\n actions.getUserName( sessionId, context, entities ).then( function() {\n actions.envoyer_message_text( sessionId, context, entities, \"Bonjour \"+context.userName+\". Je suis NutriBot ! Voici un petit peu d'aide concernant mon fonctionnement !\").then(function() {\n actions.timer(entities, context, sessionId, temps_entre_chaque_message).then(function() {\n actions.afficher_tuto( sessionId,context );\n })\n })\n })\n break;\n case \"Thanks\":\n actions.remerciements(entities,context,sessionId);\n break;\n case \"GO_TO_MENU_DEMARRER\":\n actions.reset_context( entities,context,sessionId ).then(function() {\n actions.choixCategories( sessionId,context );\n })\n break;\n case \"SCAN\":\n actions.ExplicationScan(sessionId,context);\n break;\n\n case \"MANUELLE\":\n actions.envoyer_message_text( sessionId, context, entities, \"Quelle est la marque, le nom ou bien le type de produit que vous souhaitez rechercher ? (Ex : Nutella, Pain de mie, croissant, etc). Je vous écoute :\");\n // then mettre dans le context qu'on est dans recherche manuelle\n break;\n // SIMPLE\n case \"Combien de sucre\":\n actions.go_reste_from_howmuchsugar(entities,context,sessionId);\n break;\n case \"CAT_NUTRIMENTS\":\n actions.go_leg_prot_vital(entities,context,sessionId);\n break;\n case \"Insuline\":\n actions.go_reste_from_insuline(entities,context,sessionId);\n break;\n case \"Betterave\":\n actions.go_legume(entities,context,sessionId);\n break;\n case \"CAT_ORGANISME\":\n actions.go_tout_organisme(entities,context,sessionId);\n break;\n case \"Glucides\":\n actions.go_nutriments(entities,context,sessionId);\n break;\n\n case \"Saccharose\":\n actions.go_glucose_canne_betterave_fructose(entities,context,sessionId);\n break;\n case \"CAT_SUCRE\":\n actions.go_saccharose(entities,context,sessionId);\n break;\n case \"Glucides complexes\":\n actions.go_relance_nutriments_from_glucomplexes(entities,context,sessionId);\n break;\n case \"Index glycémique lent\":\n actions.go_reste_index_lent(entities,context,sessionId);\n break;\n case \"Aliments transformés\":\n actions.go_additifs(entities,context,sessionId);\n break;\n case \"Produit allégé en sucre\":\n actions.go_reste_from_allege(entities,context,sessionId);\n break;\n case \"Nutriments\":\n actions.go_leg_prot_vital(entities,context,sessionId);\n break;\n case \"Besoins\":\n actions.go_reste_from_besoins(entities,context,sessionId);\n break;\n case \"Canne à sucre\":\n actions.go_relance_aliments_from_sugar_canne(entities,context,sessionId);\n break;\n case \"Les sucres\":\n actions.go_amidon_glucides_from_les_sucres(entities,context,sessionId);\n break;\n case \"CAT_DIETETIQUE\":\n actions.go_tout_diet(entities,context,sessionId);\n break;\n case \"Combien de fruits\":\n actions.go_reste_from_howmuchfruits(entities,context,sessionId);\n break;\n case \"Fructose\":\n actions.go_relance_aliments_from_fructose(entities,context,sessionId);\n break;\n case \"Légumes secs\":\n actions.go_prot(entities,context,sessionId);\n break;\n case \"ASTUCE\":\n actions.astuces(entities,context,sessionId);\n break;\n case \"Index glycémique rapide\":\n actions.go_reste_index_rapide(entities,context,sessionId);\n break;\n case \"Apports\":\n actions.go_reste_from_apports(entities,context,sessionId);\n break;\n case \"Aliments\":\n actions.go_aliments_alitransfo(entities,context,sessionId);\n break;\n case \"Produit vital\":\n actions.go_relance_from_vital(entities,context,sessionId);\n break;\n case \"Trop de sucre\":\n actions.go_reste_from_toomuchsugar(entities,context,sessionId);\n break;\n case \"Calorie ou Kcal\":\n actions.go_reste_kcal(entities,context,sessionId);\n break;\n case \"Sucre simple ou sucre rapide\":\n actions.go_reste_sucre_rapide_lent(entities,context,sessionId);\n break;\n case \"CAT_ADDITIFS\":\n actions.go_amidon_glucides(entities,context,sessionId);\n break;\n case \"Amidon\":\n actions.go_glucides_glucomplexes(entities,context,sessionId);\n break;\n case \"Protéines\":\n actions.go_vital(entities,context,sessionId);\n break;\n case \"Légume\":\n actions.go_relance_aliments_from_legume(entities,context,sessionId);\n break;\n case \"Pancréas\":\n actions.go_reste_from_pancreas(entities,context,sessionId);\n break;\n case \"Alimentation équilibrée\":\n actions.go_reste_from_alimentation_equ(entities,context,sessionId);\n break;\n case \"Glucose\":\n actions.go_relance(entities,context,sessionId);\n break;\n case \"Morceau de sucre\":\n actions.go_reste_from_morceau(entities,context,sessionId);\n break;\n case \"Composition\":\n actions.go_alitransfo(entities,context,sessionId);\n break;\n case \"Additifs\":\n actions.go_amidon_glucides(entities,context,sessionId);\n break;\n case \"CAT_ALIMENTS\":\n actions.go_aliments_alitransfo(entities,context,sessionId);\n break;\n // RESTE COMPLEXE\n case \"PRODUIT_PLUS_SAIN\":\n var element = {\n \"attachment\":{\n \"type\":\"template\",\n \"payload\":{\n \"template_type\":\"button\",\n \"text\":\"Utilisez le formulaire ci-dessous et obtenez toutes les informations nécessaires au sujet d'un produit alimentaire ou bien scannez directement un code barre.\",\n \"buttons\":[\n {\n \"type\":\"web_url\",\n \"messenger_extensions\": true,\n \"url\":\"https://mon-chatbot.com/nutribot2018/recherche.html\",\n \"title\":\"Rechercher\"\n },\n {\n \"type\":\"postback\",\n \"title\":\"Scanner\",\n \"payload\":\"SCANSCANSCAN\"\n }\n ]\n }\n }\n };\n sessions[sessionId].recherche = 'normale';\n actions.envoyer_message_bouton_generique( sessionId, context, entities, element);\n break;\n case \"ALTERNATIVE_BEST\":\n var element = {\n \"attachment\":{\n \"type\":\"template\",\n \"payload\":{\n \"template_type\":\"button\",\n \"text\":\"Recherchez ici un produit alimentaire et ses équivalents plus sains.\",\n \"buttons\":[\n {\n \"type\":\"web_url\",\n \"messenger_extensions\": true,\n \"url\":\"https://mon-chatbot.com/nutribot2018/recherche.html\",\n \"title\":\"Rechercher\"\n }\n ]\n }\n }\n };\n sessions[sessionId].recherche = 'autre';\n actions.envoyer_message_bouton_generique( sessionId, context, entities, element);\n break;\n case \"Rechercher_un_produit\":\n actions.queryManuelleSearch2(entities,context,sessionId);\n break;\n case \"INFOS_SUR_LE_NUTRI\":\n actions.afficher_infos_nutriscore(entities,context,sessionId);\n break;\n case \"SCANSCANSCAN\":\n actions.afficher_infos_nutriscore(entities,context,sessionId);\n break;\n case \"AstuceAstuce\":\n actions.astuces( sessionId,context );\n break;\n case \"ByeByeBye\":\n actions.byebye( sessionId,context );\n break;\n\n case \"GENESE\":\n actions.go_relance_from_glycemie(entities, context, sessionId);\n break;\n case \"Glycémie\":\n actions.go_relance_from_glycemie(entities, context, sessionId);\n break;\n case \"RECHERCHE\":\n actions.go_relance_from_glycemie(entities, context, sessionId);\n break;\n\n case \"SPECIFICSPECIFIC\":\n actions.go_relance_from_glycemie(entities, context, sessionId);\n break;\n case \"Insultes\":\n actions.go_relance_from_glycemie(entities, context, sessionId);\n break;\n case \"Sucre\":\n actions.go_relance_from_glycemie(entities, context, sessionId);\n break;\n\n case \"TAPER\":\n actions.go_relance_from_glycemie(entities, context, sessionId);\n break;\n case \"AUTRE_AUTRE_AUTRE\":\n actions.go_relance_from_glycemie(entities, context, sessionId);\n break;\n };\n }\n}", "title": "" }, { "docid": "7786a13070761eae3ae4af0ecfc68369", "score": "0.47880927", "text": "function trainModel(data) {\n\n //Create train & test data\n let trainData = data.slice(0, Math.floor(data.length * 0.8))\n let testData = data.slice(Math.floor(data.length * 0.8) + 1)\n\n console.log(\"train data: \"+trainData)\n console.log(\"test data: \"+testData)\n\n\n // maak het algoritme aan\n decisionTree = new DecisionTree({\n ignoredAttributes: ignored,\n trainingSet: trainData,\n categoryAttr: trainingLabel\n })\n\n // Teken de boomstructuur - DOM element, breedte, hoogte, decision tree\n let visual = new VegaTree('#view', 2400, 1200, decisionTree.toJSON())\n\n\n // todo : maak een prediction met een sample uit de testdata\n // Pregnant,Glucose,Bp,Skin,Insulin,bmi,Pedigree,Age\n //DELETE LABEL\n\n predictAll(testData)\n \n\n\n calculateAccuracy()\n\n}", "title": "" }, { "docid": "a1b9834a3adaf1649a868bb9126f14bd", "score": "0.47785002", "text": "function CAM_686_687_688()\n{\n try\n {\n Log.Message(\"Started TC:-Test to check limit DFR record length feature when Manual trigger(Pre+Post fault time) is equal to Maximum record length\") \n var DataSheetName = Project.ConfigPath +\"TestData\\\\CAM_686_687_688.xlsx\"\n \n //Step1.: Check if iQ-Plus is running or not.\n AssertClass.IsTrue(CommonMethod.IsExist(\"iQ-Plus\"),\"Checking if iQ+ is running or not\")\n \n //Step2.Check whether device exists or not in the topology. \n if(DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\"))!=true)\n {\n GeneralPage.CreateDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceSerialNo\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceIPAdd\"))\n DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\")) \n }\n else\n {\n Log.Message(\"Device exist in the tree topology.\")\n }\n \n //Step3. Retrieve Configuration\n AssertClass.IsTrue(DeviceManagementPage.ClickonRetrieveConfig(),\"Clicked on Retrieve Config\")\n \n //Step4. Click on Fault Recording\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n \n //Step5.0 //Enter PreFault\n var Prefault=CommonMethod.ReadDataFromExcel(DataSheetName,\"PrefaultTime\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetPrefault(Prefault),\"Setting Prefault Time\")\n \n //Step5.1 Enter & Check Max DFR value\n var MaxDFRLength =CommonMethod.ReadDataFromExcel(DataSheetName,\"MaxDFR\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetMaxDFR(MaxDFRLength),\"Setting and checking Max DFR\")\n \n //Step5.2 Set Post fault\n var PostFault =CommonMethod.ReadDataFromExcel(DataSheetName,\"PostFaultTime\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetPostFault(PostFault),\"Setting Post Fault time\")\n \n //Step6. Send to Device\n AssertClass.IsTrue(ConfigEditorPage.ClickSendToDevice(),\"Clicked on Send to Device\")\n \n //Step7. Trigger Manual DFR\n DFR_Methods.TriggerManualDFR()\n \n //Step8. Download Manual DFR\n AssertClass.IsTrue(DFR_Methods.DownloadManualDFR(),\"Downloading DFR\")\n \n //Step9. Get Prefault time\n var ActualPrefault = (PDPPage.GetRecordTriggerDateTime(0))-PDPPage.GetRecordStartDateTime(0)\n \n //Step10. Get Postfault time\n var ActualPostFault = PDPPage.GetRecordEndDateTime(0)-(PDPPage.GetRecordTriggerDateTime(0))\n \n //Step9. Check Record Length\n var RecordLength= CommonMethod.ConvertTimeIntoms(PDPPage.GetRecordDuration(0))//FirstRow\n \n if(aqConvert.StrToInt64(Prefault)+aqConvert.StrToInt64(PostFault)<=aqConvert.StrToInt64(MaxDFRLength))\n { \n AssertClass.CompareDecimalValues(aqConvert.StrToInt64(ActualPrefault)+aqConvert.StrToInt64(ActualPostFault),aqConvert.StrToInt64(RecordLength),1,\"Validating Record Duration.\")\n }\n else\n {\n AssertClass.CompareDecimalValues(aqConvert.StrToInt64(MaxDFRLength),aqConvert.StrToInt64(RecordLength),1,\"Validating Record Duration.\")\n } \n Log.Message(\"Pass:-Test to check limit DFR record length feature when Manual trigger(Pre+Post fault time) is equal to Maximum record length\")\n }\n catch(ex)\n {\n Log.Error(ex.stack)\n Log.Error(\"Fail:-Test to check limit DFR record length feature when Manual trigger(Pre+Post fault time) is equal to Maximum record length\")\n }\n}", "title": "" }, { "docid": "6fe48d047a1fdb8dc53983aa5546ca88", "score": "0.47755203", "text": "function getSteps() {\n return ['Marketplace Integration', 'Shipping Profile', 'Product Import','Product Sync','Import Customers'];\n }", "title": "" }, { "docid": "d0dba452ffdc1dbbb791b802b0fb7ea2", "score": "0.47687593", "text": "function jessica() {\n $log.debug(\"TODO\");\n }", "title": "" }, { "docid": "873c808f098ff001e6ef300ebfa2cee8", "score": "0.47632197", "text": "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 }", "title": "" }, { "docid": "2663d31b1b9cc90938ceaa32c884dcbd", "score": "0.4760193", "text": "function chamarAperto(){\n commandAbortJob();\n commandSelectParameterSet(1);\n commandVehicleIdNumberDownload(\"ASDEDCUHBG34563EDFRCVGFR6\");\n commandDisableTool();\n commandEnableTool();\n}", "title": "" }, { "docid": "02cb1b9097b85882628d79e059b014ac", "score": "0.47547013", "text": "function CAM_728()\n{\n try\n {\n Log.Message(\"Started TC:-Test to check that DFR record length value get saved to database.\")\n var DataSheetName = Project.ConfigPath +\"TestData\\\\MaxDFR.xlsx\"\n \n //Step1.: Check if iQ-Plus is running or not.\n AssertClass.IsTrue(CommonMethod.IsExist(\"iQ-Plus\"),\"Checking if iQ+ is running or not\")\n \n //Step2.Check whether device exists or not in the topology. \n if(DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\"))!=true)\n {\n GeneralPage.CreateDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceSerialNo\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceIPAdd\"))\n DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\")) \n }\n else\n {\n Log.Message(\"Device exist in the tree topology.\")\n }\n \n //Step3. Retrieve Configuration\n AssertClass.IsTrue(DeviceManagementPage.ClickonRetrieveConfig(),\"Clicked on Retrieve Config\")\n \n //Step4. Click on Fault Recording\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n \n //Step5.0 //Enter PreFault\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetPrefault(CommonMethod.ReadDataFromExcel(DataSheetName,\"PrefaultTime\")),\"Setting Prefault Time\")\n \n //Step5. Enter & Check Max DFR value\n var MaxDFRLength =CommonMethod.ReadDataFromExcel(DataSheetName,\"MaxDFR\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetMaxDFR(MaxDFRLength),\"Setting and checking Max DFR\")\n \n //Step6. Save to DB\n AssertClass.IsTrue(ConfigEditorPage.ClickSaveToDb(),\"Clicked on Save to DB\")\n \n //Step7. Click on Modify Configuration\n AssertClass.IsTrue(DeviceManagementPage.ClickonModifyConfig(),\"Clicked on Modify Config\")\n \n //Step7.1 Click on Fault Recording\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n \n //Step8. Check the Max DFR Value\n AssertClass.CompareString(ConfigEditor_FaultRecordingPage.GetMaxDFR(),MaxDFRLength,\"Checking Max DFR value\")\n \n Log.Message(\"Pass:-Test to check that DFR record length value get saved to database.\")\n }\n catch(ex)\n {\n Log.Error(ex.stack)\n Log.Error(\"Fail:-Test to check that DFR record length value get saved to database.\")\n }\n finally\n {\n AssertClass.IsTrue(ConfigEditorPage.ClickOnClose(),\"Clicked on Close in Config Editor\")\n }\n}", "title": "" }, { "docid": "2d240ddb4879ae6b536efdff1c271083", "score": "0.475325", "text": "function startSetupStepCap(edtype, val, index){\n\n console.log('startSetupStepCap',edtype);\n $scope.showRulesBelow = false;\n $scope.hideElse = true;\n $scope.hideExp = true;\n $scope.rule_list = '';\n $scope.rule_list = [{}];\n $scope.step_numbers = [];\n $scope.stepToBeCopied = \"None\";\n for(var i=0; i<$scope.model.TestWrapper.Setup.step.length; i++){\n $scope.step_numbers.push(i+1);\n }\n $scope.showSetupStepEdit = true;\n $scope.cancelReq();\n $scope.status.step_edit_mode = edtype;\n $scope.status.stepindex = index;\n $scope.status.step = mkNewStep();\n if (edtype == 'New') {\n $scope.driverSelected('');\n }\n $scope.status.driverCheckbox = false;\n $scope.status.kwCheckbox = false;\n if($scope.insertStep){\n $scope.insertStep = false;\n }\n }", "title": "" }, { "docid": "3552678196406290ac8948885a90c840", "score": "0.4748758", "text": "function PickScenario(id) { \r\n ResetVars();\r\n var scen = allScen[id-1];\r\n oriPath[0].Path.segments = [\r\n new Point([scen.entry_x_0, scen.entry_y_0]),\r\n new Point([scen.middle_x_0, scen.middle_y_0]),\r\n new Point([scen.exit_x_0, scen.exit_y_0])\r\n ];\r\n oriPath[1].Path.segments = [\r\n new Point([scen.entry_x_1, scen.entry_y_1]),\r\n new Point([scen.middle_x_1, scen.middle_y_1]),\r\n new Point([scen.exit_x_1, scen.exit_y_1])\r\n ];\r\n \r\n modPath[0].Path.segments = oriPath[0].Path.segments;\r\n modPath[1].Path.segments = oriPath[1].Path.segments;\r\n \r\n oriPath[0].EntryTime = scen.entry_time_0; \r\n modPath[0].EntryTime = scen.entry_time_0;\r\n \r\n oriPath[1].EntryTime = scen.entry_time_1;\r\n modPath[1].EntryTime = scen.entry_time_1;\r\n \r\n cpaVisible = setting.init_cpa;\r\n \r\n ShowCurrentConflictLine();\r\n PostGenerationTask();\r\n if (timing) {\r\n RunTimer();\r\n }\r\n $('#current-id').val(currentScenId);\r\n originalConflict = scen.is_conflict == \"1\";\r\n currentScenId++;\r\n if (trigger) {\r\n SendHardTrigger(ShowScen);\r\n }\r\n}", "title": "" }, { "docid": "f6bd807cd4e7a989fb73620ed75981af", "score": "0.4748056", "text": "function OktaConfigurationStrategy() {\n\n}", "title": "" }, { "docid": "5da4a67de857bae08129a74774a85dee", "score": "0.47380933", "text": "function buildScenario() {\n\n // Make sure the user created at least one model\n if (!TMP_MODELS) {\n setStatus(\"No model created. Aborting.\");\n return;\n }\n // display load screen\n LOADER.load();\n setStatus('Serializing and Generating JSON...');\n \n\n // Assemble all data and serialize all forms:\n\n \n var data = {};\n \n var infector = $('#frm-infector').serializeObject();\n \n var inform = $('#frm-infector');\n infector['location'] = inform.find('select[name=\"loc3\"]').val() && (inform.find('select[name=\"loc3\"]').val().length > 1) ? inform.find('select[name=\"loc3\"]').val() : null || inform.find('select[name=\"loc2\"]').val() && (inform.find('select[name=\"loc2\"]').val().length > 1) ? inform.find('select[name=\"loc2\"]').val() : null || inform.find('select[name=\"loc1\"]').val() && (inform.find('select[name=\"loc1\"]').val().length > 1) ? inform.find('select[name=\"loc1\"]').val() : null;\n if (!infector['location']) {\n infector['location'] = infector['manual-location']\n }\n delete infector['loc1'];\n delete infector['loc2'];\n delete infector['loc3'];\n delete infector['manual-location'];\n \n var disease = $('#frm-disease').serializeObject()\n \n if (disease['disease_model'] !== '-') {\n insertDiseaseIntoModel([TMP_MODELS], disease['disease_model'], disease);\n }\n if (infector['infector_model'] !== '-') {\n insertInfectorIntoModel([TMP_MODELS], infector['infector_model'], infector);\n }\n \n data['project_name'] = \"\"+Date.now();\n // Grab the form data\n data['scenario'] = $('#frm-scenario').serializeObject();\n data['disease'] = disease;\n data['infector'] = infector;\n data['models'] = TMP_MODELS;\n data['sequencer'] = $('#frm-sequencer').serializeObject();\n \n // Now do the specifics--linking names to objects\n \n data['scenario']['model'] = data['models']['name']+'.model';\n data['scenario']['sequencer'] = data['sequencer']['name']+'.sequencer';\n data['scenario']['infector'] = data['infector']['name']+'.standard';\n \n // Graphs!\n data['graphs'] = GLOBAL_GRAPHS || [];\n \n // This makes it easier on the backend, specifically storing info in the database\n data['country'] = COUNTRY_SELECTED;\n \n \n setStatus('Sending object to server...');\n\n // Object is now ready--transferring to the server\n $.ajax({\n type: \"POST\",\n url: \"backend/create_scenario.php\",\n dataType: \"json\",\n data: { data: data },\n complete: function() {\n setStatus('Completed request');\n NAV.show('load');\n }\n });\n}", "title": "" }, { "docid": "64d34242c44a9e077605f7c291ab0fe9", "score": "0.47324488", "text": "function CAM_725()\n{\n try\n {\n Log.Message(\"Started TC:-Test to check that user tries to input DFR record length value less/greater than minimum/maximum value\")\n var DataSheetName = Project.ConfigPath +\"TestData\\\\CAM_725.xlsx\";\n \n //Step1.: Check if iQ-Plus is running or not.\n AssertClass.IsTrue(CommonMethod.IsExist(\"iQ-Plus\"),\"Checking if iQ+ is running or not\")\n \n //Step2.Check whether device exists or not in the topology. \n if(DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\"))!=true)\n {\n GeneralPage.CreateDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceSerialNo\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceIPAdd\"))\n DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\")) \n }\n else\n {\n Log.Message(\"Device exist in the tree topology.\")\n }\n \n //Step3. Retrieve Configuration\n AssertClass.IsTrue(DeviceManagementPage.ClickonRetrieveConfig(),\"Clicked on Retrieve Config\")\n \n //Step4. Click on Fault Recording\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n \n //Step5. Check the Max DFR Value\n var MaxDFR = ConfigEditor_FaultRecordingPage.GetMaxDFR();\n Log.Message(\"Max DFR value is\" + MaxDFR);\n \n //Step6. //Enter MaxDFR_Min\n var MaxDFR_Min = CommonMethod.ReadDataFromExcel(DataSheetName,\"MaxDFR_Min\")\n AssertClass.IsFalse(ConfigEditor_FaultRecordingPage.SetMaxDFR(MaxDFR_Min),\"Setting and checking Max DFR\")\n \n //Step7. Save to DB\n AssertClass.IsTrue(ConfigEditorPage.ClickSaveToDb(),\"Clicked on Save to DB\")\n \n //Step8. Click on Modify Configuration\n AssertClass.IsTrue(DeviceManagementPage.ClickonModifyConfig(),\"Clicked on Modify Config\")\n \n //Step9. Click on Fault Recording\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n \n //Step10. Check the Max DFR Value\n AssertClass.CompareString(ConfigEditor_FaultRecordingPage.GetMaxDFR(),MaxDFR,\"Checking Max DFR value\")\n\n //Step11. //Enter MaxDFR_Max\n var MaxDFR_Max =CommonMethod.ReadDataFromExcel(DataSheetName,\"MaxDFR_Max\")\n AssertClass.IsFalse(ConfigEditor_FaultRecordingPage.SetMaxDFR(MaxDFR_Max),\"Setting and checking Max DFR\")\n \n //Step12. Save to DB\n AssertClass.IsTrue(ConfigEditorPage.ClickSaveToDb(),\"Clicked on Save to DB\")\n \n //Step13. Click on Modify Configuration\n AssertClass.IsTrue(DeviceManagementPage.ClickonModifyConfig(),\"Clicked on Modify Config\")\n \n //Step14. Click on Fault Recording\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n \n //Step15. Check the Max DFR Value\n AssertClass.CompareString(ConfigEditor_FaultRecordingPage.GetMaxDFR(),MaxDFR,\"Checking Max DFR value\")\n \n //Step16 //Enter PreFault\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetPrefault(CommonMethod.ReadDataFromExcel(DataSheetName,\"PrefaultTime\")),\"Setting Prefault Time\")\n \n //Step17. //Enter MaxDFR_Mid\n var MaxDFR_Mid =CommonMethod.ReadDataFromExcel(DataSheetName,\"MaxDFR_Mid\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetMaxDFR(MaxDFR_Mid),\"Setting and checking Max DFR\")\n \n //Step18. Save to DB\n AssertClass.IsTrue(ConfigEditorPage.ClickSaveToDb(),\"Clicked on Save to DB\")\n \n //Step19. Click on Modify Configuration\n AssertClass.IsTrue(DeviceManagementPage.ClickonModifyConfig(),\"Clicked on Modify Config\")\n \n //Step20. Click on Fault Recording\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n \n //Step21. Check the Max DFR Value\n AssertClass.CompareString(ConfigEditor_FaultRecordingPage.GetMaxDFR(),MaxDFR_Mid,\"Checking Max DFR value\")\n\n //Step22. Send to Device\n AssertClass.IsTrue(ConfigEditorPage.ClickSendToDevice(),\"Clicked on Send to Device\")\n \n \n Log.Message(\"Pass:-Test to check that user tries to input DFR record length value less/greater than minimum/maximum value\")\n }\n catch(ex)\n {\n Log.Error(ex.stack)\n Log.Error(\"Fail:-Test to check that user tries to input DFR record length value less/greater than minimum/maximum value\")\n }\n}", "title": "" }, { "docid": "402d5877dbfa7db8159d56fa93421667", "score": "0.47234198", "text": "scenarioThree() {\n const companyPreference = {\n c1: \"s1\",\n c2: \"s2\"\n };\n const studentPreference = {\n s1: \"c2\",\n s2: \"c1\"\n };\n InterviewScheduling.setInterview(companyPreference, studentPreference);\n }", "title": "" }, { "docid": "75d44f84bf1b4b9693159c155a311b77", "score": "0.4711526", "text": "function IndividualAttestation() {}", "title": "" }, { "docid": "a5ad1eba661c0fbb7face456bc999b1e", "score": "0.4711196", "text": "function activateTestMode() {\n var arr = newDataset.getDataset();\n var newArr = [];\n var amountToProcess = arr.length;\n for (let i = 0; i < arr.length; i++) {\n var a = new web3.utils.BN(\"10000000000000\");\n aa = [arr[i][0], a.toString()];\n newArr.push(aa);\n aa = [];\n }\n newDataset.resetData();\n newDataset.overrideData(newArr);\n console.log(JSON.stringify(newDataset.getDataset(), 2, 2));\n}", "title": "" }, { "docid": "ecfe1137f1afba3651a64f49f38e8c02", "score": "0.47020411", "text": "prepare_experiment() {\n let dataset = this.raw_sub_conds;\n \n this.sub_condition_order = balance_subconditions(this.balancing_type, this.constructor.name.toLowerCase(), dataset.length);\n\n let ordered_dataset = [];\n // Order the data set according to the randomly ordered array\n for (let i = 0; i < this.sub_condition_order.length; i++) {\n ordered_dataset[i] = dataset[this.sub_condition_order[i]];\n }\n // Set experiment trials\n this.experiment_conditions_constants = ordered_dataset;\n console.log(\"experiment_conditions_constants\");\n console.log(JSON.stringify(this.experiment_conditions_constants));\n }", "title": "" }, { "docid": "8a7d23b3cc205d40ae07f94d2c7a1b5e", "score": "0.46965313", "text": "function theImplementation(automata){\n\n}", "title": "" }, { "docid": "6b570559e16f14bcc5278bc462a53655", "score": "0.46933514", "text": "function BusinessIntelligenceCheck(){}", "title": "" }, { "docid": "c56f0284c3124b6882a583d294e8d225", "score": "0.46781826", "text": "clickTrainModel(){\n if(this.__learnData == null){\n alert(\"You Need To Upload A Data To Train First!!!\");\n return;\n }\n\n //trains the model\n let type = document.getElementById(\"alg-type\").value;\n this.__clientController.trainModel(type, this.__learnData);\n }", "title": "" }, { "docid": "138710381b68f7660a2c4a7f42ba4b23", "score": "0.46779525", "text": "function main() {\n const ws = fs.createWriteStream(process.env.OUTPUT_PATH);\n\n const nt = readLine().split(' ');\n\n const n = parseInt(nt[0], 10);\n\n const t = parseInt(nt[1], 10);\n\n const width = readLine().split(' ').map(widthTemp => parseInt(widthTemp, 10));\n\n let cases = Array(t);\n\n for (let i = 0; i < t; i++) {\n cases[i] = readLine().split(' ').map(casesTemp => parseInt(casesTemp, 10));\n }\n\n let result = serviceLane(width, cases);\n\n ws.write(result.join('\\n') + '\\n');\n\n ws.end();\n}", "title": "" }, { "docid": "95e65cb4a55ea22cdd86affdbaef9182", "score": "0.46778196", "text": "export_trial_data() {\n let trial_data = jsPsych.data.get().filterCustom(function (row) {\n return row.block_type === \"practice\" || row.block_type === \"test\";\n })\n // These are variables forced on by jsPsych\n .ignore('stimulus')\n .ignore('key_press')\n .ignore('choices')\n .ignore('trial_type')\n .ignore('trial_index')\n .ignore('time_elapsed')\n .ignore('internal_node_id')\n .ignore('rt');\n\n let fileName = \"S\" + this.subject_id + \"_\" + this.condition_name + \"_shape_estimation_trial_results.csv\";\n\n trial_data.localSave('csv', fileName);\n }", "title": "" }, { "docid": "1c0a3ad1477ae0b30cc9a0d6b8961557", "score": "0.4674954", "text": "function CAM_729_730_731_733()\n{\n try\n {\n Log.Message(\"Start:-Test to check limit DFR record length feature when FR trigger(Pre+Oplimit+Post fault time) is within Maximum record length.\")\n var dataSheetName = Project.ConfigPath +\"TestData\\\\CAM_729_730_731_733.xlsx\"\n //Step0.Check whether device exists or not in the topology. \n if(DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceName\"))!=true)\n {\n GeneralPage.CreateDevice(CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceName\"),CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceSerialNo\"),CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceIPAdd\"))\n DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceName\")) \n }\n else\n {\n Log.Message(\"Device exist in the tree topology.\")\n }\n \n //Step1. Retrieve Configuration\n AssertClass.IsTrue(DeviceManagementPage.ClickonRetrieveConfig(),\"Clicked on Retrieve Config\")\n \n //Step2. Click on Fault Recording\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n \n //Step3. Set pre-fault for External Triggers\n var prefault =CommonMethod.ReadDataFromExcel(dataSheetName,\"PrefaultTime\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetPrefault(prefault),\"Validating Prefault Time\")\n \n //Step3.1. Set Max DFR time\n var maxDFR=CommonMethod.ReadDataFromExcel(dataSheetName,\"MaxDFR\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetMaxDFR(maxDFR),\"Validating Max DFR\") \n \n //Step3.2 Click on FR Sensor\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFRSensor(),\"Clicked on FR Sensor\")\n \n //Step4 Set Post Fault,Oplimit for FR Sensor\n AssertClass.IsTrue(ConfigEditor_FaultRecording_FRSensorPage.OpenFRSensorEditor(0),\"Open up FR Sensor Editor\") //Setting First FR Sensor\n var frsensorNameFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"FRSensorName\")\n var frsensorTypeFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"Type\")\n var frsensorScalingTypeFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"ScalingType\")\n var frsensorUpperThresholdFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"UpperThreshold\")\n var frsensorPostFaultTimeFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"PostFaultTime\")\n var frsensorOplimitFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"Oplimit\")\n var frsensorRecordDurationFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"RecordDuration\")\n \n DFR_Methods.SetFRSensor(frsensorNameFromTestData,frsensorTypeFromTestData,frsensorScalingTypeFromTestData,frsensorUpperThresholdFromTestData,frsensorPostFaultTimeFromTestData,frsensorOplimitFromTestData)\n \n //Step5. Send to Device\n AssertClass.IsTrue(ConfigEditorPage.ClickSendToDevice(),\"Clicked on Send to Device\")\n \n //Step6. Click on DFR Directory under Display Device Directory\n AssertClass.IsTrue(DataRetrievalPage.ClickOnDFRDirectory() ,\"Clicked on DFR Directory\") \n \n //Step7. Find latest Record Number\n var lastDFRRecord= DataRetrievalPage.GetLatestRecordnumber()\n Log.Message(\"Current Record Number is :- \"+lastDFRRecord) \n \n //Step8. Close DFR Directory\n AssertClass.IsTrue(DataRetrievalPage.CloseDFRDirectory() ,\"Close DFR Directory\") \n \n //Step9 Start Omicron Injection\n OmicronStateSeqPage.RunSeqFile(Project.ConfigPath+\"TestData\\\\\"+CommonMethod.ReadDataFromExcel(dataSheetName,\"OmicronFile\"))\n \n AssertClass.IsTrue(DFR_Methods.IsNewRecordFound(10,lastDFRRecord),\"Checking for new Record\")\n \n AssertClass.CompareString(\"FRSENSOR\",DataRetrievalPage.GetCOTForLatestDFRRecord(),\"Checking COT\") \n \n //Step11. Click on Download Data Now\n AssertClass.IsTrue(DataRetrievalPage.ClickOnDownloadDataNow(),\"Clicked on Download Data Now\")\n CommonMethod.CheckActivityLog(\"DFR records saved successfully for device\")\n AssertClass.IsTrue(DataRetrievalPage.CloseDFRDirectory(),\"Closed DFR Directory\")\n DFR_Methods.ViewDFROnPDP(aqConvert.StrToInt64(lastDFRRecord)+1)\n \n //Step12. Check Record Length\n var recordLength= CommonMethod.ConvertTimeIntoms(PDPPage.GetRecordDuration(0))//FirstRow\n AssertClass.CompareDecimalValues(aqConvert.StrToInt64(frsensorRecordDurationFromTestData),aqConvert.StrToInt64(recordLength),0,\"Validating Record Duration.\")\n \n //Step13. Check Prefault time\n var actualPrefault = (PDPPage.GetRecordTriggerDateTime(0))-PDPPage.GetRecordStartDateTime(0)\n AssertClass.CompareDecimalValues(aqConvert.StrToInt64(prefault),actualPrefault,0,\"Prefault calculated from PDP is :-\"+actualPrefault)\n \n //Step14. Export to CDF.\n if (aqFileSystem.Exists(Project.ConfigPath+\"DFRRecordResults\"))\n {\n AssertClass.IsTrue(PDPPage.ExportTOCDF(Project.ConfigPath+\"DFRRecordResults\\\\\"))\n }\n else\n {\n aqFileSystem.CreateFolder(Project.ConfigPath+\"DFRRecordResults\")\n AssertClass.IsTrue(PDPPage.ExportTOCDF(Project.ConfigPath+\"DFRRecordResults\\\\\"))\n } \n //Step15. Export to CSV\n var sysUserName = CommonMethod.GetSystemUsername()\n var dfrRecordPath =\"C:\\\\Users\\\\\"+sysUserName+\"\\\\Desktop\\\\DFRRecord\\\\\"\n if (aqFileSystem.Exists(dfrRecordPath))\n {\n AssertClass.IsTrue(PDPPage.ExportTOCSV()) \n }\n else\n {\n aqFileSystem.CreateFolder(dfrRecordPath)\n AssertClass.IsTrue(PDPPage.ExportTOCSV())\n }\n AssertClass.IsTrue(CommonMethod.KillProcess(\"EXCEL\")) //This method is used to kill the process \n Log.Message(\"Pass:-Test to check limit DFR record length feature when FR trigger(Pre+Oplimit+Post fault time) is within Maximum record length.\")\n }\n catch(ex)\n {\n Log.Message(ex.stack)\n Log.Error(\"Error:-Test to check limit DFR record length feature when FR trigger(Pre+Oplimit+Post fault time) is within Maximum record length.\") \n }\n finally\n {\n OmicronStateSeqPage.CloseStateSeq()\n }\n}", "title": "" }, { "docid": "a28a1c45a5178ec82808ada54889f32a", "score": "0.46700877", "text": "function run_all_scripts_data()\n\n{\n \n \n runDemo_test();\n runDemo_tiscali();\n runDemo_gnocca();\n \n// runDemo_test_events();\n// runDemo_test_events_2();\n// runDemo_tiscali_events ();\n}", "title": "" }, { "docid": "2dc5ca05c52ed61b4a0d5bb43003dc99", "score": "0.46651536", "text": "getRandomTaco (e) {\n e.preventDefault();\n randomTacoConfig()\n .then(config => {\n this.saveTaco(config)\n })\n }", "title": "" }, { "docid": "6a0f1ab6a26bb22c57dc948261a0c659", "score": "0.46637797", "text": "function Scenario (name)\n{\n\tthis.Name = name;\n\tthis.Armies = [];\t\n}", "title": "" }, { "docid": "e50345371d64e64167f1fdf6b298c20c", "score": "0.46597028", "text": "function logGenerator(logText) {\n cucumberJson.attach('Automação: ' + logText);\n //console.log('Automação: ' + logText)\n}", "title": "" }, { "docid": "50b77025f9fddb23f7c2a71c5b60ab41", "score": "0.46596682", "text": "function newHowTo() {\n console.log('how to is working');\n }", "title": "" }, { "docid": "d84f7dad7045ad0ef194a291a9b3331b", "score": "0.46465623", "text": "function setupStartCase12() {\n console.log(\"setupStartCase12\");\n\n if (String($scope.OrderType).trim().toLocaleLowerCase() == \"assembly\") {\n //todo line3946-3970\n console.log(\"setupStartCase12 subassembly\", $scope.subAssembly);\n for (var i = 0; i < $scope.subAssembly.length;i++){\n if (String($scope.subAssembly[i]['woStatus']).trim().toLowerCase() != \"completed\") {\n $(\"#alertBoxContent\").text(\"Unable to proceed due to dependent Work Order is not completed.\");\n $('#alertBox').modal('show');\n //alert(\"Unable to proceed due to dependent Work Order is not completed.\");\n break;\n }\n }\n // setupStartCase15();\n } else {\n setupStartCase15();\n }\n\n }", "title": "" }, { "docid": "cf5b3fdc4fc28737b2c788c0689c2801", "score": "0.4643283", "text": "function goStep(step,id=1){\n switch(step)\n {\n case 1: window.location.assign(\"./defconceptos/\"+id);\n break;\n case 2: window.location.assign(\"./planteamiento/\"+id);\n break;\n case 3: window.location.assign(\"./ideas/\"+id);\n break;\n case 4: window.location.assign(\"./categorizacion\");\n break;\n case 5: window.location.assign(\"./metas\");\n break;\n case 6: window.location.assign(\"./estudio\");\n break;\n case 7: window.location.assign(\"./conclusion\");\n break;\n }\n\n\t\n}", "title": "" }, { "docid": "72d79cef728660bdd623f80b6c9f111a", "score": "0.4641192", "text": "function baixaSCCD(par_id,par_destino,par_filial_app,element) {\n params ={\n id: par_id,\n destino: par_destino,\n filial_app: par_filial_app\n }\n loadAPI('POST','',api_baixa_sccd,params).then((ret)=>{\n sendLog('AVISO',`(009) Registro de Baixa SCCD na API: ID:(${par_id}) >> (${JSON.stringify(ret)})`)\n testExist_ALB(element)\n })\n}", "title": "" }, { "docid": "6fdbe497ada5ca655f0efee4040cd8a7", "score": "0.46362662", "text": "function sceltagiocata(scelta,segno){\n var scelta = Math.random();\n if (scelta<=0.33) {\n segno=\"Sasso\";\n }\n else if (scelta>0.33 && scelta<=0.66) {\n segno=\"Carta\";\n }\n else if (scelta>0.66) {\n segno=\"Forbici\";\n }\n return segno;\n}", "title": "" }, { "docid": "20813d2cb191534ffdf31db795a8a695", "score": "0.4626588", "text": "function pulaCorda() {\n console.log('Pulei 1x com function')\n console.log('Pulei 2x com function')\n console.log('Pulei 3x com function')\n console.log('Pulei 4x com function')\n console.log('Pulei 5x com function')\n console.log('Pulei 6x com function')\n console.log('Pulei 7x com function')\n console.log('Pulei 8x com function')\n console.log('Pulei 9x com function')\n console.log('Pulei 10x com function')\n}", "title": "" }, { "docid": "8888b251505468cc9b16e2fa59977c6e", "score": "0.4624686", "text": "function testEliza () {\n let eliza = new ElizaBot();\n console.log(eliza.getInitial());\n console.log(eliza.transform(\"I've been wondering if you'd be a good test\"));\n}", "title": "" }, { "docid": "f9c2f8042a900228321712a15df4a735", "score": "0.462452", "text": "function execute(specs,error,data){\n\t\t\tingest.init(specs,error,data)\n\t\t\ttransform.init(specs)\n\t\t\t// draw.init(specs,\"simpleFever\",'steps')\n\t\t\tdraw.init(specs,\"horizontalBars\",\"upsDowns\")\n\n\t\t\t// draw.init(specs,\"simpleFever\",'valueYoy')\n\t\t\t// draw.init(specs,\"simpleFever\",'valueRank')\n\n\n\t\t\t// draw.init(specs,\"simpleFever\",'value12periodAverageYoy')\n\t\t\t// draw.init(specs,\"simpleFever\",'value12periodAverageYoyRank')\n\n\n\n\t\t\t// draw.init(specs,\"segmentedRankedFever\")\n\t\t}", "title": "" }, { "docid": "49a84cf0fa45c3859b1b7dfd473625a6", "score": "0.46244243", "text": "function generateTestsForScenarios(suite) {\n\t\ttestScenarioDocuments.forEach(function (doc) {\n\t\t\tsuite[doc.label] = function () {\n\t\t\t\tvar visibleBefore;\n\t\t\t\tvar visibleAfter;\n\t\t\t\tvar hasScrolled;\n\n\t\t\t\treturn this.get('remote').findById(doc.id)\n\t\t\t\t\t.findByClassName('before')\n\t\t\t\t\t.getProperty('value').then(function (visible) {\n\t\t\t\t\t\tvisibleBefore = parseInt(visible, 10);\n\t\t\t\t\t})\n\t\t\t\t\t.end()\n\t\t\t\t\t.findByClassName('scrollBtn')\n\t\t\t\t\t.click()\n\t\t\t\t\t.end()\n\t\t\t\t\t.findByClassName('hasScrolled')\n\t\t\t\t\t.getProperty('value').then(function (scrolled) {\n\t\t\t\t\t\thasScrolled = parseInt(scrolled, 10);\n\t\t\t\t\t})\n\t\t\t\t\t.end()\n\t\t\t\t\t.findByClassName('after')\n\t\t\t\t\t.getProperty('value').then(function (visible) {\n\t\t\t\t\t\tvisibleAfter = parseInt(visible, 10);\n\t\t\t\t\t})\n\t\t\t\t\t.then(function () {\n\t\t\t\t\t\tif (hasScrolled) {\n\t\t\t\t\t\t\tassert.notOk(visibleBefore, 'scrolled, target should not be visible before');\n\t\t\t\t\t\t\tassert.ok(visibleAfter, 'scrolled, target should be visible after');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tassert.ok(visibleBefore, 'not scrolled, target should be visible before');\n\t\t\t\t\t\t\tassert.ok(visibleAfter, 'not scrolled, target should be visible after');\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t};\n\t\t});\n\t}", "title": "" }, { "docid": "ee381ede8807d0c8a71724e0a74a6e1a", "score": "0.46170774", "text": "function btnScrap_ClickCase15() {\n console.log(\"btnScrap_ClickCase15\");\n if($scope.WOExecutionStatus == \"Completed\"){\n btnScrap_ClickCase20();\n } else{\n btnScrap_ClickCase100();\n }\n\n }", "title": "" }, { "docid": "2f8ee2d48eb18737e173a5df204b6e04", "score": "0.46141475", "text": "function wa(){}", "title": "" }, { "docid": "4cce72222827a75d88cea1a62612c32b", "score": "0.46135992", "text": "function ScenarioStepFactory(step,ctx) {\n this.isAction = () => step.action !== undefined\n this.isConsumedMessage = () => (step.message !== undefined) && (step.consumed_by !== undefined)\n this.isProducedMessage = () => (step.message !== undefined) && (step.produced_by !== undefined)\n this.isCalledAPI = () => (step.api !== undefined) && (step.called_by !== undefined)\n this.isStartAfter = () => step.after !== undefined\n \n this.build = function() {\n if(this.isAction()) {\n return new DoesActionStep(step,ctx)\n } else if(this.isConsumedMessage()) {\n return new ConsumesMessageStep(step,ctx)\n } else if(this.isProducedMessage()) {\n return new ProducesMessageStep(step,ctx)\n } else if(this.isCalledAPI()) {\n return new CallsAPIStep(step,ctx)\n } else if(this.isStartAfter()){\n return new StartAfterStep(step,ctx)\n }\n } \n}", "title": "" }, { "docid": "b8423dfab2f6095ea91191d03c0d97a6", "score": "0.46134922", "text": "function Launchsimplert()\n{\n\tSP_UnrequireFields();\n\tMapsimplertData();\n\tselectRouteLaunched(\"simplert\",\"mastercontrol.task.mapped.routes.simplert\");\n\tRunSimpleCounter();\n}", "title": "" }, { "docid": "90846cfd547c6128a07b9764984cc23b", "score": "0.46098837", "text": "function exampleScenario() {\n\tnewtonsBalls();\n\tcreateMassSpring(550, 180, 1.5, 20,1, balls, springs);\n\trandomBalls(offset, canvas.width-offset, canvas.height-offset-50, canvas.height-offset, 0, -0.7,5, 1,8, {\"radius\":8},balls);\n\tballs.push(new Ball(canvas.width/2, canvas.height-offset-50, 6, 0, -2.5, {\"radius\":24, \"colour\":\"#AA00FF\"}));\n}", "title": "" }, { "docid": "1a2299ccc26d7cc4879a8be85a93e88a", "score": "0.46029896", "text": "constructor() {\n this.count = 0; //a counter to keep track of how many trials were dispalyed\n this.trialData = []; //initializes a vector to collect data\n this.allTrainings = setupTrainings(); //calls the function defined in items_t.js, which creates the training trials\n this.switch=true; //simple and inelegant way to display a 'congratulations!' message after the training \n this.allTrials = setupTrials(); //calls the function defined in items.js, which creates the trials\n }", "title": "" }, { "docid": "0149fbdd3e555631b04af9929eca2280", "score": "0.46022147", "text": "step(action){\r\n\r\n }", "title": "" }, { "docid": "a5b94899079b90b57c237c43045009d6", "score": "0.4601588", "text": "constructor(scope: cdk.Construct, id: string, props: IOneTriggerProps) {\n super(scope, id);\n const stack = cdk.Stack.of(this)\n\n // Event to Step Function\n // ----------------------\n // Create CWE rule\n // Create custom action\n\n let description = `Remediate with SHARR`\n if (props.description) {\n description = props.description\n }\n\n let complianceStatusFilter = {\n \"Status\": [ \"FAILED\", \"WARNING\" ]\n }\n\n const stateMachine = StateMachine.fromStateMachineArn(this, 'orchestrator', props.targetArn);\n\n // Note: Id is max 20 characters\n const customAction = new cdk.CustomResource(this, 'Custom Action', {\n serviceToken: `arn:${stack.partition}:lambda:${stack.region}:${stack.account}:function:SO0111-SHARR-CustomAction`,\n resourceType: 'Custom::ActionTarget',\n properties: {\n Name: 'Remediate with SHARR',\n Description: 'Submit the finding to AWS Security Hub Automated Response and Remediation',\n Id: 'SHARRRemediation'\n }\n });\n {\n let child = customAction.node.defaultChild as cdk.CfnCustomResource\n child.addDependsOn(props.prereq)\n }\n\n // Create an IAM role for Events to start the State Machine\n const eventsRole = new Role(this, 'EventsRuleRole', {\n assumedBy: new ServicePrincipal('events.amazonaws.com')\n });\n\n // Grant the start execution permission to the Events service\n stateMachine.grantStartExecution(eventsRole);\n\n // Create an event rule to trigger the step function\n const stateMachineTarget: IRuleTarget = {\n bind: () => ({\n id: '',\n arn: props.targetArn,\n role: eventsRole\n })\n };\n\n let eventPattern: EventPattern = {\n source: [\"aws.securityhub\"],\n detailType: [\"Security Hub Findings - Custom Action\"],\n resources: [ customAction.getAttString('Arn') ],\n detail: {\n findings: { \n Compliance: complianceStatusFilter\n }\n }\n }\n\n new Rule(this, 'Remediate Custom Action', {\n description: description,\n enabled: true,\n eventPattern: eventPattern,\n ruleName: `Remediate_with_SHARR_CustomAction`,\n targets: [stateMachineTarget]\n })\n }", "title": "" }, { "docid": "9b297f9d484ebc328af57299635bcfb2", "score": "0.4598863", "text": "function runProgram(type) {\n // Sets default CATIA environment directory\n var direnv = '\"C:\\\\ProgramData\\\\DassaultSystemes\\\\CATEnv\"';\n var getTheorem = store.get('theorem');\n // Launches 4Tier connected CATIA R29 with Ford settings\n if (type == 'app-catia29-4tier'){\n process.env.TC_PORTAL_ROOT = \"C:\\\\Progra~1\\\\Siemens\\\\Teamcenter11\\\\fede\\\\portal_4tier\";\n process.env.TC_ROOT = \"C:\\\\Progra~1\\\\Siemens\\\\Teamcenter11\\\\fede\";\n process.env.TCICV5_DIR = \"C:\\\\Progra~1\\\\Siemens\\\\Teamcenter11\\\\fede\\\\tcic\";\n var env = 'CATIA_V5R29_CAA.FEDE';\n if (getTheorem == true){\n var fileName = 'catia5r29_start.cmd\"'\n var filePath = '\"' + 'W:' + '\\\\PROCEDURES\\\\STANDARDS\\\\THEOREM\\\\bin\\\\';\n exec(filePath + fileName + ' ' + env + ' ' + direnv, (e, stdout, stderr)=> {\n if (e instanceof Error) {\n console.error(e);\n throw e;\n }\n console.log('stdout ', stdout);\n console.log('stderr ', stderr);\n });\n } else {\n var fileName = 'CATSTART.exe\"';\n var filePath = '\"C:\\\\Program Files\\\\Dassault Systemes\\\\B29\\\\win_b64\\\\code\\\\bin\\\\';\n exec(filePath + fileName + ' -run \"CNEXT.exe\"' + ' -env ' + env + ' -direnv ' + direnv + ' -nowindow', (e, stdout, stderr)=> {\n if (e instanceof Error) {\n console.error(e);\n throw e;\n }\n console.log('stdout ', stdout);\n console.log('stderr ', stderr);\n });\n }\n };\n\n // Launches Loc2 connected CATIA R29 with Ford settings\n if (type == 'app-catia29-loc2'){\n process.env.TC_PORTAL_ROOT = \"C:\\\\Progra~1\\\\Siemens\\\\Teamcenter11\\\\fede_pdcloc2\\\\portal\"\n process.env.TC_ROOT = \"C:\\\\Progra~1\\\\Siemens\\\\Teamcenter11\\\\fede_pdcloc2\"\n process.env.TCICV5_DIR = \"C:\\\\Progra~1\\\\Siemens\\\\Teamcenter11\\\\fede_pdcloc2\\\\tcic\"\n var env = 'CATIA_V5R29_CAA.PDCLOC2_FEDE';\n if (getTheorem == true){\n var fileName = 'catia5r29_start.cmd\"'\n var filePath = '\"' + 'W:' + '\\\\PROCEDURES\\\\STANDARDS\\\\THEOREM\\\\bin\\\\';\n exec(filePath + fileName + ' ' + env + ' ' + direnv, (e, stdout, stderr)=> {\n if (e instanceof Error) {\n console.error(e);\n throw e;\n }\n console.log('stdout ', stdout);\n console.log('stderr ', stderr);\n });\n } else {\n var fileName = 'CATSTART.exe\"';\n var filePath = '\"C:\\\\Program Files\\\\Dassault Systemes\\\\B29\\\\win_b64\\\\code\\\\bin\\\\';\n exec(filePath + fileName + ' -run \"CNEXT.exe\"' + ' -env ' + env + ' -direnv ' + direnv + ' -nowindow', (e, stdout, stderr)=> {\n if (e instanceof Error) {\n console.error(e);\n throw e;\n }\n console.log('stdout ', stdout);\n console.log('stderr ', stderr);\n });\n }\n };\n\n // Launches CATIA R27 with Toyota settings\n if (type == 'app-toyota'){\n var env = 'CATIA_V5R27.TOYOTA';\n if (getTheorem == true){\n var fileName = 'catia5r27_start.cmd\"';\n var filePath = '\"' + 'W:' + '\\\\PROCEDURES\\\\STANDARDS\\\\THEOREM\\\\bin\\\\';\n exec(filePath + fileName + ' ' + env + ' ' + direnv, (e, stdout, stderr)=> {\n if (e instanceof Error) {\n console.error(e);\n throw e;\n }\n console.log('stdout ', stdout);\n console.log('stderr ', stderr);\n });\n } else {\n var fileName = 'CATSTART.exe\"';\n var filePath = '\"C:\\\\Program Files\\\\Dassault Systemes\\\\B27\\\\win_b64\\\\code\\\\bin\\\\';\n exec(filePath + fileName + ' -run \"CNEXT.exe\"' + ' -env ' + env + ' -direnv ' + direnv + ' -nowindow', (e, stdout, stderr)=> {\n if (e instanceof Error) {\n console.error(e);\n throw e;\n }\n console.log('stdout ', stdout);\n console.log('stderr ', stderr);\n });\n }\n };\n\n // Launches the GM Launcher app\n if (type == 'app-gm'){\n var fileName = 'gmlaunch6.1.bat\"';\n var filePath = '\"R:\\\\gmlaunch6.1\\\\';\n exec(filePath + fileName, (e, stdout, stderr)=> {\n if (e instanceof Error) {\n console.error(e);\n throw e;\n }\n console.log('stdout ', stdout);\n console.log('stderr ', stderr);\n });\n };\n\n // Launches the Daimler Start Configurator\n if (type == 'app-daimler'){\n var fileName = 'Daimler.NX.Startconfigurator.exe\"';\n var path = '\"C:\\\\Program Files\\\\Daimler\\\\NX12_Build18.2.2\\\\nx_client\\\\NX120\\\\Addons\\\\NXStartconfigurator\\\\';\n exec(path + fileName, (e, stdout, stderr)=> {\n if (e instanceof Error) {\n console.error(e);\n throw e;\n }\n console.log('stdout ', stdout);\n console.log('stderr ', stderr);\n });\n };\n\n // Launches 4Tier Teamcenter without CATIA\n if (type == 'app-tce-loc1'){\n var fileName = 'portal.bat\"';\n var filePath = '\"C:\\\\Program Files\\\\Siemens\\\\Teamcenter11\\\\fede\\\\portal_4tier\\\\';\n exec(filePath + fileName, (e, stdout, stderr)=> {\n if (e instanceof Error) {\n console.error(e);\n throw e;\n }\n console.log('stdout ', stdout);\n console.log('stderr ', stderr);\n });\n };\n\n // Launches Loc2 Teamcenter without CATIA\n if (type == 'app-tce-loc2'){\n var fileName = 'portal.bat\"';\n var filePath = '\"C:\\\\Program Files\\\\Siemens\\\\Teamcenter11\\\\fede_pdcloc2\\\\portal\\\\';\n exec(filePath + fileName, (e, stdout, stderr)=> {\n if (e instanceof Error) {\n console.error(e);\n throw e;\n }\n console.log('stdout ', stdout);\n console.log('stderr ', stderr);\n });\n };\n\n // Launches the base CATIA V5 R25 with default settings\n if (type == 'app-catia25'){\n var env = 'CATIA.V5-6R2015.B25';\n if (getTheorem == true){\n var fileName = 'catia5r25_start.cmd\"';\n var filePath = '\"' + oDrive + '\\\\PROCEDURES\\\\STANDARDS\\\\THEOREM\\\\bin\\\\';\n exec(filePath + fileName + ' ' + env + ' ' + direnv, (e, stdout, stderr)=> {\n if (e instanceof Error) {\n console.error(e);\n throw e;\n }\n console.log('stdout ', stdout);\n console.log('stderr ', stderr);\n });\n } else {\n var fileName = 'CATSTART.exe\"';\n var filePath = '\"C:\\\\Program Files\\\\Dassault Systemes\\\\B25\\\\win_b64\\\\code\\\\bin\\\\';\n exec(filePath + fileName + ' -env ' + env + ' -direnv ' + direnv + ' -nowindow', (e, stdout, stderr)=> {\n if (e instanceof Error) {\n console.error(e);\n throw e;\n }\n console.log('stdout ', stdout);\n console.log('stderr ', stderr);\n });\n }\n };\n\n // Launches the base CATIA V5 R26 with default settings\n if (type == 'app-catia26'){\n var env = 'CATIA.V5-6R2016.B26';\n if (getTheorem == true){\n var fileName = 'catia5r26_start.cmd\"';\n var filePath = '\"' + oDrive + '\\\\PROCEDURES\\\\STANDARDS\\\\THEOREM\\\\bin\\\\';\n exec(filePath + fileName + ' ' + env + ' ' + direnv, (e, stdout, stderr)=> {\n if (e instanceof Error) {\n console.error(e);\n throw e;\n }\n console.log('stdout ', stdout);\n console.log('stderr ', stderr);\n });\n } else {\n var fileName = 'CATSTART.exe\"';\n var filePath = '\"C:\\\\Program Files\\\\Dassault Systemes\\\\B26\\\\win_b64\\\\code\\\\bin\\\\';\n exec(filePath + fileName + ' -env ' + env + ' -direnv ' + direnv + ' -nowindow', (e, stdout, stderr)=> {\n if (e instanceof Error) {\n console.error(e);\n throw e;\n }\n console.log('stdout ', stdout);\n console.log('stderr ', stderr);\n });\n }\n };\n\n // Launches the base CATIA V5 R27 with default settings\n if (type == 'app-catia27'){\n var env = 'CATIA.V5-6R2017.B27';\n if (getTheorem == true){\n var fileName = 'catia5r27_start.cmd\"';\n var filePath = '\"' + oDrive + '\\\\PROCEDURES\\\\STANDARDS\\\\THEOREM\\\\bin\\\\';\n exec(filePath + fileName + ' ' + env + ' ' + direnv, (e, stdout, stderr)=> {\n if (e instanceof Error) {\n console.error(e);\n throw e;\n }\n console.log('stdout ', stdout);\n console.log('stderr ', stderr);\n });\n } else {\n var fileName = 'CATSTART.exe\"';\n var filePath = '\"C:\\\\Program Files\\\\Dassault Systemes\\\\B27\\\\win_b64\\\\code\\\\bin\\\\';\n exec(filePath + fileName + ' -env ' + env + ' -direnv ' + direnv + ' -nowindow', (e, stdout, stderr)=> {\n if (e instanceof Error) {\n console.error(e);\n throw e;\n }\n console.log('stdout ', stdout);\n console.log('stderr ', stderr);\n });\n }\n };\n\n // Launches the base CATIA V5 R28 with default settings\n if (type == 'app-catia28'){\n var env = 'CATIA.V5-6R2018.B28';\n if (getTheorem == true){\n var fileName = 'catia5r28_start.cmd\"';\n var filePath = '\"' + oDrive + '\\\\PROCEDURES\\\\STANDARDS\\\\THEOREM\\\\bin\\\\';\n exec(filePath + fileName + ' ' + env + ' ' + direnv, (e, stdout, stderr)=> {\n if (e instanceof Error) {\n console.error(e);\n throw e;\n }\n console.log('stdout ', stdout);\n console.log('stderr ', stderr);\n });\n } else {\n var fileName = 'CATSTART.exe\"';\n var filePath = '\"C:\\\\Program Files\\\\Dassault Systemes\\\\B28\\\\win_b64\\\\code\\\\bin\\\\';\n exec(filePath + fileName + ' -env ' + env + ' -direnv ' + direnv + ' -nowindow', (e, stdout, stderr)=> {\n if (e instanceof Error) {\n console.error(e);\n throw e;\n }\n console.log('stdout ', stdout);\n console.log('stderr ', stderr);\n });\n }\n };\n\n // Launches the base CATIA V5 R29 with default settings\n if (type == 'app-catia29'){\n var env = 'CATIA.V5-6R2019.B29';\n if (getTheorem == true){\n var fileName = 'catia5r29_start.cmd\"';\n var filePath = '\"' + oDrive + '\\\\PROCEDURES\\\\STANDARDS\\\\THEOREM\\\\bin\\\\';\n exec(filePath + fileName + ' ' + env + ' ' + direnv, (e, stdout, stderr)=> {\n if (e instanceof Error) {\n console.error(e);\n throw e;\n }\n console.log('stdout ', stdout);\n console.log('stderr ', stderr);\n });\n } else {\n var fileName = 'CATSTART.exe\"';\n var filePath = '\"C:\\\\Program Files\\\\Dassault Systemes\\\\B29\\\\win_b64\\\\code\\\\bin\\\\';\n exec(filePath + fileName + ' -env ' + env + ' -direnv ' + direnv + ' -nowindow', (e, stdout, stderr)=> {\n if (e instanceof Error) {\n console.error(e);\n throw e;\n }\n console.log('stdout ', stdout);\n console.log('stderr ', stderr);\n });\n }\n };\n\n // Launches the base CATIA V6 R2020 with default settings\n if (type == 'app-catia2020'){\n var fileName = 'CATSTART.exe\"';\n var filePath = '\"C:\\\\Program Files\\\\Dassault Systemes\\\\B422_Cloud\\\\win_b64\\\\code\\\\bin\\\\';\n exec(filePath + fileName + ' -run \"3DEXPERIENCE.exe\"' + ' -object'+ ' -Url=https://r1132101028056-us1-space.3dexperience.3ds.com:443/enovia' + ' -workbench' + ' CATShapeDesignWorkbench' + ' -MyAppsUrl=\"https://eu1-apps.3dexperience.3d\"', (e, stdout, stderr)=> {\n if (e instanceof Error) {\n console.error(e);\n throw e;\n }\n console.log('stdout ', stdout);\n console.log('stderr ', stderr);\n });\n };\n\n // Launches the base NX 11 with default settings\n if (type == 'app-nx11'){\n if (getTheorem == true){\n var fileName = 'RunNX11.cmd\"';\n var filePath = '\"' + oExt + '\\\\PROCEDURES\\\\STANDARDS\\\\THEOREM\\\\bin\\\\';\n exec(filePath + fileName, (e, stdout, stderr)=> {\n if (e instanceof Error) {\n console.error(e);\n throw e;\n }\n console.log('stdout ', stdout);\n console.log('stderr ', stderr);\n });\n } else {\n var fileName = 'ugraf.exe\"';\n var filePath = '\"C:\\\\Program Files\\\\Siemens\\\\NX 11.0\\\\NXBIN\\\\';\n exec(filePath + fileName, (e, stdout, stderr)=> {\n if (e instanceof Error) {\n console.error(e);\n throw e;\n }\n console.log('stdout ', stdout);\n console.log('stderr ', stderr);\n });\n }\n };\n\n // Launches the base NX 12 with default settings\n if (type == 'app-nx12'){\n if (getTheorem == true){\n var fileName = 'RunNX12.cmd\"';\n var filePath = '\"' + oExt + '\\\\PROCEDURES\\\\STANDARDS\\\\THEOREM\\\\bin\\\\';\n exec(filePath + fileName, (e, stdout, stderr)=> {\n if (e instanceof Error) {\n console.error(e);\n throw e;\n }\n console.log('stdout ', stdout);\n console.log('stderr ', stderr);\n });\n } else {\n var fileName = 'ugraf.exe\"';\n var filePath = '\"C:\\\\Program Files\\\\Siemens\\\\NX 12.0\\\\NXBIN\\\\';\n exec(filePath + fileName, (e, stdout, stderr)=> {\n if (e instanceof Error) {\n console.error(e);\n throw e;\n }\n console.log('stdout ', stdout);\n console.log('stderr ', stderr);\n });\n }\n };\n\n // Launches the base NX 1855 with default settings\n if (type == 'app-nx1855'){\n var fileName = 'ugraf.exe\"';\n var filePath = '\"C:\\\\Program Files\\\\Siemens\\\\NX\\\\NXBIN\\\\';\n exec(filePath + fileName, (e, stdout, stderr)=> {\n if (e instanceof Error) {\n console.error(e);\n throw e;\n }\n console.log('stdout ', stdout);\n console.log('stderr ', stderr);\n });\n };\n\n // Launches the base NX 1872 with default settings\n if (type == 'app-nx1872'){\n var fileName = 'ugraf.exe\"';\n var filePath = '\"C:\\\\Program Files\\\\Siemens\\\\NX1872\\\\NXBIN\\\\';\n exec(filePath + fileName, (e, stdout, stderr)=> {\n if (e instanceof Error) {\n console.error(e);\n throw e;\n }\n console.log('stdout ', stdout);\n console.log('stderr ', stderr);\n });\n };\n\n // Launches the base NX 1899 with default settings\n if (type == 'app-nx1899'){\n var fileName = 'ugraf.exe\"';\n var filePath = '\"C:\\\\Program Files\\\\Siemens\\\\NX1899\\\\NXBIN\\\\';\n exec(filePath + fileName, (e, stdout, stderr)=> {\n if (e instanceof Error) {\n console.error(e);\n throw e;\n }\n console.log('stdout ', stdout);\n console.log('stderr ', stderr);\n });\n };\n\n // Launches the base Solidworks with default settings\n if (type == 'app-sldwrks'){\n var fileName = 'SLDWORKS.exe\"';\n var filePath = '\"C:\\\\Program Files\\\\SOLIDWORKS Corp\\\\SOLIDWORKS\\\\';\n exec(filePath + fileName, (e, stdout, stderr)=> {\n if (e instanceof Error) {\n console.error(e);\n throw e;\n }\n console.log('stdout ', stdout);\n console.log('stderr ', stderr);\n });\n }\n}", "title": "" }, { "docid": "594b7fa1f7a9d1e0dd2e91e6b8173f5d", "score": "0.4587987", "text": "function C001_BeforeClass_Sidney_Run() {\n\tBuildInteraction(C001_BeforeClass_Sidney_CurrentStage);\n}", "title": "" }, { "docid": "5d5fbb1f0979068df78865f5a5560137", "score": "0.4587914", "text": "_transformModel(sitawareChorModel) {\n console.log('Received following model:');\n console.log(sitawareChorModel);\n\n // the elements of the situation-aware choreography model\n let sitawareChorModelDefinitions = sitawareChorModel['bpmn2:definitions'];\n\n let cliMethods = this._getMethods(this.cli);\n let bpmnjsMethods = this._getMethods(this.bpmnjs);\n let bpmnFactoryMethods = this._getMethods(this.bpmnFactory);\n let bpmnRendererMethods = this._getMethods(this.bpmnRenderer);\n let chorModelMethods = this._getMethods(sitawareChorModel);\n let modelingMethods = this._getMethods(this.modeling);\n\n console.log('CLI methods: ');\n console.log(cliMethods);\n\n console.log('bpmnJs methods: ');\n console.log(bpmnjsMethods);\n\n console.log('bpmnFacMethods:');\n console.log(bpmnFactoryMethods);\n\n console.log('bpmnRenderer Methods :');\n console.log(bpmnRendererMethods);\n\n console.log('SitAware Chor Model Methods: ');\n console.log(chorModelMethods);\n\n console.log('Modeling Methods: ');\n console.log(modelingMethods);\n\n this.modeling.makeCollaboration();\n\n let collaborationRootElementId = this._getCollaborationId();\n\n this._removeAll([collaborationRootElementId]);\n\n console.log('Currently there are the following elements:');\n console.log(this.cli.elements());\n\n console.log('With the following definitions: ');\n console.log(this.bpmnjs.getDefinitions);\n\n // we will create the collaboration model within these elements\n let sitawareCollabModelDefinitions = this.bpmnjs.getDefinitions();\n\n // find all participants of the model\n let participants = this._findParticipants(sitawareChorModel);\n console.log('Found following participants: ');\n console.log(participants);\n\n // find all available situations\n let situations = this._findSituations(sitawareChorModel);\n console.log('Found following situations: ');\n console.log(situations);\n\n let y_index = 1;\n\n // for each participant and situation we create a participant inside the new collaboration model\n for (let index = 0; index < participants.length; index++) {\n let participant = participants[index];\n this._createParticipant(participant.id, participant.name, 100, 100 * (y_index), collaborationRootElementId, sitawareCollabModelDefinitions, true);\n y_index++;\n }\n\n let sitawareChorModelStartEvents = this._findStartEvents(sitawareChorModel);\n\n console.log('Found following start events: ');\n console.log(sitawareChorModelStartEvents);\n\n let visited = [];\n let created = [];\n console.log('Starting choreography to collaboration walk to create tasks in participants:');\n this._choreography2collaborationWalk(sitawareChorModelStartEvents, visited, created, sitawareChorModel, sitawareCollabModelDefinitions);\n\n console.log('Starting to connect created tasks');\n this._transformChoreographyFlowToCollaborationFlow(created, sitawareChorModel, sitawareCollabModelDefinitions);\n\n console.log('Finished creating collaboration');\n\n\n console.log('Creating Situation-Aware logic:');\n for (let index = 0; index < situations.length; index++) {\n let situation = situations[index];\n console.log('Adding Situation to collaboration');\n this._createParticipant(this._createSituationId(situation.situationname), situation.situationname, 300 , 100 * (y_index), collaborationRootElementId, sitawareCollabModelDefinitions, false);\n y_index++;\n }\n\n this._transformSituationAwareScopes(sitawareChorModel, sitawareCollabModelDefinitions);\n\n this._layout();\n }", "title": "" }, { "docid": "aefa9d83a5f7036154caf173564b7760", "score": "0.45835462", "text": "stocker_local_trajet() {}", "title": "" }, { "docid": "c71c647ba0e4dff419d26d07e86e28a7", "score": "0.45822915", "text": "async function extractRoi(choices, flag1) {\n $UI.choiceModal.close();\n $('#snackbar').html('<h3>Model Loading ...</h3>');\n document.getElementById('snackbar').className = 'show';\n const self = $UI.segmentPanel;\n var X = self.__spImgX;\n var Y = self.__spImgY;\n const totalSize = self.__spImgWidth;\n\n self.showProgress('Processing ..');\n const key = choices.model;\n const step = parseInt(key.split('_')[0].split('-')[1]);\n const prefixUrl = ImgloaderMode == 'iip'?`../../img/IIP/raw/?IIIF=${$D.params.data.location}`:$CAMIC.slideId;\n const scaleMethod = choices.scale;\n\n // model loading\n const tx = db.transaction('models_store', 'readonly');\n const store = tx.objectStore('models_store');\n const req = store.get(key);\n\n req.onsuccess = async function(e) {\n // Keras sorts the labels by alphabetical order.\n const inputShape = e.target.result.input_shape;\n const inputChannels = parseInt(inputShape[3]);\n const imageSize = parseInt(inputShape[1]);\n\n model = await tf.loadLayersModel(IDB_URL + key);\n console.log('Model Loaded');\n\n tf.tidy(()=>{\n // Warmup the model before using real data.\n const warmupResult = model.predict(tf.zeros([1, imageSize, imageSize, inputChannels]));\n });\n\n const fullResCvs = self.__fullsrc;\n var height = Y + totalSize;\n var width = X + totalSize;\n\n\n fullResCvs.height = step;\n fullResCvs.width = step;\n const temp = document.querySelector('#dummy');\n temp.height = step;\n temp.width = step;\n\n function addImageProcess(src) {\n return new Promise((resolve, reject) => {\n const img = new Image();\n img.onload = () => resolve(img);\n img.onerror = reject;\n img.src = src;\n });\n }\n var regionData = [];\n\n\n if ( flag1 != 0 ) {\n X = 0;\n Y = 0;\n height = $D.params.data.height;\n width = $D.params.data.width;\n }\n var c = 0;\n const totalPatches = (width / step) * (height / step);\n document.getElementById('snackbar').className = '';\n $('#snackbar').html('');\n $('#snackbar').html('<h3>Predicting ...</h3><span id = \"etap\"></span>');\n document.getElementById('snackbar').className = 'show';\n for (let y = Y, dy = 0; y <= (height - step); y += (step)) {\n let dx = 0;\n for (let x = X; x < (width - step); x += (step)) {\n const src = prefixUrl + '\\/' + x + ',' + y + ',' + step + ',' + step + '\\/' + step + ',/0/default.jpg';\n const lImg = await addImageProcess(src);\n fullResCvs.height = lImg.height;\n fullResCvs.width = lImg.width;\n fullResCvs.getContext('2d').drawImage(lImg, 0, 0);\n\n // dummy.getContext('2d').drawImage(img, dx, dy);\n const imgData = fullResCvs.getContext('2d').getImageData(0, 0, fullResCvs.width, fullResCvs.height);\n let val;\n tf.tidy(()=> {\n const img = tf.browser.fromPixels(imgData).toFloat();\n let img2;\n if (inputChannels == 1) {\n img2 = tf.image.resizeBilinear(img, [imageSize, imageSize]).mean(2);\n } else {\n img2 = tf.image.resizeBilinear(img, [imageSize, imageSize]);\n }\n\n\n let normalized;\n if (scaleMethod == 'norm') {\n // Pixel Normalization: scale pixel values to the range 0-1.\n\n const scale = tf.scalar(255);\n normalized = img2.div(scale);\n } else if (scaleMethod == 'center') {\n // Pixel Centering: scale pixel values to have a zero mean.\n\n const mean = img2.mean();\n normalized = img2.sub(mean);\n // normalized.mean().print(true); // Uncomment to check mean value.\n // let min = img2.min();\n // let max = img2.max();\n // let normalized = img2.sub(min).div(max.sub(min));\n } else {\n // Pixel Standardization: scale pixel values to have a zero mean and unit variance.\n\n const mean = img2.mean();\n const std = (img2.squaredDifference(mean).sum()).div(img2.flatten().shape).sqrt();\n normalized = img2.sub(mean).div(std);\n }\n const batched = normalized.reshape([1, imageSize, imageSize, inputChannels]);\n let values = model.predict(batched).dataSync();\n values = Array.from(values);\n // scale values\n values = values.map((x) => x * 255);\n val = [];\n while (values.length > 0) val.push(values.splice(0, imageSize));\n });\n\n regionData.push({value: val, X: x, Y: y});\n dx += step;\n\n c += 1;\n $('#etap').html('');\n $('#etap').append('<b>' + (((c / totalPatches)) * 100).toFixed(0) + ' %</b> ');\n }\n dy += step;\n }\n\n self.hideProgress();\n model.dispose();\n var regionMask = [];\n for (var i = 0; i < regionData.length; i++) {\n const temp = document.querySelector('#dummy');\n temp.height = step;\n temp.width = step;\n tf.engine().startScope();\n await tf.browser.toPixels(regionData[i].value, temp);\n tf.engine().endScope();\n regionMask.push(temp.toDataURL().replace(/^data:image\\/(png|jpg);base64,/, ''));\n }\n\n var zip = new JSZip(); // zip file to download patches\n zip.folder('masks');\n var img = zip.folder('masks');\n document.getElementById('snackbar').className = '';\n $('#snackbar').html('');\n $('#snackbar').html('<h3> Downloading Masks...</h3>' + '<span id = \"etadm\"></span>');\n document.getElementById('snackbar').className = 'show';\n for (var i = 0; i < regionMask.length; i++) {\n img.file( i+ 'Mask' + '.png', regionMask[i], {base64: true});\n\n $('#etadm').html('');\n $('#etadm').append('<b>'+(((i / regionMask.length)) * 100).toFixed(0) + ' % </b>');\n }\n\n\n if ($('#both').is(':checked')) {\n c = 0;\n zip.folder('patches');\n var img2 = zip.folder('patches');\n\n document.getElementById('snackbar').className = '';\n\n $('#snackbar').html('');\n $('#snackbar').html('<h3> Downloading Patches...</h3>' + '<span id = \"etadp\"></span>');\n document.getElementById('snackbar').className = 'show';\n\n for (let y = Y, dy = 0; y <= (height - step); y += (step)) {\n let dx = 0;\n for (let x = X; x < (width - step); x += (step)) {\n const src = prefixUrl + '\\/' + x + ',' + y + ',' + step + ',' + step + '\\/' + step + ',/0/default.jpg';\n const lImg = await addImageProcess(src);\n fullResCvs.height = lImg.height;\n fullResCvs.width = lImg.width;\n var t;\n fullResCvs.getContext('2d').drawImage(lImg, 0, 0);\n t = fullResCvs.toDataURL().replace(/^data:image\\/(png|jpg);base64,/, '');\n\n img2.file(c + 'patch' + '.png', t, {base64: true});\n c = c + 1;\n dx += step; $('#etadp').html('');\n $('#etadp').append('<b>' + (((c / regionMask.length)) * 100).toFixed(0) + ' % </b>');\n }\n dy += step;\n }\n }\n\n\n await zip.generateAsync({type: 'blob'}).then(function(content) {\n saveAs(content, 'download.zip');\n });\n\n document.getElementById('snackbar').className = '';\n $('#detailsdata').html('');\n $('#detailsdata').append('<br><li>Number of patches/masks extracted <b>' + regionMask.length +'</li><br>');\n\n if (flag1 == 0 ) {\n drawRectangle({checked: false});\n flag = -1;\n }\n $UI.segmentPanel.close();\n\n $UI.detailsModal.open();\n console.log('finished');\n };\n}", "title": "" }, { "docid": "fea489760018a2dc670cd807bf08594f", "score": "0.45774007", "text": "constructor(config)\r\n {\r\n this.usteps=[];\r\n this.rsteps=[];\r\n this.begin=config.initial;\r\n this.initial=config.initial;\r\n this.states=config.states;\r\n this.states.normal.transitions.study=config.states.normal.transitions.study;\r\n this.states.busy.transitions.get_tired=config.states.busy.transitions.get_tired;\r\n this.states.busy.transitions.get_hungry=config.states.busy.transitions.get_hungry;\r\n this.states.hungry.transitions.eat=config.states.hungry.transitions.eat;\r\n this.states.sleeping.transitions.get_hungry=config.states.sleeping.transitions.get_hungry;\r\n this.states.sleeping.transitions.get_up=config.states.sleeping.transitions.get_up;\r\n\r\n }", "title": "" }, { "docid": "60a799ba1375c16cccb99702970153ff", "score": "0.4575238", "text": "irAlBoss(){\n this.salaActual = new Sala(this.salaActual.jugador, this.salaActual, posicionSala.bossBatle, \"Boss.txt\",5, this.counterId++);\n }", "title": "" }, { "docid": "cb5fdc5747166f7cadc47b1c09b0036c", "score": "0.45738783", "text": "function abrePredio(sigla) {\n history.push(`/apartamentos-predio/${sigla}`)\n }", "title": "" }, { "docid": "d5b4e52c00f36a9cdaa6f1460d6445c4", "score": "0.45727512", "text": "function step1(test, title) {\n casper.start('http://www.globalmarket.com/order/-/product-info/-/' + testCaseConfig.productId + '.html', function(response) {\n\n test.assertExists('#product-name', title);\n\n casper.capture(config.screenshotsDir + '/step1.png');\n\n });\n}", "title": "" }, { "docid": "a66574e0821c366327a4d475d2ec1936", "score": "0.45700157", "text": "function inicializarSopa(){\n\n switch (gameLevel){\n case 1: rowsCols=14; break;\n case 2: rowsCols=18; break;\n case 3: rowsCols=25; break;\n default : alert(\"tipo de juego no soportado\");\n }\n //crear la tabla y llenar cada celda con un caracter aleatorio\n var tab=document.createElement(\"table\");\n $(tab).addClass(\"myTable\");\n for(var j=0;j<rowsCols;j++){\n var ntr=document.createElement(\"tr\");\n $(ntr).addClass(\"myTR\");\n for(var i=0;i<rowsCols;i++){\n var ntd=document.createElement(\"td\");\n $(ntd).attr(\"id\",j+\"-\"+i); \n $(ntd).addClass(\"myTD\");\n //aqui se llena la celda con el caracter aleactorio\n $(ntd).html(getRandomChar());\n $(ntd).appendTo(ntr);\n }\n $(ntr).appendTo(tab);\n }\n $(tab).appendTo(\"#sopaLetras\");\n $(\"#sopaLetras\").addClass(\"jugando\");\n //poner las palabras en orden aleatorio \n setWordsInSoup(); \n setWordsAside();\n// \n// //agregar evento clic a cada celda\n enableCellAction();\n}", "title": "" }, { "docid": "69a92181a50b24b5e10a9c37b73518ee", "score": "0.4568091", "text": "function exportGULP() {\n\t\n\tvar stringCellparamgulp;\n\tvar coordinateAddgulp = \"\";\n\tvar cellHeadergulp = \"cell\";\n\tvar flagsymmetryGulp = false;\n\n\twarningMsg(\"Make sure you have selected the model you would like to export.\");\n\tsaveStateAndOrientation_a();\n\tif (_file.cell.typeSystem != \"crystal\")\n\t\tsetUnitCell();\n\t\n\tvar titleGulpinput = prompt(\"Type here the job title:\", \"\");\n\t(titleGulpinput == \"\") ? (titleGulpinput = 'Input prepared with J-ICE ')\n\t\t\t: (titleGulpinput = '#Input prepared with J-ICE \\n'\n\t\t\t\t\t+ titleGulpinput);\n\tvar titleGulp = 'var optiongulp = \\\"opti conp propr #GULP options\\\";'\n\t\t\t+ 'var titleheader = \\\"title \\\"; ' + 'var title = \\\"'\n\t\t\t+ titleGulpinput + '\\\"; ' + 'var titleend = \\\"end \\\";'\n\t\t\t+ 'titlegulp = [optiongulp, titleheader, title, titleend];';\n\trunJmolScriptWait(titleGulp);\n\n\tswitch (_file.cell.typeSystem) {\n\tcase \"crystal\":\n\t\tsetUnitCell();\n\t\tflagsymmetryGulp = confirm(\"Do you want to introduce symmetry ?\");\n\n\t\tif (flagsymmetryGulp) {\n\t\t\twarningMsg(\"This procedure is not fully tested.\");\n\t\t\tfigureOutSpaceGroup(false, false);\n\t\t} else {\n\t\t\tstringCellparamgulp = roundNumber(_file.cell.a) + ' ' + roundNumber(_file.cell.b)\n\t\t\t\t\t+ ' ' + roundNumber(_file.cell.c) + ' ' + roundNumber(_file.cell.alpha) + ' '\n\t\t\t\t\t+ roundNumber(_file.cell.beta) + ' ' + roundNumber(_file.cell.gamma);\n\t\t}\n\t\tbreak;\n\n\tcase \"surface\":\n\t\tcellHeadergulp = \"scell\";\n\t\tcoordinateAddgulp = \"s\";\n\t\tstringCellparamgulp = roundNumber(_file.cell.a) + \", \" + roundNumber(_file.cell.b)\n\t\t\t\t+ \", \" + roundNumber(_file.cell.gamma);\n\t\tbreak;\n\n\tcase \"polymer\":\n\t\tcellHeadergulp = \"pcell\";\n\t\tcoordinateAddgulp = \"\";\n\t\tstringCellparamgulp = roundNumber(_file.cell.a);\n\t\tbreak;\n\n\tcase \"molecule\":\n\t\t// TODO\n\n\t\tbreak;\n\t}\n\n\n\tvar cellGulp = 'var cellheader = \\\"' + cellHeadergulp + '\\\";'\n\t\t+ 'var cellparameter = \\\"' + stringCellparamgulp + '\\\";'\n\t\t+ 'cellgulp = [cellheader, cellparameter];';\n\trunJmolScriptWait(cellGulp);\n\n\tvar coordinateString;\n\tvar coordinateShel;\n\tvar sortofCoordinateGulp;\n\tif (_file.cell.typeSystem == 'crystal') {\n\t\tvar sortofCoordinate = confirm(\"Do you want the coordinates in Cartesian or fractional? \\n OK for Cartesian, Cancel for fractional.\")\n\t\tsortofCoordinateGulp = (sortofCoordinate == true) ? (coordinateAddgulp + \"cartesian\")\n\t\t\t\t: (coordinateAddgulp + \"fractional\");\n\t} else {\n\t\tmessageMsg(\"Coordinate will be exported in Cartesian\");\n\t}\n\tvar flagShelgulp = confirm(\"Is the inter-atomic potential a core/shel one? \\n Cancel stands for NO core/shel potential.\");\n\tif (sortofCoordinateGulp && _file.cell.typeSystem == 'crystal') {\n\t\tcoordinateString = _file.frameSelection + '.label(\"%e core %16.9[fxyz]\")';\n\t\tcoordinateShel = _file.frameSelection + '.label(\"%e shel %16.9[fxyz]\")';\n\t} else {\n\t\tcoordinateString = _file.frameSelection + '.label(\"%e core %16.9[xyz]\")';\n\t\tcoordinateShel = _file.frameSelection + '.label(\"%e shel %16.9[xyz]\")';\n\t}\n\tvar coordinateGulp;\n\tif (flagShelgulp) {\n\t\tcoordinateGulp = 'var coordtype = \\\"' + sortofCoordinateGulp + '\\\";'\n\t\t\t\t+ 'var coordcore = ' + coordinateString + ';'\n\t\t\t\t+ 'var coordshel = ' + coordinateShel + ';'\n\t\t\t\t+ 'coordgulp = [coordtype, coordcore, coordshel];';\n\t} else {\n\t\tcoordinateGulp = 'var coordtype = \\\"' + sortofCoordinateGulp + '\\\";'\n\t\t\t\t+ 'var coordcore = ' + coordinateString + ';'\n\t\t\t\t+ 'coordgulp = [coordtype, coordcore];';\n\t}\n\trunJmolScriptWait(coordinateGulp);\n\n\tif (_file.cell.typeSystem == \"crystal\") {\n\t\t// interNumber from crystalfunction .. BH??? interNumber is only defined locally in figureOutSpaceGroup\n\t\tif (!flagsymmetryGulp)\n\t\t\tinterNumber = \"P 1\"\n\t\tvar spacegroupGulp = 'var spaceheader = \\\"spacegroup\\\";'\n\t\t\t\t+ 'var spacegroup = \\\"' + interNumber + '\\\";'// TBC\n\t\t\t\t+ 'spacegulp = [spaceheader, spacegroup];';\n\t\trunJmolScriptWait(spacegroupGulp);\n\t}\n\n\tvar restGulp;\n\tif (flagShelgulp) {\n\t\trestGulp = 'var species= \\\"species \\\" \\n\\n;'\n\t\t\t\t+ 'var restpot = \\\"#here the user should enter the inter-atomic potential setting\\\";'\n\t\t\t\t+ 'var spring = \\\"spring \\\" \\n\\n;'\n\t\t\t\t+ 'restgulp = [species, restpot, spring];';\n\t} else {\n\t\trestGulp = 'var species= \\\"species \\\" \\n\\n;'\n\t\t\t\t+ 'var restpot = \\\"#here the user should enter the inter-atomic potential setting\\\";'\n\t\t\t\t+ 'restgulp = [species, restpot];';\n\t}\n\trunJmolScriptWait(restGulp);\n\n\tvar finalInputGulp;\n\tif (_file.cell.typeSystem == \"crystal\") {\n\t\tfinalInputGulp = \"var final = [titlegulp,cellgulp,coordgulp,spacegulp,restgulp];\"\n\t\t\t\t+ 'final = final.replace(\"\\n\\n\",\"\\n\");'\n\t\t\t\t+ 'WRITE VAR final \"?.gin\" ';\n\t} else {\n\t\tfinalInputGulp = \"var final = [titlegulp,cellgulp,coordgulp,restgulp];\"\n\t\t\t\t+ 'final = final.replace(\"\\n\\n\",\"\\n\");'\n\t\t\t\t+ 'WRITE VAR final \"?.gin\" ';\n\t}\n\trun(finalInputGulp);\n\trestoreStateAndOrientation_a();\n\n}", "title": "" }, { "docid": "9f7d9b75983d9c721283ff14ec770714", "score": "0.4567371", "text": "function loadUdt() { \n\n window.UniversalDataTool.open({\n container: document.getElementById(\"udt\"),\n\n udt: {\n namn: document.getElementById('project-name').value,\n interface: {\n type: document.querySelector('input[name=\"rdoAnnotation\"]:checked').value,\n labels: getLabels()\n },\n samples: samples\n },\n\n // Called when sample is saved\n onSaveSample: (index, sample) => {\n samples[sample].annotation = index.annotation\n console.log(index, sample);\n\n //postToPostgreSql(index.annotation)\n }\n\n }); \n}", "title": "" }, { "docid": "d3f52e7fcc7c4c6cfab0e615faf44e39", "score": "0.45651296", "text": "function troopRes(vi,tTask){\n try {\n var isTrainReady = true;////window.localStorage.setItem(\"troopRes0\" , \"troopRes0\");\n var myRace = GM_getValue ( myacc() + \"_raceID\" );\n var ProductionRate = getGMCookie(\"ProductionRate\", vi);\n //var reshere = getGMCookie ( \"ResourceNow\", vi ); \n\t\tvar reshere = getEstimatedResources(vi);\n var wareCap = Number ( GM_getValue ( myacc() + \"_\" + vi + \"_WarehouseCap\" ) );\n var granCap = Number ( GM_getValue ( myacc() + \"_\" + vi + \"_GranaryCap\") );\n //printErrorMSG(\"myRace=\"+myRace)\n switch (myRace) {\n\n case \"0\" :var trainCost = [[120,100,150,30],[100,130,160,70],[150,160,210,80,],[140,160,20,40],[550,440,320,100],[550,640,800,180],[900,360,500,70],[950,1350,600,90],[30750,27200,45000,37500],[4600,4200,5800,4400]]; break;\n\n case \"1\" :var trainCost = [[95,75,40,40],[145,70,85,40],[130,120,170,70],[160,100,50,50],[370,270,290,75],[450,515,480,80],[1000,300,350,70],[900,1200,600,60],[35500,26600,25000,27200],[5800,4400,4600,5200]]; break;\n\n case \"2\" :var trainCost = [[100,130,55,30],[140,150,185,60],[170,150,20,40],[350,450,230,60],[360,330,280,120],[500,620,675,170],[950,555,330,75],[960,1450,630,90],[30750,45400,31000,37500],[4400,5600,4200,3900]]; break;\n };\n //0,0,0,0,0,0,0,0,3,0 boss\n //0,0,0,0,0,0,0,0,0,3 migrate\n var taskCost = tTask[5];////window.localStorage.setItem(\"troopRes1\" , \"troopRes1\");\n\n var troop = taskCost.split(\",\");\n var cropCost = 0;\n for (var i=0 ; i < troop.length ; i++) {\n if ((i ==8 || i ==9) && troop[i] !=0){//save resource for training chiefer or ...\n //var saveCost =[]\n //for (var ctr=0 ;ctr<4; ctr++){saveCost[ctr] = trainCost[i][ctr]};\n GM_setValue ( myacc() + \"_\" + vi + \"_resTroop9-10\", trainCost[i].join(\"/\") );\n var sendNeedRes = GM_getValue ( myacc() + \"_promptAutoSendResourceForBuilding\", \"1\" );\n\t\t\t\tif(sendNeedRes==\"1\") {sendReqRes (false , trainCost[i] , vi , aLangErrorText[0] )};\n };\n\n cropCost += (troop[i] > 0) ? trainCost[i][3]*troop[i] : 0 ; \n\n\t\t\t////window.localStorage.setItem(\"troopRes2\" , \"troopRes2\");\n if((troop[i] > 0) && (trainCost[i][0] > wareCap || trainCost[i][1] > wareCap || trainCost[i][2] > wareCap || trainCost[i][3] > granCap)){\n isTrainReady = false;\n\n var cropError = checkCropWarehouseGranaryError ( vi, \"_cropError\" );\n if ( cropError == false ) {\n var now = new Date().getTime();\n var addWareTask = GM_getValue(\"addWareTask\" , \"true_0\");\n addWareTask = addWareTask.split(\"_\");\n var addGanTask = GM_getValue(\"addGanTask\", \"true_0\");\n addGanTask = addGanTask.split(\"_\");\n //printErrorMSG(addGanTask+\" \"+addWareTask);\n if (trainCost[i][3] > granCap && addGanTask[0] != false && now-Number(addGanTask[1]) > 40*60*1000){\n\t\t \t var flg = addBuildingTaskAtTop(vi,11); \n\t\t\t\t GM_setValue(\"addGanTask\" , (flg+\"_\"+now.toString()));// add granary upgrade task.\n }\n\t\t\t\t else if (addWareTask[0] != false && now-Number(addWareTask[1]) > 40*60*1000) \n\t\t\t\t \t{\n\t\t var flg = addBuildingTaskAtTop(vi,10);\n\t\t \t\t GM_setValue(\"addWareTask\" , (flg+\"_\"+now).toString()); // add warehouse upgrade task.;\n };\n };\n };\n };\n\n if (ProductionRate[3] < 0 && ((reshere[3]-cropCost)/(Math.abs(ProductionRate[3])) < 1.5)){\n\t\t isTrainReady = false ;////window.localStorage.setItem(\"troopRes3\" , \"troopRes3\");\n\t\t};\n\n ////window.localStorage.setItem(\"troopRes4\" , \"troopRes4\");\n return isTrainReady;\n }\ncatch ( err ) {\n\t\tprintStackTrace();\n\t\tvar msg = \"<b>troopRes():: 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}", "title": "" }, { "docid": "b30101b4b820a64cc3b7d43a6fa8d6d5", "score": "0.45638615", "text": "function exportPuzzle(){\n \n }", "title": "" }, { "docid": "37d48e81f788b9045a8e2776b0b7bb22", "score": "0.45633176", "text": "function CAM_734()\n{\n try\n {\n Log.Message(\"Start:-Test to check DFR record length when Trigger comes at end of first record..\")\n var dataSheetName = Project.ConfigPath +\"TestData\\\\CAM_734.xlsx\"\n //Step0.Check whether device exists or not in the topology. \n if(DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceName\"))!=true)\n {\n GeneralPage.CreateDevice(CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceName\"),CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceSerialNo\"),CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceIPAdd\"))\n DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceName\")) \n }\n else\n {\n Log.Message(\"Device exist in the tree topology.\")\n }\n \n //Step1. Retrieve Configuration\n AssertClass.IsTrue(DeviceManagementPage.ClickonRetrieveConfig(),\"Clicked on Retrieve Config\")\n \n //Step2. Click on Fault Recording\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n \n //Step3. Set pre-fault for External Triggers\n var prefault =CommonMethod.ReadDataFromExcel(dataSheetName,\"PrefaultTime\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetPrefault(prefault),\"Validating Prefault Time\")\n \n //Step3.1. Set Max DFR time\n var maxDFR=CommonMethod.ReadDataFromExcel(dataSheetName,\"MaxDFR\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetMaxDFR(maxDFR),\"Validating Max DFR\") \n \n //Step3.2 Click on FR Sensor\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFRSensor(),\"Clicked on FR Sensor\")\n \n //Step4 Set Post Fault,Oplimit for FR Sensor\n AssertClass.IsTrue(ConfigEditor_FaultRecording_FRSensorPage.OpenFRSensorEditor(0),\"Open up FR Sensor Editor\") //Setting First FR Sensor\n var frsensorNameFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"FRSensorName\")\n var frsensorTypeFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"Type\")\n var frsensorScalingTypeFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"ScalingType\")\n var frsensorUpperThresholdFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"UpperThreshold\")\n var frsensorPostFaultTimeFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"PostFaultTime\")\n var frsensorOplimitFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"Oplimit\")\n var expectedRecordDuration1 = CommonMethod.ReadDataFromExcel(dataSheetName,\"ExpectedRecordDuration_1\")\n var expectedRecordDuration2 = CommonMethod.ReadDataFromExcel(dataSheetName,\"ExpectedRecordDuration_2\")\n var expectedRecordDuration3 = CommonMethod.ReadDataFromExcel(dataSheetName,\"ExpectedRecordDuration_3\")\n var expectedRecordDuration4 = CommonMethod.ReadDataFromExcel(dataSheetName,\"ExpectedRecordDuration_4\")\n \n DFR_Methods.SetFRSensor(frsensorNameFromTestData,frsensorTypeFromTestData,frsensorScalingTypeFromTestData,frsensorUpperThresholdFromTestData,frsensorPostFaultTimeFromTestData,frsensorOplimitFromTestData)\n \n //Step4.1 Set Post fault, oplimit for FR sensor\n AssertClass.IsTrue(ConfigEditor_FaultRecording_FRSensorPage.OpenFRSensorEditor(1),\"Open up FR Sensor Editor\") //Setting Second FR Sensor\n var frsensorName1FromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"FRSensorName1\")\n \n DFR_Methods.SetFRSensor(frsensorName1FromTestData,frsensorTypeFromTestData,frsensorScalingTypeFromTestData,frsensorUpperThresholdFromTestData,frsensorPostFaultTimeFromTestData,frsensorOplimitFromTestData)\n \n //Step5. Send to Device\n AssertClass.IsTrue(ConfigEditorPage.ClickSendToDevice(),\"Clicked on Send to Device\")\n \n CAM_734_Verification(\"OmicronFile_1\",expectedRecordDuration1,expectedRecordDuration2,dataSheetName,prefault,100);\n CAM_734_Verification(\"OmicronFile_2\",expectedRecordDuration3,expectedRecordDuration4,dataSheetName,prefault);\n \n Log.Message(\"Pass:-Test to check DFR record length when Trigger comes at end of first record.\")\n } \n catch(ex)\n {\n Log.Message(ex.stack)\n Log.Error(\"Error:-Test to check DFR record length when Trigger comes at end of first record.\") \n }\n}", "title": "" }, { "docid": "5d9e165e18c18f60bae16ce88f1f70b1", "score": "0.45631278", "text": "function comportement (){\n\t }", "title": "" }, { "docid": "c0ccd4bc9c5d0e8c76a5367f10b581eb", "score": "0.456303", "text": "function CAM_763()\n{\n try\n {\n Log.Message(\"Start:-Test to check DFR record length with prefault =500ms and Max length =800ms.\")\n var dataSheetName = Project.ConfigPath +\"TestData\\\\CAM_763.xlsx\"\n //Step0.Check whether device exists or not in the topology. \n if(DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceName\"))!=true)\n {\n GeneralPage.CreateDevice(CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceName\"),CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceSerialNo\"),CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceIPAdd\"))\n DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceName\")) \n }\n else\n {\n Log.Message(\"Device exist in the tree topology.\")\n }\n \n //Step1. Retrieve Configuration\n AssertClass.IsTrue(DeviceManagementPage.ClickonRetrieveConfig(),\"Clicked on Retrieve Config\")\n \n //Step2. Click on Fault Recording\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n \n //Step3. Set pre-fault for External Triggers\n var prefault =CommonMethod.ReadDataFromExcel(dataSheetName,\"PrefaultTime\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetPrefault(prefault),\"Validating Prefault Time\")\n \n //Step3.1. Set Max DFR time\n var maxDFR=CommonMethod.ReadDataFromExcel(dataSheetName,\"MaxDFR\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetMaxDFR(maxDFR),\"Validating Max DFR\") \n \n //Step3.2 Click on FR Sensor\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFRSensor(),\"Clicked on FR Sensor\")\n \n //Step4 Set Post Fault,Oplimit for FR Sensor\n AssertClass.IsTrue(ConfigEditor_FaultRecording_FRSensorPage.OpenFRSensorEditor(0),\"Open up FR Sensor Editor\") //Setting First FR Sensor\n var frsensorNameFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"FRSensorName\")\n var frsensorTypeFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"Type\")\n var frsensorScalingTypeFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"ScalingType\")\n var frsensorUpperThresholdFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"UpperThreshold\")\n var frsensorPostFaultTimeFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"PostFaultTime\")\n var frsensorOplimitFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"Oplimit\")\n var expectedRecordDuration = CommonMethod.ReadDataFromExcel(dataSheetName,\"ExpectedRecordDuration\")\n \n DFR_Methods.SetFRSensor(frsensorNameFromTestData,frsensorTypeFromTestData,frsensorScalingTypeFromTestData,frsensorUpperThresholdFromTestData,frsensorPostFaultTimeFromTestData,frsensorOplimitFromTestData)\n \n //Step5. Send to Device\n AssertClass.IsTrue(ConfigEditorPage.ClickSendToDevice(),\"Clicked on Send to Device\") \n \n //Step6. Click on DFR Directory under Display Device Directory\n AssertClass.IsTrue(DataRetrievalPage.ClickOnDFRDirectory() ,\"Clicked on DFR Directory\") \n \n //Step7. Find latest Record Number\n var lastDFRRecord= DataRetrievalPage.GetLatestRecordnumber()\n Log.Message(\"Current Record Number is :- \"+lastDFRRecord) \n \n //Step8. Close DFR Directory\n AssertClass.IsTrue(DataRetrievalPage.CloseDFRDirectory() ,\"Close DFR Directory\") \n \n //Step9.Start Omicron Injection\n OmicronStateSeqPage.RunSeqFile(Project.ConfigPath+\"TestData\\\\\"+CommonMethod.ReadDataFromExcel(dataSheetName,\"OmicronFile\"))\n AssertClass.IsTrue(DFR_Methods.IsMultipleRecordFound(10,1,lastDFRRecord),\"Checking for new Record\") \n \n //Step10. Click on Download Data Now\n AssertClass.IsTrue(DFR_Methods.DownloadManualDFR(),\"Clicked on Download Data Now\")\n \n //Step11. Check Record Length\n var recordLength= CommonMethod.ConvertTimeIntoms(PDPPage.GetRecordDuration(0))//FirstRow\n AssertClass.CompareDecimalValues(aqConvert.StrToInt64(expectedRecordDuration),aqConvert.StrToInt64(recordLength),10,\"Validating Record Duration.\") //Added tolerance of 10 as sometimes we get 2-3 ms of additional duration\n \n Log.Message(\"Pass:-Test to check DFR record length with prefault =500ms and Max length =800ms\")\n }\n catch(ex)\n {\n Log.Error(ex.stack)\n Log.Error(\"Fail:-Test to check DFR record length with prefault =500ms and Max length =800ms\")\n }\n finally\n {\n OmicronStateSeqPage.CloseStateSeq()\n }\n}", "title": "" }, { "docid": "07f6e4562614b3df6a5b5629a81211a0", "score": "0.45606875", "text": "function app(nCases, input) {\n\n // code here\n \n}", "title": "" }, { "docid": "945bfd422ec1f5c0473e0e90186ad06c", "score": "0.45605165", "text": "function getCompareScenarios(isTr55) {\n var trueScenarios = App.currentProject.get('scenarios'),\n tempScenarios = new modelingModels.ScenariosCollection(),\n ccScenario = trueScenarios.findWhere({ is_current_conditions: true }),\n aoi_census = ccScenario.get('aoi_census');\n\n if (isTr55) {\n // Add Predominantly Forested scenario\n var forestScenario = copyScenario(ccScenario, aoi_census);\n\n forestScenario.set({\n name: 'Predominantly Forested',\n is_current_conditions: false,\n is_pre_columbian: true,\n });\n\n tempScenarios.add(forestScenario);\n }\n\n trueScenarios.forEach(function(scenario) {\n tempScenarios.add(copyScenario(scenario, aoi_census));\n });\n\n return tempScenarios;\n}", "title": "" }, { "docid": "68240d2ae5609eb9d9e35f7abafebaf2", "score": "0.45600918", "text": "function suivant(){\n if(active==\"idee\"){\n reunion_open();\n }else if (active==\"reunion\") {\n travail_open();\n }else if (active==\"travail\") {\n deploiement_open();\n }\n }", "title": "" }, { "docid": "a8f77c80177a76f4c95ebd7b399f99c1", "score": "0.45586276", "text": "function getSleep(steps, ser) {\n\t up.sleeps.get({}, function(err, body) {\n\t //console.log('Body: ' + body);\n\t sleep_me = JSON.parse(body);\n\t\t dashboard(steps, sleep_me.data.items[0].details.quality, res);\n\t\t});\n\t}", "title": "" } ]
1bfe049c2a0c86daf1d71486d72604cc
Resets the document changes and sets `hasPendingChanges` to false.
[ { "docid": "6758a419936ce51365900e92e7023c56", "score": "0.0", "text": "G() {\n this.U = !1, this.M = On();\n }", "title": "" } ]
[ { "docid": "27fb8be234ef43d4b998d91b418ef0bc", "score": "0.7127495", "text": "reset(doc) {\n if (doc) {\n debug('Document state reset to revision %s', doc._rev)\n } else {\n debug('Document state reset to being deleted')\n }\n this.document.reset(doc)\n this.rebase()\n }", "title": "" }, { "docid": "2f4d35008ebd04fb4f418cbfdddbac51", "score": "0.67762077", "text": "function resetDoc() {\n\n\tdoc = null;\n}", "title": "" }, { "docid": "8182c70f81e2eba419d87ceec4db6794", "score": "0.59560907", "text": "function flushChanges() {\n \t self.changes = [];\n \t }", "title": "" }, { "docid": "ff195f8d5d22eac0ceb456880dc7dc91", "score": "0.5920961", "text": "resetState() {\n this.set('changeError', null);\n this.set('changeComplete', false);\n }", "title": "" }, { "docid": "997f13753cca89eb41951217f35c1012", "score": "0.59051055", "text": "function _clearCurrentDocument() {\n // If editor already blank, do nothing\n if (!_currentDocument) {\n return;\n } else {\n // Change model & dispatch event\n var previousDocument = _currentDocument;\n _currentDocument = null;\n // (this event triggers EditorManager to actually clear the editor UI)\n $(exports).triggerHandler(\"currentDocumentChange\", [_currentDocument, previousDocument]);\n }\n }", "title": "" }, { "docid": "b3e7e4be7bfa43533ccde2ada9218ed8", "score": "0.57730365", "text": "function reset() {\n lastProcessedOperationId = -1; // Initialize to an invalid operation id\n pushConflicts = [];\n }", "title": "" }, { "docid": "d15d1de7847e2554edd1794b40595b38", "score": "0.57472634", "text": "flushChanges () {\n this._lastTransactionWasUndo = true;\n }", "title": "" }, { "docid": "5a9d37b78b9d24ac59c5ce20c99f97ef", "score": "0.5738129", "text": "function resetSentiment() {\n try {\n let docRef = firestore.collection('global-sentiment').doc(\"value\");\n docRef.set({value: 0});\n\n } catch (error) {\n logger.error(\"Could not reset sentiment\", error);\n }\n}", "title": "" }, { "docid": "037ae7abc8556905796b1d5068495011", "score": "0.5706529", "text": "function clearState() {\n m_state = { boundDocumentHandlers: m_state.boundDocumentHandlers };\n }", "title": "" }, { "docid": "a2c953f6672273b46218f291ffbf04e9", "score": "0.56525844", "text": "clearChanges() {\n }", "title": "" }, { "docid": "6f6b4e95043c2756370171c40301eb04", "score": "0.562866", "text": "function reset() {\n\t\t\t\tresetScore();\n\t\t\t\tsetExercise();\n\t\t\t\t$scope.operation = 'start';\n\t\t\t}", "title": "" }, { "docid": "18ad14dd68d198ecd4d04a8c82b22cdb", "score": "0.5540618", "text": "resetPendingTransactions() {\n this._pendingTransactions = [];\n }", "title": "" }, { "docid": "1d247d794f82d0ed748b3f2bfe601f46", "score": "0.55220366", "text": "clear () {\n\t\tthis.models = {};\t\t\t\t// cached models\n\t\tthis.modelOps = {};\t\t\t\t// cached operations to perform on models\n\t\tthis.toDeleteIds = {};\t\t\t// models that should be deleted when we persist\n\t\tthis.toCreateIds = {};\t\t\t// models that should be created when we persist\n\t\tthis.documentOptions = {};\t\t// database options associated with documents being persisted\n\t\tthis.directQueries = [];\t\t// direct queries still queued for when other documents get persisted\n\t}", "title": "" }, { "docid": "dbd005fe2d79d311313e4ec3694bbdce", "score": "0.5508353", "text": "function resetQuestions() {\n collection.forEach(question => question.status = 0);\n }", "title": "" }, { "docid": "67d798e5a72342399228bba14aad7d3e", "score": "0.54865944", "text": "reset() {\n\t\tthis.battlefield.reset();\n\t\tthis.isReady = false;\n\t\tthis.rematchRequested = false;\n\t}", "title": "" }, { "docid": "bd6860ff134434f16b20ca7ef0d429aa", "score": "0.5480392", "text": "beginEdit() {\n if (!this.isEditing) {\n this.isEditing = true;\n this.docs.forEach(srcDoc => {\n const doc = srcDoc;\n doc.status = status.DELETE;\n });\n }\n }", "title": "" }, { "docid": "ee5176dc9c167de8a243c743f2dc5864", "score": "0.5448074", "text": "reset() {\n this.resetShape();\n this.resetText();\n this.resetLink();\n this.changed = false;\n }", "title": "" }, { "docid": "a4add54e707069abd9d6d25e9eae6316", "score": "0.54328066", "text": "function eraseRecord() {\n thisEditor.lastSnapshot = new Date().getTime();\n thisEditor.undoManager.clear();\n thisEditor.ignoredChanges = 0;\n thisEditor.setModified(false);\n}", "title": "" }, { "docid": "b970777daad59ff37745cc40828b545c", "score": "0.54294944", "text": "function reset() {\n // options.count = options.originalCount;\n if (options.intervalId) {\n stop_interval();\n }\n on();\n }", "title": "" }, { "docid": "5f0446418b0e321f2788c85d08e53531", "score": "0.5428044", "text": "reset() {\r\n this.changeState(this.initialState);\r\n this.clearHistory();\r\n }", "title": "" }, { "docid": "1b8248d176de93b2e2f227143bef3917", "score": "0.54158294", "text": "reset() {\n this._model.resetActualValue();\n this._view.resetFilterValue(this._model.actualValue)\n }", "title": "" }, { "docid": "c18dd738d3cc9fa858ab5383a9f2101b", "score": "0.54134", "text": "function reset() {\n\t\tdoSubmit = true;\n\t\tauthContingency = false;\n\t\turls = {};\n\t\texperiences = {};\n\t\tlisteners = [];\n\t\t\n\t\tresetExperience();\n\t}", "title": "" }, { "docid": "454e2d5c087d94689fa118a3e2add3f3", "score": "0.53817046", "text": "function removeAllContent() {\n var doc = DocumentApp.getActiveDocument();\n doc.setText(''); \n}", "title": "" }, { "docid": "5c9f837d092b68b3c56679ce52d01a38", "score": "0.53767675", "text": "reset() {\r\n this.changeState(this.initialState)\r\n }", "title": "" }, { "docid": "97015f43a453e30b868fd490543ef6e8", "score": "0.53638566", "text": "_reset() {\n this._current = null;\n this._cursor = null;\n this._options = [];\n this._original = null;\n this._query = '';\n this._subsetMatch = false;\n this._typeMap = {};\n this._orderedTypes = [];\n }", "title": "" }, { "docid": "885f67578727fd882d5dee00786e0a54", "score": "0.5353299", "text": "async function reset() {\r\n // delete todoist tasks\r\n const [label] = await todoist.ensureLabels(['d2l']);\r\n const res = await todoist.get(['items']);\r\n const tasks = res.items.filter(({ labels }) => labels.includes(label));\r\n console.log(`Deleting ${tasks.length} tasks...`);\r\n tasks.forEach(({ id }) => todoist.queue(id, { type: 'item_delete', args: { id } }));\r\n await todoist.sync();\r\n // reset cache\r\n const snapshot = await db.collection('d2l-classes').orderBy('__name__').get();\r\n if (snapshot.size > 0) {\r\n console.log(`Cleaning ${snapshot.size} documents...`);\r\n const now = new Date();\r\n await snapshotMap(snapshot, ({ ref }) => ref.set({\r\n // reset announcement to midnight of the current day\r\n lastAnnouncement: Timestamp.fromDate(new Date(now.getFullYear(), now.getMonth(), now.getDate())),\r\n assignments: [],\r\n lessons: {},\r\n }, { merge: true }));\r\n }\r\n}", "title": "" }, { "docid": "84b6f2199738d83bcad476f1ccf4611d", "score": "0.5344533", "text": "function reset() {\n getService().reset();\n}", "title": "" }, { "docid": "84b6f2199738d83bcad476f1ccf4611d", "score": "0.5344533", "text": "function reset() {\n getService().reset();\n}", "title": "" }, { "docid": "febabc7d4e51cfd6e0629e56612b398b", "score": "0.5339055", "text": "reset() {\n this.txnConnections = 0;\n this.cursorConnections = 0;\n this.otherConnections = 0;\n }", "title": "" }, { "docid": "febabc7d4e51cfd6e0629e56612b398b", "score": "0.5339055", "text": "reset() {\n this.txnConnections = 0;\n this.cursorConnections = 0;\n this.otherConnections = 0;\n }", "title": "" }, { "docid": "a4a82ef4d5cadb234e77c6ce43be7ef7", "score": "0.53285813", "text": "reset() {\n this.exec = false;\n this.clearTimers();\n this.i = 0;\n this.currentTime = this.startTime;\n this.pb.render(0);\n this.clearCTX();\n this.dispatchChange(\"state\", { change: \"reset\" });\n }", "title": "" }, { "docid": "9f0a08978db5573d4db7c6f019ca9877", "score": "0.5324156", "text": "reset() {\n if (!this.started)\n return;\n\n // Stop subscriptions\n this.sub_accounts.stop();\n this.sub_users.stop();\n // Clear offline cache\n this.offlineKeyAccounts.clear();\n this.offlineUser.clear();\n // Reset started flag\n this.started = false;\n }", "title": "" }, { "docid": "e27a56c9de8437923c01c53d49cce27c", "score": "0.53237844", "text": "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}", "title": "" }, { "docid": "25ab2a660df73220fe08e922cb431378", "score": "0.53213984", "text": "function ResetDocumentModal() {\n\t$(\"#ApplicationDocumentFile\").val(\"\");\n\tLadda.stopAll();\n}", "title": "" }, { "docid": "7dfeefb32e4ca74c27308aab9f6072c3", "score": "0.53191644", "text": "function reset() {\n UsersRelatedToContent.reset();\n }", "title": "" }, { "docid": "22d7ba4da65259dec1355d781b65453e", "score": "0.5315963", "text": "function reset() {\n // nothing\n }", "title": "" }, { "docid": "e1aa64ce6fca429058af6e655b210e47", "score": "0.5315804", "text": "clear() {\r\n let document = this.ensureDocument();\r\n let range = new Range(document, 0, document.length);\r\n range.text = '';\r\n console.update();\r\n }", "title": "" }, { "docid": "c85d9189822d209ec379a38f8441edca", "score": "0.53118354", "text": "soft_reset() {\n this.counter = 0;\n this.state = STATIC;\n }", "title": "" }, { "docid": "ff9243457c1b2f8c60f2be905e8c74bb", "score": "0.5309512", "text": "_reset() {\n if (this.isDirty) {\n let record;\n for (record = this._previousItHead = this._itHead; record !== null; record = record._next) {\n record._nextPrevious = record._next;\n }\n for (record = this._additionsHead; record !== null; record = record._nextAdded) {\n record.previousIndex = record.currentIndex;\n }\n this._additionsHead = this._additionsTail = null;\n for (record = this._movesHead; record !== null; record = record._nextMoved) {\n record.previousIndex = record.currentIndex;\n }\n this._movesHead = this._movesTail = null;\n this._removalsHead = this._removalsTail = null;\n this._identityChangesHead = this._identityChangesTail = null;\n // TODO(vicb): when assert gets supported\n // assert(!this.isDirty);\n }\n }", "title": "" }, { "docid": "de031570eaee310d63021e108716a2d5", "score": "0.53072166", "text": "reset() {\n this.model.reset();\n\n // reset drive-inputs\n for (const drive in this.model.inputs) {\n let ident = this.model.inputs[drive].split('-'); // eg.: ident = ['a','len']\n this.model.constraintById(ident[0])[ident[1]].inputCallbk(0); // reset driven constraints\n document.getElementById(ident[0]+'-'+ident[1]).value = 0;\n this.notify(ident[0]+'-'+ident[1],0);\n };\n\n this.model.asmPos(); // necessary because model.reset() does not respect constraint r0 values\n this.notify('render');\n this.idle();\n }", "title": "" }, { "docid": "2d75db30991bd33976e5a10750ea4ee6", "score": "0.5303071", "text": "reset() {\n this.api.reset();\n }", "title": "" }, { "docid": "2d0abb6fa60e422617bc40f2d4cf3a64", "score": "0.52984697", "text": "reset() {\n this.interacted = false;\n if (this._completedOverride != null) {\n this._completedOverride = false;\n }\n if (this._customError != null) {\n this._customError = false;\n }\n if (this.stepControl) {\n this.stepControl.reset();\n }\n }", "title": "" }, { "docid": "2d0abb6fa60e422617bc40f2d4cf3a64", "score": "0.52984697", "text": "reset() {\n this.interacted = false;\n if (this._completedOverride != null) {\n this._completedOverride = false;\n }\n if (this._customError != null) {\n this._customError = false;\n }\n if (this.stepControl) {\n this.stepControl.reset();\n }\n }", "title": "" }, { "docid": "dc06a106fffcc910031138a45a9e1df5", "score": "0.5292798", "text": "function revertChanges() {\n return manager.rejectChanges();\n }", "title": "" }, { "docid": "1b239844d75bceab40ad605ab5670057", "score": "0.5292145", "text": "reset() {\n this.get('trending').clear();\n this.get('newest').clear();\n this.get('updated').clear();\n this.get('popular').clear();\n }", "title": "" }, { "docid": "44105c039aa69b33bc476764b8d1c21a", "score": "0.5291472", "text": "reset() {\n this.modelValue = this._initialModelValue;\n this.resetInteractionState();\n }", "title": "" }, { "docid": "cccb5012400fa504572086349a8afccd", "score": "0.52742946", "text": "reset(){\n this.selectedAnswer(null);\n this.answered = false;\n }", "title": "" }, { "docid": "1454d780b35063efe5fd124c8887164f", "score": "0.52673656", "text": "function reset(){}", "title": "" }, { "docid": "1609e1359878e61f1d0230b605244d9b", "score": "0.5259466", "text": "reset() {\r\n this.changeState(this.config.initial);\r\n this.redoStates = [];\r\n this.stateHistory = [];\r\n }", "title": "" }, { "docid": "425101ced92df19b5eb8742f8c39406b", "score": "0.525785", "text": "clear() {\n this.logging && console.log('clear', { ...this.data });\n this.data = { ...this.defaultData };\n this.save();\n }", "title": "" }, { "docid": "44d57fbfd1e8cd55a55116bf521ea5bf", "score": "0.52485543", "text": "function reset () {\n Object.keys(currentOptions).forEach( (option) => {\n currentOptions[option] = false;\n });\n return;\n }", "title": "" }, { "docid": "7410e070bd6d0ca34f44c659bd93e1ab", "score": "0.5247949", "text": "function resetAll() {\n\n\t\t\tvm.refData = {};\n\t\t\tvm.refData.refsKey = \"\";\n\t\t\tvm.refData.referenceTypeKey = \"\";\n\t\t\tvm.refData.referenceType = \"\";\n \t\tvm.refData.authors = \"\";\n \t\tvm.refData.title = \"\";\n \t\tvm.refData.journal = \"\";\n \t\tvm.refData.vol = \"\";\n \t\tvm.refData.issue = \"\";\n \t\tvm.refData.date = \"\";\n \t\tvm.refData.year = \"\";\n \t\tvm.refData.pgs = \"\";\n\n \t\tvm.refData.referenceAbstract = \"\";\n \t\tvm.refData.isReviewArticle = \"0\";\n\n addBook(vm.refData);\n addNote(vm.refData);\n\n\t\t\t// associations\n\t\t\tvm.refData.alleleAssocs = [];\n\t\t\tvm.refData.markerAssocs = [];\n\t\t\tvm.refData.strainAssocs = [];\n\n\t\t\tif (vm.activeTab == undefined) {\n\t\t\t\tvm.activeTab = 1;\n\t\t\t}\n\n\t\t\tvm.disableDelete = true;\n\n\t\t\t// reference summary table \n\t\t\tclearResultTable();\n\n\t\t\t// autocomplete\n\t\t\tvm.acTag = \"\"; \n\n\t\t\tvm.batchRefTag = {\n\t\t\t \t\"refsKeys\": [],\n\t\t\t \t\"workflowTag\": \"\"\n\t\t\t};\t\t\n\n\t\t}", "title": "" }, { "docid": "7902ff92fc24cdc5c69fa064f3150d22", "score": "0.52473795", "text": "clear() {\n // REFACTORED: Moved in (partially) from wfactory_controller.js:clearAll()\n // Resets WS Contents\n this.view.editorWorkspace.clear();\n this.saveStateFromWorkspace();\n // Resets WS Configs\n this.view.resetConfigs();\n this.updateOptions();\n\n this.updatePreview();\n }", "title": "" }, { "docid": "cfb5e1cc9851521298921753c70ec771", "score": "0.52447265", "text": "function reset() {\n userSupplierManager.reset();\n UserCache._clear();\n ScoreBooster.reset();\n }", "title": "" }, { "docid": "5e2979b6aeaf1697d8a8079955e0dc0e", "score": "0.5244375", "text": "reset() {\n this._timestamp = Date.now();\n this._value = 0;\n }", "title": "" }, { "docid": "4fd6a6e5c6ac4c5440cdefc5c9ef1b47", "score": "0.52443564", "text": "reset() {\n\t\tthis._findInputView.errorText = null;\n\t\tthis.isDirty = true;\n\t}", "title": "" }, { "docid": "5c6220207f6e49445d55afd08a71b44e", "score": "0.5228945", "text": "reset() {\n\t\t\tthis.questions.forEach(question => {\n\t\t\t\tquestion.answersList.forEach(answer => {\n\t\t\t\t\tanswer.correct = false;\n\t\t\t\t\tanswer.wrong = false;\n\t\t\t\t})\n\t\t\t\tquestion.selected = [];\n\t\t\t})\n\t\t}", "title": "" }, { "docid": "4ed06b801693983a0e6e180b30a723e0", "score": "0.5215845", "text": "resetsNothing() {return false}", "title": "" }, { "docid": "6edefe71346eeb137fed962579832a1d", "score": "0.52076215", "text": "clear() {\n this._unmarkAll();\n this._emitChangeEvent();\n }", "title": "" }, { "docid": "c2c0f537002a35c1e076f20aade64a12", "score": "0.5205277", "text": "_reset() {\n this.boundedTelemetry = [];\n this.futureBuffer = [];\n\n this.emit('clear');\n\n this._requestHistoricalTelemetry();\n }", "title": "" }, { "docid": "93cb1a259198d9fcf0132ec280e447d4", "score": "0.52013606", "text": "resetAll() {\n this.set(\"shipNationOwnerCount\", 0);\n this.set(\"captainCrewCount\", 0);\n this.set(\"activeSearchTerms\", [{ // required for all searches\n varName: YEAR_RANGE_VARNAME,\n op: 'is between',\n searchTerm: [SEARCH_MIN_YEAR, SEARCH_MAX_YEAR]\n }]);\n }", "title": "" }, { "docid": "e78315cb26373ee734f67c390cd91991", "score": "0.5201028", "text": "function reset() {}", "title": "" }, { "docid": "b8daaf476ca890f01058052680249a54", "score": "0.52006245", "text": "reset() {\n this.queue.clear();\n this.fileSet.clear();\n }", "title": "" }, { "docid": "6db2e52e50cfdbce199ede8393415497", "score": "0.51969296", "text": "reset(hard = false) {\n // When the completer detects a common subset prefix for all options,\n // it updates the model and sets the model source to that value, triggering\n // a reset. Unless explicitly a hard reset, this should be ignored.\n if (!hard && this._subsetMatch) {\n return;\n }\n this._subsetMatch = false;\n this._reset();\n this._stateChanged.emit(undefined);\n }", "title": "" }, { "docid": "b4f4bf2db4893477d5fa3cfd7176b7e6", "score": "0.51922816", "text": "reset() {\r\n this.changeState(this.config.initial);\r\n }", "title": "" }, { "docid": "b4f4bf2db4893477d5fa3cfd7176b7e6", "score": "0.51922816", "text": "reset() {\r\n this.changeState(this.config.initial);\r\n }", "title": "" }, { "docid": "b4f4bf2db4893477d5fa3cfd7176b7e6", "score": "0.51922816", "text": "reset() {\r\n this.changeState(this.config.initial);\r\n }", "title": "" }, { "docid": "8a8f427250a2e8edde0dbcce6299b22a", "score": "0.5185832", "text": "function reset() {\n console.log(loading)\n if (results) setResults(null)\n if (loading) {\n setLoading(false)\n controller.abort()\n }\n }", "title": "" }, { "docid": "580b50ec3c01db0393a4b0b12d376d65", "score": "0.5184774", "text": "rewind() {\n if (!this[kInitialized]) {\n return;\n }\n this[kId] = undefined;\n this[kDocuments] = [];\n this[kClosed] = false;\n this[kKilled] = false;\n this[kInitialized] = false;\n const session = this[kSession];\n if (session) {\n // We only want to end this session if we created it, and it hasn't ended yet\n if (session.explicit === false && !session.hasEnded) {\n session.endSession();\n }\n this[kSession] = undefined;\n }\n }", "title": "" }, { "docid": "a36d2e5851a7cda09465e68a9048e7d8", "score": "0.5183804", "text": "reset() {\n this.#delta = 0;\n this.#noncePromise = null;\n }", "title": "" }, { "docid": "c66290761ff53e5e86a6f13563c05abf", "score": "0.5179533", "text": "reset () {\n this.occurrences = Object.create(null);\n }", "title": "" }, { "docid": "be5eb2ea61177892206cf6c7a967134e", "score": "0.51785433", "text": "reset(){\n this.history.splice(1,this.history.length);\n this.updateStore();\n }", "title": "" }, { "docid": "cddbff99c4a66d2d72d0ff8ce69281fa", "score": "0.5176768", "text": "clear () {\n this.successful = false\n }", "title": "" }, { "docid": "8c17329ec10827493cb6bb05c9e9c3fa", "score": "0.51740754", "text": "function reset() {\n database.ref(\"app/\").set({\n total: 0,\n player1: {\n wins: 0,\n gesture: \"\",\n history: []\n },\n player2: {\n wins: 0,\n gesture: \"\",\n history: []\n },\n ties: 0\n });\n\n updateDisplay();\n calculateRecord();\n }", "title": "" }, { "docid": "2ddc42830b1b7b1f37e7ef8d94b03e3a", "score": "0.51701236", "text": "function resetPublishFilteredWords() \n{\n\tboolPublishFilteredWords = null;\n\tsetPublishFilteredWords();\n}", "title": "" }, { "docid": "e3201a212852f66ac66188c3bc3a61b0", "score": "0.5163245", "text": "function reset() {\n BaseAPI.reset.call(_self);\n\n // Data Model\n _self.cmi = new CMI(_self);\n _self.adl = new ADL(_self);\n }", "title": "" }, { "docid": "a444f46fa52060bdb869874073f5d4a2", "score": "0.5153223", "text": "rewind() {\n if (!this[kInitialized]) {\n return;\n }\n this[kId] = null;\n this[kDocuments].clear();\n this[kClosed] = false;\n this[kKilled] = false;\n this[kInitialized] = false;\n const session = this[kSession];\n if (session) {\n // We only want to end this session if we created it, and it hasn't ended yet\n if (session.explicit === false) {\n if (!session.hasEnded) {\n session.endSession().catch(() => null);\n }\n this[kSession] = this.client.startSession({ owner: this, explicit: false });\n }\n }\n }", "title": "" }, { "docid": "c030f6b24c4fa9ea084d0d01c04d9616", "score": "0.5152749", "text": "reset() {\r\n this.currentState= this.initialState;\r\n this.possibleTransitions=this.states[this.currentState].transitions;\r\n this.clearHistory();\r\n }", "title": "" }, { "docid": "d57a7373f5a24752b7bc5e93369bfb9a", "score": "0.51410174", "text": "function reset() {\n }", "title": "" }, { "docid": "8b2dd849b9fa68d02bb39307e5552efd", "score": "0.5140115", "text": "function resetWinner() {\n\t// called prior to new rounds\n\tdb.ref(\"current/winner\").set(\"\");\n}", "title": "" }, { "docid": "2761f5a908b7bbb583dd82abfb9ad95f", "score": "0.51303226", "text": "reset() {\n if (this.preserve === false) {\n for (let field in this.originalData) {\n this[field] = '';\n }\n }\n\n this.errors.clear();\n this.busy = false;\n this.successful = false;\n }", "title": "" }, { "docid": "759d9e8313deacf988c99d8982e0ae43", "score": "0.51260823", "text": "function reset() {\n frank_global.cateIndex = 0;\n frank_global.pagging = 0;\n frank_global.onSearch = false;\n frank_global.infiniteScrollLocker = false;\n}", "title": "" }, { "docid": "3097b89293ef6c5489887fb37fbc5191", "score": "0.5123371", "text": "function reset() {\n started = false;\n count = 0;\n return;\n}", "title": "" }, { "docid": "eb17eb503ebfb6fc017682d0ceb025e6", "score": "0.5122958", "text": "reset() {\n this._currentCompletions = null;\n this._completionIndex = 0;\n this.currentStub = \"\";\n return this.hasStarted = false;\n }", "title": "" }, { "docid": "2546e25767ee0b132deaa2921b301b43", "score": "0.51216245", "text": "detachDoc() {\n\t\tvar doc = this.doc;\n\t\tif (!doc) {\n\t\t\treturn;\n\t\t}\n\t\tdoc.cm.version = doc.version;\n\t\tvar codeMirror = this.codeMirror;\n\t\tcodeMirror.off('beforeChange', this.codeMirrorBeforeChange);\n\t\tcodeMirror.off('changes', this.codeMirrorChanges);\n\t\tdoc.removeListener('op', this.shareDBOp);\n\t\tdoc.removeListener('del', this.shareDBDel);\n\t\tdoc.removeListener('error', this.shareDBError);\n\t\tdelete this.doc;\n\t\tthis.log('ShareDBCodeMirror: unsubscribed from doc');\n\t}", "title": "" }, { "docid": "1da78f241c016342a794d92953252551", "score": "0.5120731", "text": "function reset() {\n history = [];\n cursor = 0;\n }", "title": "" }, { "docid": "69e3ca7b0076a4d9ebeee3a7b8b40862", "score": "0.511856", "text": "reset() {\n this.model.position.set(0, 0, 0);\n this.model.rotation.set(0, 0, 0);\n this.boundingBox.position.set(0, 0, 0);\n this.boundingBox.rotation.set(0, 0, 0);\n this.velocity = 0;\n this.angle = 0;\n }", "title": "" }, { "docid": "be875110f402dc4342d4011d3ebd5543", "score": "0.5116864", "text": "function reset() {\n RelatedUsersSupplier.reset();\n ServerUsersSupplier.reset();\n RecentUsersSupplier._clear();\n }", "title": "" }, { "docid": "1d7357610d1b6a5d6ffe0e70da8dff66", "score": "0.5104992", "text": "function resetAll() {\n $scope.selectedAllDeAlloc = false;\n }", "title": "" }, { "docid": "cfb78467acbd2af2d76bea24c713bd92", "score": "0.51029813", "text": "function reset() {\n started = false; count = 0;\n return;\n}", "title": "" }, { "docid": "83517e24424bf721507527e3b21d0862", "score": "0.5098745", "text": "reset() {\n this.queryPlanPromise = undefined;\n this.queryExecutionContext = new DefaultQueryExecutionContext(this.options, this.fetchFunctions);\n }", "title": "" }, { "docid": "5f500592b0d068f3a7c993b1defdbedc", "score": "0.5092165", "text": "function reset() {\n var filePath = ProjectManager.getFilename();\n ProjectManager.save(filePath);\n SelectionManager.deselectAll();\n DiagramManager.repaint();\n ModelExplorerView.rebuild();\n var project = ProjectManager.getProject();\n ModelExplorerView.expand(project);\n ModelExplorerView.expand(project.ownedElements[0]);\n }", "title": "" }, { "docid": "3bd939a12637bd5cb495229e804f7ec2", "score": "0.5090124", "text": "function _resetState() {\n eventManager.clearEvents();\n pressedKeys.clear();\n refCount = 0;\n}", "title": "" }, { "docid": "3bd939a12637bd5cb495229e804f7ec2", "score": "0.5090124", "text": "function _resetState() {\n eventManager.clearEvents();\n pressedKeys.clear();\n refCount = 0;\n}", "title": "" }, { "docid": "3bd939a12637bd5cb495229e804f7ec2", "score": "0.5090124", "text": "function _resetState() {\n eventManager.clearEvents();\n pressedKeys.clear();\n refCount = 0;\n}", "title": "" }, { "docid": "663d9af7e5f504f1c21c5d0b4240e7ab", "score": "0.50894487", "text": "function _reset() {\n var worksheet = _model.resetWorksheet(_type);\n if (worksheet) {\n _inputsGroupDOM.innerHTML = '';\n // TODO: destroy all the inputs\n _inputsList = {};\n _generateInputs(worksheet);\n }\n }", "title": "" }, { "docid": "5ace95f1e9cb0ebbb2c0a0bea8da8f9b", "score": "0.50893503", "text": "function reset() {\n getService_().reset();\n}", "title": "" }, { "docid": "5ace95f1e9cb0ebbb2c0a0bea8da8f9b", "score": "0.50893503", "text": "function reset() {\n getService_().reset();\n}", "title": "" }, { "docid": "5ace95f1e9cb0ebbb2c0a0bea8da8f9b", "score": "0.50893503", "text": "function reset() {\n getService_().reset();\n}", "title": "" }, { "docid": "5ace95f1e9cb0ebbb2c0a0bea8da8f9b", "score": "0.50893503", "text": "function reset() {\n getService_().reset();\n}", "title": "" }, { "docid": "d7c1d7eb38ef7c0d2ccc62f6fb104269", "score": "0.5087719", "text": "function resetDirty(resetUndo/*:Boolean = false*/)/*:void*/ {if(arguments.length<=0)resetUndo=false;\n if(this.ckEditor) {\n this.ckEditor.resetDirty();\n resetUndo && this.ckEditor['resetUndo'] && this.ckEditor.resetUndo();\n }\n\n this.dirty$vqVB = false;\n }", "title": "" } ]
c490aca96092eacaea06dd2d63cfa725
Add a `or where` clause
[ { "docid": "fa641c3e64a0d11fb50e9574e50d0018", "score": "0.6548493", "text": "orWhere(key, operator, value) {\n const whereClauses = this.getRecentStackItem();\n if (value !== undefined) {\n whereClauses.push({\n method: 'orWhere',\n args: [this.resolveKey(key), operator, this.transformValue(value)],\n });\n }\n else if (operator !== undefined) {\n whereClauses.push({\n method: 'orWhere',\n args: [this.resolveKey(key), this.transformValue(operator)],\n });\n }\n else {\n this.validateWhereSingleArgument(key, 'orWhere');\n whereClauses.push({\n method: 'orWhere',\n args: [this.resolveKey(key, true, this.transformCallback(key))],\n });\n }\n return this;\n }", "title": "" } ]
[ { "docid": "ac89156d9a9b64e94d901d4d0f379f5f", "score": "0.74041915", "text": "orWhere(field, value) {\n // Cancel id filter usage, since \"or\" needs full scan.\n this.cancelIdFilter = true;\n this.wheres.push({ field, value, boolean: 'or' });\n return this;\n }", "title": "" }, { "docid": "dd7d17d626f3dd1b13632ed7c949e566", "score": "0.68937707", "text": "static addWhere (cond) {\n if (cond) {\n cond = DB.normalize(cond)\n if (cond) {\n return ` where ${cond} `\n }\n }\n return cond\n }", "title": "" }, { "docid": "2a9028b4b7c2c5bd01efd8b76b7d16f2", "score": "0.687937", "text": "or(filters, { foreignTable } = {}) {\n const key = typeof foreignTable === 'undefined' ? 'or' : `${foreignTable}.or`;\n this.url.searchParams.append(key, `(${filters})`);\n return this;\n }", "title": "" }, { "docid": "1accd1432ca5da971d5ae06d45749408", "score": "0.67563444", "text": "orWhereExists(value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereExists',\n args: [this.transformValue(value)],\n });\n return this;\n }", "title": "" }, { "docid": "49acf84869f9c11f639c931834118118", "score": "0.6545588", "text": "orWhereNotNull(key) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereNotNull',\n args: [this.resolveKey(key)],\n });\n return this;\n }", "title": "" }, { "docid": "e8179af767b8f1a641f413036c8bc394", "score": "0.651941", "text": "orWhereRaw(sql, bindings) {\n const whereClauses = this.getRecentStackItem();\n if (bindings) {\n bindings = Array.isArray(bindings)\n ? bindings.map((binding) => this.transformValue(binding))\n : bindings;\n whereClauses.push({\n method: 'orWhereRaw',\n args: [sql, bindings],\n });\n }\n else {\n whereClauses.push({\n method: 'orWhereRaw',\n args: [this.transformRaw(sql)],\n });\n }\n return this;\n }", "title": "" }, { "docid": "d64f5246c75a6554dcb9e0551379fa0e", "score": "0.6507025", "text": "orWhereNotExists(value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereNotExists',\n args: [this.transformValue(value)],\n });\n return this;\n }", "title": "" }, { "docid": "a05f9274aad68f0b5230096e7752b46a", "score": "0.6402414", "text": "orWhereNot(key, operator, value) {\n const whereClauses = this.getRecentStackItem();\n if (value !== undefined) {\n whereClauses.push({\n method: 'orWhereNot',\n args: [this.resolveKey(key), operator, this.transformValue(value)],\n });\n }\n else if (operator !== undefined) {\n whereClauses.push({\n method: 'orWhereNot',\n args: [this.resolveKey(key), this.transformValue(operator)],\n });\n }\n else {\n this.validateWhereSingleArgument(key, 'orWhereNot');\n whereClauses.push({\n method: 'orWhereNot',\n args: [this.resolveKey(key, true, this.transformCallback(key))],\n });\n }\n return this;\n }", "title": "" }, { "docid": "a5b310575c00f6d4a06da661c6216440", "score": "0.6397346", "text": "orWhereNull(key) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereNull',\n args: [this.resolveKey(key)],\n });\n return this;\n }", "title": "" }, { "docid": "43dec65ab95f621a54152ac8fe6338b1", "score": "0.6380968", "text": "findWhere(where){\n // add or manipulate the where clause\n }", "title": "" }, { "docid": "021f87624fdbe45d3e8911d8f36b0a7c", "score": "0.62886584", "text": "findWhere(where, opts){\n // add or manipulate the where clause\n }", "title": "" }, { "docid": "16cec202e8052f2852c67b6a23100c5b", "score": "0.62413967", "text": "function or(args) {\n\t\t\t\tunion = args.map(function (arg) {\n\t\t\t\t\tfilterQuery = {};\n\t\t\t\t\tprocessFilter([arg]);\n\t\t\t\t\treturn filterQuery;\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "1769f6013b9181459ddd01822ec75477", "score": "0.6175083", "text": "function or(...args) {\n return args.reduce(orCode);\n }", "title": "" }, { "docid": "94e636505f76dd150d6a9b8ef399b7c2", "score": "0.6129626", "text": "function flattenOrQueries(where) {\n if (!Object.prototype.hasOwnProperty.call(where, '$or')) {\n return where;\n }\n var accum = [];\n for (var i = 0; i < where.$or.length; i++) {\n accum = accum.concat(where.$or[i]);\n }\n return accum;\n}", "title": "" }, { "docid": "ceacccd191a02e905f8b0e9418494839", "score": "0.6077927", "text": "function or(...args) {\n return combine(args, (args) => {\n for (var i = 0, l = args.length; i < l; i++) {\n if (args[i])\n return true;\n }\n return false;\n });\n }", "title": "" }, { "docid": "7f330cf00a565b9f551095920abc3faf", "score": "0.5911837", "text": "function or(...args) {\n\t return args.reduce(orCode);\n\t}", "title": "" }, { "docid": "df59479597f51473a5f1c2e00ab56a08", "score": "0.58828306", "text": "function op_or(x,y){return x|y}", "title": "" }, { "docid": "da2b3cb1a35332ec196981f96054ec80", "score": "0.57939315", "text": "function or() {\n var filter = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n filter[_i] = arguments[_i];\n }\n return function (word, wordToMatchAgainst) {\n for (var i = 0, len = filter.length; i < len; i++) {\n var match = filter[i](word, wordToMatchAgainst);\n if (match) {\n return match;\n }\n }\n return null;\n };\n}", "title": "" }, { "docid": "8ab467f7e0ab6937d2a435476ab09632", "score": "0.5788309", "text": "static toWhereOrSqlList(Model, whereOr, list, sqlParams) {\n whereOr.forEach(function(orObj) {\n Object.keys(orObj).forEach(function(key, i) {\n if (Array.isArray(orObj[key])) {\n sqlParams.push(orObj[key]);\n list.push(Model.table + '.' + key + ' IN ( ? ) ');\n } else {\n sqlParams.push(orObj[key]);\n\n if (orObj[key] === null) {\n list.push(Model.table + '.' + key + ' IS ? ');\n } else {\n list.push(Model.table + '.' + key + ' = ? ');\n }\n }\n });\n });\n }", "title": "" }, { "docid": "103f342e35e0b9800af8462a36740082", "score": "0.57830644", "text": "function or( a, b ) {\n return no( a )? b: a;\n }", "title": "" }, { "docid": "29bc279137b7692a9aa141aa22747647", "score": "0.57771015", "text": "function orOp(a, b){\r\n return (a === true) ? true :\r\n (a === false) ? b : error(or);\r\n}", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "02bcbd4c547cee10989200aaded61cad", "score": "0.57665366", "text": "function op_or(x,y) { return x|y; }", "title": "" }, { "docid": "9e17069705c73c1173988c936023877a", "score": "0.5739051", "text": "filter() {\n //This forces filter function to do its job :-)\n this.where = \"\";\n }", "title": "" }, { "docid": "ac3160c8976ea98b10edf95082b399d8", "score": "0.5719736", "text": "function orExpr(stream, a) {\n (stream.peeked || \"\") + stream.str;\n var r = binaryL(andExpr, stream, a, \"or\");\n (stream.peeked || \"\") + stream.str;\n return r;\n }", "title": "" }, { "docid": "86a4f4e08fbf6a17a8db941383d078f2", "score": "0.5713405", "text": "function op_or(x, y) {\n return x | y;\n }", "title": "" }, { "docid": "86a4f4e08fbf6a17a8db941383d078f2", "score": "0.5713405", "text": "function op_or(x, y) {\n return x | y;\n }", "title": "" }, { "docid": "c926eed46c11caac961ec9c475cf1b95", "score": "0.57108957", "text": "orWhereIn(columns, value) {\n value = Array.isArray(value)\n ? value.map((one) => this.transformValue(one))\n : this.transformValue(value);\n columns = Array.isArray(columns)\n ? columns.map((column) => this.resolveKey(column))\n : this.resolveKey(columns);\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereIn',\n args: [columns, value],\n });\n return this;\n }", "title": "" }, { "docid": "a471932ce41fde7e87893ad92c72eafd", "score": "0.57098246", "text": "getWhereConditions(smth, tableName, factory, options, prepend) {\n const where = {};\n\n if (Array.isArray(tableName)) {\n tableName = tableName[0];\n if (Array.isArray(tableName)) {\n tableName = tableName[1];\n }\n }\n\n options = options || {};\n\n if (prepend === undefined) {\n prepend = true;\n }\n\n if (smth && smth instanceof Utils.SequelizeMethod) { // Checking a property is cheaper than a lot of instanceof calls\n return this.handleSequelizeMethod(smth, tableName, factory, options, prepend);\n }\n if (_.isPlainObject(smth)) {\n return this.whereItemsQuery(smth, {\n model: factory,\n prefix: prepend && tableName,\n type: options.type\n });\n }\n if (typeof smth === 'number') {\n let primaryKeys = factory ? Object.keys(factory.primaryKeys) : [];\n\n if (primaryKeys.length > 0) {\n // Since we're just a number, assume only the first key\n primaryKeys = primaryKeys[0];\n } else {\n primaryKeys = 'id';\n }\n\n where[primaryKeys] = smth;\n\n return this.whereItemsQuery(where, {\n model: factory,\n prefix: prepend && tableName\n });\n }\n if (typeof smth === 'string') {\n return this.whereItemsQuery(smth, {\n model: factory,\n prefix: prepend && tableName\n });\n }\n if (Buffer.isBuffer(smth)) {\n return this.escape(smth);\n }\n if (Array.isArray(smth)) {\n if (smth.length === 0 || smth.length > 0 && smth[0].length === 0) return '1=1';\n if (Utils.canTreatArrayAsAnd(smth)) {\n const _smth = { [Op.and]: smth };\n return this.getWhereConditions(_smth, tableName, factory, options, prepend);\n }\n throw new Error('Support for literal replacements in the `where` object has been removed.');\n }\n if (smth === null) {\n return this.whereItemsQuery(smth, {\n model: factory,\n prefix: prepend && tableName\n });\n }\n\n return '1=1';\n }", "title": "" }, { "docid": "ecfcebaeb0af6f4ea275a7b5c7880027", "score": "0.57081234", "text": "function op_or(x, y) {\n\t return x | y\n\t}", "title": "" }, { "docid": "5bccdefc2372ecc559235df3f469c16f", "score": "0.5682193", "text": "orWhereNotIn(columns, value) {\n value = Array.isArray(value)\n ? value.map((one) => this.transformValue(one))\n : this.transformValue(value);\n columns = Array.isArray(columns)\n ? columns.map((column) => this.resolveKey(column))\n : this.resolveKey(columns);\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereNotIn',\n args: [columns, value],\n });\n return this;\n }", "title": "" }, { "docid": "be68d4b99efb8604240863733845c305", "score": "0.56745946", "text": "function op_or(x, y)\n {\n return x | y;\n }", "title": "" }, { "docid": "be68d4b99efb8604240863733845c305", "score": "0.56745946", "text": "function op_or(x, y)\n {\n return x | y;\n }", "title": "" }, { "docid": "be68d4b99efb8604240863733845c305", "score": "0.56745946", "text": "function op_or(x, y)\n {\n return x | y;\n }", "title": "" }, { "docid": "467001f9ab8f5285533da88f8db3a810", "score": "0.5672244", "text": "function op_or(x, y) {\n return x | y;\n }", "title": "" }, { "docid": "75d6c3251b2d5d481365f9a71aec625a", "score": "0.56544626", "text": "function op_or(x, y) { return x | y; }", "title": "" }, { "docid": "75d6c3251b2d5d481365f9a71aec625a", "score": "0.56544626", "text": "function op_or(x, y) { return x | y; }", "title": "" }, { "docid": "4c835a68ccc3399dcfdd841215c10370", "score": "0.5641561", "text": "async function getUserUsingOR(){\n const users = await User\n .find()\n .or([{username: 'dev-salman'}, {age: {$gt: 15 }} ]) // or operator with array contains filter as a objects\n .limit(1)\n .sort({ username: 1 })\n .select({username: 1, isverified: 1});\n console.log('Get query based response', users);\n}", "title": "" }, { "docid": "ce34bf87bb6f8d26adedeee91903c056", "score": "0.5640267", "text": "function op_or(x, y) {\n return x | y\n}", "title": "" }, { "docid": "ce34bf87bb6f8d26adedeee91903c056", "score": "0.5640267", "text": "function op_or(x, y) {\n return x | y\n}", "title": "" }, { "docid": "ce34bf87bb6f8d26adedeee91903c056", "score": "0.5640267", "text": "function op_or(x, y) {\n return x | y\n}", "title": "" }, { "docid": "ce34bf87bb6f8d26adedeee91903c056", "score": "0.5640267", "text": "function op_or(x, y) {\n return x | y\n}", "title": "" }, { "docid": "ce34bf87bb6f8d26adedeee91903c056", "score": "0.5640267", "text": "function op_or(x, y) {\n return x | y\n}", "title": "" }, { "docid": "ce34bf87bb6f8d26adedeee91903c056", "score": "0.5640267", "text": "function op_or(x, y) {\n return x | y\n}", "title": "" }, { "docid": "ce34bf87bb6f8d26adedeee91903c056", "score": "0.5640267", "text": "function op_or(x, y) {\n return x | y\n}", "title": "" }, { "docid": "ce34bf87bb6f8d26adedeee91903c056", "score": "0.5640267", "text": "function op_or(x, y) {\n return x | y\n}", "title": "" }, { "docid": "ce34bf87bb6f8d26adedeee91903c056", "score": "0.5640267", "text": "function op_or(x, y) {\n return x | y\n}", "title": "" }, { "docid": "ce34bf87bb6f8d26adedeee91903c056", "score": "0.5640267", "text": "function op_or(x, y) {\n return x | y\n}", "title": "" }, { "docid": "ce34bf87bb6f8d26adedeee91903c056", "score": "0.5640267", "text": "function op_or(x, y) {\n return x | y\n}", "title": "" }, { "docid": "ce34bf87bb6f8d26adedeee91903c056", "score": "0.5640267", "text": "function op_or(x, y) {\n return x | y\n}", "title": "" }, { "docid": "ce34bf87bb6f8d26adedeee91903c056", "score": "0.5640267", "text": "function op_or(x, y) {\n return x | y\n}", "title": "" }, { "docid": "9294420a4fbcc820ad1af8f7ac1d4bc7", "score": "0.563498", "text": "or () {\n const op = { op: 'or', match: [] }\n this.currentMatch.push(op)\n\n // push 'or' onto and or elem stack\n this.andOrElemStack.push('or')\n\n // push old match list onto match stack & set new ops match as current\n this.matchStack.push(this.currentMatch)\n this.currentMatch = op.match\n\n return this // enable chaining\n }", "title": "" }, { "docid": "94d08d29b7bf17c88352595f072bb7a0", "score": "0.5633571", "text": "orWhereColumn(column, operator, comparisonColumn) {\n if (comparisonColumn !== undefined) {\n this.orWhere(column, operator, new Reference_1.ReferenceBuilder(comparisonColumn, this.knexQuery.client));\n }\n else {\n this.orWhere(column, new Reference_1.ReferenceBuilder(operator, this.knexQuery.client));\n }\n return this;\n }", "title": "" }, { "docid": "7cab04f292adf89c7d5ebcdb86c6f089", "score": "0.5618311", "text": "function orExpr(stream, a) {\n var orig = (stream.peeked || '') + stream.str\n var r = binaryL(andExpr, stream, a, 'or');\n var now = (stream.peeked || '') + stream.str;\n return r;\n }", "title": "" }, { "docid": "7cab04f292adf89c7d5ebcdb86c6f089", "score": "0.5618311", "text": "function orExpr(stream, a) {\n var orig = (stream.peeked || '') + stream.str\n var r = binaryL(andExpr, stream, a, 'or');\n var now = (stream.peeked || '') + stream.str;\n return r;\n }", "title": "" }, { "docid": "c1e9626f2fab4baf2dff47949910c341", "score": "0.5602589", "text": "function op_or(x, y) {\n\t return x | y;\n\t}", "title": "" }, { "docid": "4a55028f9f0f43ecad00b58b66322491", "score": "0.5590802", "text": "function eatLogicalOrExpression() {\n var expr = eatLogicalAndExpression();\n while (peekIdentifierToken('or') || peekTokenOne(_TokenKind.TokenKind.SYMBOLIC_OR)) {\n var token = nextToken(); //consume OR\n var rhExpr = eatLogicalAndExpression();\n checkOperands(token, expr, rhExpr);\n expr = _OpOr.OpOr.create(toPosToken(token), expr, rhExpr);\n }\n return expr;\n }", "title": "" }, { "docid": "6222f0e6be5eb641f795e166b2948fce", "score": "0.5550428", "text": "function op_or(x, y) {\n return x | y;\n}", "title": "" }, { "docid": "6222f0e6be5eb641f795e166b2948fce", "score": "0.5550428", "text": "function op_or(x, y) {\n return x | y;\n}", "title": "" } ]
717b5a9a57ebcaffe54a4d7edb3d93d8
tail :: [a] > [a] drop head element
[ { "docid": "aac4191327c6921895bddfb69e11697c", "score": "0.8274212", "text": "function tail(a) {\n return drop(1, a);\n }", "title": "" } ]
[ { "docid": "03cfccc696a0a58878065f37935ae10a", "score": "0.8322308", "text": "function tail(a) {\n\t return drop(1, a);\n\t }", "title": "" }, { "docid": "f9217219b3b5f5075636da7cc36711a6", "score": "0.8316875", "text": "function tail(a) {\n return drop(1, a);\n}", "title": "" }, { "docid": "26b2c8bdb7f08ba2a3c8e77916b89e75", "score": "0.82636917", "text": "function tail (a) {\n return drop(1, a)\n }", "title": "" }, { "docid": "adc72764bee6bf24d8f208b2f28d4438", "score": "0.7221805", "text": "function tail(xs) {\n if (xs === Nil) return [];\n else return xs[1];\n}", "title": "" }, { "docid": "81777cd346179d2f5cc9f2b7331d7492", "score": "0.71824616", "text": "pop(){\n if(!this.head) {\n return undefined;\n }\n var removed = this.tail;\n if(this.length === 1) {\n this.head = null;\n this.tail = null;\n } else {\n this.tail = removed.prev;\n this.tail.next = null;\n removed.prev = null;\n }\n this.length--;\n return removed;\n}", "title": "" }, { "docid": "6ec9eba2258df19bde20708be70f8400", "score": "0.7172963", "text": "pop(){\n if(this.length === 0) return undefined;\n const oldTail = this.tail;\n if(this.length === 1){\n this.head = null;\n this.tail = null;\n }else{\n this.tail = oldTail.previous;\n this.tail.next = null;\n oldTail.previous = null;\n }\n this.length--;\n return oldTail;\n }", "title": "" }, { "docid": "22ee43d84ca799ad08aeaef395b3752e", "score": "0.7147455", "text": "removeTail() {\n // Only single node or empty node.\n if (this.head === this.tail) {\n const node = this.tail;\n this.tail = null;\n this.head = null;\n return node;\n }\n\n // More than one node.\n let current = this.head;\n while (current.next !== this.tail) {\n current = current.next;\n }\n const node = this.tail;\n this.tail = current;\n this.tail.next = null; // Removing reference.\n return node;\n }", "title": "" }, { "docid": "a7c6e59930d6a29ec4cedabfb9546d8a", "score": "0.7039433", "text": "function head (lista){\n \treturn lista.splice(0,lista.length-1); \n}", "title": "" }, { "docid": "0fe27105935910be7914ff8502fb05e5", "score": "0.69898486", "text": "pop(){\n if(!this.head){\n return undefined;\n }\n let current = this.head;\n let newTail = current\n while(current.next){\n newTail = current;\n current = current.next;\n }\n this.tail = newTail;\n this.tail.next = null;\n this.length--;\n if(this.length === 0){\n this.head = null;\n this.tail = null;\n }\n return current;\n }", "title": "" }, { "docid": "2ba99602594a441ee4eee76db17b3cb7", "score": "0.69880176", "text": "removeLast() {\n if (this.tail) {\n let tmp = this.tail;\n this.tail = tmp.prev;\n this.tail.next = null;\n this.size--;\n return tmp;\n }\n throw new Error('No tail node');\n }", "title": "" }, { "docid": "553671882521364a7cb8ad918bab73ec", "score": "0.6979619", "text": "removeTail()\n {\n return this.removeIndex(this.#length - 1);\n }", "title": "" }, { "docid": "59729bb390eedda6ad6b9bdcfa13178a", "score": "0.6966835", "text": "pop() {\n if(!this.head) return undefined;\n var oldTail = this.tail;\n if(this.length === 1) {\n this.head = null;\n this.tail = null;\n } else {\n this.tail = oldTail.prev;\n this.tail.next = null;\n oldTail.prev = null;\n }\n this.length--;\n return oldTail;\n }", "title": "" }, { "docid": "28f02c03e4392b015fbf6b35a05cb6b4", "score": "0.69531494", "text": "pop(){\r\n if(!this.head) return null;\r\n\r\n let curHead = this.head;\r\n let curTail = curHead;\r\n while(curHead.next){\r\n curTail = curHead;\r\n curHead = curHead.next;\r\n }\r\n curTail.next = null;\r\n this.tail = curTail;\r\n this.length--;\r\n if(this.length === 0) {\r\n this.head = null;\r\n this.tail = null;\r\n }\r\n return curHead;\r\n\r\n }", "title": "" }, { "docid": "9e064b93142cf15a4cb297d03e875e08", "score": "0.6917142", "text": "pop() {\n if (!this.head) return undefined;\n let current = this.head;\n let newTail = current;\n while (current.next) {\n newTail = current;\n current = current.next;\n }\n this.tail = newTail;\n this.tail.next = null;\n this.length--;\n if (this.length === 0) {\n this.tail = null;\n this.head = null;\n }\n return current;\n }", "title": "" }, { "docid": "b2da155521519f5f3957ad402700f3b8", "score": "0.6888877", "text": "pop() {\n if (!this.head) {\n return undefined;\n }\n let current = this.head;\n let newTail = current;\n while (current.next) {\n newTail = current;\n current = current.next;\n }\n this.tail = newTail;\n this.tail.next = null;\n this.length--;\n if (this.length === 0) {\n this.head = null;\n this.tail = null;\n }\n return current;\n }", "title": "" }, { "docid": "769e23fa3daa7f899f7735837d779e10", "score": "0.6887952", "text": "pop() {\n if (!this.head) return undefined;\n let current = this.head;\n let newTail = current;\n\n while (current.next) {\n newTail = current;\n current = current.next;\n }\n this.tail = newTail;\n this.tail.next = null;\n this.length--;\n if (this.length === 0) {\n this.head = null;\n this.tail = null;\n }\n return current;\n }", "title": "" }, { "docid": "9db8389b859df6db56391883dd06ac5f", "score": "0.68867457", "text": "removeTail() {\n let currentNode = this.head\n while (currentNode.next !== this.tail) {\n currentNode = currentNode.next\n }\n currentNode.next = null\n this.tail = currentNode\n }", "title": "" }, { "docid": "5a2b2028a986acf995c2f2a2aaa280a6", "score": "0.68848544", "text": "removeLast() {\n\t\tthis.remove(this.tail);\n\t}", "title": "" }, { "docid": "785238f48260d0ef1b0792b6a317a9e9", "score": "0.68639296", "text": "pop() {\n if (!this.head)\n return undefined;\n let current = this.head;\n let newTail = current;\n while (current.next) {\n newTail = current;\n current = current.next;\n }\n this.tail = newTail;\n this.tail.next = null;\n this.length--;\n if (this.length === 0) {\n this.head = null\n this.tail = null\n }\n return current;\n }", "title": "" }, { "docid": "4157c5a0778b82eef200e437efdf311e", "score": "0.6858654", "text": "pop(){\n if(!this.head)return undefined;\n\n let current = this.head;\n let newTail = current;\n\n while(current.next){\n newTail = current;\n current = current.next;\n }\n \n this.tail = newTail;\n this.tail.next = null;\n this.length--;\n\n if(this.length === 0){\n this.head = null;\n this.tail = null;\n }\n\n return current;\n }", "title": "" }, { "docid": "ec17412d8046ebffb7827e2ac12ecc50", "score": "0.68155086", "text": "pop() {\n if(!this.tail){\n throw new Error(\"List empty\"); \n }\n \n const val = this.tail.val; \n if(this.head === this.tail){\n this.head = null; \n this.tail = null; \n }\n else{\n let node = this.head; \n while(this.tail != node.next){\n node = node.next; \n }\n this.tail = node;\n this.tail.next = null; \n }\n\n this.length -= 1; \n return val; \n }", "title": "" }, { "docid": "97d028cce64c7a5a67259772eb10f425", "score": "0.68104476", "text": "pop() {\n if (this.head === null) {\n return undefined;\n }\n let current = this.head;\n let newTail = current;\n while(current.next) {\n newTail = current;\n current = current.next;\n }\n this.tail = newTail;\n this.tail.next = null;\n this.length--;\n if (this.length === 0) {\n this.head = this.tail = null\n }\n return current;\n \n }", "title": "" }, { "docid": "c7f7e489f42ab6c200de064660e6e13c", "score": "0.68055445", "text": "shift(){\n if(!this.head) {\n return undefined;\n }\n var removedHead = this.head;\n if(this.length === 1){\n this.head = null;\n this.tail = null;\n } else {\n this.head = removedHead.next;\n this.head.prev = null;\n removedHead.next = null;\n }\n this.length--;\n return removedHead;\n}", "title": "" }, { "docid": "b257aaf090aae6362687ae17de3d65dd", "score": "0.6797294", "text": "pop() {\n if (!this.head) {\n return undefined\n }\n let current = this.head;\n let newTail = current;\n while(current.next) {\n newTail = current;\n current = current.next\n } \n this.tail = newTail\n this.tail.next = null;\n this.length--;\n if (this.length === 0) {\n this.head = null;\n this.tail = null;\n }\n return current;\n }", "title": "" }, { "docid": "15de5c1ca69e190c65b786e266681c03", "score": "0.67909056", "text": "pop(){\n if(!first) return null\n let removed = this.first\n if(this.first === this.last) {\n this.last = null\n }\n this.first = this.first.next\n this.size--\n return removed.value\n }", "title": "" }, { "docid": "fe378ad86053185c0be583c879a59576", "score": "0.67849106", "text": "removeBack() {\n\n if (this.head == null && this.tail == null) {\n return undefined;\n }\n\n else if (this.head == this.tail) {\n var temp = this.head;\n this.head = null;\n this.tail = null;\n return temp.value;\n }\n\n else if (this.head.next == this.tail) {\n var temp = this.tail;\n this.head.next = null;\n this.tail = this.head;\n return temp.value;\n }\n\n else {\n var runner = this.head\n while (runner.next.next != null) { // while( runner.next != this.tail)\n runner = runner.next;\n var temp = runner\n }\n var x = temp.next\n this.tail = temp\n this.tail.next = null\n return x.value\n }\n }", "title": "" }, { "docid": "d0098f612f721edbda3e9081226643fa", "score": "0.67532206", "text": "pop() {\n // If there is nothing on the list, return undefined\n if (!this.head) return undefined;\n // Loop through to find the last item\n var current = this.head;\n var newTail = current;\n while(current.next) {\n newTail = current;\n current = current.next\n }\n // Set the found tail to tail\n this.tail = newTail;\n // The next one will be null since we \n // would like to remove it\n this.tail.next = null;\n // Decrease the length\n this.length--;\n // If there is nothing left after removing\n // set the head and tail to be null\n if(this.length === 0) {\n this.head = null;\n this.tail = null;\n }\n return current;\n }", "title": "" }, { "docid": "7f1b009145370a8a3c46003776169075", "score": "0.6749984", "text": "function tail(array) {\n return array.slice(1);\n}", "title": "" }, { "docid": "b03da2fe30f2a0b7e67c929fa59bba6b", "score": "0.6699044", "text": "pop() {\n\t\tif (this.length === 0) return undefined;\n\t\tconst removed = this.tail;\n\t\tif (this.length === 1) {\n\t\t\tthis.head = null;\n\t\t\tthis.tail = null;\n\t\t} else {\n\t\t\tthis.tail = this.tail.prev;\n\t\t\tthis.tail.next = null;\n\t\t\tremoved.prev = null;\n\t\t}\n\t\tthis.length--;\n\t\treturn removed;\n\t}", "title": "" }, { "docid": "6c564a6f5d409305bf6e8d12eff4d638", "score": "0.6690068", "text": "remove() {\r\n this.tail = this.tail.prev;\r\n this.tail.prev = null;\r\n this.length--;\r\n }", "title": "" }, { "docid": "e081ecef8d2b996ef1a248a8da23eaaa", "score": "0.66795623", "text": "pop() {\n if (!this.head) return undefined;\n let current = this.head;\n let newTail = current;\n while (current.next) {\n newTail = current;\n current = current.next;\n }\n this.tail = newTail;\n this.tail.next = null;\n this.length--;\n if (this.length === 0) {\n this.head = null;\n this.tail = null;\n }\n return this;\n }", "title": "" }, { "docid": "ebd6b4358ffba9990dc5e4b02baa6579", "score": "0.6661148", "text": "shift() {\n if (!this.head) return undefined\n let removed = this.head\n if (this.head === 1) {\n this.head = null\n this.tail = null\n } else {\n this.head = removed.next\n this.head.prev = null\n removed.next = null\n }\n this.length--\n return removed\n }", "title": "" }, { "docid": "bada9d3f37cbaa100cbfd73348e42d50", "score": "0.6641609", "text": "shift() {\n\t\tif (this.length === 0) return undefined;\n\t\tconst removed = this.head;\n\t\tif (this.length === 1) {\n\t\t\tthis.head = null;\n\t\t\tthis.tail = null;\n\t\t} else {\n\t\t\tthis.head = this.head.next;\n\t\t\tthis.head.prev = null;\n\t\t\tremoved.next = null;\n\t\t}\n\t\tthis.length--;\n\t\treturn removed;\n\t}", "title": "" }, { "docid": "e8e62fcc2edddec120c9b17aff10a338", "score": "0.66410667", "text": "pop() {\n\t\t\tif (!this.head) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tlet current = this.head;\n\t\t\tlet newTail = current;\n\n\t\t\twhile (current.next) {\n\t\t\t\tnewTail = current;\n\t\t\t\tcurrent = current.next;\n\t\t\t}\n\n\t\t\tthis.tail = newTail;\n\t\t\tconsole.log('this.tail', this.tail);\n\t\t\tthis.tail.next = null;\n\t\t\tthis.length--;\n\t\t\tif (this.length === 0) {\n\t\t\t\tthis.head = null;\n\t\t\t\tthis.tail = null;\n\t\t\t}\n\t\t\treturn current;\n\t\t}", "title": "" }, { "docid": "981c6b59374cd8c9bc4a4a1e8786da9b", "score": "0.6639629", "text": "pop() {\n if (!this.head) return undefined;\n let poppedNode = this.tail;\n if (this.length === 1) {\n this.head = null;\n this.tail = null;\n } else {\n this.tail = poppedNode.prev;\n this.tail.next = null;\n poppedNode.prev = null;\n }\n this.length--;\n return poppedNode;\n }", "title": "" }, { "docid": "52ed5f0719b95fba7164666e6c39ab85", "score": "0.6636394", "text": "function popHead() {\n if (!this.head) return undefined;\n if (this.head === this.tail) this.tail = null;\n var poppedValue = this.head.value;\n this.head = this.head.next;\n this.size--;\n return poppedValue;\n}", "title": "" }, { "docid": "ee5291946b70cab7bdaf0bb1c47c3520", "score": "0.66325057", "text": "shift() {\n if (this.length === 0) {\n throw new Error('Cannot remove Node from empty list');\n }\n\n let currentHead = this.head;\n this.head = currentHead.next;\n this.length--;\n\n if (this.length === 0) {\n this.head = null;\n this.tail = null;\n }\n\n return currentHead;\n }", "title": "" }, { "docid": "05fcdb23f3196503f4d96befbf2c102d", "score": "0.6629951", "text": "pop() {\n if (!this.first) return null;\n let temp = this.first;\n if (this.first === this.last) {\n this.last = null;\n }\n this.first = this.first.next;\n this.size--;\n return temp.value;\n }", "title": "" }, { "docid": "9b9ddbb27e284e3be7b8389aaf1d7882", "score": "0.66281706", "text": "shift() {\n let oldHead = this.head;\n if (!this.head) return undefined;\n if (this.length === 1) { //alt: if(this.head === this.tail)\n this.head = null;\n this.tail = null;\n } else {\n this.head = oldHead.next;\n oldHead.next = null;\n this.head.prev = null;\n }\n this.length--;\n return oldHead;\n }", "title": "" }, { "docid": "8761b7901b416a53860c88e5de2a873a", "score": "0.6617447", "text": "shift(){\n if(!this.head) return undefined\n let currentHead = this.head;\n this.head = currentHead.next;\n this.length--;\n if(this.length === 0){\n this.tail = null;\n }\n return currentHead;\n }", "title": "" }, { "docid": "717cca8ccb02d95b069e6184801b1938", "score": "0.66059345", "text": "removeRear() {\n let value = this.data[this.tail]\n delete this.data[this.tail]\n this.tail--\n return value\n }", "title": "" }, { "docid": "4f30e8ed5489f65cd734c724346176ae", "score": "0.6589026", "text": "pop() {\n if (!this.head) return null;\n let current = this.head;\n while (current.next) {\n let previous = current;\n current = current.next;\n if (current.next === null) {\n previous.next = null\n this.tail = previous\n }\n\n }\n this.length--;\n if (this.length === 0) {\n this.head = null\n this.tail = null\n }\n return this\n }", "title": "" }, { "docid": "3ca0ae80526be4d6f2e32ff25a4c6a13", "score": "0.65875226", "text": "pop() {\n if (!this.first) return null;\n\n let removed = this.first;\n\n if (this.first === this.last) {\n this.last = null;\n // why not set this.first = null?\n }\n\n // It's possible that removed.next === null\n // Therefore the first line in put will return null\n // So there's no need to set this.first = null in the if condition\n this.first = removed.next;\n\n this.size--;\n\n return removed.val;\n }", "title": "" }, { "docid": "b816231af7bfe1017862e426d1534542", "score": "0.65749943", "text": "shift() {\n if (!this.head) return undefined \n let currentHead = this.head;\n this.head = currentHead.next\n this.length--;\n if (length === 0) {\n this.tail = null;\n }\n return currentHead\n }", "title": "" }, { "docid": "fb68df420c58c340c0fa3a7d05378081", "score": "0.65621096", "text": "shift() {\n if (!this.head) return undefined;\n let oldHead = this.head;\n if (this.length === 1) {\n this.head = null;\n this.tail = null;\n }\n this.head = oldHead.next;\n this.head.prev = null;\n oldHead.next = null;\n this.length--;\n return oldHead;\n }", "title": "" }, { "docid": "e0d700ef5d68b79d0a3791b74fcc2cec", "score": "0.6558219", "text": "pop() {\n let current = this.head;\n let prev = null;\n\n while (current) {\n if (current === this.tail) {\n if (prev === null) {\n this.head = null;\n } else {\n prev.next = null;\n }\n\n this.tail = prev;\n this.length -= 1;\n break;\n }\n\n prev = current;\n current = current.next;\n }\n\n return current === null ? null : current.value;\n }", "title": "" }, { "docid": "e404dec1f23c7f1e39d27c8a84380f0b", "score": "0.65534425", "text": "pop() {\n\t\tlet ret = null;\n\n\t\tif(this.isEmpty()) return;\n\t\tif(this.size === 1) {\n\t\t\tret = this.head;\n\t\t\tthis.tail = null;\n\t\t\tthis.head = null;\n\t\t}\n\t\telse {\n\t\t\tret = this.tail;\n\t\t\tthis.tail = this.tail.prev;\n\t\t\tthis.tail.next.prev = null;\n\t\t\tthis.tail.next = null;\n\t\t}\n\n\t\tthis.size --;\n\t\treturn ret;\n\t}", "title": "" }, { "docid": "54f07f86df6c6b25f9e4c2022c040eff", "score": "0.6551619", "text": "pop() {\n if (this.tail == null) {\n return null\n }\n if(this.head == this.tail)\n {\n var temp = this.head.value;\n this.head = null;\n this.tail = null;\n return temp;\n }\n var runner = this.head;\n while (runner.next != this.tail) {\n runner = runner.next;\n }\n var lastValue = this.tail.value;\n this.tail = runner;\n runner.next = null;\n return lastValue;\n }", "title": "" }, { "docid": "41e26fce9f17c2340a7c0beb1fce6af1", "score": "0.65511405", "text": "pop(){\n if(this.size < 1){\n return null\n }\n let value = this.first.value;\n if(this.size === 1 ){\n this.first = null;\n this.last = null;\n }\n else {\n const temp = this.first;\n this.first = this.first.next;\n temp.next = null;\n }\n this.size--;\n return value;\n }", "title": "" }, { "docid": "422d47789a85b2e9b606d502a26c6d37", "score": "0.6544493", "text": "removeHead() {\n // Only single node or empty node.\n if (this.head === this.tail) {\n const node = this.head;\n this.tail = null;\n this.head = null;\n return node;\n }\n const head = this.head; // head node\n this.head = this.head.next; // shift head to next node\n head.next = null; // remove pointer to next\n return head;\n }", "title": "" }, { "docid": "64c68c37f2524288a9583cbd865e223a", "score": "0.6543966", "text": "shift(){\n if(!this.head) return undefined;\n \n let current = this.head;\n this.head = current.next;\n this.length--;\n\n if(this.length === 0){\n this.tail = null;\n }\n return current; \n }", "title": "" }, { "docid": "f9c485ade1d7584018233e46f9ca19a5", "score": "0.65361655", "text": "pop() {\r\n if (!this.first) {\r\n return null;\r\n }\r\n\r\n var tmp = this.first;\r\n\r\n if (this.first === this.last) {\r\n this.last = null;\r\n }\r\n\r\n this.first = this.first.next;\r\n this.size--;\r\n\r\n return tmp.value;\r\n }", "title": "" }, { "docid": "a4be622b459e5732fa732f9cb727d4c5", "score": "0.65356183", "text": "shift(){\n if(this.length === 0){\n return undefined\n }\n\n let currentHead = this.head \n this.head = currentHead.next\n currentHead.next = null\n this.length--\n if(this.length === 0){\n this.tail = null\n }\n return currentHead\n }", "title": "" }, { "docid": "cc8dca1a10cd0ef9d88e8d4a70f1c6fa", "score": "0.6529975", "text": "shift() {\n if(!this.head){\n throw new Error('Empty list'); \n }\n\n const val = this.head.val; \n if(this.head === this.tail){\n this.head = null; \n this.tail = null; \n }\n else{\n this.head = this.head.next; \n }\n\n this.length -= 1; \n return val; \n }", "title": "" }, { "docid": "1e1f6273d04040839dfaf6434f8d1d1a", "score": "0.6525829", "text": "shift() {\n if (!this.head)\n return undefined;\n let temp = this.head;\n this.head = temp.next;\n this.length--;\n if (this.length === 0) {\n this.tail = null\n }\n return temp;\n }", "title": "" }, { "docid": "9ddbc3e7a00f6085f0b5b18f255a84c5", "score": "0.6524899", "text": "pop() {\n if (this.length === 0) {\n throw new Error('Cannot remove Node from empty list');\n }\n\n let current = this.head;\n let newTail = this.head;\n while (current.next !== null) {\n newTail = current;\n current = current.next;\n }\n\n this.tail = newTail;\n newTail.next = null;\n this.length--;\n\n if (this.length === 0) {\n this.head = null;\n this.tail = null;\n }\n\n return current;\n }", "title": "" }, { "docid": "c7f6836e6598de9b1b1cffe2f4917ce2", "score": "0.65219516", "text": "shift(){\r\n if(!this.head) return null;\r\n let curHead = this.head;\r\n this.head = curHead.next;\r\n this.length--;\r\n if(this.length === 0) {\r\n this.tail = null;\r\n }\r\n return curHead;\r\n }", "title": "" }, { "docid": "03d022e4929a12e806bd4731daeddfc0", "score": "0.6519962", "text": "pop() {\n let current = this.head \n let removedNode\n\n if(!this.tail) {\n return null\n } \n\n if(this.size === 1) {\n removedNode = this.tail \n this.head = null \n this.tail = null\n this.size--\n return removedNode\n }\n\n while(current.next) {\n if(current.next === this.tail) {\n removedNode = this.tail \n current.next = null\n this.tail = current \n this.size--\n return removedNode\n } else {\n current = current.next\n }\n }\n }", "title": "" }, { "docid": "6d315497fea114c640c3027efeaed255", "score": "0.6515014", "text": "remove(index){\n if(index < 0 || index > this.length) return undefined;\n if(index === 0) return this.shift()\n if(index === this.length - 1) return this.pop()\n\n let prev = this.get(index - 1)\n let removed = prev.next\n prev.next = removed.next\n this.length--;\n return removed\n }", "title": "" }, { "docid": "6c4eae7ab41e099bfd0a8bb0ff352451", "score": "0.65104795", "text": "pop() {\n if (!this.head) {\n return null;\n }\n if (this.length === 1) {\n this.head = null;\n this.tail = null;\n } else {\n this.tail = this.tail.prev;\n this.tail.next = null;\n }\n this.length -= 1;\n return this;\n }", "title": "" }, { "docid": "33319730acb53035eeddaafd9ae25a5b", "score": "0.6496902", "text": "deleteAtHead() {\n\t\tlet toReturn = null;\n\t\tif (this.head !== null) {\n\t\t\ttoReturn = this.head.data;\n\t\t\tif (this.tail === this.head) {\n\t\t\t\tthis.head = null;\n\t\t\t\tthis.tail = null;\n\t\t\t} else {\n\t\t\t\tthis.head = this.head.next;\n\t\t\t\tthis.head.prev = null;\n\t\t\t}\n\t\t\treturn toReturn;\n\t\t}\n\t}", "title": "" }, { "docid": "7838d465a817ea2cac1c40219e267f74", "score": "0.6492477", "text": "deleteTail() {\n let currentNode = this.head;\n\n while(currentNode) {\n if (currentNode.next === null) {\n return null;\n }\n if(currentNode.next.next === null) {\n this.tail = currentNode;\n currentNode.next = null;\n return;\n } else {\n currentNode = currentNode.next;\n }\n }\n }", "title": "" }, { "docid": "ff31fb91d7ffe38b0392f5677dd6fa19", "score": "0.6491509", "text": "function tail(arr) {\n return (arr.length && arr[arr.length - 1]) || undefined;\n}", "title": "" }, { "docid": "77bd9fa5fc26df24a773e6c6cd0621be", "score": "0.64873713", "text": "function last(a) {\n return a.length > 0 ? a[a.length - 1] : null;\n}", "title": "" }, { "docid": "d84aaa1a660e0d683df6e2dbd37b2e6c", "score": "0.6486823", "text": "function last(a) {\n return a.length > 0 ? a[a.length - 1] : null;\n }", "title": "" }, { "docid": "8c19308e8e322e54498d7eb274bcb565", "score": "0.64839804", "text": "dequeue(){\n if(!this.first) return null;\n let oldFirst = this.first;\n if(this.first === this.last) {\n this.last = null;\n }\n //take the first item and re-assign it to the next item in the list\n this.first = this.first.next;\n this.size--;\n return oldFirst.val;\n }", "title": "" }, { "docid": "16730194ae7105355709773d538ec544", "score": "0.64783996", "text": "function last(a) {\n return a.length > 0 ? a[a.length - 1] : null;\n}", "title": "" }, { "docid": "16730194ae7105355709773d538ec544", "score": "0.64783996", "text": "function last(a) {\n return a.length > 0 ? a[a.length - 1] : null;\n}", "title": "" }, { "docid": "16730194ae7105355709773d538ec544", "score": "0.64783996", "text": "function last(a) {\n return a.length > 0 ? a[a.length - 1] : null;\n}", "title": "" }, { "docid": "16730194ae7105355709773d538ec544", "score": "0.64783996", "text": "function last(a) {\n return a.length > 0 ? a[a.length - 1] : null;\n}", "title": "" }, { "docid": "caec1a64a3b0c4774c33054a41508863", "score": "0.6475987", "text": "pop() {\n if (this.head === null && this.tail === null) {\n return null;\n } else {\n let tail = this.tail;\n this.tail = this.tail.prev;\n tail.delete();\n return tail.val;\n }\n }", "title": "" }, { "docid": "9e38ac5e641c96a5f6785545dc7660e8", "score": "0.64707905", "text": "function popTail() {\n\t\tconst tail = snakeObject.tails.pop();\n\t\tlet tailElement = document.querySelector('.' + tail.name);\n\t\ttailElement.parentNode.removeChild(tailElement);\n\t\treturn tail;\n\t}", "title": "" }, { "docid": "92e76049d19f2d738a3f0763b55466c2", "score": "0.6469221", "text": "removeLast() {\n //for an empty list.\n if (!this.head) {\n return;\n }\n //for a list with one node.\n if (!this.head.next) {\n this.head = null;\n return;\n }\n //for a list with more than one node.\n let prev = this.head;\n let node = this.head.next;\n while (node.next) {\n prev = node;\n node = node.next;\n }\n prev.next = null;\n }", "title": "" }, { "docid": "acea1a96bb2c47d6739420dd3e00a7d9", "score": "0.64672685", "text": "pop() {\n // Make sure the list is not empty\n if (!this.head) {\n return undefined;\n }\n\n let current = this.head;\n let newTail = current;\n\n while (current.next) {\n // New tail is always lagging behind current\n newTail = current;\n // Move current forward\n current = current.next;\n }\n // Set the new tail\n this.tail = newTail;\n // Old tail will be deleted if nothing is pointing to it\n this.tail.next = null;\n this.length--;\n if (this.length === 0) {\n this.head = null;\n this.tail = null;\n }\n // return the removed node\n return current;\n }", "title": "" }, { "docid": "7bad1662c9a84fd71d88a95bc31f0a7e", "score": "0.64666736", "text": "pop() {\n if (this.size <= 0) {\n return null;\n }\n const temp = this.first;\n if (this.size === 1) {\n this.first = null;\n this.last = null;\n } else {\n this.first = this.first.next;\n }\n this.size -= 1;\n return temp.val;\n }", "title": "" }, { "docid": "9507f6bc9ee75d254b81038a2dcdc7a8", "score": "0.6459557", "text": "function tail(arr) {\n return arr.length && arr[arr.length - 1] || undefined;\n}", "title": "" }, { "docid": "9507f6bc9ee75d254b81038a2dcdc7a8", "score": "0.6459557", "text": "function tail(arr) {\n return arr.length && arr[arr.length - 1] || undefined;\n}", "title": "" }, { "docid": "9507f6bc9ee75d254b81038a2dcdc7a8", "score": "0.6459557", "text": "function tail(arr) {\n return arr.length && arr[arr.length - 1] || undefined;\n}", "title": "" }, { "docid": "9507f6bc9ee75d254b81038a2dcdc7a8", "score": "0.6459557", "text": "function tail(arr) {\n return arr.length && arr[arr.length - 1] || undefined;\n}", "title": "" }, { "docid": "9507f6bc9ee75d254b81038a2dcdc7a8", "score": "0.6459557", "text": "function tail(arr) {\n return arr.length && arr[arr.length - 1] || undefined;\n}", "title": "" }, { "docid": "1f30ec5297dce9fa864c29fa48f780c4", "score": "0.64575875", "text": "dequeue() {\r\n\t\tif(!this.head) { return undefined };\r\n\t\tlet currentHead = this.head;\r\n\t\t//for case where there was only 1 item\r\n\t\tif(this.length === 1) {\r\n\t\t\t//set head and tail back to null\r\n\t\t\tthis.head = null;\r\n\t\t\tthis.tail = null;\r\n\t\t}\r\n\t\tthis.head = currentHead.next;\r\n\t\tthis.length--;\r\n\t\treturn currentHead.val;\r\n\t}", "title": "" }, { "docid": "1dc3f3ab5edcc6534fca57ea3e35a652", "score": "0.6452386", "text": "pop(){\n if(this.length === 0){\n return ''\n }\n let current = this.head\n if(this.length === 1 ){\n \n this.tail = null \n this.head = null \n }else{\n let previousNode = this.head\n while(current.next){\n previousNode = current\n current = current.next \n \n }\n \n this.tail = previousNode\n this.tail.next = null\n }\n this.length--\n return current.val\n\n }", "title": "" }, { "docid": "a41fc118e59078262810ab39e1358a7e", "score": "0.6451254", "text": "shift() {\n if(!this.head){\n return null;\n } else{\n const removeNode = this.head;\n this.head = this.head.next;\n this.length -=1;\n \n if(!this.length){\n this.tail = null;\n }\n \n return removeNode.val;\n }\n }", "title": "" }, { "docid": "4beeae198dab0768c696abaf1ba56f56", "score": "0.64502627", "text": "remove(index) {\n if(index < 0 || index >= this.length) return undefined;\n if(index === 0) return this.shift();\n if(index === this.length - 1) return this.pop();\n var removed = this.get(index);\n var beforeNode = removed.prev;\n var afterNode = removed.next;\n\n beforeNode.next = afterNode; removed.prev = null;\n afterNode.prev = beforeNode; removed.next = null;\n\n this.length--;\n return removed;\n}", "title": "" }, { "docid": "33a95ee4f59270a00a9c56c08bfd8834", "score": "0.64494234", "text": "pop() {\n if (!this.head) return undefined;\n\n let current = this.head;\n let prevNode = current;\n\n while (current.next) {\n prevNode = current;\n current = current.next;\n }\n\n // Set tail to 2nd last node\n this.tail = prevNode;\n // Remove it's next, since it's now the last\n this.tail.next = null;\n // Reduce length of list\n this.length--;\n\n // Reset head and tail if there's 0 now\n if (this.length === 0) {\n this.head = null;\n this.tail = null;\n }\n\n // Return what we just popped\n console.log(JSON.stringify(this, null, 2));\n console.log(\"pop\", current);\n return current;\n }", "title": "" }, { "docid": "e087f9ef7eb4b01eeb15c2a5f7250ce8", "score": "0.6438468", "text": "dequeue(){\n if(!this.first){\n return null;\n }\n var temp = this.first;\n if(this.first === this.last){\n this.last = null;\n }\n this.first = this.first.next;\n this.size--;\n return temp;\n }", "title": "" }, { "docid": "d317a52ffb8b07621a197a76239df3af", "score": "0.6427945", "text": "pop() {\n if (this.size === 0) return null;\n let temp = this.first;\n if (this.size === 1) {\n this.last = null;\n }\n this.first = this.first.next;\n this.size--;\n return temp.value;\n }", "title": "" }, { "docid": "e2c5f9c4f963010f59cc13a511842fe1", "score": "0.6420815", "text": "pop() {\n if (!this.tail) {\n if (!this.head) return null;\n return this.shift();\n } else {\n const tail = this.tail;\n this.tail = this.tail.prev;\n this.tail.next = null;\n return tail.val;\n }\n }", "title": "" }, { "docid": "bb3d17d523e87bcb49739d31e4e41c32", "score": "0.6416921", "text": "shift() {\n if (this.head === null) {\n return undefined;\n }\n const newHead = this.head;\n this.head = newHead.next;\n this.length--;\n if (this.length === 0) {\n this.tail = null;\n }\n return newHead;\n }", "title": "" }, { "docid": "475bfc8a9da8f58ff392c83ad6a33a2c", "score": "0.6416703", "text": "remove(index){\n if(index < 0 || index > this.length){\n return undefined;\n }\n if(index === this.length - 1){\n return this.pop();\n }\n else if(index === 0){\n return this.shift();\n }\n else{\n let prevNode = this.get(index - 1);\n let removed = prevNode.next;\n prevNode.next = removed.next;\n this.length--;\n return removedNode;\n }\n }", "title": "" }, { "docid": "030e1020c9386a2b6fa5339278dfcc4a", "score": "0.6414009", "text": "pop() {\n //if there are no nodes, return undefined\n if(!this.head) return undefined;\n //Loop through the list until you reach the tail\n let current = this.head;\n let newTail = current;\n while(current.next) {\n //new tail lags behind the current by 1 node\n newTail = current;\n current = current.next;\n }\n //Set the next property of the 2nd to last node to be null\n this.tail = newTail;\n //Set the tail to be the 2nd to last node\n this.tail.next = null;\n //Decrement the length by 1\n this.length --;\n //if the list is now empty, then set the head and tail to be null;\n if(!this.length) {\n this.head = null;\n this.tail = null;\n }\n //Return the value of the node removed\n return current;\n }", "title": "" }, { "docid": "71b06d7fbb79e4021586b17e63daf1c6", "score": "0.64104325", "text": "shift() {\n // Make sure the list is not empty\n if (!this.head) {\n return undefined;\n }\n const currentHead = this.head;\n // move the head 1 forward\n this.head = currentHead.next;\n this.length--;\n if (this.length === 0) {\n this.head = null;\n this.tail = null;\n }\n return currentHead;\n }", "title": "" }, { "docid": "d081dde982dada49a6906c4fe505d589", "score": "0.640619", "text": "removeHead() {\n if (this.head === this.tail) {\n this.head = {}\n this.tail = this.head\n } else {\n this.head = this.head.next\n }\n }", "title": "" }, { "docid": "8166fa6c4ada18fc087c9473733da3b8", "score": "0.64038765", "text": "removeFront() {\n if (this.head == null && this.tail == null) {\n return undefined;\n }\n\n else if (this.head == this.tail) {\n var temp = this.head;\n this.head = null;\n this.tail = null;\n return temp.value;\n }\n\n else {\n var temp = this.head;\n // this.head = temp.next;\n this.head = this.head.next;\n temp.next = null;\n // if (this.head == null) {\n // this.tail = null;\n // }\n return temp.value;\n }\n }", "title": "" }, { "docid": "3dca098b93c0744594bf2c2eaaa75dc4", "score": "0.6398889", "text": "function remove_last(items) {\n\treturn items.slice(0, items.length - 1);\n}", "title": "" }, { "docid": "c3c48bae5ce498224eee38a35ce08dbd", "score": "0.63938004", "text": "removeAt(index) {\n // check for out-of-bounds values\n if (index >= 0 && index <= this.count) {\n let current = this.head;\n\n // removing the first item\n if (index === 0) {\n this.head = current.head;\n } else {\n const previous = this.getElementAt(index - 1);\n current = previous.next;\n previous.next = current.next; // link previous with current's next: skip it to remove\n }\n this.count--;\n return current.element;\n }\n return undefined;\n }", "title": "" }, { "docid": "1582866139e3c25791162152ee18bc6a", "score": "0.6393277", "text": "deleteLast() {\n let previous;\n let current = this.head;\n // traverse the linked list until it reaches the last index\n while (current.next) {\n previous = current;\n current = current.next;\n }\n // remove the last index\n previous.next = null;\n this.size--;\n }", "title": "" }, { "docid": "29d48769071df9fe5395a39c69f13c53", "score": "0.6390978", "text": "shift(){\n if(this.length === 0) return undefined;\n const oldHead = this.head;\n if(this.length === 1){\n this.head = null;\n this.tail = null;\n }else{\n this.head = oldHead.next;\n this.head.previous = null;\n oldHead.next = null; //? Severs completely\n }\n this.length--;\n return oldHead;\n }", "title": "" }, { "docid": "ad1ee3736372fbe4a920e2f68b6785c1", "score": "0.6378293", "text": "removeAt(index) {\n if(!this.head) {\n return;\n }\n\n if(index === 0) {\n this.head = this.head.next;\n return;\n }\n\n var previous = this.getAt(index-1);\n if(!previous || !previous.next) {\n return;\n }\n previous.next = previous.next.next;\n }", "title": "" } ]
69a9bc6202ff43afefbb453ca8fe1ac6
let dataList1 = [20, 32, 34, 90, 30, 21], dataList2 = [20, 82, 91, 34, 20, 30], dataList3 = [50, 32, 20, 54, 19, 33]; dataList1 = dataList1.slice(0, hourDataSize); dataList2 = dataList2.slice(0, hourDataSize); dataList3 = dataList3.slice(0, hourDataSize); let dataX = ['04:00', '08:00', '12:00', '16:00', '20:00', '24:00']; initLineCharts1('echarts1', dataList1, dataList2, dataList3, dataX)
[ { "docid": "a871cd8dd16a1357476ea198cf3cbc4d", "score": "0.7510215", "text": "function initLineCharts1(id, dataList1, dataList2, dataList3, dataX) {\n\t\tvar myChart = echarts.init(document.getElementById(id));\n\t\tvar option = {\n\t\t\ttooltip: {\n\t\t\t\ttrigger: 'axis',\n\t\t\t\taxisPointer: {\n\t\t\t\t\ttype: 'cross',\n\t\t\t\t\tlabel: {\n\t\t\t\t\t\tbackgroundColor: '#6a7985'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tlegend: {\n\t\t\t\ttextStyle: {\n\t\t\t\t\tcolor: 'rgba(255, 255, 255, 0.8)',\n\t\t\t\t\tfontSize: fontSize(0.12)\n\t\t\t\t},\n\t\t\t\tdata: ['今日在线', '今日离线', '今日故障']\n\t\t\t},\n\t\t\tgrid: { // 设置图形大小\n\t\t\t\tleft: '3%',\n\t\t\t\tright: '4%',\n\t\t\t\tbottom: '3%',\n\t\t\t\ttop: '25%',\n\t\t\t\tcontainLabel: true\n\t\t\t},\n\t\t\txAxis: [{\n\t\t\t\ttype: 'category',\n\t\t\t\tdata: dataX,\n\t\t\t\taxisLabel: {\n\t\t\t\t\tfontSize: fontSize(0.12),\n\t\t\t\t\ttextStyle: {\n\t\t\t\t\t\tcolor: 'rgba(255, 255, 255, 0.8)' //坐标值得具体的颜色\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}],\n\t\t\tyAxis: [{\n\t\t\t\ttype: 'value',\n\t\t\t\tname: '单位:个',\n\t\t\t\tnameTextStyle: {\n\t\t\t\t\tcolor: 'rgba(255, 255, 255, 0.8)',\n\t\t\t\t\tfontSize: fontSize(0.12)\n\t\t\t\t},\n\t\t\t\tsplitNumber: '4',\n\t\t\t\taxisLabel: {\n\t\t\t\t\tfontSize: fontSize(0.12),\n\t\t\t\t\ttextStyle: {\n\t\t\t\t\t\tcolor: 'rgba(255, 255, 255, 0.8)'\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tsplitLine: {\n\t\t\t\t\tshow: true,\n\t\t\t\t\t// 改变轴线颜色\n\t\t\t\t\tlineStyle: {\n\t\t\t\t\t\ttype: 'dashed', //设置网格线类型 dotted:虚线 solid:实线\n\t\t\t\t\t\t// 使用深浅的间隔色\n\t\t\t\t\t\tcolor: ['#9ba2ac']\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}],\n\t\t\tseries: [{\n\t\t\t\t\tname: '今日在线',\n\t\t\t\t\ttype: 'line',\n\t\t\t\t\tcolor: \"#4AFEA3\",\n\t\t\t\t\tdata: dataList1\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: '今日离线',\n\t\t\t\t\ttype: 'line',\n\t\t\t\t\tcolor: \"#00FFFF\",\n\t\t\t\t\tdata: dataList2\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: '今日故障',\n\t\t\t\t\ttype: 'line',\n\t\t\t\t\tcolor: \"#FD9D02\",\n\t\t\t\t\tdata: dataList3\n\t\t\t\t},\n\t\t\t]\n\t\t};\n\t\tmyChart.setOption(option);\n\t}", "title": "" } ]
[ { "docid": "b26cf6f86aa526bae9e16f28cf3b068a", "score": "0.66026014", "text": "function displayConsumptionDataInChart(consumptionDataArray) {\n\n //array for c3 chart load\n let columnsObject = {\n x: 'x',\n columns: []\n }\n\n let dateTime = ['x']\n consumptionDataArray[0].consumptionWindows.forEach(consumptionWindow => {\n\n //format date time, use end time for time stamp\n let dateTimeFormatted = new Date(consumptionWindow[1]);\n dateTime.push(dateTimeFormatted);\n })\n\n //add date time for c3 chart object\n columnsObject.columns.push(dateTime);\n\n consumptionDataArray.forEach(meterDataObject => {\n\n //create array to hold data series name, and data series\n let dataArray = [];\n dataArray.push(meterDataObject.name)\n\n //add series data to data array\n meterDataObject.consumptionWindows.forEach(consumptionWindow => {\n dataArray.push(Math.floor(consumptionWindow[2]))\n })\n columnsObject.columns.push(dataArray);\n })\n\n //destroy old line chart\n lineChart.destroy();\n\n //create new line chart\n lineChart = c3.generate({\n size: {\n height: 420\n },\n bindto: \"#lineChart\",\n data: columnsObject,\n axis: {\n x: {\n type: 'timeseries',\n tick: {\n format: '%m-%d-%Y %H:%M'\n }\n }\n }\n });\n\n}", "title": "" }, { "docid": "2968dc2d4b1eada34ba30d4c65ae99b7", "score": "0.65106684", "text": "function chartH() {\r\n var options = {\r\n chart: {\r\n height: 350,\r\n type: 'line',\r\n shadow: {\r\n enabled: true,\r\n color: '#111',\r\n top: 18,\r\n left: 7,\r\n blur: 10,\r\n opacity: 1\r\n },\r\n toolbar: {\r\n show: false\r\n },\r\n zoom: {\r\n enabled: false\r\n },\r\n fontFamily: 'Poppins, sans-serif',\r\n },\r\n colors: ['#1b4962', '#ffa000'],\r\n dataLabels: {\r\n enabled: true,\r\n },\r\n stroke: {\r\n curve: 'smooth'\r\n },\r\n series: [{\r\n name: \"High - 2013\",\r\n data: [28, 29, 33, 36, 32, 32, 33]\r\n },\r\n {\r\n name: \"Low - 2013\",\r\n data: [12, 11, 14, 18, 17, 13, 13]\r\n }\r\n ],\r\n title: {\r\n text: 'Average High & Low Temperature',\r\n align: 'left'\r\n },\r\n grid: {\r\n borderColor: '#e4e4e4',\r\n row: {\r\n colors: ['#f2f2f2', 'transparent'], // takes an array which will be repeated on columns\r\n opacity: 0.5\r\n },\r\n },\r\n markers: {\r\n\r\n size: 6\r\n },\r\n xaxis: {\r\n categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul'],\r\n title: {\r\n text: 'Month'\r\n },\r\n labels: {\r\n style: {\r\n colors: '#10163a',\r\n fontFamily: 'Poppins, sans-serif',\r\n }\r\n }\r\n },\r\n yaxis: {\r\n title: {\r\n text: 'Temperature'\r\n },\r\n labels: {\r\n style: {\r\n color: '#10163a',\r\n fontFamily: 'Poppins, sans-serif',\r\n }\r\n },\r\n min: 5,\r\n max: 40\r\n },\r\n legend: {\r\n position: 'top',\r\n horizontalAlign: 'right',\r\n floating: true,\r\n offsetY: -25,\r\n offsetX: -5\r\n }\r\n }\r\n\r\n var chart = new ApexCharts(\r\n document.querySelector(\"#chartH\"),\r\n options\r\n );\r\n\r\n chart.render();\r\n}", "title": "" }, { "docid": "575d14c5f8fc793cdc499ae5f3f96f39", "score": "0.6459817", "text": "function initializeLineChart(data){\n return;\n}", "title": "" }, { "docid": "b39d556f1e93a43082d5edf6f5338777", "score": "0.63304657", "text": "function twentyFourHourGraph(multiJson){\n const f_ar = [];\n multiJson.forEach(function(days){\n let time = days[\"timestamp\"];\n let available = days[\"available\"];\n\n time_conver = function(time){\n return new Date(time);\n };\n\n let value_i = parseInt(time);\n let available_i = parseInt(available);\n\n b_obj = {};\n b_obj.x = time_conver(value_i);\n b_obj.y = available_i;\n f_ar.push(b_obj);\n });\n\n let chart = new CanvasJS.Chart(\"graph-container\",\n {\n backgroundColor: \"#3C5F73\",\n title: {\n },\n axisX: {\n title: \"Time\",\n valueFormatString: \"HH:mm\",\n labelAngle: -20,\n labelFontColor: \"white\",\n titleFontColor: \"white\",\n lineColor: \"white\", \n tickColor: \"white\",\n gridColor: \"#3e7ea3\",\n },\n axisY:{\n title: \"Bike Stand Availability\",\n labelFontColor: \"white\",\n titleFontColor: \"white\",\n lineColor: \"white\",\n tickColor: \"white\", \n gridColor: \"#3e7ea3\",\n },\n data: [\n {\n \t color: \"#E8C775\",\n type: \"splineArea\",\n dataPoints: f_ar\n }]\n });\n chart.render();\n}", "title": "" }, { "docid": "7575dc52cf5a956f8b190cf1ceefff96", "score": "0.63101965", "text": "function generateChartData() {\r\n data=LINE_CHART_DATA;//$.parseJSON(document.getElementById('charts').value);\r\n $.each(data, function(key, item){ // we create date objects here. In your data, you can have date strings\r\n // and then set format of your dates using chart.dataDateFormat property,\r\n // however when possible, use date objects, as this will speed up chart rendering.\r\n var newDate = new Date(item['cur_date']);\r\n var total = item['total_user'];\r\n var active = item['total_active_user'];\r\n// var views = Math.round(Math.random() * 6000);\r\n\r\n chartData.push({\r\n date: newDate,\r\n active: active,\r\n total: total\r\n// views: views\r\n });\r\n })\r\n }", "title": "" }, { "docid": "e88b215c53038a0f4809f34df5121bcf", "score": "0.6290328", "text": "function drawMultipleLineChart(formatteddata){\n\t\tHighcharts.chart('chart', {\n\n\t\t title: {\n\t\t text: 'Reports and Violations Statistics Chart'\n\t\t },\n\t\t \n\t\t xAxis: {\n\t\t categories: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\n\t\t },\n\n\t\t yAxis: {\n\t\t title: {\n\t\t text: 'Number of reports/violations'\n\t\t }\n\t\t },\n\t\t legend: {\n\t\t layout: 'vertical',\n\t\t align: 'right',\n\t\t verticalAlign: 'middle'\n\t\t },\n\n\t\t plotOptions: {\n\t\t series: {\n\t\t label: {\n\t\t connectorAllowed: false\n\t\t },\n\t\t pointStart: 0\n\t\t }\n\t\t },\n\n\t\t series: formatteddata,\n\n\t\t responsive: {\n\t\t rules: [{\n\t\t condition: {\n\t\t maxWidth: 100,\n\t\t\t\t\t\tmaxHeight: 100\n\t\t },\n\t\t chartOptions: {\n\t\t legend: {\n\t\t layout: 'horizontal',\n\t\t align: 'center',\n\t\t verticalAlign: 'bottom'\n\t\t }\n\t\t }\n\t\t }]\n\t\t }\n\n\t\t});\n\t}", "title": "" }, { "docid": "c05fb32e37a35bf912b58dec71a949f0", "score": "0.6278527", "text": "function creatingChartData1() {\n var lengthSubSums = [];\n lengthSubSums[0] = 0;\n lengthSubSums[1] = retHistLBPeriodsNo[0];\n for (var i = 2; i < retHistLBPeriodsNo.length + 1; i++) {\n lengthSubSums[i] = lengthSubSums[i - 1] + retHistLBPeriodsNo[i - 1];\n }\n \n var chartStart = lengthSubSums[indOfLength];\n var chartEnd = lengthSubSums[indOfLength + 1] - 1;\n var nCurrData = lengthOfChart + 1;\n\n var xTicksH = new Array(nCurrData);\n for (var i = 0; i < nCurrData; i++) {\n var xTicksHRows = new Array(2);\n xTicksHRows[0] = i;\n xTicksHRows[1] = dailyDatesArray[dailyDatesArray.length - nCurrData + i];\n xTicksH[i] = xTicksHRows;\n }\n\n var noAssets = assetNamesArray.length;\n var listH = [];\n for (var j = 0; j < noAssets; j++) {\n var assChartPerc1 = new Array(nCurrData);\n var assChartPerc1Rows0 = new Array(2);\n assChartPerc1Rows0[0] = 0;\n assChartPerc1Rows0[1] = 0;\n assChartPerc1[0] = assChartPerc1Rows0;\n for (var i = 1; i < nCurrData; i++) {\n var assChartPerc1Rows = new Array(2);\n assChartPerc1Rows[0] = i;\n assChartPerc1Rows[1] = parseFloat(histRets2ChartsMtx[chartStart - 1 + i][j]);\n assChartPerc1[i] = assChartPerc1Rows;\n }\n listH.push({ label: assetNamesArray[j], data: assChartPerc1, points: { show: true, radius: Math.min(40 / nCurrData,2) }, lines: { show: true } });\n }\n\n \n var datasets1 = listH;\n \n flotPlotMyData1(datasets1, nCurrData, xTicksH, noAssets, assetNamesArray);\n \n\n \n }", "title": "" }, { "docid": "898d056e9156a71a1c6920c730707288", "score": "0.62647897", "text": "function makeLineChart_1(linechart1_config){\r\n\r\n Highcharts.chart('linechart_1', {\r\n\r\n credits:{\r\n enabled:false\r\n },\r\n title: {\r\n text: linechart1_config['chart_title']\r\n },\r\n\r\n subtitle: {\r\n text: ''\r\n },\r\n\r\n yAxis: {\r\n title: {\r\n text: linechart1_config['y_title']\r\n }\r\n },\r\n xAxis: {\r\n type: 'datetime',\r\n\r\n },\r\n plotOptions: {\r\n series: {\r\n label: {\r\n connectorAllowed: true\r\n }\r\n },\r\n zoomType:'xy'\r\n },\r\n\r\n series: [{\r\n name: 'Created',\r\n color: 'rgb(135,185,37)',\r\n data: linechart1_config['tickets_created_arr']\r\n }, {\r\n name: 'Completed',\r\n color: 'rgb(0,53,148)',\r\n data: linechart1_config['tickets_completed_arr']\r\n }],\r\n\r\n responsive: {\r\n rules: [{\r\n condition: {\r\n maxWidth: 500\r\n },\r\n chartOptions: {\r\n legend: {\r\n \r\n }\r\n }\r\n }]\r\n }\r\n\r\n });\r\n\r\n} //end of makeLineChart_1", "title": "" }, { "docid": "01cf31dcca8cd44a5c78ff51c5cc733b", "score": "0.6218803", "text": "function drawChart1(data) {\n // Add header data\n data.unshift(dataHeaders);\n\n c3.generate({\n bindto: '#chart1',\n data: {\n x: 'x',\n rows: data\n },\n axis: {\n x: {\n type: 'timeseries',\n tick: {\n format: '%Y-%m-%d'\n }\n },\n y: {\n tick: {\n count: 5\n }\n }\n },\n size: {\n height: 250\n },\n legend: {\n position: 'right'\n },\n color: {\n pattern: ['#90c4e3', '#fb8d34']\n }\n });\n}", "title": "" }, { "docid": "b8bf134ac400ea0ec298ea7bb1a4ef1f", "score": "0.62162125", "text": "function prepareLineChart(data){\n var dId = 'dashboard' + data.id.toString();\n var dashboard = new google.visualization.Dashboard(document.getElementById(dId));\n var dataTbl = new google.visualization.DataTable();\n\n var chart = new google.visualization.ChartWrapper({\n 'chartType': 'LineChart',\n 'containerId': 'chart',\n // Convert the first column from 'date' to 'string'.\n 'view': {\n 'columns': [{\n 'calc': function(dataTable, rowIndex) {\n return dataTable.getFormattedValue(rowIndex, 0);\n },\n 'type': 'string'\n }, 1,2\n ]\n }\n });\n\n var chartOptions = {\n // Use the same chart area width as the control for axis alignment.\n 'chartArea': {'height': '80%', 'width': '90%'},\n 'hAxis': {'slantedText': false},\n 'vAxis': {'viewWindow': {'min': 0, 'max': 1200}},\n 'legend': {'position': 'none'}\n };\n\n var control = new google.visualization.ControlWrapper({\n 'controlType': 'ChartRangeFilter',\n 'containerId': 'control',\n 'state': {\n 'range': {\n 'start': new Date(2013, 5, 1),\n 'end': new Date(2013, 5, 15)\n }\n }\n });\n\n var controlOptions = {\n // Filter by the date axis.\n 'filterColumnIndex': 000,\n 'ui': {\n 'chartType': 'LineChart',\n 'chartOptions': {\n 'chartArea': {'width': '90%'},\n 'hAxis': {'baselineColor': 'none'}\n },\n // Display a single series that shows the closing value of the stock.\n // Thus, this view has two columns: the date (axis) and the stock value (line series).\n 'chartView': { 'columns': [0, 1] },\n }\n };\n\n var startIndex = parseInt(parseInt(data.data.length) / 3);\n var endIndex = parseInt(parseInt(data.data.length) - startIndex);\n var start = data.data[startIndex].fecha.split('-');\n var end = data.data[endIndex].fecha.split('-');\n\n control.setOptions(controlOptions);\n control.setState({\n 'range': {\n 'start': new Date(start[0], start[1] - 1, start[2]),\n 'end': new Date(end[0], end[1] - 1, end[2])\n }\n });\n\n if (data.dimension == 'emisiones-gds' || data.dimension == 'emisiones-sine') {\n dataTbl.addColumn('date', 'Date');\n dataTbl.addColumn('number', 'Amadeus');\n dataTbl.addColumn('number', 'Sabre');\n chart.setView({\n 'view': {\n 'columns': [{\n 'calc': function(dataTable, rowIndex) {\n return dataTable.getFormattedValue(rowIndex, 0);\n },\n 'type': 'string'\n }, 1, 2\n ]\n }\n });\n chartOptions.vAxis.viewWindow.max = parseInt(data.settings.max);\n chart.setOptions(chartOptions);\n\n for(i=0; i < data.data.length; i++){\n var fecha = data.data[i].fecha.split('-');\n dataTbl.addRow([\n new Date(parseInt(fecha[0]), parseInt(fecha[1]) - 1, parseInt(fecha[2])),\n parseInt(data.data[i].count_amadeus),\n parseInt(data.data[i].count_sabre)\n ]);\n } \n }\n\n if (data.dimension == 'emisiones-full') {\n dataTbl.addColumn('date', 'Date');\n dataTbl.addColumn('number', 'Tickets');\n\n chart.setView({\n 'view': {\n 'columns': [{\n 'calc': function(dataTable, rowIndex) {\n return dataTable.getFormattedValue(rowIndex, 0);\n },\n 'type': 'string'\n }, 1\n ]\n }\n });\n chartOptions.vAxis.viewWindow.max = parseInt(data.settings.max);\n chart.setOptions(chartOptions);\n\n for(i=0; i<data.data.length; i++){\n var fecha = data.data[i].fecha.split('-');\n dataTbl.addRow([\n new Date(parseInt(fecha[0]), parseInt(fecha[1]) - 1, parseInt(fecha[2])),\n parseInt(data.data[i].count)\n ]);\n }\n }\n\n control.setContainerId('control' + data.id.toString());\n chart.setContainerId('chart' + data.id.toString());\n\n var graphObject = {};\n graphObject.control = control;\n graphObject.chart = chart;\n graphObject.dashboard = dashboard;\n graphObject.dataTbl = dataTbl;\n\n return graphObject;\n }", "title": "" }, { "docid": "d0671a5821aaadf5803802d2600a3bff", "score": "0.6213647", "text": "function multiLineChartFunc(values,divToShow,title){\n\n var svg = d3.select(divToShow),\n margin = {top: 20, right: 220, bottom: 40, left: 60},\n width = 1400 - margin.left - margin.right,\n height = 500 - margin.top - margin.bottom;\n\n var formatDate = d3.time.format(\"%Y-%m-%d %H:%M:%S\").parse;\n\n var x = d3.time.scale().range([0, width]),\n y = d3.scale.linear().range([height, 0]);\n\n if (title.indexOf('separated')>=0) {\n var color = d3.scale.ordinal()\n .range([\"#ff7f0e\", \"#d62728\", \"#1f77b4\", \"#2ca02c\", \"#9467bd\", \"#bcbd22\", \"#17becf\", \"#e377c2\", \"#ffbb78\", \"#ff9896\", \"#aec7e8\", \"#98df8a\", \"#c5b0d5\", \"#dbdb8d\", \"#9edae5\", \"#f7b6d2\", '#000000', '#7f7f7f'])\n .domain(['evgen_running', 'pile_running', 'simul_running', 'recon_running', 'reprocessing_running', 'deriv_running', 'merge_running', 'eventIndex_running','evgen_waiting', 'pile_waiting', 'simul_waiting', 'recon_waiting', 'reprocessing_waiting', 'deriv_waiting', 'merge_waiting', 'eventIndex_waiting', 'total_running', 'total_waiting']);\n }\n else {\n var color = d3.scale.ordinal()\n .range([ \"#248F24\", \"#47D147\", \"#c7c7c7\"])\n .domain(['used', 'running', 'waiting']);\n }\n var line = d3.svg.line()\n .x(function(d) { return x(d.timestamp); })\n .y(function(d) { return y(d.nevents); });\n\n var data = values;\n\n // data structure:\n // [{'state1': ev_state1, 'values1': [{'date':parsed_date, 'nevents': nevents}, ...]}]\n\n nevents = [];\n for (var i=0; i<data.length; i++) {\n data[i].values.forEach(function (d) {\n d.timestamp = formatDate(d.timestamp);\n nevents.push(d.nevents)\n })\n }\n\n x.domain(d3.extent(data[0].values, function (d) { return d.timestamp; }));\n\n y.domain([ 0, d3.max(nevents) ]);\n\n\n var xAxis = d3.svg.axis()\n .scale(x)\n .orient(\"bottom\");\n var yAxis = d3.svg.axis()\n .scale(y)\n .orient(\"left\")\n .tickFormat(hFormat);\n\n var vis = svg\n\t.data([data])\n .append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right )\n .attr(\"height\", height + margin.top + margin.bottom )\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n vis.append(\"g\")\n .attr(\"class\", \"axis axis--x\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis);\n\n vis.append(\"g\")\n .attr(\"class\", \"axis axis--y\")\n .call(yAxis);\n vis.append(\"g\")\n .attr(\"transform\", \"rotate(-90)\")\n\t\t.append(\"text\")\n .attr(\"y\", 0 - margin.left)\n .attr(\"x\",0 - (height / 2))\n .attr(\"dy\", \"1em\")\n .style(\"text-anchor\", \"middle\")\n .text(\"N events\");\n\n vis.append(\"g\")\n .attr(\"transform\", \"translate(\" + ( (width)/2 ) + \",\" + ( -10 ) + \")\")\n .append(\"text\")\n .attr(\"class\", \"title\")\n .text(title);\n\n var evlines = vis.selectAll(\".state\")\n .data(data)\n .enter()\n .append(\"g\")\n .attr(\"class\", \"state\");\n\n evlines.append(\"path\")\n .attr(\"class\", \"linenevents\")\n .attr(\"d\", function(d) { return line(d.values); })\n .style(\"stroke\", function(d) { return color(d.state); });\n\n\n var mouseG = vis.append(\"g\")\n .attr(\"class\", \"mouse-over-effects\");\n\n mouseG.append(\"path\") // this is the black vertical line to follow mouse\n .attr(\"class\", \"mouse-line\")\n .style(\"stroke\", \"black\")\n .style(\"stroke-width\", \"1px\")\n .style(\"opacity\", \"0\");\n\n var lines = document.getElementsByClassName('linenevents');\n\n var mousePerLine = mouseG.selectAll('.mouse-per-line')\n .data(data)\n .enter()\n .append(\"g\")\n .attr(\"class\", \"mouse-per-line\");\n\n mousePerLine.append(\"circle\")\n .attr(\"r\", 7)\n .style(\"stroke\", function(d) {\n return color(d.state);\n })\n .style(\"fill\", \"none\")\n .style(\"stroke-width\", \"1px\")\n .style(\"opacity\", \"0\");\n\n mousePerLine.append(\"text\")\n .attr(\"transform\", \"translate(10,3)\");\n\n mouseG.append('svg:rect') // append a rect to catch mouse movements on canvas\n .attr('width', width) // can't catch mouse events on a g element\n .attr('height', height)\n .attr('fill', 'none')\n .attr('pointer-events', 'all')\n .on('mouseout', function() { // on mouse out hide line, circles and text\n d3.select(\".mouse-line\")\n .style(\"opacity\", \"0\");\n d3.selectAll(\".mouse-per-line circle\")\n .style(\"opacity\", \"0\");\n d3.selectAll(\".mouse-per-line text\")\n .style(\"opacity\", \"0\");\n })\n .on('mouseover', function() { // on mouse in show line, circles and text\n d3.select(\".mouse-line\")\n .style(\"opacity\", \"1\");\n d3.selectAll(\".mouse-per-line circle\")\n .style(\"opacity\", \"1\");\n d3.selectAll(\".mouse-per-line text\")\n .style(\"opacity\", \"1\");\n })\n .on('mousemove', function() { // mouse moving over canvas\n var mouse = d3.mouse(this);\n d3.select(\".mouse-line\")\n .attr(\"d\", function() {\n var d = \"M\" + mouse[0] + \",\" + height;\n d += \" \" + mouse[0] + \",\" + 0;\n return d;\n });\n\n d3.selectAll(\".mouse-per-line\")\n .attr(\"transform\", function(d, i) {\n // console.log(width/mouse[0])\n var xDate = x.invert(mouse[0]),\n bisect = d3.bisector(function(d) { return d.timestamp; }).right;\n idx = bisect(d.values, xDate);\n\n var beginning = 0,\n end = lines[i].getTotalLength(),\n target = null;\n\n while (true){\n target = Math.floor((beginning + end) / 2);\n pos = lines[i].getPointAtLength(target);\n if ((target === end || target === beginning) && pos.x !== mouse[0]) {\n break;\n }\n if (pos.x > mouse[0]) end = target;\n else if (pos.x < mouse[0]) beginning = target;\n else break; //position found\n }\n\n d3.select(this).select('text')\n .text(Humanize.compactInteger(y.invert(pos.y),2));\n\n\n\n return \"translate(\" + mouse[0] + \",\" + pos.y +\")\";\n });\n });\n\n var states = data.map(function (d) {\n return d.state;\n });\n\n var squareside = 15;\n var legend = vis.selectAll(\".legend\")\n .data(states.sort())\n .enter().append(\"g\")\n .attr(\"class\", \"legendoutpie\")\n .attr(\"transform\", function(d, i) {\n maxLegendWidth = 65;\n maxLegendHeight = Math.floor(i) * 20;\n return \"translate(\" + (width + maxLegendWidth) + \", \" + (maxLegendHeight) + \")\";\n });\n\n legend.append(\"rect\")\n .attr(\"x\", 0)\n .attr(\"width\", squareside)\n .attr(\"height\", squareside)\n .style(\"fill\", color)\n .style({\"stroke\":d3.rgb(color).darker(),'stroke-width':0.4});\n\n legend.append(\"text\")\n .attr(\"x\", squareside+5)\n .attr(\"y\", 12)\n .text(function(d) {\n return d;\n });\n\n}", "title": "" }, { "docid": "a6ee06817c6bf9a1eebf91994401cdfe", "score": "0.62071985", "text": "function lineChart(district_name,data_cases){\n\t \n\t var dates=[\"03/19/2020\",\"03/20/2020\",\"03/21/2020\",\"03/23/2020\",\"03/24/2020\",\"03/27/2020\",\"03/30/2020\",\"04/01/2020\",\"04/14/2020\",\"04/19/2020\"];\n\t \n\t var dataset_y_confirmed = data_cases.hasOwnProperty(district_name)?data_cases[district_name]['y-confirmed']:data_cases[\"Chennai\"]['y-confirmed'];\n\t //for i in \n\t genericlinechart(\"line-confirmed\",dates,dataset_y_confirmed,\"#ff0000\",\"Confirmed Cases\");\n\t var dataset_y_active = data_cases.hasOwnProperty(district_name)?data_cases[district_name]['y-active']:data_cases[\"Chennai\"]['y-active'];\n\t genericlinechart(\"line-active\",dates,dataset_y_active,\"#0000ff\",\"Active Cases\");\n\t var dataset_y_recovered = data_cases.hasOwnProperty(district_name)?data_cases[district_name]['y-recovered']:data_cases[\"Chennai\"]['y-recovered'];\n\t genericlinechart(\"line-recovered\",dates ,dataset_y_recovered, \"#00ff99\",\"Recovered Cases\" );\n\t var dataset_y_death = data_cases.hasOwnProperty(district_name)?data_cases[district_name]['y-death']:data_cases[\"Chennai\"]['y-death'];\n\t genericlinechart(\"line-death\",dates,dataset_y_death,\"#bfbfbf\",\"Death Cases\");\n\t //confirmed cases #ff0000\n\t \n }", "title": "" }, { "docid": "30c0d64d3f942a4f8b190120b46a003d", "score": "0.62070775", "text": "function initGraph() {\n\n google.charts.load('current', {\n 'packages': ['corechart']\n });\n google.charts.setOnLoadCallback(drawChart);\n\n function drawChart() {\n // Create and populate the data table taking time (hours) and temperature from the globData object.\n var hourlyDataPoints = globData.hourly.data.length;\n console.log(\"Hourly array length = \" + hourlyDataPoints);\n\n var graphDataHour = [hourlyDataPoints];\n var graphDataTemp = [hourlyDataPoints];\n\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Hour');\n data.addColumn('number', 'Temperature');\n\n var i = 0;\n for (i = 0; i < hourlyDataPoints; i++) {\n var time = new Date(globData.hourly.data[i].time * 1000);\n graphDataHour[i] = formatAMPM(time);\n graphDataTemp[i] = globData.hourly.data[i].temperature;\n data.addRow([graphDataHour[i], graphDataTemp[i]]);\n console.log(\"Time: \" + graphDataHour[i] + \" Temp: \" + graphDataTemp[i]);\n }\n\n var options = {\n title: 'Temperature for next 48 hours:',\n curveType: 'function',\n legend: {\n position: 'bottom'\n },\n height: 300,\n width: 600\n };\n\n // Create and draw the visualization.\n var chart = new google.visualization.LineChart(mapInfoWindowContent);\n chart.draw(data, options);\n infowindow.setContent(mapInfoWindowContent);\n\n };\n\n} // END FUNCTION", "title": "" }, { "docid": "e6ec3bdba75c92b5a26224c9e0bbad98", "score": "0.61981165", "text": "function simpleLineChartData() {\n var sin = [{ x: 3, y: 55 }, { x: 4, y: 59 }, { x: 5, y: 68 }, { x: 6, y: 73 }, { x: 7, y: 95 }, { x: 8, y: 109 }, { x: 9, y: 146 }, { x: 10, y: 124 }, { x: 11, y: 110 }, { x: 12, y: 92 }, { x: 13, y: 101 }, { x: 14, y: 104 }],\n cos = [{ x: 3, y: 50 }, { x: 4, y: 52 }, { x: 5, y: 60 }, { x: 6, y: 68 }, { x: 7, y: 89 }, { x: 8, y: 99 }, { x: 9, y: 122 }, { x: 10, y: 110 }, { x: 11, y: 100 }, { x: 12, y: 88 }, { x: 13, y: 90 }, { x: 14, y: 85 }];\n\n var data = $('#RopesDiscardedData').val();\n data = JSON.parse(data);\n\n return [\n {\n values: data,\n key: 'Discarded',\n color: success\n }\n //{\n // values: cos,\n // key: 'Requiring Discard',\n // color: '#0F3976'\n //}\n ];\n }", "title": "" }, { "docid": "d445c67cdcb3c8400a08609475ea1992", "score": "0.61946636", "text": "function drawKEChart() {\n //console.log(chartX);\n let x = [];\n if(chartX == \"measurement\"){\n x = [...measurementData];\n }else if(chartX == \"ekt\"){\n x = [...ek];\n }else{\n x = [...particles[parseInt(chartX, 10)-1].ek];\n }\n\n let y = [];\n if(chartY == \"measurement\"){\n y = [...measurementData];\n }else if(chartY == \"ekt\"){\n y = [...ek];\n }else{\n y = [...particles[parseInt(chartY, 10)-1].ek];\n }\n \n var arr = [];\n x.forEach((n, i) =>{\n arr.push([n, y[i]]);\n })\n\n var data = google.visualization.arrayToDataTable(arr);\n\n var options = {\n title: 'Graph (Change X and Y Axis in the above form):',\n legend: { position: 'bottom' }\n };\n\n var chart = new google.visualization.LineChart(document.getElementById('curve_chart'));\n\n chart.draw(data, options);\n\n}", "title": "" }, { "docid": "4510497fd2ea528dc228aed074f2a671", "score": "0.61920244", "text": "function prepareCharts() {\n console.log(\"Preparing charts\");\n for (let h = 0; h < 24; h++) {\n hours.push(h + \":00\");\n }\n showCharts();\n}", "title": "" }, { "docid": "d09f48716c3e695fe4d6745ef796b9b4", "score": "0.616932", "text": "function updateChart3() {\n myLineChart3.data = data6;\n myLineChart3.update();\n}", "title": "" }, { "docid": "114a1ca8a505d099a15f266e08357038", "score": "0.61575526", "text": "function showCharts(mapid, timeSeries) {\n for (var i = 0; i < timeSeries.length; i++) {\n var value = timeSeries[i];\n if (value != null) {\n if (i + 1 < timeSeries.length) {\n var nextValue = timeSeries[i + 1];\n if (nextValue != null && value[0] == nextValue[0]) {\n timeSeries.splice(i + 1, 1);\n value[1] = (value[1] + nextValue[1]) / 2;\n }\n }\n value[0] = new Date(parseInt(value[0], 10));\n }\n }\n this.data = new google.visualization.DataTable();\n this.data.addColumn(\"date\");\n this.data.addColumn(\"number\");\n this.data.addRows(timeSeries);\n\n if (mapid == '0') {\n this.options = { title: \"High\", hAxis: \"Date\", vAxis: \"Elevation\" }\n } else if (mapid == '1') {\n this.options = { title: \"Lights\", hAxis: \"Date\", vAxis: \"Luminosity\" }\n } else if (mapid == '2') {\n this.options = { title: \"Temperature\", hAxis: \"Date\", vAxis: \"Celsius Degrees\" }\n } else if (mapid == '3') {\n this.options = { title: \"Water Occurrence Change Intensity\", hAxis: \"Date\", vAxis: \"Water\" }\n } else if (mapid == '4') {\n this.options = { title: \"Water Change\", hAxis: \"Date\", vAxis: \"Water\", legend: \"0: 'No observations', 1: 'Not water', 2: 'Seasonal water', 3: 'Permanent water'\" }\n } else if (mapid == '5') {\n this.options = { title: \"Forest Change\", hAxis: \"Date\", vAxis: \"Pixels representing loss\" }\n } else if (mapid == '6') {\n this.options = { title: \"Vegetation Index\", hAxis: \"Date\", vAxis: \"NDVI\" }\n }\n\n this.columnNames = [this.options.hAxis, this.options.vAxis];\n if (mapid != 1 && mapid != 4) {\n this.showLineChart(this.options, this.data);\n } else {\n this.showBarChart(this.options, this.data);\n }\n}", "title": "" }, { "docid": "99609b4198e19adaa654f171b493c4c4", "score": "0.611728", "text": "function buildRegularHistoryChart(data) {\n\n var chartConfig = {\n xAxis: {\n type: \"datetime\"\n },\n chart: {\n zoomType: 'x'\n },\n rangeSelector: {\n enabled: true,\n selected: 2\n },\n legend: {\n enabled: true,\n align: \"center\",\n symbolWidth: 30,\n itemStyle: {\n cursor: 'pointer',\n fontSize: '12px'\n }\n },\n tooltip: {\n useHTML: true,\n crosshairs: [{\n width: 1,\n color: 'grey'\n }, {\n width: 1,\n color: 'grey'\n }],\n shared: true,\n valueDecimals: 0\n },\n subtitle: {\n text: \"You can select/deselect single graph elements by clicking on their legend entry.\"\n },\n title: {\n useHTML: true\n },\n yAxis: [{ // Primary yAxis\n labels: {\n x: -2,\n y: -2,\n align: \"right\"\n },\n title: {},\n opposite: true,\n showEmpty: false,\n min: 0\n }, { // Secondary yAxis\n labels: {\n align: 'left',\n x: 2,\n y: -2\n },\n title: {},\n gridLineWidth: 0,\n opposite: false,\n showEmpty: false,\n min: 0\n }],\n useHighStocks: true,\n series: [],\n size: {\n height: 500\n }\n };\n\n ['platinum', 'gold'].forEach(function(cur) {\n\n // configure y axises labeling\n var config = JSON.parse(JSON.stringify(chartConfig));\n config.yAxis[0].labels.format = \"{value} \" + cur[0].toUpperCase();\n config.yAxis[0].title.text = cur[0].toUpperCase() + cur.slice(1, cur.length);\n\n config.yAxis[1].labels.format = \"{value} Units\";\n config.yAxis[1].title.text = \"Quantity\";\n\n // customize chart title\n config.title.text = 'Global Economy History - ' + cur[0].toUpperCase() + cur.slice(1, cur.length);\n\n // start parsing series data\n var total = [],\n quantity = [],\n cumulativeQuantity = [],\n cumulativeTotal = [];\n\n var quantitySeries = {\n name: \"Quantity\",\n type: 'line',\n data: quantity,\n color: '#23b1b1',\n index: 2,\n yAxis: 1,\n tooltip: {\n valueSuffix: \" Units\"\n }\n };\n\n var totalSeries = {\n name: \"Total\",\n data: total,\n line: 'line',\n lineWidth: 2,\n color: \"#000\",\n index: 3,\n tooltip: {\n valueSuffix: \" \" + cur[0].toUpperCase()\n }\n };\n\n var cumulativeQuantitySeries = {\n name: \"Cumulative Quantity\",\n type: \"area\",\n color: \"#007777\",\n index: 0,\n data: cumulativeQuantity,\n visible: false,\n yAxis: 1,\n tooltip: {\n valueSuffix: \" Units\"\n }\n };\n\n var cumulativeTotalSeries = {\n name: \"Cumulative Total\",\n type: \"area\",\n // color: \"#007777\",\n index: 1,\n data: cumulativeTotal,\n visible: false,\n yAxis: 0,\n tooltip: {\n valueSuffix: \" \" + cur[0].toUpperCase()\n }\n };\n\n var cumulativeQuantityAcc = 0;\n var cumulativeTotalAcc = 0;\n\n data[cur].forEach(function(i) {\n\n var d = Date.parse(i.d);\n\n quantitySeries.data.push([d, i.q]);\n totalSeries.data.push([d, i.t]);\n cumulativeQuantityAcc = cumulativeQuantityAcc + i.q;\n cumulativeQuantitySeries.data.push([d, cumulativeQuantityAcc]);\n cumulativeTotalAcc = cumulativeTotalAcc + i.t;\n cumulativeTotalSeries.data.push([d, cumulativeTotalAcc]);\n\n });\n config.series = [quantitySeries, totalSeries, cumulativeQuantitySeries, cumulativeTotalSeries, getFlagSeries()];\n $('#economy-regular-' + cur.toLowerCase()).highcharts('StockChart', config);\n });\n\n }", "title": "" }, { "docid": "0fe482586a7cb0a2a5af7159f2c6e952", "score": "0.6115395", "text": "function updateChart() {\n myLineChart.data = data3;\n myLineChart.update();\n}", "title": "" }, { "docid": "0433d6778ac549c5e97aa5eab215ba04", "score": "0.611157", "text": "function setChart(recent_measurements, measurement_types) {\n // console.log(\"final data\", recent_measurements);\n console.log(\"measurement_types\", measurement_types);\n\n if(measurement_types[0][0] != 1) {\n console.log(\"2 measurements\");\n var categories = [];\n if(measurement_types[1][0] != 1) { // 2 measurements used\n var strict_data = [[], []];\n for(recent_measurement in recent_measurements) {\n var created = recent_measurements[recent_measurement]['created_at'];\n splitDate = created.split(\" \");\n var dayOfWeek = splitDate[0];\n var month = splitDate[1];\n var day = parseFloat(splitDate[2]);\n var year = parseFloat(splitDate[3]);\n var shortenStr = dayOfWeek + ' ' + month + ' ' + day + ', ' + year;\n var newElem = parseFloat(recent_measurements[recent_measurement]['value']);\n if(parseFloat(recent_measurements[recent_measurement]['measurement_type_id']) == measurement_types[0][0]) {\n strict_data[0].push(newElem);\n categories.push(shortenStr); \n } else if(parseFloat(recent_measurements[recent_measurement]['measurement_type_id']) == measurement_types[1][0]) {\n strict_data[1].push(newElem);\n } else {\n console.log(\"no matches ERROR\");\n }\n } \n console.log(\"categories\", categories);\n console.log(\"strict_data\", strict_data);\n new Highcharts.Chart({\n chart: {\n renderTo: 'activity_chart',\n zoomType: 'x'\n },\n title: {\n text: 'Your History of ' + str.capitalize()\n },\n subtitle: {\n text: document.ontouchstart === undefined ?\n 'Click and drag in the plot area to zoom in' :\n 'Pinch the chart to zoom in'\n },\n xAxis: [{\n categories: categories\n }],\n yAxis: [{ // Primary yAxis\n title: {\n text: measurement_types[0][1].capitalize(),\n }\n }, { // Secondary yAxis\n title: {\n text: measurement_types[1][1].capitalize(),\n },\n opposite: true\n }],\n legend: {\n floating: false,\n backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'\n },\n series: [{\n name: measurement_types[0][1].capitalize(),\n type: 'column',\n data: strict_data[0]\n }, {\n name: measurement_types[1][1].capitalize(),\n type: 'column',\n yAxis: 1,\n data: strict_data[1]\n }]\n });\n } else { // 1 measurement used\n var categories = [];\n var graph_data = [[], []];\n for(recent_measurement in recent_measurements) {\n var created = recent_measurements[recent_measurement]['created_at'];\n // splitDate = created.split(\" \");\n // var dayOfWeek = splitDate[0];\n // var month = splitDate[1];\n // var day = parseFloat(splitDate[2]);\n // var year = parseFloat(splitDate[3]);\n // var shortenStr = dayOfWeek + ' ' + month + ' ' + day + ', ' + year; \n // console.log(\"stuffs\", dayOfWeek, year, month, day);\n\n var newElem = parseFloat(recent_measurements[recent_measurement]['value']);\n if(parseFloat(recent_measurements[recent_measurement]['measurement_type_id']) == measurement_types[0][0]) {\n graph_data[0].push(newElem);\n categories.push(created);\n } else if(parseFloat(recent_measurements[recent_measurement]['measurement_type_id']) == measurement_types[1][0]) {\n // ignore\n } else {\n console.log(\"no matches ERROR\");\n }\n }\n console.log(\"graph_data\", graph_data);\n console.log(\"categories\", categories); \n console.log(\"1 measurements\");\n\n new Highcharts.Chart({\n chart: {\n renderTo: 'activity_chart',\n zoomType: 'x',\n type: 'areaspline',\n style: {\n fontFamily: 'Book Antiqua'\n }\n },\n title: {\n text: 'Your History of ' + str.capitalize()\n },\n subtitle: {\n text: document.ontouchstart === undefined ?\n 'Click and drag in the plot area to zoom in' :\n 'Pinch the chart to zoom in'\n },\n xAxis: {\n type: 'category',\n categories: categories,\n title: {\n text: 'Date'\n }\n },\n yAxis: {\n title: {\n text: measurement_types[0][1].capitalize()\n },\n min: 0\n },\n series: [{\n name: measurement_types[0][1].capitalize(),\n color: Highcharts.getOptions().colors[3],\n data: graph_data[0]\n }]\n });\n }\n } else { // 0 mesurements used\n console.log(\"0 measurements\");\n var categories = [];\n var graph_data = [];\n for(recent_measurement in recent_measurements) {\n var created = recent_measurements[recent_measurement]['created_at'];\n splitDate = created.split(\" \");\n var dayOfWeek = splitDate[0];\n var month = splitDate[1];\n var day = parseFloat(splitDate[2]);\n var year = parseFloat(splitDate[3]);\n var shortenStr = dayOfWeek + ' ' + month + ' ' + day + ', ' + year;\n console.log(\"shortened\", shortenStr);\n if(graph_data[0]) {\n if(categories[categories.length - 1] != shortenStr) {\n graph_data.push(.5);\n categories.push(shortenStr);\n } else {\n graph_data[graph_data.length - 1] = graph_data[graph_data.length - 1] + .5;\n }\n } else {\n graph_data[0] = .5;\n categories.push(shortenStr); \n }\n }\n console.log(\"graph_data\", graph_data);\n console.log(\"categories\", categories);\n var chart = new Highcharts.Chart({\n chart: {\n renderTo: 'activity_chart',\n zoomType: 'x',\n type: 'column',\n style: {\n fontFamily: 'Book Antiqua'\n }\n },\n title: {\n text: 'Your History of ' + str.capitalize()\n },\n subtitle: {\n text: document.ontouchstart === undefined ?\n 'Click and drag in the plot area to zoom in' :\n 'Pinch the chart to zoom in'\n },\n xAxis: {\n type: 'category',\n categories: categories,\n title: {\n text: 'Dates of Exercises'\n }\n },\n yAxis: {\n title: {\n text: 'Number of Times Completed per Day'\n },\n min: 0\n },\n series: [{\n name: str.capitalize(),\n color: Highcharts.getOptions().colors[3],\n data: graph_data\n }]\n });\n }\n}", "title": "" }, { "docid": "040656d40eb92843e5ae95bf6bc62404", "score": "0.61062837", "text": "function displayLineChart(data, lineChartDOM, lineLinesDOM) {\n\n var timestamps = transformTimestampsToXLables(data.columns[0]);\n var chartWidth = Y_AXIS_LABEL_WIDTH * timestamps.length + X_STROKE_WIDTH;\n\n var lineChartContext = lineChartDOM.getContext(\"2d\");\n var doubledData = Math.min(data.columns[1].length / 2);\n var doubledData2 = Math.min(data.columns[2].length / 2);\n data.columns[1].splice(doubledData, doubledData);\n data.columns[2].splice(doubledData2, doubledData2);\n\n var maxFromYAxis = findLargestFromYAxis(data.columns[1], data.columns[2]);\n var yAxisData = transformDataToYLabels(lineChartContext, data, timestamps, maxFromYAxis);\n var yLineHeight = Y_AXIS_LABEL_HEIGHT;\n yAxisData.yLabels.forEach((labelCount) => {\n lineChartContext.fillText(labelCount, 60, yLineHeight += Y_AXIS_LABEL_HEIGHT);\n });\n\n function initTimeStamps(CHART_ELEMENT, timestamps, yAxisHeight) {\n CHART_ELEMENT.font = \"12px Arial, serif\";\n var xStrokeWidth = X_STROKE_WIDTH;\n timestamps.forEach((timestamp) => {\n CHART_ELEMENT.fillText(timestamp, xStrokeWidth += Y_AXIS_LABEL_WIDTH, yAxisHeight + 20);\n });\n }\n\n lineChartDOM.setAttribute(\"width\", chartWidth);\n lineLinesDOM.setAttribute(\"width\", chartWidth);\n lineChartDOM.setAttribute(\"height\", yAxisData.yAxisHeight + 200);\n lineLinesDOM.setAttribute(\"height\", yAxisData.yAxisHeight + 200);\n\n initTimeStamps(lineChartContext, timestamps, yAxisData.yAxisHeight);\n initLines(lineChartContext, timestamps, yAxisData.yAxisStamps);\n fillLinePointsAsLine(lineLinesDOM.getContext(\"2d\"), data.columns[1], data.colors[\"y0\"]);\n fillLinePointsAsLine(lineLinesDOM.getContext(\"2d\"), data.columns[2], data.colors[\"y1\"]);\n }", "title": "" }, { "docid": "58e01ff4bb8176e2b83887ceb05809e4", "score": "0.610569", "text": "function generateChartData() {\n\n\t\t\tvar chartData = [];\n\t\t\tvar nowTime = new Date();\n\t\t\thours = nowTime.getHours();\n\t\t\tmins = nowTime.getMinutes();\n\t\t\tseconds = nowTime.getSeconds();\n\t\t\t//setData();\n\t\t\tfor (var i = seconds; i < seconds + 30; i++) {\n\t\t\t\tvar newDate = new Date(firstDate);\n\t\t\t\tnewDate.setDate(firstDate.getDate());\n\t\t\t\tif(i >= 60){\n\t\t\t\t\tmins = mins + 1;\n\t\t\t\t\tif(mins >= 60){\n\t\t\t\t\t\tmins = 0;\n\t\t\t\t\t\thours = hours + 1;\n\t\t\t\t\t}\n\t\t\t\t\tif(hours >= 24){\n\t\t\t\t\t\thours = 0;\n\t\t\t\t\t}\n\t\t\t\t\tnewDate.setHours(hours, mins, i-60);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tnewDate.setHours(hours, mins, i);\n\t\t\t\t}\n\t\t\t\tchartData.push({\n\t\t\t\t\t\"time\" : newDate,\n\t\t\t\t\t\"temperature\" : temperature_value,\n\t\t\t\t\t\"humidity\" : humidity_value,\n\t\t\t\t\t\"dust\" : dust_value\n\t\t\t\t});\n\t\t\t} \n\t\t\tseconds = i;\n\t\t\treturn chartData;\n\t\t}", "title": "" }, { "docid": "d6d9022e9fff2d16912494d430734912", "score": "0.6075922", "text": "function setDataForChart(data) {\n //Humidity chart configuartion\n ConfigHumidityChart();\n\n //Temperature chart configuartion\n ConfigTemperatureChart();\n\n // On success, 'data' contains a list of products.\n $.each(data, function (key, item) {\n // Add a list item for the product.\n humidityChartdata.addRows([[item.DateTime.toString(), item.Humidity]]);\n temperatureChartData.addRows([[item.DateTime.toString(), item.Temperature]]);\n });\n resize();\n}", "title": "" }, { "docid": "60a324a207011ee2329939305c8e19c8", "score": "0.60587543", "text": "function drawTemperatureCharts(){\n var alt_temp_chart = new google.visualization.LineChart(document.getElementById('chart_alt_temp'))\n var batt_temp_chart = new google.visualization.LineChart(document.getElementById('chart_batt_temp'))\n var mcu_temp_chart = new google.visualization.LineChart(document.getElementById('chart_mcu_temp'))\n var compass_temp_chart = new google.visualization.LineChart(document.getElementById('chart_compass_temp'))\n var adc1_temp_chart = new google.visualization.LineChart(document.getElementById('chart_adc1_temp'))\n var adc2_temp_chart = new google.visualization.LineChart(document.getElementById('chart_adc2_temp'))\n var ext_temp_chart = new google.visualization.LineChart(document.getElementById('chart_ext_temp'))\n var RB_temp_chart = new google.visualization.LineChart(document.getElementById('chart_RB_temp'))\n alt_temp_chart.draw(chart_alt_temp_data, chart_alt_temp_options)\n batt_temp_chart.draw(chart_batt_temp_data, chart_batt_temp_options)\n mcu_temp_chart.draw(chart_mcu_temp_data, chart_mcu_temp_options)\n compass_temp_chart.draw(chart_compass_temp_data, chart_compass_temp_options)\n adc1_temp_chart.draw(chart_adc1_temp_data, chart_adc1_temp_options)\n adc2_temp_chart.draw(chart_adc2_temp_data, chart_adc2_temp_options)\n ext_temp_chart.draw(chart_ext_temp_data, chart_ext_temp_options)\n RB_temp_chart.draw(chart_RB_temp_data, chart_RB_temp_options)\n}", "title": "" }, { "docid": "f87655c3207db29764136bb58a93b79c", "score": "0.6041692", "text": "function startChart() {\n var data = new google.visualization.DataTable();\n data.addColumn('datetime', 'Time');\n /*data.addColumn('number', 'Temperature');\n data.addColumn('number', 'Humidity');*/\n\n var options = {\n series: {\n 0: { targetAxisIndex: 0 }\n // 4: {targetAxisIndex: 4}\n },\n hAxis: {\n title: 'Time',\n format: 'HH:mm',\n gridlines: {\n color: '#333'\n }\n },\n vAxis: {\n\n // Adds titles to each axis.\n 0: {\n title: 'Temps (Celsius)',\n gridlines: {\n color: '#333'\n }\n },\n /*4: {title: 'Daylight',\n gridlines: {\n color: '#333'\n }} ,*/\n gridlines: {\n color: '#333'\n },\n\n\n },\n backgroundColor: '#000000',\n width: '100%',\n height: '100%',\n interpolateNulls: 'false',\n chartArea: { left: '5%', top: '5%', width: '80%', height: '90%' }\n };\n\n // Denne oppretter et 'google LineChart'\n var chart = new google.visualization.LineChart(document.getElementById('chart_div'));\n\n chart.draw(data, options);\n\n // Denne oppretter en ny funksjon, som skal gÃ¥ hver 5 sek og hente inn 1 rad med data\n (function updatethingspeakgauges() {\n\n $.getJSON(thingspeakURL, function (json) {\n\n\n var i = 0;\n\n Object.entries(json).forEach(([key, value]) => {\n var found = false;\n for (var i = 0; i < data.getNumberOfColumns(); i++)\n if (key == data.getColumnId(i))\n found = true;\n if (!found)\n data.addColumn('number', key + \" \" + value, key); \n });\n\n var keys = [];\n keys = Object.keys(json);\n var values = [];\n values = Object.values(json);\n //myVal.unshift(new Date(Date.now()));\n data.addRow();\n var id;\n var k;\n for (var j = 0; j < keys.length; j++)\n for (var i = 0; i < data.getNumberOfColumns(); i++) {\n if (data.getColumnId(i) == keys[j]) {\n data.setCell(data.getNumberOfRows() - 1, i, values[j]);\n data.setColumnLabel(i, keys[j] + \" \" + values[j]);\n }\n }\n\n data.setCell(data.getNumberOfRows() - 1, 0, new Date(Date.now()));\n //console.log(myVal);\n //data.addRow(myVal);\n });\n\n // Fjern første rad om den er eldre enn en time\n var now = new Date(Date.now());\n now.setHours(now.getHours() - 6);\n while (data.getNumberOfRows() > 0 &&\n now > data.getValue(0, 0))\n data.removeRow(0);\n\n chart.draw(data, options);\n\n // Denne setter timeout pÃ¥ denne funksjonen, dvs gjentar den etter 5 sek\n setTimeout(updatethingspeakgauges, 5000);\n })();\n}", "title": "" }, { "docid": "02122c761288775e506eecc795c4c703", "score": "0.6041479", "text": "function buildChart(data) {\n // Setting some default highchart actions\n Highcharts.setOptions({\n lang: {\n decimalPoint: '.',\n thousandsSep: ','\n }\n })\n\n // line chart\n Highcharts.chart('container2', {\n\n title: {\n text: 'Ripple Prices in USD, Last 30 days'\n },\n\n subtitle: {\n text: 'Source: cryptodatadownload.com'\n },\n\n yAxis: {\n title: {\n text: 'Price in USD'\n }\n },\n legend: {\n layout: 'vertical',\n align: 'right',\n verticalAlign: 'middle'\n },\n\n plotOptions: {\n series: {\n label: {\n connectorAllowed: false\n },\n pointStart: 2015\n }\n },\n\n\n // Actual data plotting\n series: [{\n name: 'Daily High',\n data: priceHigh\n }]\n });\n Highcharts.chart('container', {\n\n title: {\n text: 'Ripple Prices in USD, 2015-2018'\n },\n\n subtitle: {\n text: 'Source: cryptodatadownload.com'\n },\n\n\n yAxis: {\n title: {\n text: 'Price in USD'\n }\n },\n legend: {\n layout: 'vertical',\n align: 'right',\n verticalAlign: 'middle'\n },\n\n plotOptions: {\n series: {\n label: {\n connectorAllowed: false\n },\n\n }\n },\n\n\n // Actual data plotting\n series: [{\n name: 'High',\n data: priceHigh\n }]\n });\n\n\n }", "title": "" }, { "docid": "be4abb735693531b30dcb1a05d02a06f", "score": "0.6032644", "text": "function insertEmptyResultsCharts(data, dataType){\n var mintimestamp = data[0][0];\n var maxtimestamp = data[0][data[0].length-1];\n var timestampType;\n\n if (mintimestamp.length == 4)\n timestampType = 'years';\n else if (mintimestamp.length == 7)\n timestampType = 'months';\n else{\n timestampType = 'days';\n mintimestamp = conversion.convertToDefault(mintimestamp);\n maxtimestamp = conversion.convertToDefault(maxtimestamp);\n }\n\n var insertedData = [[], [], []];\n insertedData[0].push(data[0][0]);\n insertedData[1].push(data[1][0]);\n insertedData[2].push(data[2][0]);\n for(var currentDate = mintimestamp, nextDate = mintimestamp, index = 0; currentDate.toString() != maxtimestamp.toString(); currentDate = nextDate) {\n if (timestampType == 'years' || timestampType == 'months') {\n nextDate = (timestampType == 'years') ? parseInt(currentDate) + 1 : conversion.getNextMonthDate(currentDate);\n // if the next day of the current date is equal to the next date on the array\n if (nextDate.toString() == data[0][index+1]){\n insertedData[0].push(data[0][index+1]);\n insertedData[1].push(data[1][index+1]);\n insertedData[2].push(data[2][index+1]);\n index++;\n }else {\n insertedData[0].push(nextDate);\n insertedData[2].push('');\n if (dataType == 'areaChart')\n insertedData[1].push([0, 0]);\n else if (dataType == 'lineChart')\n insertedData[1].push({x:0, y:0});\n }\n }else if (timestampType == 'days') {\n nextDate.setDate(currentDate.getDate() + 1);\n if (nextDate.toString() == conversion.convertToDefault(data[0][index+1]).toString()){\n insertedData[0].push(data[0][index+1]);\n insertedData[1].push(data[1][index+1]);\n insertedData[2].push(data[2][index+1]);\n index++;\n }else {\n insertedData[0].push(conversion.getDateHandler(currentDate+1));\n insertedData[2].push('');\n if (dataType == 'areaChart')\n insertedData[1].push([0, 0]);\n else if (dataType == 'lineChart')\n insertedData[1].push({x:0, y:0});\n }\n }\n }\n for (var index = 0; index < insertedData[1].length; index++) {\n if (dataType == 'areaChart')\n insertedData[1][index][0] = index;\n else if (dataType == 'lineChart')\n insertedData[1][index].x = index;\n }\n\n return insertedData;\n}", "title": "" }, { "docid": "de7989ba76bff1bdc3369f74283ce85a", "score": "0.60316694", "text": "function dashboardFive() {\n\n var data1 = [\n [0,4],[1,8],[2,5],[3,10],[4,4],[5,16],[6,5],[7,11],[8,6],[9,11],[10,20],[11,10],[12,13],[13,4],[14,7],[15,8],[16,12]\n ];\n var data2 = [\n [0,0],[1,2],[2,7],[3,4],[4,11],[5,4],[6,2],[7,5],[8,11],[9,5],[10,4],[11,1],[12,5],[13,2],[14,5],[15,2],[16,0]\n ];\n\n var options = {\n series: {\n lines: {\n show: false,\n fill: true\n },\n splines: {\n show: true,\n tension: 0.4,\n lineWidth: 1,\n fill: 0.4\n },\n points: {\n radius: 0,\n show: true\n },\n shadowSize: 2\n },\n grid: {\n hoverable: true,\n clickable: true,\n\n borderWidth: 2,\n color: 'transparent'\n },\n colors: [\"#1ab394\", \"#1C84C6\"],\n xaxis:{\n },\n yaxis: {\n },\n tooltip: false\n };\n\n /**\n * Definition of variables\n * Flot chart\n */\n this.flotData = [data1, data2];\n this.flotOptions = options;\n\n\n var sparkline1Data = [34, 43, 43, 35, 44, 32, 44, 52];\n var sparkline1Options = {\n type: 'line',\n width: '100%',\n height: '50',\n lineColor: '#1ab394',\n fillColor: \"transparent\"\n };\n\n var sparkline2Data = [32, 11, 25, 37, 41, 32, 34, 42];\n var sparkline2Options = {\n type: 'line',\n width: '100%',\n height: '50',\n lineColor: '#1ab394',\n fillColor: \"transparent\"\n };\n\n this.sparkline1 = sparkline1Data;\n this.sparkline1Options = sparkline1Options;\n this.sparkline2 = sparkline2Data;\n this.sparkline2Options = sparkline2Options;\n\n}", "title": "" }, { "docid": "de7989ba76bff1bdc3369f74283ce85a", "score": "0.60316694", "text": "function dashboardFive() {\n\n var data1 = [\n [0,4],[1,8],[2,5],[3,10],[4,4],[5,16],[6,5],[7,11],[8,6],[9,11],[10,20],[11,10],[12,13],[13,4],[14,7],[15,8],[16,12]\n ];\n var data2 = [\n [0,0],[1,2],[2,7],[3,4],[4,11],[5,4],[6,2],[7,5],[8,11],[9,5],[10,4],[11,1],[12,5],[13,2],[14,5],[15,2],[16,0]\n ];\n\n var options = {\n series: {\n lines: {\n show: false,\n fill: true\n },\n splines: {\n show: true,\n tension: 0.4,\n lineWidth: 1,\n fill: 0.4\n },\n points: {\n radius: 0,\n show: true\n },\n shadowSize: 2\n },\n grid: {\n hoverable: true,\n clickable: true,\n\n borderWidth: 2,\n color: 'transparent'\n },\n colors: [\"#1ab394\", \"#1C84C6\"],\n xaxis:{\n },\n yaxis: {\n },\n tooltip: false\n };\n\n /**\n * Definition of variables\n * Flot chart\n */\n this.flotData = [data1, data2];\n this.flotOptions = options;\n\n\n var sparkline1Data = [34, 43, 43, 35, 44, 32, 44, 52];\n var sparkline1Options = {\n type: 'line',\n width: '100%',\n height: '50',\n lineColor: '#1ab394',\n fillColor: \"transparent\"\n };\n\n var sparkline2Data = [32, 11, 25, 37, 41, 32, 34, 42];\n var sparkline2Options = {\n type: 'line',\n width: '100%',\n height: '50',\n lineColor: '#1ab394',\n fillColor: \"transparent\"\n };\n\n this.sparkline1 = sparkline1Data;\n this.sparkline1Options = sparkline1Options;\n this.sparkline2 = sparkline2Data;\n this.sparkline2Options = sparkline2Options;\n\n}", "title": "" }, { "docid": "6471489a1bb9f11008123ef3a0e8fb57", "score": "0.6027091", "text": "function prepareCharts() {\r\n console.log('Preparing charts...');\r\n //hours\r\n for(var h =0; h <= 24; h++) {\r\n hours.push(h + ': 00');\r\n }\r\n //calls\r\n calls = JsonData.today.calls;\r\n agents = JsonData.today.agents;\r\n average = JsonData.today.averageHandleTime;\r\n wait = JsonData.today.averageWaitTime;\r\n // calls = [10,1,4,2,11,11,5,9,9,12,8,11,0,0,0,0,0,0,0,0,0,0,0,0];\r\n // agents = [7,12,9,7,6,7,10,6,5,6,4,1,0,0,0,0,0,0,0,0,0,0,0,0];\r\n // average = [200, 201, 20, 14, 250, 180, 250, 480,250,510,620,200,0,0,0,0,0,0,0,0,0,0,0,0];\r\n // wait = [170, 200, 180, 110, 320, 34, 206, 59, 85, 50, 120,21,0,0,0,0,0,0,0,0,0,0,0,0];\r\n // console.log('Calls lenght: ',calls.length)\r\n // console.log('Agents lenght: ',agents.length)\r\n // console.log('Average lenght: ',average.length)\r\n // console.log('Wait lenght: ',wait.length)\r\n showCharts();\r\n\r\n}", "title": "" }, { "docid": "b4001293cd2d5e9b456ce2c0e216e34a", "score": "0.60231954", "text": "function drawLineChart(seriesTitles, data, elementId, unit) {\n var min = Infinity;\n var max = -Infinity;\n for (var i = 0; i < data.length; i++) {\n // Convert the first column to a Date.\n if (data[i] != null) {\n data[i][0] = new Date(data[i][0]);\n }\n\n // Find min, max.\n for (var j = 1; j < data[i].length; j++) {\n var val = data[i][j];\n if (val < min) {\n min = val;\n }\n if (val > max) {\n max = val;\n }\n }\n }\n\n // We don't want to show any values less than 0 so cap the min value at that.\n // At the same time, show 10% of the graph below the min value if we can.\n var minWindow = min - (max - min) / 10;\n if (minWindow < 0) {\n minWindow = 0;\n }\n\n // Add the definition of each column and the necessary data.\n var dataTable = new google.visualization.DataTable();\n dataTable.addColumn('datetime', seriesTitles[0]);\n for (var i = 1; i < seriesTitles.length; i++) {\n dataTable.addColumn('number', seriesTitles[i]);\n }\n dataTable.addRows(data);\n\n // Create and draw the visualization.\n if (!(elementId in window.charts)) {\n window.charts[elementId] =\n new google.visualization.LineChart(document.getElementById(elementId));\n }\n\n // TODO(vmarmol): Look into changing the view window to get a smoother\n // animation.\n var opts = {\n curveType: 'function',\n height: 300,\n legend: {position: 'none'},\n focusTarget: 'category',\n vAxis: {\n title: unit,\n viewWindow: {\n min: minWindow,\n }\n },\n legend: {\n position: 'bottom'\n }\n };\n // If the whole data series has the same value, try to center it in the chart.\n if (min == max) {\n opts.vAxis.viewWindow.max = 1.1 * max;\n opts.vAxis.viewWindow.min = 0.9 * max;\n }\n\n window.charts[elementId].draw(dataTable, opts);\n}", "title": "" }, { "docid": "fb48b1d6ae11cef608d45b23fab6a47c", "score": "0.6020074", "text": "function ClientSideLineChart(points, xlabel, ylabel, title, elementid) {\n for (var i = 0; i < points.length; i++) {\n points[i][1] = parseFloat(points[i][1]);\n }\n var plot2 = $.jqplot(elementid, [points], {\n title: title,\n axes: {\n xaxis: {\n renderer: $.jqplot.DateAxisRenderer,\n label: xlabel,\n labelRenderer: $.jqplot.CanvasAxisLabelRenderer,\n tickRenderer: $.jqplot.CanvasAxisTickRenderer,\n tickOptions: {\n angle: -40,\n fontSize: '9pt'\n }\n },\n yaxis: {\n label: ylabel,\n labelRenderer: $.jqplot.CanvasAxisLabelRenderer\n }\n }\n });\n}", "title": "" }, { "docid": "f2aecdf21759c5636f0c93ffbce0c81c", "score": "0.6013745", "text": "addData(data) {\n let dataPoints = [];\n for (let i = 0; i < data.length; i++) {\n dataPoints.push({\n x: new Date(data[i].timestamp),\n y: Number(data[i].temperature),\n });\n }\n return dataPoints;\n }", "title": "" }, { "docid": "62216ba70e112ffa730aef45c93bf6b4", "score": "0.6007777", "text": "function DataForWeekChart() {\n if (dd > 6) {\n for (var i = dd; i > parseInt(dd) - 7; i--) {\n if (isNaN(localStorage.getItem(\"TodayCostNum\" + i + mm + yyyy)) ||\n localStorage.getItem(\"TodayCostNum\" + i + mm + yyyy) == '' ||\n localStorage.getItem(\"TodayCostNum\" + i + mm + yyyy) == null\n ) {\n }\n else {\n tempArray = Array();\n tempArray.push(i + \"-\" + month[mm] + \"-\" + yy);\n var sdf = 1.11;\n sdf = parseFloat(localStorage.getItem(\"TodayCostNum\" + i + mm + yyyy)).toFixed(2);\n tempArray.push(parseFloat(sdf));\n dataForYearChartLineWeek.push(tempArray);\n\n }\n }\n }\n else {\n var different = 7 - dd;\n\n for (var i = 1; i < parseInt(dd) + 1; i++) {\n if (isNaN(localStorage.getItem(\"TodayCostNum\" + i + mm + yyyy)) ||\n localStorage.getItem(\"TodayCostNum\" + i + mm + yyyy) == '' ||\n localStorage.getItem(\"TodayCostNum\" + i + mm + yyyy) == null\n ) {\n }\n else {\n tempArray = Array();\n tempArray.push(i + \"-\" + month[mm] + \"-\" + yy);\n var sdf = 1.11;\n sdf = parseFloat(localStorage.getItem(\"TodayCostNum\" + i + mm + yyyy)).toFixed(2);\n tempArray.push(parseFloat(sdf));\n dataForYearChartLineWeek.push(tempArray);\n }\n }\n //console.log(dataForYearChartLine);\n var prevMonth;\n var prevYear;\n var prevYearShort;\n if (mm == 1) {\n prevYear = yyyy - 1;\n prevYearShort = yy - 1;\n prevMonth = 12;\n }\n else {\n prevYear = yyyy;\n prevYearShort = yy;\n prevMonth = mm - 1;\n }\n\n var d = new Date(prevYear, prevMonth, 0);\n\n for (var i = d.getDate() ; i > parseInt(d.getDate()) - different; i--) {\n if (isNaN(localStorage.getItem(\"TodayCostNum\" + i + prevMonth + prevYear)) ||\n localStorage.getItem(\"TodayCostNum\" + i + prevMonth + prevYear) == '' ||\n localStorage.getItem(\"TodayCostNum\" + i + prevMonth + prevYear) == null\n ) {\n }\n else {\n tempArray = Array();\n tempArray.push(i + \"-\" + month[prevMonth] + \"-\" + prevYearShort);\n var sdf = 1.11;\n sdf = parseFloat(localStorage.getItem(\"TodayCostNum\" + i + prevMonth + prevYear)).toFixed(2);\n tempArray.push(parseFloat(sdf));\n dataForYearChartLineWeek.push(tempArray);\n }\n }\n }\n\n}", "title": "" }, { "docid": "6e2028a6b28566aa0776a3dd9d4af97a", "score": "0.6002893", "text": "function historyDataToKline(datas) {\n startTime = datas[0].date;\n // startTime = startTime - startTime%60\n start = timestampToDate(startTime);\n open = datas[0].rate;\n close = open;\n high = open;\n low = open;\n volume = [];\n historydata = [];\n let v = 0;\n let i = 0;\n for (let trade of datas) {\n\n if (trade.date > startTime + timeSpan) {\n historydata.push([start, open, close, low, high]);\n volume.push(v);\n startTime = trade.date;\n start = timestampToDate(startTime);\n open = trade.rate;\n high = open;\n low = open;\n v = 0;\n i++;\n }\n\n if (trade.rate > high)\n high = trade.rate;\n else if (trade.rate < low)\n low = trade.rate;\n close = trade.rate;\n v += parseFloat(trade.amount)\n\n }\n\n historydata.push([start, open, close, low, high])\n\n}", "title": "" }, { "docid": "6293d5268f26f96473ca60f360294215", "score": "0.5989136", "text": "getChartData() {\n const { chartData } = this.props;\n let dates = [];\n let hours = [];\n let events = [];\n\n chartData.forEach(item => {\n if (item.hour) {\n hours.push(item.hour);\n this.setState({\n hours: hours,\n chartTitle: 'Hourly Events'\n });\n }\n else {\n this.setState({\n chartTitle: 'Daily Events'\n });\n }\n\n dates.push(item.date);\n events.push(item.events);\n \n this.setState({\n dates: dates,\n events: events, \n });\n });\n }", "title": "" }, { "docid": "82cd755662d5227bc8e2b174b9e92a25", "score": "0.5974557", "text": "function SUPERCHART(){\n if(dataURL.get(\"drawing\")){\n return\n }\n if($(\"#container-lastweek\").length>0 && $(\".mp-pushed\").length>0 && $(\".clock\").length==0){\n $(\".loading-data.page-level\").show();\n }\n dataURL.set(\"drawing\",true)\n \n var path = dataURL.get('paths'),\n d = '',\n uri_persons = dataURL.get('persons'),\n uri_category = dataURL.get('category') || 'total_usage',\n uri_users = dataURL.get('group') || '';\n \n uri_persons='/'+uri_persons;\n uri_category+='/';\n \n if(uri_users[0] && uri_users[0].length>0){\n uri_users=encodeURI(uri_users[0]);\n uri_users='/'+uri_users;\n }\n \n if(uri_users!==''){\n uri_persons='';\n }\n \n var $container = $('#container'),\n seriesOptions = [],\n yAxisOptions = [],\n seriesCounter = 0,\n enableLegend =false,\n names = dataURL.get('names'),\n colors= ['#FB715E','#7994FF','#5AA689','#FFD340','#796499'],\n uri_root = '/',\n start_date = dataURL.get('start'),\n end_date = dataURL.get('end'),\n date_range = '/'+formatDate(start_date)+'/'+formatDate(end_date)+'/',\n campus_tag = dataURL.get('campus') || '',\n distinct = dataURL.get('distinct') || false,\n distinct_tag = \"\";\n \n if(campus_tag!='' && campus_tag[0].length>0 ){\n campus_tag=\"/\"+campus_tag[0];\n uri_category=\"on_off_campus/\";\n }\n \n if(distinct){\n distinct_tag = \"?distinct=True\";\n }\n \n var total_sum = 0,\n distinct_sum = 0;\n \n $.each(names, function(i, name) {\n var jsonURL = uri_root+uri_category+path[i]+uri_persons+uri_users+campus_tag+date_range+distinct_tag;\n \n // console.log(jsonURL);\n\n var json = $.getJSON(jsonURL)\n \n json.done(function(data){\n total_sum += parseInt(data.total);\n distinct_sum += parseInt(data.distinct);\n \n if(data.data.length>0){\n jsonResponse(data)\n }\n else {\n data.data.push([(new Date).getTime(),0]);\n console.log(data.meta.library+\" is empty.\")\n jsonResponse(data)\n }\n })\n \n json.fail(function(){\n console.log('Error: JSON Ajax function failed.')\n var $error = $('<div/>').attr({'class':'error-loading'}).append('<span/>').html(\"<p>Sorry, the data failed to load from the server.</p>\");\n $container.html($error);\n $error.fadeOut(0).fadeIn(500);\n $(\".loading-data.page-level\").hide()\n dataURL.set(\"drawing\",\"\")\n });\n \n function jsonResponse(data) {\n d = data;\n if(data.data !== undefined){\n d = data.data;\n }\n else{\n d = data;\n }\n \n var color = colors[i];\n \n if(name=='Woodruff'){\n color='#FB715E';\n }\n if(name=='Law'){\n color='#7994FF';\n }\n if(name=='Health Sciences'||name=='Health Science'){\n color='#5AA689';\n }\n \n seriesOptions[i] = {\n name: name,\n id: name,\n data: d,\n color:color,\n fillColor : {\n linearGradient : {\n x1: 0, \n y1: 0, \n x2: 0, \n y2: 1\n },\n stops : [\n [0, 'rgb(65, 73, 85)'], \n [1, 'rgb(65, 73, 85)']\n ]\n },\n pointInterval: 36 * 1000\n };\n \n // As we're loading the data asynchronously, we don't know what order it will arrive. So\n // we keep a counter and create the chart when all the data is loaded.\n seriesCounter++;\n \n if (seriesCounter == names.length) {\n // console.log(seriesCounter)\n // Timeline Events are possible!\n // seriesOptions.push(\n // {\n // name : \"Flaged Events\", \n // color: '#999',\n // type : 'flags',\n // data : [\n // {\n // x : 1405536180000, // Point where the flag appears\n // title : 'Timeline Event 1', // Title of flag displayed on the chart \n // text : 'Description for timeline event.' // Text displayed when the flag are highlighted.\n // },\n // {\n // x : 1407272940000, // Point where the flag appears\n // title : 'Timeline Event 2', // Title of flag displayed on the chart \n // text : 'Description for timeline event.' // Text displayed when the flag are highlighted.\n // }\n // ],\n // onSeries : '', // Id of which series it should be placed on. If not defined \n // // the flag series will be put on the X axis\n // shape : 'flag' // Defines the shape of the flags.\n // });\n \n function duration(number){\n var upper_limit = 2500;\n var lower_limit = 550;\n number = (number/10);\n if(number > upper_limit){\n number = upper_limit\n }\n else if(number < lower_limit){\n number = lower_limit;\n }\n return number;\n }\n var comma_separator_number_step = $.animateNumber.numberStepFactories.separator(',')\n $(\".visitor-count .total .number\").animateNumber({ number: total_sum,easing: 'easeInQuad',numberStep: comma_separator_number_step },duration(total_sum));\n $(\".visitor-count .distinct .number\").animateNumber({ number: distinct_sum, easing: 'easeInQuad',numberStep: comma_separator_number_step },duration(distinct_sum));\n \n drawChart(seriesOptions);\n drawChartLastWeek(seriesOptions);\n $(\".visitor-count\").css({\"opacity\":1})\n $(\".loading-data.page-level\").hide();\n dataURL.set(\"drawing\",false)\n }\n }\n \n function drawChartLastWeek(data){\n var $container = $('#container-lastweek'),\n enableLegend = (data.length > 1 ? true : false);\n Highcharts.setOptions({\n global: {\n useUTC: false\n }\n });\n $container.highcharts('StockChart', {\n chart:{\n backgroundColor:'transparent',\n type:'column'\n },\n rangeSelector: {\n buttons: [{\n type: 'day',\n count: 1,\n text: '1d'\n },{\n type: 'day',\n count: 3,\n text: '3d'\n },{\n type: 'week',\n count: 1,\n text: '1w'\n }],\n selected: 0,\n },\n \n yAxis: {\n labels: {\n formatter: function() {\n return (this.value < 0 ? '-' : '') + Highcharts.numberFormat(this.value, 0);;\n }\n },\n floor:0\n },\n navigator : {\n enabled : false\n },\n scrollbar : {\n enabled : false\n },\n plotOptions: {\n series: {\n compare: undefined, //value, percent\n dataGrouping:{\n approximation:'sum',\n smoothed:false,\n forced:true,\n units: [ ['hour', [1]] ] \n }\n }\n },\n navigation: {\n buttonOptions: {\n theme: {\n 'stroke-width': 0,\n stroke: \"#DCDEE5\",\n r: 3,\n style:{\n 'cursor':\"pointer\"\n },\n states: {\n hover: {\n fill: '#DCDEE5'\n },\n select: {\n stroke: '#DCDEE5',\n fill: '#DCDEE5'\n }\n }\n }\n }\n },\n legend: {\n enabled: enableLegend,\n },\n tooltip: {\n pointFormat: '<span style=\"color:{series.color}\">{series.name}</span>: <b>{point.y} visitors</b><br/>',\n changeDecimals: 2,\n valueDecimals: 0\n },\n inputEnabled:false,\n inputDateFormat: '%H:%M:%S.%L',\n inputEditDateFormat: '%H:%M:%S.%L',\n // Custom parser to parse the %H:%M:%S.%L format\n inputDateParser: function(value) {\n value = value.split(/[:\\.]/);\n return Date.UTC(\n 1970, \n 0, \n 1, \n parseInt(value[0]),\n parseInt(value[1]),\n parseInt(value[2]),\n parseInt(value[3])\n );\n },\n \n title: {\n text: '',\n floating: true\n },\n \n xAxis: {\n tickPixelInterval: 120,\n type: 'datetime',\n dateTimeLabelFormats : {\n hour: '%I %p',\n minute: '%I:%M %p'\n },\n },\n series: data\n }, function(chart) {\n // apply the date pickers\n setTimeout(function(){\n if(chart && chart.options.chart){\n setDatepickerPosition(chart);\n }\n },0)\n });//end highcharts\n }//end drawChartLastWeek\n \n function drawChart(data){\n var $container= $('#container'),\n enableLegend = (data.length > 1 ? true : false);\n Highcharts.setOptions({\n global: {\n useUTC: false\n }\n });\n $container.highcharts('StockChart', {\n chart:{\n backgroundColor:'transparent'\n },\n rangeSelector: {\n buttons: [{\n type: 'week',\n count: 1,\n text: '1w'\n }, {\n type: 'month',\n count: 1,\n text: '1m'\n }, {\n type: 'month',\n count: 3,\n text: '3m'\n }, {\n type: 'month',\n count: 6,\n text: '6m'\n }, {\n type: 'ytd',\n text: 'YTD'\n }, {\n type: 'year',\n count: 1,\n text: '1y'\n }, {\n type: 'all',\n text: 'All'\n }],\n selected: 6,\n inputDateFormat: '%b %e %Y',\n inputEditDateFormat: '%Y-%m-%d' \n },\n \n yAxis: {\n labels: {\n formatter: function() {\n return (this.value < 0 ? '-' : '') + Highcharts.numberFormat(this.value, 0);;\n }\n },\n floor:0\n },\n legend: {\n enabled: enableLegend,\n },\n plotOptions: {\n series: {\n compare: undefined, //value, percent\n dataGrouping:{\n approximation:'sum',\n smoothed:false,\n forced:false,\n groupPixelWidth:300,\n units: [ ['minute',[15]],['hour', [1]],['day',[1]] ]\n },\n \n }\n },\n navigation: {\n buttonOptions: {\n theme: {\n 'stroke-width': 0,\n stroke: \"#DCDEE5\",\n r: 3,\n style:{\n 'cursor':\"pointer\"\n },\n states: {\n hover: {\n fill: '#DCDEE5'\n },\n select: {\n stroke: '#DCDEE5',\n fill: '#DCDEE5'\n }\n }\n }\n }\n },\n tooltip: {\n pointFormat: '<span style=\"color:{series.color}\">{series.name}</span>: <b>{point.y} visitors</b><br/>',\n changeDecimals: 2,\n valueDecimals: 0\n },\n \n title: {\n text: '',\n floating: true\n },\n \n xAxis: {\n tickPixelInterval: 120,\n type: 'datetime',\n dateTimeLabelFormats : {\n hour: '%I %p',\n minute: '%I:%M %p'\n },\n },\n series: data\n }, function(chart) {\n // apply the date pickers\n setTimeout(function(){\n setDatepickerPosition(chart)\n },0)\n });//end highcharts\n }//end drawChart\n \n })//end $.each\n}//end SUPERCHART", "title": "" }, { "docid": "6ae5bb1e005b93772c018498dbf06139", "score": "0.59678596", "text": "function setChartData(data) {\n const DAYS_COUNT = 7; // Days Count to show\n const timePeriods = data.length; // 7 days * 24 horus = data.count = timePeriods\n let filterdData, revMyArr;\n\n //One Value Per Day\n filterdData = data.filter((d, idx) => {\n return idx === 0 || ((idx + 1) % Math.floor(timePeriods / DAYS_COUNT) === 0)\n });\n\n return filterdData.map((d, idx) => {\n let ms = Date.now();\n let date = new Date(ms - (idx * MS_PER_DAY));\n\n let [s, mon, day] = date.toDateString().split(\" \");\n\n return {\n name: s + \", \" + mon + \" \" + day,\n uv: d\n }\n })\n}", "title": "" }, { "docid": "9aa83ab41ed5aebf14450a64a045d2c3", "score": "0.5952399", "text": "function extendCompletedSPChart(dataSet) {\r\n var count = dataSet.length;\r\n\r\n //next date\r\n var nextDate = new Date().getTime();\r\n\r\n dataSet.push({ x: nextDate, y: dataSet[count - 1].y });\r\n}", "title": "" }, { "docid": "80ddff8bbc4e5e9150cc7d443a3a93e0", "score": "0.59469414", "text": "function prepData(rawData) {\n // Create two empty arrays for x and y values\n\t\t\tvar x = [];\n\t\t\tvar y = [];\n // Loop through the raw data and extract the x and y values\n\t\t\trawData.forEach(function(datum) {\n //console.log(datum);\n\t\t\t\tx.push(new Date(datum['Time']));\n\t\t\t\ty.push(datum['Value']);\n\t\t\t});\n // Return the arrays, combined with formatting\n\t\t\treturn [{\n\t\t\t\tmode: 'lines',\n\t\t\t\tx: x,\n\t\t\t\ty: y,\n line: {\n color: scope.config.seriesColor\n }\n\t\t\t}];\n\t\t}", "title": "" }, { "docid": "9524b9915863aa21b5a1cb49b595368f", "score": "0.5945699", "text": "function makeLineChart(category, value, data) {\n return AmCharts.makeChart(\"line-chart-div\", {\n \"type\": \"serial\",\n \"theme\": \"blur\",\n \"marginRight\": 40,\n \"marginLeft\": 40,\n \"autoMarginOffset\": 20,\n \"mouseWheelZoomEnabled\":true,\n \"dataDateFormat\": \"YYYY-MM-DD\",\n \"valueAxes\": [{\n \"id\": \"v1\",\n \"axisAlpha\": 0,\n \"position\": \"left\",\n \"ignoreAxisWidth\":true,\n useScientificNotation: true,\n }],\n \"balloon\": {\n \"borderThickness\": 3,\n \"shadowAlpha\": 1\n },\n \"graphs\": [{\n \"id\": \"g1\",\n \"balloonFunction\": function (item) {\n return getBalloonText(item);\n },\n \"balloon\":{\n \"drop\":true,\n \"adjustBorderColor\":false,\n \"color\":\"#ff0c03\"\n },\n \"bullet\": \"round\",\n \"bulletBorderAlpha\": 1,\n \"bulletColor\": \"#ff0a13\",\n \"bulletSize\": 8,\n \"hideBulletsCount\": 50,\n \"lineThickness\": 2,\n \"title\": \"red line\",\n \"lineColor\": \"#d1655d\",\n \"type\": \"smoothedLine\",\n \"useLineColorForBulletBorder\": true,\n \"valueField\": value\n }],\n \"chartScrollbar\": {\n \"graph\": \"g1\",\n \"oppositeAxis\":false,\n \"gridAlpha\":0,\n \"offset\":30,\n \"scrollbarHeight\": 80,\n \"backgroundAlpha\": 0,\n \"selectedBackgroundAlpha\": 0.1,\n \"selectedBackgroundColor\": \"#888888\",\n \"graphFillAlpha\": 0,\n \"graphLineAlpha\": 0.5,\n \"selectedGraphFillAlpha\": 0,\n \"selectedGraphLineAlpha\": 1,\n \"graphLineColor\":\"#42a2c2\",\n \"selectedGraphLineColor\":\"#2e886c\",\n \"autoGridCount\":true,\n \"color\":\"#193c88\"\n },\n \"chartCursor\": {\n \"categoryBalloonDateFormat\": \"YYYY\",\n \"valueLineEnabled\": true,\n \"valueLineBalloonEnabled\": true,\n \"cursorAlpha\":0,\n \"valueLineAlpha\":0.5,\n fullWidth: true\n },\n \"valueScrollbar\":{\n \"oppositeAxis\":false,\n \"offset\":50,\n \"scrollbarHeight\":10\n },\n \"categoryField\": category,\n \"categoryAxis\": {\n \"parseDates\": true,\n \"dashLength\": 1,\n \"minorGridAlpha\": 0.1,\n \"minorGridEnabled\": true\n },\n \"export\": {\n \"enabled\": true\n },\n \"dataProvider\": data,\n });\n }", "title": "" }, { "docid": "a30e96c4cb70c1636da069babdb557c7", "score": "0.5938545", "text": "function generateIDChartData(stock_data) {\n\n var lastTradingDate = new Date(stock_data[0].date);\n lastTradingDate.setHours(0, 0, 0, 0);\n\n\n for (var i = 0; i < stock_data.length; i++) { // data comes from AIX on a one-minute interval\n \n var newTime=new Date(lastTradingDate); // Creating the new date using last trading date\n var HrMin=stock_data[i].minute.split(\":\");\n newTime.setHours(parseInt(HrMin[0]),parseInt(HrMin[1]),0,0);\n \n chartData.push({\n date: newTime, // date\n value: stock_data[i].average, // average price during minute\n volume: stock_data[i].volume // volume during minute\n });\n }\n} // last line of generateIDChartData function", "title": "" }, { "docid": "6e2eb79df99faf88990f93b17fd1a7cf", "score": "0.5926007", "text": "function add_to_linear_chart(country,color,cases_data,cObject){\n new_data = []\n new_labels = []\n\n for(i=0;i< cases_data.x.length;i++){\n new_data.push({\n x: i,\n y: parseInt(cases_data.y[i])\n })\n\n new_labels.push(i)\n }\n\n\n var new_dataset = {\n data: new_data,\n label:country,\n backgroundColor: color,\n borderColor: color,\n showLine:true,\n //pointRadius: 0,\n fill: false,\n showLine: true\n\n }\n if(cObject.data.labels.length < new_labels.length){\n cObject.data.labels = new_labels\n }\n\n cObject.data.datasets.push(new_dataset)\n\n cObject.update()\n}", "title": "" }, { "docid": "2f0c7547d061cee9563ca6b25f79d481", "score": "0.5920783", "text": "function vergleichChartData(arr) {\n var years = [];\n var dayMonth = [];\n var feld = [];\n var user = [];\n\n for (let i = 0; i < arr.length; i++) {\n if (arr !== undefined) {\n const year = new Date(arr[i][0]['datum']);\n for (let j = 0; j < arr[i].length; j++) {\n const el2 = arr[i][j]['datum'];\n const el3 = arr[i][j]['userProTag'];\n const el4 = arr[i][j]['gesamtFelder'];\n dayMonth.push(new Date(el2).getDate());\n user.push(el3);\n feld.push(el4);\n }\n\n years.push([year.getFullYear(), user.reverse(), feld.reverse(), dayMonth.reverse()]);\n dayMonth = [];\n feld = [];\n user = [];\n years.reverse();\n } else {\n i++;\n }\n }\n\n var l = [];\n var a = [];\n var z = [];\n var colors = ['red', 'green', 'blue', 'yellow', 'orange', 'purple', 'pink', 'gray'];\n for (let index = 0; index < years.length; index++) {\n a[index] = {\n label: years[index][0],//////\n fill: false,\n lineTension: 0.5,\n data: years[index][1],//////\n backgroundColor: '#fff',\n borderColor: colors[index],//////\n borderCapStyle: 'round',\n borderDashOffset: 0.5,\n borderjoinStyle: 'round'\n }\n z[index] = {\n label: years[index][0],//////\n fill: false,\n lineTension: 0.5,\n data: years[index][2],//////\n backgroundColor: '#fff',\n borderColor: colors[index],//////\n borderCapStyle: 'round',\n borderDashOffset: 0.5,\n borderjoinStyle: 'round'\n }\n l = years[0][3];\n };\n\n\n //Aktion Vergleichen Chart 1\n var line = document.getElementById('myChartNutzer')\n var lineChart1 = new Chart(line, {\n type: 'line',\n data: {\n labels: l,\n datasets: a,\n },\n options: {\n scales: {\n xAxes: [{\n gridLines: {\n color: \"rgba(0, 0, 0, 0)\",\n }\n }],\n yAxes: [{\n gridLines: {\n color: \"rgba(0, 0, 0, 0)\",\n }\n }]\n }\n }\n });\n var line = document.getElementById('myChartFelder')\n var lineChart2 = new Chart(line, {\n type: 'line',\n data: {\n labels: l,\n datasets: z,\n },\n options: {\n scales: {\n xAxes: [{\n gridLines: {\n color: \"rgba(0, 0, 0, 0)\",\n }\n }],\n yAxes: [{\n gridLines: {\n color: \"rgba(0, 0, 0, 0)\",\n }\n }]\n }\n }\n\n\n });\n}", "title": "" }, { "docid": "70b898328e5bbd861c103fd4921d129e", "score": "0.5906586", "text": "function createLineChart(elemId, dataSeries, labels, title) {\r\n // DOM element to hold chart\r\n var CHART = document.getElementById(elemId).getContext('2d');\r\n\r\n // Create chart\r\n var lineChart = new Chart(CHART, {\r\n type: 'line',\r\n data: {\r\n labels: labels,\r\n datasets: [{\r\n data: dataSeries[0],\r\n label: \"Monday\",\r\n borderColor: \"#244dff\",\r\n fill: false\r\n }, {\r\n data: dataSeries[1],\r\n label: \"Tuesday\",\r\n borderColor: \"#8e5ea2\",\r\n fill: false\r\n }, {\r\n data: dataSeries[2],\r\n label: \"Wednesday\",\r\n borderColor: \"#17ffab\",\r\n fill: false\r\n }, {\r\n data: dataSeries[3],\r\n label: \"Thursday\",\r\n borderColor: \"#64fc7c\",\r\n fill: false\r\n }, {\r\n data: dataSeries[4],\r\n label: \"Friday\",\r\n borderColor: \"#ff3d4f\",\r\n fill: false\r\n }, {\r\n data: dataSeries[5],\r\n label: \"Saturday\",\r\n borderColor: \"#ff38a4\",\r\n fill: false\r\n }, {\r\n data: dataSeries[6],\r\n label: \"Sunday\",\r\n borderColor: \"#3e95cd\",\r\n fill: false\r\n }\r\n ]\r\n },\r\n options:{\r\n title: {\r\n display: true,\r\n text: title\r\n },\r\n legend: {\r\n display: true,\r\n position: 'bottom',\r\n labels: {\r\n boxWidth: 10,\r\n fontColor: 'black'\r\n }\r\n }\r\n }\r\n\r\n });\r\n\r\n return lineChart;\r\n}", "title": "" }, { "docid": "571176e28d70ad549be3dca777d137b4", "score": "0.5905075", "text": "function getValuesForClient(data, type){\n var dataForClient = [], timestamp = [], dataContent = [], description = [], lastInsertedIndex = 0, lastTimestamp = '', lastValue = '', numberElementsInserted = 0;\n for (var dataArray, index = 0; index < data.length; index++) {\n dataArray = (type=='areaChart') ? [numberElementsInserted, data[index].y] : {x:numberElementsInserted, y:data[index].y};\n if (lastTimestamp != data[index].x ) { //dont insert repeated data\n dataContent.push(dataArray);\n timestamp.push(data[index].x);\n description.push(data[index].xvalues);\n lastTimestamp = data[index].x;\n lastValue = data[index].y;\n lastInsertedIndex = description.length-1;\n numberElementsInserted++;\n }else {\n description[lastInsertedIndex] += ' </br> ' + data[index].xvalues;\n lastValue = data[index].y;\n }\n }\n dataForClient.push(timestamp);\n dataForClient.push(dataContent);\n dataForClient.push(description);\n return dataForClient;\n}", "title": "" }, { "docid": "780ce62195443d185e9a6ed66486d973", "score": "0.5904459", "text": "function drawCharts(data){\n // if there is no data\n if(data.Count === 0) {\n console.log(\"No data on this day\");\n alert(\"No data on this day\");\n return;\n }\n\n //process data for the pie\n var pieProcessed = getPieData(data);\n console.log(pieProcessed);\n drawPies(pieProcessed);\n //process data for the line\n var processed = getLineData(data);\n var labelArr = processed[0];\n var dataArr = processed[1];\n //draw graph based on the data\n drawLines(labelArr, dataArr);\n\n}", "title": "" }, { "docid": "877d6a4ce15f7269662efd93839ab7ee", "score": "0.5897994", "text": "function generateChartData() {\n //var dss = new Date(arrayDateStart[1]+\"-\"+arrayDateStart[2]+\"-\"+arrayDateStart[0]);\n var chartData = [];\n //var firstDate = new Date();\n //firstDate.setDate(firstDate.getDate() - 100);\n var cadena=\"\";\n var newDate;\n for (var i = 0; i < sizeRange; i++) {\n // ne naegador safari al mes de se le quita 1 yaque safari lo aumenta en el mes .\n // var newDate = new Date(arrayDateStart[0], arrayDateStart[1] - 1, arrayDateStart[2]);\n // newDate.setDate(newDate.getDate() + i);\n cadena=arrayDateStart[i];\n newDate = new Date(cadena);\n newDate.setDate(newDate.getDate()+1);\n chartData.push({\n date: newDate,\n visits: array1[i],\n hits: array2[i],\n views: array3[i],\n totalGoal: array4[i]\n });\n }\n \n return chartData;\n }", "title": "" }, { "docid": "9947a46d69e2c4696e05283fb2086d88", "score": "0.58822656", "text": "function generateChartData() {\n\t\t\t\t\t\t\t\tvar chartData = [];\n\t\t\t\t\t\t\t /* var firstDate = new Date();\n\t\t\t\t\t\t\t\tfirstDate.setDate(firstDate.getDate() - 100);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tfor (var i = 0; i < 100; i++) {\n\t\t\t\t\t\t\t\t\t// we create date objects here. In your data, you can have date strings\n\t\t\t\t\t\t\t\t\t// and then set format of your dates using chart.dataDateFormat property,\n\t\t\t\t\t\t\t\t\t// however when possible, use date objects, as this will speed up chart rendering.\n\t\t\t\t\t\t\t\t\tvar newDate = new Date(firstDate);\n\t\t\t\t\t\t\t\t\tnewDate.setDate(newDate.getDate() + i);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tvar visits = Math.round(Math.sin(i * 5) * i);\n\t\t\t\t\t\t\t\t\tvar hits = Math.round(Math.random() * 80) + 500 + i * 3;\n\t\t\t\t\t\t\t\t\tvar views = Math.round(Math.random() * 6000) + i * 4;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tchartData.push({\n\t\t\t\t\t\t\t\t\t\tdate: newDate,\n\t\t\t\t\t\t\t\t\t\tvisits: visits,\n\t\t\t\t\t\t\t\t\t\thits: hits,\n\t\t\t\t\t\t\t\t\t\tviews: views,\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\tvar data = jQuery.parseJSON(getvalueCHART().responseText);\n\t\t\t\t\t\t\t\tvar res = [];\n\t\t\t\t\t\t\t\tfor (var i = 1; i < data.length; ++i){\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tvar date = data[i].date;\n\t\t\t\t\t\t\t\t\tchartData.push({'date':date,'cbot': parseFloat(data[i].cbot).toFixed(2),'q_net':parseFloat(data[i].q_net/1000000).toFixed(2)/*,'q_short':parseFloat(data[i].q_short/1000000).toFixed(2),'q_long':parseFloat(data[i].q_long/1000000).toFixed(2)*/})\n\t\t\t\t\t\t\t\t\t//if (i==(data.length-1)) { last_new = data[i].close; time_new = data[i].date}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn chartData;\n\t\t\t\t\t\t\t}", "title": "" }, { "docid": "626248db7b96eadb26a0d84537e3821f", "score": "0.5880175", "text": "function SetUpHighCharts(splineDataset) {\n\tconsole.log('spline json loaded');\n\n function CreateXAxis(){\n return {\n type: 'datetime',\n tickInterval: 3600 * 1000,\n labels: {\n formatter: function () {\n return Highcharts.dateFormat('%d-%m-%Y', new Date(this.value*1000));\n }\n }\n };\n };\n\n function CreateSplineSeries(){\n return [{\n showInLegend : false,\n data : splineDataset.utcString\n }]\n }; \n\n var SplineHighchartObj = function () {\n this.chart = {\n type: 'spline'\n };//for spline with irregular data\n\n this.title = {\n text: 'Daily Walked Distance',\n x: -20 //center\n };\n\n this.xAxis = {};\n\n this.yAxis = {\n title: {\n text: 'Distance (Km)'\n },\n plotLines: [{\n value: 0,\n width: 1,\n color: '#808080'\n }]\n };\n\n this.tooltip = { \n formatter: function(){\n return \"<b>\" + Highcharts.dateFormat('%d-%m-%Y', this.x*1000) + \"</b><br/>\" + this.y + \" km\"\n } \n };\n\n this.legend = {\n layout: 'vertical',\n align: 'right',\n verticalAlign: 'middle',\n borderWidth: 0\n };\n\n this.series = {};\n };\n\n var splineChart = new SplineHighchartObj();\n splineChart.xAxis = CreateXAxis();\n splineChart.series = CreateSplineSeries();\n\n return splineChart;\n}", "title": "" }, { "docid": "b4ed1a5d2ebe2124d45870763242884d", "score": "0.587622", "text": "function DataForMonthChart() {\n if (dd > 30) {\n for (var i = dd; i > parseInt(dd) - 30; i--) {\n if (isNaN(localStorage.getItem(\"TodayCostNum\" + i + mm + yyyy)) ||\n localStorage.getItem(\"TodayCostNum\" + i + mm + yyyy) == '' ||\n localStorage.getItem(\"TodayCostNum\" + i + mm + yyyy) == null\n ) {\n }\n else {\n tempArray = Array();\n tempArray.push(i + \"-\" + month[mm] + \"-\" + yy);\n var sdf = 1.11;\n sdf = parseFloat(localStorage.getItem(\"TodayCostNum\" + i + mm + yyyy)).toFixed(2);\n tempArray.push(parseFloat(sdf));\n dataForYearChartLineMonth.push(tempArray);\n\n }\n }\n }\n else {\n var different = 30 - dd;\n\n for (var i = 1; i < parseInt(dd) + 1; i++) {\n if (isNaN(localStorage.getItem(\"TodayCostNum\" + i + mm + yyyy)) ||\n localStorage.getItem(\"TodayCostNum\" + i + mm + yyyy) == '' ||\n localStorage.getItem(\"TodayCostNum\" + i + mm + yyyy) == null\n ) {\n }\n else {\n tempArray = Array();\n tempArray.push(i + \"-\" + month[mm] + \"-\" + yy);\n var sdf = 1.11;\n sdf = parseFloat(localStorage.getItem(\"TodayCostNum\" + i + mm + yyyy)).toFixed(2);\n tempArray.push(parseFloat(sdf));\n dataForYearChartLineMonth.push(tempArray);\n }\n }\n //console.log(dataForYearChartLine);\n var prevMonth;\n var prevYear;\n var prevYearShort;\n if (mm == 1) {\n prevYear = yyyy - 1;\n prevYearShort = yy - 1;\n prevMonth = 12;\n }\n else {\n prevYear = yyyy;\n prevYearShort = yy;\n prevMonth = mm - 1;\n }\n\n var d = new Date(prevYear, prevMonth, 0);\n\n for (var i = d.getDate() ; i > parseInt(d.getDate()) - different; i--) {\n if (isNaN(localStorage.getItem(\"TodayCostNum\" + i + prevMonth + prevYear)) ||\n localStorage.getItem(\"TodayCostNum\" + i + prevMonth + prevYear) == '' ||\n localStorage.getItem(\"TodayCostNum\" + i + prevMonth + prevYear) == null\n ) {\n }\n else {\n tempArray = Array();\n tempArray.push(i + \"-\" + month[prevMonth] + \"-\" + prevYearShort);\n var sdf = 1.11;\n sdf = parseFloat(localStorage.getItem(\"TodayCostNum\" + i + prevMonth + prevYear)).toFixed(2);\n tempArray.push(parseFloat(sdf));\n dataForYearChartLineMonth.push(tempArray);\n }\n }\n }\n\n}", "title": "" }, { "docid": "faae82fde02c405784044b82458da556", "score": "0.58633184", "text": "function createGraph(dailyPrice) {\n\n function createGraphh() {\n\n let myChart = document.getElementById(\"myChart\").getContext('2d');\n let hour = dayjs().format('H')\n // let hour = dayjs().format('H')\n\n let yesterdaysDate = dayjs().subtract(4, 'day').format(\"YYYY-MM-DD\")\n console.log(yesterdaysDate);\n console.log(dailyPrice);\n\n //setting the hour to call the API per hour\n // let hour1 = yesterdaysDate + \" 05:00:00\"\n // let hour2 = yesterdaysDate + \" 06:00:00\"\n // let hour3 = yesterdaysDate + \" 07:00:00\"\n let hour4 = yesterdaysDate + \" 08:00:00\"\n let hour5 = yesterdaysDate + \" 09:00:00\"\n let hour6 = yesterdaysDate + \" 10:00:00\"\n let hour7 = yesterdaysDate + \" 11:00:00\"\n let hour8 = yesterdaysDate + \" 12:00:00\"\n let hour9 = yesterdaysDate + \" 13:00:00\"\n let hour10 = yesterdaysDate + \" 14:00:00\"\n let hour11 = yesterdaysDate + \" 15:00:00\"\n let hour12 = yesterdaysDate + \" 16:00:00\"\n let hour13 = yesterdaysDate + \" 17:00:00\"\n // let hour14 = yesterdaysDate + \" 18:00:00\"\n // let hour15 = yesterdaysDate + \" 19:00:00\"\n // let hour16 = yesterdaysDate + \" 20:00:00\"\n\n //the actual format for API call to store the time\n //after each variable, I round the number to two decimals by eliminating the 3rd and 4th decimal\n // let sixAM = dailyPrice[\"Time Series (60min)\"][hour1][\"4. close\"]\n // sixAM = sixAM.substring(0, sixAM.length - 2);\n // let sevenAM = dailyPrice[\"Time Series (60min)\"][hour2][\"4. close\"]\n // sevenAM = sevenAM.substring(0, sevenAM.length - 2);\n // let eightAM = dailyPrice[\"Time Series (60min)\"][hour3][\"4. close\"]\n // eightAM = eightAM.substring(0, eightAM.length - 2);\n let nineAM = dailyPrice[\"Time Series (60min)\"][hour4][\"4. close\"]\n nineAM = nineAM.substring(0, nineAM.length - 2);\n let tenAM = dailyPrice[\"Time Series (60min)\"][hour5][\"4. close\"]\n tenAM = tenAM.substring(0, tenAM.length - 2);\n let elevenAM = dailyPrice[\"Time Series (60min)\"][hour6][\"4. close\"]\n elevenAM = elevenAM.substring(0, elevenAM.length - 2);\n let twelvePM = dailyPrice[\"Time Series (60min)\"][hour7][\"4. close\"]\n twelvePM = twelvePM.substring(0, twelvePM.length - 2);\n let onePM = dailyPrice[\"Time Series (60min)\"][hour8][\"4. close\"]\n onePM = onePM.substring(0, onePM.length - 2);\n let twoPM = dailyPrice[\"Time Series (60min)\"][hour9][\"4. close\"]\n twoPM = twoPM.substring(0, twoPM.length - 2);\n let threePM = dailyPrice[\"Time Series (60min)\"][hour10][\"4. close\"]\n threePM = threePM.substring(0, threePM.length - 2);\n let fourPM = dailyPrice[\"Time Series (60min)\"][hour11][\"4. close\"]\n fourPM = fourPM.substring(0, fourPM.length - 2);\n let fivePM = dailyPrice[\"Time Series (60min)\"][hour12][\"4. close\"]\n fivePM = fivePM.substring(0, fivePM.length - 2);\n // let sixPM = dailyPrice[\"Time Series (60min)\"][hour13][\"4. close\"]\n // sixPM = sixPM.substring(0, sixPM.length - 2);\n // let sevenPM = dailyPrice[\"Time Series (60min)\"][hour14][\"4. close\"]\n // sevenPM = sevenPM.substring(0, sevenPM.length - 2);\n // let eightPM = dailyPrice[\"Time Series (60min)\"][hour15][\"4. close\"]\n // eightPM = eightPM.substring(0, eightPM.length - 2);\n // let ninePM = dailyPrice[\"Time Series (60min)\"][hour16][\"4. close\"]\n // ninePM = ninePM.substring(0, ninePM.length - 2);\n\n let stockPricingChart = new Chart(myChart, {\n type: 'line', //bar, horizontalbar, pie, line, doughnut, radar, polarArea\n data: {\n labels: ['9am', '10am', '11am', '12pm', '1pm', '2pm', '3pm', '4pm', '5pm'],\n datasets: [\n {\n label: 'Price',\n data: [nineAM, tenAM, elevenAM, onePM, twoPM, threePM, fourPM, fivePM],\n //old copy\n // data: [sixAM, sevenAM, eightAM, nineAM, tenAM, elevenAM, onePM, twoPM, threePM, fourPM, fivePM, sixPM, sevenPM, eightPM, ninePM],\n // backgroundColor: 'blue'\n backgroundColor: [\n 'rgba(46, 204, 113, 0.5)'\n ]\n }\n ]\n },\n options: {\n responsive: true,\n title: {\n display: true,\n text: dailyPrice[\"Meta Data\"][\"2. Symbol\"] + \": Yesterday's Price Movement\"\n\n },\n legend: {\n display: false,\n position: 'bottom'\n },\n drawOnChartArea: false,\n }\n })\n\n\n\n document.getElementById(\"myChart\").classList.remove(\"chart-hidden\")\n document.getElementById(\"myChart\").classList.add(\"chart-show\")\n\n let waypoint = new Waypoint({\n element: document.querySelector('#myChart'),\n handler: function () {\n anime({\n targets: '#myChart',\n easing: 'easeOutExpo',\n translateY: [100, 0],\n opacity: [0, 1],\n delay: 400,\n })\n this.destroy();\n },\n context: document.querySelector('#chartContainer'),\n offset: '100%',\n })\n\n\n //close function\n }\n\n createGraphh()\n}", "title": "" }, { "docid": "6daa1a6f9e0b879183bdde2d71447267", "score": "0.58570826", "text": "function buildHistoricalChart(dataHistorical) {\n let dataArray = [];\n let dateParser = d3.timeParse(\"%Y-%m-%d\");\n \n for (var row in dataHistorical) {\n dataArray.push({ 'date': dateParser(row), \n 'EUR_USD': parseFloat(dataHistorical[row]['USD']),\n 'EUR_GBP': parseFloat(dataHistorical[row]['GBP']),\n 'EUR_CAD': parseFloat(dataHistorical[row]['CAD']), \n 'EUR_AUD': parseFloat(dataHistorical[row]['AUD']),\n 'EUR_NZD': parseFloat(dataHistorical[row]['NZD'])\n });\n }\n \n dataArray.sort(function(a, b){return a.date - b.date;});\n\n var chartObj = makeMultiLineChart(\n dataArray, \n 'date', \n {\n 'USD': {column: 'EUR_USD'},\n 'GBP': {column: 'EUR_GBP'},\n 'CAD': {column: 'EUR_CAD'},\n 'AUD': {column: 'EUR_AUD'},\n 'NZD': {column: 'EUR_NZD'}\n }, \n {xAxis: 'Date', yAxis: 'Exchange Rate'});\n\n chartObj.bind(\"#hist-chart\");\n chartObj.render();\n}", "title": "" }, { "docid": "ae1a8dc67a75ad12b92c1736d0a75e92", "score": "0.5852439", "text": "function onChartLoad(sender) {\n var data = getData();\n sender.model.series[0].dataSource = data.Open;\n\tsender.model.series[0].xName = \"XValue\";\n\tsender.model.series[0].yName = \"YValue\";\n\tsender.model.series[1].dataSource = data.Close;\n\tsender.model.series[1].xName = \"XValue\";\n\tsender.model.series[1].yName = \"YValue\";\n\tsender.model.series[2].dataSource = data.OpenClose;\n\tsender.model.series[2].xName = \"XValue\";\n\tsender.model.series[2].yName = \"YValue\";\n \n}", "title": "" }, { "docid": "5cdf46584f332a8d327e77aa67c5c380", "score": "0.58517057", "text": "function sampleData() {\n window.setInterval(function () {\n\n getNewSeries(dataStromaufnahme, Date.now(), {\n min: 0.5,\n max: 3\n })\n getNewSeries(dataTemperatur, Date.now(), {\n min: 21,\n max: 23\n })\n\n if (count === 2) {\n getNewStromsensoren(dataStromsensoren)\n count = 0\n chartStromsensoren.updateSeries([{\n data: dataStromsensoren.slice()\n }])\n }\n count++\n\n chartStromaufnahme.updateSeries([{\n data: dataStromaufnahme.slice()\n }])\n\n\n chartTemperatur.updateSeries([{\n data: dataTemperatur.slice()\n }])\n\n }, 500)\n}", "title": "" }, { "docid": "eec562fa83da1b67a898834edc1ff373", "score": "0.5849298", "text": "drawLineChart(db, tipo){\r\n\r\n //Variabili\r\n const tempLineChart = DOM.elementStrings.lineChart;\r\n var style = getComputedStyle(document.body);\r\n\r\n var labels = []; //Array date\r\n //--------------------------------\r\n db.forEach(function(el){\r\n if(labels.indexOf(el.data) === -1) labels.push(el.data); \r\n });\r\n\r\n var dates = []; // Array quantità\r\n //--------------------------------\r\n labels.forEach(function(elem) {\r\n var num = 0;\r\n db.forEach(function(el){\r\n if (el.data === elem){\r\n num += parseInt(el[`${tipo}`]);\r\n }\r\n });\r\n \r\n dates.push(num); \r\n });\r\n \r\n var formattedDate = labels.map(function(el){\r\n var a = el.split('-');\r\n return `${a[2]}-${a[1]}-${a[0]}`;\r\n })\r\n \r\n //punta al canvas\r\n const lineChart = document.getElementById(tempLineChart);\r\n const myChart = lineChart.getContext('2d');\r\n\r\n //Define chart\r\n var massPopChart = new Chart(myChart, {\r\n type:'line',\r\n data: {\r\n labels: formattedDate,\r\n datasets: [{\r\n // label:'Daily report',\r\n data: dates,\r\n backgroundColor: 'transparent',\r\n borderColor: style.getPropertyValue('--grey'),\r\n borderWidth: 1,\r\n pointRadius: 1,\r\n pointHoverRadius: 10,\r\n pointHoverBorderWidth: 2\r\n \r\n }]\r\n },\r\n options: {\r\n maintainAspectRatio: false,\r\n responsive:true,\r\n title: {\r\n display: true,\r\n fontColor: style.getPropertyValue('--black'),\r\n text: `Andamento - ${tipo} - dal 24-2-2020`\r\n },\r\n scales: {\r\n yAxes: [{\r\n ticks: {\r\n // Include a dollar sign in the ticks\r\n callback: function(value) {\r\n return UTIL.numberWithCommas(value);\r\n }\r\n }\r\n }]\r\n },\r\n tooltips: { \r\n enabled: false,\r\n mode: 'index',\r\n intersect: false,\r\n custom: this.customTooltips\r\n }\r\n },\r\n layout: {\r\n padding:{\r\n left:2,\r\n right:2,\r\n bottom:0,\r\n top:0\r\n }\r\n } \r\n });\r\n\r\n }", "title": "" }, { "docid": "00c4cccc895ba3fcc1d1650253ad98a4", "score": "0.5846676", "text": "function processLineChart(dataRows) {\n // need to show:\n // for each account on the same graph:\n // the inputted finance data \n // horizontal line where finance goal is\n\n //WORKING code from chart sample\n var lineChartData = {\n labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],\n datasets: [{\n label: 'My First dataset',\n // borderColor: window.chartColors.red,\n // backgroundColor: window.chartColors.red,\n fill: false,\n data: [\n 1, 2, 3, 4, 5, 6, 7\n // randomScalingFactor(),\n // randomScalingFactor(),\n // randomScalingFactor(),\n // randomScalingFactor(),\n // randomScalingFactor(),\n // randomScalingFactor(),\n // randomScalingFactor()\n ],\n yAxisID: 'y-axis-1',\n }, {\n label: 'My Second dataset',\n // borderColor: window.chartColors.blue,\n // backgroundColor: window.chartColors.blue,\n fill: false,\n data: [\n 7, 6, 5, 4, 3, 2, 1\n // randomScalingFactor(),\n // randomScalingFactor(),\n // randomScalingFactor(),\n // randomScalingFactor(),\n // randomScalingFactor(),\n // randomScalingFactor(),\n // randomScalingFactor()\n ],\n yAxisID: 'y-axis-2'\n }]\n };\n}", "title": "" }, { "docid": "6f2784f4cbebef6680ef26af7f8e4f95", "score": "0.5845524", "text": "function launchHLinesChart(){\n\tvar t = [];\n\tvar q = $(\"#query\").val();\n\tvar sel = $('#default-graph-uri-visu').val();\n\n\t$.ajax({\n\t\turl : '${baseUri}/sparql',\n\t\ttype : 'GET',\n\t\tdata : {\n\t\t\t'default-graph-uri' : sel,\n\t\t\t'query' : q,\n\t\t},\n\t\tdataType : 'json',\n\t\terror : function(result, status, error){\n\t\t\tif(getLang()==\"EN\"){\n\t\t\t\talert(\"Failure to recovery parameters\");\n\t\t\t} else {\n\t\t\t\talert(\"Echec de récupération des paramètres\");\n\t\t\t}\n\t\t},\n\t\tsuccess : function(json, status){\n\t\t\tvar nVars = json.head.vars.length;\n\t\t\tvar varNames = [];\n\t\t\tif(json.results.bindings.length==0)\n\t\t\t\talert(\"no results to show\");\n\t\t\tif (nVars>1 || nVars<4){\n\t\t\t\t$.each(json.results.bindings, function(key, val) {\n\t\t\t\t\t// var d = {};\n\t\t\t\t\tvar temp = [];\n\t\t\t\t\t\t$.each(val, function(k, sub) {\n\t\t\t\t\t\t\tvarNames.push(k);\n\t\t\t\t\t\t\t$.each(sub, function(subK, subSub) {\n\t\t\t\t\t\t\t\tif(subK == \"value\"){\n\t\t\t\t\t\t\t\t\t// d[k] = subSub;\n\t\t\t\t\t\t\t\t\ttemp.push(subSub);\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t// t.push(d);\n\t\t\t\t\tt.push(temp);\n\t\t\t\t});\n\n\t\t\t\tconsole.log(t);\n\t\t\t\t\n\t\t\t\tvar tab = [];\n\t\t\t\tfor(var i=0; i<t[0].length; i++){\n\t\t\t\t\tvar d = {};\n\t\t\t\t\tvar v = [];\n\t\t\t\t\tfor(var j=0; j<t.length; j++){\n\t\t\t\t\t\tv.push(parseFloat(t[j][i]));\n\t\t\t\t\t}\n\t\t\t\t\td[\"data\"] = v;\n\t\t\t\t\td[\"name\"] = varNames[i];\n\t\t\t\t\ttab.push(d);\n\t\t\t\t}\n\t\t\t\tconsole.log(tab);\n\t\t\t\t\n\t\t\t\t$(function() {\n\t\t\t\t\t$('#container').highcharts({\n\t\t\t\t\t\ttitle: {\n\t\t\t\t\t\t\ttext: 'HLinesChart',\n\t\t\t\t\t\t\tx: -20 //center\n\t\t\t\t\t\t},\n\t\t\t\t\t\tlegend: {\n\t\t\t\t\t\t\tlayout: 'vertical',\n\t\t\t\t\t\t\talign: 'right',\n\t\t\t\t\t\t\tverticalAlign: 'middle',\n\t\t\t\t\t\t\tborderWidth: 0\n\t\t\t\t\t\t},\n\t\t\t\t\t\tseries: tab\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "c60814290f1aebb65c5065183afdc79d", "score": "0.5842251", "text": "function graficoAcquaInatividade(dados) {\r\n Highcharts.chart('table-container-inatividade-rede-acqua', {\r\n series: [{\r\n name: 'Qtd Pcds',\r\n data: dados\r\n }],\r\n chart: {\r\n type: 'line',\r\n reflow: true\r\n },\r\n title: {\r\n text: 'Inatividade da Rede Acqua'\r\n },\r\n subtitle: {\r\n text: null\r\n },\r\n xAxis: {\r\n type: 'datetime',\r\n tickInterval: 24 * 3600 * 1000,\r\n dateTimeLabelFormats: {\r\n day: \"%e-%b\"\r\n }\r\n },\r\n yAxis: {\r\n allowDecimals: false,\r\n title: {\r\n text: 'Qtd Pcds'\r\n }\r\n },\r\n legend: {\r\n enabled: false\r\n },\r\n plotOptions: {\r\n line: {\r\n dataLabels: {\r\n enabled: true\r\n },\r\n enableMouseTracking: true,\r\n allowPointSelect: true\r\n },\r\n series: {\r\n pointIntervalUnit: 'day',\r\n lineColor: '#000000',\r\n marker: {\r\n fillColor: '#FFFFFF',\r\n lineWidth: 2,\r\n lineColor: '#000000',\r\n enabled: false\r\n }\r\n }\r\n },\r\n tooltip: {\r\n shared: true,\r\n crosshairs: true,\r\n xDateFormat: '%d/%m/%Y - %Hh'\r\n }\r\n\r\n });\r\n}", "title": "" }, { "docid": "e3c4766a199aca3505ec2c576750bc56", "score": "0.58346426", "text": "function drawMapLine (className,num) {\r\n\t// body... \r\n\tvar myecharts=echarts.init(document.getElementsByClassName(className)[num]);\r\n\tvar planePath = 'path://M1705.06,1318.313v-89.254l-319.9-221.799l0.073-208.063c0.521-84.662-26.629-121.796-63.961-121.491c-37.332-0.305-64.482,36.829-63.961,121.491l0.073,208.063l-319.9,221.799v89.254l330.343-157.288l12.238,241.308l-134.449,92.931l0.531,42.034l175.125-42.917l175.125,42.917l0.531-42.034l-134.449-92.931l12.238-241.308L1705.06,1318.313z';\r\n\toption = {\r\n\t\t// backgroundColor: '#404a59',\r\n\t\ttitle : {\r\n\t\t\ttext: 'Logistic Transportation Lines',\r\n\t\t\tsubtext: '',\r\n\t\t\tleft: 'center',\r\n\t\t\ttextStyle : {\r\n\t\t\t\tcolor: '#fff',\r\n fontSize:30,\r\n fontFamily:'楷体'\r\n\t\t\t}\r\n\t\t},\r\n\t\ttooltip : {\r\n\t\t\ttrigger: 'item'\r\n\t\t},\r\n legend: {\r\n orient: 'vertical',\r\n top: 'bottom',\r\n left: 'right',\r\n data:['Beijing Top10'],\r\n textStyle: {\r\n color: '#fff'\r\n },\r\n selectedMode: 'single'\r\n },\r\n geo: {\r\n \tmap: 'china',\r\n \tlabel: {\r\n \t\t\r\n \t\t\tshow: true,\r\n color:'#91c7af',\r\n opacity:0.7\r\n \t\t\r\n \t},\r\n \troam: true,\r\n \titemStyle: {\r\n \t\tnormal: {\r\n areaColor: 'transparent',\r\n borderColor: '#0e94eb',\r\n shadowBlur: 10,\r\n shadowColor: '#0e94ea'\r\n \t\t\t// areaColor: '#323c48',\r\n \t\t\t// borderColor: '#404a59'\r\n \t\t},\r\n \t\temphasis: {\r\n \t\t\tareaColor: '#2a333d'\r\n \t\t}\r\n \t}\r\n },\r\n series: {\r\n \r\n \tname: datainfoMapLine.fromName,\r\n \ttype: 'lines',\r\n \tzlevel: 2,\r\n \tcoordinateSystem: 'geo',\r\n \tsymbol: ['none', 'arrow'],\r\n \tsymbolSize: 10,\r\n \teffect: {\r\n \t\tshow: true,\r\n \t\tperiod: 6,\r\n \t\ttrailLength: 0,\r\n \t\tsymbol: planePath,\r\n \t\tsymbolSize: 15,\r\n \t\ttrailLength: 0.1,\r\n \t},\r\n \tlineStyle: {\r\n \t\tnormal: {\r\n \t\t\tcolor:'#a6c84c',\r\n \t\t\twidth: 1,\r\n \t\t\topacity: 0.6,\r\n \t\t\tcurveness: -0.2\r\n \t\t}\r\n \t},\r\n \tdata:datainfoMapLine\r\n\r\n }\r\n\r\n };\r\n myecharts.setOption(option);\r\n}", "title": "" }, { "docid": "ba2fc53caa901d3a20852a0abe7e2af4", "score": "0.5830163", "text": "function drawChart(city) {\n\n var data = new google.visualization.DataTable();\n data.addColumn('number', 'X');\n data.addColumn('number', 'Temp Values');\n \n var hourlyTempValues=getForeCast(city); \n\n data.addRows(hourlyTempValues);\n\n var options = {\n hAxis: {title: 'Hours Military Time'},\n vAxis: {title: 'Temp in Farenheit'}\n };\n\n var chart = new google.visualization.LineChart(document.getElementById('chart_area'));\n \n chart.draw(data, options);\n}", "title": "" }, { "docid": "da336cfd8c0ba056bc8a7dca4092c642", "score": "0.58290005", "text": "function lchart() {\n //id of div\n $LINEDIV = $(\"#linechart\");\n COLORS = [\"#1696d2\", \"#fdbf11\"];\n //column name of Y variable\n LINEVAL = \"assaultrate\";\n //column name of grouping variable\n GROUP = \"cluster\";\n //names of the groups in the same order as the colors you want to draw them with\n GROUPS = [27, 29];\n //column name of X variable\n YEARVAL = \"year\";\n //how to format Y axis ticks\n FORMATTER = d3.format(',0f');\n //number of ticks on big and small screens. can be the same.\n NUMTICKS = 14;\n MOBILE_TICKS = 7;\n //leave this.\n isMobile = false;\n //change the height ratio depending on the shape of your graph\n linechart_aspect_height = 0.6;\n linechart_aspect_height_mobile = 1;\n\n //draw the chart to the div\n linechart(\"#linechart\");\n}", "title": "" }, { "docid": "784b883ab1adb0ad415794876eb9ff5f", "score": "0.58211905", "text": "function createChart() {\r\n // specify the chart options\r\n var chartOptions = {\r\n chart:\r\n {\r\n renderTo: 'chart-container',\r\n zoomType:'x'\r\n },\r\n rangeSelector: {\r\n buttons: [{\r\n count: 1,\r\n type: 'hour',\r\n text: '1H'\r\n }, {\r\n count: 12,\r\n type: 'hour',\r\n text: '12H'\r\n }, {\r\n count: 1,\r\n type: 'day',\r\n text: 'D'\r\n }, {\r\n count: 1,\r\n type: 'week',\r\n text: 'W'\r\n }, {\r\n count: 1,\r\n type: 'month',\r\n text: 'M'\r\n }, {\r\n count: 1,\r\n type: 'year',\r\n text: 'Y'\r\n }, {\r\n type: 'all',\r\n text: 'All'\r\n }],\r\n inputEnabled: false,\r\n selected: 2 //Change to 4th button as default\r\n },\r\n title: {\r\n text: ''\r\n },\r\n plotOptions: {\r\n line: {\r\n gapSize:5\r\n },\r\n series: {\r\n connectNulls: true,\r\n marker: {\r\n radius: 2\r\n },\r\n animation: false,\r\n step: false,\r\n turboThrehold:1000,\r\n borderWidth: 0\r\n }\r\n },\r\n tooltip: {\r\n valueDecimals: 1,\r\n valueSuffix: '',\r\n xDateFormat:'%Y-%m-%d<br/>%H:%M:%S %p'\r\n },\r\n xAxis: {\r\n type: 'datetime',\r\n ordinal:false,\r\n min: Date.UTC(2013,02,28),\r\n dateTimeLabelFormats : {\r\n hour: '%I %p',\r\n minute: '%l:%M %p'\r\n },\r\n title: {\r\n text: 'LeftAxis'\r\n }\r\n },\r\n yAxis: [{\r\n title: {\r\n text: ''\r\n },\r\n id: 'R'\r\n }, {\r\n title: {\r\n text: 'Temperature'\r\n },\r\n opposite: true,\r\n id: 'C'\r\n }],\r\n legend: {\r\n enabled: false\r\n },\r\n navigator: {\r\n baseSeries: 0 //select which series to show in history navigator, First series is 0\r\n },\r\n series: []\r\n };\r\n // add all Channel data to the chart\r\n for (var channelIndex=0; channelIndex<channelKeys.length; channelIndex++) // iterate through each channel\r\n {\r\n for (var fieldIndex=0; fieldIndex<channelKeys[channelIndex].fieldList.length; fieldIndex++) // add each field\r\n {\r\n chartOptions.series.push({data:channelKeys[channelIndex].fieldList[fieldIndex].data,\r\n index:channelKeys[channelIndex].fieldList[fieldIndex].series,\r\n yAxis:channelKeys[channelIndex].fieldList[fieldIndex].axis,\r\n //visible:false,\r\n name: channelKeys[channelIndex].fieldList[fieldIndex].name});\r\n }\r\n }\r\n // set chart labels here so that decoding occurs properly\r\n //chartOptions.title.text = data.channel.name;\r\n chartOptions.xAxis.title.text = 'Date';\r\n // draw the chart\r\n dynamicChart = new Highcharts.StockChart(chartOptions);\r\n }", "title": "" }, { "docid": "160e9cbdc19eec651f672236d60d8f5e", "score": "0.58147126", "text": "function showData(data) {\n var count = data.getRowCount();\n var rowHeight = 100;\n\n for (var i=0; i<count; i++) {\n // dividing line\n stroke(200);\n strokeWeight(2);\n line(50,rowHeight*(i+1)+hHeight,width-100,rowHeight*(i+1)+hHeight);\n \n // x axes\n stroke(150);\n strokeWeight(1);\n line(150,rowHeight*(i+1)-50+hHeight,width-100,rowHeight*(i+1)-50+hHeight);\n stroke(220);\n strokeWeight(.5);\n line(150,rowHeight*(i+1)-100/6+hHeight,width-100,rowHeight*(i+1)-100/6+hHeight);\n line(150,rowHeight*(i+1)-100/6*2+hHeight,width-100,rowHeight*(i+1)-100/6*2+hHeight);\n line(150,rowHeight*(i+1)-100/6*4+hHeight,width-100,rowHeight*(i+1)-100/6*4+hHeight);\n line(150,rowHeight*(i+1)-100/6*5+hHeight,width-100,rowHeight*(i+1)-100/6*5+hHeight);\n noStroke();\n fill(150);\n textSize(7);\n textAlign(RIGHT);\n text('0', 145, rowHeight*(i+1)-47.5+hHeight);\n textSize(5);\n fill(220);\n text('+2', 145, rowHeight*(i+1)-98/6*5+hHeight);\n text('+1', 145, rowHeight*(i+1)-98/6*4+hHeight);\n text('-1', 145, rowHeight*(i+1)-98/6*2+hHeight);\n text('-2', 145, rowHeight*(i+1)-98/6+hHeight);\n }\n\n for (var i=0; i<count; i++) {\n var country = data.getString(i, 2);\n for(var col=4; col<20; col++) {\n var val = data.getString(i, col);\n val = parseFloat(val);\n if (minVal > val)\n minVal = val;\n if (maxVal < val)\n maxVal = val;\n }\n \n // graphs\n noFill();\n strokeWeight(graphWeight);\n stroke(cCC);\n ccLine = beginShape();\n // loop through all the columns\n for (var col = 4; col < 20; col++) {\n val = data.getString(i, col);\n val = parseFloat(val);\n vertex(map(col, 4, 19, 150, width-100), map(val, minVal, maxVal, rowHeight*(i+1)+hHeight, rowHeight*(i+1)-100+hHeight));\n // vertex(map(col, 3, 25, 0, width), map(val, minVal, maxVal, height, 0));\n }\n endShape();\n // ccLine.class(\"ccLine\")\n \n // country names\n noStroke();\n fill(0);\n textAlign(RIGHT);\n textStyle(BOLD);\n textSize(10);\n text(country, 130, rowHeight*(i+1)-47.5+hHeight)\n \n // CC = select(\".ccLine\");\n // CC.mouseOver(ccOver);\n // CC.mouseOut(ccOut);\n }\n \n \n console.log(\"minimum: \" + minVal + \" | maximum: \" + maxVal);\n}", "title": "" }, { "docid": "70537bb547989346bfc29d5ad6efa97a", "score": "0.5809737", "text": "function getDataAndDrawCharts() {\n $http.get('widgets/examples/google_charts/data.json').success(function (data) {\n\n // Iterate and convert date string to date object\n for (var i in data['line_chart']) {\n if (i > 0) {\n data['line_chart'][i][0] = new Date(data['line_chart'][i][0]);\n }\n }\n\n chartsData = data;\n drawAllCharts();\n });\n }", "title": "" }, { "docid": "534d4b3a4e05985527c45ab00dd31049", "score": "0.58045745", "text": "function appendChart() {\n // using prepareData() to get the excact data we want\n let data = prepareData(_data);\n \n document.querySelector(\".chart-container\").style.display = \"block\";\n let chartContainer = document.getElementById('chartContainer');\n let chart = new Chart(chartContainer, {\n // The type of chart we want to create\n type: 'line',\n // The data for our dataset\n data: {\n labels: data.dates, // refering to the data object, holding data from prepareData()\n datasets: [{\n data: data.carbon, // refering to the data object, holding data from prepareData()\n label: 'Ton Carbon dioxide',\n backgroundColor: '#9aba6a', // Customise the graf color etc. Go to the docs to find more: https://www.chartjs.org/docs/latest/\n borderColor: '#19a413'\n }]\n },\n // Configuration options goes here\n // Go to the docs to find more: https://www.chartjs.org/docs/latest/\n options: {\n scales: {\n yAxes: [{\n ticks: {\n min: 100,\n max: 700\n }\n }]\n },\n title: {\n display: true,\n text: 'Carbon footprint for the whole farm',\n fontSize: 30\n }\n }\n\n }\n\n );\n}", "title": "" }, { "docid": "9db839c6f94cb9260dcb769d21e88c05", "score": "0.57985234", "text": "function graficoPluvioInatividade(dados) {\r\n Highcharts.chart('table-container-inatividade-rede-pluvio', {\r\n series: [{\r\n name: 'Qtd Pcds',\r\n data: dados\r\n }],\r\n chart: {\r\n type: 'line',\r\n reflow: true\r\n },\r\n title: {\r\n text: 'Inatividade da Rede Pluviométrica'\r\n },\r\n subtitle: {\r\n text: null\r\n },\r\n xAxis: {\r\n type: 'datetime',\r\n tickInterval: 24 * 3600 * 1000,\r\n dateTimeLabelFormats: {\r\n day: \"%e-%b\"\r\n }\r\n },\r\n yAxis: {\r\n allowDecimals: false,\r\n title: {\r\n text: 'Qtd Pcds'\r\n }\r\n },\r\n legend: {\r\n enabled: false\r\n },\r\n plotOptions: {\r\n line: {\r\n dataLabels: {\r\n enabled: true\r\n },\r\n enableMouseTracking: true,\r\n allowPointSelect: true\r\n },\r\n series: {\r\n pointIntervalUnit: 'day',\r\n lineColor: '#000000',\r\n marker: {\r\n fillColor: '#FFFFFF',\r\n lineWidth: 2,\r\n lineColor: '#000000',\r\n enabled: false\r\n }\r\n }\r\n },\r\n tooltip: {\r\n shared: true,\r\n crosshairs: true,\r\n xDateFormat: '%d/%m/%Y - %Hh'\r\n }\r\n });\r\n}", "title": "" }, { "docid": "48e740fcba4675ea230c8ea932444c15", "score": "0.5794854", "text": "async function renderModuleA() {\n let col = [\"Serie\", \"sector\", \"Oudste datum\", \"Recentste datum\", \"Laatste koers\"]\n\n highLightSelectedButton(0);\n\n let section1 = document.querySelector(\".section1\");\n let section2 = document.querySelector(\".section2\");\n\n lineChart = new LineChart(section1);\n lineChart.build();\n\n let amxResponse = await fetch(\"/data/api/dataseries/AMX/close\");\n let data1 = await amxResponse.json();\n\n lineChart.updateClose(data1, \"AMX\")\n\n // get all information about the available dataseries from db\n let dataseriesResponse = await fetch('/data/api/dataseries');\n let data2 = await dataseriesResponse.json();\n \n // format it to the form of: [[\"AMX\", \"1-9-20\", \"8-9-20\", \"43.5\"],......]\n let rows = []\n for (key in data2) {\n info = data2[key];\n rows.push([key, info['sector'], info['min_date'], info['max_date'], info['close']]);\n }\n\n createDataTable(section2, \"timeseries_table\", col, rows, true);\n}", "title": "" }, { "docid": "5473587919fc794c5ad09f6efc18c3c1", "score": "0.57926255", "text": "function addPriceGraph(id,coin,unit,x,y_prices,start,end, min, max, first){\n prices = [];\n for(i = 0 ; i < x.length ; i++){\n if(x[i] >= start && x[i] <= end){\n prices.push([x[i], y_prices[i]]);\n }\n }\n prices.sort();\n title = coin + \" Charts\";\n y_axis = \"Price of \" + coin + \" in \" + unit;\n \n //price axis\n hchart.addAxis({ \n id: id + \"-axis\",\n colorIndex: id,\n className: 'highcharts-color-' + id,\n labels: {\n align: 'left',\n },\n title: {\n text: '<div class=\"highcharts-color-' + id + '\">' + y_axis + '</div>'\n },\n height: '65%',\n lineWidth: 2,\n opposite: true,\n }\n );\n\n //price series\n hchart.addSeries({\n cropThreshold: Number.MAX_VALUE,\n getExtremesFromAll: true,\n id: id + \"-series\",\n colorIndex: id,\n type: 'line',\n name: y_axis,\n unit: unit,\n data: prices,\n //yAxis: hchart.yAxis.length-1,\n yAxis: id + \"-axis\",\n //boostThreshold: 1\n });\n \n if(!first){\n setMinMax(min,max) //from the url min and max query set the xAxis to min and max\n AlignAxis(id, \"Price\")\n }\n\n}", "title": "" }, { "docid": "476a5938ae3e46ddc100c74880f31244", "score": "0.5791953", "text": "function getSensorData() {\n var sensorData12 = [], sensorData24, sensorData48, time12hrsago, time24hrsago, time48hrsago;\n\n time12hrsago = new window.moment().subtract('hours', 12);\n time24hrsago = new window.moment().subtract('hours', 24);\n time48hrsago = new window.moment().subtract('hours', 48);\n\n $.getJSON('./temperature.json', function(response) {\n //var response = window.testChartData;\n var data = [];\n if (response && response.length > 0) {\n if (response[0] && response[0].length > 0) {\n sensorData12 = _.filter(response[0], function(val) { return (val.value > MIN_RANGE && val.value < MAX_RANGE); });\n }\n if (response[1] && response[1].length > 0) {\n data = _.filter(response[1], function(val) { return (val.value > MIN_RANGE && val.value < MAX_RANGE); });\n\n data = _.map(data, function(item) {\n var tempData = {};\n tempData.time = item.time;\n tempData.value2 = item.value;\n return tempData;\n });\n\n sensorData12 = _.merge(sensorData12, data);\n sensorData12 = _.filter(sensorData12, function(val, index) {\n return (time12hrsago.isBefore(val.time) && index % 6 === 0);\n });\n }\n\n if (!graph) {\n graph = window.Morris.Line({\n element: 'line-example',\n data: sensorData12,\n xkey: 'time',\n ykeys: ['value', 'value2'],\n labels: ['Sensor 1', 'Sensor 2'],\n xLabels: '5min',\n ymin: 'auto 60.0',\n ymax: 'auto 72.0',\n hideHover: 'auto',\n postUnits: '°',\n pointSize: 0,\n goals: [60.0, 72.0],\n goalLineColors: ['#00ff00'],\n yLabelFormat: function (y) { if (y) { return y.toFixed(0) + '°'; } return y; },\n dateFormat: function (x) { return new window.moment(x).format('MMM Do, h:mm:ss a'); }\n });\n } else {\n graph.setData(sensorData12);\n }\n\n // setup data for 24hr graph\n sensorData24 = _.filter(response[0], function(val) { return (val.value > MIN_RANGE && val.value < MAX_RANGE); });\n sensorData24 = _.filter(sensorData24, function(val, index) {\n return (time24hrsago.isBefore(val.time) && index % 12 === 0);\n });\n sensorData24 = _.pluck(sensorData24, 'value').reverse();\n $('.graph-24hr').sparkline(sensorData24, sparkFormat);\n\n // setup data for 48hr graph\n sensorData48 = _.filter(response[0], function(val) { return (val.value > MIN_RANGE && val.value < MAX_RANGE); });\n sensorData48 = _.filter(sensorData48, function(val, index) {\n return (time48hrsago.isBefore(val.time) && index % 24 === 0);\n });\n sensorData48 = _.pluck(sensorData48, 'value').reverse();\n $('.graph-48hr').sparkline(sensorData48, sparkFormat);\n\n updateCurrentWithResponse(response);\n }\n\n });\n\n // poll server again in 5 minutes\n setTimeout(getSensorData, ((1000 * 60) * 5));\n\n }", "title": "" }, { "docid": "3b335c6f89cb3662fb26ff22ab7f4672", "score": "0.57917815", "text": "function dashboardFlotTwo() {\n\n var data1 = [\n [gd(2012, 1, 1), 7],\n [gd(2012, 1, 2), 6],\n [gd(2012, 1, 3), 4],\n [gd(2012, 1, 4), 8],\n [gd(2012, 1, 5), 9],\n [gd(2012, 1, 6), 7],\n [gd(2012, 1, 7), 5],\n [gd(2012, 1, 8), 4],\n [gd(2012, 1, 9), 7],\n [gd(2012, 1, 10), 8],\n [gd(2012, 1, 11), 9],\n [gd(2012, 1, 12), 6],\n [gd(2012, 1, 13), 4],\n [gd(2012, 1, 14), 5],\n [gd(2012, 1, 15), 11],\n [gd(2012, 1, 16), 8],\n [gd(2012, 1, 17), 8],\n [gd(2012, 1, 18), 11],\n [gd(2012, 1, 19), 11],\n [gd(2012, 1, 20), 6],\n [gd(2012, 1, 21), 6],\n [gd(2012, 1, 22), 8],\n [gd(2012, 1, 23), 11],\n [gd(2012, 1, 24), 13],\n [gd(2012, 1, 25), 7],\n [gd(2012, 1, 26), 9],\n [gd(2012, 1, 27), 9],\n [gd(2012, 1, 28), 8],\n [gd(2012, 1, 29), 5],\n [gd(2012, 1, 30), 8],\n [gd(2012, 1, 31), 25]\n ];\n\n var data2 = [\n [gd(2012, 1, 1), 800],\n [gd(2012, 1, 2), 500],\n [gd(2012, 1, 3), 600],\n [gd(2012, 1, 4), 700],\n [gd(2012, 1, 5), 500],\n [gd(2012, 1, 6), 456],\n [gd(2012, 1, 7), 800],\n [gd(2012, 1, 8), 589],\n [gd(2012, 1, 9), 467],\n [gd(2012, 1, 10), 876],\n [gd(2012, 1, 11), 689],\n [gd(2012, 1, 12), 700],\n [gd(2012, 1, 13), 500],\n [gd(2012, 1, 14), 600],\n [gd(2012, 1, 15), 700],\n [gd(2012, 1, 16), 786],\n [gd(2012, 1, 17), 345],\n [gd(2012, 1, 18), 888],\n [gd(2012, 1, 19), 888],\n [gd(2012, 1, 20), 888],\n [gd(2012, 1, 21), 987],\n [gd(2012, 1, 22), 444],\n [gd(2012, 1, 23), 999],\n [gd(2012, 1, 24), 567],\n [gd(2012, 1, 25), 786],\n [gd(2012, 1, 26), 666],\n [gd(2012, 1, 27), 888],\n [gd(2012, 1, 28), 900],\n [gd(2012, 1, 29), 178],\n [gd(2012, 1, 30), 555],\n [gd(2012, 1, 31), 993]\n ];\n\n\n var dataset = [\n {\n label: \"Number of orders\",\n grow:{stepMode:\"linear\"},\n data: data2,\n color: \"#1ab394\",\n bars: {\n show: true,\n align: \"center\",\n barWidth: 24 * 60 * 60 * 600,\n lineWidth: 0\n }\n\n },\n {\n label: \"Payments\",\n grow:{stepMode:\"linear\"},\n data: data1,\n yaxis: 2,\n color: \"#1C84C6\",\n lines: {\n lineWidth: 1,\n show: true,\n fill: true,\n fillColor: {\n colors: [\n {\n opacity: 0.2\n },\n {\n opacity: 0.2\n }\n ]\n }\n }\n }\n ];\n\n\n var options = {\n grid: {\n hoverable: true,\n clickable: true,\n tickColor: \"#d5d5d5\",\n borderWidth: 0,\n color: '#d5d5d5'\n },\n colors: [\"#1ab394\", \"#464f88\"],\n tooltip: true,\n xaxis: {\n mode: \"time\",\n tickSize: [3, \"day\"],\n tickLength: 0,\n axisLabel: \"Date\",\n axisLabelUseCanvas: true,\n axisLabelFontSizePixels: 12,\n axisLabelFontFamily: 'Arial',\n axisLabelPadding: 10,\n color: \"#d5d5d5\"\n },\n yaxes: [\n {\n position: \"left\",\n max: 1070,\n color: \"#d5d5d5\",\n axisLabelUseCanvas: true,\n axisLabelFontSizePixels: 12,\n axisLabelFontFamily: 'Arial',\n axisLabelPadding: 3\n },\n {\n position: \"right\",\n color: \"#d5d5d5\",\n axisLabelUseCanvas: true,\n axisLabelFontSizePixels: 12,\n axisLabelFontFamily: ' Arial',\n axisLabelPadding: 67\n }\n ],\n legend: {\n noColumns: 1,\n labelBoxBorderColor: \"#d5d5d5\",\n position: \"nw\"\n }\n\n };\n\n function gd(year, month, day) {\n return new Date(year, month - 1, day).getTime();\n }\n\n /**\n * Definition of variables\n * Flot chart\n */\n this.flotData = dataset;\n this.flotOptions = options;\n}", "title": "" }, { "docid": "b45d65cd2ab6de67aa32ec626d950565", "score": "0.57917815", "text": "function dashboardFlotTwo() {\n\n var data1 = [\n [gd(2012, 1, 1), 7],\n [gd(2012, 1, 2), 6],\n [gd(2012, 1, 3), 4],\n [gd(2012, 1, 4), 8],\n [gd(2012, 1, 5), 9],\n [gd(2012, 1, 6), 7],\n [gd(2012, 1, 7), 5],\n [gd(2012, 1, 8), 4],\n [gd(2012, 1, 9), 7],\n [gd(2012, 1, 10), 8],\n [gd(2012, 1, 11), 9],\n [gd(2012, 1, 12), 6],\n [gd(2012, 1, 13), 4],\n [gd(2012, 1, 14), 5],\n [gd(2012, 1, 15), 11],\n [gd(2012, 1, 16), 8],\n [gd(2012, 1, 17), 8],\n [gd(2012, 1, 18), 11],\n [gd(2012, 1, 19), 11],\n [gd(2012, 1, 20), 6],\n [gd(2012, 1, 21), 6],\n [gd(2012, 1, 22), 8],\n [gd(2012, 1, 23), 11],\n [gd(2012, 1, 24), 13],\n [gd(2012, 1, 25), 7],\n [gd(2012, 1, 26), 9],\n [gd(2012, 1, 27), 9],\n [gd(2012, 1, 28), 8],\n [gd(2012, 1, 29), 5],\n [gd(2012, 1, 30), 8],\n [gd(2012, 1, 31), 25]\n ];\n\n var data2 = [\n [gd(2012, 1, 1), 800],\n [gd(2012, 1, 2), 500],\n [gd(2012, 1, 3), 600],\n [gd(2012, 1, 4), 700],\n [gd(2012, 1, 5), 500],\n [gd(2012, 1, 6), 456],\n [gd(2012, 1, 7), 800],\n [gd(2012, 1, 8), 589],\n [gd(2012, 1, 9), 467],\n [gd(2012, 1, 10), 876],\n [gd(2012, 1, 11), 689],\n [gd(2012, 1, 12), 700],\n [gd(2012, 1, 13), 500],\n [gd(2012, 1, 14), 600],\n [gd(2012, 1, 15), 700],\n [gd(2012, 1, 16), 786],\n [gd(2012, 1, 17), 345],\n [gd(2012, 1, 18), 888],\n [gd(2012, 1, 19), 888],\n [gd(2012, 1, 20), 888],\n [gd(2012, 1, 21), 987],\n [gd(2012, 1, 22), 444],\n [gd(2012, 1, 23), 999],\n [gd(2012, 1, 24), 567],\n [gd(2012, 1, 25), 786],\n [gd(2012, 1, 26), 666],\n [gd(2012, 1, 27), 888],\n [gd(2012, 1, 28), 900],\n [gd(2012, 1, 29), 178],\n [gd(2012, 1, 30), 555],\n [gd(2012, 1, 31), 993]\n ];\n\n\n var dataset = [\n {\n label: \"Number of orders\",\n grow:{stepMode:\"linear\"},\n data: data2,\n color: \"#1ab394\",\n bars: {\n show: true,\n align: \"center\",\n barWidth: 24 * 60 * 60 * 600,\n lineWidth: 0\n }\n\n },\n ];\n\n\n var options = {\n grid: {\n hoverable: true,\n clickable: true,\n tickColor: \"#d5d5d5\",\n borderWidth: 0,\n color: '#d5d5d5'\n },\n colors: [\"#1ab394\", \"#464f88\"],\n tooltip: true,\n xaxis: {\n mode: \"time\",\n tickSize: [3, \"day\"],\n tickLength: 0,\n axisLabel: \"Date\",\n axisLabelUseCanvas: true,\n axisLabelFontSizePixels: 12,\n axisLabelFontFamily: 'Arial',\n axisLabelPadding: 10,\n color: \"#d5d5d5\"\n },\n yaxes: [\n {\n position: \"left\",\n max: 1070,\n color: \"#d5d5d5\",\n axisLabelUseCanvas: true,\n axisLabelFontSizePixels: 12,\n axisLabelFontFamily: 'Arial',\n axisLabelPadding: 3\n },\n {\n position: \"right\",\n color: \"#d5d5d5\",\n axisLabelUseCanvas: true,\n axisLabelFontSizePixels: 12,\n axisLabelFontFamily: ' Arial',\n axisLabelPadding: 67\n }\n ],\n legend: {\n noColumns: 1,\n labelBoxBorderColor: \"#d5d5d5\",\n position: \"nw\"\n }\n\n };\n\n function gd(year, month, day) {\n return new Date(year, month - 1, day).getTime();\n }\n\n /**\n * Definition of variables\n * Flot chart\n */\n // this.flotData = dataset;\n this.flotOptions = options;\n}", "title": "" }, { "docid": "7f06b436183b31e22eed7f3baf6ac72e", "score": "0.5788485", "text": "render() {\n const dataPrettyfied = this.props.data.map(function(dataRow) {\n const point = {};\n point[\"date\"] = TimeUtil.getYearFromDate(dataRow.date_millis);\n point[\"count\"] = dataRow.doc_count;\n return point;\n });\n\n return (\n <div className={IDUtil.cssClassName('query-line-chart')}>\n <ResponsiveContainer width=\"100%\" height=\"40%\">\n <LineChart width={600} height={300} data={dataPrettyfied} margin={{top: 5, right: 30, left: 20, bottom: 5}}>\n <XAxis dataKey=\"date\"/>\n <YAxis/>\n <Tooltip/>\n <Legend />\n <Line type=\"monotone\" dataKey=\"count\" stroke=\"#8884d8\" activeDot={{r: 8}}/>\n </LineChart>\n </ResponsiveContainer>\n </div>\n )\n }", "title": "" }, { "docid": "21cc73a489bbbabb062e887b64bd03f7", "score": "0.5782443", "text": "function MychartLine() {\n var ctxLine = document.getElementById('myChartLine').getContext('2d');\n var chart = new Chart(ctxLine, {\n // The type of chart we want to create\n type: 'line',\n // The data for our dataset\n data: {\n labels: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],\n datasets: [{\n label: \"Statistiche mensili\",\n borderColor: 'rgb(255, 99, 132)',\n pointBorderWidth: 3,\n pointHoverBorderWidth: 3,\n data: [statisticaMensile.January,statisticaMensile.February,statisticaMensile.March,statisticaMensile.April,statisticaMensile.May,\n statisticaMensile.June,statisticaMensile.July,statisticaMensile.August,statisticaMensile.September,\n statisticaMensile.October,statisticaMensile.November,statisticaMensile.December],\n }]\n },\n\n });\n }", "title": "" }, { "docid": "9d397f3aa0f28143e619cb36d940f38e", "score": "0.5782094", "text": "function widgetFlotChart() {\n\n\n /**\n * Flot chart data and options\n */\n var d1 = [[1262304000000, 6], [1264982400000, 3057], [1267401600000, 20434], [1270080000000, 31982], [1272672000000, 26602], [1275350400000, 27826], [1277942400000, 24302], [1280620800000, 24237], [1283299200000, 21004], [1285891200000, 12144], [1288569600000, 10577], [1291161600000, 10295]];\n var d2 = [[1262304000000, 5], [1264982400000, 200], [1267401600000, 1605], [1270080000000, 6129], [1272672000000, 11643], [1275350400000, 19055], [1277942400000, 30062], [1280620800000, 39197], [1283299200000, 37000], [1285891200000, 27000], [1288569600000, 21000], [1291161600000, 17000]];\n\n var flotChartData1 = [\n { label: \"Data 1\", data: d1, color: '#17a084'},\n { label: \"Data 2\", data: d2, color: '#127e68' }\n ];\n\n var flotChartOptions1 = {\n xaxis: {\n tickDecimals: 0\n },\n series: {\n lines: {\n show: true,\n fill: true,\n fillColor: {\n colors: [{\n opacity: 1\n }, {\n opacity: 1\n }]\n }\n },\n points: {\n width: 0.1,\n show: false\n }\n },\n grid: {\n show: false,\n borderWidth: 0\n },\n legend: {\n show: false\n }\n };\n\n var flotChartData2 = [\n { label: \"Data 1\", data: d1, color: '#19a0a1'}\n ];\n\n var flotChartOptions2 = {\n xaxis: {\n tickDecimals: 0\n },\n series: {\n lines: {\n show: true,\n fill: true,\n fillColor: {\n colors: [{\n opacity: 1\n }, {\n opacity: 1\n }]\n }\n },\n points: {\n width: 0.1,\n show: false\n }\n },\n grid: {\n show: false,\n borderWidth: 0\n },\n legend: {\n show: false\n }\n };\n\n var flotChartData3 = [\n { label: \"Data 1\", data: d1, color: '#fbbe7b'},\n { label: \"Data 2\", data: d2, color: '#f8ac59' }\n ];\n\n var flotChartOptions3 = {\n xaxis: {\n tickDecimals: 0\n },\n series: {\n lines: {\n show: true,\n fill: true,\n fillColor: {\n colors: [{\n opacity: 1\n }, {\n opacity: 1\n }]\n }\n },\n points: {\n width: 0.1,\n show: false\n }\n },\n grid: {\n show: false,\n borderWidth: 0\n },\n legend: {\n show: false\n }\n };\n\n /**\n * Definition of variables\n * Flot chart\n */\n\n this.flotChartData1 = flotChartData1;\n this.flotChartOptions1 = flotChartOptions1;\n this.flotChartData2 = flotChartData2;\n this.flotChartOptions2 = flotChartOptions2;\n this.flotChartData3 = flotChartData3;\n this.flotChartOptions3 = flotChartOptions3;\n\n\n}", "title": "" }, { "docid": "6920935dcc6d6dee3556aaea684c6514", "score": "0.5781925", "text": "function grabDataForLineChart(\n data,\n features,\n chartElement,\n chartAxisElement\n ) {\n\n var activeDayScroll = 0,\n scrollDistance = 0,\n chipStatsLabels = document.querySelector(\".line-chart-chips\"),\n dailyStatsFrame = document.querySelector(\".line-chart-daily-stats-frame\");\n\n chipStatsLabels.appendChild(features.chips.chips.y0.chipDOM);\n chipStatsLabels.appendChild(features.chips.chips.y1.chipDOM);\n\n var chartData = JSON.parse(data),\n chartTimeStamps = transformTimestampsToXLables(chartData.columns[0]),\n setDailyStats = features.dailyStatsFrame.set;\n\n chartData.columns[1].splice(0, 1);\n chartData.columns[2].splice(0, 1);\n chartData.dailyData = chartTimeStamps.map((timestamp, id) => {\n return {\n label: timestamp,\n joined: chartData.columns[1][id],\n left: chartData.columns[2][id]\n };\n });\n dailyStatsFrame.appendChild(setDailyStats(chartData.dailyData[0]));\n displayLineChart(chartData, chartElement, chartAxisElement);\n\n /* chartsWrapper.onscroll = (event) => {\n event.target.scrollLeft > currentScrollDestanation ? currentScrollDestanation = currentActiveDay++ : currentActiveDay --;\n replaceDailyStatsFrameWithAnotherDay(charts[0].dailyData[currentActiveDay]);\n currentScrollDestanation = event.target.scrollLeft;\n }; */\n }", "title": "" }, { "docid": "680777d382d52555f59302dce7e993b5", "score": "0.5780901", "text": "function Trends1({ fullData, dataKey, dataKeyName, dataColor }) {\n let [chartData, setChartData] = useState(fullData);\n\n useEffect(() => {\n let newData =\n (fullData &&\n Array.isArray(fullData) &&\n fullData.map((item) => {\n return {\n ...item,\n [dataKey]: parseInt(item[dataKey]),\n };\n })) ||\n [];\n //console.log(newData);\n setChartData(newData);\n }, [fullData, dataKey]);\n\n return (\n <Box>\n <Panel\n variant=\"small\"\n title={\n <>\n {dataKeyName}\n {fullData && fullData[fullData.length - 1] ? (\n <span>\n {\" \"}\n :{\" \"}\n <span style={{ color: dataColor }}>\n {fullData[fullData.length - 1][dataKey]}\n </span>\n </span>\n ) : (\n \"\"\n )}\n </>\n }\n >\n <div style={{ width: \"100%\" }}>\n <ResponsiveContainer height={150}>\n <LineChart\n width={500}\n height={300}\n data={chartData}\n margin={{\n top: 20,\n right: 5,\n left: 0,\n bottom: 5,\n }}\n >\n <CartesianGrid strokeDasharray=\"3 3\" />\n <XAxis dataKey=\"date\" />\n <YAxis />\n <Tooltip />\n <Line\n /* type=\"monotone\" */\n type=\"linear\"\n dataKey={dataKey}\n name={dataKeyName}\n stroke={dataColor || \"#000000\"}\n activeDot={{ r: 8 }}\n />\n </LineChart>\n </ResponsiveContainer>\n </div>\n </Panel>\n </Box>\n );\n}", "title": "" }, { "docid": "66b65bb52b24f4cdd7a3c2857d833496", "score": "0.57789624", "text": "function createLineGraph(data,labels) {\n var title2 = titleGraph();\n var view =$('#viewStatSelect').val();\n\n var parser = new DOMParser();\n var xmlDoc;\n xmlDoc = parser.parseFromString(data ,\"text/xml\");\n var data2 = xmlDoc.getElementsByTagName(\"row\");\n var data3 = xmlDoc.getElementsByTagName('Utilization');\n var seriesDATA=\"\";\n var utilNew = \"\";\n var util =0;\n var ctr =0;\n var split;\n var TF;\n var maxArr=[];\n var exportVal = 'true';\n // this loop is for the highest resrvation number\n\tfor(var y = 0; y < data3.length; y++){\n var TotalMax = data3[y].getAttribute('TotalReservation');\n maxArr.push(TotalMax);\n\n }\n var MaxReservation = Math.max.apply(Math, maxArr);\n\n if(data2.length==0){\n// alerts('No reservation for this duration.');\n //this variable set to false to hide the context menu of the grpah\n exportVal = false;\n }\n //this loop is for the reservation of the per device.\n for(var x = 0; x < data2.length; x++){\n ctr++;\n var hostname = data2[x].getAttribute('Name');\n split = hostname.split(\" \");\n var utilNew = parseFloat(data2[x].getAttribute('Util'))/60;\n var RN = parseFloat(data2[x].getAttribute('ReservationNumber'));\n var idle = data2[x].getAttribute('Idle');\n if(hostname==\"\"){\n hostname=\"Unknown\";\n }\n util = utilNew+','+RN;\n\n seriesDATA +='{'+'\"name\"'+':'+'\"'+hostname+'\"'+','+'\"data\"'+':'+'\"'+util+'\"'+'},';\n }\n //this condition is for showing of scroll bar for Line Graph when the MaxReservation is greater than 50\n if(MaxReservation<50){\n TF = '';\n var maxVal = MaxReservation;\n }else if(MaxReservation < 1000){\n TF = 'true';\n var maxVal = 50;\n }else{\n TF = 'true';\n var maxVal = 100;\n\t}\n\n var val = seriesDATA.substring(0,seriesDATA.length-1);\n var dataCHART = '['+val+']';\n\n //options variable contains the style and data for rendering graph in highcharts\n var options = {\n chart: {\n\t\t\tbackgroundColor: null,\n renderTo: 'graphDiv',\n alignTicks: false,\n backgroundColor: {\n linearGradient: { x1: 0, y1: 0, x2: 1, y2: 1 },\n stops: [\n [0, 'rgb(255, 255, 255)'],\n [1, 'rgb(240, 240, 255)']\n ]\n },\n borderWidth: 2,\n plotBackgroundColor: 'rgba(255, 255, 255, .9)',\n plotShadow: true,\n plotBorderWidth: 1\n },\n\t\tcredits: {\n\t \tenabled: false,\n href : 'https://www.narrasystems.com',\n text: 'NarraSystems'\n\t },\n\t\tcolors: [\n '#2f7ed8',\n '#0d233a',\n '#8bbc21',\n '#910000',\n '#1aadce',\n '#492970',\n '#f28f43',\n '#77a1e5',\n '#c42525',\n '#a6c96a'\n ],\n exporting: {\n enabled: exportVal\n },\n title: {\n text: 'Reservation Duration',\n style: {\n color: '#000',\n font: 'bold 16px \"Trebuchet MS\", Verdana, sans-serif'\n }\n },\n subtitle: {\n text: '<b>'+title2+'</b>',\n style: {\n color: '#666666',\n font: 'bold 12px \"Trebuchet MS\", Verdana, sans-serif'\n }\n },\n xAxis: {\n\t\t//min:0,\n max: maxVal,\n gridLineWidth: 1,\n allowDecimals: false,\n lineColor: '#000',\n tickColor: '#000',\n labels: {\n style: {\n color: '#000',\n font: '11px Trebuchet MS, Verdana, sans-serif'\n }\n },\n title: {\n text: 'Reservation Number',\n style: {\n color: '#333',\n fontWeight: 'bold',\n fontSize: '12px',\n fontFamily: 'Trebuchet MS, Verdana, sans-serif'\n\n }\n }\n },\n yAxis: {\n///\t\t\ttype: 'datetime',\n minorTickInterval: 'auto',\n allowDecimals: false,\n// min: 0,\n lineColor: '#000',\n// endOnTick: false,\n \t\tlineWidth: 1,\n tickWidth: 1,\n tickColor: '#000',\n labels: {\n formatter: function(){\n if(this.value < 2){\n return this.value+' hr'\n }else{\n\n return this.value+' hrs'\n }\n },\n style: {\n color: '#000',\n font: '11px Trebuchet MS, Verdana, sans-serif'\n }\n },\n title: {\n text: 'Reservation(Hours)',\n style: {\n color: '#333',\n fontWeight: 'bold',\n fontSize: '12px',\n fontFamily: 'Trebuchet MS, Verdana, sans-serif'\n }\n }\n\n },\n plotOptions: {\n series:{\n pointStart: 1,\n }\n },\n scrollbar: {\n enabled: TF\n },\n legend: {\n itemStyle: {\n font: '9pt Trebuchet MS, Verdana, sans-serif',\n color: 'black'\n\n },\n itemHoverStyle: {\n color: '#039'\n },\n itemHiddenStyle: {\n color: 'gray'\n }\n },\n tooltip: {\n formatter: function () {\n return this.series.name + '<br />Reservation Number: ' + this.x +'<br/>Reservation Time: <b>'+ this.y.toFixed(2)+'hr(s)</b>';\n\n },\n\t\t\tbackgroundColor: {\n linearGradient: [0, 0, 0, 60],\n stops: [\n [0, '#FFFFFF'],\n [1, '#E0E0E0']\n ]\n }\n },\n labels: {\n\t\t\tstyle: {\n color: '#99b'\n }\n },\n series: []\n };\n //convert xml file to JSON\n data = JSON.parse(dataCHART);\n var names = [];\n //stores data from the query into series data of chart.\n $.each(data, function (i, ligne) {\n var ind = names.indexOf(ligne.name),\n splited = ligne.data.split(','),\n x = parseFloat(splited[0]);\n y = parseFloat(splited[1]);\n if (ind == -1) {\n ind = names.push(ligne.name) - 1;\n options.series.push({\n data: [],\n name: ligne.name\n });\n }\n if(!isNaN(x) && !isNaN(y)){\n options.series[ind].data.push([y,x]);\n }\n });\n //rendering the options to graph\n var chart = new Highcharts.Chart(options);\n}", "title": "" }, { "docid": "16ff2c8858d9d3e102317624a85bac80", "score": "0.57733786", "text": "function addDataPoint(dataSeries, type, secs, percent, value, unit, time, device) {\n // some parameter sanitation\n if (unit === undefined) {\n unit = \"\";\n }\n\n //\n // get me the right queue depending on the viz library we are using\n //\n var dataPoints;\n if (usingChartJS) {\n dataPoints = dataSeries.data;\n //secs = moment.unix(secs); // but we don't have the moments library\n } else {\n dataPoints = dataSeries.dataPoints;\n }\n\n //\n // this big switch makes different line behavior happen for different devices/variables, as defined in their vizChannel\n //\n switch (type) {\n case \"momentary\":\n // make a spike out of three points\n dataPoints.push({x: secs - 0.0001, y: 0, value: 0, unit: unit, time: time, device: device});\n dataPoints.push({x: secs, y: percent, value: value, unit: unit, time: time, device: device});\n dataPoints.push({x: secs + 0.0001, y: 0, value: 0, unit: unit, time: time, device: device});\n break;\n case \"discrete\":\n // flat lines that move at the time of the event\n // i.e. the datapoint reflects how things are from hereon\n if (dataPoints.length > 0) {\n var lastPoint = dataPoints[dataPoints.length - 1];\n dataPoints.push({x: secs - 0.0001, y: lastPoint.y, value: lastPoint.value, unit: unit, time: time, device: device});\n }\n dataPoints.push({x: secs, y: percent, value: value, unit: unit, time: time, device: device});\n break;\n case \"discrete trailing\":\n // flat lines that move at the last event before ours\n // i.e. the datapoint is interpreted to reflect how things have been since the last datapoint\n if (dataPoints.length > 0) {\n var lastPoint = dataPoints[dataPoints.length - 1];\n dataPoints.push({x: lastPoint.x + 0.0001, y: percent, value: value, unit: unit, time: time, device: device});\n }\n dataPoints.push({x: secs, y: percent, value: value, unit: unit, time: time, device: device});\n break;\n case \"continuous\":\n // just put the point in\n default:\n dataPoints.push({x: secs, y: percent, value: value, unit: unit, time: time, device: device});\n break;\n }\n // in live view, constrain ourselves to xxx data points per series\n if (liveServer) {\n while (dataPoints.length > 2000) {\n dataPoints.shift();\n }\n }\n}", "title": "" }, { "docid": "51f78a5b717b5c3d6e6e654f60e02cac", "score": "0.5760345", "text": "function xGraph3(){\n\tvar data = {\n\t\t\"xScale\": \"time\",\n\t\t\"yScale\": \"linear\",\n\t\t\"type\": \"line\",\n\t\t\"main\": [\n\t\t{\n\t\t\t\"className\": \".xchart-class-3\",\n\t\t\t\"data\": [\n\t\t\t\t{\n\t\t\t\t \"x\": \"2012-11-05\",\n\t\t\t\t \"y\": 1\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"x\": \"2012-11-06\",\n\t\t\t\t \"y\": 6\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"x\": \"2012-11-07\",\n\t\t\t\t \"y\": 13\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"x\": \"2012-11-08\",\n\t\t\t\t \"y\": -3\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"x\": \"2012-11-09\",\n\t\t\t\t \"y\": -4\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"x\": \"2012-11-10\",\n\t\t\t\t \"y\": 9\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"x\": \"2012-11-11\",\n\t\t\t\t \"y\": 6\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"x\": \"2012-11-12\",\n\t\t\t\t \"y\": 7\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"x\": \"2012-11-13\",\n\t\t\t\t \"y\": -2\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"x\": \"2012-11-14\",\n\t\t\t\t \"y\": -7\n\t\t\t\t}\n\t\t\t]\n\t\t\t}\n\t\t]\n\t};\n\tvar opts = {\n\t\t\"dataFormatX\": function (x) { return d3.time.format('%Y-%m-%d').parse(x); },\n\t\t\"tickFormatX\": function (x) { return d3.time.format('%A')(x); }\n\t};\n\tvar myChart = new xChart('line', data, '#xchart-3', opts);\n}", "title": "" }, { "docid": "c8771cfd37521cfd81835d70a0ffbda1", "score": "0.57467985", "text": "function display_dataviz_type1(return_data, anchor, cname, CnameExtra, credits) {\n\n\n\n\n var chart = new Highcharts.Chart({\n chart: {\n type: 'spline',\n renderTo: anchor\n },\n colors: ['#6e9fc5', '#ffdf51', '#a6ca6d', '#ad46d6', '#f26a2e', '#00adef', '#f4bb90'],\n title: {\n text: return_data.indicatorName\n },\n credits: {\n enabled: false,\n },\n\n subtitle: {\n text: credits\n },\n xAxis: {\n categories: return_data.date, //.reverse() to have the min year on the left \n },\n plotOptions: {\n series: {\n marker: {\n enabled: false\n },\n }\n },\n tooltip: {\n valueDecimals: 2,\n pointFormat: '<span style=\"color:{point.color}\">\\u25CF</span> {series.name}: <b>{point.y}</b><br/>'\n },\n series: return_data.series\n }, OnChartComplete);\n\n\n\n\n Highcharts.setOptions({\n chart: {\n style: {\n fontFamily: \"'Open Sans', sans-serif\"\n }\n\n }\n });\n\n return chart\n}", "title": "" }, { "docid": "9962120bfa1dfd21a1a9a4ff5c588806", "score": "0.57423776", "text": "function addData_LineChart(chart, labels, data) {\n chart.data.labels = labels;\n chart.data.datasets[0].data = data;\n}", "title": "" }, { "docid": "abc8620d89901f03afa1ab195c11367f", "score": "0.5741719", "text": "function getNumbers(data, metaData) {\n var allNumbers = data;\n var newArrayWithData = [];\n for (const interval in allNumbers) {\n var openPrice = allNumbers[interval]['1. open'];\n var closePrice = allNumbers[interval]['4. close'];\n var lowPrice = allNumbers[interval]['3. low'];\n var highPrice = allNumbers[interval]['2. high'];\n var intervalTime = interval.split(' ');\n if(intervalTime.length > 1){\n intervalTime = intervalTime.pop().toString();\n intervalTime = intervalTime.substring(0, intervalTime.length-3);\n } else {\n intervalTime = intervalTime.toString();\n }\n newArrayWithData.push([intervalTime, parseFloat(lowPrice), parseFloat(closePrice), parseFloat(openPrice), parseFloat(highPrice)])\n }\n console.log(newArrayWithData, metaData)\n drawChart(newArrayWithData, metaData)\n}", "title": "" }, { "docid": "5f9b1cb6b366b2cc86af09c8e3045501", "score": "0.57416904", "text": "function LineChart(id, name, config) {\n this.id = id;\n this.name = name;\n this.shape = [1, 1];\n this.size = config[\"size\"];\n if (!this.size) {\n this.size = 1;\n }\n var series = [];\n for (var i = 0; i < size; i++) {\n series.push({\n data: []\n });\n }\n this.definition = {\n chart: {\n renderTo: id,\n defaultSeriesType: 'spline',\n alighTicks: false,\n events: {}\n },\n title: {\n text: name,\n style: {\n color: '#000',\n fontWeight: 'bold',\n fontSize: \"20px\",\n }\n },\n xAxis: {\n // type: 'linear',\n tickPixelInterval: 20,\n minRange: 40,\n tickInterval: 5\n },\n yAxis: {\n minPadding: 0.2,\n maxPadding: 0.2,\n title: {\n text: 'Value',\n margin: 30\n },\n min: 0,\n max: 1,\n endOnTick: false,\n startOnTick: false,\n },\n series: series\n };\n this.chart = new Highcharts.Chart(this.definition);\n console.log(\"here\", series.length);\n}", "title": "" }, { "docid": "0c3996e28b1e057a7f483118fb9b8944", "score": "0.5739605", "text": "function chartI() {\r\n var options = {\r\n chart: {\r\n height: 350,\r\n type: 'line',\r\n fontFamily: 'Poppins, sans-serif',\r\n toolbar: {\r\n show: false\r\n },\r\n zoom: {\r\n enabled: false\r\n },\r\n },\r\n series: [{\r\n name: 'Series1',\r\n type: 'column',\r\n data: [440, 505, 414, 671, 227, 413, 201, 352, 752, 320, 257, 160]\r\n }, {\r\n name: 'Series2',\r\n type: 'line',\r\n data: [23, 42, 35, 27, 43, 22, 17, 31, 22, 22, 12, 16]\r\n }],\r\n stroke: {\r\n width: [0, 4]\r\n },\r\n title: {\r\n text: 'Google Analytics'\r\n },\r\n labels: ['01 Jan 2020', '02 Jan 2020', '03 Jan 2020', '04 Jan 2020', '05 Jan 2020', '06 Jan 2020', '07 Jan 2020', '08 Jan 2020', '09 Jan 2020', '10 Jan 2020', '11 Jan 2020', '12 Jan 2020'],\r\n xaxis: {\r\n type: 'datetime',\r\n labels: {\r\n style: {\r\n colors: '#10163a',\r\n fontSize: '14px',\r\n fontFamily: 'Poppins, sans-serif',\r\n }\r\n }\r\n },\r\n yaxis: [{\r\n title: {\r\n text: 'Website Blog',\r\n },\r\n labels: {\r\n style: {\r\n color: '#10163a',\r\n }\r\n }\r\n\r\n }, {\r\n opposite: true,\r\n title: {\r\n text: 'Social Media'\r\n },\r\n labels: {\r\n style: {\r\n color: '#10163a',\r\n }\r\n }\r\n }],\r\n colors: ['#1b4962', '#ffa000', '#11a0fd']\r\n\r\n }\r\n\r\n var chart = new ApexCharts(\r\n document.querySelector(\"#chartI\"),\r\n options\r\n );\r\n\r\n chart.render();\r\n}", "title": "" }, { "docid": "88b11f8dc6b07063989a0d0bfd282abf", "score": "0.5738705", "text": "function plotLines(div,results) {\n var data = [];\n var container = $(div+\"legend\");\n container.find(\"input:checked\").each(function() {\n for (var i=0; i<results.length; i+=2) {\n\t if (results[i].label && this.name == results[i].label) {\n\t\t data.push(results[i]);\n if (i <results.length-1) {\n\t\t data.push(results[i+1]);\n }\n\t }\n }\n });\n function xAxisFormatter(val, axis) {\n var found = false;\n for (var i=0; i<data.length; i+=2) {\n for (var j=0; j<data[i].data.length; ++j) {\n var date = data[i].data[j][0];\n if (date == val) {\n found = true;\n break;\n }\n }\n }\n if (!found && !showTime)\n return \"\";\n\n var date = new Date(val);\n if (showTime) {\n\t return date.getUTCMonth()+1 + \"/\" +\n\t\tdate.getUTCDate() + \"/\" + \n\t\tdate.getUTCFullYear() + \"\\n\" + \n\t\tpad(date.getUTCHours()) + \":\" + \n\t\tpad(date.getUTCMinutes());\n } else {\n\t return date.getUTCMonth()+1 + \"/\" +\n\t\tdate.getUTCDate() + \"/\" + \n\t\tdate.getUTCFullYear(); \n }\n }\n var options = {\n series: {\n curvedLines: {\n active: true,\n nrSplinePoints: 20\n }\n },\n grid: { hoverable: true, autoHighlight: true, backgroundColor: \"#fff\" },\n xaxis: { tickFormatter: xAxisFormatter, mode: \"time\" },\n yaxis: { min: 0, minTickSize: 1, tickFormatter: function(val, axis) { return val < axis.max ? val.toFixed(1) : \"#\"; }},\n legend: { show: true, noColumns: 0, position: \"nw\"}\n };\n\n var plot = $.plot($(div), data, options);\n $(div).unbind(\"plothover\");\n $(div).bind(\"plothover\", function (event, pos, item) {\n var date = null;\n if (item) {\n date = item.datapoint[0]; \n } \n if (date) {\n\t plot.unhighlight();\n\t var labels=[];\n var count=0;\n\t for (var j=0; j<data.length; ++j) { \n\t\t for (i=0;i<data[j].data.length;++i) {\n\t\tvar x = data[j].data[i];\n\t\tif (x[0] == date && data[j].label) {\n\t\t\tplot.highlight(j,i);\n\t\t\tlabels.push({\"label\":data[j].label,\"val\":data[j].data[i][1]});\n count++;\n\t\t\tbreak\n\t\t}\n\t\t }\n\t }\n // Convert to javascript date object\n date = new Date(date);\n if (count>0)\n\t $(\"#tooltip\").html(tooltipFormatter(date,labels)).css({top: item.pageY-$(\"#tooltip\").height()+$(\"#tooltip\").height()/2-5, left: item.pageX+15}).fadeIn(200);\n } else {\n\t $(\"#tooltip\").hide();\n\t plot.unhighlight();\n }\n });\n $(div).mouseleave(function() {\n $(\"#tooltip\").hide();\n plot.unhighlight();\n });\n}", "title": "" }, { "docid": "c3ef0738448897b67cc6a2b1449dadf0", "score": "0.57364553", "text": "function formatData(myresults) {\nvar failedTests = [];\nvar tests = [];\n\n//Separate the results from summary.csv to different arrays\nmyresults.data.forEach( function(d,i){\n\tvar splitdate = d[0].split(\"_\");\n\tvar year = Number(splitdate[0]);\n\tvar mon = Number(splitdate[1])-1;\n\tvar day = Number(splitdate[2]);\n\tvar datetime = Date.UTC(year,mon,day);\n\ttests[i] = [datetime,d[1]];\n\tfailedTests[i] = [datetime,d[2]];\n})\n\n// Display the chart\n$(function () {\n $('#linePlot').highcharts({\n title: {\n text: 'Running Tests',\n x: -20 //center\n },\n\t\tsubtitle: {\n\t\t\ttext: \"Shows the number of tests and number of failed tests\"\n\t\t},\n xAxis: {\n\t\t\ttype: 'datetime' \n\t\t},\n yAxis: {\n title: {\n text: 'Number of Tests'\n },\n plotLines: [{\n value: 0,\n width: 1,\n color: '#808080'\n }]\n },\n legend: {\n layout: 'vertical',\n align: 'right',\n verticalAlign: 'middle',\n borderWidth: 0\n },\n series: [{\n name: 'Failed Tests',\n data: failedTests\n }, {\n name: 'Tests',\n data: tests \n\t }]\n });\n});\n\n}", "title": "" }, { "docid": "090092294e81baf00acefeac16e73485", "score": "0.57314104", "text": "function graficoHidroInatividade(dados) {\r\n Highcharts.chart('table-container-inatividade-rede-hidro', {\r\n series: [{\r\n name: 'Qtd Pcds',\r\n data: dados\r\n }],\r\n chart: {\r\n type: 'line',\r\n reflow: true\r\n },\r\n title: {\r\n text: 'Inatividade da Rede Hidrológica'\r\n },\r\n subtitle: {\r\n text: null\r\n },\r\n xAxis: {\r\n type: 'datetime',\r\n tickInterval: 24 * 3600 * 1000,\r\n dateTimeLabelFormats: {\r\n day: \"%e-%b\"\r\n }\r\n },\r\n yAxis: {\r\n allowDecimals: false,\r\n title: {\r\n text: 'Qtd Pcds'\r\n }\r\n },\r\n legend: {\r\n enabled: false\r\n },\r\n plotOptions: {\r\n line: {\r\n dataLabels: {\r\n enabled: true\r\n },\r\n enableMouseTracking: true,\r\n allowPointSelect: true\r\n },\r\n series: {\r\n pointIntervalUnit: 'day',\r\n lineColor: '#000000',\r\n marker: {\r\n fillColor: '#FFFFFF',\r\n lineWidth: 2,\r\n lineColor: '#000000',\r\n enabled: false\r\n }\r\n }\r\n },\r\n tooltip: {\r\n shared: true,\r\n crosshairs: true,\r\n xDateFormat: '%d/%m/%Y - %Hh'\r\n }\r\n\r\n });\r\n}", "title": "" }, { "docid": "8424b3f009c193da26c173dc33a97210", "score": "0.57245904", "text": "function getC3LineChart(bindToSelector, data, maxDisplayedResults){\n //var xAxisName = data.xAxisName;\n var xFormat = data.xFormat;\n var chartData = getChartData(data);\n maxChartsToShow = maxDisplayedResults;\n\n /*Object that represents structure and properties of the c3 chart*/\n var chartObjectDefinition = {\n bindto: bindToSelector,\n legend: {\n show: true,\n position: 'right',\n item: {\n onclick: onLegendClick,\n onmouseover: doNothing,\n onmouseout: doNothing\n }\n },\n grid: {\n x: {\n show: false\n },\n y: {\n show: true\n }\n },\n tooltip: {\n show: true,\n/* position: function (data, width, height, element) {\n var x = element.getBoundingClientRect().left; //this is the exact point location\n return {top: height, left: x}\n },*/\n contents: function (points) {\n //TODO add validations\n var valuesListTemplate = \"<div id='tooltip-$index'><div class='left'>$name</div><div class='right'>$value</div></div>\";\n var valuesListHtml=\"\";\n var dateFormatter = d3.time.format(\"%b-%Y\"); //formatter of the bottom MON-YYYY value\n\n points.forEach(function(currentPoint, index, array){\n valuesListHtml += valuesListTemplate.replace(\"$index\",index).replace(\"$name\", currentPoint.name).replace(\"$value\",currentPoint.value);\n });\n\n //var valueFormat = d3.format(\"$,.2f\");\n var dateString = dateFormatter(points[0].x);\n\n var html = '<div class=\"tooltip-value\">'+valuesListHtml+'</div>'\n html += '<div class=\"tooltip-date triangled\">'+dateString+'</div>';\n\n return html;\n }\n },\n data: {\n type: 'area-spline', //TODO check if its ok with UX (spline not line)\n x: \"xAxisName\",\n columns: chartData[\"columns\"],\n names: chartData[\"names\"],\n color: function (color, d) {\n try{\n /*d can be object or plain string (id like data1)\n depends on the color it represents, if its legend its plain id, if its line its an obj*/\n var inx;\n (d.id) ? inx= shown.indexOf(d.id) : inx= shown.indexOf(d);\n return (inx < 0) ? colorsArray[colorsArray.length-1] : colorsArray[inx];\n }\n catch(e){\n return color;\n }\n },\n shown: shown,\n xFormat: \"%Y-%m\" //this tells the chart how to interpret the x axis data\n },\n point: {\n show: true,\n r: 5,\n focus: {\n expand: {\n enabled: true,\n r: 5\n }\n }\n\n },\n axis: {\n y: {\n show: true,\n label:{\n text: 'License Usage %',\n position: 'outer-middle'\n },\n padding: {\n top: 60,\n bottom: 30\n },\n tick: {\n format: function(y){\n return y+'%';\n }\n }\n },\n x: {\n type: 'timeseries',\n height: 50,\n tick: {\n max: 0,\n fit: true,\n format: '%b' //this tells the chart how to display the x axis data\n },\n padding:{\n left: 100,\n right: 0\n }\n }\n },\n transition: {\n duration: 500\n },\n onrendered: function(){\n },\n oninit: function() {\n //TODO move to constructor function\n initChart([\"data1\",\"data2\",\"data3\"],\n [\"#01a982\", \"#614767\", \"#ff8d6d\",\"#f0f0f0\"],\n [\"main-data\", \"second-data\", \"third-data\"]);\n }\n }\n\n return chartObjectDefinition;\n }", "title": "" }, { "docid": "8ff6b5399c5a95c865f96b1acf0e127b", "score": "0.57243496", "text": "function createRows() {\n\n for (var i = 0; i < $scope.rtts.length; i++){\n // If there is an alert triggered for one of the message types, then\n // add exclamation points to it\n if(data[i * $scope.unformattedTimes.length + 1].AlertTriggered){\n // This is done knowing that we should only have 5 time frames\n $scope.chartRows.push({\n c: [{v: '!!! ' + $scope.categories[i] + ' !!!'}, {v: $scope.rtts[i][0]}, {v: $scope.rtts[i][1]},\n {v: $scope.rtts[i][2]}, {v: $scope.rtts[i][3]}, {v: $scope.rtts[i][4]}]\n });\n }\n else {\n // This is done knowing that we should only have 5 time frames\n $scope.chartRows.push({\n c: [{v: $scope.categories[i]}, {v: $scope.rtts[i][0]}, {v: $scope.rtts[i][1]},\n {v: $scope.rtts[i][2]}, {v: $scope.rtts[i][3]}, {v: $scope.rtts[i][4]}]\n });\n }\n\n\n }\n }", "title": "" }, { "docid": "88a94a94f13db92e6ec6c9e8004704dc", "score": "0.5710099", "text": "function drawHCDCharts(){\n var H1_chart = new google.visualization.LineChart(document.getElementById('chart_H1'))\n var H2_chart = new google.visualization.LineChart(document.getElementById('chart_H2'))\n var HD_chart = new google.visualization.LineChart(document.getElementById('chart_HD'))\n var CX_chart = new google.visualization.LineChart(document.getElementById('chart_CX'))\n var CY_chart = new google.visualization.LineChart(document.getElementById('chart_CY'))\n var CZ_chart = new google.visualization.LineChart(document.getElementById('chart_CZ'))\n H1_chart.draw(chart_H1_data, chart_H1_options)\n H2_chart.draw(chart_H2_data, chart_H2_options)\n HD_chart.draw(chart_HD_data, chart_HD_options)\n CX_chart.draw(chart_CX_data, chart_CX_options)\n CY_chart.draw(chart_CY_data, chart_CY_options)\n CZ_chart.draw(chart_CZ_data, chart_CZ_options)\n}", "title": "" }, { "docid": "d6eb7e7c7426c2fb64a5006c06339f68", "score": "0.5709118", "text": "function populateSegmentChartData() {\n\t\t$scope.segmentChartConfig.series = [];\n\t\t$scope.segmentChartConfig.xAxis = {type: 'datetime',\n dateTimeLabelFormats: { // don't display the dummy year\n month: '%e %b',\n year: '%b'\n }\n };\n\t\t$scope.segmentChartConfig.options.chart.type = 'line';\n\t\tangular.forEach($scope.eventsData, function(series, index) {\n\t\t\t$scope.segmentChartConfig.series.push(series);\n\t\t});\t \t\n\t}", "title": "" }, { "docid": "9a88c9afc3075289ebf11790eab337cd", "score": "0.5709006", "text": "integrateData() {\n const filteredData = this.props.data.filter((data, index) => {\n if ( index < 10) {\n return true;\n } else {\n return false;\n }\n });\n\n const dataPoint = filteredData.map( data => {\n return {\n y: data.times,\n label: data.number\n }\n });\n\n return dataPoint;\n }", "title": "" }, { "docid": "3de36d7de29284df1af4587d1bd34956", "score": "0.57079613", "text": "function updateList() {\n let element = document.querySelector('#scrollableView');\n while (element.firstChild) {\n element.removeChild(element.firstChild);\n }\n\n // filter out the timestamps to show\n let timestamps = dataSet.data.properties.timeseries;\n console.log(timestamps);\n let filteredList = [];\n\n timestamps.forEach((timestamp, index) => {\n let remainingHours = 24 - today.getHours();\n let totalHours = remainingHours + 38;\n\n if (index < totalHours) {\n filteredList.push(timestamp);\n }\n });\n console.log(filteredList);\n\n filteredList.forEach((timestamp) => {\n let listItem = document.createElement('div');\n listItem.classList.add('visible');\n\n //get the info that's to be appended from the timestamps\n let listInfo = [\n timestamp.time.slice(11, 16),\n timestamp.data.next_1_hours.summary.symbol_code,\n timestamp.data.instant.details.air_temperature + '°',\n timestamp.data.next_1_hours.details.precipitation_amount + 'mm',\n timestamp.data.instant.details.wind_speed,\n timestamp.data.instant.details.relative_humidity + '% humidity',\n ];\n\n listInfo.forEach((item, index) => {\n let itemToAppend;\n if (index != 1) {\n itemToAppend = document.createElement('p');\n itemToAppend.append(item);\n } else {\n itemToAppend = document.createElement('img');\n itemToAppend.src = `weathericon/svg/${item}.svg`;\n }\n\n switch (index) {\n case 2:\n itemToAppend.classList.add('listTemp');\n break;\n case 3:\n itemToAppend.classList.add('listRain');\n break;\n case 4:\n itemToAppend.classList.add('listWind');\n itemToAppend.append('m/s');\n itemToAppend.value = item;\n break;\n case 5:\n itemToAppend.classList.add('listHum');\n break;\n }\n listItem.append(itemToAppend);\n });\n\n document.querySelector('#scrollableView').append(listItem);\n });\n}", "title": "" }, { "docid": "2bdee26e8cbb3b313291535e19124ad7", "score": "0.5707815", "text": "function plotChart() {\r\n plot=[]; //main data array.\r\n \r\n for (var i = 0; i < id; i++) { \r\n if($(\"#data\" + i).length != 0){ //check that data block exist of not.\r\n plotX=[]; // Xarray\r\n plotY=[]; //Yarray\r\n plotObj={}; //particular trace object\r\n plotSize=[]; // size array\r\n plotZ=[];\r\n console.log(\"id\"+i);\r\n \r\n var sel = document.getElementById(\"selectChart\"+i);\r\n var sv = sel.value;\r\n console.log(\"selectChart\"+sv);\r\n \r\n \r\n if(sv==\"pie\"){//if it is pie chart parse only x values.\r\n //parse the data\r\n var data=document.getElementById(\"dataInput\"+i).value;\r\n plotX=removeSemicolan(data);\r\n plotObj[\"text\"]=document.getElementById(\"traceTitle\"+(i)).value;\r\n var label=document.getElementById(\"dataLabel\"+i).value;\r\n var subLabel=label.split(\";\");//split the label\r\n var domainX=document.getElementById(\"domainX\"+i).value;\r\n var domainY=document.getElementById(\"domainY\"+i).value;\r\n domain={};\r\n domain[\"x\"]=domainX.split(\",\");\r\n domain[\"y\"]=domainY.split(\",\");\r\n plotObj[\"domain\"]=domain;\r\n\r\n plotObj[\"labels\"]=subLabel;\r\n plotObj[\"values\"]=plotX;\r\n plotObj[\"type\"]='pie';\r\n\r\n } \r\n else if(sv!=\"continous\"){ // if it is not continous type. Then parse X , Y values. else do sampling of continous function\r\n\r\n //parse the data\r\n var data=document.getElementById(\"dataInput\"+i).value;\r\n var dataparse=removeSemicolan(data);\r\n //console.log(dataparse);\r\n for (var j = 0; j < dataparse.length; j++) {\r\n\r\n var temp=dataparse[j];\r\n\r\n //alert(temp);\r\n var subData=temp.split(\",\"); //split into x,y\r\n //insert x,y values\r\n plotX.push(subData[0]); //x values\r\n \r\n plotY.push(subData[1]); // y values\r\n\r\n \r\n\r\n if(subData[2]!=null) // if there is size field also in data.\r\n if(sv==\"3d\"){\r\n plotZ.push(subData[2]); \r\n var selected = $('#3D'+i).find(\":selected\").val();\r\n if(selected==\"scatter3D\"){\r\n plotObj[\"type\"]='scatter3d';\r\n }else\r\n plotObj[\"type\"]='mesh3d';\r\n }else{\r\n plotSize.push(subData[2]); \r\n }\r\n \r\n\r\n }\r\n }else{ //for continous function\r\n\r\n var result=continousFunction(i); // return the discrete value of continous fn.\r\n plotX=result.X;\r\n plotY=result.Y;\r\n var line={}\r\n line[\"shape\"]=\"spline\";\r\n \r\n // 0 - 1.3 \r\n \r\n //line[\"simplify\"]=false;\r\n //plotObj[\"line\"]=line;\r\n\r\n //console.log(\"the color s\"+$(\"#add-new-event\"+i).css(\"color\"));\r\n var e5 = document.getElementById(\"opacity\"+i);\r\n var opacity = e5.options[e5.selectedIndex].value;\r\n \r\n \r\n // to change rgb value to rgba value.\r\n var bg = $(\"#add-new-event\"+i).css(\"background-color\");\r\n line[\"framecolor\"]=bg;\r\n if(bg.indexOf('a') == -1){\r\n bg = bg.replace(')', ','+opacity+' )').replace('rgb', 'rgba');\r\n }\r\n line[\"color\"]=bg;\r\n line[\"smoothing\"]=opacity;\r\n\r\n var e = document.getElementById(\"width\"+i);\r\n \r\n var width = e.options[e.selectedIndex].value;\r\n line[\"width\"]=width; \r\n var e1 = document.getElementById(\"filling\"+i);\r\n var filling = e1.options[e1.selectedIndex].value;\r\n if(filling==\"noLine\" && markerTag == \"lines\"){\r\n plotObj[\"mode\"]=\"none\";\r\n }else if(filling==\"noLine\"){plotObj[\"mode\"]=\"markers\";}\r\n else\r\n line[\"dash\"]=filling;\r\n var fill=document.getElementById(\"fill\"+i).value;\r\n plotObj[\"fill\"]=fill;\r\n\r\n\r\n plotObj[\"mode\"]=\"lines\";\r\n plotObj[\"line\"]=line;\r\n var fn=document.getElementById(\"dataInput\"+i).value;\r\n var range=document.getElementById(\"dataRange\"+i).value;\r\n plotObj[\"function\"]=fn;\r\n plotObj[\"range\"]=range;\r\n plotObj[\"type\"]=\"continous\";\r\n plotObj[\"x\"] = plotX;\r\n plotObj[\"y\"] = plotY;\r\n }\r\n\r\n\r\n\r\n if(sv==\"line\"){ // for the scatter type plot.\r\n \r\n var marker={}; // marker object\r\n line={}; //line object\r\n var label=document.getElementById(\"dataLabel\"+i).value;\r\n var subLabel=label.split(\";\");//split the label\r\n plotObj[\"text\"]=subLabel;\r\n plotObj[\"type\"]=\"scatter\";\r\n \r\n var m1=document.getElementById(\"marker\"+i);\r\n var markerTag = m1.options[m1.selectedIndex].value;\r\n\r\n\r\n var mm=document.getElementById(\"thickness\"+i);\r\n var lineThickness = mm.options[mm.selectedIndex].value;\r\n \r\n if(markerTag==\"lines\"){\r\n plotObj[\"mode\"]=markerTag;//no markers , only line\r\n line[\"width\"]=lineThickness;\r\n }else{\r\n plotObj[\"mode\"]=\"lines+markers\";//marker+lines\r\n line[\"width\"]=lineThickness;\r\n }\r\n var e5 = document.getElementById(\"opacity\"+i);\r\n var opacity = e5.options[e5.selectedIndex].value;\r\n console.log(\"the color s\"+$(\"#add-new-event\"+i).css(\"color\")); \r\n \r\n // to change rgb value top rgba value.\r\n var bg = $(\"#add-new-event\"+i).css(\"background-color\");\r\n line[\"framecolor\"]=bg;\r\n\r\n if(bg.indexOf('a') == -1){\r\n bg = bg.replace(')', ','+opacity+' )').replace('rgb', 'rgba');\r\n }\r\n\r\n line[\"color\"]=bg;\r\n //marker width\r\n var e = document.getElementById(\"marker\"+i);\r\n var width = e.options[e.selectedIndex].value;\r\n marker[\"size\"]=width;\r\n var e1 = document.getElementById(\"filling\"+i);\r\n var filling = e1.options[e1.selectedIndex].value;\r\n if(filling==\"noLine\" && markerTag == \"lines\"){\r\n plotObj[\"mode\"]=\"none\";\r\n }else if(filling==\"noLine\"){plotObj[\"mode\"]=\"markers\";}\r\n else\r\n line[\"dash\"]=filling;\r\n\r\n var e6 = document.getElementById(\"markerOpacity\"+i);\r\n var opacity = e6.options[e6.selectedIndex].value;\r\n //console.log(\"the color s\"+$(\"#add-new-event\"+i).css(\"color\")); \r\n\r\n var e2 = document.getElementById(\"shape\"+i);\r\n var shape = e2.options[e2.selectedIndex].value;\r\n console.log(\"shape\"+shape);\r\n line[\"shape\"]=shape;\r\n line[\"smoothing\"]=opacity;\r\n plotObj[\"line\"]=line;\r\n\r\n var fill=document.getElementById(\"fill\"+i).value;\r\n plotObj[\"fill\"]=fill;\r\n //marker property here\r\n\r\n \r\n \r\n // to change rgb value top rgba value.\r\n var bg1 = $(\"#new-event\"+i).css(\"background-color\");\r\n marker[\"framecolor\"]=bg1;\r\n if(bg1.indexOf('a') == -1){\r\n bg1 = bg1.replace(')', ','+opacity+' )').replace('rgb', 'rgba');\r\n }\r\n\r\n marker[\"color\"]=bg1;\r\n marker[\"smoothing\"]=opacity;\r\n plotObj[\"marker\"]=marker;\r\n plotObj[\"x\"] = plotX;\r\n plotObj[\"y\"] = plotY;\r\n\r\n\r\n }\r\n if(sv==\"bar\"){\r\n //console.log(\"Bar\")\r\n plotObj[\"type\"]=\"bar\";\r\n\r\n marker={};\r\n console.log(\"the color s\"+$(\"#add-new-event\"+i).css(\"color\"));\r\n var e5 = document.getElementById(\"opacity\"+i);\r\n var opacity = e5.options[e5.selectedIndex].value;\r\n // console.log(\"the color s\"+$(\"#add-new-event\"+i).css(\"color\")); \r\n \r\n // to change rgb value top rgba value.\r\n var bg = $(\"#add-new-event\"+i).css(\"background-color\");\r\n marker[\"framecolor\"]=bg;\r\n if(bg.indexOf('a') == -1){\r\n bg = bg.replace(')', ','+opacity+' )').replace('rgb', 'rgba');\r\n }\r\n marker[\"color\"]=bg;\r\n var line={};\r\n var e = document.getElementById(\"width\"+i);\r\n \r\n var width = e.options[e.selectedIndex].value;\r\n line[\"width\"]=width;\r\n var bg1 = $(\"#add-new-event\"+i).css(\"background-color\");\r\n if(bg1.indexOf('a') == -1){\r\n bg1 = bg1.replace(')', ','+1+' )').replace('rgb', 'rgba');\r\n }\r\n line[\"color\"]=bg1;\r\n marker[\"line\"]=line;\r\n marker[\"smoothing\"]=opacity;\r\n plotObj[\"marker\"]=marker;\r\n plotObj[\"x\"] = plotX;\r\n plotObj[\"y\"] = plotY;\r\n // plotObj[\"line\"]=line;\r\n }\r\n if(sv==\"bubble\"){\r\n plotObj[\"mode\"]=\"markers\";\r\n //console.log(\"I m here\");\r\n marker={};\r\n if(!plotSize.length<1){ //if plotsize is not empty.\r\n //make an object\r\n marker[\"size\"]=plotSize; \r\n }\r\n var label=document.getElementById(\"dataLabel\"+i).value;\r\n var subLabel=label.split(\";\");\r\n plotObj[\"text\"]=subLabel;\r\n var e5 = document.getElementById(\"opacity\"+i);\r\n var opacity = e5.options[e5.selectedIndex].value;\r\n //console.log(\"the color s\"+$(\"#add-new-event\"+i).css(\"color\")); \r\n \r\n // to change rgb value top rgba value.\r\n var bg = $(\"#add-new-event\"+i).css(\"background-color\");\r\n marker[\"framecolor\"]=bg;\r\n if(bg.indexOf('a') == -1){\r\n bg = bg.replace(')', ','+opacity+' )').replace('rgb', 'rgba');\r\n }\r\n\r\n marker[\"color\"]=bg;\r\n marker[\"smoothing\"]=opacity;\r\n var e2 = document.getElementById(\"symbol\"+i);\r\n var shape = e2.options[e2.selectedIndex].value;\r\n // console.log(\"shape\"+shape);\r\n marker[\"symbol\"]=shape;\r\n\r\n plotObj[\"marker\"]=marker;\r\n plotObj[\"x\"] = plotX;\r\n plotObj[\"y\"] = plotY;\r\n }\r\n \r\n \r\n if(sv=='3d'){\r\n \r\n plotObj[\"z\"] = plotZ;\r\n\r\n var marker={}; // marker object\r\n line={}; //line object\r\n \r\n var m1=document.getElementById(\"marker\"+i);\r\n var markerTag = m1.options[m1.selectedIndex].value;\r\n\r\n\r\n var mm=document.getElementById(\"thickness\"+i);\r\n var lineThickness = mm.options[mm.selectedIndex].value;\r\n \r\n if(markerTag==\"lines\"){\r\n plotObj[\"mode\"]=markerTag;//no markers , only line\r\n line[\"width\"]=lineThickness;\r\n }else{\r\n plotObj[\"mode\"]=\"lines+markers\";//marker+lines\r\n line[\"width\"]=lineThickness;\r\n }\r\n var e5 = document.getElementById(\"opacity\"+i);\r\n var opacity = e5.options[e5.selectedIndex].value;\r\n console.log(\"the color s\"+$(\"#add-new-event\"+i).css(\"color\")); \r\n \r\n // to change rgb value top rgba value.\r\n var bg = $(\"#add-new-event\"+i).css(\"background-color\");\r\n line[\"framecolor\"]=bg;\r\n if(bg.indexOf('a') == -1){\r\n bg = bg.replace(')', ','+opacity+' )').replace('rgb', 'rgba');\r\n }\r\n\r\n line[\"color\"]=bg;\r\n line[\"smoothing\"]=opacity;\r\n //marker width\r\n var e = document.getElementById(\"marker\"+i);\r\n var width = e.options[e.selectedIndex].value;\r\n marker[\"size\"]=width;\r\n \r\n marker[\"line\"]=line;\r\n\r\n \r\n //marker property here\r\n\r\n var e6 = document.getElementById(\"markerOpacity\"+i);\r\n var opacity = e6.options[e6.selectedIndex].value;\r\n //console.log(\"the color s\"+$(\"#add-new-event\"+i).css(\"color\")); \r\n \r\n // to change rgb value top rgba value.\r\n var bg1 = $(\"#new-event\"+i).css(\"background-color\");\r\n marker[\"framecolor\"]=bg1;\r\n if(bg1.indexOf('a') == -1){\r\n bg1 = bg1.replace(')', ','+opacity+' )').replace('rgb', 'rgba');\r\n }\r\n\r\n marker[\"color\"]=bg1;\r\n marker[\"smoothing\"]=opacity;\r\n plotObj[\"marker\"]=marker;\r\n plotObj[\"x\"] = plotX;\r\n plotObj[\"y\"] = plotY;\r\n\r\n }\r\n\r\n \r\n\r\n //plotObj[\"mode\"]=\"scatter\";\r\n //console.log(\"traceTitle\"+(i-1));\r\n plotObj[\"name\"]=document.getElementById(\"traceTitle\"+(i)).value;\r\n plot.push(plotObj);\r\n\r\n \r\n }\r\n}\r\n\r\n var plotData = plot;//JSON.parse(document.getElementById(\"plot-data\").value);\r\n //document.getElementById(\"demo\").innerHTML = document.getElementById(\"plot-data\").value;\r\n var data = plotData;\r\n\r\n//var layout = JSON.parse(document.getElementById(\"layout\").value);\r\n// var plotJson={};\r\n// plotJson[\"plotdata\"]=data;\r\n// plotJson[\"layout\"]=layout();\r\n// var dataStr = \"data:text/json;charset=utf-8,\" + encodeURIComponent(JSON.stringify(plotJson));\r\n// var dlAnchorElem = document.getElementById('downloadAnchorElem');\r\n// dlAnchorElem.setAttribute(\"href\", dataStr );\r\n// dlAnchorElem.setAttribute(\"download\", \"PlotJson.json\");\r\n// dlAnchorElem.click();\r\n\r\n// var dataStr = \"data:text/json;charset=utf-8,\" + encodeURIComponent(JSON.stringify(layout()));\r\n// var dlAnchorElem = document.getElementById('adownloadAnchorElem');\r\n// dlAnchorElem.setAttribute(\"href\", dataStr );\r\n// dlAnchorElem.setAttribute(\"download\", \"layout.json\");\r\n// dlAnchorElem.click();\r\n\r\n// var aspectratio = document.getElementById(\"aspectRatio\").value;\r\n\r\n\r\n // MAKE THE PLOTS RESPONSIVE\r\n (function() {\r\n var d3 = Plotly.d3;\r\n var WIDTH_IN_PERCENT_OF_PARENT = 100,\r\n HEIGHT_IN_PERCENT_OF_PARENT = 100;\r\n \r\n var gd3 = d3.select(\"#myDiv\")\r\n .style({\r\n width: WIDTH_IN_PERCENT_OF_PARENT + '%'\r\n // height: HEIGHT_IN_PERCENT_OF_PARENT + '%'\r\n });\r\n\r\n var nodes_to_resize = gd3[0]; //not sure why but the goods are within a nested array\r\n window.onresize = function() {\r\n for (var i = 0; i < nodes_to_resize.length; i++) {\r\n Plotly.Plots.resize(nodes_to_resize[i]);\r\n }\r\n };\r\n })();\r\n\r\n\r\n Plotly.newPlot('myDiv', data ,layout(), {displaylogo: false, modeBarButtonsToRemove: ['sendDataToCloud','hoverCompareCartesian']});\r\n\r\n\r\n// dataobj=metadata();\r\ndataobj=layout();\r\nvar dataobj_plot ={};\r\ndataobj_plot=data;\r\n// console.log(\"dataobj---\"+ JSON.stringify(dataobj));\r\ndocument.getElementById(\"layout_update\").value = JSON.stringify(dataobj);\r\ndocument.getElementById(\"plotdata_update\").value = JSON.stringify(dataobj_plot);\r\n\r\n}", "title": "" }, { "docid": "ca298e467c0f7cdca019baa133ad7345", "score": "0.57048416", "text": "function extendTotalSPChart(dataSet, iterationsNeeded, iterationLength) {\r\n var count = dataSet.length;\r\n\r\n //iteration time in ms\r\n var iterationTime = iterationLength * 24 * 3600 * 1000;\r\n\r\n //next date & next value\r\n var nextDate = dataSet[count - 1].x + iterationTime;\r\n\r\n //auxiliar variable\r\n var tempIteration = iterationsNeeded;\r\n\r\n while (tempIteration > 0) {\r\n dataSet.push({ x: nextDate, y: dataSet[count - 1].y });\r\n nextDate = nextDate + iterationTime;\r\n tempIteration = tempIteration - 1;\r\n }\r\n}", "title": "" }, { "docid": "365935b73f1e2855fbc249a09c07945c", "score": "0.57038325", "text": "function dashboardFlotOne() {\n\n var data1 = [\n [0, 4],\n [1, 8],\n [2, 5],\n [3, 10],\n [4, 4],\n [5, 16],\n [6, 5],\n [7, 11],\n [8, 6],\n [9, 11],\n [10, 30],\n [11, 10],\n [12, 13],\n [13, 4],\n [14, 3],\n [15, 3],\n [16, 6]\n ];\n var data2 = [\n [0, 1],\n [1, 0],\n [2, 2],\n [3, 0],\n [4, 1],\n [5, 3],\n [6, 1],\n [7, 5],\n [8, 2],\n [9, 3],\n [10, 2],\n [11, 1],\n [12, 0],\n [13, 2],\n [14, 8],\n [15, 0],\n [16, 0]\n ];\n\n var options = {\n series: {\n lines: {\n show: false,\n fill: true\n },\n splines: {\n show: true,\n tension: 0.4,\n lineWidth: 1,\n fill: 0.4\n },\n points: {\n radius: 0,\n show: true\n },\n shadowSize: 2,\n grow: {stepMode:\"linear\",stepDirection:\"up\",steps:80}\n },\n grow: {stepMode:\"linear\",stepDirection:\"up\",steps:80},\n grid: {\n hoverable: true,\n clickable: true,\n tickColor: \"#d5d5d5\",\n borderWidth: 1,\n color: '#d5d5d5'\n },\n colors: [\"#1ab394\", \"#1C84C6\"],\n xaxis: {\n },\n yaxis: {\n ticks: 4\n },\n tooltip: false\n };\n\n /**\n * Definition of variables\n * Flot chart\n */\n this.flotData = [data1, data2];\n this.flotOptions = options;\n}", "title": "" }, { "docid": "365935b73f1e2855fbc249a09c07945c", "score": "0.57038325", "text": "function dashboardFlotOne() {\n\n var data1 = [\n [0, 4],\n [1, 8],\n [2, 5],\n [3, 10],\n [4, 4],\n [5, 16],\n [6, 5],\n [7, 11],\n [8, 6],\n [9, 11],\n [10, 30],\n [11, 10],\n [12, 13],\n [13, 4],\n [14, 3],\n [15, 3],\n [16, 6]\n ];\n var data2 = [\n [0, 1],\n [1, 0],\n [2, 2],\n [3, 0],\n [4, 1],\n [5, 3],\n [6, 1],\n [7, 5],\n [8, 2],\n [9, 3],\n [10, 2],\n [11, 1],\n [12, 0],\n [13, 2],\n [14, 8],\n [15, 0],\n [16, 0]\n ];\n\n var options = {\n series: {\n lines: {\n show: false,\n fill: true\n },\n splines: {\n show: true,\n tension: 0.4,\n lineWidth: 1,\n fill: 0.4\n },\n points: {\n radius: 0,\n show: true\n },\n shadowSize: 2,\n grow: {stepMode:\"linear\",stepDirection:\"up\",steps:80}\n },\n grow: {stepMode:\"linear\",stepDirection:\"up\",steps:80},\n grid: {\n hoverable: true,\n clickable: true,\n tickColor: \"#d5d5d5\",\n borderWidth: 1,\n color: '#d5d5d5'\n },\n colors: [\"#1ab394\", \"#1C84C6\"],\n xaxis: {\n },\n yaxis: {\n ticks: 4\n },\n tooltip: false\n };\n\n /**\n * Definition of variables\n * Flot chart\n */\n this.flotData = [data1, data2];\n this.flotOptions = options;\n}", "title": "" }, { "docid": "23cfdde6252a65043d51edbf4daebc59", "score": "0.5701125", "text": "function renderChart(element, chartType, data) {\nconsole.log('renderChart is working')\n var lineChart = new Chart(element, {\n type: chartType,\n data: data,\n options: {\n responsive: true,\n maintainAspectRatio: true,\n legend: {\n display: false\n },\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero:true\n }\n }]\n },\n }\n });\n}", "title": "" } ]
205b3c72288579d0a5de0e6f85c95568
Creates a new React class that is idempotent and capable of containing other React components. It accepts event listeners and DOM properties that are valid according to `DOMProperty`. Event listeners: `onClick`, `onMouseDown`, etc. DOM properties: `className`, `name`, `title`, etc. The `style` property functions differently from the DOM API. It accepts an object mapping of style properties to values.
[ { "docid": "d1582838989986f10622aa7360a10a36", "score": "0.0", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (true) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" } ]
[ { "docid": "14624c287638c8e9714103ce3b24c36e", "score": "0.56001544", "text": "function Style (displayName, style, options) {\n\toptions = options || {};\n\t\n\tthis.displayName = displayName;\n\n\tthis._prefix = 'react-' + toHyphenDelimited(displayName) + '_';\n\t\n\tthis._selectorPrefix = '.react-view.' + this._prefix.substr(0, this._prefix.length-1) + ' ';\n\n\tthis.rules = {};\n\tthis.animations = {};\n\tthis.instanceRules = {};\n\tthis.mediaQueries = {};\n\n\tthis.parseStyle(style);\n}", "title": "" }, { "docid": "0ff068bef15d9c39862bf31d233e051b", "score": "0.5551513", "text": "function Component(options) {\n //tslint:disable-line\n return descriptor => {\n return {\n elements: descriptor.elements,\n constructor: undefined,\n kind: 'class',\n finisher: target => {\n if (!_customelement__WEBPACK_IMPORTED_MODULE_0__[\"CustomElement\"].isPrototypeOf(target)) {\n throw new Error(`${target.name} must extend CustomElement`);\n }\n\n const componentExtendedOptions = { ...options,\n cssStyles: [],\n shadyCSSStyleSheetAdopted: false,\n templateCache: null\n };\n const prototype = Object.getPrototypeOf(target);\n const prototypeClassProperties = Object(_classproperties__WEBPACK_IMPORTED_MODULE_1__[\"getClassProperties\"])(prototype);\n\n if (prototypeClassProperties) {\n const targetClassProperties = Object(_classproperties__WEBPACK_IMPORTED_MODULE_1__[\"getClassProperties\"])(target);\n prototypeClassProperties.forEach((value, key) => {\n targetClassProperties.set(key, value);\n });\n }\n\n const componentStyles = Array.isArray(options.style) ? options.style : [options.style || ''];\n const componentCSSStyles = componentStyles.map(value => {\n if (_utils__WEBPACK_IMPORTED_MODULE_6__[\"supportsAdoptingStyleSheets\"]) {\n const css = new CSSStyleSheet();\n css.replaceSync(value);\n return css;\n } else {\n return {\n cssText: value\n };\n }\n });\n\n if (componentExtendedOptions.inheritStyle) {\n const parentStyle = Object(_componentproperties__WEBPACK_IMPORTED_MODULE_2__[\"getComponentProperties\"])(prototype).cssStyles;\n componentExtendedOptions.cssStyles.push(...parentStyle);\n componentExtendedOptions.cssStyles.push(...componentCSSStyles);\n } else {\n componentExtendedOptions.cssStyles.push(...componentCSSStyles);\n }\n\n const prototypeWatcher = Object(_classpropertywatcher__WEBPACK_IMPORTED_MODULE_3__[\"getAllClassPropertyWatcher\"])(prototype);\n\n if (prototypeWatcher.size > 0) {\n Array.from(prototypeWatcher.entries()).forEach(([property, watcher]) => {\n Object(_classpropertywatcher__WEBPACK_IMPORTED_MODULE_3__[\"getClassPropertyWatcher\"])(target, property).push(...watcher);\n });\n }\n\n const prototypeInterceptor = Object(_classpropertyinterceptors__WEBPACK_IMPORTED_MODULE_4__[\"getAllClassPropertyInterceptors\"])(prototype);\n\n if (prototypeInterceptor.size > 0) {\n Array.from(prototypeInterceptor.entries()).forEach(([property, interceptor]) => {\n Object(_classpropertyinterceptors__WEBPACK_IMPORTED_MODULE_4__[\"getClassPropertyInterceptor\"])(target, property).push(...interceptor);\n });\n }\n\n const events = Object(_classevents__WEBPACK_IMPORTED_MODULE_5__[\"getClassEvents\"])(prototype);\n\n if (events.size > 0) {\n Array.from(events.entries()).forEach(([event, option]) => {\n Object(_classevents__WEBPACK_IMPORTED_MODULE_5__[\"getClassEvents\"])(target).set(event, option);\n });\n }\n\n Object(_componentproperties__WEBPACK_IMPORTED_MODULE_2__[\"setComponentProperties\"])(target, componentExtendedOptions);\n window.customElements.define(options.tag, target);\n }\n };\n };\n}", "title": "" }, { "docid": "45088302fb076c8e4bcfb968141eec1f", "score": "0.5521962", "text": "updateNativeProps(nativeProps, classList) {\n let { style, pointerEvents } = nativeProps;\n\n if (pointerEvents) {\n style || (style = {});\n style.pointerEvents = pointerEvents;\n delete nativeProps.pointerEvents;\n }\n\n if (style == null) {\n return;\n }\n if (style.constructor !== Object) {\n throw TypeError('Expected `nativeProps.style` to be an Object!');\n }\n\n const classNamesByProp = {};\n forEach(classList, (className) => {\n const { prop } = this.styleManager.getDeclaration(className);\n prop && (classNamesByProp[prop] = className);\n });\n\n const inlineStyle = {};\n style = createReactDOMStyle(style);\n Object.keys(style).forEach(prop => {\n const value = style[prop];\n if (value != null) {\n const className = this.styleManager.getClassName(prop, value);\n if (className) {\n const prevClassName = classNamesByProp[prop];\n if (!prevClassName) {\n classList.add(className);\n }\n else if (className !== prevClassName) {\n classList.remove(prevClassName);\n classList.add(className);\n }\n inlineStyle[prop] = null;\n } else {\n inlineStyle[prop] = value;\n }\n }\n });\n\n nativeProps.style = prefixInlineStyles(inlineStyle);\n }", "title": "" }, { "docid": "e44dbcca8671226c504d8983199cfeaf", "score": "0.5431071", "text": "function createElement(type,config,children){var propName=void 0;// Reserved names are extracted\nvar props={};var key=null;var ref=null;var self=null;var source=null;if(config!=null){if(hasValidRef(config)){ref=config.ref;}if(hasValidKey(config)){key=''+config.key;}self=config.__self===undefined?null:config.__self;source=config.__source===undefined?null:config.__source;// Remaining properties are added to a new props object\nfor(propName in config){if(hasOwnProperty.call(config,propName)&&!RESERVED_PROPS.hasOwnProperty(propName)){props[propName]=config[propName];}}}// Children can be more than one argument, and those are transferred onto\n// the newly allocated props object.\nvar childrenLength=arguments.length-2;if(childrenLength===1){props.children=children;}else if(childrenLength>1){var childArray=Array(childrenLength);for(var i=0;i<childrenLength;i++){childArray[i]=arguments[i+2];}{if(Object.freeze){Object.freeze(childArray);}}props.children=childArray;}// Resolve default props\nif(type&&type.defaultProps){var defaultProps=type.defaultProps;for(propName in defaultProps){if(props[propName]===undefined){props[propName]=defaultProps[propName];}}}{if(key||ref){if(typeof props.$$typeof==='undefined'||props.$$typeof!==REACT_ELEMENT_TYPE){var displayName=typeof type==='function'?type.displayName||type.name||'Unknown':type;if(key){defineKeyPropWarningGetter(props,displayName);}if(ref){defineRefPropWarningGetter(props,displayName);}}}}return ReactElement(type,key,ref,self,source,ReactCurrentOwner.current,props);}", "title": "" }, { "docid": "6b60cad30f3fd7f3d94eea3362943b1d", "score": "0.5420334", "text": "function getMyReact() {\n function render(element, parent) {\n // Get the props and type from element object\n const { type, props } = element;\n\n // Check if it is a text element\n const isTextElement = type === \"TEXT_ELEMENT\";\n\n // Create a new dom element\n const dom = !isTextElement\n ? document.createElement(type)\n : document.createTextNode(props.nodeValue);\n\n // Filter for eventListeners in the props\n const isListener = name => name.startsWith(\"on\");\n\n // Add eventListeners to the dom element\n Object.keys(props)\n .filter(isListener)\n .forEach(name => {\n const eventType = name.toLowerCase().substring(2);\n dom.addEventListener(eventType, props[name]);\n });\n\n const isAttribute = name => !isAttribute && name !== \"children\";\n\n Object.keys(props)\n .filter(isAttribute)\n .forEach(name => {\n dom[name] = props[name];\n });\n\n // Check if there are any childrens of the given element\n const childElements = props.children || [];\n\n // render those childrens recursively first\n childElements.forEach(el => render(el, dom));\n\n // finally append the element to the parent element\n parent.appendChild(dom);\n }\n\n function createElement(type, config, ...args) {\n const props = Object.assign({}, config);\n const hasChildren = args.length > 0;\n\n const allChildren = hasChildren ? [].concat(...args) : [];\n\n props.children = allChildren\n .filter(child => child !== null && child !== false)\n .map(child =>\n child instanceof Object ? child : createTextElement(child)\n );\n\n return { type, props };\n }\n\n function createTextElement(value) {\n return {\n type: TEXT_ELEMENT,\n props: {\n nodeValue: value\n }\n };\n }\n return {\n render,\n createElement\n };\n}", "title": "" }, { "docid": "db640b80d16a2be58b7817b498f3bd7c", "score": "0.54094386", "text": "function styled(Component) {\n var componentCreator = function componentCreator(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var name = options.name,\n stylesOptions = Object(objectWithoutProperties[\"a\" /* default */])(options, [\"name\"]);\n\n if (false) {}\n\n var classNamePrefix = name;\n\n if (false) { var displayName; }\n\n var stylesOrCreator = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style(Object(esm_extends[\"a\" /* default */])({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n var useStyles = Object(makeStyles[\"a\" /* default */])(stylesOrCreator, Object(esm_extends[\"a\" /* default */])({\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var filterProps;\n var propTypes = {};\n\n if (style.filterProps) {\n filterProps = style.filterProps;\n delete style.filterProps;\n }\n /* eslint-disable react/forbid-foreign-prop-types */\n\n\n if (style.propTypes) {\n propTypes = style.propTypes;\n delete style.propTypes;\n }\n /* eslint-enable react/forbid-foreign-prop-types */\n\n\n var StyledComponent = react_default.a.forwardRef(function StyledComponent(props, ref) {\n var children = props.children,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = Object(objectWithoutProperties[\"a\" /* default */])(props, [\"children\", \"className\", \"clone\", \"component\"]);\n\n var classes = useStyles(props);\n var className = clsx_default()(classes.root, classNameProp);\n var spread = other;\n\n if (filterProps) {\n spread = omit(spread, filterProps);\n }\n\n if (clone) {\n return react_default.a.cloneElement(children, Object(esm_extends[\"a\" /* default */])({\n className: clsx_default()(children.props.className, className)\n }, spread));\n }\n\n if (typeof children === 'function') {\n return children(Object(esm_extends[\"a\" /* default */])({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return /*#__PURE__*/react_default.a.createElement(FinalComponent, Object(esm_extends[\"a\" /* default */])({\n ref: ref,\n className: className\n }, spread), children);\n });\n false ? undefined : void 0;\n\n if (false) {}\n\n hoist_non_react_statics_cjs_default()(StyledComponent, Component);\n return StyledComponent;\n };\n\n return componentCreator;\n}", "title": "" }, { "docid": "46c21c7c1966f52ab58a43ffe4cf961a", "score": "0.53784853", "text": "function Styles() {\n\n var defaultTraits = {\n\n 'no-fill': {\n fill: 'none'\n },\n 'no-border': {\n strokeOpacity: 0.0\n },\n 'no-events': {\n pointerEvents: 'none'\n }\n };\n\n var self = this;\n\n /**\n * Builds a style definition from a className, a list of traits and an object of additional attributes.\n *\n * @param {String} className\n * @param {Array<String>} traits\n * @param {Object} additionalAttrs\n *\n * @return {Object} the style defintion\n */\n this.cls = function(className, traits, additionalAttrs) {\n var attrs = this.style(traits, additionalAttrs);\n\n return Object(__WEBPACK_IMPORTED_MODULE_0_min_dash__[\"a\" /* assign */])(attrs, { 'class': className });\n };\n\n /**\n * Builds a style definition from a list of traits and an object of additional attributes.\n *\n * @param {Array<String>} traits\n * @param {Object} additionalAttrs\n *\n * @return {Object} the style defintion\n */\n this.style = function(traits, additionalAttrs) {\n\n if (!Object(__WEBPACK_IMPORTED_MODULE_0_min_dash__[\"i\" /* isArray */])(traits) && !additionalAttrs) {\n additionalAttrs = traits;\n traits = [];\n }\n\n var attrs = Object(__WEBPACK_IMPORTED_MODULE_0_min_dash__[\"t\" /* reduce */])(traits, function(attrs, t) {\n return Object(__WEBPACK_IMPORTED_MODULE_0_min_dash__[\"a\" /* assign */])(attrs, defaultTraits[t] || {});\n }, {});\n\n return additionalAttrs ? Object(__WEBPACK_IMPORTED_MODULE_0_min_dash__[\"a\" /* assign */])(attrs, additionalAttrs) : attrs;\n };\n\n this.computeStyle = function(custom, traits, defaultStyles) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_0_min_dash__[\"i\" /* isArray */])(traits)) {\n defaultStyles = traits;\n traits = [];\n }\n\n return self.style(traits || [], Object(__WEBPACK_IMPORTED_MODULE_0_min_dash__[\"a\" /* assign */])({}, defaultStyles, custom || {}));\n };\n}", "title": "" }, { "docid": "d918f6e48cb9d954935c507699a72927", "score": "0.53218955", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "d918f6e48cb9d954935c507699a72927", "score": "0.53218955", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "d918f6e48cb9d954935c507699a72927", "score": "0.53218955", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "aad3b02a884039d3e4ce775dd7ead1a8", "score": "0.5319181", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty$1.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "aad3b02a884039d3e4ce775dd7ead1a8", "score": "0.5319181", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty$1.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "aad3b02a884039d3e4ce775dd7ead1a8", "score": "0.5319181", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty$1.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5306349", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5306349", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5306349", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5306349", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5306349", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5306349", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5306349", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5306349", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5306349", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5306349", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5306349", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5306349", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5306349", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5306349", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5306349", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5306349", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5306349", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5306349", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5306349", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "9d46e8d6d4266f3eeaf54c8353ad8724", "score": "0.5301322", "text": "function styled(Component) {\n var componentCreator = function componentCreator(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var name = options.name,\n stylesOptions = _objectWithoutProperties$1(options, [\"name\"]);\n\n var classNamePrefix = name;\n\n var stylesOrCreator = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style(_extends$5({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n var useStyles = makeStyles(stylesOrCreator, _extends$5({\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var filterProps;\n var propTypes = {};\n\n if (style.filterProps) {\n filterProps = style.filterProps;\n delete style.filterProps;\n }\n /* eslint-disable react/forbid-foreign-prop-types */\n\n\n if (style.propTypes) {\n propTypes = style.propTypes;\n delete style.propTypes;\n }\n /* eslint-enable react/forbid-foreign-prop-types */\n\n\n var StyledComponent = react.forwardRef(function StyledComponent(props, ref) {\n var children = props.children,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = _objectWithoutProperties$1(props, [\"children\", \"className\", \"clone\", \"component\"]);\n\n var classes = useStyles(props);\n var className = clsx(classes.root, classNameProp);\n var spread = other;\n\n if (filterProps) {\n spread = omit(spread, filterProps);\n }\n\n if (clone) {\n return react.cloneElement(children, _extends$5({\n className: clsx(children.props.className, className)\n }, spread));\n }\n\n if (typeof children === 'function') {\n return children(_extends$5({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return react.createElement(FinalComponent, _extends$5({\n ref: ref,\n className: className\n }, spread), children);\n });\n\n hoistNonReactStatics_cjs(StyledComponent, Component);\n return StyledComponent;\n };\n\n return componentCreator;\n }", "title": "" }, { "docid": "9f1171d208f5565c43cf12483625f77e", "score": "0.5272749", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "9f1171d208f5565c43cf12483625f77e", "score": "0.5272749", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "9f1171d208f5565c43cf12483625f77e", "score": "0.5272749", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "f6f0583c22e27f7f4f406c079c3c9aa1", "score": "0.52505356", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "3366fa3b7cd858fa0684c69566cc66e9", "score": "0.52401274", "text": "function createElement(type, config, children) {\n var arguments$1 = arguments;\n\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments$1[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "a8ed8da7e2e2fdf3dbaf823ab77e14de", "score": "0.5235427", "text": "function createElement(type, config, children) {\n\t var propName = void 0;\n\n\t // Reserved names are extracted\n\t var props = {};\n\n\t var key = null;\n\t var ref = null;\n\t var self = null;\n\t var source = null;\n\n\t if (config != null) {\n\t if (hasValidRef(config)) {\n\t ref = config.ref;\n\t }\n\t if (hasValidKey(config)) {\n\t key = '' + config.key;\n\t }\n\n\t self = config.__self === undefined ? null : config.__self;\n\t source = config.__source === undefined ? null : config.__source;\n\t // Remaining properties are added to a new props object\n\t for (propName in config) {\n\t if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n\t props[propName] = config[propName];\n\t }\n\t }\n\t }\n\n\t // Children can be more than one argument, and those are transferred onto\n\t // the newly allocated props object.\n\t var childrenLength = arguments.length - 2;\n\t if (childrenLength === 1) {\n\t props.children = children;\n\t } else if (childrenLength > 1) {\n\t var childArray = Array(childrenLength);\n\t for (var i = 0; i < childrenLength; i++) {\n\t childArray[i] = arguments[i + 2];\n\t }\n\t {\n\t if (Object.freeze) {\n\t Object.freeze(childArray);\n\t }\n\t }\n\t props.children = childArray;\n\t }\n\n\t // Resolve default props\n\t if (type && type.defaultProps) {\n\t var defaultProps = type.defaultProps;\n\t for (propName in defaultProps) {\n\t if (props[propName] === undefined) {\n\t props[propName] = defaultProps[propName];\n\t }\n\t }\n\t }\n\t {\n\t if (key || ref) {\n\t if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n\t var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\t if (key) {\n\t defineKeyPropWarningGetter(props, displayName);\n\t }\n\t if (ref) {\n\t defineRefPropWarningGetter(props, displayName);\n\t }\n\t }\n\t }\n\t }\n\t return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n\t }", "title": "" }, { "docid": "f334cf63fc49c1b999f4ad7cb9c681ce", "score": "0.5228831", "text": "function Styles() {\n\n var defaultTraits = {\n\n 'no-fill': {\n fill: 'none'\n },\n 'no-border': {\n strokeOpacity: 0.0\n },\n 'no-events': {\n pointerEvents: 'none'\n }\n };\n\n var self = this;\n\n /**\n * Builds a style definition from a className, a list of traits and an object of additional attributes.\n *\n * @param {String} className\n * @param {Array<String>} traits\n * @param {Object} additionalAttrs\n *\n * @return {Object} the style defintion\n */\n this.cls = function(className, traits, additionalAttrs) {\n var attrs = this.style(traits, additionalAttrs);\n\n return assign(attrs, { 'class': className });\n };\n\n /**\n * Builds a style definition from a list of traits and an object of additional attributes.\n *\n * @param {Array<String>} traits\n * @param {Object} additionalAttrs\n *\n * @return {Object} the style defintion\n */\n this.style = function(traits, additionalAttrs) {\n\n if (!isArray(traits) && !additionalAttrs) {\n additionalAttrs = traits;\n traits = [];\n }\n\n var attrs = reduce(traits, function(attrs, t) {\n return assign(attrs, defaultTraits[t] || {});\n }, {});\n\n return additionalAttrs ? assign(attrs, additionalAttrs) : attrs;\n };\n\n this.computeStyle = function(custom, traits, defaultStyles) {\n if (!isArray(traits)) {\n defaultStyles = traits;\n traits = [];\n }\n\n return self.style(traits || [], assign({}, defaultStyles, custom || {}));\n };\n}", "title": "" }, { "docid": "f757810746c7780c0e0ed361e5f40335", "score": "0.5213821", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "f757810746c7780c0e0ed361e5f40335", "score": "0.5213821", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "f757810746c7780c0e0ed361e5f40335", "score": "0.5213821", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "f757810746c7780c0e0ed361e5f40335", "score": "0.5213821", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.5211275", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.5211275", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.5211275", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.5211275", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.5211275", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.5211275", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.5211275", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.5211275", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.5211275", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.5211275", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.5211275", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.5211275", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.5211275", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.5211275", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.5211275", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.5211275", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.5211275", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.5211275", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.5211275", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.5211275", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.5211275", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.5211275", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.5211275", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.5211275", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.5211275", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.5211275", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.5211275", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.5211275", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "aaa02d7b6c7dd7fde47a7eff49d7cd86", "score": "0.52060634", "text": "function createElement(type, config, children) {\n\t var propName = void 0;\n\n\t // Reserved names are extracted\n\t var props = {};\n\n\t var key = null;\n\t var ref = null;\n\t var self = null;\n\t var source = null;\n\n\t if (config != null) {\n\t if (hasValidRef(config)) {\n\t ref = config.ref;\n\t }\n\t if (hasValidKey(config)) {\n\t key = '' + config.key;\n\t }\n\n\t self = config.__self === undefined ? null : config.__self;\n\t source = config.__source === undefined ? null : config.__source;\n\t // Remaining properties are added to a new props object\n\t for (propName in config) {\n\t if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n\t props[propName] = config[propName];\n\t }\n\t }\n\t }\n\n\t // Children can be more than one argument, and those are transferred onto\n\t // the newly allocated props object.\n\t var childrenLength = arguments.length - 2;\n\t if (childrenLength === 1) {\n\t props.children = children;\n\t } else if (childrenLength > 1) {\n\t var childArray = Array(childrenLength);\n\t for (var i = 0; i < childrenLength; i++) {\n\t childArray[i] = arguments[i + 2];\n\t }\n\t {\n\t if (Object.freeze) {\n\t Object.freeze(childArray);\n\t }\n\t }\n\t props.children = childArray;\n\t }\n\n\t // Resolve default props\n\t if (type && type.defaultProps) {\n\t var defaultProps = type.defaultProps;\n\t for (propName in defaultProps) {\n\t if (props[propName] === undefined) {\n\t props[propName] = defaultProps[propName];\n\t }\n\t }\n\t }\n\t {\n\t if (key || ref) {\n\t if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n\t var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\t if (key) {\n\t defineKeyPropWarningGetter(props, displayName);\n\t }\n\t if (ref) {\n\t defineRefPropWarningGetter(props, displayName);\n\t }\n\t }\n\t }\n\t }\n\t return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n\t}", "title": "" }, { "docid": "aaa02d7b6c7dd7fde47a7eff49d7cd86", "score": "0.52060634", "text": "function createElement(type, config, children) {\n\t var propName = void 0;\n\n\t // Reserved names are extracted\n\t var props = {};\n\n\t var key = null;\n\t var ref = null;\n\t var self = null;\n\t var source = null;\n\n\t if (config != null) {\n\t if (hasValidRef(config)) {\n\t ref = config.ref;\n\t }\n\t if (hasValidKey(config)) {\n\t key = '' + config.key;\n\t }\n\n\t self = config.__self === undefined ? null : config.__self;\n\t source = config.__source === undefined ? null : config.__source;\n\t // Remaining properties are added to a new props object\n\t for (propName in config) {\n\t if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n\t props[propName] = config[propName];\n\t }\n\t }\n\t }\n\n\t // Children can be more than one argument, and those are transferred onto\n\t // the newly allocated props object.\n\t var childrenLength = arguments.length - 2;\n\t if (childrenLength === 1) {\n\t props.children = children;\n\t } else if (childrenLength > 1) {\n\t var childArray = Array(childrenLength);\n\t for (var i = 0; i < childrenLength; i++) {\n\t childArray[i] = arguments[i + 2];\n\t }\n\t {\n\t if (Object.freeze) {\n\t Object.freeze(childArray);\n\t }\n\t }\n\t props.children = childArray;\n\t }\n\n\t // Resolve default props\n\t if (type && type.defaultProps) {\n\t var defaultProps = type.defaultProps;\n\t for (propName in defaultProps) {\n\t if (props[propName] === undefined) {\n\t props[propName] = defaultProps[propName];\n\t }\n\t }\n\t }\n\t {\n\t if (key || ref) {\n\t if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n\t var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\t if (key) {\n\t defineKeyPropWarningGetter(props, displayName);\n\t }\n\t if (ref) {\n\t defineRefPropWarningGetter(props, displayName);\n\t }\n\t }\n\t }\n\t }\n\t return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n\t}", "title": "" }, { "docid": "aaa02d7b6c7dd7fde47a7eff49d7cd86", "score": "0.52060634", "text": "function createElement(type, config, children) {\n\t var propName = void 0;\n\n\t // Reserved names are extracted\n\t var props = {};\n\n\t var key = null;\n\t var ref = null;\n\t var self = null;\n\t var source = null;\n\n\t if (config != null) {\n\t if (hasValidRef(config)) {\n\t ref = config.ref;\n\t }\n\t if (hasValidKey(config)) {\n\t key = '' + config.key;\n\t }\n\n\t self = config.__self === undefined ? null : config.__self;\n\t source = config.__source === undefined ? null : config.__source;\n\t // Remaining properties are added to a new props object\n\t for (propName in config) {\n\t if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n\t props[propName] = config[propName];\n\t }\n\t }\n\t }\n\n\t // Children can be more than one argument, and those are transferred onto\n\t // the newly allocated props object.\n\t var childrenLength = arguments.length - 2;\n\t if (childrenLength === 1) {\n\t props.children = children;\n\t } else if (childrenLength > 1) {\n\t var childArray = Array(childrenLength);\n\t for (var i = 0; i < childrenLength; i++) {\n\t childArray[i] = arguments[i + 2];\n\t }\n\t {\n\t if (Object.freeze) {\n\t Object.freeze(childArray);\n\t }\n\t }\n\t props.children = childArray;\n\t }\n\n\t // Resolve default props\n\t if (type && type.defaultProps) {\n\t var defaultProps = type.defaultProps;\n\t for (propName in defaultProps) {\n\t if (props[propName] === undefined) {\n\t props[propName] = defaultProps[propName];\n\t }\n\t }\n\t }\n\t {\n\t if (key || ref) {\n\t if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n\t var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\t if (key) {\n\t defineKeyPropWarningGetter(props, displayName);\n\t }\n\t if (ref) {\n\t defineRefPropWarningGetter(props, displayName);\n\t }\n\t }\n\t }\n\t }\n\t return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n\t}", "title": "" }, { "docid": "bd8685ca72bb29a4087dd87413038079", "score": "0.5205034", "text": "function styled(Component) {\n var componentCreator = function componentCreator(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var name = options.name,\n stylesOptions = (0,objectWithoutProperties/* default */.Z)(options, [\"name\"]);\n\n if (false) {}\n\n var classNamePrefix = name;\n\n if (false) { var displayName; }\n\n var stylesOrCreator = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style((0,esm_extends/* default */.Z)({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n var useStyles = (0,makeStyles/* default */.Z)(stylesOrCreator, (0,esm_extends/* default */.Z)({\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var filterProps;\n var propTypes = {};\n\n if (style.filterProps) {\n filterProps = style.filterProps;\n delete style.filterProps;\n }\n /* eslint-disable react/forbid-foreign-prop-types */\n\n\n if (style.propTypes) {\n propTypes = style.propTypes;\n delete style.propTypes;\n }\n /* eslint-enable react/forbid-foreign-prop-types */\n\n\n var StyledComponent = /*#__PURE__*/react.forwardRef(function StyledComponent(props, ref) {\n var children = props.children,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = (0,objectWithoutProperties/* default */.Z)(props, [\"children\", \"className\", \"clone\", \"component\"]);\n\n var classes = useStyles(props);\n var className = clsx_default()(classes.root, classNameProp);\n var spread = other;\n\n if (filterProps) {\n spread = omit(spread, filterProps);\n }\n\n if (clone) {\n return /*#__PURE__*/react.cloneElement(children, (0,esm_extends/* default */.Z)({\n className: clsx_default()(children.props.className, className)\n }, spread));\n }\n\n if (typeof children === 'function') {\n return children((0,esm_extends/* default */.Z)({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return /*#__PURE__*/react.createElement(FinalComponent, (0,esm_extends/* default */.Z)({\n ref: ref,\n className: className\n }, spread), children);\n });\n false ? 0 : void 0;\n\n if (false) {}\n\n hoist_non_react_statics_cjs_default()(StyledComponent, Component);\n return StyledComponent;\n };\n\n return componentCreator;\n}", "title": "" }, { "docid": "883d3d6c15be50e73da27e854c19057f", "score": "0.52002865", "text": "function createEventProperties (opts) {\n const props = opts.properties;\n opts.listeners.forEach(function (name) {\n props[`on${name}`] = {\n attribute: false,\n set (elem, data) {\n if (data.newValue === data.oldValue) {\n return;\n }\n\n if (data.oldValue) {\n elem.removeEventListener(name, data.oldValue);\n }\n\n if (data.newValue) {\n elem.addEventListener(name, data.newValue);\n }\n }\n };\n });\n}", "title": "" }, { "docid": "3d99aa6bc253080d1a09f21977c27bd7", "score": "0.518317", "text": "function styled_styled(Component) {\n var componentCreator = function componentCreator(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var name = options.name,\n stylesOptions = Object(objectWithoutProperties[\"a\" /* default */])(options, [\"name\"]);\n\n if (false) {}\n\n var classNamePrefix = name;\n\n if (false) { var displayName; }\n\n var stylesOrCreator = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style(Object(esm_extends[\"a\" /* default */])({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n var useStyles = Object(makeStyles[\"a\" /* default */])(stylesOrCreator, Object(esm_extends[\"a\" /* default */])({\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var filterProps;\n var propTypes = {};\n\n if (style.filterProps) {\n filterProps = style.filterProps;\n delete style.filterProps;\n }\n /* eslint-disable react/forbid-foreign-prop-types */\n\n\n if (style.propTypes) {\n propTypes = style.propTypes;\n delete style.propTypes;\n }\n /* eslint-enable react/forbid-foreign-prop-types */\n\n\n var StyledComponent = react_default.a.forwardRef(function StyledComponent(props, ref) {\n var children = props.children,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = Object(objectWithoutProperties[\"a\" /* default */])(props, [\"children\", \"className\", \"clone\", \"component\"]);\n\n var classes = useStyles(props);\n var className = Object(clsx_m[\"default\"])(classes.root, classNameProp);\n var spread = other;\n\n if (filterProps) {\n spread = omit(spread, filterProps);\n }\n\n if (clone) {\n return react_default.a.cloneElement(children, Object(esm_extends[\"a\" /* default */])({\n className: Object(clsx_m[\"default\"])(children.props.className, className)\n }, spread));\n }\n\n if (typeof children === 'function') {\n return children(Object(esm_extends[\"a\" /* default */])({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return /*#__PURE__*/react_default.a.createElement(FinalComponent, Object(esm_extends[\"a\" /* default */])({\n ref: ref,\n className: className\n }, spread), children);\n });\n false ? undefined : void 0;\n\n if (false) {}\n\n hoist_non_react_statics_cjs_default()(StyledComponent, Component);\n return StyledComponent;\n };\n\n return componentCreator;\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.51809347", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.51809347", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.51809347", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.51809347", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.51809347", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.51809347", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.51809347", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.51809347", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.51809347", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "fd6dc2f863c2d94933e2600e7e10d439", "score": "0.51714814", "text": "function createElement(type,config,children){var propName;// Reserved names are extracted\nvar props={};var key=null;var ref=null;var self=null;var source=null;if(config!=null){if(hasValidRef(config)){ref=config.ref;{warnIfStringRefCannotBeAutoConverted(config);}}if(hasValidKey(config)){key=''+config.key;}self=config.__self===undefined?null:config.__self;source=config.__source===undefined?null:config.__source;// Remaining properties are added to a new props object\nfor(propName in config){if(hasOwnProperty.call(config,propName)&&!RESERVED_PROPS.hasOwnProperty(propName)){props[propName]=config[propName];}}}// Children can be more than one argument, and those are transferred onto\n// the newly allocated props object.\nvar childrenLength=arguments.length-2;if(childrenLength===1){props.children=children;}else if(childrenLength>1){var childArray=Array(childrenLength);for(var i=0;i<childrenLength;i++){childArray[i]=arguments[i+2];}{if(Object.freeze){Object.freeze(childArray);}}props.children=childArray;}// Resolve default props\nif(type&&type.defaultProps){var defaultProps=type.defaultProps;for(propName in defaultProps){if(props[propName]===undefined){props[propName]=defaultProps[propName];}}}{if(key||ref){var displayName=typeof type==='function'?type.displayName||type.name||'Unknown':type;if(key){defineKeyPropWarningGetter(props,displayName);}if(ref){defineRefPropWarningGetter(props,displayName);}}}return ReactElement(type,key,ref,self,source,ReactCurrentOwner.current,props);}", "title": "" }, { "docid": "fd6dc2f863c2d94933e2600e7e10d439", "score": "0.51714814", "text": "function createElement(type,config,children){var propName;// Reserved names are extracted\nvar props={};var key=null;var ref=null;var self=null;var source=null;if(config!=null){if(hasValidRef(config)){ref=config.ref;{warnIfStringRefCannotBeAutoConverted(config);}}if(hasValidKey(config)){key=''+config.key;}self=config.__self===undefined?null:config.__self;source=config.__source===undefined?null:config.__source;// Remaining properties are added to a new props object\nfor(propName in config){if(hasOwnProperty.call(config,propName)&&!RESERVED_PROPS.hasOwnProperty(propName)){props[propName]=config[propName];}}}// Children can be more than one argument, and those are transferred onto\n// the newly allocated props object.\nvar childrenLength=arguments.length-2;if(childrenLength===1){props.children=children;}else if(childrenLength>1){var childArray=Array(childrenLength);for(var i=0;i<childrenLength;i++){childArray[i]=arguments[i+2];}{if(Object.freeze){Object.freeze(childArray);}}props.children=childArray;}// Resolve default props\nif(type&&type.defaultProps){var defaultProps=type.defaultProps;for(propName in defaultProps){if(props[propName]===undefined){props[propName]=defaultProps[propName];}}}{if(key||ref){var displayName=typeof type==='function'?type.displayName||type.name||'Unknown':type;if(key){defineKeyPropWarningGetter(props,displayName);}if(ref){defineRefPropWarningGetter(props,displayName);}}}return ReactElement(type,key,ref,self,source,ReactCurrentOwner.current,props);}", "title": "" }, { "docid": "48e70caf04914561d1b95c6dea681473", "score": "0.51688194", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t}", "title": "" }, { "docid": "7f6087a7b6867cc029158439c66db2f8", "score": "0.51676214", "text": "function createElement(type, config, children) {\n\t var propName;\n\n\t // Reserved names are extracted\n\t var props = {};\n\n\t var key = null;\n\t var ref = null;\n\t var self = null;\n\t var source = null;\n\n\t if (config != null) {\n\t if (hasValidRef(config)) {\n\t ref = config.ref;\n\t }\n\t if (hasValidKey(config)) {\n\t key = '' + config.key;\n\t }\n\n\t self = config.__self === undefined ? null : config.__self;\n\t source = config.__source === undefined ? null : config.__source;\n\t // Remaining properties are added to a new props object\n\t for (propName in config) {\n\t if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n\t props[propName] = config[propName];\n\t }\n\t }\n\t }\n\n\t // Children can be more than one argument, and those are transferred onto\n\t // the newly allocated props object.\n\t var childrenLength = arguments.length - 2;\n\t if (childrenLength === 1) {\n\t props.children = children;\n\t } else if (childrenLength > 1) {\n\t var childArray = Array(childrenLength);\n\t for (var i = 0; i < childrenLength; i++) {\n\t childArray[i] = arguments[i + 2];\n\t }\n\t {\n\t if (Object.freeze) {\n\t Object.freeze(childArray);\n\t }\n\t }\n\t props.children = childArray;\n\t }\n\n\t // Resolve default props\n\t if (type && type.defaultProps) {\n\t var defaultProps = type.defaultProps;\n\t for (propName in defaultProps) {\n\t if (props[propName] === undefined) {\n\t props[propName] = defaultProps[propName];\n\t }\n\t }\n\t }\n\t {\n\t if (key || ref) {\n\t if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n\t var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\t if (key) {\n\t defineKeyPropWarningGetter(props, displayName);\n\t }\n\t if (ref) {\n\t defineRefPropWarningGetter(props, displayName);\n\t }\n\t }\n\t }\n\t }\n\t return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n\t }", "title": "" }, { "docid": "568b07c731a0d749415fd67926e47b65", "score": "0.51473415", "text": "function bindObjectProps(data,tag,value,asProp){if(value){if(!isObject(value)){process.env.NODE_ENV!=='production'&&warn('v-bind without argument expects an Object or Array value',this);}else{if(Array.isArray(value)){value=toObject(value);}var hash;for(var key in value){if(key==='class'||key==='style'){hash=data;}else{var type=data.attrs&&data.attrs.type;hash=asProp||config.mustUseProp(tag,type,key)?data.domProps||(data.domProps={}):data.attrs||(data.attrs={});}if(!(key in hash)){hash[key]=value[key];}}}}return data;}", "title": "" }, { "docid": "568b07c731a0d749415fd67926e47b65", "score": "0.51473415", "text": "function bindObjectProps(data,tag,value,asProp){if(value){if(!isObject(value)){process.env.NODE_ENV!=='production'&&warn('v-bind without argument expects an Object or Array value',this);}else{if(Array.isArray(value)){value=toObject(value);}var hash;for(var key in value){if(key==='class'||key==='style'){hash=data;}else{var type=data.attrs&&data.attrs.type;hash=asProp||config.mustUseProp(tag,type,key)?data.domProps||(data.domProps={}):data.attrs||(data.attrs={});}if(!(key in hash)){hash[key]=value[key];}}}}return data;}", "title": "" }, { "docid": "568b07c731a0d749415fd67926e47b65", "score": "0.51473415", "text": "function bindObjectProps(data,tag,value,asProp){if(value){if(!isObject(value)){process.env.NODE_ENV!=='production'&&warn('v-bind without argument expects an Object or Array value',this);}else{if(Array.isArray(value)){value=toObject(value);}var hash;for(var key in value){if(key==='class'||key==='style'){hash=data;}else{var type=data.attrs&&data.attrs.type;hash=asProp||config.mustUseProp(tag,type,key)?data.domProps||(data.domProps={}):data.attrs||(data.attrs={});}if(!(key in hash)){hash[key]=value[key];}}}}return data;}", "title": "" }, { "docid": "568b07c731a0d749415fd67926e47b65", "score": "0.51473415", "text": "function bindObjectProps(data,tag,value,asProp){if(value){if(!isObject(value)){process.env.NODE_ENV!=='production'&&warn('v-bind without argument expects an Object or Array value',this);}else{if(Array.isArray(value)){value=toObject(value);}var hash;for(var key in value){if(key==='class'||key==='style'){hash=data;}else{var type=data.attrs&&data.attrs.type;hash=asProp||config.mustUseProp(tag,type,key)?data.domProps||(data.domProps={}):data.attrs||(data.attrs={});}if(!(key in hash)){hash[key]=value[key];}}}}return data;}", "title": "" }, { "docid": "568b07c731a0d749415fd67926e47b65", "score": "0.51473415", "text": "function bindObjectProps(data,tag,value,asProp){if(value){if(!isObject(value)){process.env.NODE_ENV!=='production'&&warn('v-bind without argument expects an Object or Array value',this);}else{if(Array.isArray(value)){value=toObject(value);}var hash;for(var key in value){if(key==='class'||key==='style'){hash=data;}else{var type=data.attrs&&data.attrs.type;hash=asProp||config.mustUseProp(tag,type,key)?data.domProps||(data.domProps={}):data.attrs||(data.attrs={});}if(!(key in hash)){hash[key]=value[key];}}}}return data;}", "title": "" }, { "docid": "568b07c731a0d749415fd67926e47b65", "score": "0.51473415", "text": "function bindObjectProps(data,tag,value,asProp){if(value){if(!isObject(value)){process.env.NODE_ENV!=='production'&&warn('v-bind without argument expects an Object or Array value',this);}else{if(Array.isArray(value)){value=toObject(value);}var hash;for(var key in value){if(key==='class'||key==='style'){hash=data;}else{var type=data.attrs&&data.attrs.type;hash=asProp||config.mustUseProp(tag,type,key)?data.domProps||(data.domProps={}):data.attrs||(data.attrs={});}if(!(key in hash)){hash[key]=value[key];}}}}return data;}", "title": "" }, { "docid": "568b07c731a0d749415fd67926e47b65", "score": "0.51473415", "text": "function bindObjectProps(data,tag,value,asProp){if(value){if(!isObject(value)){process.env.NODE_ENV!=='production'&&warn('v-bind without argument expects an Object or Array value',this);}else{if(Array.isArray(value)){value=toObject(value);}var hash;for(var key in value){if(key==='class'||key==='style'){hash=data;}else{var type=data.attrs&&data.attrs.type;hash=asProp||config.mustUseProp(tag,type,key)?data.domProps||(data.domProps={}):data.attrs||(data.attrs={});}if(!(key in hash)){hash[key]=value[key];}}}}return data;}", "title": "" }, { "docid": "568b07c731a0d749415fd67926e47b65", "score": "0.51473415", "text": "function bindObjectProps(data,tag,value,asProp){if(value){if(!isObject(value)){process.env.NODE_ENV!=='production'&&warn('v-bind without argument expects an Object or Array value',this);}else{if(Array.isArray(value)){value=toObject(value);}var hash;for(var key in value){if(key==='class'||key==='style'){hash=data;}else{var type=data.attrs&&data.attrs.type;hash=asProp||config.mustUseProp(tag,type,key)?data.domProps||(data.domProps={}):data.attrs||(data.attrs={});}if(!(key in hash)){hash[key]=value[key];}}}}return data;}", "title": "" }, { "docid": "ee81ad62ab7e058061e72b73ec643eff", "score": "0.51228327", "text": "function styled(Component) {\n var componentCreator = function componentCreator(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var name = options.name,\n stylesOptions = (0, _objectWithoutProperties2.default)(options, [\"name\"]);\n\n if (process.env.NODE_ENV !== 'production' && Component === undefined) {\n throw new Error(['You are calling styled(Component)(style) with an undefined component.', 'You may have forgotten to import it.'].join('\\n'));\n }\n\n var classNamePrefix = name;\n\n if (process.env.NODE_ENV !== 'production') {\n if (!name) {\n // Provide a better DX outside production.\n var displayName = (0, _utils.getDisplayName)(Component);\n\n if (displayName !== undefined) {\n classNamePrefix = displayName;\n }\n }\n }\n\n var stylesOrCreator = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style((0, _extends2.default)({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n var useStyles = (0, _makeStyles.default)(stylesOrCreator, (0, _extends2.default)({\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var filterProps;\n var propTypes = {};\n\n if (style.filterProps) {\n filterProps = style.filterProps;\n delete style.filterProps;\n }\n /* eslint-disable react/forbid-foreign-prop-types */\n\n\n if (style.propTypes) {\n propTypes = style.propTypes;\n delete style.propTypes;\n }\n /* eslint-enable react/forbid-foreign-prop-types */\n\n\n var StyledComponent = _react.default.forwardRef(function StyledComponent(props, ref) {\n var children = props.children,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = (0, _objectWithoutProperties2.default)(props, [\"children\", \"className\", \"clone\", \"component\"]);\n var classes = useStyles(props);\n var className = (0, _clsx.default)(classes.root, classNameProp);\n var spread = other;\n\n if (filterProps) {\n spread = omit(spread, filterProps);\n }\n\n if (clone) {\n return _react.default.cloneElement(children, (0, _extends2.default)({\n className: (0, _clsx.default)(children.props.className, className)\n }, spread));\n }\n\n if (typeof children === 'function') {\n return children((0, _extends2.default)({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return _react.default.createElement(FinalComponent, (0, _extends2.default)({\n ref: ref,\n className: className\n }, spread), children);\n });\n\n process.env.NODE_ENV !== \"production\" ? StyledComponent.propTypes = (0, _extends2.default)({\n /**\n * A render function or node.\n */\n children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),\n\n /**\n * @ignore\n */\n className: _propTypes.default.string,\n\n /**\n * If `true`, the component will recycle it's children DOM element.\n * It's using `React.cloneElement` internally.\n *\n * This prop will be deprecated and removed in v5\n */\n clone: (0, _utils.chainPropTypes)(_propTypes.default.bool, function (props) {\n if (props.clone && props.component) {\n return new Error('You can not use the clone and component prop at the same time.');\n }\n\n return null;\n }),\n\n /**\n * The component used for the root node.\n * Either a string to use a DOM element or a component.\n */\n component: _propTypes.default.elementType\n }, propTypes) : void 0;\n\n if (process.env.NODE_ENV !== 'production') {\n StyledComponent.displayName = \"Styled(\".concat(classNamePrefix, \")\");\n }\n\n (0, _hoistNonReactStatics.default)(StyledComponent, Component);\n return StyledComponent;\n };\n\n return componentCreator;\n}", "title": "" }, { "docid": "ee81ad62ab7e058061e72b73ec643eff", "score": "0.51228327", "text": "function styled(Component) {\n var componentCreator = function componentCreator(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var name = options.name,\n stylesOptions = (0, _objectWithoutProperties2.default)(options, [\"name\"]);\n\n if (process.env.NODE_ENV !== 'production' && Component === undefined) {\n throw new Error(['You are calling styled(Component)(style) with an undefined component.', 'You may have forgotten to import it.'].join('\\n'));\n }\n\n var classNamePrefix = name;\n\n if (process.env.NODE_ENV !== 'production') {\n if (!name) {\n // Provide a better DX outside production.\n var displayName = (0, _utils.getDisplayName)(Component);\n\n if (displayName !== undefined) {\n classNamePrefix = displayName;\n }\n }\n }\n\n var stylesOrCreator = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style((0, _extends2.default)({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n var useStyles = (0, _makeStyles.default)(stylesOrCreator, (0, _extends2.default)({\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var filterProps;\n var propTypes = {};\n\n if (style.filterProps) {\n filterProps = style.filterProps;\n delete style.filterProps;\n }\n /* eslint-disable react/forbid-foreign-prop-types */\n\n\n if (style.propTypes) {\n propTypes = style.propTypes;\n delete style.propTypes;\n }\n /* eslint-enable react/forbid-foreign-prop-types */\n\n\n var StyledComponent = _react.default.forwardRef(function StyledComponent(props, ref) {\n var children = props.children,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = (0, _objectWithoutProperties2.default)(props, [\"children\", \"className\", \"clone\", \"component\"]);\n var classes = useStyles(props);\n var className = (0, _clsx.default)(classes.root, classNameProp);\n var spread = other;\n\n if (filterProps) {\n spread = omit(spread, filterProps);\n }\n\n if (clone) {\n return _react.default.cloneElement(children, (0, _extends2.default)({\n className: (0, _clsx.default)(children.props.className, className)\n }, spread));\n }\n\n if (typeof children === 'function') {\n return children((0, _extends2.default)({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return _react.default.createElement(FinalComponent, (0, _extends2.default)({\n ref: ref,\n className: className\n }, spread), children);\n });\n\n process.env.NODE_ENV !== \"production\" ? StyledComponent.propTypes = (0, _extends2.default)({\n /**\n * A render function or node.\n */\n children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),\n\n /**\n * @ignore\n */\n className: _propTypes.default.string,\n\n /**\n * If `true`, the component will recycle it's children DOM element.\n * It's using `React.cloneElement` internally.\n *\n * This prop will be deprecated and removed in v5\n */\n clone: (0, _utils.chainPropTypes)(_propTypes.default.bool, function (props) {\n if (props.clone && props.component) {\n return new Error('You can not use the clone and component prop at the same time.');\n }\n\n return null;\n }),\n\n /**\n * The component used for the root node.\n * Either a string to use a DOM element or a component.\n */\n component: _propTypes.default.elementType\n }, propTypes) : void 0;\n\n if (process.env.NODE_ENV !== 'production') {\n StyledComponent.displayName = \"Styled(\".concat(classNamePrefix, \")\");\n }\n\n (0, _hoistNonReactStatics.default)(StyledComponent, Component);\n return StyledComponent;\n };\n\n return componentCreator;\n}", "title": "" } ]
8869cf5d2cae24453a4dd81a97819608
Modify skip link to match mobile buttons.
[ { "docid": "9e34d5f23bdfe125275f1d1a044879b4", "score": "0.6933761", "text": "function _changeSkipLink( buttons ) {\n\n\t\t// Start with an empty array.\n\t\tvar menuToggleList = _getAllMenusArray();\n\n\t\t// Exit out if there are no menu items to update.\n\t\tif ( ! $( menuToggleList ).length > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$.each( menuToggleList, function ( key, value ) {\n\n\t\t\tvar newValue = value.replace( '.', '' ),\n\t\t\t\tstartLink = 'genesis-' + newValue,\n\t\t\t\tendLink = 'genesis-mobile-' + newValue;\n\n\t\t\tif ( 'none' == _getDisplayValue( buttons ) ) {\n\t\t\t\tstartLink = 'genesis-mobile-' + newValue;\n\t\t\t\tendLink = 'genesis-' + newValue;\n\t\t\t}\n\n\t\t\tvar $item = $( '.genesis-skip-link a[href=\"#' + startLink + '\"]' );\n\n\t\t\tif ( menusToCombine !== null && value !== menusToCombine[0] ) {\n\t\t\t\t$item.toggleClass( 'skip-link-hidden' );\n\t\t\t}\n\n\t\t\tif ( $item.length > 0 ) {\n\t\t\t\tvar link = $item.attr( 'href' );\n\t\t\t\t\tlink = link.replace( startLink, endLink );\n\n\t\t\t\t$item.attr( 'href', link );\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t});\n\n\t}", "title": "" } ]
[ { "docid": "b86309ec7592ffb82f5bde22cfadf1b9", "score": "0.75303483", "text": "function _changeSkipLink( buttons ) {\n\t\tvar startLink = 'genesis-nav',\n\t\t\tendLink = 'mobile-genesis-nav';\n\t\tif ( 'none' === _getDisplayValue( buttons ) ) {\n\t\t\tstartLink = 'mobile-genesis-nav';\n\t\t\tendLink = 'genesis-nav';\n\t\t}\n\t\t$( '.genesis-skip-link a[href^=\"#' + startLink + '\"]' ).each( function() {\n\t\t\tvar link = $( this ).attr( 'href' );\n\t\t\tlink = link.replace( startLink, endLink );\n\t\t\t$( this ).attr( 'href', link );\n\t\t});\n\t}", "title": "" }, { "docid": "ade1d28758256ae91ef654b30acca6eb", "score": "0.68649745", "text": "function _changeSkipLink(buttons) {\n\n\t\t// Start with an empty array.\n\t\tvar menuToggleList = _getAllMenusArray();\n\n\t\t// Exit out if there are no menu items to update.\n\t\tif (!$(menuToggleList).length > 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t$.each(menuToggleList, function (key, value) {\n\n\t\t\tvar newValue = value.replace('.', ''),\n\t\t\t\tstartLink = 'genesis-' + newValue,\n\t\t\t\tendLink = 'genesis-mobile-' + newValue;\n\n\t\t\tif ('none' == _getDisplayValue(buttons)) {\n\t\t\t\tstartLink = 'genesis-mobile-' + newValue;\n\t\t\t\tendLink = 'genesis-' + newValue;\n\t\t\t}\n\n\t\t\tvar $item = $('.genesis-skip-link a[href=\"#' + startLink + '\"]');\n\n\t\t\tif (menusToCombine !== null && value !== menusToCombine[0]) {\n\t\t\t\t$item.toggleClass('skip-link-hidden');\n\t\t\t}\n\n\t\t\tif ($item.length > 0) {\n\t\t\t\tvar link = $item.attr('href');\n\t\t\t\tlink = link.replace(startLink, endLink);\n\n\t\t\t\t$item.attr('href', link);\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "360effe494ec0f7ed2e289fbf50f5c4d", "score": "0.6321398", "text": "function setSkip() {\n\tif (Browser.chrome || Browser.safari || Browser.opera) {\n\t\tvar target = document.id('skiptarget');\n\t\ttarget.href = \"#skiptarget\";\n\t\ttarget.innerText = \"Start of main content\";\n\t\ttarget.setAttribute(\"tabindex\", \"0\");\n\t\tdocument.id('skiplink').setAttribute(\"onclick\",\n\t\t\t\t\"document.id('skiptarget').focus();\");\n\t}\n}", "title": "" }, { "docid": "d21c5c4c1abd805588ac8805e21320c9", "score": "0.6046017", "text": "onSkipTap_() {\n if (this.loading) {\n return;\n }\n this.loading = true;\n this.browserProxy_.userActed(RELATED_INFO_SCREEN_ID, ['skip-pressed']);\n }", "title": "" }, { "docid": "d9bf88399e206c0c3f2c8c8ec16ef9d6", "score": "0.5563873", "text": "disableNextButton() {\n this.$(this.progress.displayConfig.ui.next.target)\n .off('click')\n .prop('disabled', true);\n }", "title": "" }, { "docid": "b671b037e6d5850a4e7168476450cd04", "score": "0.5553186", "text": "function mobileInsertLinkFix () {\n if ($('#insert-link-button-mobile').hasClass('wysihtml5-command-dialog-opened')) {\n $('#insert-link-button-mobile').addClass('hidden')\n } else {\n $('#insert-link-button-mobile').removeClass('hidden')\n }\n }", "title": "" }, { "docid": "ffc0a284fa61979336a4d3254002f4ab", "score": "0.55505395", "text": "function disableEnableLinks(pageName) {\n\t\t\t// If we're on the requestPasscode page, remove the 'request passcode' link\n\t\t\tif( pageName == \"requestPasscode\" ) {\n\t\t\t\t$('#requestPasscodeLink').hide()\n\t\t\t}\n\t\t\t// When the user completes the requestPasscode form, the display will change to a confirmation screen without\n\t\t\t// leaving the session. In that case, we restore the link that was removed by the previous code.\n\t\t\tif( pageName == \"requestPasscodeConfirmation\" ) {\n\t\t\t\t$('#requestPasscodeLink').show()\n\t\t\t}\n\t\t\t// If we're on the home page, disable the logo 'home' link\n\t\t\tif( pageName == \"home\" ) {\n\t\t\t\t$(\"#headerLogoLink\").removeClass(\"goHome\");\n\t\t\t}\n\t\t\t// When the user completes the home page form, the display will change to a confirmation screen without\n\t\t\t// leaving the session. In that case, we restore the link that was removed by the previous code.\n\t\t\tif( pageName == \"homeConfirmation\" ) {\n\t\t\t\t$(\"#headerLogoLink\").addClass(\"goHome\");\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "5474b53a67eb6b36a6c8266db299aad8", "score": "0.5462735", "text": "onSkip() {\n if (this.state.rank !== 79) {\n if (this.state.rank === 78) {\n { this.state.mute === false ? this.handleAudio(winnerAudio) : null };\n } else {\n { this.state.mute === false ? this.handleAudio(skipAudio) : null };\n }\n this.handleNext();\n this.setState({ skipTotal: this.state.skipTotal + 1 });\n { this.state.skipTotal === 0 ? this.setState({ skipS: \"\" }) : this.setState({ skipS: \"s\" }) };\n }\n }", "title": "" }, { "docid": "0706ab64fab7c9251e18e0d4f73731b8", "score": "0.5380697", "text": "function pressNextButtonsWhenMounted() {\n if (location.host.includes(\".youtube.com\")) {\n onSkipBtnMounted(\".ytp-ad-skip-button.ytp-button\", (btn) => {\n if (this.enabled) {\n console.log(\"Clicked skip-ad button\");\n btn.click();\n }\n });\n }\n }", "title": "" }, { "docid": "41fb09d299b8964e03d787454e7444d6", "score": "0.5341836", "text": "function _createSkipButton() {\n return $(Constants.BUTTON_COMP, {\n \"class\": Constants.SKIP_BUTTON + \" \" + Constants.SKIP_BUTTON_TRIGGER,\n text: _getSkipButtonText()\n });\n}", "title": "" }, { "docid": "f8859844f84c5d2a2d4f204f45fdb602", "score": "0.5340964", "text": "function checkIgnore( link ) {\n\treturn ignore.test( link );\n}", "title": "" }, { "docid": "eaabdb7905b92439df832c40378588bd", "score": "0.5307844", "text": "function enableNext(arg)\n\t\t{\n\t\t\tref.allThumbVisited[arg]=1\t\t\t\t\t\t\t\t\t\n\t\t\tif(ref.allThumbVisited.join().indexOf(0)==-1)\n\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t$(\".btnNext\").removeAttr(\"style\");\n\t\t\t\twindow.shell.updateVisitedPages(globalCurTopic, globalCurPage);\n\t\t\t\t\n\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "1b513449a0a2e90738ca6b7d723e3cf9", "score": "0.52870286", "text": "function disableNextPageIcon(){\n\t$(\"div#valueset_pagination_holder > ul.pagination > li.pagination-li#pagination_next\").addClass(\"disabled\");\n\t$(\"div#valueset_pagination_holder > ul.pagination > li.pagination-li#pagination_last\").addClass(\"disabled\");\n}", "title": "" }, { "docid": "b4e2a11567b31a8b809008ee9d83fed3", "score": "0.52734447", "text": "function ACT_SKIP() {\n}", "title": "" }, { "docid": "0d63c4229a65b1a0ff4e254b01a266f1", "score": "0.5263199", "text": "function ga_skiplinks() {\n 'use strict';\n var element = document.getElementById( location.hash.substring( 1 ) );\n\n if ( element ) {\n\t\tif ( ! /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) {\n \t\t\telement.tabIndex = -1;\n \t\t}\n element.focus();\n }\n}", "title": "" }, { "docid": "b2c9fdbf07099f7932b7b6f7038847f7", "score": "0.5257871", "text": "function disableNextButton(){\n var nextButtons = document.getElementsByName('next-button');\n nextButtons.forEach(button => button.disabled=true);\n nextButtons.forEach(button => button.className='next-button disabled');\n}", "title": "" }, { "docid": "c795831ccfab4fcd5d0562b61bd78c64", "score": "0.52576405", "text": "function disableNext(){\n if(!$('#step_options_2 .choices').hasClass('selected')){\n $('.next-btn').addClass('disabled');\n $(\"#step_header_3\").css('pointer-events', 'none');\n }\n else{\n $('.next-btn').removeClass('disabled');\n $(\"#step_header_3\").css('pointer-events','all');\n }\n }", "title": "" }, { "docid": "df357aef6749ea4c4c8efdf4ab541d11", "score": "0.52503973", "text": "function counteractPrevNextButtons() {\n var prevNext = document.querySelectorAll(\".prev-next a\");\n var i;\n if (prevNext.length > 0) {\n i = prevNext.length - 1;\n for (; i >= 0; --i) {\n prevNext[i].setAttribute(\"data-href\", prevNext[i].href);\n prevNext[i].href = \"\";\n prevNext[i].onclick = function(e) {\n this.href = this.getAttribute(\"data-href\");\n this.click();\n };\n }\n }\n }", "title": "" }, { "docid": "c0c1fe39d5b2020933c05717e57362b9", "score": "0.52378845", "text": "function handleSkip() {\n var value = parseInt(_self._getCurrentPageValue(), 10);\n if (_self._isPageAllowRedirect(value)) {\n _self.jumpToPage(value);\n } else {\n _self._setCurrentPageValue(_self.get('curPage'));\n }\n }", "title": "" }, { "docid": "d3a79ca1f33e4a47e85092be438349c9", "score": "0.52218246", "text": "function disableTestLinks() {\n var pageLinks = document.getElementsByTagName('a');\n for (var i=0; i<pageLinks.length; i++) {\n if (pageLinks[i].href.match(/[^#]#$/)) {\n addEvent(pageLinks[i], 'click', knackerEvent, false);\n }\n }\n}", "title": "" }, { "docid": "31e07eecc48025a2617093deefefedde", "score": "0.51910627", "text": "handlePreviousDisable() {\n if (this.state.page === 0) {\n document.getElementById(\"previousBtn\").className = \"btn_list-lg-disabled\";\n }\n else {\n document.getElementById(\"previousBtn\").className = \"btn_list-lg\";\n }\n }", "title": "" }, { "docid": "321bda244e660a3d168f33e225247d82", "score": "0.51910603", "text": "function disableLink(e) {\n\te.preventDefault();\n}", "title": "" }, { "docid": "5aeb3276f6b6c851c2373fd08f4e1479", "score": "0.51676565", "text": "function hyperlinkPhone(){\n\t $(\"a[href^='tel:']\").click(function(){\n\t \tif( !$(\"body\").hasClass(\"mobile\") ) return false;\n });\n}", "title": "" }, { "docid": "9f3fcd764ad9bd5c2ae5c5fa3cba22d2", "score": "0.51652133", "text": "function disablePrevPageIcon(){\n\t$(\"div#valueset_pagination_holder > ul.pagination > li.pagination-li#pagination_prev\").addClass(\"disabled\");\n\t$(\"div#valueset_pagination_holder > ul.pagination > li.pagination-li#pagination_first\").addClass(\"disabled\");\n}", "title": "" }, { "docid": "f5bbe500059fa8fd6c07e13f22be3658", "score": "0.5154719", "text": "function removelink() {\n // if the current page is Microsite\n if (typeof (_runningFromMicrosite) != \"undefined\") {\n $('.removeIf.openBag').removeClass('openBag').addClass('bagLink');\n $(\".removeIf\").attr(\"href\", BaseURL + \"/shopping_bag/ShoppingBag.aspx\");\n } \n}", "title": "" }, { "docid": "1cf4647e4fbf780321ad407276eb7b8c", "score": "0.51200724", "text": "function Disable_Link( link_id )\n{\n\tmyButton = document.getElementById( link_id );\n\tsavedLinks.push(new Array(link_id, myButton.href));\n\tmyButton.href = \"#\";\n\tsetTimeout( \"Enable_Button('\" + link_id + \"')\", timeoutLength );\n}", "title": "" }, { "docid": "92a798b582657ba08d0fcb4843d4bf24", "score": "0.51113904", "text": "function enableLink(link) {\n link.removeClass('disabled')\n}", "title": "" }, { "docid": "54d62fd422424f478aedd60b57a98095", "score": "0.51101446", "text": "function Skip() {\n var button = document.getElementById('player-bar-forward')\n button.click()\n}", "title": "" }, { "docid": "70aa0454035750900dcf873dd2bf5f32", "score": "0.50776297", "text": "function addBlacklistClass () {\n $('a').each(function () {\n if (this.href.indexOf('/wp-admin/') !== -1 ||\n this.href.indexOf('/wp-login.php') !== -1) {\n $(this).addClass('no-barba').addClass('wp-link');\n }\n });\n }", "title": "" }, { "docid": "02b2744ae9c605c1c2719f5a70a4ca1d", "score": "0.5071613", "text": "enableButtons() {\n document.getElementById('pageButtonsNext').removeAttribute('hidden');\n document.getElementById('pageButtonsPrior').removeAttribute('hidden');\n\n }", "title": "" }, { "docid": "8653adc7231556a980c8558df3098718", "score": "0.50640255", "text": "function disableLinks($slide) {\r\n\t\t\tif (!$_accordion.hasClass('jAccordion-keepLinksEnabled')) {\r\n\t\t\t\t$('a:not(.jAccordion-keepEnabled)', $slide).bind('click.smartLink', function (e) {\r\n\t\t\t\t\te.preventDefault();\r\n\t\t\t\t});\r\n\t\t\t}\r\n }", "title": "" }, { "docid": "cdf15167b5307c2a6abcb90fec9944e2", "score": "0.5051879", "text": "function disableNextEllipsisIcon(){\n\t$(\"div#valueset_pagination_holder > ul.pagination > li.pagination-li.pagination_ellipsis#pagination_ellipsis_next\").addClass(\"disabled hidden\");\n}", "title": "" }, { "docid": "7bd3159b3970a320044fcce22b84df7c", "score": "0.5042124", "text": "function Get_Next_App_Checker( link_id, destination )\n{\n\tlink = document.getElementById(link_id);\n\n\t// Could use additional handling of canceled requests to enable the button\n\tif( savedLinks.toString().indexOf(link_id) !== -1 || Check_Data() == false )\n\t{\n\t\t// disable\n\t\tlink.href = '#';\n\t}\n\telse\n\t{\n\t\t// enable\n\t\tlink.href = destination;\n\t\tsavedLinks.push( link_id );\n\t\tsetTimeout( \"Shift_Link_Array('\"+link_id+\"')\", timeoutLength );\n\t}\n}", "title": "" }, { "docid": "c6c7094177ad227045e64081006e3012", "score": "0.5033908", "text": "function disableLink(link) {\n if (!link.hasClass('disabled')) {\n link.addClass('disabled')\n }\n link.click(function(event) {\n if (link.hasClass('disabled')) {\n return false\n }\n })\n}", "title": "" }, { "docid": "6630551a9670274b0a1fe6cacd8f2b13", "score": "0.50223523", "text": "function enableNext() {\n next_button.prop('disabled', false);\n bNextEnabled = true;\n }", "title": "" }, { "docid": "c6604768cc7b1316abb51156dc17b623", "score": "0.49961397", "text": "function toggleNextButtonDisabled(disabled)\n {\n var buttons = document.getElementsByClassName(\"sequence-nav-button button-next\"); \n\n for (var i = 0; i < buttons.length; i++)\n {\n buttons[i].disabled = disabled; \n }\n\n buttons = document.getElementsByClassName(\"next-btn btn btn-link\"); \n\n for (var i = 0; i < buttons.length; i++)\n {\n buttons[i].disabled = disabled; \n } \n\n buttons = document.getElementsByClassName(\"seq_other inactive nav-item tab\"); \n\n for (var i = 0; i < buttons.length; i++)\n {\n buttons[i].disabled = disabled; \n } \n\n buttons = document.getElementsByClassName(\"complete btn btn-link\"); \n\n for (var i = 0; i < buttons.length; i++)\n {\n buttons[i].disabled = disabled; \n } \n\n buttons = document.getElementsByClassName(\"sequence-nav-button button-next\"); \n\n for (var i = 0; i < buttons.length; i++)\n {\n buttons[i].disabled = disabled; \n } \n\n buttons = document.getElementsByClassName(\"next-button btn btn-outline-primary\"); \n\n for (var i = 0; i < buttons.length; i++)\n {\n buttons[i].disabled = disabled; \n } \n }", "title": "" }, { "docid": "b526a60ba7b762082d3b582042c1b028", "score": "0.49848288", "text": "function disableLinkPreviews(str) {\n return str.replace(/(?<!<)(https?:\\/\\/\\S+)/gi, \"<$1>\");\n}", "title": "" }, { "docid": "62ea4e332caf1f4f6c7bfbad99ebf625", "score": "0.4973113", "text": "function skipToMainContent() {\n skipTo(null, \"SecondAnchorInACAMainContent\", \"FirstAnchorInACAMainContent\");\n}", "title": "" }, { "docid": "43287ea76f87ee37b525b6104fa8747d", "score": "0.49569887", "text": "function handleSkip() {\n displayNextQuestion();\n }", "title": "" }, { "docid": "64bea83643e1dc89a0411c82a1db7848", "score": "0.49566278", "text": "function noLink(){\n\treturn false;\n}", "title": "" }, { "docid": "3cfaede457c95c006d231d8960d3fe56", "score": "0.49312094", "text": "function skipActivity(){\n\t\taddtoSkipped();\n\t\tindex ++;\n\t\tadvanceGame();\n}", "title": "" }, { "docid": "6f52694ed4dfbae2738bf20471778d71", "score": "0.4914224", "text": "function modifyLinks(role){\n\t$('a').not(\".ignore-target\").each(function() {\t\n\t\tvar first_query;\n\t\tvar second_query;\n\t\tvar new_link;\n\t\tif(role == \"admin\"){\t\t\t\n\t\t\tfirst_query = appendQuery($(this).attr(\"href\"), \"cms\" , \"view\");\n\t\t\tnew_link = first_query;\n\t\t\t$(this).attr(\"href\", new_link);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "3540389fc0956f4143ab3809ccf88041", "score": "0.48933417", "text": "_skipTo(nextIndex, updateUrl = true) {\n if (nextIndex > this.activePanel) {\n this._slideInPanel(nextIndex);\n }\n if (nextIndex < this.activePanel) {\n this._slideOutAllPanels(nextIndex);\n }\n if (updateUrl)\n this._updateUrl(nextIndex);\n }", "title": "" }, { "docid": "4b6ad9acf533040132e9f46d91fcc9af", "score": "0.48905763", "text": "function createSkipButton(){\n let $current = $('<div class=\"skip\"></div>');\n $current.text(\"Skip\").button();\n\n $current.on('click', function(){\n if (currentElement === \"stuffing\")\n currentElement = \"none\";\n\n setNextCategory();\n });\n $('#container').append('<br/>').append('<br/>').append($current);\n}", "title": "" }, { "docid": "d0a0731f4e6c6979939fbae4db3905d9", "score": "0.4873369", "text": "function showSkip5()\n{\n var form = this.form;\n var regDomain = form.RegDomain.value;\n var regYear = form.RegYear.value;\n var regNum = 5 + Number(form.RegNum.value);\n var lang = 'en';\n if ('lang' in args)\n lang = args['lang'];\n var nextUrl = \"DeathRegDetail.php?RegDomain=\" + regDomain +\n \"&RegYear=\" + regYear +\n \"&RegNum=\" + regNum + '&lang=' + lang;\n if (typeof(args.showimage) == 'string' &&\n args.showimage.toLowerCase() == 'yes')\n nextUrl += \"&ShowImage=Yes\";\n location = nextUrl;\n return false;\n}", "title": "" }, { "docid": "02612d6606a235323d2e9203523146ab", "score": "0.48713356", "text": "function skipVideosWhenShowing() {\n if (location.host.includes(\".youtube.com\")) {\n onSkipBtnMounted(\".html5-video-player.ad-showing video\", (video) => {\n if (this.enabled) {\n console.log(\"skipped video ads\");\n video.currentTime = 10000;\n }\n });\n }\n }", "title": "" }, { "docid": "79ca849ff6aef68e445990b0d6ecfdf9", "score": "0.48635212", "text": "function skipMovie() {\n\tsuccessHandler = function(response) {\n\t\tgetNextMovie();\n\t}\n\tsaveUserAction(\"skipMovie\", currentMovieInfo['movie_id'], -1, \"skip\",\n\t\t\tsuccessHandler);\n}", "title": "" }, { "docid": "f51ccb53da842437c8fa7237aaa41c2d", "score": "0.48610055", "text": "function wishlist_mob() {\n if (jQuery('#header .links li a.top-link-wishlist').length) {\n wishlist_link = jQuery('#header .links li a.top-link-wishlist');\n wishlist_start_index = wishlist_link.html().indexOf('(');\n if (wishlist_start_index != -1) {\n wishlist_link.html(wishlist_link.html().slice(0, wishlist_start_index));\n }\n }\n }", "title": "" }, { "docid": "312a01a0651c010dcf2d4a04b9d9a72d", "score": "0.48603246", "text": "function disableLink(linkElement) {\n linkElement\n .removeClass(architectureLinkClass)\n .unbind(\"click\");\n }", "title": "" }, { "docid": "1dcc4bf7e13d98c589b48b2b76e93482", "score": "0.48571783", "text": "function enablePrevPageIcon(){\n\t$(\"div#valueset_pagination_holder > ul.pagination > li.pagination-li#pagination_prev\").removeClass(\"disabled\");\n\t$(\"div#valueset_pagination_holder > ul.pagination > li.pagination-li#pagination_first\").removeClass(\"disabled\");\n}", "title": "" }, { "docid": "b7fe6d4ccdb103df815128deafe327a6", "score": "0.48561406", "text": "function removeAcitve(skip) {\n for (var i = 0; i < 6; i++) {\n if (i == skip) {\n continue;\n }\n $(\"#\".concat(i)).removeClass(\"active\");\n }\n}", "title": "" }, { "docid": "0cbef096ca60993078581233d25b52cb", "score": "0.48432082", "text": "function switchButtons() {\n $('#skip-uncomprehensible').prop('disabled', true);\n $('#skip-no-value').prop('disabled', true);\n $('#skip-already-present').prop('disabled', true);\n $('#next-motivation').prop('disabled', false);\n $(\".similar-motivations-button\").prop(\"disabled\", false);\n}", "title": "" }, { "docid": "197e9390fe6189c8bb42c8c24ce91f66", "score": "0.48338622", "text": "function skip() {\n media.currentTime += parseFloat(this.dataset.skip);\n}", "title": "" }, { "docid": "01a553c34c9405fb4b4feef8ea560b2a", "score": "0.48316485", "text": "function enableNextPageIcon(){\n\t$(\"div#valueset_pagination_holder > ul.pagination > li.pagination-li#pagination_next\").removeClass(\"disabled\");\n\t$(\"div#valueset_pagination_holder > ul.pagination > li.pagination-li#pagination_last\").removeClass(\"disabled\");\n}", "title": "" }, { "docid": "651c743b123105a42989748a008e12f8", "score": "0.4822607", "text": "function skip() {\n this.shouldSkip = true;\n}", "title": "" }, { "docid": "23236672ad24c0820fdb5ff97e4a1c6e", "score": "0.4806011", "text": "function Mediacheck(x){\r\n\tif (x.matches){\r\n\t\tdesktopButton.style.display = \"none\";\t\t\r\n\t}\r\n\telse{\r\n\t\tmobileButton.style.display = \"none\";\t\t\r\n\t}\r\n}", "title": "" }, { "docid": "3321e6f0935a3094c65c1fd3862d1e8f", "score": "0.48024917", "text": "function disableNext(){\n if (nextButton!=undefined) \n nextButton.disable();\n //The .off(\"keydown\") and .off(\"keypress\") seems to have bug\n //bind to null instead\n // console.log(nextButton.style())\n }", "title": "" }, { "docid": "2c009ec1e82622db177e0389520992c5", "score": "0.47957352", "text": "function disablePrevEllipsisIcon(){\n\t$(\"div#valueset_pagination_holder > ul.pagination > li.pagination-li.pagination_ellipsis#pagination_ellipsis_prev\").addClass(\"disabled hidden\");\n}", "title": "" }, { "docid": "4a0c89bcbde5eb1a1920c2ae780b68a1", "score": "0.4795568", "text": "function modifyHRefOfJumpbutton(next_seq_no, prev_seq_no)\n{\n // provide seq no for both buttons\n var btn_seq_no = {'next-item': next_seq_no, 'previous-item': prev_seq_no};\n\n // modify both buttons\n for (var where in btn_seq_no) {\n\n // get handle on the button element\n var goWhereButton = document.getElementById('go-'+where);\n\n // if link doesn't exist, ignore the rest\n if (goWhereButton==null) continue;\n\n // find the old item id\n var hrefValue = goWhereButton.href.split('/');\n var indexItemId = hrefValue.indexOf('items')+1;\n if (indexItemId>0) {\n var buttonsItemId = hrefValue[indexItemId];\n var newHref = goWhereButton.href.replace(buttonsItemId, btn_seq_no[where]);\n goWhereButton.setAttribute('href', newHref);\n }\n }\n\n // hide spinner, if present\n $('#show-spinner').modal('hide')\n}", "title": "" }, { "docid": "ccf20a6063e63f9fcb7257e908391746", "score": "0.47922826", "text": "function forMobileView() {\n var x = document.getElementById(\"myLinks\");\n if (x.style.display === \"block\") {\n x.style.display = \"none\";\n } else {\n x.style.display = \"block\";\n }\n}", "title": "" }, { "docid": "3867a51baaa8cd4515e461948e95e65e", "score": "0.478204", "text": "function likeBtnSwitch(link, makeUnlike) {\n $(link).unbind('click');\n $(link).css('pointer-events', 'unset');\n if (makeUnlike) {\n $(link).parents('.grid-item').addClass('liked');\n $(link).tooltip('remove');\n $(link).attr('data-tooltip', 'Unlike this pin');\n $(link).tooltip();\n $(link).find('i').removeClass('fa-heart-o').addClass('fa-heart');\n $(link).click(() => likePin($(link), true));\n $(link).data('link', 'unlike');\n } else {\n $(link).parents('.grid-item').removeClass('liked');\n $(link).tooltip('remove');\n $(link).attr('data-tooltip', 'Like this pin');\n $(link).tooltip();\n $(link).find('i').removeClass('fa-heart').addClass('fa-heart-o');\n $(link).click(() => likePin($(link)));\n }\n}", "title": "" }, { "docid": "1615f594a7ac2100f20354abedf7d81c", "score": "0.4771195", "text": "function on_page_links_mobile_classes() {\n\n\t\tvar $display_menu = on_page_links_mobile_display();\n\n\t\tif (!$display_menu) {\n\t\t\t$on_page_links.removeClass('on-page-mobile-nav-active');\n\t\t\t$on_page_links.removeClass('on-page-mobile-nav-display');\n\t\t\t// console.log('begone classes');\n\t\t} else if (!$on_page_links.hasClass('on-page-mobile-nav-display')) {\n\t\t\t$on_page_links.addClass('on-page-mobile-nav-display');\n\t\t\t// console.log('right_size_for_mobile_nav');\n\t\t}\n\t}", "title": "" }, { "docid": "0f5efcf660b084ea5c754f887aeb459f", "score": "0.47702843", "text": "function addThreadIgnoreControl() {\n\tvar item = document.createElement('li');\n\titem.classList.add('nav-top', 'user-threadignore', 'first');\n\titem.innerHTML = '<a href=\"#\" title=\"Toggle thread ignore controls\">Ignore Threads</a>';\n\t$('a', item).addEventListener('click', function(e) {\n\t\te.preventDefault();\n\t\t$('body').classList.toggle('showMuteControls');\n\t});\n\tvar userNav = $('#block-wc-core-user ul[role=navigation]');\n\tif (!userNav) {\n\t\treturn;\n\t}\n\tuserNav.firstChild.classList.remove('first');\n\tuserNav.insertBefore(item, userNav.firstChild);\n}", "title": "" }, { "docid": "ba743595ca5b07eb8fad4a2091018f55", "score": "0.4768612", "text": "function removelink() {\nvar menu = document.getElementsByClassName('menu')[0];\nvar list = menu.getElementsByTagName('li')[5];\nvar link = list.getElementsByTagName('a')[0];\nvar checklink = link.hasAttribute('href');\nif (checklink == true) {\nlink.removeAttribute('href');\nlink.removeAttribute('onclick');\nlink.style.cursor = \"context-menu\"\n}\n}", "title": "" }, { "docid": "a527c81d8b19faec672bb292b02fcae4", "score": "0.4767156", "text": "disable() {\n this.content.setAttribute('aria-disabled', 'true');\n this.content.setAttribute('tabindex', '-1');\n this.wrapper.classList.remove('h5p-multi-media-choice-enabled');\n }", "title": "" }, { "docid": "1269b0182ed75b3584bfeb9f0413c587", "score": "0.47610718", "text": "function ignoreClicks (e) {\n e.preventDefault()\n return false\n }", "title": "" }, { "docid": "2e578426f6a9abf8b427535229104b5f", "score": "0.47510728", "text": "function disableMove(target) {\r\n // kinda brute force but whatever\r\n $(\"#moves_list a\").each(function() {\r\n if ( $(this).data('move') === target ) {\r\n $(this).addClass('completed')\r\n }\r\n });\r\n}", "title": "" }, { "docid": "33f0cbf5e1f79343d053cfe1ea248176", "score": "0.4745101", "text": "function handleMobileScreen(e){\n if(e.matches){\n navIcon.classList.remove(\"invisible\");\n }\n}", "title": "" }, { "docid": "d4dcd8ce56a8810934ec64b0bbe8556a", "score": "0.4741701", "text": "function activeNextBtn() {\n if ($validateNumbers) {\n $nextBtn.removeAttr('disabled');\n }\n }", "title": "" }, { "docid": "c4cda9666295b8c4c1fb3df3f8924123", "score": "0.47360027", "text": "function onLinkButtonClick(event){\n\t\tvar objTile = jQuery(this).parents(\".ug-tile\");\n\n\t\tif(g_temp.funcParentApproveClick && g_temp.funcParentApproveClick() == false)\n\t\t\tevent.preventDefault();\n\n\t\t//allow click only from over style\n\t\tif(isOverStyle(objTile) == false && g_options.tile_as_link == false){\n\t\t\tevent.preventDefault();\n\t\t\tonMobileClick(objTile);\n\t\t}\n\n\t}", "title": "" }, { "docid": "fb4dd277ae1051735f23d6a8aef3c7df", "score": "0.47330123", "text": "function hidePageLinks() {\n //hides the exercise and lecture icons\n exercise.hide();\n lecture.hide();\n \n //resets the url for the exercise and lecture pages\n $(\"#exerciselink\").attr(\"href\",\"#\");\n $(\"#lecturelink\").attr(\"href\",\"#\");\n }", "title": "" }, { "docid": "24d60875d94b4c551a2a748bdbd25a75", "score": "0.47193888", "text": "recordOnlyRelativeLink(pNode) {\n const href = pNode.parentNode.getAttribute('href');\n if(href.substring(0,1)!=='#' && href!=='javascript:void(0)' && href.substring(0,4)!=='http'\n && href.substring(0,3)!=='/-/' && href.substring(0,6)!=='/media'\n && href.substring(0,9)!=='/sitecore' && href.substring(0,3)!=='tel'\n && href.substring(0,3)!=='ema' && href.substring(0,3)!=='e-m' && href.substring(0,3)!=='mai') {\n this.linksRelative.push(this.websiteUrl.concat(href));\n // pNode.parentNode.setAttribute('href',this.websiteUrl.concat(href));\n }\n\n }", "title": "" }, { "docid": "e5643e8e5dc8dd18f4faec8b05f7b539", "score": "0.47122538", "text": "function get_next_page() {\n current_offset += page_limit\n get_different_page()\n\n if (current_offset != 0) {\n $(\"button[name='prev-btn\").prop(\"disabled\", false)\n }\n}", "title": "" }, { "docid": "049e6d1adf66ed82ccf30e194f42a94c", "score": "0.4710333", "text": "function nextSong() {\n\t\t$('.playControls .skipControl__next').trigger('click');\n\t}", "title": "" }, { "docid": "70ce466d33799aec7a590f4d7c16dbcd", "score": "0.47102028", "text": "function clearAllMobile(main_link) {\n main_link.each((index, element) => {\n const link_box = $($(element).siblings()[2]);\n const arrow_img = $($(element).siblings()[1]);\n link_box.removeClass('link-box-show');\n arrow_img.removeClass('arrow-rotate');\n });\n}", "title": "" }, { "docid": "0a5754890f4df1145d1ea238458b7b46", "score": "0.4705176", "text": "buildLinkButton(link, label) {\n if (link) {\n return(\n <div className=\"pe-buttons-btn\">\n <a href={link}>\n <ButtonNoScroll\n addClasses=\"btnns-linked\"\n label={label}\n />\n </a>\n </div>\n );\n }\n }", "title": "" }, { "docid": "92b7fc13104a52a379e193a3efbf73a5", "score": "0.4699124", "text": "function disableRollingLinks() {\n var anchors = dom.wrapper.querySelectorAll(SLIDES_SELECTOR + ' a.roll');\n\n for (var i = 0, len = anchors.length; i < len; i++) {\n var anchor = anchors[i];\n var span = anchor.querySelector('span');\n\n if (span) {\n anchor.classList.remove('roll');\n anchor.innerHTML = span.innerHTML;\n }\n }\n }", "title": "" }, { "docid": "3c57f81c52b4d49a9f2a8c00b7208a20", "score": "0.46933806", "text": "function disablePreviewLinks() {\n\n\t\tvar anchors = toArray( document.querySelectorAll( 'a' ) );\n\n\t\tanchors.forEach( function( element ) {\n\t\t\tif( /^(http|www)/gi.test( element.getAttribute( 'href' ) ) ) {\n\t\t\t\telement.removeEventListener( 'click', onPreviewLinkClicked, false );\n\t\t\t}\n\t\t} );\n\n\t}", "title": "" }, { "docid": "3c57f81c52b4d49a9f2a8c00b7208a20", "score": "0.46933806", "text": "function disablePreviewLinks() {\n\n\t\tvar anchors = toArray( document.querySelectorAll( 'a' ) );\n\n\t\tanchors.forEach( function( element ) {\n\t\t\tif( /^(http|www)/gi.test( element.getAttribute( 'href' ) ) ) {\n\t\t\t\telement.removeEventListener( 'click', onPreviewLinkClicked, false );\n\t\t\t}\n\t\t} );\n\n\t}", "title": "" }, { "docid": "3c57f81c52b4d49a9f2a8c00b7208a20", "score": "0.46933806", "text": "function disablePreviewLinks() {\n\n\t\tvar anchors = toArray( document.querySelectorAll( 'a' ) );\n\n\t\tanchors.forEach( function( element ) {\n\t\t\tif( /^(http|www)/gi.test( element.getAttribute( 'href' ) ) ) {\n\t\t\t\telement.removeEventListener( 'click', onPreviewLinkClicked, false );\n\t\t\t}\n\t\t} );\n\n\t}", "title": "" }, { "docid": "c32e4beecea4c831b26e175596baf5bd", "score": "0.4691271", "text": "function disablePreviewLinks(selector) {\n var anchors = toArray(document.querySelectorAll(selector ? selector : 'a'));\n anchors.forEach(function (element) {\n if (/^(http|www)/gi.test(element.getAttribute('href'))) {\n element.removeEventListener('click', onPreviewLinkClicked, false);\n }\n });\n }", "title": "" }, { "docid": "2efec7ebf1d515df3d2dbe8762f6e0f2", "score": "0.46907225", "text": "function execute_ignoreBox(){\n for(var i=0 ; i<links.length ; i++){\n if(links[i].innerHTML=='ignore topic'){\n var link = create('a') ;\n link.href = links[i].href ;\n link.innerHTML = links[i].innerHTML ;\n link.className = links[i].className ;\n links[i].parentNode.insertBefore(link, links[i]) ;\n links[i].parentNode.removeChild(links[i].nextSibling) ;\n return ;\n }\n }\n}", "title": "" }, { "docid": "23f8babd2f159fccbc3fef3099fefc6e", "score": "0.4685036", "text": "function disablePreviewLinks( selector ) {\n\n\t\tvar anchors = toArray( document.querySelectorAll( selector ? selector : 'a' ) );\n\n\t\tanchors.forEach( function( element ) {\n\t\t\tif( /^(http|www)/gi.test( element.getAttribute( 'href' ) ) ) {\n\t\t\t\telement.removeEventListener( 'click', onPreviewLinkClicked, false );\n\t\t\t}\n\t\t} );\n\n\t}", "title": "" }, { "docid": "9b98cb52b526c10daf6e561ddd173cf1", "score": "0.46847364", "text": "function handleHeaderShoppingCartLink() {\n $('.shopping-cart-link a').on('click', function (event) {\n if (ssCore.getViewPort().width > window.themeSettings.themeBreakpoint) {\n event.preventDefault();\n }\n else {\n location.href = $(this).attr('href');\n }\n });\n }", "title": "" }, { "docid": "861c2a97dd42e921d4448ee28fc8c262", "score": "0.46786994", "text": "function disableVoidLinks() {\n var v = function(event) {\n event.preventDefault();\n };\n $('a.void').on('click', v);\n }", "title": "" }, { "docid": "39a3c890ee7160e6432626712a8fd8b7", "score": "0.46702322", "text": "trimDropdownLink(link) {\n const topTierLink = link.href.split('-dropdown')[0]\n link.setAttribute('href', topTierLink)\n }", "title": "" }, { "docid": "dd73c3b05a7ee45b0b2ce72d24c36d01", "score": "0.4666144", "text": "function enableContinueButton() {\n $(\"button[name=continue]\").prop(\"disabled\", false);\n}", "title": "" }, { "docid": "b761efa8544df819ed4e41759b50fb84", "score": "0.46648508", "text": "function skipInfo() {\n $('.js-skip-info').click(function () {\n saveInfos('', '', '');\n })\n }", "title": "" }, { "docid": "1ef3455872c599484ee182ecf6e18788", "score": "0.46636647", "text": "function switchMobileToView(page) {\n if (page === \"notepad\"){\n $('#note-selection').addClass('mobile-hide');\n $('#note-content').removeClass('mobile-hide');\n } else {\n $('#note-selection').removeClass('mobile-hide');\n $('#note-content').addClass('mobile-hide');\n }\n }", "title": "" }, { "docid": "3ccc4662c752e9944309653d1e4c90aa", "score": "0.46592698", "text": "function nextPageButtonDisabled(){\n let pageButtonsDisabled = false;\n //getting next page button from DOM\n var pageButtons = document.getElementsByClassName('artdeco-table-next-btn');\n\n console.log('pageButtons',pageButtons );\n // checking for disabled prop\n for (var i = 0; i < pageButtons.length; i++) {\n pageButtonsDisabled = (pageButtons[i].disabled)\n console.log('pageButtonsDisabled',pageButtonsDisabled);\n\n }\n if (pageButtonsDisabled) {\n return true;\n }else {\n return false;\n }\n\n}", "title": "" }, { "docid": "6e6fde768da09b3627ccffe340400678", "score": "0.46573612", "text": "function skipStep() {\n clearUp();\n //generate input and result header\n for (var i = 0; i < state.listLength+1; i++){\n\n var xOrigin = sideMargin + blockWidth * i;\n var yOrigin = topMargin + i * 3 * lineHeight;\n var thisCall = state.recursiveCalls[i];\n var s1 = \"powerset(\"+xToString(thisCall.input)+\")\"\n var h1 = ex.createHeader(xOrigin, yOrigin, s1,\n {size:fontSize, textAlign:\"right\",\n transition:\"fade\"});\n state.recursiveCalls[i].h1 = h1;\n\n var s2 = xToString(thisCall.result);\n var h2 = ex.createHeader(xOrigin, yOrigin + lineHeight, s2,\n {size:fontSize, textAlign:\"right\",\n transition:\"fade\"});\n state.recursiveCalls[i].h2 = h2;\n h2.width(blockWidth);\n h1.width(blockWidth);\n }\n\n skipButton.disable();\n nextButton.disable();\n prevButton.disable();\n ex.alert(\"Finished, begin quiz by clicking StartQuiz button\", {color: \"green\", transition: \"alert-long\"});\n return;\n }", "title": "" }, { "docid": "e1b8c9b5c53311b8974161e0f98a0f82", "score": "0.46543184", "text": "function pt(e){return!(e instanceof Element)||Pi.call(e,\"a[href],area[href],button,details,input,textarea,select,iframe,[tabindex]\")&&!e.hasAttribute(\"disabled\")}", "title": "" }, { "docid": "fde5c5b3169ed1fa5a79cb7c2e9cccf8", "score": "0.4651461", "text": "function disableGoButton() {\n var goButton = $('#goButton');\n if (goButton.not(':disabled')) {\n goButton.prop('disabled', true);\n }\n }", "title": "" }, { "docid": "4df0a7f866dc578796b5b8d7fd37a72a", "score": "0.46438354", "text": "function enableLinks($slide) {\r\n\t\t\tif (!$_accordion.hasClass('jAccordion-keepLinksEnabled')) {\r\n\t\t\t\t$('a:not(.jAccordion-keepEnabled)', $slide).unbind('click.smartLink');\r\n\t\t\t}\r\n }", "title": "" }, { "docid": "6fddf1a558af00b454e3c119a4295faf", "score": "0.46429148", "text": "hideNextButton() {\n this.$(this.progress.displayConfig.ui.next.target).hide();\n }", "title": "" }, { "docid": "b0e2c5024756fe3995c70f2569dc240a", "score": "0.4640098", "text": "function pageBtnsEnableCheck() {\n backBtn.disabled = false\n nextBtn.disabled = false\n \n if (currentPage >= (navItems.length - 1)) \n nextBtn.disabled = true\n if (currentPage <= 0)\n backBtn.disabled = true\n}", "title": "" }, { "docid": "017af0a9a17edab0f0ed20c279a495f6", "score": "0.46367225", "text": "handleNextClick() {\n if (this.currentVideoCount < this.totalVideos - 1) {\n this.currentVideoCount += 1;\n this.previousButtonDisabled = false;\n }\n if (this.currentVideoCount === this.totalVideos - 1) {\n this.forwardButtonDisabled = true;\n }\n }", "title": "" }, { "docid": "fbdf70ed474363657e49b3515587bcb0", "score": "0.46339315", "text": "function carouselLinksApproach() {\n $('#approach-interior .carousel-linked-nav > li > a').click(function() {\n var item = Number($(this).attr('href').substring(1));\n $('#approach-interior .carousel').carousel(item - 1);\n $('#approach-interior .carousel-linked-nav .active').removeClass('active');\n $(this).parent().addClass('active');\n return false;\n });\n }", "title": "" }, { "docid": "c0cd334928b66fd71138aaae3cf6e43b", "score": "0.46317264", "text": "function navigatorMouseIn(event) {\n navigatorCancelHideArrows();\n event.preventDefault();\n}", "title": "" }, { "docid": "0c4900b36353624746d6b98d1dc9379f", "score": "0.4623829", "text": "function fixLinks () {\n qs(CONTENT_SELECTOR).querySelectorAll('a').forEach(anchor => {\n if (anchor.querySelector('code, img')) {\n anchor.classList.add('no-underline')\n }\n })\n}", "title": "" } ]
41ef379ed65e3a987941a4cc01428e6b
Constructor for the BubbleBreaker object
[ { "docid": "6abd286cb3a53e6760c572f808f5848c", "score": "0.60644495", "text": "function BubbleBreaker() {\n\n this.score = 0;\n this.startTime = 0;\n this.board = new Array();\n this.highlighted = new Array();\n this.removed = new Array();\n this.table = document.getElementById(\"board\");\n\n this.init = function () {\n this.clearBoard();\n this.fillBoard();\n this.resetStartTime();\n this.resetHighlight();\n this.score = 0;\n this.updateScore();\n interval = setInterval(function(){timer()}, 1000);\n \n var howto = document.getElementById(\"howto\");\n howto.setAttribute(\"style\",\"visibility:hidden\");\n }\n \n this.resetStartTime = function () {\n var d = new Date();\n this.startTime = d.getTime();\n }\n \n /*Add a bubble to the html document and the corresponding\n reference the the board array*/\n this.addBubble = function (td, i, j) { \n var img = document.createElement(\"img\");\n\n /*randomly choose color of bubble to be added*/\n var n = Math.floor((Math.random()*5)+1);\n switch(n)\n {\n case 1:\n var color = \"b\";\n img.setAttribute(\"src\", \"img/b.png\");\n break;\n case 2:\n var color = \"g\";\n img.setAttribute(\"src\", \"img/g.png\");\n break; \n case 3:\n var color = \"p\";\n img.setAttribute(\"src\", \"img/p.png\");\n break;\n case 4:\n var color = \"r\";\n img.setAttribute(\"src\", \"img/r.png\");\n break;\n case 5:\n var color = \"y\";\n img.setAttribute(\"src\", \"img/y.png\");\n break;\n }\n\n td.appendChild(img);\n this.board[i][j] = new Bubble(color, i, j, td);\n img.onclick = function(){bubbleBreaker.playMove(i, j)};\n }\n \n /*Remove bubble from the board*/\n this.removeBubble = function (bubble) {\n bubble.color = \"n\";\n bubble.htmlLocation.getElementsByTagName(\"img\")[0].setAttribute(\"src\", \"img/n.png\");\n }\n\n /*Fill the html document and corresponding board array with\n bubbles*/\n this.fillBoard = function () { \n \tfor (var i=0; i<8; i = i + 1) {\n \tvar tr = document.createElement(\"tr\");\n \tthis.table.appendChild(tr);\n\n this.board[i] = new Array();\n \tfor(var j=0; j<15; j = j + 1) {\n \tvar td = document.createElement(\"td\");\n \ttr.appendChild(td);\n \tthis.addBubble(td, i, j);\n \t}\n \t}\n }\n\n /*Clear the html*/\n this.clearBoard = function () {\n var len = this.table.childNodes.length;\n if(len > 1){\n for(var i = 1; i < len; i = i + 1){\n this.table.removeChild(this.table.childNodes[1]);\n }\n }\n }\n \n /*Return true is the game is over, false otherwise*/\n this.isGameOver = function () {\n for (var i = 0; i < this.board.length; i = i + 1) {\n for (var j = 0; j < this.board[i].length; j = j + 1) {\n var bubble = this.board[i][j];\n if (bubble.color != \"n\") {\n if (j > 0 && bubble.color == this.board[i][j-1].color) {\n return false;\n }\n else if (j < 14 && bubble.color == this.board[i][j+1].color) {\n return false;\n }\n else if (i > 0 && bubble.color == this.board[i-1][j].color) {\n return false;\n }\n else if (i < 7 && bubble.color == this.board[i+1][j].color) {\n return false;\n }\n }\n }\n }\n return true;\n }\n \n this.endGame = function() {\n this.resetStartTime();\n clearInterval(interval);\n alert(\"Game Over\");\n }\n \n /*Process the user's click according to the game's rules*/\n this.playMove = function (i, j) {\n if(this.board[i][j].color != \"n\"){\n var b = this.board[i][j]; \n if (this.isHighlighted(b)){\n /*-remove group of highlighted bubbles DONE\n -apply gravity DONE\n -reset highlighted set DONE\n -add points to score\n - see if won\n */\n this.hidePossibleScore();\n this.removeHighlightedBubbles();\n this.applyGravity();\n this.score = this.score + Math.pow(this.highlighted.length, 2);\n this.updateScore();\n this.resetHighlight();\n if (this.isGameOver()){\n this.endGame();\n }\n }\n else{\n /*-reset highlighted set DONE\n -highlight bubbles DONE\n -show possible score\n */\n this.resetHighlight();\n this.highlight(i, j);\n this.showPossibleScore(Math.pow(this.highlighted.length, 2));\n \n }\n }\n }\n \n /*I don't know how to explain it, but it's neat stuff :)*/\n this.applyGravity = function () {\n \n var stack = this.highlighted.slice(0);\n stack.sort(function(a,b){return a.i-b.i});\n while(stack.length > 0){\n var bubble = stack.pop();\n var u = bubble.i - 1;\n while(u > 0 && this.board[u][bubble.j].color == \"n\"){\n u = u - 1;\n }\n\n if(u >= 0 && this.board[u][bubble.j].color != \"n\"){\n bubble.color = this.board[u][bubble.j].color;\n var img = bubble.htmlLocation.getElementsByTagName(\"img\")[0];\n var path = \"img/\" + bubble.color + \".png\";\n img.setAttribute(\"src\", path);\n \n this.board[u][bubble.j].color = \"n\";\n img = this.board[u][bubble.j].htmlLocation.getElementsByTagName(\"img\")[0];\n img.setAttribute(\"src\", \"img/n.png\");\n \n stack.unshift(this.board[u][bubble.j]);\n }\n }\n }\n \n /*Reset highlight*/\n this.resetHighlight = function () {\n for (var i = 0; i < this.highlighted.length; i = i + 1) {\n this.highlighted[i].htmlLocation.setAttribute(\"style\", \"\");\n }\n this.highlighted = new Array();\n }\n \n /*Remove bubbles in the highlighted array*/\n this.removeHighlightedBubbles = function (){\n for (var i = 0; i < this.highlighted.length; i = i +1){\n this.removeBubble(this.highlighted[i]);\n }\n }\n \n /*Check if a bubble is in the highlighted array*/\n this.isHighlighted = function (bubble) {\n for (e in this.highlighted){\n if(this.highlighted[e].i == bubble.i \n && this.highlighted[e].j == bubble.j){\n return true;\n }\n }\n return false;\n }\n \n /*Fill the highlighted array with bubble of position i,j\n and bubbles of the same color adjacent to it*/\n this.fillHighlighted = function (i,j) {\n var bubble = this.board[i][j];\n \n if(this.isHighlighted(bubble) == false){\n this.highlighted.push(bubble);\n \n if (j > 0 && bubble.color == this.board[i][j-1].color) {\n this.fillHighlighted(i, j-1);\n }\n if (j < 14 && bubble.color == this.board[i][j+1].color) {\n this.fillHighlighted(i, j+1);\n }\n if (i > 0 && bubble.color == this.board[i-1][j].color) {\n this.fillHighlighted(i-1, j);\n }\n if (i < 7 && bubble.color == this.board[i+1][j].color) {\n this.fillHighlighted(i+1, j);\n }\n }\n }\n \n /*Highlight set of adjacent bubbles of the same color\n starting from bubble at position i,j*/\n this.highlight = function (i, j) {\n this.fillHighlighted(i, j);\n if (this.highlighted.length > 1) {\n for (var a = 0; a < this.highlighted.length; a = a + 1) {\n var b = this.highlighted[a];\n var style = \"\";\n \n if (b.j > 0) {\n var c = this.board[b.i][b.j - 1];\n if(this.isHighlighted(c) == false){\n style = \"border-left-color:white;\";\n }\n }\n else {\n style = \"border-left-color:white;\";\n }\n \n if (b.j < 14) {\n c = this.board[b.i][b.j + 1];\n if(this.isHighlighted(c) == false){\n style = style + \"border-right-color:white;\";\n }\n }\n else {\n style = style + \"border-right-color:white;\";\n }\n \n if (b.i > 0) {\n c = this.board[b.i - 1][b.j];\n if(this.isHighlighted(c) == false){\n style = style + \"border-top-color:white;\";\n }\n }\n else {\n style = style + \"border-top-color:white;\";\n }\n \n if (b.i < 7) {\n c = this.board[b.i + 1][b.j];\n if(this.isHighlighted(c) == false){\n style = style + \"border-bottom-color:white;\"\n }\n }\n else {\n style = style + \"border-bottom-color:white;\"\n }\n b.htmlLocation.setAttribute(\"style\", style);\n }\n }\n else{\n this.highlighted = new Array();\n }\n }\n \n this.updateScore = function () {\n var dashboard = document.getElementById(\"dashboard\");\n var table = dashboard.getElementsByTagName(\"table\")[0];\n var tr = table.getElementsByTagName(\"tr\")[1];\n var td = tr.getElementsByTagName(\"td\")[0];\n \n td.innerHTML = \"Score \" + this.score;\n }\n \n this.showPossibleScore = function (score) {\n document.getElementById(\"possibleScore\").innerHTML = \"+ \" + score; \n }\n \n this.hidePossibleScore = function () {\n document.getElementById(\"possibleScore\").innerHTML = \"\"; \n }\n}", "title": "" } ]
[ { "docid": "9ab0edb6bf8469bf64671eee0851c3f7", "score": "0.6547757", "text": "function Billboard() \r\n{\r\n\tthis._ctor();\r\n}", "title": "" }, { "docid": "f688adba5a436b7dfb22640f9bd1e040", "score": "0.619738", "text": "function Bubble(descr) {\n // Common inherited setup logic from Entity\n this.setup(descr);\n\n this.sprite = this.sprite || g_sprites.bubble;\n this.scale = this.scale || 1;\n}", "title": "" }, { "docid": "0468797f84899f84eb491d8ebb1bb62c", "score": "0.6000126", "text": "function initializeBubbles() {\n\n // DECREASE BUBBLE COUNT ON SMALLEST SCREENS\n let num = rootTones.length;\n if (cw < 400 || ch < 400) {\n num = rootTones.length - 1;\n }\n\n // UNIQUE BUBBLE ID\n let index = 0;\n\n // CREATE BUBBLE OBJECTS\n for (let i=0; i<num; i++){\n for (let j=0; j<intervals.length; j++) {\n\n // SET RANDOM STARTING POSITION\n // CHECK TO SEE IF ITS TOO CLOSE\n let x, y;\n do {\n x = Math.round(getRandomNumber(0, cw));\n y = Math.round(getRandomNumber(0, ch));\n } while (checkBubblePositions(x, y) === false );\n\n // SET MASS BASED ON FREQUENCY\n let massMin = 0.5;\n let massMax = 2.5;\n let m1 = remapNumber(i, rootTones.length-1, 0, massMin, massMax);\n let m2 = remapNumber(j, intervals.length-1, 0, massMin, massMax);\n let m = m1 + m2;\n\n // SET KEY AND TONE IDS\n let k = i;\n let n = j;\n\n // SET WAVE\n let wave = bassWave;\n if (i % 2 === 1) {\n wave = celesteWave;\n }\n\n // CREATE BUBBLE\n let b = new Bubble(x, y, m, k, n, wave, index);\n bubbles.push(b);\n\n // INCREAE UNIQUE ID\n index++;\n }\n }\n}", "title": "" }, { "docid": "87ba3cbfb3997e8ce2fd0599e635533e", "score": "0.58587325", "text": "constructor(canvas) {\n // Logical variables\n super(canvas);\n this.mouseDownOnSlider = false;\n this.onClick = (x, y) => { this._onClick(x, y); };\n this.onMouseUp = (x, y) => { this._onMouseUp(x, y); };\n this.onMouseMove = (x, y) => { this._onMouseMove(x, y); };\n\n // Value of input.\n this.value = 0.5;\n\n // Slider bubble (container of slider).\n this.bubbleWidth = 500;\n this.bubbleHeight = 100;\n this.bubble = undefined;\n\n // Knob that is slid to change input value.\n this.knob = undefined;\n\n // Header information.\n this.headerFont = Fonts.DEFAULT_FONT;\n this.headerText = '';\n this.header = undefined;\n\n // Style of bubble outline stroke.\n this.strokeStyle = Colors.DEFAULT_LINE_SHINE;\n\n // Strike-through line that knob rests on.\n this.line = undefined;\n\n this._compose();\n }", "title": "" }, { "docid": "f34bd68c5be55b4d9c1ba91a4dbd1ecb", "score": "0.58421034", "text": "constructor(height, weight) {\n //Instances Variables\n this.height = height;\n this.weight = weight;\n }", "title": "" }, { "docid": "5f6b5a4b5ff8c4dd171b43e7536b65c1", "score": "0.5815162", "text": "constructor(ctx, args) {\n super(ctx, args);\n this.txt = new Label_07(this.s, {\n cap: args.weight, x: this.x3, y: this.y3, start: args.start\n });\n }", "title": "" }, { "docid": "392ca1e107acff06a6d8e38f394ee32f", "score": "0.57611215", "text": "constructor() {\n super();\n this.boostValue = 0;\n this.boosting = false;\n this.jumping = false;\n this.powersliding = false;\n this.steerValue = 128; // 128 = no steer, 0 = full left, 255 = full right\n this.throttleValue = 128; // 128 = no throttle, 0 = full backward, 255 = full forward\n this.balanceValue = 128; // 128 = centered joystick, 0 = joystick pointing down, 255 = joystick pointing up\n }", "title": "" }, { "docid": "55062c181943e98cbab233a0d2a262e2", "score": "0.5734556", "text": "constructor(self) {\n\t\tthis.ball = this.createBall(self);\n\t\tthis.init();\n\t}", "title": "" }, { "docid": "e00207282f51c4b3c504fb9dc065ef11", "score": "0.5719655", "text": "function Bubble(text, width, x, y, side, colour) {\n this.width = width;\n this.y = y;\n //either left or right\n this.side = side;\n this.x = x;\n this.colour = colour;\n\n //set css properties\n var css = { top: y + 'px', 'background-color': colour, 'color': '#FFFFFF' };\n css[side] = x + 'px';\n\n //create div element with - text set - css properties applied and - css class added\n this.$bubble = $('<div/>')\n .html(text)\n .css(css)\n .addClass('bubble');\n\n //prepend adds element as first child of body\n $('body').prepend(this.$bubble);\n }", "title": "" }, { "docid": "4bf19ec917178d74f97eb8a1981aa6b8", "score": "0.57195044", "text": "constructor(args) {\n\t\tsuper(args);\n\t\tthis.color = \"LightSalmon\";\n\t\tthis.name = \"Balloon\";\n\t\tthis.image.height = 60;\n\t\tthis.image.width = 34;\n\t\tthis.height = 60;\n\t\tthis.width = 34;\n\t}", "title": "" }, { "docid": "642da9a6fa6a157fa2d0af75bf286a7e", "score": "0.5689843", "text": "_compose() {\n this.knobWidth = (this.bubbleWidth - this.bubbleHeight) * 0.9;\n this.knobMinX = this.x - this.knobWidth / 2;\n this.knobMaxX = this.x + this.knobWidth / 2;\n this.knobX = this.x + ((this.knobMaxX - this.x) * ((this.value - 0.5) * 2));\n this.mouseDownX = this.knobX;\n\n this.bubble =\n new MillionaireBubbleBuilder(this.canvas)\n .setPosition(this.x - this.bubbleWidth / 2, this.y)\n .setDimensions(this.bubbleWidth, this.bubbleHeight)\n .setStrokeStyle(this.strokeStyle)\n .build();\n\n this.line = new Path2D();\n this.knob = new Path2D();\n\n this.header =\n new TextElementBuilder(this.canvas)\n .setPosition(this.x, this.y - this.bubbleHeight * 1.2)\n .setTextAlign('center')\n .setFont(this.headerFont)\n .setText(this.headerText)\n .build();\n }", "title": "" }, { "docid": "c6c63b90925d45feefddb0b61dfdd7d1", "score": "0.5681037", "text": "function Bubble(x, y, p) {\n this.x = x;\n this.y = y;\n this.degree = p;\n\n // Dtermines the distance from mouse location.\n this.distX = 0;\n this.distY = 0;\n this.isPressed = false;\n\n // Determines the velocity of the note (range: [0,1]).\n // The diameter is the size of the bubble as used in\n // drawning an p5 ellipse.\n this.vel = VELOCITY;\n this.diam = DIAMETER;\n\n // Determines the coloring starting point.\n this.col = randomColor();\n\n this.display = function() {\n stroke(255);\n fill(this.col);\n ellipse(this.x, this.y, this.diam);\n }\n\n this.pressed = function() {\n let d = dist(mouseX, mouseY, this.x, this.y);\n if (d < this.diam / 2) {\n triggerAttack(this.degree, this.vel);\n this.isPressed = true;\n }\n }\n\n this.released = function () {\n let d = dist(mouseX, mouseY, this.x, this.y);\n if (d < this.diam) {\n this.brighten();\n triggerRelease(this.degree);\n this.isPressed = false;\n }\n }\n\n this.brighten = function () {\n this.col.setAlpha(alpha(this.col) + 1);\n }\n\n this.move = function() {\n this.x = this.x + random(-0.5, 0.5);\n this.y = this.y + random(-0.5, 0.5);\n }\n}", "title": "" }, { "docid": "e3e2e0e2abffac9b5eb7cfb52528c75c", "score": "0.56803113", "text": "constructor(x,y,paddleWidth,paddleHeight) {\n super(x,y,paddleWidth,paddleHeight,color(255));\n }", "title": "" }, { "docid": "97675f0e69b53fb7ea66b787873d5306", "score": "0.5678077", "text": "constructor(height, weight){\n //create local instances of variables\n this.height = height;\n this.weight = weight;\n }", "title": "" }, { "docid": "45d7c6044f862bb3400ecd9df61d570a", "score": "0.56777126", "text": "constructor(height, weight) {\n this.height = height;\n this.weight = weight;\n\n }", "title": "" }, { "docid": "385d24e85890cbafad10d95bbfc0b02b", "score": "0.5672984", "text": "function createBicyclePrototype() {\n let speed = 0;\n\n function applyBrake(decrease) {\n speed = -decrease;\n }\n\n function speedup(increment) {\n speed += increment;\n }\n\n return {\n speed,\n applyBrake: applyBrake,\n speedup: speedup\n }\n }", "title": "" }, { "docid": "fb4a8c388280429bdf5e3ed2f2e7dc0b", "score": "0.5671344", "text": "constructor(bubbleFactory,screenBottom,width,bubbleRadius) {\r\n\t\tthis.angle = 90;\r\n\t\tthis.bubbleFactory = bubbleFactory;\r\n\t\tthis.bottom = screenBottom;\r\n\t\tthis.bubble = null;\r\n\t\tthis.width = width;\r\n\t\tthis.bubbleRadius = bubbleRadius;\r\n\t\t//this.addBubble();\r\n\t}", "title": "" }, { "docid": "1fe525f9d2cc06656cedffc315162a8d", "score": "0.5661795", "text": "constructor(...args) {\n super(...args);\n\n\n // The following values should get overridden when delta states are merged, but we set them here as a reference for you to see what variables this class has.\n\n // default values for private member values\n this.busy = '';\n this.movingOnWeb = null;\n this.movingToNest = null;\n this.numberOfCoworkers = 0;\n this.workRemaining = 0;\n\n //<<-- Creer-Merge: init -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.\n // any additional init logic you want can go here\n //<<-- /Creer-Merge: init -->>\n }", "title": "" }, { "docid": "c8e7c61e7e0946a511cf407ed00ce10b", "score": "0.56557214", "text": "function LetterB(n, r, w, x, y, messageDiv) {\n\tthis.name = n;\n\talert(\"Letter \" + n + \" initalized!\");\n\tthis.messageDiv = messageDiv;\n\n\tthis.canvas = document.getElementById('paint');\n\tthis.ctx = canvas.getContext('2d');\n\n\tthis.start = false;\n\tthis.control = false;\n\tthis.controlNr = new Array();\n\tthis.end = false;\n\tthis.endAll = false;\n\n\tthis.radius = r;\n\tthis.x = x;\n\tthis.y = y;\n\tthis.lineWidth = w;\n\n\tthis.pt_start_x = new Array();\n\tthis.pt_start_y = new Array();\n\tthis.pt_end_x = new Array();\n\tthis.pt_end_y = new Array();\n\tthis.pt_control_x = new Array();\n\tthis.pt_control_y = new Array();\n\n\tthis.pt_start_x[0] = x;\n\tthis.pt_start_y[0] = y + 200;\n\tthis.pt_end_x[0] = x + 30;\n\tthis.pt_end_y[0] = y + 190;\n\tthis.pt_control_x[0] = x;\n\tthis.pt_control_y[0] = y;\n\tthis.controlNr[0] = false;\n\tthis.pt_control_x[1] = x + 30;\n\tthis.pt_control_y[1] = y + 100;\n\tthis.controlNr[1] = false;\n\n\t// Methods\n\tthis.drawStartPoint = LetterB_drawStartPoint;\n\tthis.drawEndPoint = LetterB_drawEndPoint;\n\tthis.drawControlPoints = LetterB_drawControlPoints;\n\tthis.drawHelpLines = LetterB_drawHelpLines;\n\n\tthis.checkStart = LetterB_checkStart;\n\tthis.handleControls = LetterB_handleControls;\n\tthis.checkEnd = LetterB_checkEnd;\n\n\tthis.drawPreview = LetterB_drawPreview;\n}", "title": "" }, { "docid": "2ee4f299855fd7b061e4e63c03169127", "score": "0.56485885", "text": "constructor() {\n super();\n // initialization\n this.endLabel = new objects.Label();\n this._background = new objects.Background();\n this._backButton = new objects.Button();\n this._scoreBoard = new managers.ScoreBoard;\n this.Start();\n }", "title": "" }, { "docid": "83be67328f26bc36f705c3f2e7f5693e", "score": "0.5620193", "text": "function Bullet(X, Y) {\n this.x = X;\n this.y = Y;\n this.toX = document.getElementById(\"canvas\").clientWidth;\n //this.toy = toY; NOT IMPLEMENTED YET\n}", "title": "" }, { "docid": "5419611d665a808a974bf451525f8961", "score": "0.55960375", "text": "function CreateCircuitBreaker(InParent, InContact, InX, InY, InWidth, InHeight, InCount, InRating, InContactIndex) {\r\n\r\n var clickArea, b, breaker;\r\n var x1, x2, x3, x4, y1, y2, y3, y4, cx;\r\n var i, h, d;\r\n this.body = document.createElementNS(SVGNS, \"g\");\r\n\r\n InParent.appendChild(this.body);\r\n \r\n var breakerBody = document.createElementNS(SVGNS, \"rect\");\r\n\r\n if ( InContact ) {\r\n InContact.breakerFuse = breakerBody;\r\n InContact.breakerFuseWidth = InCount; \r\n InContact.breakerCount = InCount;\r\n InContact.breakerRating = InRating;\r\n }\r\n var totalWidth = InWidth * InCount;\r\n breakerBody.setAttribute(\"x\", InX);\r\n breakerBody.setAttribute(\"y\", InY);\r\n breakerBody.setAttribute(\"width\", totalWidth);\r\n breakerBody.setAttribute(\"height\", InHeight);\r\n breakerBody.setAttribute(\"fill\", \"silver\");\r\n breakerBody.setAttribute(\"stroke\", \"black\");\r\n\r\n b = document.createElementNS(SVGNS, \"rect\");\r\n b.setAttribute(\"y\", InY + 5);\r\n b.setAttribute(\"x\", InX);\r\n b.setAttribute(\"width\", totalWidth);\r\n b.setAttribute(\"height\", InHeight - 10);\r\n b.setAttribute(\"fill\", \"#000000FF\");\r\n\r\n breaker = document.createElementNS(SVGNS, \"path\");\r\n breaker.id = \"Switch\";\r\n x1 = InX + 3;\r\n x2 = InX + (totalWidth - 3);\r\n x3 = InX + (totalWidth - 3);\r\n x4 = InX + 2;\r\n\r\n y1 = InY + ((InHeight/2));\r\n y2 = InY + ((InHeight/2));\r\n y3 = y1 + 4;\r\n y4 = y2 + 4;\r\n\r\n this.body.appendChild(breakerBody);\r\n this.body.appendChild(b);\r\n this.body.appendChild(breaker);\r\n cx = InX + InWidth/2;\r\n \r\n for (i = 0; i < InCount; i++) {\r\n h = document.createElementNS(SVGNS, \"circle\");\r\n h.setAttribute('cx', cx);\r\n h.setAttribute('cy', InY + 3);\r\n h.setAttribute(\"r\", 1.4);\r\n h.setAttribute(\"fill\", \"#00000080\");\r\n this.body.appendChild(h);\r\n\r\n h = document.createElementNS(SVGNS, \"circle\");\r\n h.setAttribute('cx', cx);\r\n h.setAttribute('cy', InY + InHeight - 3);\r\n h.setAttribute(\"r\", 1.4);\r\n h.setAttribute(\"fill\", \"#000000FF\");\r\n this.body.appendChild(h);\r\n cx += InWidth;\r\n }\r\n\r\n d = \"M\" + x1 + \",\" + y1 + \" \";\r\n d += x2 + \",\" + y2 + \" \";\r\n d += x3 + \",\" + y3 + \" \";\r\n d += x4 + \",\" + y4 + \"Z\";\r\n\r\n breaker.setAttribute(\"d\", d);\r\n breaker.setAttribute(\"fill\", ContactBreakerClosedColor);\r\n clickArea = document.createElementNS(SVGNS, \"rect\");\r\n clickArea.setAttribute(\"fill\", \"#00000010\");\r\n clickArea.setAttribute(\"x\", InX);\r\n clickArea.setAttribute(\"y\", InY);\r\n clickArea.setAttribute(\"width\", totalWidth);\r\n clickArea.setAttribute(\"height\", InHeight);\r\n clickArea.contactType = InRating;\r\n clickArea.contactWidth = InCount;\r\n clickArea.contactIndex = InContactIndex;\r\n clickArea.contact = InContact;\r\n if ( InContact ) {\r\n clickArea.dsm = InContact.dsm;\r\n }\r\n clickArea.breaker = breaker;\r\n clickArea.style.cursor = \"hand\";\r\n clickArea.draggable = \"true\";\r\n clickArea.ondragstart = function(event) { BreakerDrag(event); }\r\n clickArea.contactBasicType = \"Breaker\";\r\n clickArea.contactState = \"Closed\";\r\n clickArea.id = \"SelectArea\";\r\n this.body.appendChild(clickArea);\r\n this.body.contactState = \"Closed\";\r\n clickArea.onclick = function(InEvent) { ContactTypeAssignCB(InEvent); };\r\n clickArea.onmouseover = function(InEvent) { ContactTypeHoverCB(InEvent, true); };\r\n clickArea.onmouseleave= function(InEvent) { ContactTypeHoverCB(InEvent, false); };\r\n if ( InContact ) {\r\n SetContactState(InContact.dsm, InContact.contactIndex, \"Closed\");\r\n }\r\n return this.body;\r\n}", "title": "" }, { "docid": "aea0cef0f5d1788b30d16241c143d030", "score": "0.55924416", "text": "constructor({\n x,\n y,\n velocity,\n horizontal = false,\n maxCells = 2,\n brains,\n color,\n name = \"\",\n }) {\n this._private_INITIAL = { x, y, velocity, horizontal, maxCells };\n this._private_x = x;\n this._private_y = y;\n this._private_name = name;\n this._private_velocity = velocity;\n this._private_speed = Math.abs(this.velocity);\n this._private_horizontal = horizontal;\n this._private_cells = [];\n this._private_maxCells = maxCells;\n this._private_color = color;\n for (let i = 0; i < this._private_maxCells; i++) {\n if (horizontal) {\n this._private_cells.push({ x: x - i, y });\n } else {\n this._private_cells.push({ x, y: y - i });\n }\n }\n this._private_brains = brains;\n this.boundUpdateState = this.updateState.bind(this);\n this.enabled = true;\n }", "title": "" }, { "docid": "b8dad461dc8152cad84da87dcf607544", "score": "0.556138", "text": "constructor(piece, to) {\r\n this.piece = piece;\r\n this.to = to;\r\n }", "title": "" }, { "docid": "0bf9908fd3b047e2d38c3e93fe02abf8", "score": "0.55446947", "text": "function Bacon(bacon)\n{\n this.toppingBacon=bacon;\n this.baconCost=[];\n}", "title": "" }, { "docid": "f23a866e361105eb0c405d9483986f26", "score": "0.55325955", "text": "function Bee() {\n let weight = 15;\n this.getWeight = function() {\n return weight;\n };\n}", "title": "" }, { "docid": "3d4ee32e8fb2d273d3c2af29521f9b48", "score": "0.5528259", "text": "function B(els) {\n if(typeof els === \"string\") {\n els = this.brb.create(els);\n }\n for(var i = 0; i < els.length; i++) {\n this[i] = els[i];\n }\n this.length = els.length;\n// return this;\n }", "title": "" }, { "docid": "f788a25934d3f6a99f5aee7f1090b568", "score": "0.55136", "text": "constructor(x, y, origin){\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.boutonHeight = boutonHeight;\n\t\tthis.origin = origin;\n\t\tthis.rgb = [185, 185, 185, 1.0]; \t\n\t}", "title": "" }, { "docid": "d2f1b389cdf059613e3c94c0b46d4a31", "score": "0.55040866", "text": "constructor() {\r\n this.chain = [];\r\n this.height = -1;\r\n this.initializeChain();\r\n }", "title": "" }, { "docid": "496837a7e05c9bc143ce2c9d67a43140", "score": "0.5480802", "text": "makeActiveBubble(){\n this.bubble = new Bubble({game: this.game,\n x :this.ship.body.x,\n y: this.ship.body.y,\n asset:'bluebubble',\n rightBound: this.rightBound,\n leftBound: this.leftBound,\n ship:this.ship});\n this.game.add.existing(this.bubble);\n }", "title": "" }, { "docid": "d4992fe31cdb31327e0b1811ba549960", "score": "0.5480624", "text": "constructor() {\n //Array to store the alive coins' positions\n this.positions = [];\n this.status = [];\n this.changeColors = [];\n this.whites = 0;\n this.blacks = 0;\n //Creating the array to store the coins\n this.coins = [];\n for (let i = 0; i < 8; i++) {\n for (let j = 0; j < 8; j++) {\n this.positions.push([j, i]);\n this.status.push(0);\n }\n }\n this.emptyPositions = [];\n // STARTING CASES\n this.coins.push(new Coin(355, 355, 90, color(255), 'white'));\n this.coins.push(new Coin(355, 455, 90, color(0), 'black'));\n this.coins.push(new Coin(455, 355, 90, color(0), 'black'));\n this.coins.push(new Coin(455, 455, 90, color(255), 'white'));\n\n // TEST CASES\n // this.coins.push(new Coin(355, 255, 90, color(0), 'black'));\n // this.coins.push(new Coin(455, 555, 90, color(255), 'white'));\n }", "title": "" }, { "docid": "b5cc35ea3f0d2e3621999daf810e7d8a", "score": "0.54741114", "text": "constructor(param) {\n super(param);\n this.parent = param.id;\n this.speed = 10;\n this.x = PLAYER_LIST[this.parent].x + 10;\n this.y = PLAYER_LIST[this.parent].y - 10;\n this.angle = Math.atan((param.y - TOTAL_SCR_HEIGHT / 2) / (param.x - TOTAL_SCR_WIDTH / 2));\n if ((param.x - TOTAL_SCR_WIDTH / 2) < 0)\n this.angle += Math.PI;\n this.id = Math.random();\n this.speedX = Math.cos(this.angle) * 20;\n this.speedY = Math.sin(this.angle) * 20;\n\n this.timer = 0;\n this.toRemove = false;\n this.pressingLeftMouseButton = false;\n\n BULLET_LIST[this.id] = this;\n }", "title": "" }, { "docid": "818e1c0760f25b683d65d33aa720d585", "score": "0.5472466", "text": "function Tapper() {\n this.rolling = false;\n this.unbounded = false;\n this.tapped = 0;\n this.lastTapped = 0;\n this.interval = 0;\n this.previous = null;\n this.defalutGap = 60;\n this.minInterval = 16;\n this.maxInterval = 3000;\n }", "title": "" }, { "docid": "32a61c80c159b44a5c580541a676600f", "score": "0.54662526", "text": "constructor(x_,y_){\n this.xBrush = x_;\n this.yBrush = y_;\n \n}", "title": "" }, { "docid": "e405dc20bac458e7479d10aa46af01cc", "score": "0.5444252", "text": "function Bubble(x, y){\n this.x = x;\n this.y = y;\n \n this.radius = random(20, 50);\n this.lnWeight = 2;\n \n this.rValue = 240;\n this.gValue = 140;\n this.bValue = 170;\n this.aValue = 100;\n \n this.xStep = random(-2, 2);\n this.yStep = random(-2, 2);\n \n this.count = 0;\n this.maxCount = random(100, 150);\n \n this.draw = function(){\n fill(this.rValue, this.gValue, this.bValue, this.aValue);\n stroke(this.rValue, this.gValue, this.bValue);\n strokeWeight(this.lnWeight);\n ellipse(this.x, this.y, this.radius, this.radius);\n }\n \n this.play = function(){\n this.move();\n this.count++;\n }\n \n this.move = function(){\n this.x += this.xStep;\n this.y += this.yStep;\n }\n \n this.isPopped = function(){\n var xIsOut = (this.x - this.radius < 0) || (this.x + this.radius > myCaptureDevice.width);\n var yIsOut = (this.y - this.radius < 0) || (this.y + this.radius > myCaptureDevice.height)\n \n if(this.count >= this.maxCount || xIsOut || yIsOut){\n this.aValue = this.lnWeight = 0;\n notes[5].play();\n return true;\n }\n \n return false;\n }\n}", "title": "" }, { "docid": "57d3139ca3f6804d14fe221c2049d351", "score": "0.543744", "text": "setupBubblePool(_numBubbles){\n let numObjs = _numBubbles;\n \n for (let i = 0; i < numObjs; i++){\n this.createBubble\n (-99,-99, Math.random()*\n (this.maxB-this.minB)+this.minB);\n // Grab this object.\n this.bubbles[i] = RedHen_2DPhysics.\n lastObjectCreated();\n // Time to sleep.\n RedHen_2DPhysics.lastObjectCreated().\n makeSleep(true);\n }\n \n }", "title": "" }, { "docid": "d7482dae5183f7bbad5be48418862a36", "score": "0.54106677", "text": "init() {\n\tthis.board = new Board(\"\");\t// Board object\n\tthis.clicked_cell = V.NO_CELL_CLICKED;\n\tthis.promotion_piece = C.EMPTY;\n\tthis.move_r0 = 0;\n\tthis.move_r = 0;\n\tthis.move_c = 0;\n\tthis.move_c0 = 0;\n\tthis.plys = new Array;\n\tthis.black_view = 0;\n }", "title": "" }, { "docid": "903afcaeab1637c5346ca98f504ffb29", "score": "0.54085666", "text": "function Bumper(cell) {\n this.color = Color.randomColor();\n this.direction = Direction.randomDirection();\n this.cell = cell;\n}", "title": "" }, { "docid": "c9351bdeeeb403cd5fd06384a6779e3c", "score": "0.5408138", "text": "constructor(initWeight, bmr, pal) {\n this.initWeight = initWeight;\n this.bmr = bmr;\n this.pal = pal;\n }", "title": "" }, { "docid": "f6ce68799857f12f510747be60239615", "score": "0.53943616", "text": "function Bubble() {\n this.x = random(100, 120);\n this.y = random(0, height);\n this.i = random(100, 120);\n this.j = random(0, height - 100);\n //two types of bubble for variation\n this.display = function() {\n noStroke();\n fill(260, 80);\n ellipse(this.x, this.y, 20);\n\n noStroke();\n fill(260, 60);\n ellipse(this.i, this.j, 28);\n }\n //moving the bubbles in a circular loop with variations\n this.move = function() {\n this.x = this.x + random(-0.50, 0.50);\n this.y = this.y - 1;\n this.i = this.i + random(-0.50, 0.50);\n this.j = this.j - 1;\n if (this.y < 0) {\n this.y = height;\n this.x = random(100, 120);\n }\n if (this.j < 0) {\n this.j = height;\n this.i = random(100, 120);\n }\n }\n}", "title": "" }, { "docid": "9c9e98833dd9249de4b0d90e79df34e4", "score": "0.5389765", "text": "function CreateBullet(InParent, InContact, InX, InY, InWidth, InHeight, InCount, InRating, InContactIndex) {\r\n var b, breaker, x1, x2, x3, x4, y1, y2, y3, y4, d, cx, i, h, clickArea;\r\n this.body = document.createElementNS(SVGNS, \"g\");\r\n this.body.contactState = \"Closed\";\r\n InParent.appendChild(this.body);\r\n var breakerBody = document.createElementNS(SVGNS, \"rect\");\r\n\r\n if ( InContact ) {\r\n InContact.breakerFuse = this.body;\r\n InContact.breakerFuseWidth = InWidth;\r\n InContact.breakerCount = InCount;\r\n InContact.breakerRating = InRating;\r\n }\r\n\r\n var totalWidth = InWidth * InCount;\r\n breakerBody.setAttribute(\"x\", InX);\r\n breakerBody.setAttribute(\"y\", InY);\r\n breakerBody.setAttribute(\"width\", totalWidth);\r\n breakerBody.setAttribute(\"height\", InHeight);\r\n breakerBody.setAttribute(\"fill\", \"silver\");\r\n breakerBody.setAttribute(\"stroke\", \"black\");\r\n\r\n b = document.createElementNS(SVGNS, \"rect\");\r\n b.setAttribute(\"y\", InY + 5);\r\n b.setAttribute(\"x\", InX);\r\n b.setAttribute(\"width\", totalWidth);\r\n b.setAttribute(\"height\", InHeight - 10);\r\n b.setAttribute(\"fill\", \"#404080\");\r\n\r\n breaker = document.createElementNS(SVGNS, \"path\");\r\n breaker.id = \"Switch\";\r\n x1 = InX + 2;\r\n x2 = InX + (totalWidth - 2);\r\n x3 = InX + (totalWidth - 3);\r\n x4 = InX + 3;\r\n\r\n y1 = InY + ((InHeight/2));\r\n y2 = InY + ((InHeight/2));\r\n y3 = y1 + 4;\r\n y4 = y2 + 4;\r\n\r\n d = \"M\" + x1 + \",\" + y1 + \" \";\r\n d += x2 + \",\" + y2 + \" \";\r\n d += x3 + \",\" + y3 + \" \";\r\n d += x4 + \",\" + y4 + \"Z\";\r\n\r\n breaker.setAttribute(\"d\", d);\r\n breaker.setAttribute(\"fill\", ContactBreakerClosedColor);\r\n \r\n this.body.appendChild(breakerBody);\r\n this.body.appendChild(b);\r\n this.body.appendChild(breaker);\r\n cx = InX + InWidth/2;\r\n \r\n for (i = 0; i < InCount; i++) {\r\n h = document.createElementNS(SVGNS, \"circle\");\r\n h.setAttribute('cx', cx);\r\n h.setAttribute('cy', InY + 3);\r\n h.setAttribute(\"r\", 1.5);\r\n h.setAttribute(\"fill\", \"#0000F0C0\");\r\n this.body.appendChild(h);\r\n\r\n h = document.createElementNS(SVGNS, \"circle\");\r\n h.setAttribute('cx', cx);\r\n h.setAttribute('cy', InY + InHeight - 3);\r\n h.setAttribute(\"r\", 1.5);\r\n h.setAttribute(\"fill\", \"#0000F0C0\");\r\n this.body.appendChild(h);\r\n cx += InWidth;\r\n }\r\n\r\n clickArea = document.createElementNS(SVGNS, \"rect\");\r\n clickArea.id = \"SelectArea\";\r\n clickArea.setAttribute(\"fill\", \"#00000010\");\r\n clickArea.setAttribute(\"x\", InX);\r\n clickArea.setAttribute(\"y\", InY);\r\n clickArea.setAttribute(\"width\", totalWidth);\r\n clickArea.setAttribute(\"height\", InHeight);\r\n clickArea.contactType = InRating;\r\n clickArea.contactBasicType = \"Bullet\";\r\n clickArea.contactState = \"Closed\";\r\n clickArea.contactWidth = InCount;\r\n clickArea.contact = InContact;\r\n if ( InContact ) {\r\n clickArea.dsm = InContact.dsm;\r\n }\r\n clickArea.contactIndex = InContactIndex;\r\n this.body.appendChild(clickArea);\r\n clickArea.onclick = function(InEvent) { ContactTypeAssignCB(InEvent); };\r\n clickArea.onmouseover = function(InEvent) { ContactTypeHoverCB(InEvent, true); };\r\n clickArea.onmouseleave= function(InEvent) { ContactTypeHoverCB(InEvent, false); };\r\n if ( InContact ) {\r\n SetContactState(InContact.dsm, InContact.contactIndex, \"Closed\");\r\n }\r\n return this.body;\r\n}", "title": "" }, { "docid": "457eac6e541d9fc32e3cba353efe75ac", "score": "0.5386657", "text": "constructor(options = {}) {\n const opts = {...defaults, ...options};\n\n this.power = 0;\n this.crank = {revolutions: 0, timestamp: -Infinity};\n\n process.env['NOBLE_HCI_DEVICE_ID'] = opts.bikeAdapter;\n process.env['BLENO_HCI_DEVICE_ID'] = opts.serverAdapter;\n if (opts.bikeAdapter === opts.serverAdapter) {\n process.env['NOBLE_MULTI_ROLE'] = '1'\n }\n\n this.opts = opts;\n this.logger = new Logger();\n this.simulation = new Simulation();\n this.server = new GymnasticonServer(bleno, opts.serverName);\n\n this.antStick = createAntStick(opts);\n this.antServer = new AntServer(this.antStick, {deviceId: opts.antDeviceId});\n this.antStick.on('startup', this.onAntStickStartup.bind(this));\n\n this.pingInterval = new Timer(opts.serverPingInterval);\n this.statsTimeout = new Timer(opts.bikeStatsTimeout, {repeats: false});\n this.connectTimeout = new Timer(opts.bikeConnectTimeout, {repeats: false});\n this.powerScale = opts.powerScale;\n this.powerOffset = opts.powerOffset;\n\n this.pingInterval.on('timeout', this.onPingInterval.bind(this));\n this.statsTimeout.on('timeout', this.onBikeStatsTimeout.bind(this));\n this.connectTimeout.on('timeout', this.onBikeConnectTimeout.bind(this));\n this.simulation.on('pedal', this.onPedalStroke.bind(this));\n\n this.onSigInt = this.onSigInt.bind(this);\n this.onExit = this.onExit.bind(this);\n }", "title": "" }, { "docid": "768c7bfdc607e0e497014077ede0eec5", "score": "0.5382542", "text": "function BeeSwarm(x, y){\r\n\t this.x = x;\r\n\t\tthis.y = y;\r\n\t\tthis.offsetX = x;\r\n\t\tthis.offsetY = y;\r\n\t\tthis.speed = 5;\r\n\t}", "title": "" }, { "docid": "4d774e3c0e14015c6240507f216a51a5", "score": "0.53812504", "text": "constructor(...args) {\n super(...args);\n\n\n // The following values should get overridden when delta states are merged, but we set them here as a reference for you to see what variables this class has.\n\n // default values for private member values\n this.actions = 0;\n this.carryLimit = 0;\n this.chopping = 0;\n this.cost = 0;\n this.damage = 0;\n this.distractionPower = 0;\n this.health = 0;\n this.moves = 0;\n this.munching = 0;\n this.title = '';\n\n //<<-- Creer-Merge: init -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.\n // any additional init logic you want can go here\n //<<-- /Creer-Merge: init -->>\n }", "title": "" }, { "docid": "af9898f778a5eeeaa3a6001b2ab52a90", "score": "0.5380607", "text": "constructor(width, height, size) {\n this.width = width;\n this.height = height;\n this.size = size;\n\n // var tempBrick = new Brick(100, 200, 20);\n // var tempBrick2 = new Brick(200, 200, 20);\n // var tempBrick3= new Brick(300, 200, 20);\n\n this.brickMgr = new BrickManager();\n\n this.initData();\n }", "title": "" }, { "docid": "652e041d87f924c180cb1fd133aa0905", "score": "0.53737056", "text": "constructor(b, t) {\n\t\tthis.turn = t;\n\t\tthis.tiles = new Array(9);\n\t\tfor (let i = 0; i < 9; i++)\n\t\t\tthis.tiles[i] = b[i];\n\t}", "title": "" }, { "docid": "619253e1fbfd5e7bbcae0a66393701b6", "score": "0.5366114", "text": "constructor(t,e){this.bs={},this.Le=new J(0),this.Be=!1,this.Be=!0,this.referenceDelegate=t(this),this.ze=new Vr(this);this.Ht=new gi(),this.He=function(t,e){return new Pr(t,e);}(this.Ht,t=>this.referenceDelegate.Ps(t)),this.N=new si(e),this.Je=new Ir(this.N);}", "title": "" }, { "docid": "f671d421cc4a9464adfc5a51dc21a6fd", "score": "0.53651047", "text": "constructor(props) {\n super(props);\n this.state =\n {\n bleats: [],\n bleatDisplay: 5\n }\n }", "title": "" }, { "docid": "0114aed374f8e22cd6f0def044f2b7a8", "score": "0.5359188", "text": "constructor(ball, trackPosition) {\n this.timeRepresentation = 1; //one o'clock when all the clocks start.\n this.ball = ball;\n this.trackPostion = trackPosition;\n this.visited = false;\n this.done = false;\n this.minuteIndicatortrack = 5;\n this.fiveMinuteIndicatortrack = 11; // holds 11 balls \n this.hourIndicator = 11; // holds 11 balls plus 1 fixed ..\n //so that counting the balls in the hour indicator will yield \n //an hour in the range one to twelve.\n }", "title": "" }, { "docid": "c894850d65f422ebb18c5504584cfdd0", "score": "0.5358418", "text": "function BitBreaks(habitObject, streakDetails) {\n this.hash = habitObject.hash;\n this.title = utilityFunctions.stringToTitleCase(habitObject.title);\n this.description = decodeURI(habitObject.description);\n this.startDate = new Date(habitObject.startDate);\n this.totalDays = habitObject.totalDays;\n this.streakDetails = (streakDetails !== undefined || streakDetails !== null) ? streakDetails : null;\n\n this.foreverHabit = habitObject.foreverHabit;\n\n // This will be of type array. Each day will be stored as an index of the array\n this.dailyStatus = habitObject.dailyStatus;\n this.ended = habitObject.ended;\n\n // These will give incorrect values if forever habit is checked. Basically -ve values...\n this.daysLeft = utilityFunctions.daysLeft(this.startDate, habitObject.totalDays);\n this.daysLeft = this.daysLeft < 0 ? 0 : this.daysLeft;\n this.endDate = utilityFunctions.endingDate(this.startDate, habitObject.totalDays);\n}", "title": "" }, { "docid": "79e1a8dff876106c2cfa5ab94a1b8bd1", "score": "0.53549635", "text": "constructor( height, width ){\n this.height = height;\n this.width = width;\n this.__innerBoard = this.__makeBoard( )\n this.board = this.__makeHtmlBoard( )\n }", "title": "" }, { "docid": "7319e988399a051542b939deb4fe4d01", "score": "0.53541076", "text": "function HausBodenL(x,y,nr) {\n this.constructor(x,y);\n this.betretbar=true;\n this.key = nr;\n\n}", "title": "" }, { "docid": "bdc4880ca9a0e7b4b67d19371011bacb", "score": "0.5338441", "text": "constructor(height,weight){\n //assigning local variable to the arguments\n this.height = height;\n this.weight = weight;\n \n }", "title": "" }, { "docid": "9344dc38bb0efbdab3f0a1e61d1b5561", "score": "0.53367776", "text": "constructor(bc){\n\t\tthis.seed = 2352; //Seed used for RNG Generation (Some random number)\n\t\tthis.step = 0; //Used to count how many turns this bot has existed\n\t\tthis.map_height = bc.map.length; //Convenience for map height\n\t\tthis.map_width = bc.map[0].length; //Convenience for map width\n\t\tthis.map_horizontal_symmetry = this.isMapHorizontal(bc); //Precomp to determine map symmetry\n\t\tif (this.map_horizontal_symmetry){\n\t\t\tbc.log(\"Map is horizontally symmetric\");\n\t\t}\n\t\telse{\n\t\t\tbc.log(\"Map is vertically symmetric\");\n\t\t}\n\t\tthis.enemy_castles = this.getEnemyCastles(bc);\n\t\tthis.attack_mode = false; //Is in attack mode?\n\t\t//bc.log(\"Enemy castles predicted at: \" + this.enemy_castles);\n\t\tthis.actions = []; //No actions to take\n\t\t//this.bc = battleCode;\n\t}", "title": "" }, { "docid": "f22cb981733d75c2bc34bdb791b93657", "score": "0.53273803", "text": "Constructor(){}", "title": "" }, { "docid": "5cdb02f6c128cd10076713925e1952bd", "score": "0.53261554", "text": "constructor() {\n this.bombs = BOMB_COUNT;\n }", "title": "" }, { "docid": "961ba31927786a9fdd3f0ee60741234a", "score": "0.5325879", "text": "constructor(x,y,theColor){\n this.x = x;\n this.y = y;\n this.color = theColor;\n this.speed = 5;\n }", "title": "" }, { "docid": "0dfdf33a3ebaa9abe21ab3e66d9ccde2", "score": "0.5324255", "text": "function weitereBiene() {\r\n bees.push(new Classes.Bee(325, 120, \"hsl(\" + Math.random() * 360 + \", 80%, 50%)\", Math.random() * 10 + 5));\r\n n++;\r\n }", "title": "" }, { "docid": "18969670fd2d5fe34bc904a40aab52e6", "score": "0.53111607", "text": "constructor(grid, brickSize = 16){\n this.grid = grid;\n this.brickSize = brickSize;\n \n }", "title": "" }, { "docid": "9f7f2dcd0c49299aae3b0ba8ce86e32f", "score": "0.5305447", "text": "burstBubble(){\n\t this.bubble = new createjs.Sprite(window.burstSheet, \"animate\");\n\t }", "title": "" }, { "docid": "a496b455ba9df2f25e3abcc050f153e7", "score": "0.5297259", "text": "constructor(health=18, power=5) {\n this.health = health;\n this.power = power;\n }", "title": "" }, { "docid": "9ee3cf0570ab33845140f8c8e41a552f", "score": "0.52879405", "text": "function createBubbles() {\n for (var i = 0; i < bubbleCount; i++) {\n var div = document.createElement(\"div\");\n var divSize = getSize();\n div.style.left = getLeftPosition() + \"px\";\n div.style.width = divSize + \"px\";\n div.style.height = divSize + \"px\";\n div.style.animationDelay = i * randomFloat(0, 30) + \"s\";\n div.style.filter = \"blur(\" + randomFloat(2, 5) + \"px)\";\n div.classList.add(\"bubble\");\n bubbleBuffer.push(div);\n }\n console.log(\"Bubbles created\");\n}", "title": "" }, { "docid": "616a60a31f55664cf79e1117f8f99f93", "score": "0.5283422", "text": "constructor(x, quantity=5, spacing=256, \n thickness=96, gapSize=200, \n lowerY=height, upperY=200) {\n \n this.activePipes = [];\n \n /*\n There are a lot of duplicate variables here.\n Idea was to make each class self-sustaining.\n */\n\n this.x = x;\n this.quantity = quantity;\n this.spacing = spacing;\n this.thickness = thickness;\n this.gapSize = gapSize;\n this.lowerY = lowerY;\n this.upperY = upperY;\n \n }", "title": "" }, { "docid": "18c860c7516ac65075e600b224e44610", "score": "0.5281867", "text": "constructor(x, y, w, h, color) {\n \n \n }", "title": "" }, { "docid": "3ec38d0b44baf5c41c9b2cd30cdcca1e", "score": "0.5273861", "text": "function BallSupplyComponent() {\n //invoke constructor of superclass\n this.BaseComponentRenderer_constructor();\n }", "title": "" }, { "docid": "e92ae0c6bb3ac454b2c22d44c7d6d228", "score": "0.5268995", "text": "static set bounceThreshold(value) {}", "title": "" }, { "docid": "bd4c764787a115a4bd0fd17d1f6a61cb", "score": "0.52655333", "text": "constructor()\n\t{\n\t\tthis.board = new Board();\n\t}", "title": "" }, { "docid": "de01a98ef5df451421ec5abbd5396da4", "score": "0.526523", "text": "function Pb(){this.Cg=Ob||Mb||Lb;this.$f=!(this.Cg||Fb&&!Kb[10]&&!(Kb[10]=0<=ta(10)));!Fb||Kb[11]||(Kb[11]=0<=ta(11));this.Kg=Nb||Ob}", "title": "" }, { "docid": "30298580a91792088cc795adede044ba", "score": "0.5264615", "text": "constructor(...args) {\n super(...args);\n\n\n // The following values should get overridden when delta states are merged, but we set them here as a reference for you to see what variables this class has.\n\n // default values for private member values\n this.tile = null;\n this.timer = 0;\n\n //<<-- Creer-Merge: init -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.\n // any additional init logic you want can go here\n //<<-- /Creer-Merge: init -->>\n }", "title": "" }, { "docid": "cd837aa658e80e11568097c9373c62e5", "score": "0.5261785", "text": "constructor(top, bottom) {\n this.top = top;\n this.bottom = bottom;\n }", "title": "" }, { "docid": "cd837aa658e80e11568097c9373c62e5", "score": "0.5261785", "text": "constructor(top, bottom) {\n this.top = top;\n this.bottom = bottom;\n }", "title": "" }, { "docid": "8ad385f3966bc8a1cb6a708dddfa3da0", "score": "0.5251196", "text": "constructor(ctx, args) {\n super(ctx, args);\n this.flow = new TextFade(this.s, {\n str: \"0\", x: this.x - 10, y: this.y, mode: 4, start: args.start, color: [177, 255, 237],\n stroke: [0, 0, 0], strokeweight: 7, size: 27\n });\n this.cap = new TextFade(this.s, {\n x: this.x - 2, y: this.y, mode: 3, start: args.start, color: [255, 237, 177],\n str: \"| \" + args.cap, stroke: [0, 0, 0], strokeweight: 7, size: 27\n });\n }", "title": "" }, { "docid": "98d452ed8bdb8e7680a7e530d2e6268c", "score": "0.5247213", "text": "constructor(top, left, timeBetweenSteps) {\n this.$node = $('<span class=\"dancer\"></span>');\n this.timeBetweenSteps = timeBetweenSteps;\n this.originalTop = top;\n this.originalLeft = left;\n this.hovered = false;\n this.$node.on('mouseover', (event) => {\n this.hovered = true;\n this.$node.addClass('highlight');\n });\n this.$node.on('mouseleave', (event) => {\n this.hovered = false;\n this.$node.removeClass('highlight');\n });\n\n // now that we have defined the dancer object, we can start setting up important parts of it by calling the methods we wrote\n // this one sets the position to some random default point within the body\n this.step();\n this.setPosition(top, left);\n }", "title": "" }, { "docid": "9abf31dc83a69934b86746e51d390360", "score": "0.5235304", "text": "function Bone()\r\n{\r\n\tthis.name = \"\";\r\n\tthis.model = mat4.create();\r\n\tthis.parent = -1;\r\n\tthis.layer = 0;\r\n\tthis.num_children = 0;\r\n\tthis.index = -1; //index in the skeleton bones array\r\n\tthis.children = new Int8Array(16); //max 16 children\r\n}", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5234972", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5234972", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5234972", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5234972", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5234972", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5234972", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5234972", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5234972", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5234972", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5234972", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5234972", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5234972", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5234972", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5234972", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5234972", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5234972", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5234972", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5234972", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5234972", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5234972", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5234972", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5234972", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5234972", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5234972", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5234972", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5234972", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" } ]
1f0510c2222d4e7328f20428eb00c936
write your code above to get started
[ { "docid": "080548666c8fae4131fe70ad43d0c456", "score": "0.0", "text": "function random(number1,number2) {\n var randomNo = number1 + (Math.floor(Math.random() * (number2 - number1)) + 1);\n return randomNo;\n}", "title": "" } ]
[ { "docid": "94148ddab6844950bbc231991dc195c3", "score": "0.6323714", "text": "function main() {\n addHeadings();\n styleTutorialsAndArticles();\n separateAllTutorials();\n}", "title": "" }, { "docid": "9c4d22431cef064ba5ae97e03904aa99", "score": "0.6044606", "text": "function setup (){\n\t\t\t\tvar random_id = \"0000\" + Math.floor(Math.random() * 10000)\n\t\t\t\t\t;\n\n\t\t\t\tapp_name = app_name + ' ' + random_id.substring(random_id.length-4);\n\n\t\t\t\t// setup spacebrew\n\t\t\t\tsb = new Spacebrew.Client(); // create spacebrew client object\n\n\t\t\t\tsb.name(app_name);\n\t\t\t\tsb.description(\"This app sends text from an HTML form.\"); // set the app description\n\n\t\t // create the spacebrew subscription channels\n\t\t\t\tsb.addPublish(\"text\", \"string\", \"\");\t// create the publication feed\n\t\t\t\tsb.addSubscribe(\"text\", \"string\");\t\t// create the subscription feed\n\n\t\t\t\t// configure the publication and subscription feeds\n\t\t\t\tsb.onStringMessage = onStringMessage;\t\t\n\t\t\t\tsb.onOpen = onOpen;\n\n\t\t\t\t// connect to spacbrew\n\t\t\t\tsb.connect(); \n\n\t\t\t\t// listen to button clicks\n\t\t\t\t$(\"#button\").on(\"mousedown\", onMouseDown);\n\t\t\t}", "title": "" }, { "docid": "e1eb6f2e28897e12824329a92e1301db", "score": "0.6012334", "text": "function main() {\n\t\t\thtmlModule = new htmlUtil(); // View creation / HTML logic\n\t\t\tarrModule = new arrMethods(); // Array Method shortcuts\n\t\t\tmsg = htmlModule.msg; // Logging\n\t\t\tmsg.set(\"Starting Module\");\n\n\t\t\t// Setup Form.\n\t\t\tpowerForm();\n\n\t\t}", "title": "" }, { "docid": "d54fa46eed18288604e13689ca4c48dd", "score": "0.5975534", "text": "function main() {\r\n\t// Init the myGM functions.\r\n\tmyGM.init();\r\n\t\r\n\t// Init the language.\r\n\tLanguage.init();\r\n\t\r\n\t// Init the script.\r\n\tGeneral.init();\r\n\t\r\n\t// Call the function to check for updates.\r\n\tUpdater.init();\r\n\t\r\n\t// Call the function to enhance the view.\r\n\tEnhancedView.init();\r\n}", "title": "" }, { "docid": "f1247b3c4a437e7ab78cb849b0c64500", "score": "0.58486074", "text": "function Main() {\n console.log(`%c Main Function`, \"color: grey; font-size: 14px; font-weight: bold;\");\n //implement functions when you load the page\n buildInterface();\n interfaceLogic();\n }", "title": "" }, { "docid": "588364362a35d72300f2bed7662a05f9", "score": "0.5814842", "text": "function startup() {\n\t\t// TODO: Your main script logic goes here\n\t}", "title": "" }, { "docid": "a3ae2b94350f8d57ffef8182a4e9560b", "score": "0.58107936", "text": "function main() {\n const studentsPerPage = 10;\n const pageNumber = 1;\n const studentList = document.querySelectorAll('.student-list li');\n /*- initial page load, presenting the first 10 students from the students list\n - form JS components - pagination and student status range sections and their behaviors.*/\n formPaginationAndStatusBar(studentList, pageNumber, studentsPerPage);\n //adding more JS functionality, search option and behaviours related to searching\n createSearchSectionAndBehavior(studentList, pageNumber, studentsPerPage);\n}", "title": "" }, { "docid": "dbdfc1451132c7b0573f3e999db2fedf", "score": "0.58036846", "text": "static main(dataRefs) {\n window.onerror = error => RAG.panic(error);\n window.onunhandledrejection = error => RAG.panic(error);\n I18n.init();\n RAG.config = new Config(true);\n RAG.database = new Database(dataRefs);\n RAG.views = new Views();\n RAG.phraser = new Phraser();\n RAG.speech = new Speech();\n // Begin\n RAG.views.disclaimer.disclaim();\n RAG.views.marquee.set(L.WELCOME);\n RAG.generate();\n }", "title": "" }, { "docid": "9b08b23bc93d810e93c63f156b6ff687", "score": "0.57616127", "text": "function main() {\n\tdebug( 'Generating REPL examples.' );\n\tcreateExamples( docs() );\n} // end FUNCTION main()", "title": "" }, { "docid": "c9f3f501612c904444400b2d2dd15d5e", "score": "0.5744639", "text": "function main() {\n console.log('SuperApp (beta) ready');\n const person = getFromAPI(apiPerson);\n const kanye = getFromAPI(apiKanye);\n const trump = getFromAPI(apiTrump);\n\n const trumpInsults = trump.messages.personalized;\n const randomInsultIndex = Math.floor(Math.random() * trumpInsults.length);\n \n\n const fullName = person.name + ' ' + person.surname;\n\n let description = fullName;\n description += ' famously said \"' + kanye.quote + '\".';\n description += ' Trump responded \"' + fullName + ' ' + trumpInsults[randomInsultIndex] + '\".';\n\n console.log(description);\n\n const readabilityLevel = rs.textStandard(description);\n console.log('Readability Level:', readabilityLevel);\n}", "title": "" }, { "docid": "ff3e9c133ebc67932fb9c06952970239", "score": "0.574276", "text": "function main(){\n //your code here\n putBeeper();\n runKarel();\n \n \n }", "title": "" }, { "docid": "e2329a25e62e3100d9db7597f4de49a2", "score": "0.5734875", "text": "function setup() {}", "title": "" }, { "docid": "8e0d47c54af8e39572800bc9124ead10", "score": "0.5733809", "text": "initialize() { }", "title": "" }, { "docid": "fbbf740f79e55f49b73aa7944402af5e", "score": "0.57082397", "text": "function setup() {\n\n\t\t\t\t\t}", "title": "" }, { "docid": "fbbf740f79e55f49b73aa7944402af5e", "score": "0.57082397", "text": "function setup() {\n\n\t\t\t\t\t}", "title": "" }, { "docid": "7afeffccad1704f5166c03f9e1bd25a0", "score": "0.570442", "text": "function main() {\n \n footsteps = new Audio(\"./sounds/steps.mpeg\");\n bump = new Audio(\"./sounds/bounce.mp3\");\n setupWebGL(); // set up the webGL environment\n loadModels(); // load in the models from tri file\n OBJ.downloadMeshes({\n 'pokemon': INPUT_URL_GITHUB + 'models/bulbasaur-pokemon-go.obj',\n 'barrels': INPUT_URL_GITHUB + 'models/barrels.obj'\n }, setupMeshes);\n setupShaders(); // setup the webGL shaders\n renderModels(); // draw the triangles using webGL\n \n} // end main", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5689504", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "6f1b827011f5670fdd9962f0aff14e58", "score": "0.56779486", "text": "function inicializar() {\n }", "title": "" }, { "docid": "d5e428a764f2c78b0d7eb9905dbf5e32", "score": "0.5674591", "text": "function rankingPageStarter() {\n\t\tinitJSP();\n\t\trankTabs();\n\t\twheel();\n\t}", "title": "" }, { "docid": "d86cee4232c5ecbf178e5c37799e25dd", "score": "0.5671571", "text": "function main(){\n $(document).ready(function(){\n let config = JSON.parse(fs.readFileSync('./src/appconfig.json'));\n \n field = new Field(config.field.width, config.field.height, config.field.maxHumanVelocity, config.field.maxHumanAcceleration,\n config.field.maxPortionAge, config.field.maxHumanAge, config.field.updatePeriod\n );\n foodProducer = new FoodProducer(field, config.foodProducer.meanNumOfPortionsPerPeriod, config.foodProducer.updatePeriod);\n canvas = new Canvas(field, config.canvas.updatePeriod);\n\n // humanSpecificCanvas = new HumanSpecificCanvas(field, 40, controlledHuman);\n\n addHumansToPlayground(field);\n initControlMenu();\n\n field.start();\n canvas.start();\n foodProducer.start();\n // humanSpecificCanvas.start();\n });\n}", "title": "" }, { "docid": "f313907f7117421cd5816e95e2223f9e", "score": "0.56621027", "text": "function start() {\n \n // Copy out templates then remove from corpus\n\n templates = corpus.template;\n responses = corpus.response;\n headings = corpus.heading;\n\n delete corpus.template;\n delete corpus.response;\n delete corpus.heading;\n\n // Enable UI and generate first idea\n\n initUI();\n buildRexExp();\n generate();\n\t\t$('#templates').html(templates.length + ' template' + (templates.length == 1 ? '' : 's'))\n\t\t$('#outcomes').html(getTotalNumOptions().toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\"))\n\t}", "title": "" }, { "docid": "0ad131b150b840ea25d53db21e8063cf", "score": "0.5645021", "text": "function main() {\n\t\tvar csrftoken = $.utils.getCookie('csrftoken');\n\t\t$.ajaxSetup({\n\t\t\theaders: {\n\t\t\t\t\"X-CSRFToken\": csrftoken\n\t\t\t}\n\t\t});\n\t\t$.main.init();\n\t\t$('select').chosen();\n\t\tvar scribe = $.utils.getParameter('scribe');\n\t\tif (scribe[0] !== undefined && scribe[0] !== \"\") {\n\t\t\t$.main.load_idiographs(scribe[0]);\n\t\t\t$.main.scribe.val(scribe[0]);\n\t\t\t$.main.scribe.trigger('liszt:updated');\n\t\t}\n\t}", "title": "" }, { "docid": "c534dd73ead5b73fa7dffc9daf6d9bf2", "score": "0.5637142", "text": "function main() {\n update(); // Actualiza las variables del juego\n draw(); // Representa las nuevas variables\n}", "title": "" }, { "docid": "f97925d34e944763d94c11ac8b79c5e8", "score": "0.56370604", "text": "initialize()\n {\n }", "title": "" }, { "docid": "a485798ab48fb2dc058c82b6f7c830e9", "score": "0.5636641", "text": "function setupWebsite() {\n putBanner();\n init();\n putQuote();\n putUG();\n putG();\n putEmp();\n}", "title": "" }, { "docid": "f1ac53cfdf908ba2e0748ef2021de970", "score": "0.56266123", "text": "function start() {\n // Running this application will first display all of the items available for sale. \n // Include the ids, names, and prices of products for sale.\n connection.query(\"SELECT item_id,product_name,price FROM products\", function(err, res) {\n if (err) throw err;\n console.log(res);\n });\n}", "title": "" }, { "docid": "b7ef3f96bfc1a93ec8386c33eaed9533", "score": "0.56120616", "text": "function main()\n{\n\t//Manages the keyboard (also compatible with some TV remotes, gamepads and controllers which fire key codes):\n\tCB_Keyboard.onKeyDown(function(e, keyCode) { CB_Elements.insertContentById(\"last_key_down\", keyCode); }); //Event fired when a key is down (pressed).\n\tCB_Keyboard.onKeyUp(function(e, keyCode) { CB_Elements.insertContentById(\"last_key_up\", keyCode); }); //Event fired when a key is up (released).\n\tshowKeyboardInformation(); //Starts showing the information constantly.\n\t\n\t//Manages the gamepads and controllers which use HTML5 Gamepad API or proprietary API:\n\tCB_Controllers.onConnect(function(gamepad) { CB_Elements.insertContentById(\"last_gamepad_connected\", \"#\" + gamepad.index + \" (\" + gamepad.id + \")\"); updateGamepadsInformation(); }); //Event fired when a gamepad is connected.\n\tCB_Controllers.onDisconnect(function(gamepad) { CB_Elements.insertContentById(\"last_gamepad_disconnected\", \"#\" + gamepad.index + \" (\" + gamepad.id + \")\"); updateGamepadsInformation(); }); //Event fired when a gamepad is disconnected.\n\tshowGamepadsButtonsInformation(); //Starts showing the information constantly.\n}", "title": "" }, { "docid": "a1073e63ff7b0f18207238fb58ab4e3e", "score": "0.56110424", "text": "function Scrapper() {}", "title": "" }, { "docid": "a8a61dbcef380d61c47f545f53bbb2ff", "score": "0.56100637", "text": "function main() {\r\n inGenerating = true;\r\n \r\n try\r\n {\r\n // initialize variables\r\n initProperties();\r\n \r\n // create WhiteStarUML COM Object\r\n connectToWhiteStarUMLApplication();\r\n \r\n // generate document from template document\r\n generateDocument();\r\n } \r\n catch (e)\r\n {\r\n if(e==\"user termination\")\r\n log(\"Terminated by user request.\");\r\n else\r\n log(\"Error : \" + e.number + \",\" + e.description);\r\n throw e;\r\n }\r\n finally\r\n {\r\n // release WhiteStarUML COM Object\r\n disconnectFromWhiteStarUMLApplication();\r\n inGenerating = false;\r\n }\r\n}", "title": "" }, { "docid": "39d0898f6e919f177214b26da99902b8", "score": "0.56059974", "text": "function setup() {\n \n // create an HL app to start retrieving kinect datas\n // and automatically call the function update, onUserIn and onUserOut\n app = new HL.App();\n\n // set it up with our project's metadatas\n app.setup({\n projectName : 'loop',\n author1 : 'Benjamin',\n author2 : 'Alexia '\n });\n}", "title": "" }, { "docid": "3f9f688eae01dc26a5d2cc1c66d1f984", "score": "0.55936664", "text": "Inicializar() {\n\n }", "title": "" }, { "docid": "79fe1eaf5dca71828c041158946415c9", "score": "0.55759525", "text": "function main() {\n // New canvas created and selected in active OmniGraffle document\n var cnv = addCanvas();\n cnv.layoutInfo.automaticLayout = false;\n ['Right', 'Down'].forEach(function (x) {\n cnv['autosizes' + x] = true;\n });\n document.windows[0].selection.view.canvas = cnv;\n\n // New shape added to new canvas\n var shp = cnv.newShape();\n shp.cornerRadius = 9;\n shp.text = \"Hello to the OmniJS world from JXA!!!\";\n shp.textSize = 12;\n shp.geometry = new Rect(100.00, 100.00, 100.00, 100.00);\n }", "title": "" }, { "docid": "43b29b53e25ffdc2b33d5891d201b350", "score": "0.5575364", "text": "function start_script() {\n\n\t\t\t\t\t//create playground and every page create or remove on here\n\t\t\t\t\tplayground.create(define.playground_name, define.app_playground_obj);\n\n\t\t\t\t\t//route from url if http querys exists\n\t\t\t\t\tvar query_get = query.get(define.default_controller, define.default_action,1);\n\t\t\t\t\tquery_get._query = (query_get._query) ? query_get._query : define.default_query ;\n\t\t\t\t\t//alert(define.default_query['me'])\n\t\t\t\t\t// var _query = ( query_get._query[0] ) ? query_get._query:define.default_query\n\n\t\t\t\t\t//begin route path\n\t\t\t\t\tdojob.route.to(query_get._class, query_get._method, query_get._query, 'none', true);\n\t\t\t\t}", "title": "" }, { "docid": "b7320202831111c131d2a1fdd9e73ad7", "score": "0.5574561", "text": "function main() {\n \n // Set some convinience variables.\n Basejump.controlTabs = SC.page.get('workspace').get('mainContent').get('controlTabs')\n\n // Step 1: Load Your Model Data\n // The default code here will load the fixtures you have defined.\n // Comment out the preload line and add something to refresh from the server\n // when you are ready to pull data from your server.\n Basejump.server.preload(Basejump.FIXTURES) ;\n\n // TODO: refresh() any collections you have created to get their records.\n // ex: Basejump.contacts.refresh() ;\n\n // Step 2: Instantiate Your Views\n Basejump.controlTabs.set('nowShowing', 'welcome')\n SC.page.awake() ;\n\n // Step 3. Set the content property on your primary controller.\n // This will make your app come alive!\n\n/* Basejump.userCollection = Basejump.User.collection() ;\n Basejump.masterController.set('users', Basejump.userCollection)\n Basejump.server.listFor(Basejump.User, {view:\"_view/users/by_username\"}) ;\n*/ \n// Basejump.clientListController.set('content', Basejump.Client.collection({orderBy:\"lastName\"})) ;\n// Basejump.server.listFor(Basejump.Client) ;\n\n var c = Basejump.Client.collection();\n Basejump.clientListController.set('content', c);\n c.refresh();\n \n}", "title": "" }, { "docid": "affdae093a8da507199a1ed6e7858e81", "score": "0.5565445", "text": "start() {\n\n\t}", "title": "" }, { "docid": "b601acac33c0bfbfdd1aaba521765bd2", "score": "0.5563116", "text": "function init() {\n\n //\n\n }", "title": "" }, { "docid": "db645e74e1b13d752013f4209beae8b2", "score": "0.5563113", "text": "static main() {\r\n\t\tthis.init();\r\n\t}", "title": "" }, { "docid": "e37638a20242a1d31c721f2f8058d9a2", "score": "0.55579376", "text": "function page_setup(){\n // Access the data\n d3.json(\"samples.json\").then((data)=>{\n \n // Get a list of the samples\n var sample_list = data.names;\n\n //Select the option menu\n var options = d3.select(\"#selDataset\");\n\n //Append the names to the option menu\n sample_list.forEach((sample)=>{\n options.append(\"option\").text(sample).property(\"value\",sample);\n });\n });\n\n //Display an initial page\n bar_chart(\"940\");\n bubble_chart(\"940\");\n metadata(\"940\");\n}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5550928", "text": "initialize() {}", "title": "" }, { "docid": "684573f17bff06841d58b6815b003787", "score": "0.5549531", "text": "function init() {\r\n //\r\n }", "title": "" }, { "docid": "63709620e42ac1fe1a2674dc059df896", "score": "0.5543556", "text": "function initialize() { \n \n }", "title": "" }, { "docid": "72b8944884fba618ee9cec69e2b4322a", "score": "0.55100924", "text": "function main() {\n document.title = \"JS Jeopardy! v\" + VERSION;\n // show the game setup dialog\n tb_show('JS Jeopardy', '#TB_inline?height=500&width=800&inlineId=setupWindow&modal=true', null);\n}//main", "title": "" }, { "docid": "7505f25280ec6b1f147253ed9b566635", "score": "0.5509741", "text": "run() {\r\n\r\n }", "title": "" }, { "docid": "68eedb7f20e08d16efb1cea71cd362ba", "score": "0.550857", "text": "initializing() {\n \n }", "title": "" }, { "docid": "2ca444a44ce765447b51f97ef2a80d2e", "score": "0.55067194", "text": "startup()\n\t{\n\t\tthis.rows(7, 8, 1);\n\t\tthis.action(0);\n\t}", "title": "" }, { "docid": "66009e8db01f28a049c62db56ba65bda", "score": "0.55032486", "text": "function Main()\n {\n \n }", "title": "" }, { "docid": "66009e8db01f28a049c62db56ba65bda", "score": "0.55032486", "text": "function Main()\n {\n \n }", "title": "" }, { "docid": "4f5a60af9178eb4d346a814425ddd6ff", "score": "0.550032", "text": "function IntelligentDesign() {}", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.5495297", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.5495297", "text": "init() { }", "title": "" }, { "docid": "f9dac33ec5138e39e42568ab02d78927", "score": "0.54891497", "text": "function start() {\n process.stdout.write(help() + '\\n' + world.rooms[currentRoom].description + \n '\\n\\n' + \"What would you like to do?\" + '\\n> ');\n}", "title": "" }, { "docid": "7dfe9a76181045dd6c6ffe855127bdaf", "score": "0.54882073", "text": "function init() {\n questions()\n .then(readme => {\n writeToFile('./use/README.md', generatePage(readme))\n\n console.log('Readme is ready for review! Check out README.md to see the output!');\n })\n}", "title": "" }, { "docid": "b0fa2025fb343178c9ad50c2f58ab252", "score": "0.54836625", "text": "function start() {\n \n // Copy out templates then remove from corpus\n\n templates = corpus.template;\n responses = corpus.response;\n\n delete corpus.template;\n delete corpus.response;\n\n // Enable UI and generate first idea\n\n initUI();\n buildRexExp();\n generate();\n }", "title": "" }, { "docid": "ab9569c804a63082245f1ee81b2d6b81", "score": "0.54815805", "text": "startup() {}", "title": "" }, { "docid": "b9c4a95ceb1f9f08c4325a80892ddcf2", "score": "0.54741937", "text": "function Main() {\n console.log(`%c App Started...`, \"font-weight: bold; font-size: 20px;\");\n \n insertHTML(\"/Views/partials/header.html\", \"header\");\n\n setPageContent(\"/Views/content/home.html\");\n\n insertHTML(\"/Views/partials/footer.html\", \"footer\");\n \n }", "title": "" }, { "docid": "b0a9c018c7a05b4540cf6cf35b3df229", "score": "0.5474009", "text": "function start() {\n connection.query('SELECT * FROM products', function(err, results) {\n if (err) throw err;\n for (var i = 0; i < results.length; i++) {\n //%s stringifies the results to display them more orderly\n console.log(\"%s %s %s\", results[i].item_id, results[i].product_name, \"$\" + results[i].price);\n }\n //calls prompt function to obtain user the id of product and how many are wanted\n prompt();\n }\n\n );\n\n \n }", "title": "" }, { "docid": "c41d4addcf28884a6eaeb70fb6130cb2", "score": "0.54728705", "text": "function mainFunction() {\n //Remove previous results\n initialization();\n //input collection\n inputCollection();\n //input validation\n inputValidation();\n if (inputValid) {\n //input conversion\n inputConversion();\n //call event API\n skyAPI();\n }\n}", "title": "" }, { "docid": "c41d4addcf28884a6eaeb70fb6130cb2", "score": "0.54728705", "text": "function mainFunction() {\n //Remove previous results\n initialization();\n //input collection\n inputCollection();\n //input validation\n inputValidation();\n if (inputValid) {\n //input conversion\n inputConversion();\n //call event API\n skyAPI();\n }\n}", "title": "" }, { "docid": "0226033eb7b71aff25b27052b755ca3f", "score": "0.54722315", "text": "function main() {\n\tutility.fixModelNames();\n\tfetchUsers();\n\tfetchAttributesForModels();\n\tfetchActions();\n\tregisterEventListeners();\n}", "title": "" }, { "docid": "b7e4c570e5fa0379bf0093833181eb0a", "score": "0.54638076", "text": "function start() {\n // Remove start button\n $(\"#start-btn-section, time-remain-section, question-result-section, result-msg-section\").empty();\n\n // Initialize questions, correct answers, incorrect answers, unanswered\n currentObject = 0;\n currentAnswer = \"\";\n correctResponse = false;\n correctAnswers = 0;\n incorrectAnswers = 0;\n unanswered = 0;\n\n // Ask questions\n displayQuestion();\n }", "title": "" }, { "docid": "51aa746559501279a0056733c92a0b8e", "score": "0.5461226", "text": "function startup() {\n\n}", "title": "" }, { "docid": "e4f172576984c0705e20b3ab45250365", "score": "0.54599255", "text": "function init(){\n \n }", "title": "" }, { "docid": "6e1797fab10773cef32d936ce3e070ca", "score": "0.5459299", "text": "function startProgram() {\n\n console.log(\"########################################################\")\n console.log(\"-----------------WELCOME TO COLLATERALIZED-----------------\")\n console.log(\" YOUR GO-TO SERVICE FOR CRYPTO INTEREST RATE SWAPS\")\n console.log(\"########################################################\")\n console.log(\"----------------Check your MakerCDP Status-----------------\")\n console.log(\"\")\n\n rl.question(\"What is your CDP Number: \", function(answer) {\n if (answer == '5298') {\n showMakerInfo(answer)\n }\n else {\n rl.setPrompt(\"Again\")\n rl.promp()\n }\n })\n\n}", "title": "" } ]
ef7db7916372fa78a6ca6c5605c412ea
function to count the number of moves made
[ { "docid": "71d434d4faa95508c94ae7b35c4f088e", "score": "0.72112375", "text": "function countMoves(){\n let numMove = document.querySelector(\".num-moves\");\n if(moves<=1){\n numMove.innerHTML = `${moves} move`;\n } \n if(moves>1){\n numMove.innerHTML = `${moves} moves`;\n }\n}", "title": "" } ]
[ { "docid": "4ac4249dcec275336a9ae057f6a462f3", "score": "0.8031323", "text": "function countMoves() {\n\tmoves++;\n\tmoveContainer.textContent = moves;\n\tstarRating();\n}", "title": "" }, { "docid": "b6042b2142fc8aeb4d3ed934a1c6a1e6", "score": "0.778379", "text": "function movesCount() {\n\tmoveCounter += 1;\n\tmoves.innerHTML = moveCounter\n}", "title": "" }, { "docid": "591367e0aac0082c0dacb11d7e5c878b", "score": "0.7654067", "text": "function countMoves() {\n moves++;\n numMoves.innerHTML = moves;\n \n starRating();\n }", "title": "" }, { "docid": "cbc757dbb879a4a95c7e6ad3ea99944d", "score": "0.76272637", "text": "function moveCounter() {\n\n\tmoves = (moves + 1);\n\n\tshowMoves.innerText = moves;\n}", "title": "" }, { "docid": "00d89ccf71bb222e7da8c6f4058ebfb7", "score": "0.75562334", "text": "function countMoves() {\n countPlay = (countMatched+countUnmatched);\n moves.innerHTML = countPlay;\n setRating();\n\n //This function uses logic to decrement the number of start depending on the number of moves made\n function setRating() {\n if (countPlay === 16) {\n stars[2].classList.toggle('hide');\n endRating[2].classList.toggle('hide');\n }else if (countPlay === 30) {\n stars[1].classList.toggle('hide');\n endRating[1].classList.toggle('hide');\n }\n }\n }", "title": "" }, { "docid": "e1f0eab3e176802584829f12261d7de6", "score": "0.752635", "text": "function incrmNbrClicks () {\n moves ++;\n mdlMoves ++;\n nbrClicks.textContent= `Moves: ${moves}`;\n calcNbrStars ();\n}// end of incrmCountMoves function", "title": "" }, { "docid": "62853de65b882d94400ed4207eb8cf7d", "score": "0.7485713", "text": "function countMoves(){\n moves = moves + 1;\n document.getElementById('moves').innerHTML = moves;\n}", "title": "" }, { "docid": "23171a9b002c36939a89785c6f2adbed", "score": "0.7424551", "text": "function moveCounter(){\n numberOfMoves ++;\n $('.moves').text(numberOfMoves);\n}", "title": "" }, { "docid": "c431bdb1ffc99ed059759044f06576b3", "score": "0.72521", "text": "_incrementNumMoves() {\n this._numMoves++;\n }", "title": "" }, { "docid": "5f21fd6ab6ca4f9262cdea1185f7111a", "score": "0.7248633", "text": "function mCount() {\n console.log(\"I'm counting the moves:\", moveCount);\n moveCount++;\n // Change 'moves' from plural to singular when needed\n count.textContent = moveCount;\n if (moveCount == 1) {\n cText.textContent = 'Move';\n } else {\n cText.textContent = 'Moves';\n }\n}", "title": "" }, { "docid": "44e5f45a4fdf98449369f37b3f84214e", "score": "0.7233344", "text": "getNumberOfMoves() {\n return this._numMoves;\n }", "title": "" }, { "docid": "e9ca68b30540231b50abdcf7036525e8", "score": "0.7166222", "text": "function moveCounter() {\n moves++;\n const movesText = document.querySelector('.moves');\n movesText.innerHTML = moves;\n}", "title": "" }, { "docid": "be8240f9f9f8be8a1b42f883d9bfb2e2", "score": "0.7131632", "text": "function moveCounter() {\n\n let movesContainer = document.querySelector('.moves');\n movesContainer.textContent = movescount;\n rating();\n}", "title": "" }, { "docid": "52267fc1b88037d1947951a11f589971", "score": "0.7130089", "text": "function increaseCount() {\n count += 1;\n let moves = document.querySelector('.moves')\n moves.textContent = count;\n //See if the rank changes.\n checkRank();\n}", "title": "" }, { "docid": "9da94e2d928e4d379ecb5dcd8b663695", "score": "0.71161026", "text": "function setMoveCounter() {\n moves.textContent = movesCount;\n}", "title": "" }, { "docid": "316d96465ff1903f52ca20c134923882", "score": "0.7090181", "text": "function countMoves(list) {\n\n // Odd numbers are rounded down\n\n var count = Math.floor(list.length / 2);\n\n movesNumber.innerHTML = count; \n\n }", "title": "" }, { "docid": "aaadceaccc8006f62db5bf2c95db4bd1", "score": "0.7033778", "text": "function valid_moves(N, board, color) {\n var count = 0;\n for (var p = -1; p <= 1; p++) {\n for (var q = -1; q <= 1; q++) {\n if (board[i * N + j] == \".\" && valid_move(N, board, color, i, j)) {\n count += 1;\n }\n }\n }\n return count;\n}", "title": "" }, { "docid": "7759c8b6b9b0d624a4b2cc3d62878810", "score": "0.69729805", "text": "function movesCounter() {\r\n moves += 1;\r\n move.innerHTML = moves;\r\n hideStars();\r\n }", "title": "" }, { "docid": "1ddf7a544ad037f455fca963fcbecd7d", "score": "0.69686675", "text": "function countSteps(state, robot, memory) {\n for(let steps = 0; ; steps++) {\n if(state.parcels.length == 0) return steps;\n let action = robot(state, memory);\n state = state.move(action.direction);\n memory = action.memory;\n }\n}", "title": "" }, { "docid": "2a81d652551c8a5ce58ba7e77611643a", "score": "0.6956651", "text": "function updateMoves(){\r\n moves++;\r\n moveCounter.textContent = moves; \r\n}", "title": "" }, { "docid": "13c220810447414479f8c91c930c69f6", "score": "0.69366986", "text": "function moveCounter() {\n\tmoves++;\n\tmovesContainer.innerHTML = moves;\n\trating();\n\n}", "title": "" }, { "docid": "6def56d48b9665e237b3911f2e2d35c1", "score": "0.6929537", "text": "function addMove() {\n moves++;\n }", "title": "" }, { "docid": "9ce9893cd6564769e7a227b9cdd531d6", "score": "0.6925955", "text": "function incrementTotalAttempts() {\n if (clickCounter === 2) {\n numberOfTotalMoves++;\n document.getElementById(\"moves\").innerHTML = numberOfTotalMoves;\n }\n}", "title": "" }, { "docid": "fad448f2632c403d3a0593bb5757f5ff", "score": "0.68671054", "text": "function movesCounter() {\n moves ++;\n movesCount.innerHTML = moves;\n if (moves > 15) {\n stars[0].style.visibility = 'collapse';\n starRating = 2;\n }\n if (moves > 25) {\n stars[1].style.visibility = 'collapse';\n starRating = 1;\n }\n}", "title": "" }, { "docid": "498bee63acbc841d6635fa012af1e9ca", "score": "0.68641686", "text": "function countMoves () {\n moves++\n counter.innerHTML = moves\n\n // the stars decrease as the moves' number go up\n if (moves > 8 && moves < 18) {\n allStars[2].style.visibility = 'collapse'\n } else if (moves > 19) {\n allStars[1].style.visibility = 'collapse'\n allStars[2].style.visibility = 'collapse'\n }\n}", "title": "" }, { "docid": "dd75f058cf926ad89e1ed91c49911d2d", "score": "0.6860361", "text": "function incrementMoveCounter() {\n const currentValue = parseInt($(\".moves\").html());\n const nextValue = currentValue + 1;\n $(\".moves\").html(nextValue.toString());\n $(\".moves-summary\").html(nextValue.toString());\n}", "title": "" }, { "docid": "d5f218242ce7ab13b90329fe9fca7b18", "score": "0.6857174", "text": "function getMoves() {\n let moves = 0;\n return moves;\n}", "title": "" }, { "docid": "6163a868d028ecc7d3d13148d687185c", "score": "0.6826669", "text": "function incrementCounter() {\n if (!newOpenCard) {\n moveCounter++;\n $(\".moves\").text(moveCounter);\n updateStarRating();\n }\n }", "title": "" }, { "docid": "15e9ba5d9baaf89416cd0e8045c6f809", "score": "0.68232507", "text": "getMoveCount() {\n return this.moveCount;\n }", "title": "" }, { "docid": "fbe45410a245ddf5beb35db42d1e5380", "score": "0.68193865", "text": "function showMoves() {\n numOfMoves++;\n moveCounter.textContent = numOfMoves;\n rating();\n}", "title": "" }, { "docid": "c8dee4af1b2cd1da72b6303147087d10", "score": "0.68172425", "text": "function moveCount() {\n\n moves++;\n // movescounter.textContent = `${moves} Moves`;\n movescounter.innerHTML = moves;\n\n if (moves == 1) {\n\n\n\n\n}\n\nRating();\n\n\n}", "title": "" }, { "docid": "7f4098f7b17e9c4b521c92681cc0a98c", "score": "0.681085", "text": "function moveCounter(){\n moves++;\n moveCounter.innerHTML = moves;\n}", "title": "" }, { "docid": "16de7233be0ca896a5b12b722e58096e", "score": "0.68063116", "text": "function countMoves() {\n const moveModalCountText = document.querySelector('.modal-moves');\n moveModalCountText.innerHTML = `with only: ${moves} moves`;\n}", "title": "" }, { "docid": "5cf3dfa492df0ef246c82e38486592ab", "score": "0.67986923", "text": "function countMoves (){\n\t\n\tmovesCount++;\n\tmoves.textContent = (movesCount);\n\t//Removing the event for the function runTime.\n\tif (movesCount === 1){\n\t\tfor(let i = 0 ; i< cards.length;i++){\n\t\t\tcards[i].removeEventListener('click',runTime);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d999a1d06833d62d2e9bd423f69b63b0", "score": "0.6789713", "text": "function setMoves() {\n movesCounter.textContent = moves;\n}", "title": "" }, { "docid": "c4a84af392a087f27b1a26c364993c8f", "score": "0.6781116", "text": "function minimumMovement(obstacleLanes) {\n // Write your code here\n\n let count = 0;\n let hash = {\n 1: true,\n 2: true,\n 3: true,\n }\n\n obstacleLanes.forEach( obs => {\n if (!count && obs == 2) {\n pos -= obs;\n } else {\n\n }\n })\n\n return count;\n\n}", "title": "" }, { "docid": "0b7b9c79add22b5abfcd3aa7f0130b7d", "score": "0.67384505", "text": "function doCounter()\n{\n\tif(playerLocation === 0)\n\t\tcounterRoom0++;\n\n\telse if(playerLocation === 1)\n\t\tcounterRoom1++;\n\n\telse if(playerLocation === 2)\t\t\n\t\tcounterRoom2++;\n\t\n\telse if(playerLocation === 3)\n\t\tcounterRoom3++;\n\n\telse if(playerLocation === 4)\t\t\n\t\tcounterRoom4++;\n\t\n\telse if(playerLocation === 5)\t\t\n\t\tcounterRoom5++;\n\t\n\telse if(playerLocation === 6)\n\t\tcounterRoom6++;\n\t\t\n\telse if(playerLocation === 7)\n\t\tcounterRoom7++;\n\t\n\telse if(playerLocation === 8)\t\t\t\n\t\tcounterRoom8++;\n\n\telse if(playerLocation === 9)\t\t\t\n\t\tcounterRoom9++;\n\t\t\n\tcounterMoves++;\n\n}", "title": "" }, { "docid": "e24c6458e548681900fa4c05388ad081", "score": "0.67341936", "text": "function addToCount(){\n moves++;\n if(moves < 2){\n count.innerHTML = moves +\" Move\";\n\n }else{\n count.innerHTML = moves +\" Moves\";\n } \n if(moves > 12 && moves < 18){\n stars[2].style.visibility =\"collapse\"\n }else if( moves >= 19){\n stars[1].style.visibility =\"collapse\"\n }\n if(moves === 1){second = 0 ; minute = 0; hour = 0; time()}\n}", "title": "" }, { "docid": "19bee6c23fa220d478bb45075144fd48", "score": "0.6691531", "text": "function addMoves() {\n moves++;\n setMoves();\n}", "title": "" }, { "docid": "06dbd123a0e69c87bc3a01f73baf0469", "score": "0.66457933", "text": "function countMovementTypes() {\n //Dectect Browsers\n // Firefox 1.0+\n var isFirefox = typeof InstallTrigger !== 'undefined';\n //Browser Unterscheidung Firefox \n if (distanceSincePause < 120 && !isFirefox) {\n if (mouseMovementTime > 2000) {\n slowMovementCounter = slowMovementCounter + 1;\n }\n if ((distanceSincePause / minDistanceSincePause) - 1 < 0.29) {\n straightLinesCounter = straightLinesCounter + 1;\n } else {\n nonDirectMovementsCounter = nonDirectMovementsCounter + 1;\n }\n if ((distanceSincePause / minDistanceSincePause) > 1.85) {\n uTurnCounter += 1;\n }\n } else {\n if (mouseMovementTime > 2000) {\n slowMovementCounter = slowMovementCounter + 1;\n }\n if ((distanceSincePause / minDistanceSincePause) - 1 < 0.05) {\n straightLinesCounter = straightLinesCounter + 1;\n if (distanceSincePause > 120) {\n longStraightLinesCounter = longStraightLinesCounter + 1;\n }\n } else {\n nonDirectMovementsCounter = nonDirectMovementsCounter + 1;\n }\n if ((distanceSincePause / minDistanceSincePause) > 1.4) {\n uTurnCounter += 1;\n }\n }\n }", "title": "" }, { "docid": "17d17d93f940774a49345a6ec6034e9f", "score": "0.6609288", "text": "function moveCounter(evt) {\n initialScore += 1;\n nbMoves.innerHTML = initialScore.toString();\n\n settingStars();\n}", "title": "" }, { "docid": "551f8b597e547ded610d35f3d6e21db9", "score": "0.6594592", "text": "function incrementCounter() {\n counter++;\n document.querySelector('.moves').innerText = counter;\n}", "title": "" }, { "docid": "bd829eae2439feaff6560759b05961ee", "score": "0.6589413", "text": "function updateMoveCounter() {\n\t$('.moves').text(moveCounter);\n\n\tif (moveCounter === hard || moveCounter == medium) {\n\t\tremoveStar();\n\t}\n}", "title": "" }, { "docid": "5ca923c3a26a7fb857556b35dbd21d79", "score": "0.658781", "text": "function moveCounter(){\n moves++;\n document.getElementById(\"steps\").innerHTML = moves ;\n rating ();\n}", "title": "" }, { "docid": "8b2b34d7cc8ae074177bd7eef0029dff", "score": "0.6582485", "text": "function increaseMoves() {\n\tcounter +=1;\n\t$('.moves').text(counter);\n\t// decrease the score depending on the amount of moves that were already made\n\tif(counter===30) {\n\t\t$('#third-star').css('color', '#fefefe');\n\t\tscore = 2;\n\t}else if(counter===40) {\n\t\t$('#second-star').css('color', '#fefefe');\n\t\tscore = 1;\n\t}\n\telse if(counter===50) {\n\t\tlosingModal();\n\t}\n}", "title": "" }, { "docid": "470d6cf92c81b25e5a90af6970959207", "score": "0.6561596", "text": "function movesCounter() {\n moves++;\n counter.innerHTML = moves;\n //star rating based on the number of moves taken by the player\n if (moves > 12 && moves < 23) {\n for (i = 0; i < 3; i++) {\n if (i > 1) {\n stars[i].style.visibility = \"collapse\";\n }\n }\n } else if (moves >= 23) {\n for (var i = 0; i < 3; i++) {\n if (i > 0) {\n stars[i].style.visibility = \"collapse\";\n }\n }\n }\n //start timer on first moves\n if (moves == 1) {\n startTimer();\n }\n}", "title": "" }, { "docid": "f38d59d99399b83221dc9cabec12d4e4", "score": "0.655651", "text": "function updateMovesCount() {\n $(\".moves\").text(movesCount);\n\n if (movesCount === hard || movesCount === medium) {\n decreaseStar();\n }\n}", "title": "" }, { "docid": "985df6ffb5a1a7128f34abbc3ba7b6e9", "score": "0.6531649", "text": "function updateMoveCount(){\n document.querySelector(\".moves\").innerHTML=moveCount;\n if(moveCount===15||moveCount===20){\n console.log(\"Star reduced\");\n removeStar();\n stars--;\n }\n}", "title": "" }, { "docid": "43aa3db740f5ab3e75c471830ebe2bae", "score": "0.6531142", "text": "function counter() {\n\n\tcont += 1\n\tif (cont == 1) {\n\t\ttimer()\n\t}\n\tmoves.textContent = cont\n\n}", "title": "" }, { "docid": "f1aecddd5652ee77b63751edf1e70a81", "score": "0.6522059", "text": "get currentCount() {\n const s = this.s;\n const w = this.w;\n return this.stories.reduce(function(count, story, idx) {\n if (s == idx) {\n return count + w;\n }\n else if (s > idx) {\n return count + story.Waypoints.length;\n }\n else {\n return count;\n }\n }, 1);\n }", "title": "" }, { "docid": "f1aecddd5652ee77b63751edf1e70a81", "score": "0.6522059", "text": "get currentCount() {\n const s = this.s;\n const w = this.w;\n return this.stories.reduce(function(count, story, idx) {\n if (s == idx) {\n return count + w;\n }\n else if (s > idx) {\n return count + story.Waypoints.length;\n }\n else {\n return count;\n }\n }, 1);\n }", "title": "" }, { "docid": "28a88489b3fc03d0cb7c83afa8fb1a6f", "score": "0.6507788", "text": "function resetCounter() {\n moveCounter = 0;\n $(\".moves\").text(moveCounter);\n }", "title": "" }, { "docid": "d3052e666faf5cc51ed3618314df662b", "score": "0.6501209", "text": "function increaseMove() {\n\tmoves += 1;\n\t// declare a global variable to pass to the draw stars function that is set at 3 in startgame\n\tif (moves === 26) {\n\t\tstarPoints = 2;\n\t\tdrawStars(starPoints);\n\n\t} else if (moves === 41) {\n\t\tstarPoints = 1;\n\t\tdrawStars(starPoints);\n\t}\n\tmoveCounter.innerHTML = moves;\n\ttimerCounter.innerHTML = gameTime;\n}", "title": "" }, { "docid": "0c8e20e55235680fc115aff9f3f16372", "score": "0.64977443", "text": "function moveCounter (){\n moves.innerHTML = countMoves;\n countMoves++;\n\n //Setting star raiting\n\n if(countMoves < 15 ) {\n endStars.innerHTML = 'End Stars: ' + 3;\n }\n else if (countMoves >= 15 && countMoves < 21) {\n stars.children[2].innerHTML = \"\";\n endStars.innerHTML = 'End Stars: ' + 2;\n }\n else if (countMoves >= 21) {\n stars.children[1].innerHTML = \"\";\n endStars.innerHTML = 'End Stars: ' + 1;\n }\n}", "title": "" }, { "docid": "24b5516b3488966cb0b3a2424a0925dd", "score": "0.6490187", "text": "function increaseMoveCounterFunc() {\n moves++;\n document.querySelector(\"span\").textContent = moves;\n}", "title": "" }, { "docid": "c8e625c3cb95dd3465e896333a64b78d", "score": "0.646845", "text": "function increaseMoveCounter(){\n const currentMoves = +moves.textContent;\n moves.textContent = currentMoves + 1;\n toggleStars(currentMoves);\n\n}", "title": "" }, { "docid": "62d3824219ebef8ae0991ad8dfdfabec", "score": "0.64516985", "text": "function moveUpdater() {\r\n moveCounter++;\r\n document.getElementById('moves').innerText = moveCounter;\r\n\r\n}", "title": "" }, { "docid": "d6fe3e6ee7e77eef55e558b6cc096f04", "score": "0.6419529", "text": "function moveCounter() {\n\n \tstarCounter = 3;\n\tmove ++;\n\tif (move > 8 && move < 12) {\n\n\t\tstars[2].firstChild.classList.remove(\"fa-star\");\n\t\tstars[2].firstChild.classList.add(\"fa-star-o\");\n\t\tstarCounter = 2;\n\n\t} else if (move >= 12 && move <= 20) {\n\t\tstars[1].firstChild.classList.remove(\"fa-star\");\n\t\tstars[1].firstChild.classList.add(\"fa-star-o\");\n\t\tstarCounter = 1;\n\n\t} else if (move > 21 ) {\n\t\tstars[0].firstChild.classList.remove(\"fa-star\");\n\t\tstars[0].firstChild.classList.add(\"fa-star-o\");\n\t\tstarCounter = 0;\n\t}\n\n\tmoves.innerHTML = move;\n\n}", "title": "" }, { "docid": "240c281c3f43586e3baf922c8b5bfaa6", "score": "0.6405613", "text": "function countBattleships(board){\n let count = 0;\n\n for(let i=0; i<board.length; i++){\n for(let j=0; j<board[0].length; j++){\n if(board[i][j] === '.') continue;\n \n if(i > 0 && board[i-1][j] === 'X') continue;\n if(j > 0 && board[i][j-1] === 'X') continue;\n\n count ++;\n }\n }\n\n return count;\n}", "title": "" }, { "docid": "4e1fe707e7c197b49ed8953d92c252d8", "score": "0.64035845", "text": "function mousePressed(){\n // if (humanPlaying) {\n // humanStep(0);\n //\n // }\n let count = 0;\n for (let y = 0; y < 3; y ++){ //row\n for (let x = 0; x < 3; x++){ //col\n if (mouseX > x*squareSize && mouseX < (x+1)*squareSize\n && mouseY > y * squareSize && mouseY < (y+1)*squareSize){\n console.log(count);\n humanMove(count);\n }\n count++;\n }\n }\n}", "title": "" }, { "docid": "f7ceefbfa8a76cfe45cdc97cbde6b53b", "score": "0.6397356", "text": "function countWaysToReachNthStair(n) {\n\n}", "title": "" }, { "docid": "fb7dfaf84c568b9b1d4e26a749a10cb2", "score": "0.63927084", "text": "function allChecks() {\n moves++;\n checkWin();\n togglePlayer();\n}", "title": "" }, { "docid": "5c04bf923c7263924128ea41a9b308cb", "score": "0.6367917", "text": "function countTotalNonMines () {\n var count = 0;\n for (var i = 0; i < board.cells.length; i++){\n if (board.cells[i].isMine === false){\n count++\n }\n }\n return count\n}", "title": "" }, { "docid": "3fc1169092234e6613a2611215cdcb7b", "score": "0.6348656", "text": "function moveCounter(){\n var move = parseInt(moves.innerHTML)+1;\n moves.innerHTML = move;\n // start timer on first move\n if(move == 1){\n second = 0;\n minute = 0;\n startTimer();\n }\n}", "title": "" }, { "docid": "83ce018a0e6da5792411d23d42ba9dab", "score": "0.6346007", "text": "function calculateMoveDistance() {\n const reducer = (accumulator, currentValue) => accumulator + currentValue;\n let moveDistance = 0;\n\n if (diceRoll.length !== 0) {\n moveDistance = diceRoll.reduce(reducer);\n if (moveDistance === 0) {\n moveDistance = 6;\n }\n }\n else {\n return null;\n }\n return moveDistance;\n }", "title": "" }, { "docid": "ad26e4fb109ca2436bd5632db62ca62e", "score": "0.6343292", "text": "function pieceCount()\n{\n\tvar bCount = 0;\n\tvar wCount = 0;\n\tfor(var i = 0; i < 64; i++)\n\t{\n\t\tif(pieces[i] == \"B\")\n\t\t\tbCount++;\n\t\tif(pieces[i] == \"W\")\n\t\t\twCount++;\n\t}\n\t\n\t$('#bcount').html(player1 + \": \" + bCount);\n\t$('#wcount').html(player2 + \": \" + wCount);\n\t\n\tif(bCount > wCount)\n\t\treturn player1;\n\treturn player2;\n}", "title": "" }, { "docid": "5777455fbae26c99f003f0fce2c7d518", "score": "0.63379973", "text": "function countCells() {\n cellsCount = boardSize[0] * boardSize[1];\n unrevealed = cellsCount - minesAmount;\n}", "title": "" }, { "docid": "f2f10f58cb7a9ccad42ae3854f6fd486", "score": "0.6336299", "text": "function countMoves() {\n clicks++;\n document.getElementById(\"clicks\").firstChild.innerHTML = clicks;\n}", "title": "" }, { "docid": "bc6389b4f51493b0367caa2c705f6419", "score": "0.6329194", "text": "function updateMoves() {\n ++moves;\n $moves.innerText = moves;\n checkStars();\n }", "title": "" }, { "docid": "d4db0d9473fc48be6ba279690f63726b", "score": "0.63212055", "text": "function counterCorner(nextMove) {\n var moveMade = 0;\n if (nextMove.length > 0){\n var spaceIndex = nextMove[0];\n markSpace(spaceIndex);\n setNextTurn();\n }\n else{\n if (!spaces[4]){\n markSpace(4);\n }\n else{\n index = Math.floor((Math.random()*10)%4);\n arr = [1, 3, 5, 7];\n mark = arr[index];\n if(!spaces[mark]){\n markSpace(mark);\n }\n else{\n for (var i = 0; i < 9; i++){\n if(!spaces[arr[i]]){\n markSpace(arr[i]);\n break;\n }\n }\n }\n }\n setNextTurn();\n }\n}", "title": "" }, { "docid": "1fe031a95ef96fcdcd1b9c48efbb4310", "score": "0.63191956", "text": "function moveCounter() {\n moves += 1;\n \t\t\t displayMove.innerText = moves;\n if(moves == 1){\n sec = 0;\n min = 0; \n /*startTimer*/\n startTimer();\n }\n finalScore(moves);\n }", "title": "" }, { "docid": "0fd862026b306ff7ea948c9b2567e4ad", "score": "0.63188314", "text": "function display_counter(){\n let gameCounter = document.querySelector(\".moves\");\n gameCounter.innerHTML=movesCount;\n}", "title": "" }, { "docid": "35162484572114a5562504ca6745e769", "score": "0.63181245", "text": "function displayMoves(){\n\tmoves+=1; \n\tmoveCounter.innerHTML =moves;\n\tif(moves >= 16){\n\t\tfallingStars();\n\t}\n}", "title": "" }, { "docid": "f1cde345c9ee25a8c1b75f4297499578", "score": "0.63181037", "text": "function getPieceDiagonalForwardCount(piece, n){\n var counter = 0;\n for(var k = 0; k < n; k++){\n if(gameBoard[k][k] == piece)\n {\n counter++;\n }\n }\n return counter;\n}", "title": "" }, { "docid": "9f8462721dc69935b448ae9c711c069c", "score": "0.6306624", "text": "function noMoves() {\n return 0;\n}", "title": "" }, { "docid": "89cc0d6de84b5a73c0998b07da176deb", "score": "0.63051814", "text": "function checkMovesNumber() {\n\tif (counterMoves > 15) {\n\t\tstarsArray[2].className += \" star-lost\";\n\t\tif (counterMoves > 20) {\n\t\t\tstarsArray[1].className += \" star-lost\";\n\t\t};\n\t};\n}", "title": "" }, { "docid": "613f71e09015ff5ba42de938bd812cf7", "score": "0.6304913", "text": "function moveCounter() {\n moves++;\n counter.html(moves);\n moves > 10 ? (stars.first().hide(), remainingStars = 4) : '';\n moves > 15 ? ($('.stars li:nth-child(2)').hide(), remainingStars = 3) : '';\n moves > 20 ? ($('.stars li:nth-child(3)').hide(), remainingStars = 2) : '';\n moves > 25 ? ($('.stars li:nth-child(4)').hide(), remainingStars = 1) : '';\n}", "title": "" }, { "docid": "930662c8f784b268c00df1d0b480aeed", "score": "0.6302332", "text": "function addMove() {\n numofMoves++;\n moveDiv.innerHTML = numofMoves + \" Moves\";\n}", "title": "" }, { "docid": "a82f96adc9bb251134a678cbd0f00c6e", "score": "0.6294761", "text": "function incrementMoves() {\n moves++;\n document.getElementById(\"moves\").innerHTML = moves;\n}", "title": "" }, { "docid": "c2a21d4f48691cf505896d054f07b63e", "score": "0.62904805", "text": "mineCounter(x, y, boardData)\n {\n let mineCount = 0;\n //top\n if (x > 0 && boardData[x-1][y].isMine == true)\n {\n mineCount++;\n }\n //bottom\n if (x < 7 && boardData[x+1][y].isMine == true)\n {\n mineCount++;\n }\n //left\n if (y > 0 && boardData[x][y-1].isMine == true)\n {\n mineCount++;\n }\n //right\n if (y < 7 && boardData[x][y+1].isMine == true)\n {\n mineCount++;\n }\n //top-left\n if (x > 0 && y > 0 && boardData[x-1][y-1].isMine == true)\n {\n mineCount++;\n }\n //top-right\n if (x > 0 && y < 7 && boardData[x-1][y+1].isMine == true)\n {\n mineCount++;\n }\n //bottom-left\n if (x < 7 && y > 0 && boardData[x+1][y-1].isMine == true)\n {\n mineCount++;\n }\n //bottom-right\n if (x < 7 && y < 7 && boardData[x+1][y+1].isMine == true)\n {\n mineCount++;\n }\n\n return mineCount;\n }", "title": "" }, { "docid": "184d4384f5a279087d45f97c99af8747", "score": "0.62869304", "text": "function checkForPlayerWinPoss() {\n let winCheck = 0;\n for ( i = 0; winCheck !== 2; i++) {\n winCheck = winConditions[i].reduce((a, b) => a + b, 0);\n winNum = winConditions[i];\n winCondit = i;\n }\n console.log(winCondit);\n findOpenPosition(winCondit);\n}", "title": "" }, { "docid": "522ecb3ac00351118c4082e3dbf0fe3f", "score": "0.62667394", "text": "function moves() {\n if (moveCounter < 8) {\n checkWin();\n } else if ((moveCounter === 8)) {\n statusArea.textContent = \"It's a Draw\";\n boardReset();\n }\n moveCounter++;\n}", "title": "" }, { "docid": "d1f35f41bb492717dd924438112305e5", "score": "0.6266573", "text": "function moveCount() {\n moves+=1;\n count.innerHTML = moves;\n if (moves >=10 && moves <20) {\n \tfor( i= 0; i < 3; i++){\n if(i > 1){\n stars[i].style.visibility = \"collapse\";\n }\n }\n } else if (moves >= 20) {\n \tfor( i= 0; i < 3; i++){\n if(i > 0){\n stars[i].style.visibility = \"collapse\";\n }\n }\n }\n if (moves == 1) {\n \ttimerStart();\n }\n}", "title": "" }, { "docid": "b0c1add6d9019bb9894e7530e08fafdc", "score": "0.62437415", "text": "function evalCount(node, player) {\n\t// console.log(\"evalCount\", node)\n\tvar piece = getPlayerPiece(player);\n\tvar oppPiece = getOpponentPiece(player);\n\tvar score = 0;\n\tvar oppScore = 0;\n\n\t// how many moves the player would have next\n\tvar mobility = successor(node, player).length;\n\n\t// position values\n\tfor (let i=0; i<8; i++) {\n\t\tfor (let j=0; j<8; j++) {\n\t\t\tif (node.state[i][j] == piece) {\n\t\t\t\tscore += position_vals[i][j];\n\t\t\t} else if (node.state[i][j] == oppPiece) {\n\t\t\t\toppScore += position_vals[i][j];\n\t\t\t}\n\t\t}\n\t}\n\treturn 1*(score - oppScore) + 1.25*mobility;\n}", "title": "" }, { "docid": "bf32400aea8429bb645e3b7d173eca38", "score": "0.6237385", "text": "function cardMoveCounter() {\n moves++;\n counter.innerHTML = moves;\n\n // Live rating system based on card moves\n if (moves > 8 && moves < 12) {\n for (i = 0; i < 3; i++) {\n if (i > 1) {\n stars[i].style.visibility = \"collapse\";\n }\n }\n } else if (moves > 13) {\n for (i = 0; i < 3; i++) {\n if (i > 0) {\n stars[i].style.visibility = \"collapse\";\n }\n }\n }\n}", "title": "" }, { "docid": "84b24eb7c90d45962cb731548807ca09", "score": "0.62343496", "text": "function isWinningMove(){\n // horizontal win\n for(var i = 0; i < 3; i++){\n if(board[i][0] !== ' ' && board[i][0] === board[i][1] && board[i][0] === board[i][2]){\n return board[i][0];\n }\n }\n\n // vertical win\n for(var j = 0; j < 3; j++){\n if (board[0][j] != ' ' && board[0][j] === board[1][j] && board[0][j] === board[2][j]) {\n return board[0][j];\n }\n }\n\n // diagonal - left to right\n if (board[0][0] !== ' ' && board[0][0] === board[1][1] && board[0][0] === board[2][2]) {\n return board[0][0];\n }\n\n // diagonal - right to left\n if (board[2][0] !== ' ' && board[2][0] === board[1][1] && board[2][0] === board[0][2]) {\n return board[2][0];\n }\n var counter = 0;\n for(var i = 0; i < 3; i++){\n for(var j = 0; j < 3; j++){\n if(board[i][j] != ' '){\n counter++\n }\n }\n } if(counter === 9){\n alert('Draw');\n resetGame();\n }\n \n }", "title": "" }, { "docid": "5932dcddad9820d7246396fe74c5676f", "score": "0.62329644", "text": "function countPawns(x, y) {\n let count = 0\n // directions(?)\n const dirs = [-1, 0, 1, 0, -1]\n \n for (let i = 0; i < dirs.length - 1; i++) {\n const dirX = dirs[i]\n const dirY = dirs[i + 1]\n count += findPawn(x + dirX, y + dirY, dirX, dirY)\n }\n return count\n }", "title": "" }, { "docid": "1e5fd444b63054c1a01c5eedd25cc781", "score": "0.62324387", "text": "function total_visitados(){\nvar count = 0;\n \n for (let index = 0; index < states_list.length; index++) {\n\n if(states_list[index]) count++;\n }\n if(count==8 ){stop = true;}\n return count;\n}", "title": "" }, { "docid": "5883ece4afc1957d0b65baf135c5a802", "score": "0.62299556", "text": "function addMoves() {\n\n moves++;\n movesNumber.innerHTML = moves;\n\n}", "title": "" }, { "docid": "495cb9e2bb81b7be6335121d6e7b055d", "score": "0.6228414", "text": "function displayMoves() {\n let movesMade = clickCounter / 2;\n $totalMoves.textContent = String(movesMade).padStart(2, '0');\n}", "title": "" }, { "docid": "4ea8727f616174ce60995e5de3136718", "score": "0.62225354", "text": "function counterAttackMethod(){\n var blockMove = countMarks(human);\n var winMove = countMarks(machine);\n if (counterAttack == \"center\"){\n if (winMove.length > 0){\n counterCenter(winMove);\n }\n else if (blockMove.length > 0){\n counterCenter(blockMove);\n }\n else {\n counterCenter([]);\n }\n }\n else if(counterAttack == \"corner\"){\n if (winMove.length > 0){\n counterCorner(winMove);\n }\n else if (blockMove.length > 0){\n counterCorner(blockMove);\n }\n else {\n counterCorner([]);\n }\n }\n else {\n if (winMove.length > 0){\n counterEdge(winMove);\n }\n else if (blockMove.length > 0){\n counterEdge(blockMove);\n }\n else{\n counterEdge([]);\n }\n }\n}", "title": "" }, { "docid": "31f4faff577bf9c92e82a5cb0ef18272", "score": "0.62065554", "text": "function moveCounter() {\n moves++;\n counter.innerHTML = moves;\n //start timer on click\n if (moves == 1) {\n second = 0;\n minute = 0;\n hour = 0;\n startTimer();\n };\n // setting rates based on moves\n if (moves > 8 && moves < 14) {\n for (i = 0; i < 3; i++) {\n if (i > 1) {\n stars[i].style.visibility = \"collapse\";\n }\n }\n } else if (moves > 15) {\n for (i = 0; i < 3; i++) {\n if (i > 0) {\n stars[i].style.visibility = \"collapse\";\n }\n }\n }\n}", "title": "" }, { "docid": "46e71f50e0630acc20c50d285909062a", "score": "0.6197427", "text": "mineCount(neighArr) {\n let count = 0;\n for (let cell in neighArr) {\n if (neighArr[cell]) {\n if (DATA.boardArr[neighArr[cell]]) count++;\n }\n }\n return count;\n }", "title": "" }, { "docid": "75d6030aa09e89f8999e7226def2b7f1", "score": "0.6195072", "text": "function moveCounter() {\n movesCounter++;\n moves.innerHTML = movesCounter;\n\n if (movesCounter > 24) {\n for (const [index, star] of stars.entries()) {\n if (index > 1) {\n star.style.color = \"transparent\";\n }\n }\n }\n\n if (movesCounter > 30) {\n for (const [index, star] of stars.entries()) {\n if (index > 0) {\n star.style.color = \"transparent\";\n }\n }\n }\n}", "title": "" }, { "docid": "a1f50df23a2750344ee3bb26046d28a5", "score": "0.61937267", "text": "function addCount(card) {\n if (!card.classList.contains('match')) {\n count++;\n moveCounter.textContent = count;\n }\n if (count <= 20 && count !== 0) {\n changeStars();\n }\n let numberOfStars = starsRating();\n return numberOfStars;\n }", "title": "" }, { "docid": "70634c012d9f2757268fe5e389ce97e1", "score": "0.6179158", "text": "function resetMoveCounter() {\n $(\".moves\").html(\"0\");\n $(\".moves-summary\").html(\"0\");\n}", "title": "" }, { "docid": "1e78f362bc5175d9c8224d9742c87558", "score": "0.6174203", "text": "function updateMoveCounter() {\n $(\".moves\").text(moveCounter);\n if (moveCounter === hard || moveCounter === medium) {\n removeStar();\n }\n}", "title": "" }, { "docid": "d1f862273c47ca1b75fb66c876fec273", "score": "0.6160284", "text": "function updateCount() {\n count++;\n moveCount.innerHTML = count;\n}", "title": "" }, { "docid": "df302a2c7d7a3bb9ffe8a29bf5a7dee3", "score": "0.615874", "text": "function countUp() {\r\n rounds = rounds + 1;\r\n roundCheck();\r\n molesLeft();\r\n}", "title": "" }, { "docid": "f0af6f5c1867f628360741093a881568", "score": "0.61547756", "text": "function countRow(x, y, tick = player){\n var output = [0,0];\n for(var i = 0; i < 3; i++){\n var square = board[y][i];\n if(square != \" \"){\n if(square === tick){\n output[0] += 1;\n } else{\n output[1] += 1;\n }\n }\n }\n return output;\n}", "title": "" } ]
ac77ddbac85f3839df3831c624d03f12
funcion se agrega a lista de compras y se suma el total;
[ { "docid": "fd6f8e4648b2c924152108c4f7b212f2", "score": "0.65992635", "text": "function listaDeCompras(params) {\n arrayListadeCompras.push(params);\n listContainer.innerHTML = `<table class=\"table table-light\">\n <thead>\n <tr class=\"tr-1\">\n <th scope=\"col\">Img</th>\n <th scope=\"col\">Nombre</th>\n <th scope=\"col\">Precio</th>\n <th scope=\"col\"></th>\n </tr>\n </thead>\n <tbody>${arrayListadeCompras\n .map(\n (\n item\n ) => `<tr><th scope=\"row\" ><div class=\"img-tabla-1\"> <img src=\"https://pokeres.bastionbot.org/images/pokemon/${\n item.id\n }.png\" alt=\"\"></div></th>\n <td>${item.nombre.toUpperCase()}</td>\n <td>$${item.precio}</td>\n <td key=\"${\n item.id\n }\"><span class=\"icon-cancel-circle\" id='deleteProductLista'></span></td>\n </tr>`\n )\n .join(\" \")} \n </tbody>\n</table>`;\n totalContainer.innerHTML = `<table class=\"table table-light\">\n<thead>\n <tr class=\"tr-1\">\n <th scope=\"col\"></th>\n <th scope=\"col\">Total</th>\n <th scope=\"col\">$${arrayListadeCompras[0].precio}</th>\n <th scope=\"col\"></th>\n </tr>\n</thead>\n\n</table>`;\n\n if (arrayListadeCompras.length > 1) {\n const arrayNuevoSuma = arrayListadeCompras.map((item) => item[\"precio\"]);\n const sumaTotal = arrayNuevoSuma.reduce((acu, item) => acu + item);\n\n totalContainer.innerHTML = `<table class=\"table table-light\">\n<thead>\n <tr class=\"tr-1\">\n <th scope=\"col\"></th>\n <th scope=\"col\">Total</th>\n <th scope=\"col\">$${sumaTotal}</th>\n <th scope=\"col\"></th>\n \n </tr>\n\n</thead>\n\n</table>`;\n }\n}", "title": "" } ]
[ { "docid": "6d8f76258be6e14ba573260cbc6def65", "score": "0.7457196", "text": "carrinhoTotal() {\n let total = 0\n if(this.carrinho.length)\n this.carrinho.forEach(item => {\n total += item.preco\n });\n return total\n }", "title": "" }, { "docid": "80a9e725a112b233f469938fb3b5bff4", "score": "0.71596843", "text": "function calcularTotal() {\n // Limpiamos precio anterior\n total = 0;\n // Recorremos el array del carrito\n carrito.forEach((item) => {\n // De cada elemento obtenemos su precio\n const miItem = baseDeDatos.filter((itemBaseDatos) => {\n return itemBaseDatos.id === parseInt(item);\n });\n total = total + (miItem[0].Prezioa-(miItem[0].Prezioa * miItem[0].Portzentaia /100));\n });\n // Renderizamos el precio en el HTML\n DOMtotal.textContent = total.toFixed(2);\n }", "title": "" }, { "docid": "4db11e7a19b3d0a09717999a779090e8", "score": "0.7138965", "text": "function totalCompra()\n{\n // se obtiene el total calculando el precio por la cantidad comprada.\n var total = 0;\n productos_comprados.forEach(unProducto =>\n {\n total += unProducto.precioUnitario * unProducto.cantidad;\n });\n // se actualiza el html con el nuevo total.\n //var mensaje = document.getElementById('total');\n\n alert('El Total de su compra es de ' + formatMoney(total) + '.');\n //mensaje.innerHTML = \"Total: \" + formatMoney(total);\n}", "title": "" }, { "docid": "de9b5ada63ac3da32a57bd2706ed949a", "score": "0.71145946", "text": "function computarTotal() {\n var total = 0.0;\n\n pedido.forEach(function(id){\n total += pizzas.get(id).precio;\n })\n return total;\n}", "title": "" }, { "docid": "433b9fdd10e797cb50b2c2b171781c46", "score": "0.7041123", "text": "function countTotal() {\n vm.factura.total = 0;\n vm.factura.cancelado = 0;\n vm.detalles_factura.forEach(function(detalle){\n vm.factura.total = vm.factura.total + (detalle.cantidad*detalle.precio_venta);\n })\n vm.listapagos.forEach(function (pago){\n vm.factura.cancelado = vm.factura.cancelado + pago.monto;\n });\n }", "title": "" }, { "docid": "9201868b08d61d0d04bab62f6ce21a4f", "score": "0.69095075", "text": "function sumarTotalPrecios(){\n\n var precioItem = $(\".precioInsumo\");\n var arraySumaPrecio = [];\n\n for (var i = 0; i < precioItem.length; i++) {\n\n arraySumaPrecio.push(Number($(precioItem[i]).val()));\n\n\n }\n\n function sumarArrayPrecios(total, numero){\n\n return total + numero;\n\n }\n\n var sumaTotalPrecio = arraySumaPrecio.reduce(sumarArrayPrecios);\n\n $(\"#totalCompra\").val(sumaTotalPrecio);\n\n $(\"#totalCompraFinal\").val(sumaTotalPrecio);\n\n $(\"#totalCompra\").attr(\"total\", sumaTotalPrecio);\n\n }", "title": "" }, { "docid": "b9061bf1688d54677d12ed95305f2966", "score": "0.69005156", "text": "calculaCosteTotal(){\n this.costeTotal=0;\n this.unidades.forEach(\n (value,index)=>{this.costeTotal+=value.coste;}\n )\n }", "title": "" }, { "docid": "2befafddd9be646d03e608402f7e7285", "score": "0.6868427", "text": "function cot_total(){\n //alert(\"totaux\");\n /* cotiz de base */\n if (elem(\"c-cotisation-checkbox\").checked)\n\telem('c-cotisation').value=elem('tarif'+elem('cotiz').value).getAttribute(\"tarif\");\n else\n\telem('c-cotisation').value=0;\n\n /* Cotisation à l'hectare */\n var i,somme=0;\n if (elem(\"c-culture-checkbox\").checked) {\n\tvar rows=elem(\"c-culture-rows\");\n\tvar row;\n\tfor (i=1;i<rows.childNodes.length;i++){\n\t row = rows.childNodes[i];\n\t if (row.childNodes[0].checked){\n\t\tsomme+=1*row.childNodes[1].value*row.childNodes[1].getAttribute(\"tarif\");\n\t }\n\t}\n }\n elem(\"c-hectare\").value=somme;\n\n \n /* total */ \n var total;\n total=1*elem(\"c-cotisation\").value+1*elem(\"c-hectare\").value;\n if (elem(\"c-conseil-checkbox\").checked) total+=1*elem(\"c-conseil-menulist\").selectedItem.getAttribute(\"tarif\");\n if (elem(\"c-journal-checkbox\").checked) {\n\telem(\"c-journal-total\").value=\"(\"+elem('c-journal-nbex').value*elem(\"c-journal-menulist\").selectedItem.getAttribute(\"tarif\")+\" euros)\";\n\ttotal+=1*elem('c-journal-nbex').value*elem(\"c-journal-menulist\").selectedItem.getAttribute(\"tarif\");\n } else elem(\"c-journal-total\").value=\"\";\n\n if (1*elem(\"c-reglement-montant\").value==0 || elem(\"c-reglement-montant\").value==elem(\"c-total\").value)\n\telem(\"c-reglement-montant\").value=total;\n elem(\"c-total\").value=total;\n //alert(\"totaux calculés\");\n}", "title": "" }, { "docid": "0c5c28863c895c297d039d1fe2cfb60f", "score": "0.6843914", "text": "function calcularTotalCesta(){\n\n viewModel.totalCesta(0);\n\n viewModel.cesta().forEach(element => {\n viewModel.totalCesta(viewModel.totalCesta()+element.precioTotal);\n });\n\n}", "title": "" }, { "docid": "137468d168c04adfb273df8a2d445cdc", "score": "0.6805596", "text": "totalDepositos() {\n let total = 0;\n for (let i = 0; i < this.depositos.length; i++) {\n total += this.depositos[i][1]\n }\n return total;\n }", "title": "" }, { "docid": "b27c9dab641534bb54492461732ae530", "score": "0.6802549", "text": "function totalCarrito(carrito) {\n console.log(\"Totcarrito\")\n console.log(carrito);\n let total = 0;\n carrito.forEach(p => total += p.subtotal());\n return total.toFixed(2);\n }", "title": "" }, { "docid": "6cb50a0902f3e5c25cee0c3e478554ce", "score": "0.6793393", "text": "function total() {\r\n {\r\n transactions.map((transaction) => {\r\n\r\n //si la transaccion es ingreso y el checkbox de ingreso esta prendido, entonces sumar monto\r\n if (transaction.income == true && incomeCheck == true) {\r\n monto = monto + transaction.amount\r\n }\r\n\r\n\r\n //si la transaccion es gasto y el checkbox de gasto esta prendido, entonces restar monto\r\n else if (transaction.income == false && expenseCheck == true) {\r\n monto = monto - transaction.amount\r\n }\r\n }\r\n )\r\n }\r\n if (monto < 0){\r\n colorTotal = \"minus\"\r\n }\r\n }", "title": "" }, { "docid": "9f88836065adf012df2769ef00da6850", "score": "0.67625463", "text": "function cargarLista() {\n var $total = $('td#totalval');\n for (var id in accesorios) {\n if ((accesorio = accesorios[id]) != null) {\n añadir(id, accesorio.etiqueta, accesorio.total, accesorio.unidades);\n $total.html(parseFloat($total.html())+accesorio.total);\n }\n }\n}", "title": "" }, { "docid": "67361c85c07401f5b446bb5c7558bcd6", "score": "0.6749566", "text": "function sumarTotalPrecios() {\n\n\t\tvar precioItem = $(\".nuevoPrecioProducto\")\n\t\tvar sumaPrecio = [];\n\n\t\tfor(var i = 0; i < precioItem.length; i++) {\n\n\t\t\tsumaPrecio.push(Number($(precioItem[i]).val())) \n\n\n\t\t}\n\n\t\tfunction sumarArrayPrecios(total, numero) {\n\n\t\t\treturn total + numero\n\n\t\t}\n\n\t\tvar sumaTotal = sumaPrecio.reduce(sumarArrayPrecios)\n\t\t$('#nuevoTotalVenta').val(sumaTotal)\n\t\t$('#realTotalVenta').val(sumaTotal)\n\t\t$('#nuevoTotalVenta').attr(\"total\", sumaTotal)\n\n\t}", "title": "" }, { "docid": "c8870acf470044e96c29d03dffac2d29", "score": "0.6658202", "text": "function getCantidadTotalPanes() {\n cantidadTotalPanes = carrito.reduce((acum, item) => acum + item.cantidadPedido, 0);;\n}", "title": "" }, { "docid": "0de9011dca28538e7a6e1ab5de9942ee", "score": "0.66398543", "text": "function sumarPrecios(){\n\t\tvar precioItem = $(\".input-precio\");\n\n\t\tvar listaPrecios = [];\n\t\tvar precioTotalVenta = 0;\n\t\tfor (var i = 0; i < precioItem.length; i++) {\n\t\t\tlistaPrecios.push(parseFloat($(precioItem[i]).val()));\n\t\t}\n\t\tfor (var i2 = 0; i2 < listaPrecios.length; i2++){\n\t\t\tprecioTotalVenta += listaPrecios[i2];\n\t\t}\n\t\t$(\"#precioTotalCompra\").val(precioTotalVenta);\n\t\t$(\"#precioTotalCompra\").data('total', precioTotalVenta);\n\n\t}", "title": "" }, { "docid": "03be6b54e555ec178c6484f5947537ad", "score": "0.6636509", "text": "function sumarTotalCierre() {\n\n var cantidadSer = $(\".nuevaCantidadProducto\");\n\n //console.log(\"cantidadOc\", cantidadOc);\n\n var arraySumarCantidades = [];\n\n for (var i = 0; i < cantidadSer.length; i++){\n\n arraySumarCantidades.push(Number($(cantidadSer[i]).val()));\n\n }\n /* console.log(\"arraySumarCantidades\", arraySumarCantidades); */\n\n function sunaArrayCantidades(total, numero) {\n return total + numero;\n }\n\n var sumarTotal = arraySumarCantidades.reduce(sunaArrayCantidades);\n\n /* console.log(\"sumarTotal\", sumarTotal); */\n\n $(\"#nuevoTotalVenta\").val(sumarTotal);\n $(\"#totalVenta\").val(sumarTotal);\n $(\"#nuevoTotalVenta\").attr(\"total\", sumarTotal);\n\n}", "title": "" }, { "docid": "620a7bd29521b57f589e57776a483e09", "score": "0.6630485", "text": "function total(data){\n\n let total =[0,0]\n \n data.forEach(item =>{\n total[0] += item[0]\n total[1] += item[1]\n })\n return total;\n}", "title": "" }, { "docid": "2b31f2b8ff62c442da07f9706e46ebd4", "score": "0.6618662", "text": "static calcTotal(data) {\n if (data.mod === undefined)\n data.mod = [];\n const parts = new PartsList_1.PartsList(data.mod);\n // if a temp field is found, add it as a unique part\n if (data['temp'] !== undefined) {\n parts.addUniquePart('SR5.Temporary', data['temp']);\n }\n data.value = parts.total + data.base;\n data.mod = parts.list;\n return data.value;\n }", "title": "" }, { "docid": "ad799c50baa57b029e3cfb6c04d81dfa", "score": "0.661725", "text": "function calculateTotal() {\n\n var valueTotal = 0;\n\n listTotalPrices.map((num) => {\n valueTotal += num.value;\n });\n\n setTotal(valueTotal);\n\n }", "title": "" }, { "docid": "10741f619a23dc1a367544208e82861a", "score": "0.6616301", "text": "function total(arr) {\n let sum = 0;\n arr.forEach(function (numero) {\n sum += numero.price * numero.ProductoDeOrden.cantidad;\n });\n return sum;\n }", "title": "" }, { "docid": "c399543c77d05e2047b441c9838847a6", "score": "0.6579434", "text": "function totalPrecios(){\n\tvar precioItem = $(\".precioProducto\");\n\tarraySuma = [];\n\tconsole.log(\"arraySuma\", arraySuma);\n\t\n\tfor (var i = 0; i < precioItem.length; i++) {\n\t\tarraySuma.push(Number($(precioItem[i]).val()));\n\t}\n\n\tfunction sumaArrayPrecios(total, numero){\n\n\t\treturn total + numero;\n\n\t}\n\n\tsumaTotalPrecio = arraySuma.reduce(sumaArrayPrecios)\n\tconsole.log(\"sumaTotalPrecio\", sumaTotalPrecio);\n\t$(\"#nuevoSubTotalVenta\").attr('value', sumaTotalPrecio);\n\n\tagregarIva();\n\tlistaProductos();\n\n}", "title": "" }, { "docid": "279cb941b62e9f9d96ede4f50a0ddbfe", "score": "0.65575606", "text": "function calculaElTotal(elEvento) {\r\n\t\t//Añade el encabezado de la tabla\r\n\t\tdocument.getElementById(\"tablaTotal\").innerHTML = '<tr><td class=\"pro\"><b>Producto</b></td><td class=\"uni\"><b>Unidades</b></td><td class=\"preUni\"><b>Precio Unidad</b></td><td class=\"preTotal\"><b>Precio Total</b></td></tr>';\r\n\r\n\t\t//Inicializacion de las variables para esta funcion:\r\n\t\tvar carroTotal = 0;\r\n\t\tvar numProductos = 0;\r\n\r\n\t\t//Muestra el carrito de la compra\r\n\t\tfor (i in productos){\r\n\t\t\tvar tablaTotal = document.getElementById(\"tablaTotal\").innerHTML;\r\n\t\t\tvar preTotal = 0;\r\n\t\t\t//Cuenta el numero de productos para saber cuanto costara el transporte\r\n\t\t\tif (uniUser[i].value != 0){\r\n\t\t\t\tnumProductos++;\r\n\t\t\t}\r\n\r\n\t\t\tif (uniUser[i].value != 0){\r\n\r\n\t\t\t\t//Modifica el css para hacer hueco a los formularios\r\n\t\t\t\tdocument.getElementById(\"todo\").className = \"todoSi\";\r\n\t\t\t\tdocument.getElementById(\"menu\").className = \"menuSi\";\r\n\t\t\t\tdocument.getElementById(\"divZonaCompra\").className = \"divZonaCompraSi\";\r\n\t\t\t\tdocument.getElementById(\"divTotal\").className = \"divsSi\";\r\n \t\t\tdocument.getElementById(\"divDatos\").className = \"divsNo\";\r\n\t \t\tdocument.getElementById(\"divPago\").className = \"divsNo\";\r\n\r\n\r\n\t\t\t\t//Calcula el totalUnidades y rellena el carro de la compra\r\n\t\t\t\tpreTotal = precios[i] * uniUser[i].value;\r\n\t\t\t\tcarroTotal = carroTotal + preTotal;\r\n\t\t\t\tdocument.getElementById(\"tablaTotal\").innerHTML = tablaTotal + '<tr class=\"proCarrito\"><td>' +productos[i]+ '</td><td>' +uniUser[i].value+ '</td><td>' +precios[i]+ '</td><td id=\"preTotal' +i+'\" name=\"preTotal\">' +preTotal+ '</td></tr>';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//Se calcula el transporte a pagar segun la cantidad de productos comprados:\r\n\t\tvar precioTransporteAPagar;\r\n\t\tif (numProductos <= 2){\r\n\t\t\tprecioTransporteAPagar = precioTransporte[0];\r\n\t\t}\r\n\t\telse if (numProductos <= 3){\r\n\t\t\tprecioTransporteAPagar = precioTransporte[1];\r\n\t\t}\r\n\t\telse if (numProductos <= 4){\r\n\t\t\tprecioTransporteAPagar = precioTransporte[2];\r\n\t\t}\r\n\t\telse if (numProductos >= 5){\r\n\t\t\tprecioTransporteAPagar = precioTransporte[3];\r\n\t\t}\r\n\r\n\t\t//Se sacan las cuentas del transporte (si lo hubiese), del iva y el total:\r\n\t\tvar totalTransporte = precioTransporteAPagar;\r\n\t\tif(totalTransporte == \"gratis\"){\r\n\t\t\tvar totalIVA = (carroTotal * IVA);\r\n\t\t\tvar totalAPagar = carroTotal + totalIVA;\r\n\t\t}\r\n\t\telse{\r\n\t\t\tvar totalIVA = ((carroTotal + totalTransporte) * IVA);\r\n\t\t\tvar totalAPagar = carroTotal + totalTransporte + totalIVA;\r\n\t\t}\r\n\t\t//Limitar a 2 los decimales a mostrar del IVA:\r\n\t\ttotalIVA=totalIVA*100;\r\n\t\ttotalIVA=Math.floor(totalIVA);\r\n\t\ttotalIVA=totalIVA/100;\r\n\t\t//Limitar a 2 los decimales a mostrar del TOTAL A PAGAR:\r\n\t\ttotalAPagar=totalAPagar*100;\r\n\t\ttotalAPagar=Math.floor(totalAPagar);\r\n\t\ttotalAPagar=totalAPagar/100;\r\n\r\n\t\t//Se añade a la tabla el TOTAL que suma el carrito:\r\n\t\ttablaTotal = document.getElementById(\"tablaTotal\").innerHTML;\r\n\t\tdocument.getElementById(\"tablaTotal\").innerHTML = tablaTotal + '<tr><td>&nbsp;</td>&nbsp;<td></td><td class=\"preUni\"><b>Transporte: </b></td><td class=\"preTotal\"><b>' +totalTransporte+ '</b></td></tr>' + '<tr><td>&nbsp;</td>&nbsp;<td></td><td class=\"preUni\"><b>IVA ('+(IVA*100)+'%): </b></td><td class=\"preTotal\"><b>' +totalIVA+ '</b></td></tr>' + '<tr><td>&nbsp;</td>&nbsp;<td></td><td class=\"preUni\"><b>Total: </b></td><td class=\"preTotal\" id=\"totalAPagar\"><b>' +totalAPagar+ ' </b></td></tr>';\r\n\t}", "title": "" }, { "docid": "003c4bbe6dc0e3325522087960a91038", "score": "0.65362304", "text": "function somarSaldo(ListaTransacoes) {\n var total = 0;\n for (let t of ListaTransacoes) {\n total += Number(t[\"valor\"]);\n }\n return total;\n}", "title": "" }, { "docid": "ef4a3bd38302f27160c3cc0dc571fca4", "score": "0.6529619", "text": "getTotal(amounts){\n let total = 0;\n amounts.forEach(element => {\n total += element\n });\n return total;\n }", "title": "" }, { "docid": "d0bc856993339fd64e23964703cca96c", "score": "0.6523871", "text": "function calculateTotalPrice(lists) {\n return lists.reduce((a,c) => {\n return a + c.price;\n }, 0)\n}", "title": "" }, { "docid": "a00402821d32621e42affdb0bfa6dbb4", "score": "0.6520079", "text": "function total(arr) {\n let sum = 0;\n //console.log(arr)\n arr.forEach(function (numero) {\n // console.log(numero)\n //console.log(numero)\n sum += numero.price * numero.ProductoDeOrden.cantidad;\n });\n return sum;\n }", "title": "" }, { "docid": "01916f0633f01e97887dcbca9656c468", "score": "0.6496185", "text": "function totalHarga(namaMaskapai, arrMaskapai, jumlahOrang, opsi, tempat, namaTempat) { \n\n let total = 0 \n let hargaTrip = opsiTrip(opsi, jumlahOrang, tempat, namaTempat)\n let hargaPesawat = hargaFlight(namaMaskapai, arrMaskapai, jumlahOrang)\n\n total = hargaTrip + hargaPesawat\n\n return `Rp ${total = total.toLocaleString('id-ID')}`\n}", "title": "" }, { "docid": "4b29bc9a77198afc8043deef9c8df618", "score": "0.6495013", "text": "function calculateTotal(arr) {\n const orderType = 'espresso';\n\n // get everything matching 'espresso'\n const justEspresso = arr.filter(o => {\n // does the o.order === 'espresso'?\n // if (o.order === orderType) {\n // return true;\n // } else {\n // return false;\n // }\n return o.order === orderType;\n });\n //console.log(justEspresso);\n // grab just the costs\n const justCosts = justEspresso.map(o => {\n // pluck out the value of .cost\n return o.cost;\n });\n console.log(justCosts);\n\n\n // add it up\n // let total = 0;\n // for (let cost of justCosts) {\n // total = total + cost;\n // }\n // console.log(total);\n console.log('============');\n const nums = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];\n let finalTotal = nums.reduce((runningTotal, curr) => {\n // add the current item to the running total\n let sum = runningTotal + curr;\n console.log(`${runningTotal} + ${curr} = ${sum}`);\n\n runningTotal = sum;\n return runningTotal;\n }, 0);\n console.log(finalTotal);\n}", "title": "" }, { "docid": "62a8912b861910f1ca39309cb8594b56", "score": "0.6493865", "text": "function lucroTotal(umPeriodo) {\n var soma= 0;\n var mes = 0;\n for (var i=0; i<umPeriodo.length; i++) {\n mes = umPeriodo[i];\n soma= soma+ mes;\n }\n return soma;\n }", "title": "" }, { "docid": "5bb921753096b0e1fed290babb0b9d21", "score": "0.6485126", "text": "function listaTotal(mapa){\n if(isEmpty(mapa)){\n return [];\n }else{\n return append(first(mapa),listaTotal(rest(mapa)));\n }\n }", "title": "" }, { "docid": "2950de749998f0a3d54b4a970d407071", "score": "0.6475851", "text": "function CalculaTotal(){\n let total = 0;\n GeneratePeopleArray();\n people.forEach(function (element) { //Podria hacerse con un reduce? como?\n total += element.amount;\n });\n\n //cuando debe pagar cada uno redondeado hacia abajo.\n amountEach = Math.floor((total/people.length)*100)/100;\n\n document.getElementById(\"pTotal\").innerHTML = \"TOTAL: \" + total;\n document.getElementById(\"pEach\").innerHTML = \"Each should pay: \" + amountEach;\n}", "title": "" }, { "docid": "56e634b481ec2c786a5fe9f70383bc88", "score": "0.6469226", "text": "function getTotal(list, getValueToAddfn) {\n if (isNullOrUndefined(list, getValueToAddfn)) {\n return;\n }\n var result = 0;\n for (var i = 0, length = list.length; i < length; i++) {\n var item = list[i];\n result += getValueToAddfn(item);\n }\n return result;\n }", "title": "" }, { "docid": "78ee18cd77fa7fe58d7ada0119ddb7e9", "score": "0.6452473", "text": "function agregarCarrito(precio) { //PASO 2: agregas la función\n return total += precio; //PASO 3: en el return le dices que vaya sumando el resultado del precio y se sume al total\n}", "title": "" }, { "docid": "da426abaeade62309331248d409dc197", "score": "0.6448759", "text": "function Totaliza() {\n var sumCtServPrest = 0;\n var sumImPrecioTotalPres = 0;\n var sumCtServFact = 0;\n var sumImPrecioTotalFact = 0;\n var sumCtServFactDife = 0;\n var sumImServFactDife = 0;\n var sumCtDiferencia = 0;\n var sumImPrecioTotalDife = 0;\n var rows = $('#gridConciliacionesId').jqGrid('getRowData');\n for (var i = 0; i < rows.length; i++) {\n var row = rows[i];\n if (row['chkPres'] == 1 || $('#stConciliacion').val() == 'APR') {\n \t sumCtServPrest += Number(removeCommas(row['ctServPrest']));\n \t sumImPrecioTotalPres += Number(removeCommas(row['imPrecioTotalPres']));\n \t \n sumCtServFactDife -= Number(removeCommas(row['ctServPrest']));\n sumImServFactDife -= Number(removeCommas(row['imPrecioTotalPres']));\n }\n if (row['chkFact'] == 1 || $('#stConciliacion').val() == 'APR') {\n \t sumCtServFact += Number(removeCommas(row['ctServFact']));\n \t sumImPrecioTotalFact += Number(removeCommas(row['imPrecioTotalFact']));\n \t \n sumCtServFactDife += Number(removeCommas(row['ctServFact']));\n sumImServFactDife += Number(removeCommas(row['imPrecioTotalFact']));\n }\n }\n \n $('#gridConciliacionesId').jqGrid('footerData','set',{ctServPrest : sumCtServPrest ,\n imPrecioTotalPres : sumImPrecioTotalPres ,\n ctServFact : sumCtServFact , \n imPrecioTotalFact : sumImPrecioTotalFact , \n ctServFactDife : sumCtServFactDife , \n imServFactDife : sumImServFactDife \n }, true);\n \n var rows = $('#gridDiferenciasId').jqGrid('getRowData');\n for (var i = 0; i < rows.length; i++) {\n var row = rows[i];\n if (row['stDiferencia'] == 'ACT') {\n// sumCtDiferencia += Number(removeCommas(row['ctDiferencia']));\n// sumImPrecioTotalDife += Number(removeCommas(row['imPrecioTot']));\n sumCtDiferencia += Number(row['ctDiferencia']);\n sumImPrecioTotalDife += Number(row['imPrecioTot']);\n } \n }\n $('#gridDiferenciasId').jqGrid('footerData','set',{ctDiferencia: sumCtDiferencia, imPrecioTot: sumImPrecioTotalDife}, true);\n \n saldoCt = Math.round((sumCtServFactDife - sumCtDiferencia) * 100) / 100;\n saldoIm = Math.round((sumImServFactDife - sumImPrecioTotalDife) * 100) / 100;\n\n var rids = $('#gridSaldosId').jqGrid('getDataIDs');\n var rowId = rids[0];\n var rowData = $('#gridSaldosId').jqGrid('getRowData', rowId);\n rowData.saldoCtDiferencia = saldoCt;\n rowData.saldoPrecioTotal = saldoIm;\n $('#gridSaldosId').jqGrid('setRowData', rowId, rowData);\t \n\n var stIgnoraVal = ($('#stIgnoraVal').is(':checked')) ? 'S' : 'N';\n var stConciliacion = $('#stConciliacion').val();\n\n// $(\"#btnRepetidos\").removeClass('ui-state-disabled');\n// $(\"#btnRepetidos\").removeAttr(\"disabled\");\n \n $(\"#btnGrabar\").addClass('ui-state-disabled');\n $(\"#btnGrabar\").attr(\"disabled\", \"disabled\");\n $(\"#btnAprobar\").addClass('ui-state-disabled');\n $(\"#btnAprobar\").attr(\"disabled\", \"disabled\");\n $(\"#add_dif\").addClass('ui-state-disabled');\n $(\"#edit_dif\").addClass('ui-state-disabled');\n\n if ($(\"#stPeriodo\").val() == 'ABI' && $(\"#stProducto\").val() == 'S' && $(\"#stProductoSector\").val() == 'S') { \n // Verifico que la conciliacion no esta grabada\n if (stConciliacion != 'APR') {\n //Verifico primero si hay registros seleccionados en la grilla de Conciliaciones\n if (sumCtServPrest != 0 || sumCtServFact != 0 || sumImPrecioTotalPres != 0 || sumImPrecioTotalFact != 0) {\n //if ($('#gridConciliacionesId').jqGrid('getGridParam','records') > 0) {\n if ($(\"#saveGrant\").val() == 'S') {\n\t $(\"#btnGrabar\").removeClass('ui-state-disabled');\n $(\"#btnGrabar\").removeAttr(\"disabled\");\n }\n if ($(\"#differGrant\").val() == 'S') {\t \n $(\"#add_dif\").removeClass('ui-state-disabled');\n $(\"#edit_dif\").removeClass('ui-state-disabled');\n }\n if ($(\"#approveGrant\").val() == 'S') {\n // Si el Saldo de Cantidad e Importe son = 0 y no està aprobada, habilito el boton APROBAR\n if (saldoCt == 0 && saldoIm == 0) {\n \t $(\"#btnAprobar\").removeClass('ui-state-disabled');\n \t $(\"#btnAprobar\").removeAttr(\"disabled\");\n } else {\n \t // Si el Saldo de Importe != 0, pero el de Cantidad = 0 admitiendo la aprobacion por \n\t // cantidad chequeando el campo stIgnoraVal, entonces se habilita el boton APROBAR\n if (saldoCt == 0 && saldoIm != 0 && stIgnoraVal == 'S') {\n $(\"#btnAprobar\").removeClass('ui-state-disabled');\n $(\"#btnAprobar\").removeAttr(\"disabled\");\n } else {\n $(\"#btnAprobar\").addClass('ui-state-disabled');\n $(\"#btnAprobar\").attr(\"disabled\", \"disabled\");\n }\n }\n }\n }\n } \n } \n}", "title": "" }, { "docid": "e72f97a87f29c310ea562d2bf1aa5d57", "score": "0.6437808", "text": "function sumaRepoValidaFacturas() {\n var grid = jQuery(\"#GR_REPO_DS\");\n var dblTotalBono = 0;\n var dblTotal = 0;\n var arr = grid.getDataIDs();\n if (arr != null) {\n for (var i = 0; i < arr.length; i++) {\n var id = arr[i];\n var lstVal = grid.getRowData(id);\n dblTotalBono = dblTotalBono + parseFloat(lstVal.FAC_BONO);\n dblTotal = dblTotal + parseFloat(lstVal.FAC_IMPORTE);\n }\n }\n /*Ponemos el total en el pie de las columnas*/\n grid.footerData('set', {FAC_FECHAPAGO: \"TOTAL\", FAC_IMPORTE: dblTotal, FAC_BONO: dblTotalBono});\n}//Fin sumaRepoValidaFacturas", "title": "" }, { "docid": "7dff6c0e8ae9de2fd6f6e8a12aa72a0a", "score": "0.6425514", "text": "function ValorTotal(mochila){\n var valorTotal = 0;\n for (var i = 0; i < mochila.length; i++) {\n valorTotal += Math.round(mochila[i].valor * mochila[i].Cantidad);\n }\n return valorTotal\n}", "title": "" }, { "docid": "5d87133391ba6e03730e8313c86e31f3", "score": "0.64168626", "text": "costoTotal() {\n return this.costo + this.calcularIgv();\n }", "title": "" }, { "docid": "080fd43276bc06ec8c2fba8148cbdcb1", "score": "0.64157015", "text": "function total(){\n let total = 0;\n Object.keys(items).forEach( item => {\n total += (priceList[item] * items[item]);\n });\n return total;\n }", "title": "" }, { "docid": "e44c210fbe255d43a89a95e7f8d1c606", "score": "0.64145535", "text": "function total(splang)\n{\n const result = splang.reduce(function(num,dittle){\n dittle = dittle + num; \n return dittle;\n });\n return result;\n\n }", "title": "" }, { "docid": "87615576137a7081e7030b4ed4f8eda2", "score": "0.63986194", "text": "function calcular_suma_menu(){\n temporal_validar = false;\n suma = {\n totales:0,\n activos:0,\n recuperados:0,\n fallecidos:0\n }\n for(i=0;i<datos.poligonos.suma.length;i++){\n if(datos.poligonos.suma[i] != null && datos.poligonos.suma[i] != 'null'){\n temporal = datos.province.data[datos.poligonos.suma[i]];\n suma.totales += temporal.confirmed;\n suma.activos += temporal.confirmed - temporal.recovered - temporal.dead\n suma.recuperados += temporal.recovered == null ? 0 : temporal.recovered\n suma.fallecidos +=temporal.dead;\n temporal_validar = true;\n }\n }\n\n if(!temporal_validar){\n for(i=0;i<datos.province.data.length;i++){\n if(datos.province.data[i].country_code == datos.country.data[datos.pais_seleccionado].country_code){\n temporal = datos.province.data[i];\n suma.totales += temporal.confirmed;\n suma.activos += temporal.confirmed - temporal.recovered - temporal.dead\n suma.recuperados += temporal.recovered == null ? 0 : temporal.recovered\n suma.fallecidos +=temporal.dead;\n }\n }\n }\n\n numeros_menu(suma.activos,suma.recuperados,suma.fallecidos,suma.totales)\n}", "title": "" }, { "docid": "1963190d198f0ee4dd124867802ff395", "score": "0.63893294", "text": "function actualizarTotal(){\n\tlet total = 0;\n\tconst montoTotal= document.querySelector(\".montoTotal\");\n\t\n\t articulosCarrito.forEach(producto=>{\n\t\n\tlet cantidad = Number(producto.cantidad)\n\tlet precio = Number(producto.precio.slice(1))\n\n\ttotal= total + precio*cantidad;\n\t//console.log(total) \n\t});\n\tmontoTotal.innerHTML = ` Total: $ ${total} `\n\n}", "title": "" }, { "docid": "ccdce3c6c9d99c2937ba3fbaa2e53ae5", "score": "0.63876855", "text": "function getTotal(incentivi) {\n\t\t\tvar sum = 0;\n\t\t\tfor (var index = 0; index < incentivi.length; index++) {\n\t\t\t\tsum += parseFloat((String(incentivi[index].imponibile)).replace(',', '.'));\n\t\t\t}\n\t\t\treturn sum;\n\t\t}", "title": "" }, { "docid": "1da394436142df2b03e70deb5806fafc", "score": "0.6385377", "text": "function getTotal() {\n let total = 0;\n products.map(product => {\n total += (product.price * product.qty);\n\n })\n return total;\n }", "title": "" }, { "docid": "2d0cd815167d68d201bf7f90585b868e", "score": "0.63815093", "text": "function calculateTotal() {\r\n let sum = 0;\r\n\r\n if (window.books.length > 0) {\r\n window.books.forEach(book => {\r\n sum += book.price * book.quantity;\r\n });\r\n }\r\n\r\n return sum;\r\n}", "title": "" }, { "docid": "59dba5b328461f30035a1e7bc9e13a2e", "score": "0.63672036", "text": "function sumarTotalPrecios(){\n\n let precioItem = $(\".nuevoPrecioProducto\");\n let arraySumarPrecio = [];\n\n for (let i = 0; i < precioItem.length; i++){\n\n arraySumarPrecio.push(Number($(precioItem[i]).val()));\n\n }\n\n function sumarArrayPrecios(total, cantidad){\n\n return total + cantidad;\n\n\n }\n\n let sumaTotalPrecio = arraySumarPrecio.reduce(sumarArrayPrecios);\n\n\n\n $('#nuevoTotalVenta').val(sumaTotalPrecio);\n $('#totalVenta').val(sumaTotalPrecio);\n $('#nuevoTotalVenta').attr('total', sumaTotalPrecio);\n\n\n}", "title": "" }, { "docid": "642c5d99fe732ce02be9943079012bb5", "score": "0.63668674", "text": "function handleSumTotal() {\n const reducer = (accumulator, currentValue) =>\n accumulator + currentValue.price;\n //cart.reduce() funcion de un array que retorna o reduce a un unico valor de un array\n const sum = cart.reduce(reducer, 0);\n return sum;\n }", "title": "" }, { "docid": "2fce5ca20d863fd005d57ad908e13dbf", "score": "0.6360634", "text": "function sumArray(masyvoPavadinmas) {\n let total = 0;\n // debugger;\n for (let i = 0; i < masyvoPavadinmas.length; i++) {\n // kiekvieno el reiksme norim prideti prie total\n total += masyvoPavadinmas[i];\n }\n return total;\n}", "title": "" }, { "docid": "567bd60a6de6d27c3d0c679041521999", "score": "0.635392", "text": "function calcularTotal() {\n\t\tvar totalHora = 0;\n\t\tgridTareas.store.each(function (registrostore) {\n\t\t\tvar valor = String(registrostore.get('canhor')).replace(',','.');\n\t\t\ttotalHora = totalHora + parseFloat(valor);\n\t\t});\n\t\tExt.getCmp('tothor').setValue(totalHora);\n\t}", "title": "" }, { "docid": "bf5cc7b584c8824ada89e1a87d2f7c24", "score": "0.63326776", "text": "function totalArreglo(arr){\n arr.forEach(element => {\n let total = element.valores.reduce((a,b) => a + b);\n element.valores = total;\n });\n return arr;\n}", "title": "" }, { "docid": "bc4400eb77fc266cef24b574de2ac0f6", "score": "0.6317734", "text": "function sumarTotal() {\n var productos = $('#productosContainer').find('tbody tr');//Busca todos los productos\n var total = 0;\n $.each(productos, function (i, producto) {//Recorre los productos\n var precio = $(producto).find('.precio').text();//Busca solo los precios por su clase .precio\n total = parseInt(precio) + total;//Suma los precios de cada producto\n });\n $('#total strong').text(total);//pinta en total\n}", "title": "" }, { "docid": "3351e7aad33075775ad663f5e0e0857d", "score": "0.6310119", "text": "function totalCaja(){\n var totalCajero = 0;\n infoTec.innerHTML = \"<p>Información Técnica</p><br><p> El cajero cuenta con:</p><br>\"\n for(Rest of caja){\n infoTec.innerHTML += Rest.cantidad + \" billetes de $\" + Rest.valor + \"<br />\";\n\n totalCajero += (Rest.cantidad * Rest.valor);\n }\n totalCaje1 = totalCajero;\n infoTec.innerHTML += \"<br> Total: \" + totalCaje1;\n\n}", "title": "" }, { "docid": "26ad2e760d07ae9a8f0da19138a0e284", "score": "0.62880945", "text": "function getTotal(numbers) {\n return numbers.reduce(getSum);\n}", "title": "" }, { "docid": "543f8346e4c610322f73d024ed3dc2f6", "score": "0.62783456", "text": "_calcTotal() {\n return this.items.reduce((accumulator, current) => {\n return accumulator + current.price;\n },0);\n }", "title": "" }, { "docid": "3e46e5bfcb75934b70074687eafcdb0d", "score": "0.6275982", "text": "function sumarTotalPrecios()\n{\n\t// Proviene de este seccion : $(\".formularioVenta\").on(\"change\",\"select.nuevaDescripcionProducto\",function(){.........\n\n\tvar precioItem = $(\".nuevoPrecioProducto\"); // Almacena todas las clases, es decir son todos los renglones de la venta que se esta realizando.\n\tvar arraySumaPrecio = [];\n\t \n\tfor (var i=0;i<precioItem.length; i++)\n\t{\n\t\tarraySumaPrecio.push(Number($(precioItem[i]).val()));\n\n\t}\n\t//console.log(\"arraySumaPrecio\",arraySumaPrecio);\n\tfunction sumaArrayPrecios(total,numero)\n\t{\n\t\treturn total+numero;\n\t}\n\n\t// Para obtener el precio total de la venta de productos.\n\tvar sumaTotalPrecio = arraySumaPrecio.reduce(sumaArrayPrecios);\n\t//console.log(\"sumaTotalPrecio\",sumaTotalPrecio);\n\t$(\"#nuevoTotalVenta\").val(sumaTotalPrecio);\n\t$(\"#totalVenta\").val(sumaTotalPrecio);\n\t$(\"#nuevoTotalVenta\").attr(\"total\",sumaTotalPrecio);\n\n}", "title": "" }, { "docid": "47208e8343ebd9f04124215a3d23a688", "score": "0.624849", "text": "function getTotals()\r\n{\r\n\r\nvar sum = refugees.map(function(obj) { \r\n \r\n return obj[\"Africa\"]+obj[\"Asia\"]+obj[\"Europe\"]+obj[\"Former Soviet Union\"]+obj[\"Kosovo\"]+obj[\"Latin America/Caribbean\"]+obj[\"Near East/South Asia\"];\r\n});\r\n\r\nreturn sum;\r\n}", "title": "" }, { "docid": "a06df863e03ca96943aa074e176b73ae", "score": "0.62334967", "text": "function sumGeral() {\n\t\tvar vTotal = $( \".valueCase-topList\" ), vOne = $( \"#value-sum\" ), count = 0;\n\t\tvTotal.each( function(key, value) {\n\t\t\tcount += parseInt($(this).text());\n\t\t});\n\t\tvOne.text(count);\n\t}", "title": "" }, { "docid": "32e823089d7a54a74061512f5b6f374b", "score": "0.6232539", "text": "function getTotal( valP, valC )\n {\n // faire une addition\n return valP + valC;\n }", "title": "" }, { "docid": "1c5cbdf0fbee455a1eb7f05cf45fb3ce", "score": "0.6230746", "text": "function calcTotal (resArr, resPack, packs) {\n var tot_price = 0;\n for (var j = 0; j < resArr.length; j++) {\n for (var k = 0; k < packs.length; k++) {\n if (packs[k].qnt == resPack[j]) {\n var count = resArr[j].quot;\n var price = count * packs[k].rate;\n tot_price += price;\n }\n }\n }\n return tot_price;\n}", "title": "" }, { "docid": "4fad7600f438ab362266c1df5a7f383c", "score": "0.62265646", "text": "function calulateTotal(type){\n var sum = 0;\n\n data.allItems[type].forEach(function(current){\n sum += current.value;\n })\n \n data.total[type] = sum;\n }", "title": "" }, { "docid": "568b52c657cc1e8f41bcaca2d4e6e61e", "score": "0.6215202", "text": "calculateTotals(){\n this.data.totals = 0;\n this.data.items.forEach(item => {\n let price = item.price;\n let qty = item.qty;\n this.data.totals =+ price * qty;\n this.setFormattedTotals();\n })\n }", "title": "" }, { "docid": "722eec93561b35e0a3c0ac859b883dff", "score": "0.62086946", "text": "function accumulate(numTarjeta) {\n return Compra.listByNumTarjeta(numTarjeta) /* Obtencion de compras por numTarjeta */\n .then(compras => {\n /* Caso de exito */\n let puntos = 0; /* Acumulador de puntos */\n let dec = 0; /* Parte decimal de importe */\n\n /* Iteracion de compras para calculo y acumulacion de puntos */\n for(let i = 0; i < compras.length; i++) {\n puntos += Math.floor(compras[i].importe); /* Acumulacion de puntos con parte entera de importe */\n dec = compras[i].importe % 1; /* Obtencion de parte decimal del importe */\n\n if (dec > 0.5) { /* Si parte decimal mayor que 0.5 */\n puntos++; /* Acumular +1 punto */\n }\n }\n \n return Tarjeta.update(numTarjeta, { puntos: puntos }) /* Actualizacion de puntos */\n .then(tarjeta => {\n /* Caso de exito */\n /* Comprobacion de resultado */\n if (tarjeta) {\n return true; /* Actualizacion correcta */\n } else {\n return false; /* Actualizacion incorrecta */ \n }\n })\n .catch(reason => {\n /* Caso de fallo */\n console.log('Error acumulando puntos: ', reason);\n return false; /* Acumulacion incorrecta por problema en DB actualizando puntos */\n });\n })\n .catch(reason => {\n /* Caso de fallo */\n console.log('Error listando compras: ', reason);\n return false; /* Acumulacion incorrecta por problema en db buscando compras por numTarjeta */\n });\n}", "title": "" }, { "docid": "dd2a7006cf0ae37d132b74b0246de39a", "score": "0.6207331", "text": "calculatePortTotal(shares){\n const portTotal = []\n shares.forEach((share)=>{\n const sharePrice = share.price * 100\n const shareQuantity = share.quantity\n const totalHoldings = sharePrice * shareQuantity\n portTotal.push(totalHoldings)\n this.totalPortVal = calculateData(portTotal)\n })\n}", "title": "" }, { "docid": "8ee621ebfabd964311614470b9c5e918", "score": "0.61949635", "text": "function sumarTotalesPreciosA(){\n\n var precioItem = $(\".nuevoPrecioArticulo\");\n\n var arraySumaPrecio = [];\n\n for (var i = 0; i < precioItem.length; i++) {\n arraySumaPrecio.push(Number($(precioItem[i]).val()));\n }\n\n //console.log(\"arraySumaPrecio\", arraySumaPrecio);\n\n function sumaArrayPrecios(total, numero) {\n return total + numero;\n }\n\n var sumaTotalPrecio = arraySumaPrecio.reduce(sumaArrayPrecios);\n\n //console.log(\"sumaTotalPrecio\", sumaTotalPrecio);\n\n $(\"#nuevoSubTotalA\").val(sumaTotalPrecio.toFixed(2));\n $(\"#nuevoSubTotal\").val(sumaTotalPrecio.toFixed(2));\n\n}", "title": "" }, { "docid": "c0cb1aa4bc473f3785e59086169c52dd", "score": "0.6187798", "text": "function calculateTotal() {\n let productos;\n let total = 0;\n productos = recuperarLocalStorage();\n productos.forEach((producto) => {\n let subtotalProducto = Number(producto.precio_unitario * producto.cantidad_kg);\n total = total + subtotalProducto;\n });\n let totale;\n totale = total.toFixed(2);\n $(\"#total_pedido\").val(totale);\n \n }//Fin funcion", "title": "" }, { "docid": "41bbf2757aa6da12e73c9ec7241abacb", "score": "0.6182096", "text": "function Total(){\n \n calcularEdad()\n parejaSi()\n hijosSi()\n \n recargos = recargoPareja + recargoEdad + recargoHijos\n totalPagar = precioBase + comision + recargos\n\n document.getElementById(\"resultados\").style.display = \"flex\"\n document.getElementById(\"marcaSeguro\").style.visibility = \"visible\"\n document.getElementById(\"nombreUsuario\").innerHTML = \"Cotización para \" + nombreCompleto.value\n document.getElementById(\"saludo\").style.visibility = \"visible\"\n document.getElementById(\"dolares\").style.visibility = \"visible\"\n\n document.getElementById(\"cargos\").innerHTML = \"Cargos del seguro\"\n document.getElementById(\"total\").innerHTML = \"&nbsp;&nbsp; Totales\"\n\n document.getElementById(\"comision\").innerHTML = \"Comision\"\n document.getElementById(\"comisionNumber\").innerHTML = comision\n\n document.getElementById(\"cargonormal\").innerHTML = \"Precio base del seguro\"\n document.getElementById(\"cargonormalNumber\").innerHTML = precioBase\n\n document.getElementById(\"cargoedad\").innerHTML = \"Cargo por edad\"\n document.getElementById(\"cargoedadNumber\").innerHTML = recargoEdad\n\n document.getElementById(\"cargopareja\").innerHTML = \"Cargo por pareja\"\n document.getElementById(\"cargoparejaNumber\").innerHTML = recargoPareja\n\n document.getElementById(\"cargohijos\").innerHTML = \"Cargo por hijos\"\n document.getElementById(\"cargohijosNumber\").innerHTML = recargoHijos + \"<hr>\"\n\n document.getElementById(\"totalapagar\").innerHTML = \"Total a pagar\"\n document.getElementById(\"totalapagarNumber\").innerHTML = totalPagar\n\n document.getElementById(\"btnImprimir\").style.visibility = \"visible\"\n document.getElementById(\"rehacer\").style.visibility = \"visible\"\n}", "title": "" }, { "docid": "3457adb2ba7ab66a807c5c5aa9f3ec83", "score": "0.61791295", "text": "function mostrarCantCarro() {\n cantidadCarroEnElNav = []\n carrito.map(p => cantidadCarroEnElNav.push(p.cantidadCarro))\n let totalcarronav2 = cantidadCarroEnElNav.reduce((a, b) => a + b)\n document.getElementById('cantCarroNav').innerText = totalcarronav2\n }", "title": "" }, { "docid": "bea9807a8248648cea924107de78fae5", "score": "0.6152937", "text": "function getTotal() {\n let total = {};\n saveData.forEach(item => {\n data = item.item.split(\" x \");\n total[data[1]] = parseInt(total[data[1]]) + parseInt(data[0]) || parseInt(data[0])\n })\n return total;\n}", "title": "" }, { "docid": "3153ff067f171569baf4f310955b3ceb", "score": "0.6147661", "text": "function calculateTotalTrans(family, list){\n let sum = 0;\n\n list.forEach( entry => {\n if( entry.catFamily == family ){\n sum += entry.transAmount;\n }\n })\n return sum;\n}", "title": "" }, { "docid": "0a012c0a1b6be332a3dacf9d5b5fc08f", "score": "0.6144978", "text": "function total() {\n let total = 0;\n for (const i in cart) {\n total += cart[i].subTotal;\n }\n return total;\n}", "title": "" }, { "docid": "b78cce0d651d1b980b0eeef0f517a012", "score": "0.61425304", "text": "function getTotal() {\n return getSubTotal(orderCount) + getTax();\n}", "title": "" }, { "docid": "a43c3fb1850fe7a70e84e950115cd68a", "score": "0.6136147", "text": "checkRegisterTotal() {\n return this.cashInRegister\n .map(([_unit, value]) => value * 100)\n .reduce((acc, curr) => acc + curr, 0);\n }", "title": "" }, { "docid": "8e2b4098dc1c2a773197be6b0788ea9a", "score": "0.61344296", "text": "function getTotal() {\n //gets the evaluated result into the screen\n total = inputs.join('');\n $('#result').html(eval(total));\n $('#input').html('0');\n clear();\n }", "title": "" }, { "docid": "73ef24f6e79b636973a8909e6bdc2b24", "score": "0.61320275", "text": "compterNoeud(){\n let noeud = this.racine\n var compte=0;\n if(noeud==null){return 0}\n else{\n compte++\n const compterFils = function(noeud){\n if(noeud.gauche!=null || noeud.droite!=null){\n return compterFils(noeud.gauche)+compterFils(noeud.droite)\n }\n return compte;\n }\n return compterFils(noeud)\n }\n }", "title": "" }, { "docid": "884328a6acaca96334a900315b5d9f3a", "score": "0.6131012", "text": "function calculateTotal () {\n return cart.reduce((prev, cur) => prev + cur.price * cur.quantity, 0)\n }", "title": "" }, { "docid": "f6ee3d02803ae12cc70b25832528c5fd", "score": "0.6128785", "text": "function sumAll( ) {\n let sum = 0\n // TODO: loop to add items\n return sum;\n}", "title": "" }, { "docid": "9e41a0e9eead2839d9f31df3fa16a35c", "score": "0.612733", "text": "function totalCalc () {\n total = 0;\n shoppingCart.forEach(function (item) {\n total += item[3];\n console.log('total',total);\n return total;\n })\n}", "title": "" }, { "docid": "254a7a86eba1f67149441bfc8b3908a6", "score": "0.612185", "text": "function PesoTotal(mochila){\n var pesoTotal = 0;\n for (var i = 0; i < mochila.length; i++) {\n pesoTotal += Math.round(mochila[i].Peso * mochila[i].Cantidad);\n }\n return pesoTotal\n}", "title": "" }, { "docid": "d3bd3649044ef08a2449b60bbd2e185f", "score": "0.6118654", "text": "totalPrice(panier){\n let priceSum = 0;\n let calculPrice = (teddie) => {\n let singlePrice = parseInt(teddie.price);\n priceSum += singlePrice;\n let priceTotalContainer = document.getElementById('sum');\n priceTotalContainer.innerHTML = 'Prix total du panier :' + ' ' + priceSum/100 + '€';\n }\n panier.map(teddie => calculPrice(teddie))\n }", "title": "" }, { "docid": "d232b84d258ddf889667c501e62e83f0", "score": "0.61093485", "text": "function arregloTotal() {\n var x = document.getElementById(\"total\");\n console.log(arrayTotal)\n x.innerHTML = myarr.sort(function(a, b) {\n return a - b\n }); //Ordena los elementos de forma ascendente antes de mostrarlos\n myarr = (myarr.unique());\n x.innerHTML = myarr.join('<br/>'); //muestra los elementos ordenados y sin repeticiones\n document.getElementById(\"total\").className = \"transform\";\n }", "title": "" }, { "docid": "982d1ffc1d892607c0830cadbc53cee0", "score": "0.61062515", "text": "function getProductosTotal(e) {\r\n var form = this.form;\r\n var val = parseFloat(form.elements['acomp_total'].value);\r\n if (this.checked == true) {\r\n val += parseFloat(this.value);\r\n } else {\r\n val -= parseFloat(this.value);\r\n }\r\n\r\n form.elements['acomp_total'].value = formatDecimal(val);\r\n updateComboTotal(form);\r\n}", "title": "" }, { "docid": "36d34f8143cf93ae16ce65e229a01479", "score": "0.6091482", "text": "function totalCart() {\r\n let suma = cart.reduce(\r\n (acumulador, product) => acumulador + product.price * product.qty,\r\n 0\r\n );\r\n return suma;\r\n}", "title": "" }, { "docid": "539d485cc3bafa5461524f73ac5bcca5", "score": "0.60912937", "text": "function listarDetallesCompras(){\n\n $('#listar_det_compras').html('');\n\n var filas = \"\";\n //var subtotal = 0;\n var total = 0;\n\n for(var i=0; i<detalles.length; i++){\n\n var subtotal = detalles[i].subtotal = detalles[i].cantidad * detalles[i].precio_compra;\n\n var filas = filas + \"<tr id='fila\"+i+\"'><td>\"+(i+1)+\n \"</td><td style='text-align:center;'>\"+detalles[i].categoria+\" \"+detalles[i].marca+\" \"+\n \"Mod.: \"+detalles[i].modelo+\" \"+detalles[i].color+\" \"+\n detalles[i].medidas+\" \"+detalles[i].diseno+\" \"+detalles[i].materiales+\n\n \"</td><td style='text-align:center'><input style='text-align:right;border-radius:3px' type='text' class='cantidad form-control' name='precio_compra[]' id='precio_compra[]' onClick='setPrecioCompra(event, this, \"+(i)+\");' onKeyUp='setPrecioCompra(event, this, \"+(i)+\");' value='\"+ detalles[i].precio_compra+\"'><td style='text-align:center'><input style='text-align:right' type='number' class='cantidad form-control' name='cantidad[]' id='cantidad[]' onClick='setCantidad(event, this, \"+(i)+\");' onKeyUp='setCantidad(event, this, \"+(i)+\");' value='\"+detalles[i].cantidad+\"'><td style='text-align:center'><input style='text-align:right' type='text' class='cantidad form-control' name='cantidad[]' id='pv\"+(i)+\"' onClick='setPrecioVenta(event, this, \"+(i)+\");' onKeyUp='setPrecioVenta(event, this, \"+(i)+\");' value='\"+detalles[i].precio_venta+\"'></td><td style='text-align:center;'><span>$</span><span style='text-align:right' name='subtotal[]' id=subtotal\"+i+\" >\"+detalles[i].subtotal+\"</span><td style='text-align:center'><i class='nav-icon fas fa-trash-alt fa-2x' onClick='eliminarFila(\"+i+\");' style='color:red'></i></td></tr>\";\n\n \"</td><td style='text-align:center'><input style='text-align:right;border-radius:3px' type='text' class='cantidad form-control' name='precio_compra[]' id='precio_compra[]' onClick='setPrecioCompra(event, this, \"+(i)+\");' onKeyUp='setPrecioCompra(event, this, \"+(i)+\");' value='\"+ detalles[i].precio_compra+\"'><td style='text-align:center'><input style='text-align:right' type='number' class='cantidad form-control' name='cantidad[]' id='cantidad[]' onClick='setCantidad(event, this, \"+(i)+\");' onKeyUp='setCantidad(event, this, \"+(i)+\");' value='\"+detalles[i].cantidad+\"'><td style='text-align:center'><input style='text-align:right' type='number' class='cantidad form-control' name='cantidad[]' id='pv\"+(i)+\"' onClick='setPrecioVenta(event, this, \"+(i)+\");' onKeyUp='setPrecioVenta(event, this, \"+(i)+\");' value='\"+detalles[i].precio_venta+\"'></td><td style='text-align:center;'><span>$</span><span style='text-align:right' name='subtotal[]' id=subtotal\"+i+\" >\"+detalles[i].subtotal+\"</span><td style='text-align:center'><i class='nav-icon fas fa-trash-alt fa-2x' onClick='eliminarFila(\"+i+\");' style='color:red'></i></td></tr>\";\n\n\n //subtotal = subtotal + importe;\n\n }//cierre for\n $('#listar_det_compras').html(filas);\n}", "title": "" }, { "docid": "3a650d8414e4535567cc91fb234784f0", "score": "0.608919", "text": "function recalculaTotalPagoPaquete(){\r\tvar tcambio = $(\"#tipocambio\").val();\r\tvar adultos = $(\"#adultosc\").val();\r\tvar menores = $(\"#menoresc\").val();\r\tvar tmenores= menores * $(\"#precioMenor\").val();\r\tvar tadultos = tarifapaquetesAdultos(adultos);\r\tvar total = (tadultos * adultos) + tmenores;\r\tvar totalmxn = tcambio * total;\r\r\t$(\"#vpc_Amount\").val(Math.ceil(totalmxn)+\"00\");\r}", "title": "" }, { "docid": "a0cd3f08fd863946a1b0b4ba4f27bf0c", "score": "0.60887563", "text": "function f_summerResultat() {\n\tvar sum = 0;\n\tfor(var i=0;i<totaltAntForsok;i++){\n\t\tsum = sum + Number(tabResultat[i]);\n\t\tconsole.log(\"Sum: \" + sum + \". tabResultat[\" + i + \"]: \" + tabResultat[i] + \".\");\n\t}\n\treturn sum;\n}", "title": "" }, { "docid": "b6eabc4fbc9b6586ddfa5b530e9c32bf", "score": "0.6087263", "text": "function cantidadTotal(pedido) {\n let sumaTotal = 0;\n for (const itemProducto of pedido.item_producto) { //itemProducto x producto\n sumaTotal = sumaTotal + itemProducto.cantidad;\n }\n pedido.cantidadTotal = sumaTotal;\n return pedido;\n}", "title": "" }, { "docid": "3b0d5ead976f395de65044324411d786", "score": "0.60858446", "text": "function calculateTotal() {\r\n let serviceFee = 0;\r\n let processFee = 0;\r\n let totalTicketOnly = 0;\r\n let totalFees = 0;\r\n for (let element in this.options.ticketData) {\r\n let ticket = this.options.ticketData[element];\r\n let tempCost = ticket.price;\r\n let tempQuantity = ticket.selected;\r\n totalTicketOnly += tempCost * tempQuantity;\r\n serviceFee = calcServiceFee(tempCost);\r\n processFee = calcProcessFee(tempCost + serviceFee);\r\n totalFees += (serviceFee + processFee) * tempQuantity;\r\n }\r\n\r\n let centsTotal = totalTicketOnly;\r\n this.ticketTotalPrice = centsTotal + totalFees;\r\n this.ticketTotalContainer.innerHTML = `${this.options.currency}$${fromCents(totalTicketOnly)} <br>`;\r\n if (totalTicketOnly > 0)\r\n this.ticketTotalContainer.innerHTML += `+ Fees ${this.options.currency+'$'+fromCents(totalFees)}`;\r\n }", "title": "" }, { "docid": "9be67e7b7c0d3a31c176510ab871fc8e", "score": "0.60854036", "text": "function calcularSubTotales(costo, cantidad, idParrafo, moneda) {\n\n // calcula subtotal de cada producto\n var costoProductos = document.getElementsByClassName(\"subTotProduct\")\n var costoTotal = 0\n var total = document.getElementById(\"totalParcial\")\n\n if (moneda == \"USD\") {\n texto = costo * cantidad * 40;\n //mostrarSubtotal(idParrafo)\n document.getElementById(\"parr\" + idParrafo).innerHTML = texto;\n } else {\n texto = costo * cantidad;\n //mostrarSubtotal(idParrafo)\n document.getElementById(\"parr\" + idParrafo).innerHTML = texto;\n }\n\n\n //Calculo de la suma de los subtotales\n for (i = 0; i < costoProductos.length; i++) {\n costoTotal = parseInt(costoTotal) + parseInt(costoProductos[i].innerText)\n }\n if (costoTotal == 0) {\n total.innerHTML = 0\n } else {\n\n total.innerHTML = costoTotal\n }\n\n //calculo del costo del envio\n costoEntrega()\n\n // Calculo del total de la compra\n var subT = document.getElementById(\"totalParcial\").innerText\n var costoEnvio = document.getElementById(\"envio\").innerText\n var totalFinal = document.getElementById(\"total\")\n var costoTotal = 0\n\n costoTotal = parseInt(subT) + parseInt(costoEnvio)\n totalFinal.innerHTML = costoTotal\n}", "title": "" }, { "docid": "8bd5573a0529b535b2eee2b1d245dc4c", "score": "0.608095", "text": "function totalValue (items) {\nvar totalinventorycost=0;\nvar totalitemcost;\n for (var i=0; i<items.length; i++) {\n totalitemcost= items[i].inventory * items[i].unit_price;\n totalinventorycost += totalitemcost;\n }\n return totalinventorycost\n}", "title": "" }, { "docid": "178f0bcd7c07c3c948278b163ab3a2da", "score": "0.60744023", "text": "static sum(items) {\n return items.reduce((sum, x) => sum + x);\n }", "title": "" }, { "docid": "c56edd15708ee884bd73b95ff14992a8", "score": "0.6073833", "text": "function valeur(carte){\n var sum=0\n if (carte == crouMain){\n var length = crouMain.length\n }else{\n var length = jouMain.length // pour savoir combien de fois on fait la boucle\n }\n for (var i=0; i<length;i++){\n if (carte[0][1] == 1 && (carte[0][1] + carte [1][1]) <= 11){\n carte[0][1] = 11 \n }\n if (carte[1][1] == 1 && carte[0][1] + carte [1][1] <= 11){\n carte[1][1] = 11\n }\n sum += carte[i][1]\n }\n return sum\n}", "title": "" }, { "docid": "de54742b28430dd426c23b0c19337a6f", "score": "0.60714257", "text": "function importeTotal(pedido) {\n let suma = 0;\n for (const itemProducto of pedido.item_producto) {\n suma = suma + itemProducto.subTotal;\n }\n pedido.total = suma;\n return pedido;\n}", "title": "" }, { "docid": "3e49f121a93f00f2107725884b8b63b7", "score": "0.60695446", "text": "function findTotal(arr) {\n return arr.reduce((a, b) => a + b);\n }", "title": "" }, { "docid": "009d1c02412ee42c9b13402f27294ff6", "score": "0.60679114", "text": "function consumoTotal(){\n formulario = document.forms[\"consumo\"];\n var totalRopa = Number(formulario[\"gastoRopa\"].value);\n var totalTabaco = Number(formulario[\"consumoTabaco\"].value);\n var totalBolsas = Number(formulario[\"bolsas\"].value);\n var totalbotellas = Number(formulario[\"botellitas\"].value);\n var totalLibros = Number(formulario[\"libritos\"].value);\n var tipobolsass = document.getElementsByName(\"grupobolsas\");\n var tabaco;\n var bolsass;\n var botellas;\n var ropita;\n var ropaSegundaMano = document.getElementsByName(\"ropasegundamano\");\n if (ropaSegundaMano[1].checked)\n {\n ropita = totalRopa * 0.31 * 0.25;\n document.getElementById(\"totalRopaa\").innerHTML =\"Total por ropa: \" + ropita.toFixed(2);\n }\n if (ropaSegundaMano[2].checked)\n {\n ropita = totalRopa * 0.31 * 0.5;\n document.getElementById(\"totalRopaa\").innerHTML = \"Total por ropa: \" + ropita.toFixed(2);\n }\n if (ropaSegundaMano[3].checked)\n {\n ropita = totalRopa * 0.31 * 0.9;\n document.getElementById(\"totalRopaa\").innerHTML =\"Total por ropa: \" + ropita.toFixed(2);\n }\n if (ropaSegundaMano[4].checked)\n {\n ropita = totalRopa * 0.31;\n document.getElementById(\"totalRopaa\").innerHTML = \"Total por ropa: \" + ropita.toFixed(2);\n }\n\n //CALCULO DE CONSUMO DE TABACO\n tabaco = totalTabaco * 1.131;\n document.getElementById(\"totalTabacoo\").innerHTML = \"Total emision por tabaco: \" + tabaco.toFixed(2);\n //CALCULO DE CONSUMO POR BOLSAS :d\n if(tipobolsass[0].checked)\n {\n bolsass = totalBolsas * 0.1183\n document.getElementById(\"totalBolsaas\").innerHTML =\"Total emision por Bolsas: \" + bolsass.toFixed(2);\n document.getElementById(\"consejitos\").style = \"display:block\"\n document.getElementById(\"ConsejoBolsasEcologicas\").innerHTML = \"Se recomienda usar bolsas de algodon\"\n }\n if(tipobolsass[1].checked)\n {\n bolsass = totalBolsas * 0.02\n document.getElementById(\"totalBolsaas\").innerHTML =\"Total emision por Bolsas: \" + bolsass.toFixed(2);\n }\n if(tipobolsass[2].checked)\n {\n bolsass = totalBolsas * 3.98\n document.getElementById(\"totalBolsaas\").innerHTML =\"Total emision por Bolsas: \" + bolsass.toFixed(2);\n }\n\n //CALCULO POR BOTELLAS PERRI\n botellas = totalbotellas * 0.447;\n document.getElementById(\"totalBebidas\").innerHTML =\"Total emision por botellas: \" + botellas.toFixed(2);\n\n //Calculo PARA LIBROS :D\n var libross;\n libross = totalLibros * 1.2;\n document.getElementById(\"totalLibros\").innerHTML =\"Total emision por Libros: \" + libross.toFixed(2);\n //TOTAL DEL TOTAL \n totalDeConsumo = libross + botellas + bolsass + tabaco + ropita\n document.getElementById(\"totalTotal\").innerHTML =\"Emisiones Totales: \" + totalDeConsumo.toFixed(2)\n }", "title": "" }, { "docid": "c9769dc3b325cae49a7aaba9a7940604", "score": "0.60644275", "text": "function sumOrder() {\n\t\t\t\t\n\t\t\t\tif(self.orderList.length == 4) {\n\t\t\t\t\tself.order.subTotal \t= Math.round(self.productPrice * 3 * self.order.multiplier);\n\t\t\t\t\tself.order.discounts\t= Math.round(self.order.subTotal * self.order.discountRate);\n\t\t\t\t\tself.order.total \t\t= Math.round(self.order.subTotal - self.order.discounts);\n\t\t\t\t} else {\n\t\t\t\t\tself.order.subTotal \t= Math.round(self.productPrice * self.orderList.length * self.order.multiplier);\n\t\t\t\t\tself.order.discounts\t= Math.round(self.order.subTotal * self.order.discountRate);\n\t\t\t\t\tself.order.total \t\t= Math.round(self.order.subTotal - self.order.discounts);\n\t\t\t\t};\n\n\t\t\t\t//\tNOTIFY PROGRESS\n\t\t\t\tconsole.log('summing order', self.order);\n\t\t\t}", "title": "" }, { "docid": "f292cb2c9863c1faf1689ff312494d03", "score": "0.60579777", "text": "function total() {\n\tlet total;\n\tif ($('#coupon').val() === 'DEPTRAI') {\n\t\ttotal = formatNumber(subtotal() * 0.9);\n\t}\n\tif ($('#coupon').val() === 'XINHGAI') {\n\t\ttotal = formatNumber(subtotal() * 0.85);\n\t}\n\tif ($('#coupon').val() === 'CHONGDAY') {\n\t\ttotal = formatNumber(subtotal() * 0.8);\n\t}\n\tif ($('#coupon').val() === '') {\n\t\ttotal = formatNumber(subtotal());\n\t}\n\treturn total;\n}", "title": "" }, { "docid": "15593314766714461639e52f47bde091", "score": "0.60571396", "text": "function calcularTotales(){\r\n \tvar sub = document.getElementsByName(\"subtotal\");\r\n \tvar total = 0.0;\r\n\r\n \tfor (var i = 0; i <sub.length; i++) {\r\n\t\ttotal += document.getElementsByName(\"subtotal\")[i].value;\r\n\t}\r\n\t$(\"#total\").html(\"S/. \" + total);\r\n $(\"#total_venta\").val(total);\r\n evaluar();\r\n }", "title": "" }, { "docid": "c46923f86806a18dc7a070265731e896", "score": "0.6053997", "text": "calTotal() {\n var newArt = [...this.state.cart];\n var sum = 0;\n for (var i = 0; i < cart.lenght; i++) {\n sum += newArt[i]\n }\n }", "title": "" }, { "docid": "ab22f11d569076b245a1ccc101f79be3", "score": "0.60493606", "text": "addTotal(){\n this.total = 0;\n for(var i = 0; i < this.arr.length; i++)\n this.total += (this.arr[i].price * this.arr[i].quantity);\n return(\n <li class=\"list-group-item d-flex justify-content-between\">\n <span>Total (BRL)</span>\n <strong>R$ {this.total}</strong>\n </li>\n );\n }", "title": "" }, { "docid": "ef8b64f02f757dd8fb186e0182ec5890", "score": "0.60482144", "text": "function sum(arr) {\n // Contient la somme des int des tableaux\n var total = 0;\n\n // Cette boucle permet de convertir les tableaux contenant des tableaux qui eux même contiennent des tableaux etc ... en un tableau simple.\n // On test dans le while si notre tableau contient autre chose qu'un nombre\n while (containArray(arr)) {\n // On récupère un tableau simplifié de 1 niveau. C'est à dire que si notre tableau contient des tableaux qui eux même contiennent des tableaux, il faudra éxécuter cette fonction plusieurs fois.\n arr = arrayToInt(arr);\n }\n\n // On fait le somme de tous les éléments\n total = sumElements(arr);\n\n console.log(total);\n return total;\n\n\n\n /////////////////////////////////////////////////////////////////////////\n ////////////////////////////Exemple récursif/////////////////////////////\n /////////////////////////////////////////////////////////////////////////\n\n // Ce tout petit bout de code seul équivaut au code au dessus + toutes les fonctions qui suivent. On a pu énormement simplifier grâce à l'utilisation de la fonction 'sum(array)' de façon récursive\n\n // var total = 0;\n //\n // for (var index in arr) {\n // var value = arr[index];\n //\n // if (typeof(value) === 'number') {\n // total += value;\n // }\n // else if (typeof(value) === 'object') {\n // var subTotal = sum(value);\n // total += subTotal;\n // }\n // }\n //\n // return total;\n\n /////////////////////////////////////////////////////////////////////////\n /////////////////////////////////////////////////////////////////////////\n /////////////////////////////////////////////////////////////////////////\n}", "title": "" } ]
6705816563b740693abb873de5203121
Triggered when a Websocket client subscribes to an Invoice ID
[ { "docid": "4ca2130b3f49bda72300f9761d4c0645", "score": "0.74334294", "text": "async _onSubscribe (client, msg) {\n // TODO Make sure invoice exists\n // We really want to do this as soon as client connects.\n // If we don't, then we open ourselves up to DoS attacks.\n // So. perhaps, we force a subscribe within X seconds.\n // Otherwise, we boot the client for being cunts.\n\n if (!this.subscriptions[msg.invoiceId]) {\n this.subscriptions[msg.invoiceId] = []\n }\n\n this.subscriptions[msg.invoiceId].push(client)\n\n return client.emit('subscribed', {\n message: `Subscribed to ${msg.invoiceId}`\n })\n }", "title": "" } ]
[ { "docid": "d6f61c239ff35a52d4da0e3653704171", "score": "0.7064865", "text": "async notify (invoiceId, event, payload) {\n try {\n if (this.subscriptions[invoiceId]) {\n for (const client of this.subscriptions[invoiceId]) {\n client.emit(event, Object.assign({ event: event }, payload))\n }\n }\n } catch (err) {\n console.log(err)\n }\n }", "title": "" }, { "docid": "36e71ad0048747a7d8da153ead0da3d8", "score": "0.66894674", "text": "function onConnect() {\n client.subscribe(\"intrusion\");\n}", "title": "" }, { "docid": "cfddef3bdc75370aea850cd858f10e04", "score": "0.6486568", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"oil/#\");\n}", "title": "" }, { "docid": "c08c157c92be87395f73f7cf83e931f4", "score": "0.6475609", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n document.getElementById(\"status\").innerHTML = \"Subscribing...\";\n client.subscribe(\"penthouse/temp\");\n}", "title": "" }, { "docid": "c1862505af629930018e3314013ec494", "score": "0.64215106", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"#\");\n}", "title": "" }, { "docid": "000642e3c5d149362f5e2ee33186c82b", "score": "0.6356593", "text": "_onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n console.log(\"subscribed to: \" + this.subscriptionUrl)\n this.client.subscribe(this.subscriptionUrl);\n this._initialConnectDone = true;\n }", "title": "" }, { "docid": "360ca40d28a9a2b86b7f8e1d1475e8ce", "score": "0.62822527", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"MSG/1/#\");\n client.subscribe(\"MSG/2/#\");\n}", "title": "" }, { "docid": "215738cef9a22dbb64b92fd1c6845be6", "score": "0.61775726", "text": "function sub_message(req, res, next){\n\tvar client = require('./client.js')\n\tconsole.log(client.subscribe());\n\tres.send(200 , 'success');\n\treturn next();\n}", "title": "" }, { "docid": "1124d7f8d4c1029f5ebbb6e340af01d0", "score": "0.6167774", "text": "function onConnect() {\r\n // Once a connection has been made, make a subscription and send a message.\r\n console.log(\"Conectado...\");\r\n client.subscribe(\"emaguagallo.fie@unach.edu.ec/test\");\r\n\r\n\t\r\n }", "title": "" }, { "docid": "eb1dcc2017021e4d6289039a17f227af", "score": "0.6143976", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"Conectado...\");\n\t\n client.subscribe(\"jeffersson.pino@gmail.com/WEB\");\n\n\t\n }", "title": "" }, { "docid": "384e260852a81181c81878ebee0fd0ef", "score": "0.61119914", "text": "send_binary_subscription_message(message, subscription_event_callback) {\n var idx = this.id_ws_req++,\n ws_response_handlers = this.ws_response_handlers;\n var buf_2 = Buffer.concat([xas2(idx).buffer, message]);\n //var that = this;\n\n ws_response_handlers[idx] = function (obj_message) {\n subscription_event_callback(obj_message);\n };\n // Should be able to unsubscribe\n var unsubscribe = () => {\n // Send unsubscribe with the idx to the server.\n // LL_UNSUBSCRIBE_SUBSCRIPTION\n var buf_query = Buffer.concat([xas2(LL_UNSUBSCRIBE_SUBSCRIPTION).buffer]);\n // Only needs to give the subscription index. That is unique per client.\n var buf_2 = Buffer.concat([xas2(idx).buffer, buf_query]);\n this.websocket_connection.sendBytes(buf_2);\n\n }\n //console.log('pre send', buf_2);\n this.websocket_connection.sendBytes(buf_2);\n return unsubscribe;\n }", "title": "" }, { "docid": "0f177dd85338de0c5e1efcf10ae5912a", "score": "0.6090437", "text": "function onConnect() {\n // Once a connection has been made, make a subscription.\n console.log(\"Connected to \" + WebSocket_MQTT_Broker_URL);\n console.log(\"Client ID: \" + MQTT_Client_ID);\n MQTT_Client.subscribe(\"hwsb/+/thermostat/temperature\");\n MQTT_Client.subscribe(\"hwsb/ping/#\");\n MQTT_Client.subscribe(\"hwsb/disconnect\");\n MQTT_Client.subscribe(\"hwsb/+/switch/state\");\n}", "title": "" }, { "docid": "9466884a70f496a3dcd1e98d4cceac0c", "score": "0.6061705", "text": "received(data) {\n console.log('ClientChannel received', data)\n const { event, detail } = data\n const customEvent = new CustomEvent(`cable:client:messages:${event}`, { detail })\n document.dispatchEvent(customEvent)\n }", "title": "" }, { "docid": "d12dbef52f7a119b8866fc42c7fec790", "score": "0.60491353", "text": "_subscribe(eventName, filters) {\n const parameters = is.notUndefined(filters) ? [filters] : []\n const id = uuid({eventName, filters})\n const jsonRpcMessage = formatJsonRpc({\n id,\n params: [eventName, ...parameters]\n })\n this.socket.send(jsonRpcMessage)\n }", "title": "" }, { "docid": "9bb561e137824c974fbc08e14fdd6966", "score": "0.60319227", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n}", "title": "" }, { "docid": "b7f29495dc2d646c68d979c808100de4", "score": "0.6004108", "text": "function subscribe(client_id)\n{\n log('subscribe()','creating subscribe wrapper, client_id',client_id);\n return function(client_request_id, msg_obj, callback) {\n\n var request_id = client_id+'_'+client_request_id;\n\n log('subscribe() '+request_id);\n // Note that RTMonitorAPI builds the actual unique request_id that goes to the server\n // as a concatenation of the caller_id and the request_id given by the caller.\n //var caller_request_id = caller_id+'_'+request_id;\n\n msg_obj.msg_type = 'rt_subscribe';\n //msg_obj.request_id = caller_request_id;\n msg_obj.request_id = request_id;\n\n log('RTMonitorAPI subscribe request_id '+request_id);\n\n var msg = JSON.stringify(msg_obj);\n\n //requests[caller_request_id] = { callback: request_callback } ;\n requests[request_id] = { client_id: client_id,\n callback: callback\n } ;\n\n return self.sock_send_str(msg);\n //return subscribe(client_id+'_'+request_id, msg_obj, callback);\n };\n}", "title": "" }, { "docid": "49932a774ed8e321e1a04ad814c8a99e", "score": "0.59847397", "text": "function onConnect() {\n console.log(\"connection established\");\n client.subscribe(\"pittsburgh/temperature/#\", {qos: 1});\n}", "title": "" }, { "docid": "84cdc45c1b473eb2ad4197111b8b682f", "score": "0.598376", "text": "function subscribed (topic, client) {\n console.log('subscribed : ', topic);\n}", "title": "" }, { "docid": "65131150f31bbcca576ade0444c9cfdb", "score": "0.59813124", "text": "function on_connect() {\n console.log('Connected...')\n output.innerHTML += 'Connected to RabbitMQ-Web-Stomp<br />';\n console.log(client);\n client.subscribe(mq_queue, on_message);\n}", "title": "" }, { "docid": "5ec8bc5555f8f08c4442d64002f17d61", "score": "0.59613407", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(SUB_TOPIC);\n client.send(MESSAGES.BIRTH);\n document.getElementById(\"clientStatus\").innerText = \"connected\";\n document.getElementById(\"connectionDetails\").classList.remove(\"border-danger\");\n document.getElementById(\"connectionDetails\").classList.add(\"border-success\");\n document.getElementById(\"content\").style.display = \"block\";\n}", "title": "" }, { "docid": "49e745992b49da94fa5980c578ca018d", "score": "0.5950021", "text": "subscribe() {\n this.socket.emit('subscribe', {\n channel: this.name,\n auth: this.options.auth || {},\n });\n }", "title": "" }, { "docid": "49e745992b49da94fa5980c578ca018d", "score": "0.5950021", "text": "subscribe() {\n this.socket.emit('subscribe', {\n channel: this.name,\n auth: this.options.auth || {},\n });\n }", "title": "" }, { "docid": "421072a898f4544fe7d5e1c096e151f5", "score": "0.592568", "text": "function myClientConnected() {\n MQTT_CLIENT.subscribe(\"testtopic/gg_7\");\n}", "title": "" }, { "docid": "220d4457b7e499c92e1c3545fc75f29a", "score": "0.59022576", "text": "function subscribe(id, username) {\n showMessage(\"Subscribed to \" + username + \".\");\n var url = \"/subscriptions/\";\n $.post(url, {id: id});\n}", "title": "" }, { "docid": "1e913d0483ef664e41c449da2b707dbc", "score": "0.5883848", "text": "function onConnect() {\n console.log(\"Conectado MQTT-WebSocket\");\n client.subscribe(\"IoT/Temp\");\n client.subscribe(\"IoT/Led1\");\n client.subscribe(\"IoT/Led2\");\n}", "title": "" }, { "docid": "2a43f07973af4a7bfe8a095bbfa17b29", "score": "0.587226", "text": "function onConnect(context) {\n // Once a connection has been made, make a subscription and send a message.\n var connectionString = context.invocationContext.host + \":\" + context.invocationContext.port + context.invocationContext.path;\n logMessage(\"INFO\", \"Connection Success \", \"[URI: \", connectionString, \", ID: \", context.invocationContext.clientId, \"]\");\n var statusSpan = document.getElementById(\"connectionStatus\");\n statusSpan.innerHTML = \"Connected to Solace PubSub+: \" + connectionString + \" with Client ID: \" + context.invocationContext.clientId;\n connected = true;\n setFormEnabledState(true);\n\n // sub to catalog updates\n client.subscribe(topicProductInfo);\n logMessage(\"INFO\", \"Subscribed to \" + topicProductInfo);\n // sub to my delivery status\n client.subscribe(topicSub);\n logMessage(\"INFO\", \"Subscribed to \" + topicSub);\n}", "title": "" }, { "docid": "8a5aa0f4f76626f03e88f8134aa3e301", "score": "0.5812649", "text": "subscribe() {}", "title": "" }, { "docid": "a479e6f156094020e3f6ea208c92a6d8", "score": "0.58035356", "text": "function _subscribe( context ){\n if ( !context.app.mqtt ){\n // MQTT Gateway not connected yet\n console.log ( new Date() + ' Gateway Controller Started');\n console.log(context.app.channels);\n startMQTTClient ( context );\n subscribeTopic ( context );\n \n return 'Subscribed to topic ' + context.data.topic;\n } else {\n subscribeTopic ( context );\n return 'Subscribed to topic ' + context.data.topic;\n } \n}", "title": "" }, { "docid": "d7575180fdd1072eeb0ea5c4cfa6f6f0", "score": "0.5798487", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"00e04c81aaca-rain\");\n //message = new Paho.MQTT.Message(\"Hello\");\n //message.destinationName = \"/World\";\n //client.send(message); \n}", "title": "" }, { "docid": "f8368f8f9df5202643b391ab75d06897", "score": "0.57979304", "text": "_onSubscribe(msg) {\n\n let _this = this;\n\n let resources = msg.body.resources;\n\n let subscriber = msg.from;\n let domain = divideURL(resources[0]).domain; //we are assuming resources are all from the same domain\n\n let identity = msg.body.identity;\n\n _this.createSubscription(domain, resources, subscriber, identity).then((reply)=>{\n //forward to hyperty:\n reply.id = msg.id;\n reply.from = _this._url;\n reply.to = subscriber;\n reply.body = msg.body;\n reply.body.code = 200;\n\n log.log('[SubscriptionManager] - craeteSubscription: ', msg, reply, subscriber);\n\n _this._bus.postMessage(reply);\n\n\n if (!_this._subscriptionsStorage[subscriber]) {\n\n\n _this._subscriptionsStorage[subscriber] = {\n domain: domain,\n resources: resources,\n subscriber: subscriber,\n identity: identity\n };\n\n } else {\n resources.forEach((resource) => {\n if (!(_this._subscriptionsStorage[subscriber].resources.includes(resource))) {\n _this._subscriptionsStorage[subscriber].resources.push(resource);\n }\n });\n }\n\n _this._storage.set('subscriptions', 1, _this._subscriptionsStorage);\n });\n }", "title": "" }, { "docid": "e03c71a74908004329bd31893ccfdbfc", "score": "0.5795189", "text": "function onConnect() {\n\t // Once a connection has been made, make a subscription and send a message.\n\t console.log(\"onConnect\");\n\t client.subscribe(\"onemore/square/notice/kindergarten\");\n\t message = new Paho.MQTT.Message(\"Hello\");\n\t message.destinationName = \"onemore/square/notice/kindergarten\";\n\t client.send(message);\n\t}", "title": "" }, { "docid": "6ceceb433c64eb078f1571b7954b5215", "score": "0.57826924", "text": "function ClientSubscription(session,options) {\n assert(session instanceof OPCUASession);\n\n var self = this;\n self.publish_engine = new ClientSidePublishEngine(session,{ keep_alive_interval: 100});\n // options should have\n var allowedProperties =[\n 'requestedPublishingInterval',\n 'requestedLifetimeCount',\n 'requestedMaxKeepAliveCount',\n 'maxNotificationsPerPublish',\n 'publishingEnabled',\n 'priority'\n ];\n\n options = options || {};\n options.requestedPublishingInterval = options.requestedPublishingInterval || 100;\n options.requestedLifetimeCount = options.requestedLifetimeCount || 60;\n options.requestedMaxKeepAliveCount = options.requestedMaxKeepAliveCount || 2;\n options.maxNotificationsPerPublish = options.maxNotificationsPerPublish || 2;\n options.publishingEnabled = options.publishingEnabled ? true: false;\n options.priority = options.priority || 1;\n\n\n self.publishingInterval = options.requestedPublishingInterval;\n self.lifetimeCount = options.requestedLifetimeCount;\n self.maxKeepAliveCount = options.requestedMaxKeepAliveCount;\n self.maxNotificationsPerPublish = options.maxNotificationsPerPublish;\n self.publishingEnabled = options.publishingEnabled;\n self.priority = options.priority;\n self.subscriptionId = \"pending\";\n\n//xx console.log(new Error().stack);\n\n setImmediate(function(){\n session.createSubscription(options,function(err,response){\n\n if (err) {\n self.emit(\"error\",err);\n } else {\n self.subscriptionId = response.subscriptionId;\n self.publishingInterval = response.revisedPublishingInterval;\n self.lifetimeCount = response.revisedLifetimeCount;\n self.maxKeepAliveCount = response.revisedMaxKeepAliveCount;\n\n self.publish_engine.registerSubscriptionCallback(self.subscriptionId,function(notificationData,publishTime){\n if (notificationData.length === 0 ) {\n // this is a keep alive message\n self.emit(\"keepalive\");\n } else {\n // we have valid notifications\n self.emit(\"received_notifications\");\n // let publish a global event\n\n // now inform each individual monitored item\n }\n });\n setImmediate(function(){\n self.emit(\"started\",self.subscriptionId);\n });\n }\n });\n });\n}", "title": "" }, { "docid": "01f39fa5cdd7f08d4b6f80afacd90046", "score": "0.5782014", "text": "function onConnect() {\n console.log(\"Connection established, subscribing to /lisa\");\n client.subscribe(\"/lisa\", {qos: 1});\n}", "title": "" }, { "docid": "4bc9ba43d1c7c4407a4856f24b3505ee", "score": "0.57733357", "text": "function onConnect() {\r\n // Once a connection has been made, make a subscription and send a message.\r\n console.log(\"Conectado...\");\r\n\t\r\n client.subscribe(\"wlara123@outlook.es/prueba\");\r\n message = new Paho.MQTT.Message(\"hola desde la web\");\r\n message.destinationName = \"wlara123@outlook.es/prueba\";\r\n client.send(message);\r\n\t\r\n }", "title": "" }, { "docid": "e553a3b6f5f7237f0f5f757c1ac6ac09", "score": "0.5759137", "text": "function onConnect() {\n console.log('client is connected');\n client.subscribe(\"MPU9250/namiki-digital\");\n\n}", "title": "" }, { "docid": "133cbce1d9f0a154393bac41c811156a", "score": "0.5739092", "text": "function subscribe(symbolid) {\n console.log(\"subscribe to \" + symbolid);\n\n // get the nbtrader symbol\n db.hget(\"symbol:\" + symbolid, \"nbtsymbol\", function(err, nbtsymbol) {\n if (err) {\n console.log(\"Error in subscribe():\" + err);\n return;\n }\n\n console.log(\"subscribe to \" + nbtsymbol);\n var nbtsymbollen = nbtsymbol.length;\n var buf = new Buffer(31+nbtsymbollen);\n\n buf[0] = 0;\n buf[1] = 0;\n buf[2] = 0;\n buf[3] = 27+nbtsymbollen;\n buf[4] = 28;\n buf.write(\"332\", 5);\n buf[8] = 31;\n buf.write(\"mtag\", 9);\n buf[13] = 29;\n buf.write(nbtsymbol, 14);\n buf[14+nbtsymbollen] = 30;\n buf.write(\"22\", 15+nbtsymbollen); // bid\n buf[17+nbtsymbollen] = 30;\n buf.write(\"25\", 18+nbtsymbollen); // offer\n buf[20+nbtsymbollen] = 30;\n buf.write(\"-374\", 21+nbtsymbollen); // midnetchange\n buf[25+nbtsymbollen] = 30;\n buf.write(\"-375\", 26+nbtsymbollen); // midpercentchange\n buf[30+nbtsymbollen] = 28;\n\n conn.write(buf);\n });\n}", "title": "" }, { "docid": "123d48cefe83b7a6b9af4988c13b1da7", "score": "0.57281744", "text": "listenToStore(cb) {\n // let userID = Auth.getUserId();\n let socket = io.connect('https://neighborhood-bake-sale.herokuapp.com/');\n let sellerID = this.props.location.pathname.split('/')[2];\n socket.on(sellerID, function(data) {\n console.log(data);\n if (data.message === \"Store Updated\") {\n cb(sellerID);\n }\n });\n }", "title": "" }, { "docid": "7a616f7d54b3814e946412560e411963", "score": "0.5716657", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"patient\");\n client.subscribe(\"checkin\");\n message = new Paho.MQTT.Message(JSON.stringify(template));\n message.destinationName = \"command\";\n console.log(message);\n client.send(message);\n}", "title": "" }, { "docid": "2986bb2393549819cbb125756e07f5e7", "score": "0.57158333", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message\n $('#mqtt-info').append('onConnect')\n client.subscribe('kimetrics/test');\n message = new Paho.MQTT.Message('{ \"user\": \"web\", \"mechanism\": \"WebSocket\" }');\n message.destinationName = 'kimetrics/test';\n client.send(message)\n}", "title": "" }, { "docid": "12c6f58bd77d2ad1fabebd331359518a", "score": "0.571579", "text": "function subscribe() {\n\t\tfor (subs in subscription_callbacks) {\n\t\t\tif (subscription_callbacks.hasOwnProperty(subs)) {\n\t\t\t\tvar subscription = toLightwsdMessage(appsecret, subs, \n\t\t\t\t\t\t\t\t\t\t{}, \"subscribe\");\n\t\t\t\tqueue.push(subscription);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "292d04d1e1907292529abedc9ca14b24", "score": "0.5697805", "text": "function sendSubscriptionIDToServer(subscription) {\n var subscriptionid = subscription.endpoint.split('gcm/send/')[1];\n console.log(\"Subscription ID\", subscriptionid);\n fetch('http://localhost:8080/subscribers', {\n method: 'post',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(\n { subscriptionid : subscriptionid })\n });\n}", "title": "" }, { "docid": "b7eff3ac3f160f67b0b0438f0f6fd15c", "score": "0.5695469", "text": "function subscribe_user(user_id, subscribeUser) {\n channel.push(\"subscribe\", {user_id: user_id, userToSub: subscribeUser})\n .receive(\"subscribed\", resp => console.log(\"subscribed\", user_id))\n console.log({username: user_id, usersToSub: subscribeUser})\n}", "title": "" }, { "docid": "331e09c0e1e4f84a304c263cb67ca4d9", "score": "0.56740993", "text": "function onConnect() {\n\t // Once a connection has been made, make a subscription and send a message.\n\t console.log(\"onConnect\");\n\t client.subscribe(\"#\"); //simple demo just subscribe to everything.\n\t \n\t //////this is how to send messages but we are not doing that in this demo.\n\t //message = new Paho.MQTT.Message(\"Hello\");\n\t //message.destinationName = \"World\";\n\t //client.send(message);\n\t ////////////////////////////\n\t}", "title": "" }, { "docid": "0584b7d3cdae135f605c4fee3b5c337a", "score": "0.56698084", "text": "async _onUnsubscribe (client, msg) {\n delete this.subscriptions[msg.invoiceId]\n\n return client.emit('unsubscribed', {\n message: `Unsubscribed from ${msg.invoiceId}`\n })\n }", "title": "" }, { "docid": "836f352f6406b229b29d1bd3b3905e18", "score": "0.5666995", "text": "function subscribe() {\r\n // capture the reference id so we can tell in the response whether it is the latest call\r\n // was using createGUID to create the reference id, but the old library just does this, which is simpler\r\n var referenceId = String(referenceIdCounter++);\r\n this.referenceId = referenceId;\r\n // reset any updates before subscribed\r\n this.updatesBeforeSubscribed = null;\r\n var data = _utilsObject.extend({}, this.subscriptionData, {\r\n ContextId: this.streamingContextId,\r\n ReferenceId: this.referenceId\r\n });\r\n _log2.debug(LOG_AREA, 'starting..', {\r\n serviceGroup: this.serviceGroup,\r\n url: this.url\r\n });\r\n this.currentState = STATE_SUBSCRIBE_REQUESTED;\r\n this.transport.post(this.serviceGroup, this.url + '/active', null, { body: data}).then(onSubscribeSuccess.bind(this, referenceId)).catch(onSubscribeError.bind(this, referenceId));\r\n }", "title": "" }, { "docid": "e2210dea167ae4527d72faf699f2905f", "score": "0.5665912", "text": "oneSignalCollback()\n {\n let userSubscribe;\n\n this.OneSignal.push(function () {\n // console.log('CALLBACK');\n\n this.OneSignal.on('subscriptionChange', function (isSubscribed) {\n userSubscribe = isSubscribed;\n if (isSubscribed) {\n this.OneSignal.getUserId(function (userId) {\n let data = {\n 'userName': globalData.userLogin,\n 'oneSignalId': userId,\n 'SubscribeOrNot': isSubscribed\n };\n\n $.ajax({\n type: \"POST\",\n //url: \"https://s9prej0dhgdd.runscope.net/\",\n url: globalData.rootUrl + \"Account/PushSubscribe\",\n data: data,\n error: function () {\n console.log('Error userName: ' + data.Name);\n console.log('Error oneSignalId: ' + data.Id);\n },\n success: function () {\n console.log('userName: ' + data.Name);\n console.log('oneSignalId: ' + data.Id);\n console.log('oneSignalId');\n }\n\n });\n });\n }\n });\n });\n\n return userSubscribe;\n }", "title": "" }, { "docid": "3fc6e1cb70910d1ec7878159631c82a9", "score": "0.5660192", "text": "connectedCallback() {\n console.log('in connected callback $$ ' + this.recordId);\n \n //Callback used when platform even is received\n //Need to use => function as the function messes up the this reference. \n const messageCallback = (response) => {\n console.log('New message received : ', JSON.stringify(response));\n const recId = response.data.payload.recordId__c;\n const uId = response.data.payload.userId__c;\n const uName = response.data.payload.userName__c;\n console.log(`Results from pull recId ${recId} recordId ${this.recordId} userId ${this.userId} uId ${uId}`);\n if (recId === this.recordId) {\n console.log('recordId matches');\n if( this.userId !== uId)\n {\n console.log('user id did not match');\n this.refreshNeeded = true;\n this.updateUserName = uName;\n this.dispatchEvent(\n new ShowToastEvent({\n title: uName + ' changed the record.',\n message: \"You'll need to reload the page.\",\n variant: 'error'\n })\n ); \n }\n \n }\n };\n //Subscribes to the platform event\n subscribe(this.channelName, -1, messageCallback).then(response => {\n console.log('Successfully subscribed to : ', JSON.stringify(response));\n this.subscription = response;\n }).catch(error => {\n console.log('there was an error subscribing ', JSON.stringify(error));\n });\n }", "title": "" }, { "docid": "a710cfae9fbc057e7c5e57afb04dd919", "score": "0.56558555", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(mqttconfig.topic);\n }", "title": "" }, { "docid": "47f899e1a04d049a6edcf5524633c409", "score": "0.56526846", "text": "function onConnect() {\r\n // Once a connection has been made, make a subscription and send a message.\r\n console.log(\"onConnect\");\r\n client.subscribe(topic);\r\n/* var message = new Paho.MQTT.Message(\"Hello\");\r\n message.destinationName = topic;\r\n client.send(message);*/\r\n}", "title": "" }, { "docid": "6d602f34c026182a6ca0f3374d52c0d8", "score": "0.5652515", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"event1\");//event1\n $timeout(function () {\n vm.connected1 = true;\n vm.wait1 = false;\n });\n }", "title": "" }, { "docid": "96704336230df90b829ae6918fffd3fe", "score": "0.56462127", "text": "_onConnected() {\n for (let marketSymbol of this._subscriptions.keys()) {\n this._sendSubscribe(marketSymbol);\n }\n }", "title": "" }, { "docid": "cda39e890035e985583b5f7c64a9f1b3", "score": "0.5645893", "text": "function onConnect() {\r\n // Once a connection has been made, make a subscription and send a message.\r\n console.log(\"onConnect\");\r\n\t\r\n client.subscribe(topic_rx);\r\n message = new Paho.MQTT.Message(\"hola\");\r\n message.destinationName = topic_tx;\r\n \t\r\n }", "title": "" }, { "docid": "40a269c1dff735cb3848b538ccdb023d", "score": "0.5629475", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(topic);\n //var message = new Paho.MQTT.Message(\"Hello\");\n //message.destinationName = topic;\n //client.send(message);\n }", "title": "" }, { "docid": "0ac5cb77c16ccc4424400cd2d07aebad", "score": "0.5624476", "text": "function Connected() {\n console.log(\"MQtt Connected\");\n mqttClient.subscribe(subscription);\n}", "title": "" }, { "docid": "c22ddab0c4eeefc465234087f3ba9d1c", "score": "0.5619482", "text": "_subHandler(data) {\n const id = data && data.id ? data.id : ''\n\n // Map the subscriptionId to the uuid\n this.registrySubIds[data.result] = id\n this.registry[id].subId = data.result\n this.registry[id].isSubscribed = true\n }", "title": "" }, { "docid": "792e8586bc5780269dbf6983c94b4181", "score": "0.56184995", "text": "function onConnect() {\n // Once a connection has been made, subscribes the checked one\n console.log(\"connection established, subscribing to /temperature/pittsburg\");\n\n client.subscribe(\"temperature/pittsburgh/#\", {qos: 2});\n lastTopic = \"temperature/pittsburgh/#\";\n}", "title": "" }, { "docid": "6887b1955c2e8ceecdd009b6c9e973c4", "score": "0.56127065", "text": "function covSubscription(\n socket,\n objectType,\n bacnetIdentifier,\n invokeId,\n subscriptionLifetimeInSeconds\n) {\n let deviceObject = new DeviceObject();\n deviceObject.objectType = objectType;\n deviceObject.bacnetIdentifier = bacnetIdentifier;\n\n let messageFactory = new MessageFactory();\n let message = messageFactory.subscribeCOV(\n deviceObject,\n invokeId,\n subscriptionLifetimeInSeconds\n );\n\n let offset = 0;\n\n let payload = message.bytes;\n\n // send a request and keep the socket open so the response can be retrieved\n socket.send(\n payload,\n offset,\n payload.length,\n DESTINATION_PORT,\n DESTINATION_ADDRESS,\n function () {\n console.log(\n \"covSubscription() Sent '\" +\n util.byteArrayToHexString(payload) +\n \"' Length = \" +\n payload.length\n );\n }\n );\n}", "title": "" }, { "docid": "ec646fd7797e534044740a0b224e6c15", "score": "0.5604894", "text": "function onConnect(){\n console.log(\"onConnect\");\n client.subscribe(\"#\");\n message = new Paho.MQTT.Message(\"Hello\");\n message.destinationName = \"/World\";\n}", "title": "" }, { "docid": "cb6961be3751e552dd17240ef0e46788", "score": "0.55980897", "text": "function messageWs(evt) {\n if (evt.data.indexOf(\"Student\") !=-1){\n studentId.push(evt.data.slice(8));\n generatePeerConnection(studentId[countStudent]);\n countStudent = countStudent + 1;\n startCall();\n }\n else {\n processSignalingMessage(evt);\n }\n}", "title": "" }, { "docid": "4d2c4050f654da8a8f05756694d590f3", "score": "0.55906236", "text": "function onConnect() {\n localDiv.html('client is connected');\n client.subscribe(topic);\n}", "title": "" }, { "docid": "3a04068e754db665efba87ef2c5ee38d", "score": "0.5590599", "text": "function subscribeForNotification(subcription){\n var eventFilter = []\n eventFilter.push('/restapi/v1.0/account/~/presence')\n subcription.setEventFilters(eventFilter)\n .register()\n .then(function(resp){\n console.log('ready to get missed call event')\n })\n .catch(function(e){\n throw e\n })\n}", "title": "" }, { "docid": "0e5e513fcdbf5b615734be87393eaa39", "score": "0.55904096", "text": "_clientReady() {\n const client = this._getClient();\n this.userId = client.userId;\n this._websocket = client.socketManager;\n this._websocket.on('message', this._handleSocketEvent, this);\n this._startPolling();\n }", "title": "" }, { "docid": "6e996c21afd9cdd90ab76c4c490f8502", "score": "0.55870235", "text": "function notifySubscribers(point) {\n if (subscribed[point.id]) {\n ws.send(JSON.stringify(point));\n }\n }", "title": "" }, { "docid": "16e486192e2918975aae5a8503ae66bb", "score": "0.557702", "text": "function HandleClientData(data, socketId)\n{\n console.log('Received client message ', data);\n let jsonData = JSON.parse(data);\n\n if (jsonData.msgId === 100) {\n clientSockets.push({'id': socketId, 'uuid': data.uuid});\n }\n else if (jsonData.msgId === 101)\n {\n if (!_.isNil(captureNodeSocketId)) {\n io.to(captureNodeSocketId).emit('CaptureNodeConfigRequest', '');\n }\n else\n {\n console.log('CaptureNode not connected');\n }\n }\n else\n {\n if (!_.isNil(captureNodeSocketId)) {\n console.log('server: sending WebRTCSignallingMessage ', jsonData.data);\n io.to(captureNodeSocketId).emit('WebRTCSignallingMessage', jsonData.data);\n }\n else\n {\n console.log('CaptureNode not connected');\n }\n }\n}", "title": "" }, { "docid": "ce57e4f13b74ffe7e79caf09e46100e7", "score": "0.55742157", "text": "function subscribeToPushNotification() {\n navigator.serviceWorker.ready\n .then(function(registration) {\n if (!registration.pushManager) {\n alert('This browser does not support push notification.');\n return false;\n }\n //---to subscribe push notification using pushmanager---\n registration.pushManager.subscribe(\n //---always show notification when received---\n { userVisibleOnly: true }\n )\n .then(function (subscription) {\n console.log('Push notification subscribed.');\n console.log(subscription);\n //------add the following statement------\n sendSubscriptionIDToServer(subscription);\n //---------------------------------------\n updatePushNotificationStatus(true);\n })\n .catch(function (error) {\n updatePushNotificationStatus(false);\n console.error('Push notification subscription error: ', error);\n });\n })\n}", "title": "" }, { "docid": "6f51da38a0a0359e6d896c2d2d08b606", "score": "0.55635387", "text": "function onSubscription() {\n// Sets up Subscriber\n const subscriptionName = 'projects/' + projectId + '/subscriptions/' + subscriber;\n subscription = pubsub.subscription(subscriptionName);\n\n// Handles message reception with a callback function\n subscription.on(`message`, messageHandler);\n setTimeout(() => {\n subscription.removeListener('message', messageHandler);\n console.log(`${messageCount} message(s) received.`);\n }, timeout * 1000);\n }", "title": "" }, { "docid": "1ea0b94e041b739f4d3265b4ace1e5e6", "score": "0.5551801", "text": "function openSubscriber() {\r\n\tvar timestamp = new Date();\r\n\twsSubscriber = new WebSocket(wsURL);\r\n\twsSubscriber.onopen = function() {\r\n\t\tconsole.log(\"Subscriber WebSocket ready\");\r\n\t\tdocument.getElementById('chat_area').value+=\"You have joined the group chat!\\n\";\r\n\t\tvar msg = {\"method\":\"Subscribe\", \"params\":{\"channel\" : \"pubsub_private\"}};\r\n\t\twsSubscriber.send(JSON.stringify(msg));\r\n\t};\r\n\twsSubscriber.onclose = function(obj) {\r\n\t\tconsole.log(\"Subscriber websocket was closed \" + obj.code);\r\n\t};\r\n\twsSubscriber.onmessage = function(event) {\r\n\t\tconsole.log(\"Subscriber received messsage \" + event.data);\r\n\t\tvar event_data = JSON.parse(event.data);\r\n\t\tif (event_data.from === undefined){\r\n\t\t\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\tdocument.getElementById('chat_area').value += event_data.from+\": \"+event_data.text+\" \"+timestamp.getHours()+\":\"+timestamp.getMinutes()+\":\"+timestamp.getSeconds()+\"\\n\";\r\n\t\t}\r\n\t};\r\n\twsSubscriber.onerror = function(error) {\r\n\t\tconsole.log(\"Error on subscriber websocket \" + error);\r\n\t};\r\n}", "title": "" }, { "docid": "81b1feb0e1a0e5a9d3974726cf682ca7", "score": "0.55434126", "text": "function onConnect() {\n //Once a connection has been established, make a subscription and send a message\n console.log(\"onConnect\");\n client.subscribe(\"DHT001\");\n // client.subscribe(\"humSensor\");\n client.subscribe(\"airQualitySensor\");\n client.subscribe(\"node1\");\n alert(\"Connected.\");\n}", "title": "" }, { "docid": "0ef7fd053c8d7f49a895fdae415ca363", "score": "0.55425465", "text": "function socket_handler(socket, mqtt) {\n\tlocalMQTT = mqtt;\n\t// Called when a client connects\n\tmqtt.on('clientConnected', client => {\n\t\t\n\t\tsocket.emit('debug', {\n\t\t\ttype: 'CLIENT', msg: 'New client connected: ' + client.id\n\t\t});\n\t});\n\n\t// Called when a client disconnects\n\tmqtt.on('clientDisconnected', client => {\n\t\tsocket.emit('debug', {\n\t\t\ttype: 'CLIENT', msg: 'Client \"' + client.id + '\" has disconnected'\n\t\t});\n\t});\n\n\t// Called when a client publishes data\n\tmqtt.on('published', (data, client) => {\n\t\tif (!client) return;\n\t\t// since there is only one topic, everytime something is published we will incremenent the counter of region 1\n\t\tregionCounter[0]++;\n\t\tsocket.emit('debug', {\n\t\t\ttype: 'PUBLISH', \n\t\t\tmsg: 'Client \"' + client.id + '\" published \"' + JSON.stringify(data) + '\"'\n\t\t});\n\t});\n\n\t// Called when a client subscribes\n\tmqtt.on('subscribed', (topic, client) => {\n\t\tif (!client) return;\n\n\t\tsocket.emit('debug', {\n\t\t\ttype: 'SUBSCRIBE',\n\t\t\tmsg: 'Client \"' + client.id + '\" subscribed to \"' + topic + '\"'\n\t\t});\n\t});\n\n\t// Called when a client unsubscribes\n\tmqtt.on('unsubscribed', (topic, client) => {\n\t\tif (!client) return;\n\n\t\tsocket.emit('debug', {\n\t\t\ttype: 'SUBSCRIBE',\n\t\t\tmsg: 'Client \"' + client.id + '\" unsubscribed from \"' + topic + '\"'\n\t\t});\n\t});\n\n\n}", "title": "" }, { "docid": "5a56432d9a9c402bd9c0f4af9e099584", "score": "0.5535705", "text": "_webSocketManagerOnMessage(event) {\n let content;\n if (event.content) {\n content = JSON.parse(event.content);\n }\n if (content && this._clientId === content.clientId) {\n if (content.jsonRpcMsg.method === \"idleConnection\") {\n this._clearIdleRtcPeerConnection();\n } else if (content.jsonRpcMsg.method === \"quotaBreached\") {\n this._logger.log(\"Number of active sessions are more then allowed limit for the client \" + this._clientId);\n this._closeRTCPeerConnection();\n this._publishError(\"multiple_softphone_active_sessions\", \"Number of active sessions are more then allowed limit.\");\n }\n }\n }", "title": "" }, { "docid": "e31b7a4d078dc770c1b72ea8936b713d", "score": "0.55331814", "text": "subscribe() {\n //\n }", "title": "" }, { "docid": "e31b7a4d078dc770c1b72ea8936b713d", "score": "0.55331814", "text": "subscribe() {\n //\n }", "title": "" }, { "docid": "c36ae246d83daa005e9d7cd957c2f5fa", "score": "0.5524427", "text": "function subscribe(requestUrl) {\n\tconsole.log('URL: '+requestUrl);\n var clientId = String(Math.random()).replace('.', '');\n pahoClient = new Paho.MQTT.Client(requestUrl, clientId);\n var connectOptions = {\n onSuccess: function () {\n console.log('connected');\n\n //subscribe to the topic as soon as we are connected\n pahoClient.subscribe(topic);\n \n alert('Connected to IoT');\n document.getElementById(\"messageButton\").disabled = false; \n \n },\n useSSL: true,\n timeout: 3,\n mqttVersion: 4,\n onFailure: function (err) {\n alert('IoT connect failed '+JSON.stringify(err));\n }\n };\n pahoClient.connect(connectOptions);\n\n pahoClient.onMessageArrived = function (message) {\n\t try {\n\t console.log(\"message: \" + message.payloadString);\n\t newMessage(message.payloadString)\n\t } catch (e) {\n\t console.log(\"error: \" + e);\n\t }\n };\n}", "title": "" }, { "docid": "37a28334e588d71de3362ee4fe51d528", "score": "0.551832", "text": "function clientToClient(otherClientID, data) {\n\t\tio.to(otherClientID).emit('message_to_client', data);\n\t\tio.to(socket.id).emit('message_to_client', data);\n\t}", "title": "" }, { "docid": "41e4653528c3b987c340a0ddc9cb5640", "score": "0.54985964", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n //client.subscribe(mqttData.topic);\n // message = new Paho.MQTT.Message(\"Test Feedhenry\");\n // message.destinationName = mqttData.topic;\n // client.send(message);\n }", "title": "" }, { "docid": "b93d1fa490d9b2d4a7c552fac883f480", "score": "0.5495531", "text": "async _onConnection (client) {\n // Setup event listeners\n client.on('subscribe', (msg) => this._onSubscribe(client, msg))\n client.on('unsubscribe', (msg) => this._onUnsubscribe(client, msg))\n }", "title": "" }, { "docid": "693250898a8f237174a6ff0c5d4f8717", "score": "0.5491808", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"Conectado...\");\n\t\n client.subscribe(\"mdpilatuna.fie@unach.edu.ec/repaso\");\n message = new Paho.MQTT.Message(\"hola desde la web\");\n message.destinationName = \"mdpilatuna.fie@unach.edu.ec/test\";\n client.send(message);\n\t\n }", "title": "" }, { "docid": "e60ac9396a933febe6dd5bc1765944ed", "score": "0.5490201", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n $rootScope.mqtt_client.subscribe(\"/Coletivo\");\n /*message = new Paho.MQTT.Message(\"Hello\");\n message.destinationName = \"/Coletivo\";\n $rootScope.mqtt_client.send(message);*/\n }", "title": "" }, { "docid": "85b8fc589728b395c41e5c3a4cc4d013", "score": "0.54898465", "text": "connectedCallback() {\n this.subscribeToMessageChannel();\n }", "title": "" }, { "docid": "85b8fc589728b395c41e5c3a4cc4d013", "score": "0.54898465", "text": "connectedCallback() {\n this.subscribeToMessageChannel();\n }", "title": "" }, { "docid": "d4fbf2cd2b239b01bd9c05ad835a5dd2", "score": "0.5487664", "text": "function onConnect() {\r\n // Once a connection has been made, make a subscription and send a message.\r\n console.log(\"onConnect\");\r\n\t\r\n client.subscribe(topic_rx);\r\n message = new Paho.MQTT.Message(\"ll:Hello: CloudMQTT\");\r\n message.destinationName = topic_tx;\r\n \r\n\t\r\n }", "title": "" }, { "docid": "03a44cf46093d26be3dfd1ef60dd274e", "score": "0.54750043", "text": "async eventLogSubscription() {console.log(\"subscribing\");\n const zilliqa = new Zilliqa('https://dev-api.zilliqa.com');\n const subscriber = zilliqa.subscriptionBuilder.buildEventLogSubscriptions(\n 'wss://dev-ws.zilliqa.com',\n {\n // smart contract address you want to listen on \n addresses: [AUCTION_CONTRACT_ADDRESS],\n },\n );\n \n subscriber.emitter.on(StatusType.SUBSCRIBE_EVENT_LOG, (event) => {\n // if subscribe success, it will echo the subscription info\n console.log('get SubscribeEventLog echo : ', event);\n });\n \n subscriber.emitter.on(MessageType.EVENT_LOG, (event) => {\n console.log('get new event log: ', JSON.stringify(event));\n // updating the welcome msg when a new event log is received related to getHello() transition\n this.setState({\n update: Date.now().toString()\n });\n }); \n await subscriber.start();\n }", "title": "" }, { "docid": "3117d268dcf9a73d68d18a32879308fa", "score": "0.547134", "text": "function onConnected(){\n // Subscribe to topic/public/{hubId}\n hubId = hubid.className;\n console.log(\"/topic/public/\" + hubId);\n var sub1 = stompClient.subscribe(\"/topic/public/\" + hubId, onMessageReceived);\n\n stompClient.send(\"/app/chat.addUser\",\n {},\n JSON.stringify({sender: username,\n channelId: hubId,\n type: \"JOIN\" })\n );\n\n}", "title": "" }, { "docid": "99185de940ba34b3b35a0d1d4467280f", "score": "0.5471247", "text": "subscribeToMessageChannel() {\n if (!this.subscription) {\n this.subscription = subscribe(\n this.messageContext,\n displayedProducts,\n (message) => this.handleMessage(message),\n { scope: APPLICATION_SCOPE }\n );\n }\n }", "title": "" }, { "docid": "22340977405f32e514f2dbab885ed048", "score": "0.5469325", "text": "connectedCallback() {\n this.subscribeToMessageChannel();\n }", "title": "" }, { "docid": "d59a0ea26f376b054eea46b9099d4105", "score": "0.5464638", "text": "_authorise(msg) {\n let _this = this;\n\n if (!msg.body.resource) {\n throw new Error('[SyncherManager._authorise] invitation request without data object url:', msg);\n }\n\n let objSubscriptorURL = msg.body.resource + '/subscription';\n let p2p = msg.body.p2p ? msg.body.p2p : false;\n\n log.log('[SyncherManager - authorise] - ', msg);\n\n if (msg.body.authorise) {\n msg.body.authorise.forEach((hypertyURL) => {\n //FLOW-OUT: send invites to list of remote Syncher -> _onRemoteCreate -> onNotification\n\n _this._bus.postMessage({\n type: 'create', from: objSubscriptorURL, to: hypertyURL,\n body: { p2p: p2p, identity: msg.body.identity, source: msg.from, value: msg.body.value, schema: msg.body.schema }\n }, (reply) => { // lets forward the invitation response\n let response = {\n from: msg.to,\n to: msg.from,\n id: msg.id,\n type: reply.type,\n body: reply.body\n };\n\n _this._bus.postMessage(response);\n });\n });\n }\n }", "title": "" }, { "docid": "4816fe82fa13365aabd9c4056b27fb7c", "score": "0.5464253", "text": "subscribe() {\n this.subscription = this.pusher.subscribe(this.name);\n }", "title": "" }, { "docid": "4816fe82fa13365aabd9c4056b27fb7c", "score": "0.5464253", "text": "subscribe() {\n this.subscription = this.pusher.subscribe(this.name);\n }", "title": "" }, { "docid": "e2a921d65c3c7ae8c7962bff133de1e4", "score": "0.5460275", "text": "connnectedCallBack(){\n this.subscribeMessage()\n }", "title": "" }, { "docid": "fd58bb478c238903fa30891bdf03b9cc", "score": "0.54596084", "text": "function onConnect() {\r\n // Once a connection has been made, make a subscription and send a message.\r\n alert(\"Connected\");\r\n }", "title": "" }, { "docid": "b45df45ce8556963fcf64c94ee28bd6a", "score": "0.54513913", "text": "connectedCallback() {\n this.subscribeToMessageChannel();\n }", "title": "" }, { "docid": "b45df45ce8556963fcf64c94ee28bd6a", "score": "0.54513913", "text": "connectedCallback() {\n this.subscribeToMessageChannel();\n }", "title": "" }, { "docid": "e0067ee1aa06806215e33b098773c7a0", "score": "0.5446776", "text": "function onConnect() {\n // Fetch the MQTT topic from the form\n topic = \"/data\";\n\n // Print output for the user in the messages div\n // div.innerHTML += '<span>Subscribing to: ' + topic + '</span><br/>';\n\n // Subscribe to the requested topic\n client.subscribe(topic);\n}", "title": "" }, { "docid": "081a8d2d2705106214227dc9a1e682d3", "score": "0.5443151", "text": "onmessage() {\n log(`w->r@${clientId}`, 'Unexpected handler of message.');\n }", "title": "" }, { "docid": "63e5668b8234d7c2a1cefd741dcfcd34", "score": "0.54390323", "text": "handleSubscribe() { \n // Callback invoked whenever a new event message is received \n const messageCallback = ( response ) => { \n //console.log( 'New message received : ', JSON.stringify( response ) ); \n // Response contains the payload of the new message received \n //this.strResponse = JSON.stringify( response.data.payload.Status__c ); \n this.responseBody = (JSON.stringify(response.data.payload.Response_Body__c));\n this.requestBody = (JSON.stringify(response.data.payload.Request_Body__c));\n this.statusCode = (JSON.stringify(response.data.payload.Status__c)); \n \n this.listOfLogs.push({\n response: this.responseBody,\n request: this.requestBody,\n status: this.statusCode\n });\n console.log(this.listOfLogs[0].status);\n\n \n }; \n \n // Invoke subscribe method of empApi. Pass reference to messageCallback \n subscribe( this.channelName, -1, messageCallback ).then(response => { \n // Response contains the subscription information on successful subscribe call \n console.log( 'Successfully subscribed to : ', JSON.stringify( response.channel ) ); \n this.subscription = response; \n this.toggleSubscribeButton( true ); \n }); \n }", "title": "" }, { "docid": "61bcf28d54a43f2225b58a9b87366820", "score": "0.54350215", "text": "function initiateSubscribe(clientObj) {\n this.__channels = {};\n var self = this;\n clientObj.subscribe('internalPing');\n clientObj.on('message', function(channelName, message) {\n if (channelName === 'internalPing') return; // this is our internal channel for ping\n if (typeof self.__channels[channelName] === 'undefined') return; // we have no channel.\n try {\n var data = JSON.parse(message);\n } catch (e) {\n data = message;\n }\n for (var i = 0; i < self.__channels[channelName].length; i++) {\n self.__channels[channelName][i](data);\n }\n });\n}", "title": "" }, { "docid": "08f4bf65ca69ac41c26cb9f9da4c1299", "score": "0.54319745", "text": "function initSubscribtions() {\n var sessionData = socket.handshake.session;\n\n socket.join('lang_' + sessionData.senderLanguage);\n serviceDistributor.addTranslationLanguage(sessionData.senderLanguage);\n console.info('client :: Client ' + sessionData.senderName + ' added to room lang_' + sessionData.senderLanguage);\n\n // Help session handling. If sender authenticated, it will be expected that in max configured waiting time any message arrives to preven client disconnection\n serviceDistributor.renewLastActivity();\n }", "title": "" }, { "docid": "8c3a4ff2d788b269a1dd48490010284d", "score": "0.54283035", "text": "init() {\n const websocket = new Gdax.WebsocketClient(this.EXCHANGES, this.GDAX_WS_URL, null, this.GDAX_WS_OPTIONS);\n this.interval = setInterval(() => this.sendUpdate(), this.UPDATE_INTERVAL);\n\n websocket.on('message', (data) => {\n if (data.type === 'snapshot') {\n this.handleSnapshot(data);\n this.sendUpdate();\n } else if (data.type === 'l2update') {\n this.handleUpdate(data);\n }\n });\n\n websocket.on('close', () => {\n clearInterval(this.interval);\n });\n }", "title": "" }, { "docid": "2ee3ae20662f9aad7b4a453d35e1f1a9", "score": "0.5420509", "text": "function subscribeToTimer (cb) {\n socket.on('position', (data) => cb(data));\n socket.emit('fleet_id', 'HELLO SUCKET');\n}", "title": "" }, { "docid": "e8fef9a3718965b6dd5032cfc8081432", "score": "0.54130375", "text": "function incoming(evt) {\n\t\tvar event = xmlToDom(evt.data);\n\t\tvar params = event.getElementsByTagName(\"params\");\n\n\t\t//console.log(evt.data);\n\t\t\n\t\t//find the channel and call the callback\n\t\tvar channel = getChannel(event);\n\t\tvar payload = getParam(params[0], \"payload\");\n\n\t\tif(channel === \"ping\") {\n\t\t\tconsole.log(\"<lightwsd>: server ping\");\n\t\t\theartbeat_received = true;\n\t\t\t\n\t\t\tif(heartbeats_missed > 0)\n\t\t\t\tstatusChange(\"connected\");\n\t\t\t\n\t\t\theartbeats_missed = 0;\n\t\t\tpong();\n\t\t} else {\n\t\t\tsubscription_callbacks[String(channel)](unescape(payload));\n\t\t}\n\t}", "title": "" } ]
2c31a6626b32de3480043bb5b69dc82e
Add a css class to body.
[ { "docid": "fc26f5ab575b54fa2e02297ca56fdb1a", "score": "0.0", "text": "function togglePauseMode(e) {\n if (e.code == \"KeyB\" || e.code == \"Period\") {\n toggleElement(\"#pause\");\n }\n\n if (e.code == \"KeyT\") {\n toggleElement(\"#header\");\n }\n\n if (e.code == \"KeyH\") {\n toggleElement(\"#help\");\n }\n\n if (e.code == \"KeyF\") {\n toggleFullScreen();\n }\n}", "title": "" } ]
[ { "docid": "ad1e66e42e2520fd01710c87bef2539a", "score": "0.77744234", "text": "function addBodyClass() {\n addClass(body, 'js');\n if(hasClass(body, 'page-index') ) {\n var bodyClasses = ['alfred-app','sports-digest-8-50','alton-convent-school'];\n var randomClass = Math.floor(Math.random()*bodyClasses.length);\n addClass(body, bodyClasses[randomClass]);\n }\n}", "title": "" }, { "docid": "42f6cfbc83185b99edcc4f90a6cc207a", "score": "0.70938444", "text": "function setBodyClass(){\n var source = $('[js-set-body-class]').last();\n var sourceClass = source.data(\"class\");\n var body = $('body');\n var bodyClasses = body.attr('class').split(\" \")\n var possibleClasses = [\"homepage\", \"page-dark\"]\n\n // console.log('sourceClass', sourceClass)\n // console.log('bodyClasses', bodyClasses)\n\n if ( source ){\n if ( bodyClasses.indexOf(sourceClass) === -1 ){\n body.addClass(sourceClass) // append new class if not present\n }\n // remove old\n $.each(bodyClasses, function(i, c){\n // remove if not a source and included in possibles\n if ( c !== sourceClass\n && possibleClasses.indexOf(c) !== - 1\n ){\n // console.log('removing', c)\n body.removeClass(c)\n }\n })\n\n }\n\n }", "title": "" }, { "docid": "20dfbba513f1b3c01c93d424275b8141", "score": "0.6851028", "text": "function setBodyClass() {\n var section = $(SECTION_ACTIVE_SEL);\n var slide = section.find(SLIDE_ACTIVE_SEL);\n var sectionAnchor = getAnchor(section);\n var slideAnchor = getAnchor(slide);\n var text = String(sectionAnchor);\n\n if (slide.length) {\n text = text + '-' + slideAnchor;\n } //changing slash for dash to make it a valid CSS style\n\n\n text = text.replace('/', '-').replace('#', ''); //removing previous anchor classes\n\n var classRe = new RegExp('\\\\b\\\\s?' + VIEWING_PREFIX + '-[^\\\\s]+\\\\b', \"g\");\n $body[0].className = $body[0].className.replace(classRe, ''); //adding the current anchor\n\n $body.addClass(VIEWING_PREFIX + '-' + text);\n }", "title": "" }, { "docid": "8d96de3796b634a28acf3e5649b23ac3", "score": "0.6768009", "text": "function setBodyClass(){\n var section = $(SECTION_ACTIVE_SEL);\n var slide = section.find(SLIDE_ACTIVE_SEL);\n\n var sectionAnchor = getAnchor(section);\n var slideAnchor = getAnchor(slide);\n\n var text = String(sectionAnchor);\n\n if(slide.length){\n text = text + '-' + slideAnchor;\n }\n\n //changing slash for dash to make it a valid CSS style\n text = text.replace('/', '-').replace('#','');\n\n //removing previous anchor classes\n var classRe = new RegExp('\\\\b\\\\s?' + VIEWING_PREFIX + '-[^\\\\s]+\\\\b', \"g\");\n $body[0].className = $body[0].className.replace(classRe, '');\n\n //adding the current anchor\n $body.addClass(VIEWING_PREFIX + '-' + text);\n }", "title": "" }, { "docid": "8d96de3796b634a28acf3e5649b23ac3", "score": "0.6768009", "text": "function setBodyClass(){\n var section = $(SECTION_ACTIVE_SEL);\n var slide = section.find(SLIDE_ACTIVE_SEL);\n\n var sectionAnchor = getAnchor(section);\n var slideAnchor = getAnchor(slide);\n\n var text = String(sectionAnchor);\n\n if(slide.length){\n text = text + '-' + slideAnchor;\n }\n\n //changing slash for dash to make it a valid CSS style\n text = text.replace('/', '-').replace('#','');\n\n //removing previous anchor classes\n var classRe = new RegExp('\\\\b\\\\s?' + VIEWING_PREFIX + '-[^\\\\s]+\\\\b', \"g\");\n $body[0].className = $body[0].className.replace(classRe, '');\n\n //adding the current anchor\n $body.addClass(VIEWING_PREFIX + '-' + text);\n }", "title": "" }, { "docid": "8d96de3796b634a28acf3e5649b23ac3", "score": "0.6768009", "text": "function setBodyClass(){\n var section = $(SECTION_ACTIVE_SEL);\n var slide = section.find(SLIDE_ACTIVE_SEL);\n\n var sectionAnchor = getAnchor(section);\n var slideAnchor = getAnchor(slide);\n\n var text = String(sectionAnchor);\n\n if(slide.length){\n text = text + '-' + slideAnchor;\n }\n\n //changing slash for dash to make it a valid CSS style\n text = text.replace('/', '-').replace('#','');\n\n //removing previous anchor classes\n var classRe = new RegExp('\\\\b\\\\s?' + VIEWING_PREFIX + '-[^\\\\s]+\\\\b', \"g\");\n $body[0].className = $body[0].className.replace(classRe, '');\n\n //adding the current anchor\n $body.addClass(VIEWING_PREFIX + '-' + text);\n }", "title": "" }, { "docid": "8d96de3796b634a28acf3e5649b23ac3", "score": "0.6768009", "text": "function setBodyClass(){\n var section = $(SECTION_ACTIVE_SEL);\n var slide = section.find(SLIDE_ACTIVE_SEL);\n\n var sectionAnchor = getAnchor(section);\n var slideAnchor = getAnchor(slide);\n\n var text = String(sectionAnchor);\n\n if(slide.length){\n text = text + '-' + slideAnchor;\n }\n\n //changing slash for dash to make it a valid CSS style\n text = text.replace('/', '-').replace('#','');\n\n //removing previous anchor classes\n var classRe = new RegExp('\\\\b\\\\s?' + VIEWING_PREFIX + '-[^\\\\s]+\\\\b', \"g\");\n $body[0].className = $body[0].className.replace(classRe, '');\n\n //adding the current anchor\n $body.addClass(VIEWING_PREFIX + '-' + text);\n }", "title": "" }, { "docid": "a0f938313e103ab2be9a4f19b7aee875", "score": "0.676423", "text": "function setBodyClass(){\n var section = $(SECTION_ACTIVE_SEL)[0];\n var slide = $(SLIDE_ACTIVE_SEL, section)[0];\n\n var sectionAnchor = getAnchor(section);\n var slideAnchor = getAnchor(slide);\n\n var text = String(sectionAnchor);\n\n if(slide){\n text = text + '-' + slideAnchor;\n }\n\n //changing slash for dash to make it a valid CSS style\n text = text.replace('/', '-').replace('#','');\n\n //removing previous anchor classes\n var classRe = new RegExp('\\\\b\\\\s?' + VIEWING_PREFIX + '-[^\\\\s]+\\\\b', \"g\");\n $body.className = $body.className.replace(classRe, '');\n\n //adding the current anchor\n addClass($body, VIEWING_PREFIX + '-' + text);\n }", "title": "" }, { "docid": "a0f938313e103ab2be9a4f19b7aee875", "score": "0.676423", "text": "function setBodyClass(){\n var section = $(SECTION_ACTIVE_SEL)[0];\n var slide = $(SLIDE_ACTIVE_SEL, section)[0];\n\n var sectionAnchor = getAnchor(section);\n var slideAnchor = getAnchor(slide);\n\n var text = String(sectionAnchor);\n\n if(slide){\n text = text + '-' + slideAnchor;\n }\n\n //changing slash for dash to make it a valid CSS style\n text = text.replace('/', '-').replace('#','');\n\n //removing previous anchor classes\n var classRe = new RegExp('\\\\b\\\\s?' + VIEWING_PREFIX + '-[^\\\\s]+\\\\b', \"g\");\n $body.className = $body.className.replace(classRe, '');\n\n //adding the current anchor\n addClass($body, VIEWING_PREFIX + '-' + text);\n }", "title": "" }, { "docid": "98ff6155fed5016f66b22e76ef095e8c", "score": "0.67609566", "text": "function setClass(cls, condition) {\n if (condition === true) {\n document.body.classList.add(cls);\n } else {\n document.body.classList.remove(cls);\n }\n }", "title": "" }, { "docid": "f81cfdda0bd69a7be4f6004af34e8aa8", "score": "0.6720477", "text": "function setBodyClass(){\n var section = $(SECTION_ACTIVE_SEL);\n var slide = section.find(SLIDE_ACTIVE_SEL);\n\n var sectionAnchor = getAnchor(section);\n var slideAnchor = getAnchor(slide);\n\n var sectionIndex = section.index(SECTION_SEL);\n\n var text = String(sectionAnchor);\n\n if(slide.length){\n text = text + '-' + slideAnchor;\n }\n\n //changing slash for dash to make it a valid CSS style\n text = text.replace('/', '-').replace('#','');\n\n //removing previous anchor classes\n var classRe = new RegExp('\\\\b\\\\s?' + VIEWING_PREFIX + '-[^\\\\s]+\\\\b', \"g\");\n $body[0].className = $body[0].className.replace(classRe, '');\n\n //adding the current anchor\n $body.addClass(VIEWING_PREFIX + '-' + text);\n }", "title": "" }, { "docid": "dd8dfaf48f2be4451e0d4e47245df3d8", "score": "0.6699144", "text": "function setBodyClass(){\n var section = $(SECTION_ACTIVE_SEL)[0];\n var slide = $(SLIDE_ACTIVE_SEL, section)[0];\n\n var sectionAnchor = getAnchor(section);\n var slideAnchor = getAnchor(slide);\n\n var text = String(sectionAnchor);\n\n if(slide){\n text = text + '-' + slideAnchor;\n }\n\n //changing slash for dash to make it a valid CSS style\n text = text.replace('/', '-').replace('#','');\n\n //removing previous anchor classes\n var classRe = new RegExp('\\\\b\\\\s?' + VIEWING_PREFIX + '-[^\\\\s]+\\\\b', \"g\");\n $body.className = $body.className.replace(classRe, '');\n\n //adding the current anchor\n addClass($body, VIEWING_PREFIX + '-' + text);\n }", "title": "" }, { "docid": "fb9d16f8c999294aaec30d6fcee87b7e", "score": "0.66963416", "text": "function setBodyClass(){\r\n var section = $(SECTION_ACTIVE_SEL);\r\n var slide = section.find(SLIDE_ACTIVE_SEL);\r\n\r\n var sectionAnchor = getAnchor(section);\r\n var slideAnchor = getAnchor(slide);\r\n\r\n var text = String(sectionAnchor);\r\n\r\n if(slide.length){\r\n text = text + '-' + slideAnchor;\r\n }\r\n\r\n //changing slash for dash to make it a valid CSS style\r\n text = text.replace('/', '-').replace('#','');\r\n\r\n //removing previous anchor classes\r\n var classRe = new RegExp('\\\\b\\\\s?' + VIEWING_PREFIX + '-[^\\\\s]+\\\\b', \"g\");\r\n $body[0].className = $body[0].className.replace(classRe, '');\r\n\r\n //adding the current anchor\r\n $body.addClass(VIEWING_PREFIX + '-' + text);\r\n }", "title": "" }, { "docid": "fb9d16f8c999294aaec30d6fcee87b7e", "score": "0.66963416", "text": "function setBodyClass(){\r\n var section = $(SECTION_ACTIVE_SEL);\r\n var slide = section.find(SLIDE_ACTIVE_SEL);\r\n\r\n var sectionAnchor = getAnchor(section);\r\n var slideAnchor = getAnchor(slide);\r\n\r\n var text = String(sectionAnchor);\r\n\r\n if(slide.length){\r\n text = text + '-' + slideAnchor;\r\n }\r\n\r\n //changing slash for dash to make it a valid CSS style\r\n text = text.replace('/', '-').replace('#','');\r\n\r\n //removing previous anchor classes\r\n var classRe = new RegExp('\\\\b\\\\s?' + VIEWING_PREFIX + '-[^\\\\s]+\\\\b', \"g\");\r\n $body[0].className = $body[0].className.replace(classRe, '');\r\n\r\n //adding the current anchor\r\n $body.addClass(VIEWING_PREFIX + '-' + text);\r\n }", "title": "" }, { "docid": "fb9d16f8c999294aaec30d6fcee87b7e", "score": "0.66963416", "text": "function setBodyClass(){\r\n var section = $(SECTION_ACTIVE_SEL);\r\n var slide = section.find(SLIDE_ACTIVE_SEL);\r\n\r\n var sectionAnchor = getAnchor(section);\r\n var slideAnchor = getAnchor(slide);\r\n\r\n var text = String(sectionAnchor);\r\n\r\n if(slide.length){\r\n text = text + '-' + slideAnchor;\r\n }\r\n\r\n //changing slash for dash to make it a valid CSS style\r\n text = text.replace('/', '-').replace('#','');\r\n\r\n //removing previous anchor classes\r\n var classRe = new RegExp('\\\\b\\\\s?' + VIEWING_PREFIX + '-[^\\\\s]+\\\\b', \"g\");\r\n $body[0].className = $body[0].className.replace(classRe, '');\r\n\r\n //adding the current anchor\r\n $body.addClass(VIEWING_PREFIX + '-' + text);\r\n }", "title": "" }, { "docid": "fb9d16f8c999294aaec30d6fcee87b7e", "score": "0.66963416", "text": "function setBodyClass(){\r\n var section = $(SECTION_ACTIVE_SEL);\r\n var slide = section.find(SLIDE_ACTIVE_SEL);\r\n\r\n var sectionAnchor = getAnchor(section);\r\n var slideAnchor = getAnchor(slide);\r\n\r\n var text = String(sectionAnchor);\r\n\r\n if(slide.length){\r\n text = text + '-' + slideAnchor;\r\n }\r\n\r\n //changing slash for dash to make it a valid CSS style\r\n text = text.replace('/', '-').replace('#','');\r\n\r\n //removing previous anchor classes\r\n var classRe = new RegExp('\\\\b\\\\s?' + VIEWING_PREFIX + '-[^\\\\s]+\\\\b', \"g\");\r\n $body[0].className = $body[0].className.replace(classRe, '');\r\n\r\n //adding the current anchor\r\n $body.addClass(VIEWING_PREFIX + '-' + text);\r\n }", "title": "" }, { "docid": "9aa2d8d012206b46f31876d7ebaede5b", "score": "0.66483355", "text": "function setBodyClass(){\r\n var section = $(SECTION_ACTIVE_SEL);\r\n var slide = section.find(SLIDE_ACTIVE_SEL);\r\n\r\n var sectionAnchor = getAnchor(section);\r\n var slideAnchor = getAnchor(slide);\r\n\r\n var sectionIndex = section.index(SECTION_SEL);\r\n\r\n var text = String(sectionAnchor);\r\n\r\n if(slide.length){\r\n text = text + '-' + slideAnchor;\r\n }\r\n\r\n //changing slash for dash to make it a valid CSS style\r\n text = text.replace('/', '-').replace('#','');\r\n\r\n //removing previous anchor classes\r\n var classRe = new RegExp('\\\\b\\\\s?' + VIEWING_PREFIX + '-[^\\\\s]+\\\\b', \"g\");\r\n $body[0].className = $body[0].className.replace(classRe, '');\r\n\r\n //adding the current anchor\r\n $body.addClass(VIEWING_PREFIX + '-' + text);\r\n }", "title": "" }, { "docid": "e96650ad7803dca53bc3aabf0790bf12", "score": "0.6602607", "text": "function setBodyClass(text) {\n\t\t\t\t//changing slash for dash to make it a valid CSS style\n\t\t\t\ttext = text.replace('/', '-').replace('#', '');\n\n\t\t\t\t//removing previous anchor classes\n\t\t\t\t$(\"body\")[0].className = $(\"body\")[0].className.replace(/\\b\\s?fp-viewing-[^\\s]+\\b/g, '');\n\n\t\t\t\t//adding the current anchor\n\t\t\t\t$(\"body\").addClass(\"fp-viewing-\" + text);\n\t\t\t}", "title": "" }, { "docid": "caff9958c66f36d2768375b84de4c308", "score": "0.6538247", "text": "async element(element) {\n element.setAttribute(\"class\", bodyColorClass)\n }", "title": "" }, { "docid": "e77718c1d6fd4cf50166852df73c3f2d", "score": "0.6538144", "text": "function setBodyCSS() {\n\n jQuery('html').css({\n overflow: jQuery('.modal').hasClass(_settings.elmTargetClass) == false ? '' : 'hidden',\n width: jQuery('.modal').hasClass(_settings.elmTargetClass) == false ? '' : '100%',\n });\n\n if ( jQuery('.modal').hasClass(_settings.elmTargetClass) == true ) {\n jQuery('body').addClass(_settings.elmTargetClass);\n } else {\n jQuery('body').removeClass(_settings.elmTargetClass);\n }\n }", "title": "" }, { "docid": "92111411d66dd90b5fae32a6146bdf5c", "score": "0.6476689", "text": "function setBodyClass(){\r\n var section = $('.ms-left .ms-section.active');\r\n var sectionAnchor = section.data('anchor');\r\n var sectionIndex = section.index();\r\n\r\n var text = String(sectionIndex);\r\n\r\n if(options.anchors.length){\r\n text = sectionAnchor;\r\n }\r\n\r\n //changing slash for dash to make it a valid CSS style\r\n text = text.replace('/', '-').replace('#','');\r\n\r\n //removing previous anchor classes\r\n var classRe = new RegExp('\\\\b\\\\s?' + 'ms-viewing' + '-[^\\\\s]+\\\\b', \"g\");\r\n $('body')[0].className = $('body')[0].className.replace(classRe, '');\r\n\r\n //adding the current anchor\r\n $('body').addClass('ms-viewing-' + text);\r\n }", "title": "" }, { "docid": "00baeba68adcb24f4f2ad13baee0ee02", "score": "0.6448174", "text": "function GFG_Fun() {\n document.getElementById('body').classList.add(\"newClass\");\n console.log(\"Cursor is removed from body!\");\n}", "title": "" }, { "docid": "f6c598a3318284a2867b185fc88652af", "score": "0.64347005", "text": "setBody() {\n document.body.className = this.state.darkmode ? 'dark' : 'light'\n }", "title": "" }, { "docid": "fcd735abec925328b2f4eba2fca61474", "score": "0.63653284", "text": "function toggleBodyClass(classToToggle) {\n var bodyClasses = docBody.className;\n if ( bodyClasses && (bodyClasses.indexOf(classToToggle) >= 0) ) {\n bodyClasses = bodyClasses.replace(classToToggle, '');\n } else {\n bodyClasses += ' ' + classToToggle;\n }\n docBody.className = bodyClasses.trim();\n}", "title": "" }, { "docid": "bc495656c6de8f390f9eedeb0340341c", "score": "0.62802714", "text": "_setBodyClass() {\n\t\tif ( this.pan.distance > this.options.distanceToRefresh ) {\n\t\t\tthis.bodyClass.add( 'ptr-refresh' );\n\t\t} else {\n\t\t\tthis.bodyClass.remove( 'ptr-refresh' );\n\t\t}\n\t}", "title": "" }, { "docid": "d22a108ba2c857b83a52779ab1b86173", "score": "0.62131774", "text": "function syncBodyClassName(isDark) {\n body.classList.add(isDark ? classNames.dark : classNames.light);\n body.classList.remove(isDark ? classNames.light : classNames.dark);\n}", "title": "" }, { "docid": "b946b3499082eedf0d30a6d8ae47ff5f", "score": "0.61494285", "text": "function setBodyLoggedIn() {\n document.body.className = null;\n}", "title": "" }, { "docid": "ccd706a823ca6ba8efa146d610a7bb6e", "score": "0.61454093", "text": "betslipBodyClass() {\n\t\tconst body = document.body;\n\t\tconst betslipActive = this.isBetslipActive();\n\t\tif(betslipActive) {\n\t\t\t$(body).addClass('betslip-is-active');\n\t\t} else if (!betslipActive) {\n\t\t\t$(body).removeClass('betslip-is-active');\n\t\t}\n\t}", "title": "" }, { "docid": "a6f8b0941310e411988ac1e2e4389f88", "score": "0.61421216", "text": "function syncBodyClassName(isDark, document) {\n var body = getBody(document);\n body.classList.add(isDark ? classNames.dark : classNames.light);\n body.classList.remove(isDark ? classNames.light : classNames.dark);\n}", "title": "" }, { "docid": "07c5045ac45fcbcad0d44b8d892cb82e", "score": "0.60988396", "text": "function toggleScrollBody(){\t\t\n\t\t\tbody.attr(\"class\",bodyscroll);\n\t}", "title": "" }, { "docid": "200862880ef5fc9dba72b4f2825dd67e", "score": "0.60847664", "text": "function changeBackground(classname){\n\t\t\tif(classname === undefined){\n\t\t\t\tdocument.body.removeAttribute(\"class\");\n\t\t\t} else {\n\t\t\t\tdocument.body.className = classname;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "343bdfddb8fa96e80e781670f8a625a1", "score": "0.6071704", "text": "function syncBodyClassName(isDark) {\n var body = getBody();\n body.classList.add(isDark ? classNames.dark : classNames.light);\n body.classList.remove(isDark ? classNames.light : classNames.dark);\n}", "title": "" }, { "docid": "6b96e05692656fb0b6b9bc0d0902471a", "score": "0.6063485", "text": "addClass(className) {\n let currentClassNames = null\n if (!this.hasClass(className)) {\n currentClassNames = this.documentElement.className.replace(/^\\s+|\\s+$/g, '')\n this.documentElement.className = currentClassNames + ' ' + className\n }\n }", "title": "" }, { "docid": "b21b84b2fe630ffbaf6223a84d8f4e37", "score": "0.59607995", "text": "function cssTester(){\n var HTMLclasses= $('html')[0].classList;\n var wrap = document.createElement('div');\n wrap.classList.add('tester_classes');\n for (var i = 0; HTMLclasses.length > i; i++) {\n var sect = document.createElement('div');\n sect.innerHTML = HTMLclasses[i];\n wrap.appendChild(sect);\n };\n document.body.appendChild(wrap);\n }", "title": "" }, { "docid": "2519214e22b459293254c45c7c8c9ba2", "score": "0.59445786", "text": "function addNodeToBody(type, className, styles) {\n var elem = state.document.createElement(type);\n elem.className = className;\n\n if (styles) {\n for (var key in styles) {\n if (styles.hasOwnProperty(key)) {\n elem.style[key] = styles[key];\n }\n }\n }\n\n return state.body.appendChild(elem);\n }", "title": "" }, { "docid": "3071dcba64211dd5174fe4f204c05828", "score": "0.5911965", "text": "static lockBody(lock = true) {\n if (lock) {\n document.body.classList.add(styles.bodyFixed)\n } else {\n document.body.classList.remove(styles.bodyFixed)\n }\n }", "title": "" }, { "docid": "7d167590a956086a02f8e684a07b8310", "score": "0.59000105", "text": "addClass(className) {\n this._updateClass(className, true)\n }", "title": "" }, { "docid": "d628dc010fc37a02e399bd7e54bce2a1", "score": "0.5875912", "text": "function clearBodyPageClasses(){\n var element = $(\"body\");\n var classes = element.attr('class').split(/\\s+/);\n\n var pattern = /^page-/;\n\n for(var i = 0; i < classes.length; i++){\n var className = classes[i];\n\n if(className.match(pattern)){\n element.removeClass(className);\n }\n }\n }", "title": "" }, { "docid": "2c7f12b84cacfbc3358b391a04cb54aa", "score": "0.58445984", "text": "function addClass (ele, cls) {\n ele.className += \" \" + cls;\n}", "title": "" }, { "docid": "96bedf1c02da8583afb830152d409033", "score": "0.58296174", "text": "updateCssVariables() {\n this.replaceCss(this.formCss());\n\n let str = $(\"body\").attr(\"class\").replace(/gui-skin-[^ ]+/g, \"\") +\n \" gui-skin-\" + this.skin.name + \" \";\n\n $(\"body\").attr(\"class\", str);\n }", "title": "" }, { "docid": "7ea1c15c3db0a49fe787871b9e8fdf00", "score": "0.5824865", "text": "function addClass(element, class_name){element.className += ' ' + class_name;}", "title": "" }, { "docid": "24d1d7d0a23bbf1cdf8e4217052d6e2e", "score": "0.58009636", "text": "function bg_change(next) {\n document.body.className = '';\n document.body.classList.add('is-' + next);\n}", "title": "" }, { "docid": "5b1b4746a51b9de432273f560e9e09b4", "score": "0.57891697", "text": "function addCategoryPageClass(){\n if( $(\".page\").hasClass('category-page') ){\n $(\"body\").addClass(\"CategoryPage\");\n }\n }", "title": "" }, { "docid": "49a075eb26ab64b027fdf19c8ae49818", "score": "0.57803583", "text": "function removeClassAndClearBody(selector, className) {\n $(selector).removeClass(className)\n .html('');\n}", "title": "" }, { "docid": "3fdad896254b62d46285884858aca294", "score": "0.5757861", "text": "function addClass( e, newClass ) {\n e.className += ' ' + newClass;\n }", "title": "" }, { "docid": "07d8e0100e20b1f28c1dfbaec2d6064f", "score": "0.575005", "text": "function addClass()\n {\n if(flags.currentClass)\n {\n classes.push({\n name: state.className,\n subject: state.subject,\n ...state.classData\n });\n state.classData = {};\n flags.currentClass = false;\n }\n }", "title": "" }, { "docid": "28dbfdad2bd24e10cba86149ab7522f9", "score": "0.57488656", "text": "updateTheme() {\n if (this.isLightTheme()) {\n document.body.classList.remove(\"ext-body-dark\");\n document.body.classList.add(\"ext-body-light\");\n } else {\n document.body.classList.remove(\"ext-body-light\");\n document.body.classList.add(\"ext-body-dark\");\n }\n }", "title": "" }, { "docid": "6af78af8bafcfe67ce9c36f6f7fcef2a", "score": "0.57454085", "text": "function _setOSClassNameToBody() {\n\t\t\t\t// Set a body attribute for detecting and styling according the OS\n\t\t\t\tvar osName = '';\n\t\t\t\tif (navigator.appVersion.indexOf('Win') !== -1) {\n\t\t\t\t\tosName = 'windows';\n\t\t\t\t}\n\t\t\t\tif (navigator.appVersion.indexOf('Mac') !== -1) {\n\t\t\t\t\tosName = 'mac';\n\t\t\t\t}\n\t\t\t\tif (navigator.appVersion.indexOf('Linux') !== -1) {\n\t\t\t\t\tosName = 'linux';\n\t\t\t\t}\n\n\t\t\t\tdocument.querySelector('body').setAttribute('os', osName);\n\t\t\t}", "title": "" }, { "docid": "ed34443fbdc6b17e932bbf2f94bea63b", "score": "0.57420784", "text": "function _setOSClassNameToBody() {\n // Set a body attribute for detecting and styling according the OS\n var osName = '';\n if (navigator.appVersion.indexOf('Win') !== -1) {\n osName = 'windows';\n }\n if (navigator.appVersion.indexOf('Mac') !== -1) {\n osName = 'mac';\n }\n if (navigator.appVersion.indexOf('Linux') !== -1) {\n osName = 'linux';\n }\n\n document.querySelector('body').setAttribute('os', osName);\n }", "title": "" }, { "docid": "d9222f519087996d235cea5bcae07f11", "score": "0.5716526", "text": "function addClass(theClass) { if (this.className != '') { this.className += ' ' + theClass; } else { this.className = theClass; } }", "title": "" }, { "docid": "35b134e64f0ca2b899740f165048590f", "score": "0.57155865", "text": "function changeClassStyles() {\n body.classList.toggle('new--body');\n wrapH.classList.toggle('wrapH--new--style_property'); //меняем стили главной обертки\n}", "title": "" }, { "docid": "437e5ae10742013c221e19b1d54ee9f9", "score": "0.5714626", "text": "_applyBodyHighContrastModeCssClasses() {\n if (this._platform.isBrowser && this._document.body) {\n const bodyClasses = this._document.body.classList;\n // IE11 doesn't support `classList` operations with multiple arguments\n bodyClasses.remove(HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS);\n bodyClasses.remove(BLACK_ON_WHITE_CSS_CLASS);\n bodyClasses.remove(WHITE_ON_BLACK_CSS_CLASS);\n const mode = this.getHighContrastMode();\n if (mode === 1 /* BLACK_ON_WHITE */) {\n bodyClasses.add(HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS);\n bodyClasses.add(BLACK_ON_WHITE_CSS_CLASS);\n }\n else if (mode === 2 /* WHITE_ON_BLACK */) {\n bodyClasses.add(HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS);\n bodyClasses.add(WHITE_ON_BLACK_CSS_CLASS);\n }\n }\n }", "title": "" }, { "docid": "adfa3ffd95636be95fa4cc28900041a4", "score": "0.5709221", "text": "function add_class(element, class_name)\r\n{\r\n\tif (has_class(element, class_name)) {\r\n\t\treturn;\r\n\t}\r\n\telement.className += (element.className == \"\" ? \"\" : \" \") + class_name;\r\n}", "title": "" }, { "docid": "c3094cceefcd2661afe91a19d7e3812c", "score": "0.5708513", "text": "function addClass(el,cls){/* istanbul ignore else */if(el.classList){if(cls.indexOf(' ')>-1){cls.split(/\\s+/).forEach(function(c){return el.classList.add(c);});}else{el.classList.add(cls);}}else{var cur=' '+el.getAttribute('class')+' ';if(cur.indexOf(' '+cls+' ')<0){el.setAttribute('class',(cur+cls).trim());}}}", "title": "" }, { "docid": "0c501055a1d2dd36904f694781288474", "score": "0.5707028", "text": "function addSearchPageClass(){\n if( $(\".page\").hasClass('search-page') ){\n $(\"body\").addClass(\"SearchPage\");\n }\n }", "title": "" }, { "docid": "56018373a5d921132e1037b9b0d3df2e", "score": "0.56976473", "text": "function addClass(className) {\n\t\t\tlater(function (){\n\t\t\t\tscene.node.addClass(className);\n\t\t\t}, 1);\n\t\t}", "title": "" }, { "docid": "8e972ba36b98f500155c19cab96c7003", "score": "0.56924886", "text": "function changeTheme(theme) {\n document.body.className = theme;\n}", "title": "" }, { "docid": "c5b5e12eb8aa4cd63669b728243ceb57", "score": "0.56910586", "text": "function addClass(className) {\n\t\t\tlater(function (){\n\t\t\t\telement.node.addClass(className);\n\t\t\t}, 1);\n\t\t}", "title": "" }, { "docid": "c1290ea74d99f256980470f1dd639a27", "score": "0.56823224", "text": "_applyBodyHighContrastModeCssClasses() {\n if (!this._hasCheckedHighContrastMode && this._platform.isBrowser && this._document.body) {\n const bodyClasses = this._document.body.classList;\n // IE11 doesn't support `classList` operations with multiple arguments\n bodyClasses.remove(HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS);\n bodyClasses.remove(BLACK_ON_WHITE_CSS_CLASS);\n bodyClasses.remove(WHITE_ON_BLACK_CSS_CLASS);\n this._hasCheckedHighContrastMode = true;\n const mode = this.getHighContrastMode();\n if (mode === 1 /* BLACK_ON_WHITE */) {\n bodyClasses.add(HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS);\n bodyClasses.add(BLACK_ON_WHITE_CSS_CLASS);\n }\n else if (mode === 2 /* WHITE_ON_BLACK */) {\n bodyClasses.add(HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS);\n bodyClasses.add(WHITE_ON_BLACK_CSS_CLASS);\n }\n }\n }", "title": "" }, { "docid": "134941909b8b075ee12a53618cafb669", "score": "0.56789714", "text": "function addClass(el, klass) {\n el.classList.add(klass);\n}", "title": "" }, { "docid": "7408666c11acc0487ac242a0b2dc5d59", "score": "0.5678274", "text": "function loadCSS( path, fn, scope ) {\n $('body').attr('class',path);\n fn.call(window);\n}", "title": "" }, { "docid": "cd8a8052f6916f738e7d349d6ecc6573", "score": "0.5669055", "text": "_setClasses() {\n // add default class for this component\n if (!this.classList.contains('panel')) {\n this.classList.add('panel');\n }\n\n let hasClass = false;\n this._classes.context.classes.forEach((clazz) => {\n hasClass = hasClass || this.classList.contains(clazz);\n });\n\n if (!hasClass) {\n this.classList.add(this._classes.context.default);\n }\n }", "title": "" }, { "docid": "fe6145012aad6b44689f89e1c60a0466", "score": "0.56556386", "text": "function addClass(cls) {\n container.classList.add(\"pull-to-refresh--\" + cls);\n }", "title": "" }, { "docid": "592a6091dc4fc4802db1dd5c23d0d615", "score": "0.565521", "text": "function changeBackground(theme)\n {\n document.body.className = theme ;\n }", "title": "" }, { "docid": "025943ba5225f5ce5d5d43f5dd06ea7f", "score": "0.56472087", "text": "function addCSS ( css ) { \n \n // detect if the page is loaded; if it isn't, then make it run when the page is loaded\n if ( document.addEventListener ) {\n \n // If the head element doesn't exist, create it and insert it into the DOM tree\n if ( !document.getElementsByTagName('head').length ) {\n var new_head = document.createElement('head'),\n root = document.getElementsByTagName('html')[0],\n children = root.childNodes,\n firstChild = children.length ? children[0] : false;\n\n if (firstChild) firstChild.parentNode.insertBefore(new_head, firstChild);\n else root.appendChild(new_head);\n }\n\n // create the style tag and put the contents of the \"css\" parameter into the element \n var head = document.getElementsByTagName('head')[0],\n style_tag = document.createElement('style');\n\n style_tag.setAttribute('type', 'text/css');\n style_tag.appendChild(document.createTextNode(css));\n\n // append the style element to the head element\n head.appendChild(style_tag)\n } else addEventListener ('DOMContentLoaded', addCSS(css), false);\n }", "title": "" }, { "docid": "9f266eba4bae5fbf67e5478c8f6eef1c", "score": "0.5634677", "text": "function elementAddClass(el,cl){var c=el.className;if(!c)c='';if(!elementHasClass(el,cl))c+=((c.length>0)?' ':'')+cl;el.className=c;}", "title": "" }, { "docid": "cac79bd2c2d3db39f7fdf1971ae8533d", "score": "0.5606989", "text": "function add_css() {\n var style = (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.element)(\"style\");\n style.id = \"svelte-g5yfje-style\";\n style.textContent = \"main.svelte-g5yfje{margin:0 auto;min-width:620px}.weekday.svelte-g5yfje{width:78px;font-size:1.2rem;float:left;text-align:center;margin:5px 0px}\";\n (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.append)(document.head, style);\n}", "title": "" }, { "docid": "1ed5dcb62cf999b0629cfb6ba16dab5f", "score": "0.56008446", "text": "function addClass(el, cl) {\n el.className += ' ' + cl;\n}", "title": "" }, { "docid": "9a9f05a33ff16be0221a1c94ba427347", "score": "0.5590835", "text": "function add (elem, cls) {\n \t\telem.classList.add(cls);\n \t}", "title": "" }, { "docid": "f2ad1667e3285adc44c02f116ae80b07", "score": "0.5584031", "text": "function setClasses( classes ) {\n var className = docElement.className;\n var regex;\n var classPrefix = Modernizr._config.classPrefix || '';\n\n // Change `no-js` to `js` (we do this regardles of the `enableClasses`\n // option)\n // Handle classPrefix on this too\n var reJS = new RegExp('(^|\\\\s)'+classPrefix+'no-js(\\\\s|$)');\n className = className.replace(reJS, '$1'+classPrefix+'js$2');\n\n if(Modernizr._config.enableClasses) {\n // Add the new classes\n className += ' ' + classPrefix + classes.join(' ' + classPrefix);\n docElement.className = className;\n }\n\n }", "title": "" }, { "docid": "f2ad1667e3285adc44c02f116ae80b07", "score": "0.5584031", "text": "function setClasses( classes ) {\n var className = docElement.className;\n var regex;\n var classPrefix = Modernizr._config.classPrefix || '';\n\n // Change `no-js` to `js` (we do this regardles of the `enableClasses`\n // option)\n // Handle classPrefix on this too\n var reJS = new RegExp('(^|\\\\s)'+classPrefix+'no-js(\\\\s|$)');\n className = className.replace(reJS, '$1'+classPrefix+'js$2');\n\n if(Modernizr._config.enableClasses) {\n // Add the new classes\n className += ' ' + classPrefix + classes.join(' ' + classPrefix);\n docElement.className = className;\n }\n\n }", "title": "" }, { "docid": "f2ad1667e3285adc44c02f116ae80b07", "score": "0.5584031", "text": "function setClasses( classes ) {\n var className = docElement.className;\n var regex;\n var classPrefix = Modernizr._config.classPrefix || '';\n\n // Change `no-js` to `js` (we do this regardles of the `enableClasses`\n // option)\n // Handle classPrefix on this too\n var reJS = new RegExp('(^|\\\\s)'+classPrefix+'no-js(\\\\s|$)');\n className = className.replace(reJS, '$1'+classPrefix+'js$2');\n\n if(Modernizr._config.enableClasses) {\n // Add the new classes\n className += ' ' + classPrefix + classes.join(' ' + classPrefix);\n docElement.className = className;\n }\n\n }", "title": "" }, { "docid": "f2ad1667e3285adc44c02f116ae80b07", "score": "0.5584031", "text": "function setClasses( classes ) {\n var className = docElement.className;\n var regex;\n var classPrefix = Modernizr._config.classPrefix || '';\n\n // Change `no-js` to `js` (we do this regardles of the `enableClasses`\n // option)\n // Handle classPrefix on this too\n var reJS = new RegExp('(^|\\\\s)'+classPrefix+'no-js(\\\\s|$)');\n className = className.replace(reJS, '$1'+classPrefix+'js$2');\n\n if(Modernizr._config.enableClasses) {\n // Add the new classes\n className += ' ' + classPrefix + classes.join(' ' + classPrefix);\n docElement.className = className;\n }\n\n }", "title": "" }, { "docid": "f2ad1667e3285adc44c02f116ae80b07", "score": "0.5584031", "text": "function setClasses( classes ) {\n var className = docElement.className;\n var regex;\n var classPrefix = Modernizr._config.classPrefix || '';\n\n // Change `no-js` to `js` (we do this regardles of the `enableClasses`\n // option)\n // Handle classPrefix on this too\n var reJS = new RegExp('(^|\\\\s)'+classPrefix+'no-js(\\\\s|$)');\n className = className.replace(reJS, '$1'+classPrefix+'js$2');\n\n if(Modernizr._config.enableClasses) {\n // Add the new classes\n className += ' ' + classPrefix + classes.join(' ' + classPrefix);\n docElement.className = className;\n }\n\n }", "title": "" }, { "docid": "36ae39654012a83d5b20ae94c82ee607", "score": "0.55632114", "text": "function applyBodyClassesOnSwatch()\n{\n\tvar swatchListArr = createSwatchDivs(\"ui-body\", \".dw_swatchContainer\");\n\t$(\".dw_swatchContainer .dw_swatch\").unbind('mouseenter mouseleave');\n\t$(\".dw_swatchContainer .dw_swatch\").removeClass().addClass(\"dw_swatch\");\n\t$(\".dw_swatchContainer .dw_swatch\").each(function(i){\n\t\t\tvar swatchId =i%swatchListArr.length; \n\t\t\t$(this).addClass(\"ui-body-\" + swatchListArr[swatchId]);\t\n\t\t\t});\n}", "title": "" }, { "docid": "a5bd3eea32a35ae254e08b762b7cf641", "score": "0.55619806", "text": "function SetClass (id, c) {\r\n Id (id).setAttribute ('class', c);\r\n}", "title": "" }, { "docid": "c095e1f7efdb0aceb4f7da2024cbb5fb", "score": "0.5553676", "text": "function setClasses( classes ) {\n var className = docElement.className;\n var classPrefix = Modernizr._config.classPrefix || '';\n\n // Change `no-js` to `js` (we do this regardles of the `enableClasses`\n // option)\n // Handle classPrefix on this too\n var reJS = new RegExp('(^|\\\\s)'+classPrefix+'no-js(\\\\s|$)');\n className = className.replace(reJS, '$1'+classPrefix+'js$2');\n\n if(Modernizr._config.enableClasses) {\n // Add the new classes\n className += ' ' + classPrefix + classes.join(' ' + classPrefix);\n docElement.className = className;\n }\n\n }", "title": "" }, { "docid": "5c7647e2383378dcf60152346baebccf", "score": "0.5553613", "text": "function showModal () {\n document.body.classList.add('show-modal')\n}", "title": "" }, { "docid": "a96ecf1d82cf70e0d22006a60a3c5fe9", "score": "0.5553315", "text": "function setPageColorTheme() {\n debugMessage(\"setPageColorTheme\");\n $('body').addClass(FRAMEWORK_ALM_THEME_CLASS);\n}", "title": "" }, { "docid": "97d1acad40f258299b139aebce595ab3", "score": "0.55480874", "text": "componentWillMount(){\n\t\tdocument.body.classList.add(\"homeBackground\");\n\t}", "title": "" }, { "docid": "1aea311662530f51f3ed91024bb66304", "score": "0.5539012", "text": "function setClasses( classes ) {\n var className = docElement.className;\n var classPrefix = Modernizr._config.classPrefix || '';\n\n // Change `no-js` to `js` (we do this independently of the `enableClasses`\n // option)\n // Handle classPrefix on this too\n if(Modernizr._config.enableJSClass) {\n var reJS = new RegExp('(^|\\\\s)'+classPrefix+'no-js(\\\\s|$)');\n className = className.replace(reJS, '$1'+classPrefix+'js$2');\n }\n\n if(Modernizr._config.enableClasses) {\n // Add the new classes\n className += ' ' + classPrefix + classes.join(' ' + classPrefix);\n docElement.className = className;\n }\n\n }", "title": "" }, { "docid": "6573140d3766af97e6fb0d8564999dca", "score": "0.55390024", "text": "function addClass(el, classes) {\r\n return _frameworkProto.addClass.call(el, classes);\r\n }", "title": "" }, { "docid": "ad2fc70a429658c6755fd14468492ca1", "score": "0.5526123", "text": "function addClass(e, className) {\n e.classList.add(className);\n}", "title": "" }, { "docid": "b9aa3c76d3b9f190c967ce9327eb26bf", "score": "0.55097413", "text": "function darkMode() {\n document.body.classList.add(\"dark\")\n}", "title": "" }, { "docid": "5cd619be1b5f999f5269c9fcdc59ded9", "score": "0.55032516", "text": "function setClasses( classes ) {\n\t var className = docElement.className;\n\t var classPrefix = Modernizr._config.classPrefix || '';\n\t\n\t // Change `no-js` to `js` (we do this independently of the `enableClasses`\n\t // option)\n\t // Handle classPrefix on this too\n\t if(Modernizr._config.enableJSClass) {\n\t var reJS = new RegExp('(^|\\\\s)'+classPrefix+'no-js(\\\\s|$)');\n\t className = className.replace(reJS, '$1'+classPrefix+'js$2');\n\t }\n\t\n\t if(Modernizr._config.enableClasses) {\n\t // Add the new classes\n\t className += ' ' + classPrefix + classes.join(' ' + classPrefix);\n\t docElement.className = className;\n\t }\n\t\n\t }", "title": "" }, { "docid": "9033348403372f2f743c4e80240e3d32", "score": "0.54908705", "text": "class(classes, align) {\n this.elem.classList.add(this.config.class);\n\n // if (align == 'right' || align == 'left') {\n // this.elem.classList.add(align);\n // } else {\n // this.elem.classList.add('center');\n // }\n\n if (Array.isArray(classes)) {\n classes.forEach(function(cls) {\n this.elem.classList.add(cls);\n }, this);\n } else if (classes) {\n this.elem.classList.add(classes);\n }\n }", "title": "" }, { "docid": "3aaaa3c7205187dfc9556378deb9d362", "score": "0.5485165", "text": "function addClass(el,cls){/* istanbul ignore if */if(!cls||!(cls=cls.trim())){return;}/* istanbul ignore else */if(el.classList){if(cls.indexOf(' ')>-1){cls.split(whitespaceRE).forEach(function(c){return el.classList.add(c);});}else{el.classList.add(cls);}}else{var cur=\" \"+(el.getAttribute('class')||'')+\" \";if(cur.indexOf(' '+cls+' ')<0){el.setAttribute('class',(cur+cls).trim());}}}", "title": "" }, { "docid": "db9375e970df5d50a73b2c77eb90abbf", "score": "0.54775965", "text": "function lockBody(){\n document.body.classList.add('transitioning');\n\n}", "title": "" }, { "docid": "59847ab95469d7fea15b6c1f5efc5f7b", "score": "0.5470065", "text": "addAnimationClass(className = \"exponea-animate\") {\n if (this.app === null) return;\n if (this.app.classList) {\n this.app.setAttribute(this.bannerId, \"\");\n setTimeout(function() {\n this.app.classList.add(className);\n }.bind(this), 50);\n } else {\n setTimeout(function() {\n this.app.className += ` ${className}`;\n }.bind(this), 50);\n }\n }", "title": "" }, { "docid": "52e75e7628bb824e616e57d8fe48df2f", "score": "0.5465854", "text": "function setRamdomClass() {\n this.setAttribute('class', randomClass());\n \n return this.className;\n}", "title": "" }, { "docid": "d6579c09573c8f1dc25283098ff8ca10", "score": "0.546228", "text": "function mkdfTouchDeviceBodyClass() {\n if(mkdfIsTouchDevice()) {\n mkdf.body.addClass('mkd-no-animations-on-touch');\n }\n }", "title": "" }, { "docid": "ba1716c50cba6800e27fca4a834531dd", "score": "0.54516107", "text": "function add_css() {\n var style = (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.element)(\"style\");\n style.id = \"svelte-rc08ga-style\";\n style.textContent = \"main.svelte-rc08ga{text-align:center;padding:1em;margin:0 auto;min-width:590px}\";\n (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.append)(document.head, style);\n}", "title": "" }, { "docid": "2e979815cc9d08737d1f6cbe132f3e4b", "score": "0.5430651", "text": "componentDidMount() {\n document.body.classList.add('home')\n }", "title": "" }, { "docid": "28c86ac6496191ca54c15cc034ad9a2a", "score": "0.543055", "text": "function add_class(node, class_name) {\n if (node.classList.contains(class_name)) {\n return false;\n } else {\n node.classList.add(class_name);\n }\n}", "title": "" }, { "docid": "524f9af9c0388ff7516466287530e3be", "score": "0.5426421", "text": "function addClass(ele,cls) {\n if (!hasClass(ele,cls)) ele.className += \" \"+cls;\n }", "title": "" }, { "docid": "88179f8bf7bbd524ce3213db47ee54fb", "score": "0.540901", "text": "enterClassBody(ctx) {\n\t}", "title": "" }, { "docid": "255a313a2e8f490dc3f2e3f7da082316", "score": "0.5405907", "text": "function addClass(el,cls){\n/* istanbul ignore if */\nif(!cls||!(cls=cls.trim())){\nreturn;\n}\n\n/* istanbul ignore else */\nif(el.classList){\nif(cls.indexOf(' ')>-1){\ncls.split(whitespaceRE).forEach(function(c){return el.classList.add(c);});\n}else {\nel.classList.add(cls);\n}\n}else {\nvar cur=\" \"+(el.getAttribute('class')||'')+\" \";\nif(cur.indexOf(' '+cls+' ')<0){\nel.setAttribute('class',(cur+cls).trim());\n}\n}\n}", "title": "" }, { "docid": "5c29ff85bcd59b3329fd10894789568e", "score": "0.5405858", "text": "function switchColor() {\n console.log(this);\n console.log($(this).attr('class'));\n var color = $(this).attr('class');\n $('body').attr('class', color);\n}", "title": "" }, { "docid": "233ab55c81f414325a5712a4efa7bc45", "score": "0.5405732", "text": "function addClass(el, name) {\r\n var classes = el.className.split(\" \"), ind = classes.indexOf(name);\r\n\r\n if (\"classList\" in document.documentElement) {\r\n el.classList.add(name);\r\n } else if (ind == -1) {\r\n classes = el.className.split(\" \");\r\n classes.push(name);\r\n el.className = classes.join(\" \");\r\n }\r\n }", "title": "" }, { "docid": "65c71b497ad050266441c8b23b83e077", "score": "0.5399441", "text": "set body(val) {\n this.setAttribute('body', val);\n }", "title": "" }, { "docid": "7252558282b77108dda94045badfa24e", "score": "0.5399193", "text": "addClass(cls) {\n this.classes[cls.getIRI()] = cls;\n }", "title": "" } ]
340002736cd580c6bf6b5dc61584fdbf
Function to check if textarea has input or not
[ { "docid": "a0d5d8b1ee2265cd6904b948fb989683", "score": "0.0", "text": "function checkBtn() {\r\n\tif (addTxt.value == '') {\r\n\t\taddBtn.disabled = true;\r\n\t\t// console.log('disabled', addBtn.disabled);\r\n\t} else {\r\n\t\taddBtn.disabled = false;\r\n\t\t// console.log('enabled', addBtn.disabled);\r\n\t}\r\n}", "title": "" } ]
[ { "docid": "853701016b64ca39b6bfd61231bc134f", "score": "0.7586699", "text": "textarea(input){\n return !(/\\S/.test(input));\n }", "title": "" }, { "docid": "561fd9eced56bad8412c61a0c0fd875b", "score": "0.6846899", "text": "_checkForTextArea( node ) {\r\n\t\tlet hasTextarea = (node.tagName === 'TEXTAREA');\r\n\t\t\r\n\t\tif( !hasTextarea && node.querySelectorAll ) {\r\n\t\t\tconst textareas = node.querySelectorAll( 'textarea' );\r\n\t\t\tfor( let i = 0; i < textareas.length; i++ ) {\r\n\t\t\t\thasTextarea = hasTextarea || window.getComputedStyle( textareas[i] ).resize !== 'none';\r\n\t\t\t\tif( hasTextarea ) break;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif( !hasTextarea ) {\r\n\t\t\tthis._trackedComponents.forEach( function( observer ) {\r\n\t\t\t\thasTextarea = hasTextarea || observer.hasTextarea;\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tif( hasTextarea !== this._hasTextarea ) {\r\n\t\t\tthis._hasTextarea = hasTextarea;\r\n\t\t\tthis.onHasTextareaChanged( hasTextarea );\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "8812ff1f886cce23d1966f6d36e24dbd", "score": "0.6838531", "text": "function checkIfInInput(){\n var el = document.activeElement;\n return (\n el && (\n el.tagName.toLowerCase() == 'input' ||\n el.tagName.toLowerCase() == 'textarea' ||\n el.contentEditable.toLowerCase() == 'true'\n )\n );\n }", "title": "" }, { "docid": "ccd35f6894e9fae735ef0cab86c2483a", "score": "0.6723575", "text": "function checkAllTextAreas()\n{\n document.getElementById(\"ButtonSubmit\").disabled = true;\n var textarea = document.getElementsByTagName(\"textarea\");\n for (var i = 0; i < textarea.length; i++) {\n if (!(textarea[i].value != '' && textarea[i].value[0] != ' ' && textarea[i].value.length>5))\n { return; }\n\n }\n document.getElementById(\"ButtonSubmit\").disabled = false;\n}", "title": "" }, { "docid": "8a4f2ab242181793c92247a9d0bc8108", "score": "0.6672735", "text": "function ew_IsHiddenTextArea(input_object) {\n\treturn (input_object && input_object.type && input_object.type == \"textarea\" &&\n\t\tinput_object.style && input_object.style.display &&\n\t\tinput_object.style.display == \"none\");\n}", "title": "" }, { "docid": "f734b938ac42559e67846f4ff4bdc77f", "score": "0.66706634", "text": "function isTextInput(el) {\n\tif (jQuery.nodeName(el, \"textarea\")) {\n\t\treturn true;\n\t}\n\n\tif ( ! jQuery.nodeName(el, \"input\")) {\n\t\treturn false;\n\t}\n\n\tvar type = el.type;\n\n\tif ( ! type) {\n\t\treturn true;\n\t}\n\n\tif (type == \"text\" || type == \"password\" || type == \"search\" ||\n\t\ttype == \"url\" || type == \"email\" || type == \"tel\") {\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "title": "" }, { "docid": "6d15b193bcfa96de793a7584f7b39182", "score": "0.6623743", "text": "validity() { \n return this._textarea.validity();\n }", "title": "" }, { "docid": "683e495a3d098ee5bfa16979805e90b3", "score": "0.6558577", "text": "validate() {\n return this._textarea.checkValidity();;\n }", "title": "" }, { "docid": "683e495a3d098ee5bfa16979805e90b3", "score": "0.6558577", "text": "validate() {\n return this._textarea.checkValidity();;\n }", "title": "" }, { "docid": "8baa40d14fbe31465093d269823496a1", "score": "0.63786066", "text": "function isTextElement(el){\n\tif((el.tagName == 'INPUT' && (el.type == null || el.type == 'text')) ||\n\t\tel.tagName == 'TEXTAREA' ||\n\t isRichTextElement(el)){\n\t\treturn true;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "cba1393871c155b44cb0d194731fa3c0", "score": "0.63110626", "text": "function notBlankInput() {\n\treturn input.value.length > 0;\n}", "title": "" }, { "docid": "f86e6b77f76f46e832183a45666f0a78", "score": "0.63079375", "text": "function textareaHandler(text){\r\n if (text.value.length > thiss.MAX_TEXT_LENGTH){\r\n text.value = text.value.substring(0, thiss.MAX_TEXT_LENGTH);\r\n }\r\n\r\n thiss.button[0].disabled = text.value == \"\";\r\n }", "title": "" }, { "docid": "84f10de64ee35341cf1ea13bda44959a", "score": "0.6272228", "text": "function formFieldHasInput(input)\n{\n\n\tif(input.value == null || trim(input.value) == \"\"){\n\t\treturn false;\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "d85c9b628d0176627b52978850466de7", "score": "0.6262034", "text": "function validate() {\n var obj1 = document.getElementById('direction_1');\n if (trimTextarea(obj1.value) == '') {\n return false;\n }\n}", "title": "" }, { "docid": "e3996ab3c996fd40bc18219f32d00bd1", "score": "0.6222577", "text": "validity() { \n return this.shadowRoot.querySelector('#textarea').validity();\n }", "title": "" }, { "docid": "7b3562c1d8ad041027d506f63f2e802f", "score": "0.6216058", "text": "function clipboardHasStuff() {\n return $.clipboard().value.trim().length > 0;\n }", "title": "" }, { "docid": "e5cb49367793765d98ae29d8b01d48fc", "score": "0.61958003", "text": "function validateElement()\n\t\t\t{\n\t\t\t\tvar ret = false;\n\n\t\t\t\tif(item.is('textarea')) {\n\t\t\t\t\tret = true;\n\t\t\t\t} else if(item.filter(\"input[type=text]\")) {\n\t\t\t\t\tret = true;\n\t\t\t\t} else if(item.filter(\"input[type=password]\")) {\n\t\t\t\t\tret = true;\n\t\t\t\t}\n\n\t\t\t\treturn ret;\n\t\t\t}", "title": "" }, { "docid": "b138707a4f21497d60ce26251a633eda", "score": "0.61832064", "text": "function textareaIfy(element) {\n\t\tvar textarea = \n\t\t\t$('<textarea>')\n\t\t\t\t.attr('cols', Math.round(user_data.scriptbar.editBoxCols / 9))\n\t\t\t\t.attr('rows', user_data.scriptbar.editBoxRows)\n\t\t\t\t.val($(element).val());\n\n\t\ttextarea.change(function () {\n\t\t\telement.val($(this).val());\n\t\t});\n\n\t\telement.before(textarea);\n\t\t$(element).hide();\n\t}", "title": "" }, { "docid": "2c4fcd921193b0cf7bb5e994e0dceecf", "score": "0.613998", "text": "function hasInputCapabilities(elem) {\n // The HTML5 spec lists many more types than `text` and `password` on\n // which the input event is triggered but none of them exist in IE 8 or\n // 9, so we don't check them here\n return (\n (elem.nodeName === \"INPUT\" &&\n (elem.type === \"text\" || elem.type === \"password\")) ||\n elem.nodeName === \"TEXTAREA\"\n );\n }", "title": "" }, { "docid": "aa040a1ea45d19026be35371bb893d3b", "score": "0.6111757", "text": "function hasText(obj) {\n return !(obj.val() === '');\n }", "title": "" }, { "docid": "86905d6d9f6d1f54a41ee5bdf0f87d60", "score": "0.61065793", "text": "function validateContactText() {\n var textWrapper = $('#contact-text');\n\n if ($.trim(textWrapper.find('textarea').val()).length) {\n textWrapper.removeClass('error-field');\n return true;\n } else {\n textWrapper.addClass('error-field');\n return false;\n }\n }", "title": "" }, { "docid": "7e427075a804287f1183872058b6f157", "score": "0.6095264", "text": "function validateText(text) {\n return text == \"\" ? false : true;\n}", "title": "" }, { "docid": "54275fc32a62bc07383055b51c2c739b", "score": "0.6090166", "text": "function replyValidation(){\n\n var reply_body = document.getElementById('reply_body');\n\n var replyBody = reply_body.value;\n\n\tif (!replyBody.replace(/\\s/g, '').length) {\n document.getElementById(\"add\").disabled = true;\n }\n else\n {\n document.getElementById(\"add\").disabled = false;\n }\n\n}", "title": "" }, { "docid": "9fa00722bbc4cf134fde2fdfaab7ab4e", "score": "0.6050141", "text": "function isValidElement(elem) {\n\t\tvar tag = (elem.nodeName || '').toLowerCase();\n\t\treturn (tag === 'textarea' || (tag === 'input' && (elem.type === 'text' || elem.type === 'password')));\n\t}", "title": "" }, { "docid": "9fa00722bbc4cf134fde2fdfaab7ab4e", "score": "0.6050141", "text": "function isValidElement(elem) {\n\t\tvar tag = (elem.nodeName || '').toLowerCase();\n\t\treturn (tag === 'textarea' || (tag === 'input' && (elem.type === 'text' || elem.type === 'password')));\n\t}", "title": "" }, { "docid": "02631019580964afb85c5650eea0c086", "score": "0.60058135", "text": "function commentValidation(){\n\n var comment_body = document.getElementById('comment_body');\n\n var commentBody = comment_body.value;\n\n\tif (!commentBody.replace(/\\s/g, '').length) {\n document.getElementById(\"addComment\").disabled = true;\n }\n else\n {\n document.getElementById(\"addComment\").disabled = false;\n }\n\n}", "title": "" }, { "docid": "18c57c3b7854c05660e599b80af0e635", "score": "0.5999884", "text": "function isFilledText(textbox, spStr, errMsg)\r\n{\r\n\tvar strVal;\r\n\ttextbox = get_id(textbox);\r\n\tstrVal = textbox.value;\r\n\tstrVal = trim(strVal);\r\n\tif((strVal=='') || (strVal==spStr))\r\n\t{\r\n\t\tif(errMsg != '')\r\n\t\t{\r\n\t\t\talert(errMsg);\r\n\t\t\ttextbox.focus();\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n}", "title": "" }, { "docid": "3527b77bf6f409fa4b506d9ef4a3fc9b", "score": "0.5990581", "text": "function formFieldHasInput(fieldElement){\n\n\tif ( fieldElement.value == null || trim(fieldElement.value) == \"\" )\n\t{\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "title": "" }, { "docid": "edaafc5320253b7050fbe8bdab85740f", "score": "0.5980812", "text": "function validateTextArea(){\n\tvar divCountLoop = $('#outderDiv').children('.after_sketch_task').length;\t\n\t\n\t/******************* Set focus to the Task Area which does not contain value***********************/\n\tif(sessionStorage.getItem(\"isLogout\")==\"N\"){\n\t\tremoveFocus();\n\t\tfor(var i=1; i<=divCountLoop;i++){\n\t\t\tvar style = document.getElementById(\"divImg_\" +i).getAttribute(\"style\");\n\t\t\tif((style.search('block') != -1)){\n\t\t\t\ttaskId = document.getElementById(\"divImg_\"+i).id;\n\t\t\t\ttaskDesc = document.getElementById(\"areaId_\"+i).value.trim();\t\n\t\t\t\tif(taskDesc == \"\") {\n\t\t\t\t\t$(\"#\" + taskId).children().find(\".add_task_area_sketch\").addClass(\"add_task_area_sketch_focus\");\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t}\n\t}\n\t\t\n\tif(sessionStorage.getItem(\"isLogout\")==\"N\"){\n\t\tfor(var i=1; i<=divCountLoop;i++){\n\t\t\tvar style = document.getElementById(\"divImg_\" +i).getAttribute(\"style\");\n\t\t\tif((style.search('block') != -1)){\n\t\t\t\ttaskDesc = document.getElementById(\"areaId_\"+i).value.trim();\n\t\t\t\tif(taskDesc == \"\") {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t}\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "e4a632b0dcc30330f49ec5e5ca34a971", "score": "0.59432346", "text": "function checkEmptynessOfInputfield(){\n var title = $(\"#movieTitle\").val();\n var isFilled;\n if(title == \"\"){\n isFilled = false;\n }else{\n isFilled = true;\n }\n\n return isFilled;\n}", "title": "" }, { "docid": "8ffa0a780588dc4ddd4e372cd1ca0dd6", "score": "0.59411", "text": "function validateForm() {\n return content.length > 0;\n }", "title": "" }, { "docid": "25a6aeb6ab6aa0cb3ee9998076cbb965", "score": "0.59329706", "text": "inputsAreEntered() {\n if (this.state.imageAsString === '' || this.state.fileText === '') {\n alert(\"You are missing a picture or the text!\");\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "8226be3de1592d268c7f66b13400bac3", "score": "0.59283453", "text": "function isEditBox(elem) \n {\n return (elem.tagName == 'INPUT' && elem.type == \"text\")\n || elem.contentEditable == 'true' // contenteditable is true && tag name limit??\n || elem.tagName == 'TEXTAREA' ;\n }", "title": "" }, { "docid": "6267e8eb531076e605d3736b37bb12b1", "score": "0.5917561", "text": "function handleTextareaChange () {\n var comment = _uiModalComment.textarea.val();\n if (comment.length > 0) {\n enableClickOK();\n } else {\n self._disableClickOK();\n }\n }", "title": "" }, { "docid": "e55bc99e4567b8e78de02fa0598c668d", "score": "0.5875036", "text": "function checkInput(){\n\tvar object = getValue();\n\tif (object.height === \"\" || object.character === \"\"){\n\t\talert(\"Please input Stuff\");\n\t}\t\n\telse { \n\t\ttreetop(object);\n\t};\n\treturn false;\n}", "title": "" }, { "docid": "3d88a09b043ce61280622a8222d51295", "score": "0.58690506", "text": "function checkTextArea(){\n\nvar myExtract=stripHtml(document.getElementById('myExtract').value)\n\n\nif (myExtract.length>255){\n\t\talert('Votre extrait doit comporter moins de 255 caractères')\n\n}\n}", "title": "" }, { "docid": "56946c537f4fd123f9895bfb45eed9df", "score": "0.5868361", "text": "function isEmpty(input,helpermsg)\n{\n \n if(document.getElementById(input).value==\"\")\n {\n alert(helpermsg);\n document.getElementById(input).focus();\n return false;\n }\n else\n {\n return true;\n }\n \n}", "title": "" }, { "docid": "27df53e25e9e13c451cdcb685cf40738", "score": "0.58653075", "text": "validateForm() {\n\t\tconst {comment} = this.state;\n\t\treturn comment.length > 0;\n }", "title": "" }, { "docid": "382443842e596cf9e058583e719433ba", "score": "0.5843143", "text": "checkType(input) {\n return input.type === \"text\" || input.type === \"textarea\" || input.type === \"date\";\n }", "title": "" }, { "docid": "b5aea8ec5b1e2a84e30569ebca7e2653", "score": "0.58427024", "text": "function textEmpty() {\n alert('you must fill out all text fields')\n return false;\n}", "title": "" }, { "docid": "df1e86fbaeb62914018b8be47f1b3de4", "score": "0.5832405", "text": "function checkInputTextFieldEmpty(element){\n\t\t\t var myfield = $(element).val();\n\t\t\t if(myfield.length == 0){\n\t\t\t return true; \n\t\t\t }\n\t\t\t else{\n\t\t\t return false; \n\t\t\t }\n\n\t\t\t }", "title": "" }, { "docid": "3d73ca9204ce8797c0f5c24b8caa4bd5", "score": "0.5827929", "text": "function IsEmptyUserInput(objControl) \r\n{\r\n if (objControl.value.trim().length > 0)\r\n return false;\r\n\r\n return true;\r\n}", "title": "" }, { "docid": "f8f81201d164ed9182d303713e2b9a6e", "score": "0.5826209", "text": "function check() {\r\n var name = document.getElementById('na');\r\n var email = document.getElementById('em');\r\n var textarea = document.getElementById('text');\r\n if (name.value == '') {\r\n alert('Name flied is blank');\r\n name.focus();\r\n return false;\r\n }\r\n if (email.value == '') {\r\n alert('Email flied address is blank');\r\n email.focus();\r\n return false;\r\n }\r\n if (textarea.value == '') {\r\n alert('Massage flied is blank');\r\n textarea.focus();\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "4479e8e5e6239407a5f8172a26bd12ef", "score": "0.58176214", "text": "checkType(text) {\n text = text || this.state.answers.type;\n return !isNotEmpty(text);\n }", "title": "" }, { "docid": "3992da9f7951017d8ff89c89097d3952", "score": "0.5784749", "text": "function inputLength() { //to know if the text field is empty or not\n\treturn input.value.length; \n}", "title": "" }, { "docid": "094c19320adfc5e44370831d4c4f8cfd", "score": "0.57762736", "text": "function checkComment(form){\n var formTextField = $(form).find('[name='+COMMENT_TEXT+']').val();\n if (isBlank(formTextField)) {\n setStatusMessage(DISPLAY_COMMENT_BLANK,true);\n $(window).scrollTop(0);\n return false;\n }\n}", "title": "" }, { "docid": "37c04ab2ce542bd980a567a61dd721c8", "score": "0.5744675", "text": "function isFocusOnInputBox(target) {\n if (target.getAttribute('role') == 'textbox' || target.tagName == 'INPUT' || target.tagName == 'TEXTAREA')\n\treturn true;\n else\n\treturn false;\n}", "title": "" }, { "docid": "c6b2916b50eabdc3b941cec8a1a30f36", "score": "0.57374763", "text": "function validateInput() {\n\tvar valid = descriptionText.value.length > 0;\n\tsaveButton.disabled = !valid;\n}", "title": "" }, { "docid": "1dcc3f6d93a48abccb253df074fb5b3c", "score": "0.57344246", "text": "validateTextDocumentHasFocus() {\n if (this._vscodeWrapper.activeTextEditorUri === undefined) {\n Utils.showErrorMsg(LocalizedConstants.noActiveEditorMsg);\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "dfe048b2c80e2d7528d121daf00c2f26", "score": "0.5725162", "text": "function checkInputs() {\n vals = new Array(inputs['title'].value, inputs['author'].value, inputs['pages'].value);\n if (vals[2] != '' && isNaN(vals[2])) {return false};\n return !vals.includes('');\n}", "title": "" }, { "docid": "7358e1a2c4867a3369dbbe36db558fc9", "score": "0.5721457", "text": "function inputIsValid(){\n if(addTaskInput.value.length > 0){\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "8f7d1ac8ce1dc927df7d879bff86249a", "score": "0.5710497", "text": "function displayIsEmpty(){return inputDisplay.value === '';}", "title": "" }, { "docid": "8982abe34c06df19869f23b9e7401e01", "score": "0.5697016", "text": "isEmpty(){\n const message = this;\n let ready = true;\n [message.name,message.email,message.message].forEach(function (input){\n if (input.value.length > 0){\n ready = false;\n }\n });\n return ready;\n }", "title": "" }, { "docid": "392d6e6bea4116973bd873e6b4a5ea6c", "score": "0.56934494", "text": "function validarCamposTexto(elemento)\n {\n var texto = document.getElementById(elemento).value;\n if((texto=='' || texto == null))\n {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "afbf7753b541f4ba982ba5196cff7c8a", "score": "0.5692234", "text": "function checkEmpty($input) {\n return $('#' +$input.target.name).val() !== \"\";\n}", "title": "" }, { "docid": "2eb4c5382342c7e996e2decf0699c7fe", "score": "0.56862354", "text": "clearTextarea() {\n this.$('textarea')\n .val('')\n .trigger('autosize.resize')\n this.checkContent()\n return false\n }", "title": "" }, { "docid": "09a3f6b18077ddd1ef39c76ecfc2bb66", "score": "0.5683408", "text": "function formFieldHasInput(fieldElement)\n{\n\t// Check if the text field has a value\n\tif ( fieldElement.value == null || trim(fieldElement.value) == \"\" )\n\t{\n\t\t// Invalid entry\n\t\treturn false;\n\t}\n\t\n\t// Valid entry\n\treturn true;\n}", "title": "" }, { "docid": "908b3f1a7d4da18d18e8df6be040d238", "score": "0.5682868", "text": "function find_answer_textarea () {\r\n\tres = document.evaluate(\r\n\t\t\t\t'//textarea[@name=\"message\"]',\r\n\t\t\t\tdocument,\r\n\t\t\t\tnull,\r\n\t\t\t\tXPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,\r\n\t\t\t\tnull);\r\n\treturn res.snapshotItem(0);\t\r\n }", "title": "" }, { "docid": "71bdc7a9b66e8e3053192297637f5a46", "score": "0.56523097", "text": "function checkText(obj,defaultTxt)\n{\n\tif(defaultTxt!=obj.value) {\n\t\t/*-----The trim function has to be called before calling this function -----*/\n\t\t/*---- Later , type will be passed as a parameter so that the type will be like email, phone no , numeric, character ---*/\n\n\t\tif(obj.value == \"\")\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\telse {\n\t\t\treturn true;\n\t\t}\n\t} else {\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "1d3990a37f1c79f8ceb0d39e45efd252", "score": "0.564833", "text": "function isEmptyInput(init_input){\n var input = init_input.val();\n if(input.replace(/^\\s+|\\s+$/g, \"\").length == 0){\n return false;\n }else{\n return true;\n }\n }", "title": "" }, { "docid": "99aa4d97c3b035211ebaa0069dec3c4b", "score": "0.5643209", "text": "function isEmpty(input){\r\n //console.log(input.val());\r\n if(input.val().length==0){\r\n return true;\r\n }\r\n return false;\r\n}", "title": "" }, { "docid": "afc3a23394030edcad51b522daf39d09", "score": "0.56431895", "text": "function checkSubmit() {\n let feedbackDivArea = textAreaIntro.nextElementSibling\n let feedbackDivName = textInputName.nextElementSibling\n\n if (textInputName.value.length < 1) {\n feedbackDivName.innerHTML = 'Can not blank'\n textInputName.classList.add('warning')\n } else {\n feedbackDivName.innerHTML = ''\n }\n\n if (textAreaIntro.value.length < 1) {\n feedbackDivArea.innerHTML = 'Can not blank'\n textAreaIntro.classList.add('warning')\n } else if (textAreaIntro.value.length > 200) {\n feedbackDivArea.innerHTML = 'Can not more than 200 word'\n textAreaIntro.classList.add('warning')\n } else {\n feedbackDivArea.innerHTML = ''\n }\n}", "title": "" }, { "docid": "319666692ecbc6390c72d92f72c5bb2e", "score": "0.56248194", "text": "function emptyInput(value){\n if (value.length == 0){return true;}\n}", "title": "" }, { "docid": "5ee27afb9672ce5c8be7ac4785111f92", "score": "0.5607223", "text": "function checkChatBox () {\n if (chatBox.innerHTML === \"\"){\n // console.log('if checkChatBox running')\n clearButton.disabled = true;\n} else{\n // console.log('else checkChatBox running', chatBox.innerHTML)\n clearButton.disabled = false;\n}\n// userInput.value = \"\";\n}", "title": "" }, { "docid": "5b0de23eadc32f2c35a6119629169a19", "score": "0.5584588", "text": "function validFormFieldInput(data) {\n return data !== null && data !== \"\";\n}", "title": "" }, { "docid": "18460aea9cbccd378e9c117b0f38a4a6", "score": "0.5577804", "text": "function checkInputText(value, msg) {\n if (value == null || value == \"\") {\n alert(msg);\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "37968d9c1c815450b90ba6ce2b531486", "score": "0.5569858", "text": "function checkInput() {\n\t\t// Store the pasted content in a variable\n\t\tvar child = $(\"#pasteCatcher\").children[0];\n\n\t\t// Clear the inner html to make sure we're always\n\t\t// getting the latest inserted content\n\t\t$(\"#pasteCatcher\").text = \"\";\n\n\t\tif (child) {\n\t\t\t// If the user pastes an image, the src attribute\n\t\t\t// will represent the image as a base64 encoded string.\n\t\t\tif (child.tagName === \"IMG\") {\n\t\t\t\tcreateImage(child.src);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "15dce4e47e06ec47f162f0e25d2c1212", "score": "0.5565556", "text": "function isValidInput() {\n\tif (input.value.replace(/^\\s+|\\s+$/g, '').length == 0) {\n\t\tinput.value = \"\";\n\t\treturn false;\n\t} else {\n\t\t\treturn true;\n\t\t}\n}", "title": "" }, { "docid": "1894c9266826a8fec6a3a5206140bfff", "score": "0.5561231", "text": "function textAppear(){\n if(document.getElementById(\"comment\").value==\"\"){\n document.getElementById(\"comment\").innerHTML=\"Enter your comments here\";\n }\n}", "title": "" }, { "docid": "2a9ed60b9942c61823ddc99693e2bb82", "score": "0.5559716", "text": "function readInput(cm) {\n var input = cm.display.input, prevInput = cm.display.prevInput, doc = cm.doc;\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (!cm.state.focused || (hasSelection(input) && !prevInput) || isReadOnly(cm) || cm.options.disableInput)\n return false;\n // See paste handler for more on the fakedLastChar kludge\n if (cm.state.pasteIncoming && cm.state.fakedLastChar) {\n input.value = input.value.substring(0, input.value.length - 1);\n cm.state.fakedLastChar = false;\n }\n var text = input.value;\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) return false;\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && cm.display.inputHasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\n resetInput(cm);\n return false;\n }\n\n var withOp = !cm.curOp;\n if (withOp) startOperation(cm);\n cm.display.shift = false;\n\n if (text.charCodeAt(0) == 0x200b && doc.sel == cm.display.selForContextMenu && !prevInput)\n prevInput = \"\\u200b\";\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length);\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) ++same;\n var inserted = text.slice(same), textLines = splitLines(inserted);\n\n // When pasing N lines into N selections, insert one line per selection\n var multiPaste = null;\n if (cm.state.pasteIncoming && doc.sel.ranges.length > 1) {\n if (lastCopied && lastCopied.join(\"\\n\") == inserted)\n multiPaste = doc.sel.ranges.length % lastCopied.length == 0 && map(lastCopied, splitLines);\n else if (textLines.length == doc.sel.ranges.length)\n multiPaste = map(textLines, function(l) { return [l]; });\n }\n\n // Normal behavior is to insert the new text into every selection\n for (var i = doc.sel.ranges.length - 1; i >= 0; i--) {\n var range = doc.sel.ranges[i];\n var from = range.from(), to = range.to();\n // Handle deletion\n if (same < prevInput.length)\n from = Pos(from.line, from.ch - (prevInput.length - same));\n // Handle overwrite\n else if (cm.state.overwrite && range.empty() && !cm.state.pasteIncoming)\n to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length));\n var updateInput = cm.curOp.updateInput;\n var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i % multiPaste.length] : textLines,\n origin: cm.state.pasteIncoming ? \"paste\" : cm.state.cutIncoming ? \"cut\" : \"+input\"};\n makeChange(cm.doc, changeEvent);\n signalLater(cm, \"inputRead\", cm, changeEvent);\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (inserted && !cm.state.pasteIncoming && cm.options.electricChars &&\n cm.options.smartIndent && range.head.ch < 100 &&\n (!i || doc.sel.ranges[i - 1].head.line != range.head.line)) {\n var mode = cm.getModeAt(range.head);\n var end = changeEnd(changeEvent);\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indentLine(cm, end.line, \"smart\");\n break;\n }\n } else if (mode.electricInput) {\n if (mode.electricInput.test(getLine(doc, end.line).text.slice(0, end.ch)))\n indentLine(cm, end.line, \"smart\");\n }\n }\n }\n ensureCursorVisible(cm);\n cm.curOp.updateInput = updateInput;\n cm.curOp.typing = true;\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) input.value = cm.display.prevInput = \"\";\n else cm.display.prevInput = text;\n if (withOp) endOperation(cm);\n cm.state.pasteIncoming = cm.state.cutIncoming = false;\n return true;\n }", "title": "" }, { "docid": "2a9ed60b9942c61823ddc99693e2bb82", "score": "0.5559716", "text": "function readInput(cm) {\n var input = cm.display.input, prevInput = cm.display.prevInput, doc = cm.doc;\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (!cm.state.focused || (hasSelection(input) && !prevInput) || isReadOnly(cm) || cm.options.disableInput)\n return false;\n // See paste handler for more on the fakedLastChar kludge\n if (cm.state.pasteIncoming && cm.state.fakedLastChar) {\n input.value = input.value.substring(0, input.value.length - 1);\n cm.state.fakedLastChar = false;\n }\n var text = input.value;\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) return false;\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && cm.display.inputHasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\n resetInput(cm);\n return false;\n }\n\n var withOp = !cm.curOp;\n if (withOp) startOperation(cm);\n cm.display.shift = false;\n\n if (text.charCodeAt(0) == 0x200b && doc.sel == cm.display.selForContextMenu && !prevInput)\n prevInput = \"\\u200b\";\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length);\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) ++same;\n var inserted = text.slice(same), textLines = splitLines(inserted);\n\n // When pasing N lines into N selections, insert one line per selection\n var multiPaste = null;\n if (cm.state.pasteIncoming && doc.sel.ranges.length > 1) {\n if (lastCopied && lastCopied.join(\"\\n\") == inserted)\n multiPaste = doc.sel.ranges.length % lastCopied.length == 0 && map(lastCopied, splitLines);\n else if (textLines.length == doc.sel.ranges.length)\n multiPaste = map(textLines, function(l) { return [l]; });\n }\n\n // Normal behavior is to insert the new text into every selection\n for (var i = doc.sel.ranges.length - 1; i >= 0; i--) {\n var range = doc.sel.ranges[i];\n var from = range.from(), to = range.to();\n // Handle deletion\n if (same < prevInput.length)\n from = Pos(from.line, from.ch - (prevInput.length - same));\n // Handle overwrite\n else if (cm.state.overwrite && range.empty() && !cm.state.pasteIncoming)\n to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length));\n var updateInput = cm.curOp.updateInput;\n var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i % multiPaste.length] : textLines,\n origin: cm.state.pasteIncoming ? \"paste\" : cm.state.cutIncoming ? \"cut\" : \"+input\"};\n makeChange(cm.doc, changeEvent);\n signalLater(cm, \"inputRead\", cm, changeEvent);\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (inserted && !cm.state.pasteIncoming && cm.options.electricChars &&\n cm.options.smartIndent && range.head.ch < 100 &&\n (!i || doc.sel.ranges[i - 1].head.line != range.head.line)) {\n var mode = cm.getModeAt(range.head);\n var end = changeEnd(changeEvent);\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indentLine(cm, end.line, \"smart\");\n break;\n }\n } else if (mode.electricInput) {\n if (mode.electricInput.test(getLine(doc, end.line).text.slice(0, end.ch)))\n indentLine(cm, end.line, \"smart\");\n }\n }\n }\n ensureCursorVisible(cm);\n cm.curOp.updateInput = updateInput;\n cm.curOp.typing = true;\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) input.value = cm.display.prevInput = \"\";\n else cm.display.prevInput = text;\n if (withOp) endOperation(cm);\n cm.state.pasteIncoming = cm.state.cutIncoming = false;\n return true;\n }", "title": "" }, { "docid": "fa45e0ddf1c1617e40cd24cfdf1d0fe8", "score": "0.55459005", "text": "hasTexts(editor, element) {\n return element.children.every(n => Text.isText(n));\n }", "title": "" }, { "docid": "5d63a0b311f456e71f90586e752e2106", "score": "0.5543308", "text": "function is_not_empty(field)\r\n{\r\n\r\n\t\tvar lenmin = 2;\r\n\t\tvar lenmax = 500;\r\n\t\tvar value = document.getElementById(field).value.replace(' ', '')\r\n\t\tvar type_error = false;\r\n\t\t\r\n\t\tif(document.getElementById(field).hasAttribute('onlyletters'))\r\n\t\t{\r\n\t\t\tvar VRegExp = new RegExp(/^[a-z-A-Z]{3,50}\\b/);\r\n\t\t\tif(!VRegExp.test(value))\r\n\t\t\t\ttype_error = true;\r\n\t\t}\r\n\r\n\t\tif(document.getElementById(field).hasAttribute('onlynumbers'))\r\n\t\t{\r\n\t\t\tvar VRegExp = new RegExp(/^[0-9]+\\b/);\r\n\t\t\tif(!VRegExp.test(value))\r\n\t\t\t\ttype_error = true;\r\n\t\t}\r\n\t\t\t\t\r\n\t\tif(document.getElementById(field).hasAttribute('minlength'))\r\n\t\t\tlenmin = document.getElementById(field).getAttribute('minlength')\r\n\t\t\r\n\t\tif(document.getElementById(field).hasAttribute('maxlength'))\r\n\t\t\tlenmax = document.getElementById(field).getAttribute('maxlength')\r\n\r\n\t\tif(document.getElementById(field).hasAttribute('fixedlength'))\r\n\t\t{\r\n\t\t\tlenmin = document.getElementById(field).getAttribute('fixedlength')\r\n\t\t\tlenmax = lenmin\r\n\t\t}\r\n\t\t\r\n\t\tif(value == '' || value.length < lenmin || value.length > lenmax || type_error)\r\n\t\t{\r\n\t\t\tif(document.error_style !== undefined)\r\n\t\t\t\tdocument.getElementById(field).style = document.error_style;\r\n\t\t\telse\r\n\t\t\t\tdocument.getElementById(field).style.border = '1px solid red';\r\n\t\t\treturn false\r\n\t\t}else{\r\n\t\t\tdocument.getElementById(field).style.border = 0;\r\n\t\t\t\r\n\t\t\tif(document.default_input_style !== undefined)\r\n\t\t\t\tdocument.getElementById(field).style = ''\r\n\t\t\telse\r\n\t\t\t\tdocument.getElementById(field).style = document.default_input_style\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t}\r\n}", "title": "" }, { "docid": "057553a0b68da1a8500780db13852094", "score": "0.5543289", "text": "function chat_textArea(name) {\n $(\".\"+name+\"_chat_submit_button\").removeClass(\"btn-primary\");\n $(\".\" + name +\"_chat_submit_button\").addClass(\"btn-disable\");\n\n $(\".\" + name +\"_chat_textarea\").on('keyup keydown keypres', e => {\n\n var value = $(\".\"+name+\"_chat_textarea\").val();\n current_chat.message = value;\n if (value.trim().length == 0) {\n\n $(\".\" + name +\"_chat_submit_button\").removeClass(\"btn-primary\");\n $(\".\" + name +\"_chat_submit_button\").addClass(\"btn-disable\");\n\n } else {\n $(\".\" + name +\"_chat_submit_button\").removeClass(\"btn-disable\");\n $(\".\" + name +\"_chat_submit_button\").addClass(\"btn-primary\");\n\n }\n\n })\n }", "title": "" }, { "docid": "4a7ac79bef496e9fd412657b5885498f", "score": "0.55406135", "text": "function areInputsEmpty() {\n if ($('#whoseJokeIn').val() === '' || $('#questionIn').val() === '' || $('#punchlineIn').val() === '') {\n return true;\n }\n}", "title": "" }, { "docid": "6743aed0ba76e34647f5aad3edb2cf46", "score": "0.5537973", "text": "function checkIfInputIsEmpty(elem, label, errElem) {\n\t\tif (!elem.val()) {\n\t\t\telem.focus();\n\t\t\terrElem.text(label + \" is empty!\");\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "title": "" }, { "docid": "c953f942560bddf1024d8f34c51e6491", "score": "0.55376995", "text": "function canSubmitForm(){\n if (isEditForm) {\n const changeArr = Array.from(textFields).map(input => {\n let {value, dataset : {existingvalue}} = input;\n value = value.trim(), existingvalue = existingvalue.trim()\n return value !== existingvalue\n })\n return changeArr.some(el => el === true)\n }\n // when its a create new form\n return Array.from(textFields).filter(({value, name}) => {\n // at least the title field must be filled by valid characters and numbers\n if (name === \"title\") {\n return Boolean(value.trim().length > 0)\n }\n })\n}", "title": "" }, { "docid": "1f3b50f7f2a8ae65a7714534df0ed065", "score": "0.5533818", "text": "function textarea() {\n // textarea behaves just like text input\n return Object(_input__WEBPACK_IMPORTED_MODULE_0__[/* default */ \"a\"])('text');\n}", "title": "" }, { "docid": "fd122b2cb0e22be6df822496571f0060", "score": "0.55336195", "text": "function editNotEmpty(){\n\tvar ticketNum = document.getElementById('updated_tickets')\n\tif(ticketNum.value.length == 0){\n\t\talert('Please enter a value');\n\t\tticketNum.focus(); // set the focus to this input\n\t\treturn false;\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "b9cb6ca477684b9114eb5d4aeba2a62e", "score": "0.552228", "text": "function checkInput(value) {\n\t// First check if user has entered text\n\tif (!value) {\n\t\treturn false;\n\t}\n\t// Then check if removing whitespace still has a value\n\tconst trimmed = value.trim();\n\tif (trimmed) {\n\t\treturn true;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "2e4de5e404874533d5151629dd5787f9", "score": "0.5520434", "text": "function isFocused(){\n\tconst element1 = \"expression\";\n\tif(element1 === currentTextboxId){\n\t\treturn true;\n\t}else{\n\t\twindow.alert(\"You must focus on the textbox first.\");\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "0e28b84f42b95ad81b65f2ff280792ba", "score": "0.5519915", "text": "function readInput(cm) {\n var input = cm.display.input, prevInput = cm.display.prevInput, doc = cm.doc;\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (!cm.state.focused || (hasSelection(input) && !prevInput) || isReadOnly(cm) || cm.options.disableInput || cm.state.keySeq)\n return false;\n // See paste handler for more on the fakedLastChar kludge\n if (cm.state.pasteIncoming && cm.state.fakedLastChar) {\n input.value = input.value.substring(0, input.value.length - 1);\n cm.state.fakedLastChar = false;\n }\n var text = input.value;\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) return false;\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && cm.display.inputHasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\n resetInput(cm);\n return false;\n }\n\n var withOp = !cm.curOp;\n if (withOp) startOperation(cm);\n cm.display.shift = false;\n\n if (text.charCodeAt(0) == 0x200b && doc.sel == cm.display.selForContextMenu && !prevInput)\n prevInput = \"\\u200b\";\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length);\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) ++same;\n var inserted = text.slice(same), textLines = splitLines(inserted);\n\n // When pasing N lines into N selections, insert one line per selection\n var multiPaste = null;\n if (cm.state.pasteIncoming && doc.sel.ranges.length > 1) {\n if (lastCopied && lastCopied.join(\"\\n\") == inserted)\n multiPaste = doc.sel.ranges.length % lastCopied.length == 0 && map(lastCopied, splitLines);\n else if (textLines.length == doc.sel.ranges.length)\n multiPaste = map(textLines, function(l) { return [l]; });\n }\n\n // Normal behavior is to insert the new text into every selection\n for (var i = doc.sel.ranges.length - 1; i >= 0; i--) {\n var range = doc.sel.ranges[i];\n var from = range.from(), to = range.to();\n // Handle deletion\n if (same < prevInput.length)\n from = Pos(from.line, from.ch - (prevInput.length - same));\n // Handle overwrite\n else if (cm.state.overwrite && range.empty() && !cm.state.pasteIncoming)\n to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length));\n var updateInput = cm.curOp.updateInput;\n var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i % multiPaste.length] : textLines,\n origin: cm.state.pasteIncoming ? \"paste\" : cm.state.cutIncoming ? \"cut\" : \"+input\"};\n makeChange(cm.doc, changeEvent);\n signalLater(cm, \"inputRead\", cm, changeEvent);\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (inserted && !cm.state.pasteIncoming && cm.options.electricChars &&\n cm.options.smartIndent && range.head.ch < 100 &&\n (!i || doc.sel.ranges[i - 1].head.line != range.head.line)) {\n var mode = cm.getModeAt(range.head);\n var end = changeEnd(changeEvent);\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indentLine(cm, end.line, \"smart\");\n break;\n }\n } else if (mode.electricInput) {\n if (mode.electricInput.test(getLine(doc, end.line).text.slice(0, end.ch)))\n indentLine(cm, end.line, \"smart\");\n }\n }\n }\n ensureCursorVisible(cm);\n cm.curOp.updateInput = updateInput;\n cm.curOp.typing = true;\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) input.value = cm.display.prevInput = \"\";\n else cm.display.prevInput = text;\n if (withOp) endOperation(cm);\n cm.state.pasteIncoming = cm.state.cutIncoming = false;\n return true;\n }", "title": "" }, { "docid": "0e28b84f42b95ad81b65f2ff280792ba", "score": "0.5519915", "text": "function readInput(cm) {\n var input = cm.display.input, prevInput = cm.display.prevInput, doc = cm.doc;\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (!cm.state.focused || (hasSelection(input) && !prevInput) || isReadOnly(cm) || cm.options.disableInput || cm.state.keySeq)\n return false;\n // See paste handler for more on the fakedLastChar kludge\n if (cm.state.pasteIncoming && cm.state.fakedLastChar) {\n input.value = input.value.substring(0, input.value.length - 1);\n cm.state.fakedLastChar = false;\n }\n var text = input.value;\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) return false;\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && cm.display.inputHasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\n resetInput(cm);\n return false;\n }\n\n var withOp = !cm.curOp;\n if (withOp) startOperation(cm);\n cm.display.shift = false;\n\n if (text.charCodeAt(0) == 0x200b && doc.sel == cm.display.selForContextMenu && !prevInput)\n prevInput = \"\\u200b\";\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length);\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) ++same;\n var inserted = text.slice(same), textLines = splitLines(inserted);\n\n // When pasing N lines into N selections, insert one line per selection\n var multiPaste = null;\n if (cm.state.pasteIncoming && doc.sel.ranges.length > 1) {\n if (lastCopied && lastCopied.join(\"\\n\") == inserted)\n multiPaste = doc.sel.ranges.length % lastCopied.length == 0 && map(lastCopied, splitLines);\n else if (textLines.length == doc.sel.ranges.length)\n multiPaste = map(textLines, function(l) { return [l]; });\n }\n\n // Normal behavior is to insert the new text into every selection\n for (var i = doc.sel.ranges.length - 1; i >= 0; i--) {\n var range = doc.sel.ranges[i];\n var from = range.from(), to = range.to();\n // Handle deletion\n if (same < prevInput.length)\n from = Pos(from.line, from.ch - (prevInput.length - same));\n // Handle overwrite\n else if (cm.state.overwrite && range.empty() && !cm.state.pasteIncoming)\n to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length));\n var updateInput = cm.curOp.updateInput;\n var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i % multiPaste.length] : textLines,\n origin: cm.state.pasteIncoming ? \"paste\" : cm.state.cutIncoming ? \"cut\" : \"+input\"};\n makeChange(cm.doc, changeEvent);\n signalLater(cm, \"inputRead\", cm, changeEvent);\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (inserted && !cm.state.pasteIncoming && cm.options.electricChars &&\n cm.options.smartIndent && range.head.ch < 100 &&\n (!i || doc.sel.ranges[i - 1].head.line != range.head.line)) {\n var mode = cm.getModeAt(range.head);\n var end = changeEnd(changeEvent);\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indentLine(cm, end.line, \"smart\");\n break;\n }\n } else if (mode.electricInput) {\n if (mode.electricInput.test(getLine(doc, end.line).text.slice(0, end.ch)))\n indentLine(cm, end.line, \"smart\");\n }\n }\n }\n ensureCursorVisible(cm);\n cm.curOp.updateInput = updateInput;\n cm.curOp.typing = true;\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) input.value = cm.display.prevInput = \"\";\n else cm.display.prevInput = text;\n if (withOp) endOperation(cm);\n cm.state.pasteIncoming = cm.state.cutIncoming = false;\n return true;\n }", "title": "" }, { "docid": "0e28b84f42b95ad81b65f2ff280792ba", "score": "0.5519915", "text": "function readInput(cm) {\n var input = cm.display.input, prevInput = cm.display.prevInput, doc = cm.doc;\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (!cm.state.focused || (hasSelection(input) && !prevInput) || isReadOnly(cm) || cm.options.disableInput || cm.state.keySeq)\n return false;\n // See paste handler for more on the fakedLastChar kludge\n if (cm.state.pasteIncoming && cm.state.fakedLastChar) {\n input.value = input.value.substring(0, input.value.length - 1);\n cm.state.fakedLastChar = false;\n }\n var text = input.value;\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) return false;\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && cm.display.inputHasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\n resetInput(cm);\n return false;\n }\n\n var withOp = !cm.curOp;\n if (withOp) startOperation(cm);\n cm.display.shift = false;\n\n if (text.charCodeAt(0) == 0x200b && doc.sel == cm.display.selForContextMenu && !prevInput)\n prevInput = \"\\u200b\";\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length);\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) ++same;\n var inserted = text.slice(same), textLines = splitLines(inserted);\n\n // When pasing N lines into N selections, insert one line per selection\n var multiPaste = null;\n if (cm.state.pasteIncoming && doc.sel.ranges.length > 1) {\n if (lastCopied && lastCopied.join(\"\\n\") == inserted)\n multiPaste = doc.sel.ranges.length % lastCopied.length == 0 && map(lastCopied, splitLines);\n else if (textLines.length == doc.sel.ranges.length)\n multiPaste = map(textLines, function(l) { return [l]; });\n }\n\n // Normal behavior is to insert the new text into every selection\n for (var i = doc.sel.ranges.length - 1; i >= 0; i--) {\n var range = doc.sel.ranges[i];\n var from = range.from(), to = range.to();\n // Handle deletion\n if (same < prevInput.length)\n from = Pos(from.line, from.ch - (prevInput.length - same));\n // Handle overwrite\n else if (cm.state.overwrite && range.empty() && !cm.state.pasteIncoming)\n to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length));\n var updateInput = cm.curOp.updateInput;\n var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i % multiPaste.length] : textLines,\n origin: cm.state.pasteIncoming ? \"paste\" : cm.state.cutIncoming ? \"cut\" : \"+input\"};\n makeChange(cm.doc, changeEvent);\n signalLater(cm, \"inputRead\", cm, changeEvent);\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (inserted && !cm.state.pasteIncoming && cm.options.electricChars &&\n cm.options.smartIndent && range.head.ch < 100 &&\n (!i || doc.sel.ranges[i - 1].head.line != range.head.line)) {\n var mode = cm.getModeAt(range.head);\n var end = changeEnd(changeEvent);\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indentLine(cm, end.line, \"smart\");\n break;\n }\n } else if (mode.electricInput) {\n if (mode.electricInput.test(getLine(doc, end.line).text.slice(0, end.ch)))\n indentLine(cm, end.line, \"smart\");\n }\n }\n }\n ensureCursorVisible(cm);\n cm.curOp.updateInput = updateInput;\n cm.curOp.typing = true;\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) input.value = cm.display.prevInput = \"\";\n else cm.display.prevInput = text;\n if (withOp) endOperation(cm);\n cm.state.pasteIncoming = cm.state.cutIncoming = false;\n return true;\n }", "title": "" }, { "docid": "0e28b84f42b95ad81b65f2ff280792ba", "score": "0.5519915", "text": "function readInput(cm) {\n var input = cm.display.input, prevInput = cm.display.prevInput, doc = cm.doc;\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (!cm.state.focused || (hasSelection(input) && !prevInput) || isReadOnly(cm) || cm.options.disableInput || cm.state.keySeq)\n return false;\n // See paste handler for more on the fakedLastChar kludge\n if (cm.state.pasteIncoming && cm.state.fakedLastChar) {\n input.value = input.value.substring(0, input.value.length - 1);\n cm.state.fakedLastChar = false;\n }\n var text = input.value;\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) return false;\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && cm.display.inputHasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\n resetInput(cm);\n return false;\n }\n\n var withOp = !cm.curOp;\n if (withOp) startOperation(cm);\n cm.display.shift = false;\n\n if (text.charCodeAt(0) == 0x200b && doc.sel == cm.display.selForContextMenu && !prevInput)\n prevInput = \"\\u200b\";\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length);\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) ++same;\n var inserted = text.slice(same), textLines = splitLines(inserted);\n\n // When pasing N lines into N selections, insert one line per selection\n var multiPaste = null;\n if (cm.state.pasteIncoming && doc.sel.ranges.length > 1) {\n if (lastCopied && lastCopied.join(\"\\n\") == inserted)\n multiPaste = doc.sel.ranges.length % lastCopied.length == 0 && map(lastCopied, splitLines);\n else if (textLines.length == doc.sel.ranges.length)\n multiPaste = map(textLines, function(l) { return [l]; });\n }\n\n // Normal behavior is to insert the new text into every selection\n for (var i = doc.sel.ranges.length - 1; i >= 0; i--) {\n var range = doc.sel.ranges[i];\n var from = range.from(), to = range.to();\n // Handle deletion\n if (same < prevInput.length)\n from = Pos(from.line, from.ch - (prevInput.length - same));\n // Handle overwrite\n else if (cm.state.overwrite && range.empty() && !cm.state.pasteIncoming)\n to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length));\n var updateInput = cm.curOp.updateInput;\n var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i % multiPaste.length] : textLines,\n origin: cm.state.pasteIncoming ? \"paste\" : cm.state.cutIncoming ? \"cut\" : \"+input\"};\n makeChange(cm.doc, changeEvent);\n signalLater(cm, \"inputRead\", cm, changeEvent);\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (inserted && !cm.state.pasteIncoming && cm.options.electricChars &&\n cm.options.smartIndent && range.head.ch < 100 &&\n (!i || doc.sel.ranges[i - 1].head.line != range.head.line)) {\n var mode = cm.getModeAt(range.head);\n var end = changeEnd(changeEvent);\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indentLine(cm, end.line, \"smart\");\n break;\n }\n } else if (mode.electricInput) {\n if (mode.electricInput.test(getLine(doc, end.line).text.slice(0, end.ch)))\n indentLine(cm, end.line, \"smart\");\n }\n }\n }\n ensureCursorVisible(cm);\n cm.curOp.updateInput = updateInput;\n cm.curOp.typing = true;\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) input.value = cm.display.prevInput = \"\";\n else cm.display.prevInput = text;\n if (withOp) endOperation(cm);\n cm.state.pasteIncoming = cm.state.cutIncoming = false;\n return true;\n }", "title": "" }, { "docid": "571de3ca70e30b09ac8a666459887a1f", "score": "0.5518045", "text": "function checkCommentInput(){\n var comment = document.getElementById('contact_comment');\n comment.style.borderColor = comment.value !==\"\" ? \"\":\"red\";\n return comment.value !== \"\";\n}", "title": "" }, { "docid": "be63ed021c97b819d4f4c26367b91e55", "score": "0.5517439", "text": "function notEmpty(id) {\n\tif (document.getElementById(id).value === '') {\n\t\treturn false;\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "254904f717dab139b84876f96902c5a5", "score": "0.5516474", "text": "function checkIfText(text) {\n text.value = text.value.replace(/[^a-zA-Z-'\\n\\r.]+/g, '');\n}", "title": "" }, { "docid": "666c2a71d94569c70b5f5fb9c2b0c74b", "score": "0.5506848", "text": "isTyping() {\n return this._pressedLetters.length > 0;\n }", "title": "" }, { "docid": "666c2a71d94569c70b5f5fb9c2b0c74b", "score": "0.5506848", "text": "isTyping() {\n return this._pressedLetters.length > 0;\n }", "title": "" }, { "docid": "04000d0004e0f1090542081c3f28af8a", "score": "0.5502484", "text": "function readInput(cm) {\r\n var input = cm.display.input, prevInput = cm.display.prevInput, doc = cm.doc;\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (!cm.state.focused || (hasSelection(input) && !prevInput) || isReadOnly(cm) || cm.options.disableInput || cm.state.keySeq)\n return false;\n // See paste handler for more on the fakedLastChar kludge\n if (cm.state.pasteIncoming && cm.state.fakedLastChar) {\r\n input.value = input.value.substring(0, input.value.length - 1);\n cm.state.fakedLastChar = false;\r\n }\n var text = input.value;\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) return false;\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && cm.display.inputHasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\r\n resetInput(cm);\n return false;\r\n }\n\n var withOp = !cm.curOp;\n if (withOp) startOperation(cm);\n cm.display.shift = false;\n\n if (text.charCodeAt(0) == 0x200b && doc.sel == cm.display.selForContextMenu && !prevInput)\n prevInput = \"\\u200b\";\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length);\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same))++same;\n var inserted = text.slice(same), textLines = splitLines(inserted);\n\n // When pasing N lines into N selections, insert one line per selection\n var multiPaste = null;\n if (cm.state.pasteIncoming && doc.sel.ranges.length > 1) {\r\n if (lastCopied && lastCopied.join(\"\\n\") == inserted)\n multiPaste = doc.sel.ranges.length % lastCopied.length == 0 && map(lastCopied, splitLines);\n else if (textLines.length == doc.sel.ranges.length)\n multiPaste = map(textLines, function (l) { return [l]; });\r\n }\n\n // Normal behavior is to insert the new text into every selection\n for (var i = doc.sel.ranges.length - 1; i >= 0; i--) {\r\n var range = doc.sel.ranges[i];\n var from = range.from(), to = range.to();\n // Handle deletion\n if (same < prevInput.length)\n from = Pos(from.line, from.ch - (prevInput.length - same));\n // Handle overwrite\n else if (cm.state.overwrite && range.empty() && !cm.state.pasteIncoming)\n to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length));\n var updateInput = cm.curOp.updateInput;\n var changeEvent = {\r\n from: from, to: to, text: multiPaste ? multiPaste[i % multiPaste.length] : textLines,\n origin: cm.state.pasteIncoming ? \"paste\" : cm.state.cutIncoming ? \"cut\" : \"+input\"\r\n };\n makeChange(cm.doc, changeEvent);\n signalLater(cm, \"inputRead\", cm, changeEvent);\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (inserted && !cm.state.pasteIncoming && cm.options.electricChars &&\n cm.options.smartIndent && range.head.ch < 100 &&\n (!i || doc.sel.ranges[i - 1].head.line != range.head.line)) {\r\n var mode = cm.getModeAt(range.head);\n var end = changeEnd(changeEvent);\n if (mode.electricChars) {\r\n for (var j = 0; j < mode.electricChars.length; j++)\n if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\r\n indentLine(cm, end.line, \"smart\");\n break;\r\n }\r\n } else if (mode.electricInput) {\r\n if (mode.electricInput.test(getLine(doc, end.line).text.slice(0, end.ch)))\n indentLine(cm, end.line, \"smart\");\r\n }\r\n }\r\n }\n ensureCursorVisible(cm);\n cm.curOp.updateInput = updateInput;\n cm.curOp.typing = true;\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) input.value = cm.display.prevInput = \"\";\n else cm.display.prevInput = text;\n if (withOp) endOperation(cm);\n cm.state.pasteIncoming = cm.state.cutIncoming = false;\n return true;\r\n }", "title": "" }, { "docid": "0f065012685891fe5e805d6c1fa9133d", "score": "0.54991066", "text": "checkDescription(text) {\n text = text || this.state.answers.description;\n if (!isNotEmpty(text)) {\n return 'Please enter a description!';\n }\n return false;\n }", "title": "" }, { "docid": "4fdb5aad0b995ae3647ae4f91c84fa28", "score": "0.5494955", "text": "function formTextAreaUpdate() {\n\t$j('#tool_label',editelem).text( $j('#editbox_input_label').val() );\n\t$j('#tool_textarea_textarea',editelem).attr('placeholder', $j('#editbox_input_placeholder').val() );\n\tif ( $j('#editbox_input_required_checkbox').prop('checked') ) {\n\t\t$j('#tool_is_required', editelem).text('Yes');\n\t\t$j('#tool_label', editelem).addClass('tool_is_required');\n\t} else {\n\t\t$j('#tool_is_required', editelem).text('No');\n\t\t$j('#tool_label', editelem).removeClass('tool_is_required');\n\t}\n\t$j(editelem).removeClass('_form_element_notset');\n}", "title": "" }, { "docid": "68aa6b8da57084e4fa71d6bcac6f1ca2", "score": "0.5494825", "text": "function checkTextAreaMaxLength(textBox, e, parent) {\n var maxLength = parseInt($(textBox).data(\"length\"));\n if (!checkSpecialKeys(e)) { \n if (textBox.value.length > maxLength - 1) textBox.value = textBox.value.substring(0, maxLength); \n }\n $(\".char-count\", parent).html(maxLength - textBox.value.length);\n return true; \n }", "title": "" }, { "docid": "9d319fcc332e00c955b66f822021b7fd", "score": "0.5489939", "text": "checkIfEverythingHasValue(allFormData) {\n let emptyValueArray = allFormData.filter(form => form.value === \"\");\n if (emptyValueArray.length === 0) {\n $('.something-went-wrong').empty();\n return true;\n } else {\n $('form input, textarea').each(function() {\n if ($(this).val() == \"\") {\n $(this).addClass('red-border');\n\n $('.something-went-wrong').empty().append('Alla fält måste vara ifyllda!');\n }\n })\n return false;\n }\n }", "title": "" }, { "docid": "5a108492ddb018467fc31d6e1520077e", "score": "0.5488717", "text": "function checkComment() {\n\tvar uName = document.myForm.comment.value;\n\t//have they left comments blank?\n\tif (checkBlank(comment)) {\n\t\talert(\"Please enter comment!\");\n\t\t//display message, return false\n\t\treturn false;\n\t}\n\t//no problem, return true\n\treturn true;\n}", "title": "" }, { "docid": "d938a12cba973f42f864eb3d562df4de", "score": "0.54873693", "text": "function isText(txt) {\n return txt && typeof txt === 'string' && /\\S/.test(txt);\n}", "title": "" }, { "docid": "7e6e9096a68cdd314d9b4398759457a5", "score": "0.5472059", "text": "function check_question() {\n if ($(\"#enunciado\").val().length < 10) {\n $(\"#aviso\").html(\"El enunciado es demasiado corto.\");\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "1a5f5ae261785c3753b87bde5ca91630", "score": "0.5460909", "text": "function checkInput() {\n // Store the pasted content in a letiable\n let child = pasteCatcher.childNodes[0];\n\n // Clear the inner html to make sure we're always\n // getting the latest inserted content\n pasteCatcher.innerHTML = \"\";\n\n if (child) {\n // If the user pastes an image, the src attribute\n // will represent the image as a base64 encoded string.\n if ((child.tagName === \"IMG\") && (!executed)) {\n createImage(child.src);\n // Act once\n executed = true;\n }\n }\n}", "title": "" }, { "docid": "9d7e5d1bb9ebd8a0b48845e3682a6ff2", "score": "0.54449844", "text": "isEmpty(editor, element) {\n var {\n children\n } = element;\n var [first] = children;\n return children.length === 0 || children.length === 1 && Text.isText(first) && first.text === '' && !editor.isVoid(element);\n }", "title": "" }, { "docid": "4ee61325c0c0ffd512a0eaebc0a07200", "score": "0.5442219", "text": "function containsThings (input){\n if (input.val().length > 0){\n return true;\n } else if (!$('#length-err').length) {\n $(input).after('<br><span id=\"length-err\" class=\"error\">Please provide an entry</span><br>');\n submit = false;\n }\n}", "title": "" } ]
6d3fc214765c2bec6e669629bdc538cb
Remove class with compatibility for SVG since classList is not supported on SVG elements in IE
[ { "docid": "f95eb1c96fd1b236f13dcb18e68782ac", "score": "0.0", "text": "function removeClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.remove(c); });\n } else {\n el.classList.remove(cls);\n }\n if (!el.classList.length) {\n el.removeAttribute('class');\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n var tar = ' ' + cls + ' ';\n while (cur.indexOf(tar) >= 0) {\n cur = cur.replace(tar, ' ');\n }\n cur = cur.trim();\n if (cur) {\n el.setAttribute('class', cur);\n } else {\n el.removeAttribute('class');\n }\n }\n}", "title": "" } ]
[ { "docid": "e1d17cc69fb65aacd4d3285d4b55a185", "score": "0.78202724", "text": "svgRemoveClass (el, classStr) {\n const oldClassList = el.className.baseVal.split(/\\s/)\n const newClassList = _.without.apply(null, [oldClassList].concat(classStr.split(/\\s/)))\n el.className.baseVal = newClassList.join(' ')\n }", "title": "" }, { "docid": "1f75a0dd43dc8c785363b3c619f2166a", "score": "0.7722707", "text": "function removeClasses(n) {\n if (!n) {\n return;\n }\n\n // SVG elements dont have string classnames.\n if (typeof n.className === 'string') {\n //Remove coal classes too\n /*jshint -W109 */\n n.className = n.className.replace(new RegExp(window.VWOInjected.coalClassPrefix + '[\\\\d]{13}_[\\\\d]*','g'), '').replace(/vwo(_\\w+)*_[\\d]{13}/g, '');\n if (n.className.replace(/\\s/g, '') === '') {\n n.removeAttribute('class');\n }\n }\n\n if (n.childNodes && n.childNodes.length) {\n for (var i = n.childNodes.length - 1; i >= 0; i--) {\n removeClasses(n.childNodes[i]);\n }\n }\n }", "title": "" }, { "docid": "5127a584e611b3e5f57271f6982780c3", "score": "0.6966817", "text": "svgAddClass (el, classStr) {\n const oldClassList = el.className.baseVal.split(/\\s/)\n // TODO: CHECK THIS!!!! WAS LODASH/UNDERSCORE\n // let newClassList = _.compact(_.unique(oldClassList.concat(classStr.split(/\\/s/))))\n const newClassList = [...new Set(oldClassList.concat(classStr.split(/\\/s/)))].filter()\n el.className.baseVal = newClassList.join(' ')\n }", "title": "" }, { "docid": "896eabe73259ba806820fde7d581f6a4", "score": "0.68517166", "text": "function svgToggleClass(svg, name, forceAdd) {\n var list = svg.getAttribute('class').trim().split(/\\s+/);\n var uniqueList = Object.keys(list.reduce(function (o, item) {\n return Object.assign(o, _defineProperty({}, item, 1));\n }, {}));\n var index = uniqueList.indexOf(name);\n var found = index >= 0;\n var add = forceAdd === undefined ? !found : forceAdd;\n\n if (found === !add) {\n if (add) {\n uniqueList.push(name);\n } else {\n uniqueList.splice(index, 1);\n }\n\n svg.setAttribute('class', uniqueList.join(' '));\n }\n}", "title": "" }, { "docid": "cbd092727f788cb37381fc5c1c438479", "score": "0.6710234", "text": "function removeClassAttr()\r\n{\r\n\tvar container=getSelectedContainer();\r\n\tif(container!=null)\r\n\t{\r\n\t\tcontainer.removeAttribute(\"className\",false);\r\n\t}\r\n}", "title": "" }, { "docid": "2be4ad4188d6d45db5dae60d6d3eed69", "score": "0.6613341", "text": "function clearClass() {\n\n var x = document.querySelectorAll(\"span.highlighted\");\n for (var i = 0; i < x.length; i++) {\n x[i].removeAttribute('class');\n }\n }", "title": "" }, { "docid": "434942f44733f95e74235ad413e1c63c", "score": "0.6590539", "text": "function removeClassName(c) {this.className=xClassName.call(this, c);}", "title": "" }, { "docid": "8b12fb2c5db0e2ea5e879f6d1f591588", "score": "0.65282136", "text": "function cleanUp() {\r\n document\r\n .querySelector('svg')\r\n .querySelectorAll('*')\r\n .forEach((el) => {\r\n el.classList.remove('active');\r\n });\r\n\r\n document.querySelector('svg').setAttribute('data-hour', '');\r\n document.querySelector('svg').setAttribute('data-minute', '');\r\n document.querySelector('svg').setAttribute('data-second', '');\r\n}", "title": "" }, { "docid": "44c97e754c461558e6ecb0ae00772024", "score": "0.64886093", "text": "removeEdgeClasses() {\n\t\tthis.elements.forEach(el => {\n\t\t\tel.classList.remove('right-edge');\n\t\t\tel.classList.remove('left-edge');\n\t\t});\n\t}", "title": "" }, { "docid": "2079fb58f35bbb7e1d8808f98ca6eaba", "score": "0.64164406", "text": "function patchClass(el, value, isSVG) {\r\n // directly setting className should be faster than setAttribute in theory\r\n // if this is an element during a transition, take the temporary transition\r\n // classes into account.\r\n const transitionClasses = el._vtc;\r\n if (transitionClasses) {\r\n value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(' ');\r\n }\r\n if (value == null) {\r\n el.removeAttribute('class');\r\n }\r\n else if (isSVG) {\r\n el.setAttribute('class', value);\r\n }\r\n else {\r\n el.className = value;\r\n }\r\n}", "title": "" }, { "docid": "1e8beda023ca93cea8cc855037371c19", "score": "0.641034", "text": "removeClass(classes) {\n return this.component.classList.remove(classes);\n }", "title": "" }, { "docid": "539110813bffc8707ffacd969c7de6b3", "score": "0.6399064", "text": "function patchClass(el, value, isSVG) {\n // directly setting className should be faster than setAttribute in theory\n // if this is an element during a transition, take the temporary transition\n // classes into account.\n const transitionClasses = el._vtc;\n if (transitionClasses) {\n value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(' ');\n }\n if (value == null) {\n el.removeAttribute('class');\n }\n else if (isSVG) {\n el.setAttribute('class', value);\n }\n else {\n el.className = value;\n }\n}", "title": "" }, { "docid": "e28e99b25bede4de7168d0f196af47b8", "score": "0.6377023", "text": "function patchClass(el, value, isSVG) {\n // directly setting className should be faster than setAttribute in theory\n // if this is an element during a transition, take the temporary transition\n // classes into account.\n const transitionClasses = el._vtc;\n if (transitionClasses) {\n value = (value\n ? [value, ...transitionClasses]\n : [...transitionClasses]).join(' ');\n }\n if (value == null) {\n el.removeAttribute('class');\n }\n else if (isSVG) {\n el.setAttribute('class', value);\n }\n else {\n el.className = value;\n }\n}", "title": "" }, { "docid": "2b0b3cff7cc4d2807ffe82ba12fe4ef7", "score": "0.6373464", "text": "function removeClass(el,cls){/* istanbul ignore if */if(!cls||!(cls=cls.trim())){return;}/* istanbul ignore else */if(el.classList){if(cls.indexOf(' ')>-1){cls.split(/\\s+/).forEach(function(c){return el.classList.remove(c);});}else{el.classList.remove(cls);}}else{var cur=\" \"+(el.getAttribute('class')||'')+\" \";var tar=' '+cls+' ';while(cur.indexOf(tar)>=0){cur=cur.replace(tar,' ');}el.setAttribute('class',cur.trim());}}", "title": "" }, { "docid": "439d4a395e89418226d3ce5e7bb909d3", "score": "0.6355343", "text": "function patchClass(el, value, isSVG) {\n if (value == null) {\n value = '';\n }\n if (isSVG) {\n el.setAttribute('class', value);\n }\n else {\n // directly setting className should be faster than setAttribute in theory\n // if this is an element during a transition, take the temporary transition\n // classes into account.\n const transitionClasses = el._vtc;\n if (transitionClasses) {\n value = (value\n ? [value, ...transitionClasses]\n : [...transitionClasses]).join(' ');\n }\n el.className = value;\n }\n}", "title": "" }, { "docid": "d961ed8df43ed87f77ba3b3eeab911c1", "score": "0.63451463", "text": "function clearClass(className){\n try{\n do{\n var icons = document.getElementsByClassName(className);\n icons[0].parentNode.removeChild(icons[0]);\n }while(icons.length > 0);\n }catch(exception){}\n}", "title": "" }, { "docid": "2e2025273dacf9e85f5068724cceb89e", "score": "0.63379765", "text": "removeClass(className) {\n this.getHTML().classList.remove(className);\n }", "title": "" }, { "docid": "5f3a88e6323abd7a089dc5ac0ba635dd", "score": "0.6334954", "text": "function removeClass(elmts) {\n for(var i= 0; i<elmts.length; i++)\n elmts[i].className = '';\n}", "title": "" }, { "docid": "e1f532b165740f571cf91ed31a5028a2", "score": "0.6330162", "text": "function w3RemoveClass(element, name) {\r\n var i, arr1, arr2;\r\n arr1 = element.className.split(\" \");\r\n arr2 = name.split(\" \");\r\n for (i = 0; i < arr2.length; i++) {\r\n while (arr1.indexOf(arr2[i]) > -1) {\r\n arr1.splice(arr1.indexOf(arr2[i]), 1);\r\n }\r\n }\r\n element.className = arr1.join(\" \");\r\n}", "title": "" }, { "docid": "e1f532b165740f571cf91ed31a5028a2", "score": "0.6330162", "text": "function w3RemoveClass(element, name) {\r\n var i, arr1, arr2;\r\n arr1 = element.className.split(\" \");\r\n arr2 = name.split(\" \");\r\n for (i = 0; i < arr2.length; i++) {\r\n while (arr1.indexOf(arr2[i]) > -1) {\r\n arr1.splice(arr1.indexOf(arr2[i]), 1);\r\n }\r\n }\r\n element.className = arr1.join(\" \");\r\n}", "title": "" }, { "docid": "d00e52642dcd7ee733f5ede8c9820c4a", "score": "0.6323226", "text": "function w3RemoveClass(element, name) {\r\n var i, arr1, arr2;\r\n arr1 = element.className.split(\" \");\r\n arr2 = name.split(\" \");\r\n for (i = 0; i < arr2.length; i++) {\r\n while (arr1.indexOf(arr2[i]) > -1) {\r\n arr1.splice(arr1.indexOf(arr2[i]), 1);\r\n }\r\n }\r\n element.className = arr1.join(\" \");\r\n}", "title": "" }, { "docid": "149e7a2e603c0fbca74835e852b7d2bd", "score": "0.6320399", "text": "function removeClass(el,cls){ /* istanbul ignore if */if(!cls || !cls.trim()){return;} /* istanbul ignore else */if(el.classList){if(cls.indexOf(' ') > -1){cls.split(/\\s+/).forEach(function(c){return el.classList.remove(c);});}else {el.classList.remove(cls);}}else {var cur=' ' + el.getAttribute('class') + ' ';var tar=' ' + cls + ' ';while(cur.indexOf(tar) >= 0) {cur = cur.replace(tar,' ');}el.setAttribute('class',cur.trim());}}", "title": "" }, { "docid": "fc2afa603f75402ff5e2fb9ccb30eeea", "score": "0.63040376", "text": "_removeClasses(rawClassVal) {\n if (rawClassVal) {\n if (Array.isArray(rawClassVal) || rawClassVal instanceof Set) {\n rawClassVal.forEach(klass => this._toggleClass(klass, false));\n } else {\n Object.keys(rawClassVal).forEach(klass => this._toggleClass(klass, false));\n }\n }\n }", "title": "" }, { "docid": "6ed64be5fe3684d8b775eb65db6d9cd0", "score": "0.6290721", "text": "function w3RemoveClass(element, name) {\n\t\tvar i, arr1, arr2;\n\t\tarr1 = element.className.split(\" \");\n\t\tarr2 = name.split(\" \");\n\t\tfor (i = 0; i < arr2.length; i++) {\n\t\t\twhile (arr1.indexOf(arr2[i]) > -1) {\n\t\t\t\tarr1.splice(arr1.indexOf(arr2[i]), 1);\n\t\t\t}\n\t\t}\n\t\telement.className = arr1.join(\" \");\n\t}", "title": "" }, { "docid": "f693087dbdb14584b4f4261ded790128", "score": "0.62873566", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "f693087dbdb14584b4f4261ded790128", "score": "0.62873566", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "f693087dbdb14584b4f4261ded790128", "score": "0.62873566", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "f693087dbdb14584b4f4261ded790128", "score": "0.62873566", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "f693087dbdb14584b4f4261ded790128", "score": "0.62873566", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "f693087dbdb14584b4f4261ded790128", "score": "0.62873566", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "ed1cc1f2b18e3533d12232a662852aab", "score": "0.628591", "text": "removeClass(className) {\n return this._getDOMHandle().classList.remove(className);\n }", "title": "" }, { "docid": "06dc362e9537f5cfd5a5fc895f172fab", "score": "0.6282281", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "06dc362e9537f5cfd5a5fc895f172fab", "score": "0.6282281", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "06dc362e9537f5cfd5a5fc895f172fab", "score": "0.6282281", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "06dc362e9537f5cfd5a5fc895f172fab", "score": "0.6282281", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "61d39e11bf4be171e85a32a45286089a", "score": "0.62568694", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(' ');\n arr2 = name.split(' ');\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(' ');\n}", "title": "" }, { "docid": "03b1b130cdf100e5fa70dbe6561adda4", "score": "0.6231925", "text": "_removeClasses(rawClassVal) {\n if (rawClassVal) {\n if (Array.isArray(rawClassVal) || rawClassVal instanceof Set) {\n rawClassVal.forEach((klass) => this._toggleClass(klass, false));\n }\n else {\n Object.keys(rawClassVal).forEach(klass => this._toggleClass(klass, false));\n }\n }\n }", "title": "" }, { "docid": "03b1b130cdf100e5fa70dbe6561adda4", "score": "0.6231925", "text": "_removeClasses(rawClassVal) {\n if (rawClassVal) {\n if (Array.isArray(rawClassVal) || rawClassVal instanceof Set) {\n rawClassVal.forEach((klass) => this._toggleClass(klass, false));\n }\n else {\n Object.keys(rawClassVal).forEach(klass => this._toggleClass(klass, false));\n }\n }\n }", "title": "" }, { "docid": "03b1b130cdf100e5fa70dbe6561adda4", "score": "0.6231925", "text": "_removeClasses(rawClassVal) {\n if (rawClassVal) {\n if (Array.isArray(rawClassVal) || rawClassVal instanceof Set) {\n rawClassVal.forEach((klass) => this._toggleClass(klass, false));\n }\n else {\n Object.keys(rawClassVal).forEach(klass => this._toggleClass(klass, false));\n }\n }\n }", "title": "" }, { "docid": "f644908deabae649f84dcf785b9af60a", "score": "0.62012786", "text": "clearZoom() {\n Array.from(this.complete.childNodes).forEach((_) =>\n _.classList.remove('lock')\n );\n }", "title": "" }, { "docid": "7fa7cba8aae5102e2f8b58e2a43cc75e", "score": "0.61877", "text": "function removeClass(el,cls){ /* istanbul ignore if */if(!cls || !(cls = cls.trim())){return;} /* istanbul ignore else */if(el.classList){if(cls.indexOf(' ') > -1){cls.split(/\\s+/).forEach(function(c){return el.classList.remove(c);});}else {el.classList.remove(cls);}if(!el.classList.length){el.removeAttribute('class');}}else {var cur=\" \" + (el.getAttribute('class') || '') + \" \";var tar=' ' + cls + ' ';while(cur.indexOf(tar) >= 0) {cur = cur.replace(tar,' ');}cur = cur.trim();if(cur){el.setAttribute('class',cur);}else {el.removeAttribute('class');}}}", "title": "" }, { "docid": "cef8e90b5dbce5f142a52a98864d9dd2", "score": "0.6167132", "text": "function removeClass(el,cls){/* istanbul ignore if */if(!cls||!(cls=cls.trim())){return;}/* istanbul ignore else */if(el.classList){if(cls.indexOf(' ')>-1){cls.split(whitespaceRE).forEach(function(c){return el.classList.remove(c);});}else{el.classList.remove(cls);}if(!el.classList.length){el.removeAttribute('class');}}else{var cur=\" \"+(el.getAttribute('class')||'')+\" \";var tar=' '+cls+' ';while(cur.indexOf(tar)>=0){cur=cur.replace(tar,' ');}cur=cur.trim();if(cur){el.setAttribute('class',cur);}else{el.removeAttribute('class');}}}", "title": "" }, { "docid": "cef8e90b5dbce5f142a52a98864d9dd2", "score": "0.6167132", "text": "function removeClass(el,cls){/* istanbul ignore if */if(!cls||!(cls=cls.trim())){return;}/* istanbul ignore else */if(el.classList){if(cls.indexOf(' ')>-1){cls.split(whitespaceRE).forEach(function(c){return el.classList.remove(c);});}else{el.classList.remove(cls);}if(!el.classList.length){el.removeAttribute('class');}}else{var cur=\" \"+(el.getAttribute('class')||'')+\" \";var tar=' '+cls+' ';while(cur.indexOf(tar)>=0){cur=cur.replace(tar,' ');}cur=cur.trim();if(cur){el.setAttribute('class',cur);}else{el.removeAttribute('class');}}}", "title": "" }, { "docid": "1b502bf1afe8d67d015388f03e052dbe", "score": "0.61473125", "text": "function removeClass() {\n list.forEach(el => {\n el.classList.remove('actived');\n })\n }", "title": "" }, { "docid": "5932224c16b6eda967493a5eeef552a5", "score": "0.6139272", "text": "function removeClass (domNode, classes) {\n var elementClass = ' ' + domNode.className + ' ';\n classes.split(' ').forEach(function (c) {\n elementClass = elementClass.replace(' ' + c + ' ', ' ');\n });\n domNode.className = elementClass.trim();\n }", "title": "" }, { "docid": "920898d12521fa0ed659b003ac0e9509", "score": "0.61262745", "text": "removeclass(classname) {\n if (elation.html.hasclass(this, classname)) {\n elation.html.removeclass(this, classname);\n }\n }", "title": "" }, { "docid": "a9e3bef47f5d19c9e76f71b81645e941", "score": "0.6115999", "text": "function removeAllClasses () {\n \"use strict\";\n // Loop Through Images\n slidrImages.forEach(function(image){\n image.classList.remove(\"active\");\n });\n // Loop Through Pagination Bullets \n paginationsBullets.forEach(function(bullet){\n bullet.classList.remove(\"active\");\n });\n }", "title": "" }, { "docid": "1fead7eaf7510f1f9a08fb1e5e7888d9", "score": "0.6114797", "text": "function removeClasses(el){\n while (el.firstChild) {\n el.removeChild(el.firstChild);\n }\n}", "title": "" }, { "docid": "cf17007e8073c7edf761e50f9a514d13", "score": "0.61134166", "text": "function removeClass(){document.body.className=document.body.className.replace(/ dragging-files/g,'')}", "title": "" }, { "docid": "5f95b7eaf3c857f8ee6dbf5e71130fff", "score": "0.609549", "text": "_clearExistingBadges(cssClass) {\n const element = this._elementRef.nativeElement;\n let childCount = element.children.length;\n // Use a reverse while, because we'll be removing elements from the list as we're iterating.\n while (childCount--) {\n const currentChild = element.children[childCount];\n if (currentChild.classList.contains(cssClass)) {\n element.removeChild(currentChild);\n }\n }\n }", "title": "" }, { "docid": "5f95b7eaf3c857f8ee6dbf5e71130fff", "score": "0.609549", "text": "_clearExistingBadges(cssClass) {\n const element = this._elementRef.nativeElement;\n let childCount = element.children.length;\n // Use a reverse while, because we'll be removing elements from the list as we're iterating.\n while (childCount--) {\n const currentChild = element.children[childCount];\n if (currentChild.classList.contains(cssClass)) {\n element.removeChild(currentChild);\n }\n }\n }", "title": "" }, { "docid": "154e7dca1e7ea09359ed63e9e977b3dd", "score": "0.60905075", "text": "function _cleanupClasses(target) {\n\t for (var i = 0; i < this._dirtyClasses.length; i++) target.classList.remove(this._dirtyClasses[i]);\n\t this._dirtyClasses = [];\n\t }", "title": "" }, { "docid": "58a804621eacddbd2f64e85ba827ef09", "score": "0.60560226", "text": "removeClass(target) {\n if (this._shouldApplyClass) {\n const id = target.dataset.babsi;\n const obj = this._currentTracked[id];\n obj.canvas.classList.remove(this._applyClass);\n }\n }", "title": "" }, { "docid": "0d97aba8379d62abed556b522a1b282e", "score": "0.60223854", "text": "function tcSvgHack($timeout) {\n return {\n restrict: 'A',\n link: function(scope, element, attrs) {\n var elem = $(element);\n var selectors = attrs.tcSvgHack;\n scope.$watch(function() {\n return elem[0].className;\n }, function(newClasses, oldClasses) {\n var childrenToRedraw = elem.find(selectors);\n childrenToRedraw.hide();\n childrenToRedraw.show();\n }, true); \n }\n };\n}", "title": "" }, { "docid": "01709d4c34486709167ec8e731ff84ef", "score": "0.60139716", "text": "function removeClassFromNodeList(nodeList, className){\n if(typeof className === \"object\") {\n nodeList.forEach(function(element){\n for(var index = 0; index < className.length; index++) {\n element.classList.remove(className[index]);\n }\n });\n } else {\n nodeList.forEach(function(element){\n element.classList.remove(className);\n });\n }\n}", "title": "" }, { "docid": "c1298cecce6e3cc80f8d2653a8d8886d", "score": "0.6006239", "text": "function removeClass() {\n btnPercent.forEach((btn) => {\n btn.classList.remove('select');\n });\n}", "title": "" }, { "docid": "185bcdb03a06b325e8847ab3c8240339", "score": "0.599939", "text": "function _cleanupClasses(target) {\n for (var i = 0; i < this._dirtyClasses.length; i++) target.classList.remove(this._dirtyClasses[i]);\n this._dirtyClasses = [];\n }", "title": "" }, { "docid": "638d40c64ecd5600e162c123863c305a", "score": "0.5991474", "text": "removeExtinguishFct() {\n this.progressBar.classList.remove('gn-extinguish');\n }", "title": "" }, { "docid": "e539f3613c664c3cf1cce17a25428258", "score": "0.59910023", "text": "function removeClassOnceIfPresent(Tag, tclass) {\r\n\r\n 'use strict';\r\n\r\n // take the current class list and tokenize on spaces\r\n var Classes = Tag.className.split(' '),\r\n i;\r\n\r\n // iterate the resulting classes\r\n for (i in Classes) {\r\n\r\n if (Classes.hasOwnProperty(i)) {\r\n\r\n // remove any matching element\r\n if (Classes[i] === tclass) {\r\n\r\n Classes.splice(i, 1);\r\n\r\n // then immediately recombine and return\r\n Tag.className = Classes.join(' ');\r\n return;\r\n\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "39d46277ea5f263c74e93f6a720d57bd", "score": "0.598808", "text": "clearColorClasses() {\n this.containerEl.classList.remove(this.CSS.wrapperWarning);\n this.containerEl.classList.remove(this.CSS.wrapperError);\n this.containerEl.classList.remove(this.CSS.wrapperSuccess);\n\n this.descEl.classList.remove(this.CSS.descInputWarning);\n this.descEl.classList.remove(this.CSS.descInputError);\n this.descEl.classList.remove(this.CSS.descInputSuccess);\n\n this.sideIcon.classList.remove(this.CSS.sideIconWarning);\n this.sideIcon.classList.remove(this.CSS.sideIconError);\n this.sideIcon.classList.remove(this.CSS.sideIconSuccess);\n }", "title": "" }, { "docid": "5e6c838f2beeb3e114ce450ea1fc3e22", "score": "0.59860945", "text": "function removeCircStyle() { \n d3.selectAll('circle')\n .classed(\"selected\", false)\n .style('stroke', null).style('opacity', 0.15);\n }", "title": "" }, { "docid": "7fbd7ce591031744361c23e9c3a6d38e", "score": "0.59856766", "text": "removeClass(elem, className) {\n const element = elem;\n if (element.classList.length) {\n element.classList.remove(className);\n }\n }", "title": "" }, { "docid": "6b193b25fc32e7bd0e8332320e1e4210", "score": "0.59841573", "text": "clearClasses() {\n let classes = ['infobox-sector', 'infobox-star', 'infobox-planet', 'infobox-moon']\n for (let className of classes) {\n this.infobox.classList.remove(className)\n }\n }", "title": "" }, { "docid": "c24e8a12452abb16d2eda7172fdb995e", "score": "0.5974593", "text": "function removeClass(el, klass){\r\n\tel.className = el.className.replace(getTokenizedExp(klass, \"g\"),\" \").normalize();\r\n}", "title": "" }, { "docid": "86b111bacaa9aa4ef04a1af731267425", "score": "0.59721345", "text": "function removeClass(e,c) {\n\tif (e.length === undefined)\n\t\te = [e];\n\tfor (x in e)\n\t\tif (!isNaN(x))\n\t\t\tif (hasClass(e[x],c))\n\t\t\t\te[x].className=e[x].className.replace(new RegExp('(\\\\s|^)'+c+'(\\\\s|$)'),' ').trim();\n}", "title": "" }, { "docid": "ad2e8fbd89091c02df43ba8434e9a092", "score": "0.5959942", "text": "function removeClass(node, className) {\n $(node).hasClass(className) ? $(node).removeClass(className) : \"\";\n}", "title": "" }, { "docid": "0b66d190879ce1aa50687892d55b81d9", "score": "0.59444773", "text": "removeCheckedLabelClass(items){\n items.forEach( el => {\n el.classList.remove('checked-label');\n })\n }", "title": "" }, { "docid": "656136a955af815f3cc5746c87d68998", "score": "0.59412694", "text": "clean () {\n this.svg.select('g').remove()\n }", "title": "" }, { "docid": "dd9c56223048ce092a661711427969ba", "score": "0.59410584", "text": "function _removeClass() {\n openCards[0].classList.remove('open', 'show');\n openCards[1].classList.remove('open', 'show');\n openCards.splice(0, 2);\n}", "title": "" }, { "docid": "8a70e9326f8d7701c734278390ee5c64", "score": "0.5939597", "text": "function changeIptClass(ipt){\r\n ipt.classList.remove('w3-border');\r\n ipt.classList.remove('w3-border-red');\r\n}", "title": "" }, { "docid": "ab49026cef5edf3d8143c40d021cb216", "score": "0.5929643", "text": "function deselect(elem) {\n elem.classList = \"\";\n }", "title": "" }, { "docid": "776f3ea5c23065afa63e989bb8e2368e", "score": "0.59281075", "text": "function removeClass(elements, classToRemove) {\n\n for (var index = 0; index < elements.length; index++) { \n elements[index].classList.remove(classToRemove);\n }\n}", "title": "" }, { "docid": "11418f4706d8104607d428ae980f5dfa", "score": "0.59235895", "text": "function clearStatusClass(element){\r\n element.classList.remove('correct'); //make screen neutral \r\n element.classList.remove('wrong');\r\n}", "title": "" }, { "docid": "b01bd6f581f808570e5bb874081dc748", "score": "0.5920133", "text": "function removeCSSClass( elm, cssClass ) {\n\tdojo.removeClass( elm, cssClass );\n}", "title": "" }, { "docid": "e0b605b626faad3060c4d7a470e08967", "score": "0.5919814", "text": "cleanTipClass () {\n const tip = this.getTipElement()\n const tabClass = tip.className.match(BSCLS_PREFIX_REGEX)\n if (tabClass !== null && tabClass.length > 0) {\n tabClass.forEach(cls => {\n removeClass(tip, cls)\n })\n }\n }", "title": "" }, { "docid": "8a9ce706eb6049c24498a7744f069366", "score": "0.5914036", "text": "function clearStatusClass(element) {\n element.classList.remove(\"correct\")\n element.classList.remove(\"wrong\")\n}", "title": "" }, { "docid": "4fc81e908e3cf34b03c4a7a2503c9aaf", "score": "0.59055066", "text": "removeClass(className) {\n var _a;\n delete this.attrs.classes[className];\n (_a = this.registry) === null || _a === void 0 ? void 0 : _a.onUpdate({\n id: this.attrs.id,\n name: 'class',\n value: undefined,\n oldValue: className,\n });\n return this;\n }", "title": "" }, { "docid": "2c0fa84d8ff932d93700dcbec831507a", "score": "0.5904045", "text": "function safeRemoveClass(element, cls) {\n if (element.size() > 0 && element.hasClass(cls))\n element.removeClass(cls);\n }", "title": "" }, { "docid": "bde22603bda3b257af1f4d5b3a21c9ab", "score": "0.5902824", "text": "function ignoreClassNames(){\n Object.keys( defaults.ignoreClassNames ).forEach(function(selector, index){\n var classNames = defaults.ignoreClassNames[selector].trim();\n dom.querySelectorAll(selector).forEach(function(element) {\n classNames.split(' ').forEach(function(className) {\n element.classList.remove(className.trim());\n });\n\n if( ( element.getAttribute('class') || '' ).trim() == '' ){\n element.removeAttribute('class');\n }\n });\n });\n }", "title": "" }, { "docid": "fccdcd7851dec611e29c3b952d6c26cb", "score": "0.58972037", "text": "function removeGlow() {\n document.getElementById('0').classList.remove('greenGl','redGl')\n document.getElementById('1').classList.remove('greenGl','redGl')\n document.getElementById(\"2\").classList.remove(\"greenGl\", \"redGl\")\n}", "title": "" }, { "docid": "1ac40c7b76c4816e78649e03a17f7352", "score": "0.5888763", "text": "function UnsetClassName(element, strClassName)\n{\n var bModified = false;\n var tokenArray = tokenize(element[\"className\"], ' ', true);\n for(var i=0; i<tokenArray.length; i++)\n {\n if(tokenArray[i] == strClassName) \n {\n bModified = true;\n tokenArray[i] = '';\n }\n }\n \n if(bModified)\n {\n element[\"className\"] = tokenArray.join(' ');\n }\n}", "title": "" }, { "docid": "8c07d32e9334b91014d11ac37cb6328f", "score": "0.5887493", "text": "clearStatusClass(element) {\n element.classList.remove(\"correct\");\n element.classList.remove(\"wrong\");\n }", "title": "" }, { "docid": "6be6dc2df9f79ca8de12b68146ce4ae9", "score": "0.5883839", "text": "function removeClass(className) {\n if (hasClass(className)) {\n documentElement.className = documentElement.className.replace(\n ` ${className}`,\n ''\n )\n }\n}", "title": "" }, { "docid": "def4b564946886fdf912cb52d4db8300", "score": "0.5877666", "text": "removeClassNames() {\n const {classNames} = this.options\n const classList = (Object.keys(classNames).map(key => classNames[key]))\n\n this.el.classList.remove(...classList)\n this.slides.forEach(slide => {\n slide.classList.remove(...classList)\n })\n }", "title": "" }, { "docid": "c16c16f5d44c9b1f13995cc41a055fdd", "score": "0.58705145", "text": "function RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1); \n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "f7ef3df378b1bd76ef076e030b69cdc5", "score": "0.58603764", "text": "get classes() {\n const result = {};\n const element = this.nativeElement;\n // SVG elements return an `SVGAnimatedString` instead of a plain string for the `className`.\n const className = element.className;\n const classes = typeof className !== 'string' ? className.baseVal.split(' ') : className.split(' ');\n classes.forEach(value => result[value] = true);\n return result;\n }", "title": "" }, { "docid": "c198f8b6f723dabb0913a36c78116d2c", "score": "0.5856104", "text": "function clearStatusClass(element) {\n element.classList.remove(\"correct\");\n element.classList.remove(\"wrong\");\n}", "title": "" }, { "docid": "c198f8b6f723dabb0913a36c78116d2c", "score": "0.5856104", "text": "function clearStatusClass(element) {\n element.classList.remove(\"correct\");\n element.classList.remove(\"wrong\");\n}", "title": "" }, { "docid": "5ed95aa4691409ad2183e5abf5b78fed", "score": "0.58548933", "text": "function removeClass() {\n const remove = document.querySelector('.active');\n remove.className = '';\n return remove;\n}", "title": "" }, { "docid": "db64c4bc047b4400345842219b94800f", "score": "0.58526677", "text": "function RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++)\n while (arr1.indexOf(arr2[i]) > -1)\n arr1.splice(arr1.indexOf(arr2[i]), 1); \n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "14d02875dd636722d6e62d2c45d8f50b", "score": "0.58482385", "text": "function logo_symbols_removeDots() {\r\n for (var i = 0; i < logo_symbols.length; i++) {\r\n logo_symbols[i].classList.remove('logo_symbols_dot');\r\n }\r\n}", "title": "" }, { "docid": "40629fb910d03c6e9c4436b19674f47b", "score": "0.5847517", "text": "function svgClassname() {\n return gulp\n .src(svgGlob)\n .pipe(\n svgSymbols({\n svgAttrs: { class: `custom-name` },\n })\n )\n .pipe(gulp.dest(`ex-svg-classname`))\n}", "title": "" }, { "docid": "936113c3da1faa1318c10c392434e662", "score": "0.5844392", "text": "function deleteWithClass(elements,classElement){\n\telements.classList.remove(classElement);\n}", "title": "" }, { "docid": "b175d48fc5f73f144c4c4a90677e2a23", "score": "0.5843988", "text": "function svgFallback() {\r\n $('html.no-svg img').each(function() {\r\n $(this).addClass('svg');\r\n $(this).attr('src', function() {\r\n return $(this).attr('src').replace('.svg', '.png');\r\n });\r\n });\r\n }", "title": "" }, { "docid": "c88651ef8dce22ee53a910c7284064a1", "score": "0.58369935", "text": "function RemoveClass(element, name) {\n var j, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (j = 0; j < arr2.length; j++) {\n while (arr1.indexOf(arr2[j]) > -1) {\n arr1.splice(arr1.indexOf(arr2[j]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "d2fff5160681926a3d8c7b22927a5180", "score": "0.5822083", "text": "function removeClass(){\n operator.forEach(function(i){\n if(i.classList.contains(\"clicked\")){\n i.classList.remove(\"clicked\");\n }\n });\n}", "title": "" }, { "docid": "3af529c3971f00de85d663a64ae8b275", "score": "0.5821962", "text": "function clearStatusClass(element) //how to clear previous state\n{\nelement.classList.remove('correct')\nelement.classList.remove('wrong')\n}", "title": "" }, { "docid": "c259f35624f32aa214c203c8f49db140", "score": "0.5817452", "text": "function RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1); \n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "c259f35624f32aa214c203c8f49db140", "score": "0.5817452", "text": "function RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1); \n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "b20f2eaf8218a94aadc84d8c68045234", "score": "0.5811137", "text": "function removeClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "cc6ea0368f3484ab6afc84fce914bf2f", "score": "0.5809883", "text": "function removeClass (element, className) {\n for (var i = 0; i < element.length; i++) {\n element[i].classList.remove(className)\n }\n}", "title": "" } ]
bb20f9985d2d5d984bb6906e56ef45c8
Updates the list object `obj` according to the modifications described in `patch`, or creates a new object if `obj` is undefined. Mutates `updated` to map the objectId to the new object, and returns the new object.
[ { "docid": "0069bb5b209f5f41fec06b95801aed6d", "score": "0.77244383", "text": "function updateListObject(patch, obj, updated) {\n const objectId = patch.objectId\n if (!updated[objectId]) {\n updated[objectId] = cloneListObject(obj, objectId)\n }\n\n const list = updated[objectId], conflicts = list[CONFLICTS], elemIds = list[ELEM_IDS]\n for (let i = 0; i < patch.edits.length; i++) {\n const edit = patch.edits[i]\n\n if (edit.action === 'insert' || edit.action === 'update') {\n const oldValue = conflicts[edit.index] && conflicts[edit.index][edit.opId]\n let lastValue = getValue(edit.value, oldValue, updated)\n let values = {[edit.opId]: lastValue}\n\n // Successive updates for the same index are an indication of a conflict on that list element.\n // Edits are sorted in increasing order by Lamport timestamp, so the last value (with the\n // greatest timestamp) is the default resolution of the conflict.\n while (i < patch.edits.length - 1 && patch.edits[i + 1].index === edit.index &&\n patch.edits[i + 1].action === 'update') {\n i++\n const conflict = patch.edits[i]\n const oldValue2 = conflicts[conflict.index] && conflicts[conflict.index][conflict.opId]\n lastValue = getValue(conflict.value, oldValue2, updated)\n values[conflict.opId] = lastValue\n }\n\n if (edit.action === 'insert') {\n list.splice(edit.index, 0, lastValue)\n conflicts.splice(edit.index, 0, values)\n elemIds.splice(edit.index, 0, edit.elemId)\n } else {\n list[edit.index] = lastValue\n conflicts[edit.index] = values\n }\n\n } else if (edit.action === 'multi-insert') {\n const startElemId = parseOpId(edit.elemId), newElems = [], newValues = [], newConflicts = []\n const datatype = edit.datatype\n edit.values.forEach((value, index) => {\n const elemId = `${startElemId.counter + index}@${startElemId.actorId}`\n value = getValue({ value, datatype }, undefined, updated)\n newValues.push(value)\n newConflicts.push({[elemId]: {value, datatype, type: 'value'}})\n newElems.push(elemId)\n })\n list.splice(edit.index, 0, ...newValues)\n conflicts.splice(edit.index, 0, ...newConflicts)\n elemIds.splice(edit.index, 0, ...newElems)\n\n } else if (edit.action === 'remove') {\n list.splice(edit.index, edit.count)\n conflicts.splice(edit.index, edit.count)\n elemIds.splice(edit.index, edit.count)\n }\n }\n return list\n}", "title": "" } ]
[ { "docid": "826a6da03c1af570c6fabc0e812ca5bc", "score": "0.73061496", "text": "function updateMapObject(patch, obj, updated) {\n const objectId = patch.objectId\n if (!updated[objectId]) {\n updated[objectId] = cloneMapObject(obj, objectId)\n }\n\n const object = updated[objectId]\n applyProperties(patch.props, object, object[CONFLICTS], updated)\n return object\n}", "title": "" }, { "docid": "c88a051207d719f37e5bdb09fa45e71c", "score": "0.7292426", "text": "function interpretPatch(patch, obj, updated) {\n // Return original object if it already exists and isn't being modified\n if (isObject(obj) && (!patch.props || Object.keys(patch.props).length === 0) &&\n (!patch.edits || patch.edits.length === 0) && !updated[patch.objectId]) {\n return obj\n }\n\n if (patch.type === 'map') {\n return updateMapObject(patch, obj, updated)\n } else if (patch.type === 'table') {\n return updateTableObject(patch, obj, updated)\n } else if (patch.type === 'list') {\n return updateListObject(patch, obj, updated)\n } else if (patch.type === 'text') {\n return updateTextObject(patch, obj, updated)\n } else {\n throw new TypeError(`Unknown object type: ${patch.type}`)\n }\n}", "title": "" }, { "docid": "b2208163f81a1599506e311610762058", "score": "0.68789023", "text": "function updateTableObject(patch, obj, updated) {\n const objectId = patch.objectId\n if (!updated[objectId]) {\n updated[objectId] = obj ? obj._clone() : instantiateTable(objectId)\n }\n\n const object = updated[objectId]\n\n for (let key of Object.keys(patch.props || {})) {\n const opIds = Object.keys(patch.props[key])\n\n if (opIds.length === 0) {\n object.remove(key)\n } else if (opIds.length === 1) {\n const subpatch = patch.props[key][opIds[0]]\n object._set(key, getValue(subpatch, object.byId(key), updated), opIds[0])\n } else {\n throw new RangeError('Conflicts are not supported on properties of a table')\n }\n }\n return object\n}", "title": "" }, { "docid": "234a33c6df74a72ff071a74df3815f25", "score": "0.6607343", "text": "function updateTextObject(patch, obj, updated) {\n const objectId = patch.objectId\n let elems\n if (updated[objectId]) {\n elems = updated[objectId].elems\n } else if (obj) {\n elems = obj.elems.slice()\n } else {\n elems = []\n }\n\n for (const edit of patch.edits) {\n if (edit.action === 'insert') {\n const value = getValue(edit.value, undefined, updated)\n const elem = {elemId: edit.elemId, pred: [edit.opId], value}\n elems.splice(edit.index, 0, elem)\n\n } else if (edit.action === 'multi-insert') {\n const startElemId = parseOpId(edit.elemId)\n const datatype = edit.datatype\n const newElems = edit.values.map((value, index) => {\n value = getValue({ datatype, value }, undefined, updated)\n const elemId = `${startElemId.counter + index}@${startElemId.actorId}`\n return {elemId, pred: [elemId], value}\n })\n elems.splice(edit.index, 0, ...newElems)\n\n } else if (edit.action === 'update') {\n const elemId = elems[edit.index].elemId\n const value = getValue(edit.value, elems[edit.index].value, updated)\n elems[edit.index] = {elemId, pred: [edit.opId], value}\n\n } else if (edit.action === 'remove') {\n elems.splice(edit.index, edit.count)\n }\n }\n\n updated[objectId] = instantiateText(objectId, elems)\n return updated[objectId]\n}", "title": "" }, { "docid": "51a329e83b0751b0f07f8d54295afa7c", "score": "0.6286066", "text": "patchCallback(patch, before, after, local, changes) {\n this._objectUpdate(patch.diffs, before, after, local, changes)\n }", "title": "" }, { "docid": "f595c80701952191ec02677eba61119f", "score": "0.6170743", "text": "function setPatchEditsForList(opSet, listId, elemId, index, insert, patch) {\n if (!patch) return\n setPatchPropsForMap(opSet, listId, elemId, patch)\n if (Object.keys(patch.props[elemId]).length === 0) {\n appendEdit(patch.edits, {action: 'remove', index, count: 1})\n return\n }\n\n // If the most recent existing edit is for the same index, we need to remove it, since the patch\n // format for lists treats several consecutive updates for the same index as a conflict.\n while (!insert && patch.edits.length > 0 && patch.edits[patch.edits.length - 1].index === index &&\n ['insert', 'update'].includes(patch.edits[patch.edits.length - 1].action)) {\n const previousEdit = patch.edits.pop()\n insert = (previousEdit.action === 'insert')\n }\n\n for (const opId of Object.keys(patch.props[elemId]).sort(opIdCompare)) {\n const value = patch.props[elemId][opId]\n if (insert) {\n appendEdit(patch.edits, {action: 'insert', index, elemId, opId, value})\n } else {\n appendEdit(patch.edits, {action: 'update', index, opId, value})\n }\n insert = false\n }\n}", "title": "" }, { "docid": "4c940348061b5f59f509222aeef11029", "score": "0.60130394", "text": "patch(endpoint, userId, editedObj) {\n // make sure to pass in the ID in the 'editedObj' so you can access it in the fetch call\n return fetch(`${baseUrl}/${endpoint}/${userId}`, {\n method: \"PATCH\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(editedObj)\n }).then(data => data.json());\n }", "title": "" }, { "docid": "c1e0cfc3ae4343b5e8233463a6bf2c6c", "score": "0.5985253", "text": "updatePatchProperty(patches, ops, op, docState, propState, listIndex, oldSuccNum) {\n // FIXME: these constants duplicate those at the beginning of mergeDocChangeOps()\n const objActor = 0, objCtr = 1, keyActor = 2, keyCtr = 3, keyStr = 4, idActor = 5, idCtr = 6, insert = 7, action = 8, // eslint-disable-line\n valLen = 9, valRaw = 10, predNum = 13, predActor = 14, predCtr = 15, succNum = 13, succActor = 14, succCtr = 15 // eslint-disable-line\n\n const objectId = ops.objId\n const elemId = op[keyStr] ? op[keyStr]\n : op[insert] ? `${op[idCtr]}@${docState.actorIds[op[idActor]]}`\n : `${op[keyCtr]}@${docState.actorIds[op[keyActor]]}`\n\n // An operation to be overwritten if it is a document operation that has at least one successor\n const isOverwritten = (oldSuccNum !== undefined && op[succNum] > 0)\n\n if (!patches[objectId]) patches[objectId] = {objectId, type: docState.objectMeta[objectId].type, props: {}}\n let patch = patches[objectId]\n\n if (op[keyStr] === null) {\n // Updating a list or text object (with opId key)\n if (!patch.edits) patch.edits = []\n\n // If the property has a non-overwritten/non-deleted value, it's either an insert or an update\n if (!isOverwritten) {\n if (!propState[elemId]) {\n patch.edits.push({action: 'insert', index: listIndex, elemId})\n propState[elemId] = {action: 'insert', visibleOps: [], hasChild: false}\n } else if (propState[elemId].action === 'remove') {\n patch.edits.pop()\n propState[elemId].action = 'update'\n }\n }\n\n // If the property formerly had a non-overwritten value, it's either a remove or an update\n if (oldSuccNum === 0) {\n if (!propState[elemId]) {\n patch.edits.push({action: 'remove', index: listIndex})\n propState[elemId] = {action: 'remove', visibleOps: [], hasChild: false}\n } else if (propState[elemId].action === 'insert') {\n patch.edits.pop()\n propState[elemId].action = 'update'\n }\n }\n\n if (!patch.props[listIndex] && propState[elemId] && ['insert', 'update'].includes(propState[elemId].action)) {\n patch.props[listIndex] = {}\n }\n } else {\n // Updating a map or table (with string key)\n if (!patch.props[op[keyStr]]) patch.props[op[keyStr]] = {}\n }\n\n // If one or more of the values of the property is a child object, we update objectMeta to store\n // all of the visible values of the property (even the non-child-object values). Then, when we\n // subsequently process an update within that child object, we can construct the patch to\n // contain the conflicting values.\n if (!isOverwritten) {\n if (!propState[elemId]) propState[elemId] = {visibleOps: [], hasChild: false}\n propState[elemId].visibleOps.push(op)\n propState[elemId].hasChild = propState[elemId].hasChild || (op[action] % 2) === 0 // even-numbered action == make* operation\n\n if (propState[elemId].hasChild) {\n let values = {}\n for (let visible of propState[elemId].visibleOps) {\n const opId = `${visible[idCtr]}@${docState.actorIds[visible[idActor]]}`\n if (ACTIONS[visible[action]] === 'set') {\n values[opId] = decodeValue(visible[valLen], visible[valRaw])\n } else if (visible[action] % 2 === 0) {\n const type = visible[action] < ACTIONS.length ? OBJECT_TYPE[ACTIONS[visible[action]]] : null\n values[opId] = {objectId: opId, type, props: {}}\n }\n }\n\n // Copy so that objectMeta is not modified if an exception is thrown while applying change\n deepCopyUpdate(docState.objectMeta, [objectId, 'children', elemId], values)\n }\n }\n\n const opId = `${op[idCtr]}@${docState.actorIds[op[idActor]]}`\n const key = op[keyStr] !== null ? op[keyStr] : listIndex\n\n // For counters, increment operations are succs to the set operation that created the counter,\n // but in this case we want to add the values rather than overwriting them.\n if (isOverwritten && ACTIONS[op[action]] === 'set' && (op[valLen] & 0x0f) === VALUE_TYPE.COUNTER) {\n // This is the initial set operation that creates a counter. Initialise the counter state\n // to contain all successors of the set operation. Only if we later find that each of these\n // successor operations is an increment, we make the counter visible in the patch.\n if (!propState[elemId]) propState[elemId] = {visibleOps: [], hasChild: false}\n if (!propState[elemId].counterStates) propState[elemId].counterStates = {}\n let counterStates = propState[elemId].counterStates\n let counterState = {opId, value: decodeValue(op[valLen], op[valRaw]).value, succs: {}}\n\n for (let i = 0; i < op[succNum]; i++) {\n const succOp = `${op[succCtr][i]}@${docState.actorIds[op[succActor][i]]}`\n counterStates[succOp] = counterState\n counterState.succs[succOp] = true\n }\n\n } else if (ACTIONS[op[action]] === 'inc') {\n // Incrementing a previously created counter.\n if (!propState[elemId] || !propState[elemId].counterStates || !propState[elemId].counterStates[opId]) {\n throw new RangeError(`increment operation ${opId} for unknown counter`)\n }\n let counterState = propState[elemId].counterStates[opId]\n counterState.value += decodeValue(op[valLen], op[valRaw]).value\n delete counterState.succs[opId]\n\n if (Object.keys(counterState.succs).length === 0 && patch.props[key]) {\n patch.props[key][counterState.opId] = {datatype: 'counter', value: counterState.value}\n // TODO if the counter is in a list element, we need to add a 'remove' action when deleted\n }\n\n } else if (patch.props[key] && !isOverwritten) {\n // Add the value to the patch if it is not overwritten (i.e. if it has no succs).\n if (ACTIONS[op[action]] === 'set') {\n patch.props[key][opId] = decodeValue(op[valLen], op[valRaw])\n } else if (op[action] % 2 === 0) { // even-numbered action == make* operation\n if (!patches[opId]) {\n const type = op[action] < ACTIONS.length ? OBJECT_TYPE[ACTIONS[op[action]]] : null\n patches[opId] = {objectId: opId, type, props: {}}\n }\n patch.props[key][opId] = patches[opId]\n }\n }\n }", "title": "" }, { "docid": "2b54a3f5bd6ee079946c0f2d35abccca", "score": "0.5870188", "text": "function getValue(patch, object, updated) {\n if (patch.objectId) {\n // If the objectId of the existing object does not match the objectId in the patch,\n // that means the patch is replacing the object with a new one made from scratch\n if (object && object[OBJECT_ID] !== patch.objectId) {\n object = undefined\n }\n return interpretPatch(patch, object, updated)\n } else if (patch.datatype === 'timestamp') {\n // Timestamp: value is milliseconds since 1970 epoch\n return new Date(patch.value)\n } else if (patch.datatype === 'counter') {\n return new Counter(patch.value)\n } else {\n // Primitive value (int, uint, float64, string, boolean, or null)\n return patch.value\n }\n}", "title": "" }, { "docid": "0e32ba29249587eb576c61050e1f16fe", "score": "0.57740736", "text": "function applyPatch(doc, patch, backendState = undefined) {\n if (doc[OBJECT_ID] !== '_root') {\n throw new TypeError('The first argument to Frontend.applyPatch must be the document root')\n }\n const state = copyObject(doc[STATE])\n\n if (doc[OPTIONS].backend) {\n if (!backendState) {\n throw new RangeError('applyPatch must be called with the updated backend state')\n }\n state.backendState = backendState\n return applyPatchToDoc(doc, patch, state, true)\n }\n\n let baseDoc\n\n if (state.requests.length > 0) {\n baseDoc = state.requests[0].before\n if (patch.actor === getActorId(doc)) {\n if (state.requests[0].seq !== patch.seq) {\n throw new RangeError(`Mismatched sequence number: patch ${patch.seq} does not match next request ${state.requests[0].seq}`)\n }\n state.requests = state.requests.slice(1)\n } else {\n state.requests = state.requests.slice()\n }\n } else {\n baseDoc = doc\n state.requests = []\n }\n\n let newDoc = applyPatchToDoc(baseDoc, patch, state, true)\n if (state.requests.length === 0) {\n return newDoc\n } else {\n state.requests[0] = copyObject(state.requests[0])\n state.requests[0].before = newDoc\n return updateRootObject(doc, {}, state)\n }\n}", "title": "" }, { "docid": "face8d2a38e307742172599b7b5051a8", "score": "0.572535", "text": "function update( obj ) {\n\t\tobj.updated_at = new Date();\n\n\t\treturn obj;\n\t}", "title": "" }, { "docid": "778ab0ce8d564b69408edff62d74819d", "score": "0.57104003", "text": "setupPatches(patches, objectIds, docState) {\n for (let objectId of objectIds) {\n let meta = docState.objectMeta[objectId], childMeta = null, patchExists = false\n while (true) {\n if (!patches[objectId]) patches[objectId] = {objectId, type: meta.type, props: {}}\n\n if (childMeta) {\n // key is the property name being updated. In maps and table objects, this is just q\n // string, while in list and text objects, we need to translate the elemID into an index\n let key = childMeta.parentKey\n if (meta.type === 'list' || meta.type === 'text') {\n const obj = parseOpId(objectId), elem = parseOpId(key)\n const seekPos = {\n objActor: obj.actorId, objCtr: obj.counter,\n keyActor: elem.actorId, keyCtr: elem.counter,\n keyStr: null, insert: false\n }\n const { visibleCount } = seekToOp(seekPos, docState.opsCols, docState.actorIds)\n key = visibleCount\n }\n if (!patches[objectId].props[key]) patches[objectId].props[key] = {}\n\n let values = patches[objectId].props[key]\n for (let [opId, value] of Object.entries(meta.children[childMeta.parentKey])) {\n if (values[opId]) {\n patchExists = true\n } else if (value.objectId) {\n if (!patches[value.objectId]) patches[value.objectId] = Object.assign({}, value, {props: {}})\n values[opId] = patches[value.objectId]\n } else {\n values[opId] = value\n }\n }\n if (!values[childMeta.opId]) {\n throw new RangeError(`object metadata did not contain child entry for ${childMeta.opId}`)\n }\n }\n if (patchExists || !meta.parentObj) break\n childMeta = meta\n objectId = meta.parentObj\n meta = docState.objectMeta[objectId]\n }\n }\n return patches\n }", "title": "" }, { "docid": "fc67ff4cc06dc3f863a01e53f50befa2", "score": "0.5648524", "text": "function updateObj(req, res){\n\tlet objid = req.params.objid;\n\tlet update = req.body;\n\n\tObject.findByIdAndUpdate(objid, update, {new: true}, function(err, objUpdated){\n\t\tif(err) return res.status(500).send({message: `Error al realizar la petición: ${err}`});\n\n\t\tres.status(200).send({obj: objUpdated});\n\t});\n}", "title": "" }, { "docid": "a133990ff82f78db71f236909dbdf52a", "score": "0.5570825", "text": "function updateInObject(uuid, obj) {\n //Find index of specific object using findIndex methode.\n let objIndex = rawList.findIndex((obj => obj.uuid == uuid));\n\n //Update object's name property.\n rawList[objIndex].title = obj.title;\n rawList[objIndex].notes = obj.notes;\n\n return rawList;\n}", "title": "" }, { "docid": "c0407419304c3f6df102d849871f5cd6", "score": "0.5565757", "text": "function updateObject(obj) {\n obj.foo = 'foo';\n obj.bar = 'bar';\n obj.bizz = 'bizz';\n obj.bang = 'bang';\n return obj;\n}", "title": "" }, { "docid": "72bb26c491e00e81a9c6aacc5692362f", "score": "0.55298716", "text": "function applyPatchToDoc(doc, patch, state, fromBackend) {\n const actor = getActorId(doc)\n const updated = {}\n interpretPatch(patch.diffs, doc, updated)\n\n if (fromBackend) {\n if (!patch.clock) throw new RangeError('patch is missing clock field')\n if (patch.clock[actor] && patch.clock[actor] > state.seq) {\n state.seq = patch.clock[actor]\n }\n state.clock = patch.clock\n state.deps = patch.deps\n state.maxOp = Math.max(state.maxOp, patch.maxOp)\n }\n return updateRootObject(doc, updated, state)\n}", "title": "" }, { "docid": "991982abb27ddc6b47f6120370dad40d", "score": "0.5487324", "text": "function patch(req, res) {\n if (req.body._id) {\n delete req.body._id;\n }\n return _league2.default.findById(req.params.id).exec().then(handleEntityNotFound(res)).then(patchUpdates(req.body)).then(respondWithResult(res)).catch(handleError(res));\n}", "title": "" }, { "docid": "39d33a9aba02cb9ac1aa3d1ff76f5b0c", "score": "0.5448079", "text": "_objectUpdate(diff, before, after, local, changes) {\n if (!diff.objectId) return\n if (this.observers[diff.objectId]) {\n for (let callback of this.observers[diff.objectId]) {\n callback(diff, before, after, local, changes)\n }\n }\n\n if (diff.type === 'map' && diff.props) {\n for (const propName of Object.keys(diff.props)) {\n for (const opId of Object.keys(diff.props[propName])) {\n this._objectUpdate(diff.props[propName][opId],\n before && before[CONFLICTS] && before[CONFLICTS][propName] && before[CONFLICTS][propName][opId],\n after && after[CONFLICTS] && after[CONFLICTS][propName] && after[CONFLICTS][propName][opId],\n local, changes)\n }\n }\n\n } else if (diff.type === 'table' && diff.props) {\n for (const rowId of Object.keys(diff.props)) {\n for (const opId of Object.keys(diff.props[rowId])) {\n this._objectUpdate(diff.props[rowId][opId],\n before && before.byId(rowId),\n after && after.byId(rowId),\n local, changes)\n }\n }\n\n } else if (diff.type === 'list' && diff.edits) {\n let offset = 0\n for (const edit of diff.edits) {\n if (edit.action === 'insert') {\n offset -= 1\n this._objectUpdate(edit.value, undefined,\n after && after[CONFLICTS] && after[CONFLICTS][edit.index] && after[CONFLICTS][edit.index][edit.elemId],\n local, changes)\n } else if (edit.action === 'multi-insert') {\n offset -= edit.values.length\n } else if (edit.action === 'update') {\n this._objectUpdate(edit.value,\n before && before[CONFLICTS] && before[CONFLICTS][edit.index + offset] &&\n before[CONFLICTS][edit.index + offset][edit.opId],\n after && after[CONFLICTS] && after[CONFLICTS][edit.index] && after[CONFLICTS][edit.index][edit.opId],\n local, changes)\n } else if (edit.action === 'remove') {\n offset += edit.count\n }\n }\n\n } else if (diff.type === 'text' && diff.edits) {\n let offset = 0\n for (const edit of diff.edits) {\n if (edit.action === 'insert') {\n offset -= 1\n this._objectUpdate(edit.value, undefined, after && after.get(edit.index), local, changes)\n } else if (edit.action === 'multi-insert') {\n offset -= edit.values.length\n } else if (edit.action === 'update') {\n this._objectUpdate(edit.value,\n before && before.get(edit.index + offset),\n after && after.get(edit.index),\n local, changes)\n } else if (edit.action === 'remove') {\n offset += edit.count\n }\n }\n }\n }", "title": "" }, { "docid": "32fe345b162f462e2dc36573525702ba", "score": "0.54085827", "text": "update(id, obj) {\n if (id) {\n this.db = this.db.map(record => {\n if (record.id === id) {\n this.fields.forEach(field => record.data[field] = obj[field] || record.data[field]);\n }\n return record\n });\n return this.db.find(record => record.id === id);\n }\n }", "title": "" }, { "docid": "46e5f94a74ec5959c9e37ab201ea8a2a", "score": "0.5386191", "text": "function patch(req, res) {\n if (req.body._id) {\n delete req.body._id;\n }\n return _flight2.default.findById(req.params.id).exec().then(handleEntityNotFound(res)).then(patchUpdates(req.body)).then(respondWithResult(res)).catch(handleError(res));\n}", "title": "" }, { "docid": "a4d7d21a6d6dd3b7c660dd6c2e06a545", "score": "0.5353329", "text": "function updateObject (id, update, db = connection) {\n return db('object').where('object.id', id).update(update)\n}", "title": "" }, { "docid": "2ad26e83a05732f4f22a299b3d0230be", "score": "0.5337845", "text": "function applyAssign(opSet, op, patch) {\n const objectId = op.get('obj'), action = op.get('action'), key = getOperationKey(op)\n if (!opSet.get('byObject').has(objectId)) throw new RangeError(`Modification of unknown object ${objectId}`)\n const type = getObjectType(opSet, objectId)\n\n if (patch) {\n patch.objectId = patch.objectId || objectId\n if (patch.objectId !== objectId) {\n throw new RangeError(`objectId mismatch in patch: ${patch.objectId} != ${objectId}`)\n }\n\n patch.type = patch.type || type\n if (patch.type !== type) {\n throw new RangeError(`object type mismatch in patch: ${patch.type} != ${type}`)\n }\n\n if (type !== 'list' && type !== 'text' && !patch.props[key]) patch.props[key] = {}\n }\n\n if (action.startsWith('make')) {\n if (patch) {\n const valuePatch = {}\n opSet = applyMake(opSet, op, valuePatch)\n if (type === 'map' || type === 'table') {\n patch.props[key][op.get('opId')] = valuePatch\n }\n } else {\n opSet = applyMake(opSet, op)\n }\n }\n if (action === 'link' && patch) {\n patch.props[key][op.get('opId')] = constructObject(opSet, getChildId(op))\n }\n\n const ops = getFieldOps(opSet, objectId, key)\n let overwritten, remaining\n\n if (action === 'inc') {\n overwritten = List()\n remaining = ops.map(other => {\n if (other.get('action') === 'set' && typeof other.get('value') === 'number' &&\n other.get('datatype') === 'counter' && op.get('pred').includes(other.get('opId'))) {\n return other.set('value', other.get('value') + op.get('value'))\n } else {\n return other\n }\n })\n } else {\n const priorOpsOverwritten = ops.groupBy(other => op.get('pred').includes(other.get('opId')))\n overwritten = priorOpsOverwritten.get(true, List())\n remaining = priorOpsOverwritten.get(false, List())\n }\n\n // If any child object references were overwritten, remove them from the index of inbound links\n for (let old of overwritten.filter(isChildOp)) {\n opSet = opSet.updateIn(['byObject', getChildId(old), '_inbound'], ops => ops.remove(old))\n }\n\n if (isChildOp(op)) {\n opSet = opSet.updateIn(['byObject', getChildId(op), '_inbound'], Set(), ops => ops.add(op))\n }\n if (action === 'set' || isChildOp(op)) { // not 'inc' or 'del'\n remaining = remaining.push(op)\n }\n remaining = remaining.sort(lamportCompare).reverse()\n opSet = opSet.setIn(['byObject', objectId, '_keys', key], remaining)\n\n if (type === 'list' || type === 'text') {\n opSet = updateListElement(opSet, objectId, key, patch)\n } else {\n setPatchPropsForMap(opSet, objectId, key, patch)\n }\n return opSet\n}", "title": "" }, { "docid": "d9a12b01cf3fac6f242ddd42f312a55a", "score": "0.5334139", "text": "function applyPatch(obj, patch) {\n var i;\n if(\"_r\" in patch) {\n if(obj instanceof Array) {\n obj.length = patch[\"_r\"];\n }\n else {\n var removals = patch[\"_r\"];\n \n if(removals instanceof Array) {\n for(i=0; i<removals.length; ++i) {\n delete obj[removals[i]];\n }\n } else {\n delete obj[removals];\n }\n }\n delete patch[\"_r\"];\n }\n \n for(i in patch) {\n //Unescape underscore\n //var t = (typeof(i) == \"string\" && i.charAt(0) == \"_\" ? i.substring(1) : i);\n\tif( typeof(i) === 'string' \n && i.length > 1 \n && i.charAt(0) == '_' \n && i.charAt(1) == '_' ) {\n // string staring with _ which is escaped\n var t = i.substring(1);\n \n } else if( typeof(i) === 'string' \n && i.length > 0\n && i.charAt(0) == '_' ) {\n // escaped index\n t = 1 * i.substring(1);\n \n } else {\n t = i;\n };\n \n if(typeof(obj[t]) == typeof(patch[i]) &&\n typeof(patch[i]) == \"object\" &&\n patch[i] != null ) {\n if( (obj[t] instanceof Array) == (patch[i] instanceof Array) ) {\n applyPatch(obj[t], patch[i]);\n continue;\n } else if( (obj[t] instanceof Array) && false == (patch[i] instanceof Array) ) {\n applyPatch(obj[t], patch[i]);\n continue;\n };\n }\n obj[t] = patch[i]\n }\n}", "title": "" }, { "docid": "f238b86cf635346807d6613f4937a4fe", "score": "0.53298545", "text": "function patch(obj, properties) {\n var old = {};\n for (var name in properties) {\n old[name] = obj[name];\n obj[name] = properties[name];\n }\n return old;\n}", "title": "" }, { "docid": "b0ee73012ae2fa0c89a341dcba69390c", "score": "0.5260281", "text": "function apiUpdate(collection, object, id) {\n id = id || object.id;\n\n return async function(dispatch, getState) {\n var res = await fetch(`/api/${collection}/${id}`, {\n method: 'PUT',\n credentials: 'include',\n headers: {\"Content-Type\": \"application/json\"},\n body: JSON.stringify(object),\n });\n\n if(!res.ok) return common.errorHandler(res);\n\n var updatedObject = await res.json();\n dispatch(actions.update(collection, updatedObject));\n }\n}", "title": "" }, { "docid": "df374c858c86fac3e7729ec2ec4f2cf6", "score": "0.52600104", "text": "set (patch) {\n\t\treturn this.makeApiCall({\n\t\t\tmethod: 'PATCH',\n\t\t\tbody: JSON.stringify(patch)\n\t\t});\n\t}", "title": "" }, { "docid": "8854d740e0361689924dd4f27d797aa0", "score": "0.5246601", "text": "function parse(patch) {\n var result = [];\n\n if (Array.isArray(patch)) {\n return patch.reduce((r, p) => r.concat(parse(p)), result);\n }\n\n if (patch.set) {\n Object.keys(patch.set).forEach(path => {\n result.push(new _SetPatch.default(patch.id, path, patch.set[path]));\n });\n }\n\n if (patch.setIfMissing) {\n Object.keys(patch.setIfMissing).forEach(path => {\n result.push(new _SetIfMissingPatch.default(patch.id, path, patch.setIfMissing[path]));\n });\n } // TODO: merge\n\n\n if (patch.unset) {\n patch.unset.forEach(path => {\n result.push(new _UnsetPatch.default(patch.id, path));\n });\n }\n\n if (patch.diffMatchPatch) {\n Object.keys(patch.diffMatchPatch).forEach(path => {\n result.push(new _DiffMatchPatch.default(patch.id, path, patch.diffMatchPatch[path]));\n });\n }\n\n if (patch.inc) {\n Object.keys(patch.inc).forEach(path => {\n result.push(new _IncPatch.default(patch.id, path, patch.inc[path]));\n });\n }\n\n if (patch.dec) {\n Object.keys(patch.dec).forEach(path => {\n result.push(new _IncPatch.default(patch.id, path, -patch.dec[path]));\n });\n }\n\n if (patch.insert) {\n var location;\n var path;\n var spec = patch.insert;\n\n if (spec.before) {\n location = 'before';\n path = spec.before;\n } else if (spec.after) {\n location = 'after';\n path = spec.after;\n } else if (spec.replace) {\n location = 'replace';\n path = spec.replace;\n }\n\n result.push(new _InsertPatch.default(patch.id, location, path, spec.items));\n }\n\n return result;\n}", "title": "" }, { "docid": "868571436ad4b980f1afe6d0724686ed", "score": "0.52443856", "text": "function patch(req, res) {\n if (req.body._id) {\n delete req.body._id;\n }\n return _search2.default.findById(req.params.id).exec().then(handleEntityNotFound(res)).then(patchUpdates(req.body)).then(respondWithResult(res)).catch(handleError(res));\n}", "title": "" }, { "docid": "08923f3fc1c8f750a96cb9e3b62bfd32", "score": "0.52216136", "text": "function autoUpdate (patch) {\n var tempState = Object.freeze(_.merge(appState, patch));\n _.foldl(patch, function (acc, change, key) {\n if (updateRule[key] !== undefined) updateRule[key](UIAPI, tempState, appState[key]);\n }, null);\n }", "title": "" }, { "docid": "795254177e3b832685fcb11b672bc04f", "score": "0.51808465", "text": "function update(Model,_id,updated_obj){\n const promise = new Promise((resolve,reject)=>{\n Model.findOneAndReplace(_id,updated_obj,(err,docs)=>{\n \tif (err) {\n \t\treject(err);\n \t\treturn;\n \t}\n \tresolve(docs)\n })\n })\n return promise;\n}", "title": "" }, { "docid": "bbdeae1a6a019f78c9bc51ae6b6ac700", "score": "0.5169193", "text": "function patch(req, res) {\n if (req.body._id) {\n delete req.body._id;\n }\n return _favorite2.default.findById(req.params.id).exec().then(handleEntityNotFound(res)).then(patchUpdates(req.body)).then(respondWithResult(res)).catch(handleError(res));\n}", "title": "" }, { "docid": "c8c77ea1695e41d9fc85cccc475b4d14", "score": "0.51483345", "text": "function updateObject(obj) {\n // your code here\n obj.foo = 'foo';\n obj.bar = 'bar';\n obj.bizz = 'bizz';\n obj.bang = 'bang';\n return obj;\n}", "title": "" }, { "docid": "aee345f311873dddd891db291f833332", "score": "0.5130605", "text": "async update(id, update) {\n //NOTE {new: true} insures I get the object back after the change\n return await _repository.findByIdAndUpdate(id, update, { new: true });\n }", "title": "" }, { "docid": "68734004ee0e1af618ead17228c7f861", "score": "0.5123325", "text": "function patch(req, res) {\n if (req.body._id) {\n delete req.body._id;\n }\n return _booktable2.default.findById(req.params.id).exec().then(handleEntityNotFound(res)).then(patchUpdates(req.body)).then(respondWithResult(res)).catch(handleError(res));\n}", "title": "" }, { "docid": "b2c858c334703e92900b213853e87bb4", "score": "0.511882", "text": "function updateDeepProperty(obj) {\n return obj.setIn(['a', 'b', 'c'], 'new value');\n }", "title": "" }, { "docid": "c4dfc96f443322c3fcef969225fae876", "score": "0.5104145", "text": "function objectUpdate(obj, store, onAccept, onSync, onError) {\n _deferIfSyncing(function() {\n if(!_getObjStore(store)) { onError(\"Incorrect ObjectStore.\"); return; }\n _.set(obj, _getObjStore(store).timestampProperty, _generateTimestamp());\n\n if(!obj.hasOwnProperty(\"properties\")) obj.properties = {}; // add if not existing\n\n if(obj.properties.hasOwnProperty(\"syncState\")) {\n if(obj.properties.syncState > 0) { obj.properties.syncState = 2; }\n } else {\n obj = _.cloneDeep(obj);\n obj.properties.syncState = 0;\n _.set(obj, _getObjStore(store).primaryKeyProperty, _generateUUID());\n }\n obj.onSyncCallback = '(' + onSync + ')'; // Convert to string.\n obj.onErrorCallback = '(' + onError + ')';\n _patchLocal(obj, store, function(response) {\n if(pushSync) _sync(_notifyObservers);\n\n // Test whether object was added:\n _objectExistsInIDB(obj, store, function(response) {\n if(response !== undefined) onAccept(response);\n else onError();\n });\n\n });\n });\n }", "title": "" }, { "docid": "87d8911472776fcb13183ea9cc843122", "score": "0.5049581", "text": "function utilPatch(orig, diff) /* patched object */ {\n\t\tconst\n\t\t\tkeys = Object.keys(diff || {}),\n\t\t\tpatched = clone(orig);\n\n\t\tfor (let i = 0, klen = keys.length; i < klen; ++i) {\n\t\t\tconst\n\t\t\t\tkey = keys[i],\n\t\t\t\tdiffP = diff[key];\n\n\t\t\tif (diffP === DiffOp.Delete) {\n\t\t\t\tdelete patched[key];\n\t\t\t}\n\t\t\telse if (Array.isArray(diffP)) {\n\t\t\t\tswitch (diffP[0]) {\n\t\t\t\tcase DiffOp.SpliceArray:\n\t\t\t\t\tpatched.splice(diffP[1], 1 + (diffP[2] - diffP[1]));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase DiffOp.Copy:\n\t\t\t\t\tpatched[key] = clone(diffP[1]);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase DiffOp.CopyDate:\n\t\t\t\t\tpatched[key] = new Date(diffP[1]);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tpatched[key] = Util.patch(patched[key], diffP);\n\t\t\t}\n\t\t}\n\n\t\treturn patched;\n\t}", "title": "" }, { "docid": "b3391072f3b320d42b8f8b65554f9e2b", "score": "0.5040399", "text": "async updateById (collectionId, id, newObject, updates) {\n // Wait for building to finish\n await this._building;\n\n // Get table by provided collection ID\n const table = await this._getTable (collectionId);\n\n // Filter to only top level key updates\n const topLevelUpdates = new Set (Array.from (updates).map (update => update.split (\".\")[0]));\n\n // Create new object for storing only updated keys\n const replaceObject = {};\n\n // Iterate updated keys\n await Promise.all (Array.from (topLevelUpdates).map (async (updatedKey) => {\n if (newObject[updatedKey] != undefined) {\n // Set replace object key-val to be from new object\n replaceObject[updatedKey] = newObject[updatedKey];\n } else {\n // Remove the key if undefined in new object\n await table.get (id).replace (R.row.without (updatedKey)).run (this._rethinkConn);\n }\n }));\n\n // Swap the ID keys in the object before setting the ID\n const swappedReplaceObject = swapKeys ('id', '_id', newObject);\n\n // Set `id` of the data to be the Model instance's db data ID\n swappedReplaceObject.id = id;\n\n // Execute replace query using provided cursor and provided replacement object\n await table.get (id).update (swappedReplaceObject).run (this._rethinkConn);\n }", "title": "" }, { "docid": "7278bb0b5706fab2a55eed8c132162d5", "score": "0.5032207", "text": "function applyPatch(patchObject, graph, url) {\n debug('PATCH -- Applying patch')\n patchObject.deleted = []\n patchObject.inserted = []\n return new Promise((resolve, reject) =>\n graph.applyPatch(patchObject, graph.sym(url), (err) => {\n if (err) {\n const message = err.message || err // returns string at the moment\n debug(`PATCH -- FAILED. Returning 409. Message: '${message}'`)\n return reject(error(409, `The patch could not be applied. ${message}`))\n }\n resolve(graph)\n })\n )\n}", "title": "" }, { "docid": "655b1f758fce4f66524f0f421e1aaccb", "score": "0.49706015", "text": "function patchFunc(req, res) {\n var todoId = parseInt(req.params.id);\n var body = req.body;\n var validAttributes = {};\n if (body.hasOwnProperty('completed')\n && _.isBoolean(body.completed)) {\n validAttributes.completed = body.completed\n } else if (body.hasOwnProperty('completed')) {\n res.status(400).json({error: \"invalid value type for completed:\" + typeof body.completed});\n return;\n }\n if (body.hasOwnProperty('description')\n && _.isString(body.description)\n && body.description.trim().length > 0) {\n validAttributes.description = body.description;\n } else if (body.hasOwnProperty('description')) {\n console.log(\"bad description\")\n res.status(400).json({error: \"invalid value type for description:'\" + typeof body.description + \"'\"});\n return;\n }\n // OK now try the update\n db.todo.findOne({where: {id: todoId, userId:req.user.get('id')}}).\n then(function (found) {\n if (found) {\n _.extend(found, validAttributes); //could also use update\n found.save().then(function () {\n res.status(200).json(found); //wait for db success\n });\n } else {\n res.status(404).send();\n }\n }).catch(function (err) {\n console.log(err);\n res.status(400).json(err);\n });\n}", "title": "" }, { "docid": "e74cc7dc03535acbe29301d60da9ff93", "score": "0.49640286", "text": "update(props) {\n return spPatch(this, request_builders_body(props));\n }", "title": "" }, { "docid": "e74cc7dc03535acbe29301d60da9ff93", "score": "0.49640286", "text": "update(props) {\n return spPatch(this, request_builders_body(props));\n }", "title": "" }, { "docid": "e74cc7dc03535acbe29301d60da9ff93", "score": "0.49640286", "text": "update(props) {\n return spPatch(this, request_builders_body(props));\n }", "title": "" }, { "docid": "f2d79ec35c551ce61935dd3003ecd4b4", "score": "0.49562064", "text": "function patchPatch(target, record) {\n const { name } = record;\n if (record.type === 'delete') {\n delete target[name];\n return target;\n }\n const { descriptor, valueRecords } = record;\n if (valueRecords && valueRecords.length) {\n descriptor.value = patch(descriptor.value, valueRecords);\n }\n defineProperty(target, name, descriptor);\n return target;\n}", "title": "" }, { "docid": "fa650c49d2a771a09c31268a650c5720", "score": "0.49268615", "text": "_BULK_PATCH(call) {\n\n\t\t// transaction context\n\t\tconst txCtx = this._createTransactionContext(call);\n\t\ttxCtx.patchSpec = call.entity;\n\n\t\t// make sure that we have the entity\n\t\tif (!txCtx.patchSpec)\n\t\t\treturn ws.createResponse(400).setEntity({\n\t\t\t\terrorCode: 'X2-RSRC-400-4',\n\t\t\t\terrorMessage: 'Expected patch document in the request body.'\n\t\t\t});\n\n\t\t// create query specification\n\t\ttxCtx.queryParams = new Object();\n\t\ttry {\n\n\t\t\t// parse query string\n\t\t\ttxCtx.querySpec = searchQueryParser.parseSearchQuery(\n\t\t\t\tthis._recordTypeDesc, call.requestUrl.query, 'f',\n\t\t\t\ttxCtx.queryParams);\n\n\t\t\t// make sure we have an explicit filter\n\t\t\tif (!txCtx.querySpec.filter || (txCtx.querySpec.filter.length === 0))\n\t\t\t\treturn ws.createResponse(400).setEntity({\n\t\t\t\t\terrorCode: 'X2-RSRC-400-9',\n\t\t\t\t\terrorMessage: 'Explicit filter is required.'\n\t\t\t\t});\n\n\t\t\t// add uplink filters\n\t\t\tthis._addUplinkFilters(\n\t\t\t\tcall, -1, txCtx.querySpec.filter, txCtx.queryParams);\n\n\t\t} catch (err) {\n\t\t\tif (err instanceof common.X2SyntaxError) {\n\t\t\t\treturn ws.createResponse(400).setEntity({\n\t\t\t\t\terrorCode: 'X2-RSRC-400-1',\n\t\t\t\t\terrorMessage: 'Invalid query string: ' + err.message\n\t\t\t\t});\n\t\t\t}\n\t\t\tthrow err;\n\t\t}\n\n\t\t// pre-resolve response promise\n\t\tlet responsePromise = Promise.resolve();\n\n\t\t// custom patch modification logic\n\t\tif ((typeof this.prepareBulkUpdateSpec) === 'function')\n\t\t\tresponsePromise = responsePromise.then(() => Promise.resolve(\n\t\t\t\tthis.prepareBulkUpdateSpec(txCtx, txCtx.patchSpec)));\n\n\t\t// build the patch\n\t\tresponsePromise = responsePromise.then(() => this._buildPatch(txCtx));\n\n\t\t// lock the main records collection by default\n\t\ttxCtx.lockCollections = [ this._recordTypeName ];\n\n\t\t// custom preparation logic\n\t\tif ((typeof this.prepareBulkUpdate) === 'function')\n\t\t\tresponsePromise = responsePromise.then(\n\t\t\t\t() => Promise.resolve(this.prepareBulkUpdate(txCtx))\n\t\t\t);\n\n\t\t// proceed to the transaction\n\t\tresponsePromise = responsePromise.then(() => {\n\n\t\t\t// build update DBO\n\t\t\tlet updateDBO;\n\t\t\ttry {\n\t\t\t\tupdateDBO = this._dboFactory.buildUpdate(\n\t\t\t\t\tthis._recordTypeName, txCtx.patch, txCtx.querySpec.filter);\n\t\t\t} catch (err) {\n\t\t\t\tif (err instanceof common.X2SyntaxError) {\n\t\t\t\t\treturn Promise.reject(ws.createResponse(400).setEntity({\n\t\t\t\t\t\terrorCode: 'X2-RSRC-400-1',\n\t\t\t\t\t\terrorMessage: 'Invalid query string: ' + err.message\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t\treturn Promise.reject(err);\n\t\t\t}\n\n\t\t\t// assemble transaction phases\n\t\t\tconst txPhases = new Array();\n\n\t\t\t// lock collections, process conditional request\n\t\t\tconst rcMonitor = this._dboFactory.recordCollectionsMonitor;\n\t\t\tif (rcMonitor)\n\t\t\t\ttxPhases.push(\n\t\t\t\t\t(_, txCtx) => rcMonitor.getCollectionsVersion(\n\t\t\t\t\t\ttxCtx.transaction,\n\t\t\t\t\t\tnew Set(txCtx.lockCollections),\n\t\t\t\t\t\t'exclusive'\n\t\t\t\t\t).then(versionInfo => this._processConditionalRequest(\n\t\t\t\t\t\ttxCtx, versionInfo\n\t\t\t\t\t))\n\t\t\t\t);\n\n\t\t\t// custom \"before\" hook\n\t\t\tif ((typeof this.beforeBulkUpdate) === 'function')\n\t\t\t\ttxPhases.push((_, txCtx) => this.beforeBulkUpdate(txCtx));\n\n\t\t\t// main action\n\t\t\ttxPhases.push((tx, txCtx) => updateDBO.execute(\n\t\t\t\ttx, call.actor, record => {\n\t\t\t\t\tconst errors = validators.normalizeRecord(\n\t\t\t\t\t\tthis._recordTypes, this._recordTypeName,\n\t\t\t\t\t\trecord,\n\t\t\t\t\t\tcall.httpRequest.headers['Accept-Language'],\n\t\t\t\t\t\t'onUpdate'\n\t\t\t\t\t);\n\t\t\t\t\tif (errors)\n\t\t\t\t\t\treturn Promise.reject(\n\t\t\t\t\t\t\tws.createResponse(422).setEntity({\n\t\t\t\t\t\t\t\terrorCode: 'X2-RSRC-422-1',\n\t\t\t\t\t\t\t\terrorMessage: 'Patch results in' +\n\t\t\t\t\t\t\t\t\t' invalid record data.',\n\t\t\t\t\t\t\t\tvalidationErrors: errors\n\t\t\t\t\t\t\t}));\n\t\t\t\t}, txCtx.queryParams));\n\n\t\t\t// custom \"after\" hook\n\t\t\tif ((typeof this.afterBulkUpdate) === 'function')\n\t\t\t\ttxPhases.push((_, txCtx, result) => this.afterBulkUpdate(\n\t\t\t\t\ttxCtx, result));\n\n\t\t\t// execute the transaction\n\t\t\treturn this._executeTransaction(txCtx, txPhases);\n\t\t});\n\n\t\t// custom completion logic\n\t\tif ((typeof this.completeBulkUpdate) === 'function')\n\t\t\tresponsePromise = responsePromise.then(\n\t\t\t\tresult => Promise.resolve(\n\t\t\t\t\ttxCtx.complete ?\n\t\t\t\t\t\tresult :\n\t\t\t\t\t\tthis.completeBulkUpdate(undefined, txCtx, result)\n\t\t\t\t),\n\t\t\t\terr => Promise.reject(\n\t\t\t\t\tthis.completeBulkUpdate(err, txCtx, undefined))\n\t\t\t);\n\n\t\t// build and return the response promise\n\t\treturn responsePromise.then(result => {\n\n\t\t\t// check if already a response\n\t\t\tif (ws.isResponse(result))\n\t\t\t\treturn result;\n\n\t\t\t// create and return respose\n\t\t\treturn this._addValidatorHeaders(txCtx, ws.createResponse(200))\n\t\t\t\t.setEntity(result);\n\t\t});\n\t}", "title": "" }, { "docid": "e6676f116ccc7a8abed7cf053eb9e451", "score": "0.4922877", "text": "updateSpecificItem(req, res){\n validateObjectKeys(allowedPropertiesToUpdate, req.body);\n modelService.updateSpecificItem(req.params.id, req.body)\n .then(updatedItem => res.status(200).json({ updatedItem, message: SUCCESS_MESSAGES.PATCH(modelName)}))\n .catch(err => res.status(400).json({ message: ERROR_MESSAGES.PATCH(modelName), error: err.message }));\n }", "title": "" }, { "docid": "7b51c64ec331aa661bc074eef2cf3574", "score": "0.49099827", "text": "function applyMake(opSet, op, patch) {\n const objectId = getChildId(op), action = op.get('action')\n if (opSet.hasIn(['byObject', objectId, '_keys'])) throw new Error(`Duplicate creation of object ${objectId}`)\n\n let object = Map({_init: op, _inbound: Set(), _keys: Map()})\n if (action === 'makeList' || action === 'makeText') {\n object = object.set('_elemIds', new SkipList())\n }\n opSet = opSet.setIn(['byObject', objectId], object)\n\n if (patch) {\n patch.objectId = objectId\n patch.type = getObjectType(opSet, objectId)\n patch.props = {}\n if (patch.type === 'list' || patch.type === 'text') patch.edits = []\n }\n return opSet\n}", "title": "" }, { "docid": "3d663f50308c4ebaac03b903ed1f343f", "score": "0.4886548", "text": "patch(req, res) {\n inList = []\n inList = req.body\n //console.log(inList[0])\n promises = []\n inList.forEach(function (value, i) {\n promises.push(new Promise(function (resolve, reject) {\n return Inventory\n .findOne({ where: { id: inList[i].id,UserId: inList[i].UserId } })\n .then(function (obj) {\n console.log(\"found object: \"+i);\n if (obj) { // update\n console.log(\"updating object: \"+i);\n obj.update(inList[i])\n .then(inventory => resolve(inventory))\n .catch(error => res.status(401).send(error))\n }\n else{\n console.log(\"Inventory:Patch creating new object\");\n Inventory.create({\n UserId: inList[i].UserId,\n Itemid: inList[i].Itemid,\n IngredientId: inList[i].IngredientId,\n Quantity: inList[i].Quantity\n })\n .then(inventory => resolve(inventory))\n .catch(error => res.status(401).send(error))\n }\n })\n .then(updated => {return updated})\n .catch(error => res.status(402).send(error))\n }))\n }); \n Promise.all(promises).then(function(data) {\n console.log(data)\n res.status(202).send(data)})\n .catch(error => res.status(401).send(error))\n }", "title": "" }, { "docid": "8b24cc9157b941455970e51e5d0a425c", "score": "0.48804525", "text": "function updateArray (updated, idx) {\n this.setState({\n object: update(\n this.state.object,\n {\n [idx]: {\n $set: updated\n }\n }\n )\n })\n}", "title": "" }, { "docid": "24f7880e0865b576a38c725942e04d95", "score": "0.48796746", "text": "update(id, body) {\n return this.rest.put(`${this.baseUrl}/${id}`, typeof body === 'object' ? JSON.stringify(body) : body);\n }", "title": "" }, { "docid": "5adb9044312e7223b731e332cdb7f22a", "score": "0.48726428", "text": "function computePatch(prev, next, update_in_place) {\n var updates = { }, has_updates = false;\n \n //Checks if an element common to prev and next \n var processElement = function(id) {\n \n //Add _ to escape ids which start with _\n var target_id = (typeof(id) == \"string\" && id.charAt(0) == \"_\" ? \"_\" + id : id);\n if( typeof(target_id) === 'number' ){\n \ttarget_id = '_'+target_id;\n };\n \n //First, check if the element exists and types match\n if(id in prev && typeof(prev[id]) == typeof(next[id])) {\n \n if(typeof(next[id]) == \"object\" && (prev[id] instanceof Array) == (next[id] instanceof Array) ) {\n \n //Object case\n var res = computePatch(prev[id], next[id], update_in_place);\n if(res !== null) {\n has_updates = true;\n updates[target_id] = res;\n }\n return;\n }\n else if(prev[id] === next[id]) {\n \n //P.O.D. case\n return;\n }\n }\n \n //Add to update list\n has_updates = true;\n updates[target_id] = clone(next[id]);\n \n if(update_in_place) {\n prev[id] = updates[target_id];\n }\n };\n \n //Two cases to deal with for plain old javascript objects:\n if(next instanceof Array) {\n //Case 1: Arrays\n if(prev.length != next.length) {\n if(update_in_place) {\n prev.length = next.length;\n }\n has_updates = true;\n updates[\"_r\"] = next.length;\n }\n for(var i=next.length-1; i>=0; --i) {\n processElement(i);\n }\n \n } else {\n //Case 2: Objects\n var removals = [];\n for(var i in prev) {\n if(!(i in next)) {\n removals.push(i);\n }\n }\n if(removals.length > 0) {\n has_updates = true;\n updates[\"_r\"] = (removals.length == 1 ? removals[0] : removals);\n \n if(update_in_place) {\n for(var i=removals.length-1; i>=0; --i) {\n delete prev[removals[i]];\n }\n }\n }\n for(var i in next) {\n processElement(i);\n }\n }\n \n if(has_updates) {\n return updates;\n }\n return null;\n}", "title": "" }, { "docid": "e4c014569cb752af355fbd6151955057", "score": "0.486638", "text": "insertListItems(subpatch, index, values, newObject) {\n const list = newObject ? [] : this.getObject(subpatch.objectId)\n if (index < 0 || index > list.length) {\n throw new RangeError(`List index ${index} is out of bounds for list of length ${list.length}`)\n }\n if (values.length === 0) return\n\n let elemId = getElemId(list, index, true)\n const allPrimitive = values.every(v => typeof v === 'string' || typeof v === 'number' ||\n typeof v === 'boolean' || v === null ||\n (isObject(v) && (v instanceof Date || v instanceof Counter || v instanceof Int ||\n v instanceof Uint || v instanceof Float64)))\n const allValueDescriptions = allPrimitive ? values.map(v => this.getValueDescription(v)) : []\n const allDatatypesSame = allValueDescriptions.every(t => t.datatype === allValueDescriptions[0].datatype)\n\n if (allPrimitive && allDatatypesSame && values.length > 1) {\n const nextElemId = this.nextOpId()\n const datatype = allValueDescriptions[0].datatype\n const values = allValueDescriptions.map(v => v.value)\n const op = {action: 'set', obj: subpatch.objectId, elemId, insert: true, values, pred: []}\n const edit = {action: 'multi-insert', elemId: nextElemId, index, values}\n if (datatype) {\n op.datatype = datatype\n edit.datatype = datatype\n }\n this.addOp(op)\n subpatch.edits.push(edit)\n } else {\n for (let offset = 0; offset < values.length; offset++) {\n let nextElemId = this.nextOpId()\n const valuePatch = this.setValue(subpatch.objectId, index + offset, values[offset], true, [], elemId)\n elemId = nextElemId\n subpatch.edits.push({action: 'insert', index: index + offset, elemId, opId: elemId, value: valuePatch})\n }\n }\n }", "title": "" }, { "docid": "c6bc88ebecbd7cd11effc004009556fe", "score": "0.48453635", "text": "function patchProperty(obj, prop, value) {\n obj[prop] = value;\n}", "title": "" }, { "docid": "c6bc88ebecbd7cd11effc004009556fe", "score": "0.48453635", "text": "function patchProperty(obj, prop, value) {\n obj[prop] = value;\n}", "title": "" }, { "docid": "c6bc88ebecbd7cd11effc004009556fe", "score": "0.48453635", "text": "function patchProperty(obj, prop, value) {\n obj[prop] = value;\n}", "title": "" }, { "docid": "c6bc88ebecbd7cd11effc004009556fe", "score": "0.48453635", "text": "function patchProperty(obj, prop, value) {\n obj[prop] = value;\n}", "title": "" }, { "docid": "c6bc88ebecbd7cd11effc004009556fe", "score": "0.48453635", "text": "function patchProperty(obj, prop, value) {\n obj[prop] = value;\n}", "title": "" }, { "docid": "c6bc88ebecbd7cd11effc004009556fe", "score": "0.48453635", "text": "function patchProperty(obj, prop, value) {\n obj[prop] = value;\n}", "title": "" }, { "docid": "c6bc88ebecbd7cd11effc004009556fe", "score": "0.48453635", "text": "function patchProperty(obj, prop, value) {\n obj[prop] = value;\n}", "title": "" }, { "docid": "c6bc88ebecbd7cd11effc004009556fe", "score": "0.48453635", "text": "function patchProperty(obj, prop, value) {\n obj[prop] = value;\n}", "title": "" }, { "docid": "c6bc88ebecbd7cd11effc004009556fe", "score": "0.48453635", "text": "function patchProperty(obj, prop, value) {\n obj[prop] = value;\n}", "title": "" }, { "docid": "c6bc88ebecbd7cd11effc004009556fe", "score": "0.48453635", "text": "function patchProperty(obj, prop, value) {\n obj[prop] = value;\n}", "title": "" }, { "docid": "c6bc88ebecbd7cd11effc004009556fe", "score": "0.48453635", "text": "function patchProperty(obj, prop, value) {\n obj[prop] = value;\n}", "title": "" }, { "docid": "c6bc88ebecbd7cd11effc004009556fe", "score": "0.48453635", "text": "function patchProperty(obj, prop, value) {\n obj[prop] = value;\n}", "title": "" }, { "docid": "c6bc88ebecbd7cd11effc004009556fe", "score": "0.48453635", "text": "function patchProperty(obj, prop, value) {\n obj[prop] = value;\n}", "title": "" }, { "docid": "a5468e787c830beb1d5a39e3e9266d68", "score": "0.48449567", "text": "function patchProperty(obj, prop, value) {\r\n obj[prop] = value;\r\n}", "title": "" }, { "docid": "a5468e787c830beb1d5a39e3e9266d68", "score": "0.48449567", "text": "function patchProperty(obj, prop, value) {\r\n obj[prop] = value;\r\n}", "title": "" }, { "docid": "a5468e787c830beb1d5a39e3e9266d68", "score": "0.48449567", "text": "function patchProperty(obj, prop, value) {\r\n obj[prop] = value;\r\n}", "title": "" }, { "docid": "a5468e787c830beb1d5a39e3e9266d68", "score": "0.48449567", "text": "function patchProperty(obj, prop, value) {\r\n obj[prop] = value;\r\n}", "title": "" }, { "docid": "a5468e787c830beb1d5a39e3e9266d68", "score": "0.48449567", "text": "function patchProperty(obj, prop, value) {\r\n obj[prop] = value;\r\n}", "title": "" }, { "docid": "a5468e787c830beb1d5a39e3e9266d68", "score": "0.48449567", "text": "function patchProperty(obj, prop, value) {\r\n obj[prop] = value;\r\n}", "title": "" }, { "docid": "1e1fcf85e0ecb5a1a7fb5c2cc7ad1d82", "score": "0.48412445", "text": "update(prodToUpdate, callback) {\n\n const editprod = JSON.stringify(prodToUpdate);\n\n fetch(\n \"/Product/Edit/\" +\n prodToUpdate.Id,\n {\n method: \"PUT\",\n headers: new Headers({\n \"Content-Type\": \"application/json\"\n }),\n body: editprod\n })\n\n .then(response => response.json())\n .then(bodyAsObject => {\n if (bodyAsObject.success) {\n\n let updatedproList = this.state.proList.slice();\n const prodIndex = updatedproList.findIndex(\n prod => prod.Id === prodToUpdate.Id\n );\n updatedproList[prodIndex] = prodToUpdate;\n\n this.setState(\n {\n proList: updatedproList\n },\n callback\n );\n } else {\n this.setState(\n {\n error: bodyAsObject.message\n },\n callback\n );\n }\n })\n .catch(error => {\n this.setState(\n {\n error: \"There was an error communicating with the back-end\"\n },\n callback\n );\n });\n }", "title": "" }, { "docid": "06a473f5d382b4955606cd15a8ae62ec", "score": "0.47970062", "text": "function patchItem(/*item, device, patch*/) {\n\t // Currently no-op\n\t }", "title": "" }, { "docid": "b56acf59964d373a421c0221820a24cb", "score": "0.47876686", "text": "function initializePatch(opSet, pathOp, patch) {\n const objectId = pathOp.get('obj'), opId = pathOp.get('opId'), key = getOperationKey(pathOp)\n const type = getObjectType(opSet, objectId)\n patch.objectId = patch.objectId || objectId\n patch.type = patch.type || type\n\n if (patch.objectId !== objectId) {\n throw new RangeError(`objectId mismatch in path: ${patch.objectId} != ${objectId}`)\n }\n if (patch.type !== type) {\n throw new RangeError(`object type mismatch in path: ${patch.type} != ${type}`)\n }\n\n if (!patch.props[key] || !patch.props[key][opId]) {\n if (type === 'list' || type === 'text') {\n const index = opSet.getIn(['byObject', objectId, '_elemIds']).indexOf(key)\n setPatchEditsForList(opSet, objectId, key, index, false, patch)\n } else {\n setPatchPropsForMap(opSet, objectId, key, patch)\n }\n }\n if (patch.props[key][opId] === undefined) {\n throw new RangeError(`field ops for ${key} did not contain opId ${opId}`)\n }\n return patch.props[key][opId]\n}", "title": "" }, { "docid": "7ba00da3ee834f76e17feac44bdd1e60", "score": "0.4770051", "text": "update() {\n\t\tif (this.hasChangedBesidesElement_(this.changes_) &&\n\t\t\tthis.shouldUpdate(this.changes_)) {\n\t\t\tthis.patch();\n\t\t}\n\t}", "title": "" }, { "docid": "3c6d701e09b3b9aebfc07dc3f04b2910", "score": "0.4745904", "text": "function setPatchPropsForMap(opSet, objectId, key, patch) {\n if (!patch) return\n if (!patch.props[key]) patch.props[key] = {}\n\n const ops = {}\n for (let op of getFieldOps(opSet, objectId, key)) {\n const opId = op.get('opId')\n ops[opId] = true\n if (!isChildOp(op) || !patch.props[key][opId]) {\n patch.props[key][opId] = makePatchForOperation(opSet, op)\n }\n }\n\n // Remove any values that appear in the patch, but were not returned by getFieldOps()\n for (let opId of Object.keys(patch.props[key])) {\n if (!ops[opId]) {\n delete patch.props[key][opId]\n }\n }\n}", "title": "" }, { "docid": "e036cbec4d75e8376567dca9b147d260", "score": "0.4726036", "text": "function addInPatch(patch, contact, property, newValue) {\n if (JSON.stringify(newValue) !== JSON.stringify(contact[property])) {\n // adds the property:value in the patch\n patch[property] = newValue;\n\n // updates the contact property\n contact[property] = newValue;\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "40d5f7449dc3b43cc0f8ff59d9f5591f", "score": "0.47251794", "text": "update(tableName, editedObject) {\n return fetch(`${remoteURL}/${tableName}/${editedObject.id}`, {\n method: \"PUT\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(editedObject)\n }).then(data => data.json());\n }", "title": "" }, { "docid": "40d5f7449dc3b43cc0f8ff59d9f5591f", "score": "0.47251794", "text": "update(tableName, editedObject) {\n return fetch(`${remoteURL}/${tableName}/${editedObject.id}`, {\n method: \"PUT\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(editedObject)\n }).then(data => data.json());\n }", "title": "" }, { "docid": "d83d4b728830018ffe11fcf94eb91f7d", "score": "0.47222012", "text": "function modify (obj, updateQuery) {\n\t var keys = Object.keys(updateQuery)\n\t , firstChars = _.map(keys, function (item) { return item[0]; })\n\t , dollarFirstChars = _.filter(firstChars, function (c) { return c === '$'; })\n\t , newDoc, modifiers\n\t ;\n\n\t if (keys.indexOf('_id') !== -1 && updateQuery._id !== obj._id) { throw new Error(\"You cannot change a document's _id\"); }\n\n\t if (dollarFirstChars.length !== 0 && dollarFirstChars.length !== firstChars.length) {\n\t throw new Error(\"You cannot mix modifiers and normal fields\");\n\t }\n\n\t if (dollarFirstChars.length === 0) {\n\t // Simply replace the object with the update query contents\n\t newDoc = deepCopy(updateQuery);\n\t newDoc._id = obj._id;\n\t } else {\n\t // Apply modifiers\n\t modifiers = _.uniq(keys);\n\t newDoc = deepCopy(obj);\n\t modifiers.forEach(function (m) {\n\t var keys;\n\n\t if (!modifierFunctions[m]) { throw new Error(\"Unknown modifier \" + m); }\n\n\t // Can't rely on Object.keys throwing on non objects since ES6\n\t // Not 100% satisfying as non objects can be interpreted as objects but no false negatives so we can live with it\n\t if (typeof updateQuery[m] !== 'object') {\n\t throw new Error(\"Modifier \" + m + \"'s argument must be an object\");\n\t }\n\n\t keys = Object.keys(updateQuery[m]);\n\t keys.forEach(function (k) {\n\t modifierFunctions[m](newDoc, k, updateQuery[m][k]);\n\t });\n\t });\n\t }\n\n\t // Check result is valid and return it\n\t checkObject(newDoc);\n\n\t if (obj._id !== newDoc._id) { throw new Error(\"You can't change a document's _id\"); }\n\t return newDoc;\n\t}", "title": "" }, { "docid": "f7c25789a82f1620f06a3345c0638d4c", "score": "0.47061294", "text": "_updateObject(event, formData) {\n \n // Update the Item\n return this.object.update(formData);\n }", "title": "" }, { "docid": "5954e2461539b3e2918cf8ec5dcd92e6", "score": "0.47037402", "text": "function makePatchForOperation(opSet, op) {\n if (op.get('action') === 'set') {\n const patch = {type: 'value', value: op.get('value')}\n if (op.get('datatype')) patch.datatype = op.get('datatype')\n return patch\n\n } else if (isChildOp(op)) {\n const childId = getChildId(op), type = getObjectType(opSet, childId)\n if (type === 'list' || type === 'text') {\n return {objectId: childId, type, props: {}, edits: []}\n } else {\n return {objectId: childId, type, props: {}}\n }\n\n } else {\n throw new RangeError(`Unexpected operation in field ops: ${op.get('action')}`)\n }\n}", "title": "" }, { "docid": "ac5d3d10de88ad7eaf7f44506ce33390", "score": "0.46942258", "text": "function doUpdate(updatedContact, updatingContact) {\n return updateAll(updatedContact, updatingContact, true);\n }", "title": "" }, { "docid": "8f5f78e4dad36042d6d8d33a43cc61e2", "score": "0.46774676", "text": "function makePatch(state, diffs, request, isIncremental) {\n const clock = state.getIn(['opSet', 'states']).map(seqs => seqs.size).toObject()\n const deps = state.getIn(['opSet', 'deps']).toArray().sort()\n const maxOp = state.getIn(['opSet', 'maxOp'], 0)\n const pendingChanges = OpSet.getMissingDeps(state.get('opSet')).length\n const patch = {clock, deps, diffs, maxOp, pendingChanges}\n\n if (isIncremental && request) {\n patch.actor = request.actor\n patch.seq = request.seq\n\n // Omit the local actor's own last change from deps\n const lastHash = state.getIn(['opSet', 'states', request.actor, request.seq - 1])\n patch.deps = patch.deps.filter(dep => dep !== lastHash)\n }\n return patch\n}", "title": "" }, { "docid": "b01a06e1a8ffa72a205791d3dfd42bd7", "score": "0.46652973", "text": "async update(obj) {\n await this.constructor\n .knex(this.constructor.tableName)\n .where({ id: this.id })\n .update(obj);\n const [record] = await this.constructor\n .knex(this.constructor.tableName)\n .where({\n id: this.id,\n });\n return new this.constructor(record);\n }", "title": "" }, { "docid": "b42e03dc2f3f4346706c18f6d7e73cb0", "score": "0.46615714", "text": "updateTask(updated) {\n return fetch(`${config.API_ENDPOINT}/tasks/${updated.id}`, {\n method: 'PATCH',\n headers: {\n 'content-type': 'application/json',\n authorization: `bearer ${TokenService.getAuthToken()}`,\n },\n body: JSON.stringify(updated),\n }).then(res =>\n !res.ok ? res.json().then(e => Promise.reject(e)) : res.json()\n );\n }", "title": "" }, { "docid": "b87c730ea1b9afe7c3289702c3419f4b", "score": "0.46612504", "text": "updateItem(timestamp, obj) {\n var all = this.list, ln = all.length;\n for (let i = 0; i < ln; i++) {\n let item = all[i];\n if (item.timestamp == timestamp) {\n merge(all[i], obj);\n }\n }\n this.saveToStore();\n }", "title": "" }, { "docid": "fb7e33cc999af54d98dc8c77a02ce4e3", "score": "0.46509817", "text": "function doUpdate(obj, callback){\n var updItem;\n // logger.log(obj.req, obj.res, {type: 'debug', data: obj.updates });\n userOp.findOneAndUpdate( { \"_id\": obj.uid}, {$set: obj.updates}, {new: true})\n .then(function(response){\n updItem = response;\n return audits.create(\n { kind: 'user', item: obj.userId , extid: obj.userMail },\n { kind: 'userAccount', item: response.cid.id, extid: response.cid.extid },\n { kind: 'user', item: response._id, extid: response.email },\n obj.auditType, null);\n })\n .then(function(response){\n logger.log(obj.req, obj.res, {type: 'audit', data: {user: obj.userMail, action: 'updateUser', uid: obj.uid }});\n callback(false, updItem, true);\n })\n .catch(function(err){\n callback(true, err, false);\n });\n}", "title": "" }, { "docid": "e09c9269abdd0c35027e99fc32d00ec5", "score": "0.4640006", "text": "function minimizeChangesetPatches (patches, oldObj) {\n // If the objects are deep equal, we return null\n if (patches.length === 0) { return null }\n\n var minifiedPatches = {\n // The object that the client should extend\n x: null,\n // An array of keys that the client should delete\n d: []\n }\n minifiedPatches = patches.reduce(function (prev, currentPatch) {\n // Create a dot-prop property key string\n var dotPropKey = currentPatch.key.join('.')\n\n // We test to see if we're dealing with an array. If so, we want to\n // insert our value at an array index instead of at a dot prop key\n var copiedCurrentPatch = currentPatch.key.slice()\n var potentialArrayIndex = copiedCurrentPatch.pop()\n var valueLocation = copiedCurrentPatch.pop()\n var valueLocationString = copiedCurrentPatch.join('.') + '.' + valueLocation\n valueLocationString = valueLocationString.charAt(0) !== '.' ? valueLocationString : valueLocationString.slice(1)\n var oldObjValue = dotProp.get(oldObj, valueLocationString)\n\n if (currentPatch.type === 'put') {\n // If the value that we're dealing with is an array we treat our key as an array index\n if (oldObjValue && oldObjValue.constructor === Array) {\n oldObjValue[potentialArrayIndex] = currentPatch.value\n dotProp.set(prev, 'x.' + valueLocationString, oldObjValue)\n return prev\n } else {\n // TODO: Consider using dot prop strings instead of extendable objects here\n // Could be slightly smaller. Need to benchmark\n dotProp.set(prev, 'x.' + dotPropKey, currentPatch.value)\n return prev\n }\n }\n // For deletions we populate an array of dot-prop key strings to later delete\n if (currentPatch.type === 'del') {\n // We test to see if we're dealing with an array. If so, we want to\n // insert our value at an array index instead of at a dot prop key\n\n // If the value that we're dealing with is an array we treat our key as an array index\n if (oldObjValue && oldObjValue.constructor === Array) {\n oldObjValue.splice(potentialArrayIndex, 1)\n dotProp.set(prev, 'x.' + valueLocationString, oldObjValue)\n return prev\n } else {\n prev.d = prev.d.concat(dotPropKey)\n return prev\n }\n }\n }, minifiedPatches)\n\n // Delete our delete property array if there are no deletions. A minor optimization for size\n if (minifiedPatches.d.length === 0) {\n delete minifiedPatches.d\n } else if (!minifiedPatches.x) {\n // If there are no value changes we old return our deletion array. Save a few bytes\n // by omitting `{x: null, d:}`\n minifiedPatches = minifiedPatches.d\n }\n\n return minifiedPatches\n}", "title": "" }, { "docid": "f38cce1fa69b1417f63bad7c26362896", "score": "0.46320784", "text": "function updateNote(id, updateField) {\n const note = notes.find(note => note.id == id);\n if (!note) {\n return undefined;\n }\n if (typeof updateField.title === 'string') {\n note.title = updateField.title;\n // note.dateModified = moment().valueOf();\n }\n if (typeof updateField.description === 'string') {\n note.description = updateField.description;\n // note.dateModified = moment().valueOf();\n }\n note.dateModified = moment().valueOf();\n saveNotes();\n return note;\n}", "title": "" }, { "docid": "688376f4ea104eca5aa5e35b7a4c18ef", "score": "0.46122864", "text": "function apiPatchCard(updateCard, editId) {\n const BASE_URL = 'https://callboard-backend.herokuapp.com';\n const headers = {\n Authorization: '',\n };\n\n const options = {\n method: 'PATCH',\n headers: { ...headers, 'Content-Type': 'application/json' },\n body: JSON.stringify(updateCard),\n };\n\n return fetch(`${BASE_URL}/call/${editId}`, options).then(responce =>\n responce.json(),\n );\n}", "title": "" }, { "docid": "4fa06233f304115e37eab3f8ec7b14f7", "score": "0.46064207", "text": "function updated2(obj){\n\t// obj.push(22);\n\tobj = [11, 22, 33];\n}", "title": "" }, { "docid": "38ade06e44145b239e00ac7a8ef30964", "score": "0.45985103", "text": "function deepMergeUpdates(new_obj, orig) {\n function M(n, o) {\n if (n === o) return o;\n if (typeof n !== typeof o) return n;\n if (n instanceof Date) {\n if (o instanceof Date && n.valueOf() == o.valueOf()) return o;\n return n;\n }\n if (Array.isArray(n)) {\n if (Array.isArray(o)) {\n let mut;\n for (var i in n) {\n if (mut) {\n mut[i] = M(n[i], o[i]);\n } else {\n let newc = M(n[i], o[i]);\n if (newc !== o[i]) {\n mut = o.slice(0, n.length);\n mut[i] = newc;\n }\n }\n }\n return mut ? mut : (n.length == o.length ? o : o.slice(0, n.length));\n }\n return n;\n } else if (typeof n === 'object') {\n let mut = false;\n let n2 = { ...n };\n let count = 0;\n for (var k in n2) {\n count += 1;\n let newc = n2[k] = M(n2[k], o[k]);\n if (!mut && newc !== o[k]) mut = true;\n }\n return (mut || Object.keys(o).length !== count) ? n2 : o;\n } else {\n return n;\n }\n }\n return M(new_obj, orig);\n}", "title": "" }, { "docid": "1e67dd36949b311051140fd5ba362bd9", "score": "0.45974383", "text": "function updateObject(obj, key, value) {\n obj[key] = value;\n return obj;\n}", "title": "" }, { "docid": "193bba9fe1eb4a48f1a33cfe0f8b2545", "score": "0.4594481", "text": "function patchItemsOrder(modifiedData) {\n $.ajax({\n url: \"/api/listitems/\",\n type: \"PATCH\",\n data: JSON.stringify(modifiedData),\n headers: {\n \"Content-Type\": \"application/json\"\n },\n success: function(res) {\n //\n }\n });\n }", "title": "" }, { "docid": "a2db9f15885d47788029d5f74ec482ea", "score": "0.45908445", "text": "function parsePatchArg (arg, objects) {\n if (_.isNumber(arg)) {\n return objects.splice(0, arg);\n return objects;\n } else if (_.isArray(arg)) {\n return arg;\n } else if (_.isObject(arg)) {\n return [arg];\n } else {\n throw new Error('Bad patches argument', arg); \n }\n}", "title": "" }, { "docid": "eff9308b2c70d87a5c38e8cffff79e8d", "score": "0.4577233", "text": "async updateSpecificItem(req, res){\n try{\n Logger.databaseQuery(`updating ${req.params.id} from ${modelName} -> ${JSON.stringify(req.body)}`);\n validateObjectKeys(allowedPropertiesToUpdate, req.body);\n const updatedItem = await modelService.updateSpecificItem(req.params.id, req.body);\n Logger.databaseResult(`item updated ${JSON.stringify(updatedItem)}`);\n res.status(200).json({ updatedItem, message: SUCCESS_MESSAGES.PATCH(modelName)});\n\n } catch (err){\n Logger.databaseError(`Faild to update ${req.params.id} -> ${err?.message}`);\n res.status(400).json({ message: ERROR_MESSAGES.PATCH(modelName)});\n }\n }", "title": "" }, { "docid": "0b97be06eb69ab4b46ebad7218e446ca", "score": "0.45684892", "text": "static initialize(obj, id, updatedAt, createdAt, deletedAt) { \n obj['id'] = id;\n obj['updated_at'] = updatedAt;\n obj['created_at'] = createdAt;\n obj['deleted_at'] = deletedAt;\n }", "title": "" }, { "docid": "c817dd0a90e83aa80e7fe7b03e437376", "score": "0.45538527", "text": "updateItem(id, property) {\n this.lists[id] = {\n ...this.lists[id],\n ...property,\n };\n }", "title": "" }, { "docid": "b29cf97ceeddc839527d816ab6a6ac51", "score": "0.45494002", "text": "function updateDogs (dog){\n return fetch(url+`/${dog.id}`, {\n method: 'PATCH',\n headers: { 'Content-Type': 'application/json'},\n body: JSON.stringify(dog)\n\n })\n .then(resp => resp.json())\n}", "title": "" } ]
015b9885102d0a7dc63684fba7c7f571
letters in alphabetical order (ie. hello becomes ehllo). Assume numbers and punctuation symbols will not be included in the string.
[ { "docid": "15b70a87efbefea7d6ed331d797fe2f3", "score": "0.67956406", "text": "function AlphabetSoup(str) {\n \n var indexAlph=[];\n var newOrder=[];\n var strSmall= str.toLowerCase();\n var compareOrd=\"abcdefghijklmnopqrstuvwxyz\";\n function compareNumbers(a,b){return a - b;}\n for(var i=0; i<strSmall.length; i++)\n \tif (compareOrd.indexOf(strSmall[i])!==-1){\n \t\tindexAlph.push(compareOrd.indexOf(strSmall[i]));\n \t\t\tindexAlph.sort(compareNumbers); \n }\t\n \n for (var j=0; j<indexAlph.length; j++){\n \n \t newOrder.push(compareOrd.charAt(indexAlph[j])); \n }\n \t\n \n \n return newOrder.join(\"\"); \n}", "title": "" } ]
[ { "docid": "2ab1f9e09b54890e6a274662807efe1d", "score": "0.7847331", "text": "function alphabet_order(str) {\n return str.split('').sort().join('');\n}", "title": "" }, { "docid": "67430784853657375c1afe020f303072", "score": "0.7790327", "text": "function alphaOrder(str) {\n\treturn str.split(\"\").sort().join(\"\");\n}", "title": "" }, { "docid": "9ef6e0d3f90a1d2361de928a48ee550d", "score": "0.7705311", "text": "function alphabetize(word) {\n if (!word) {\n return;\n }\n word = word.split('');\n word = word.sort();\n word = word.join('');\n return word;\n }", "title": "" }, { "docid": "3d2900a66b7b4d2ba5cf06d87cebfca1", "score": "0.7654027", "text": "function alphabetSoup(str) {\n if (typeof str !== 'string') {\n throw 'error: please pass a string';\n }\n else if (/[^A-Za-z]/.test(str)) {\n throw 'error: please pass a string with no punctuation or symbols'\n }\n\n return str.split('').sort().join('');\n }", "title": "" }, { "docid": "4337f4d987afd722bdd18200fea33900", "score": "0.76143616", "text": "function sortLetter(str){\n var newString = \"\";\n for (var i = str.length - 1; i >= 0; i--) {\n newString += str[i];\n }\n return newString;\n}", "title": "" }, { "docid": "3e28dfe83fcce175d86ae47e55712b04", "score": "0.7555746", "text": "function alphabetSoup(str) {\n return str.split(\"\").sort().join(\"\");\n }", "title": "" }, { "docid": "f9bf006c0a81f2448cc2fe19ae6f6cc0", "score": "0.75349385", "text": "function alphabetSoup(str) {\n return str.split('').sort().join('');\n}", "title": "" }, { "docid": "d50f47a5e3808aa44337f3be7c6a2b56", "score": "0.74283856", "text": "function captializeLetter(str){\n\tstr = str.split('').ToLowerCase();\n\treturn str;\n}", "title": "" }, { "docid": "b1461259267ec4b31c8fe8b36ff4cd51", "score": "0.74221", "text": "function alphabetOrder(str) {\n // Your code goes here ...\n const arr = str.split('')\n arr.sort((a , b) => {\n if (a < b) { return -1 }\n if (a > b) { return 1 } \n return 0\n })\n return arr.join('')\n}", "title": "" }, { "docid": "95a8ed6461909f7abf1dcbe95bd54b3f", "score": "0.7362811", "text": "function orderStringAlphabetically(string) {\n let arr = string.toLowerCase().split('').sort()\n arr = (arr.filter((letter) => letter !== ' ')).join('')\n return arr\n}", "title": "" }, { "docid": "d8e4e1e34a38b897d14285b8a954f807", "score": "0.73557454", "text": "function alphaStri(stringValue){\n return stringValue.split(\"\").sort().join(\"\");\n \n}", "title": "" }, { "docid": "642a7a772da949898963f82fce3d9732", "score": "0.73438877", "text": "function alphabetized(s) {\n let letters = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'];\n let newS = s.split('');\n let result = '';\n \n for(let i = 0; i <= letters.length - 1; i++){\n let big = letters[i];\n let small = letters[i].toLowerCase();\n result += newS.filter(x => x == big || x == small).join('');\n };\n \n return result;\n}", "title": "" }, { "docid": "928b286a816e8e2e8b0dd18574270a28", "score": "0.730531", "text": "function alphabetSoup(string) {\n\n var arr = string.split(\"\");\n\n\n for (var i = 0; i < string.length; i++) {\n\n }\n return arr.sort([i]);\n}", "title": "" }, { "docid": "100ebfa307af5405dd25eaf6a1348109", "score": "0.7299759", "text": "function alphabetical(string){\n var newWord = string.split(\"\").sort().join(\"\");\n console.log(newWord);\n}", "title": "" }, { "docid": "1ac447231e0b4186ebf0c31ebbc30e1d", "score": "0.7284174", "text": "function orderAlphabetical(string) {\n let lower = string.toLowerCase();\n return lower.split('').sort().join('');\n}", "title": "" }, { "docid": "2c24c3ee9875bd8457de9a4c39cd3197", "score": "0.7233168", "text": "function AlphabetSoup(str) {\r\n\tlet arr = str.split('')\r\n\treturn arr.sort().join('') \r\n}", "title": "" }, { "docid": "955c28402fee7eca66fc014551208cf0", "score": "0.71832633", "text": "function sortLetters(inputString) {\nif(typeof inputString !== \"string\"){throw('Invalid Input');}\n\n\n//if(inputString.length===0){throw('Invalid Input');}\n\nvar keithisawesome = inputString.split(\"\");\naustintexas = keithisawesome.sort();\nconsole.log(austintexas);\nvar houston = austintexas.join(\"\");\nreturn houston;\n}", "title": "" }, { "docid": "03ba1f728d1f1a8d4b97c9eead86bda3", "score": "0.71764696", "text": "function stringToSortedLetters(string) {\n return string.split('').sort();\n}", "title": "" }, { "docid": "6aed7ee1b8d103070204f4d2172ac7ff", "score": "0.7155201", "text": "function AlphabetSoup ( str ) { \r\n\r\n var arr = str.split(\"\");\r\n var sort = arr.sort();\r\n var newStr = sort.join(\"\");\r\n return newStr; \r\n}", "title": "" }, { "docid": "38068f00a931c27c4dd72d304844d6c1", "score": "0.713624", "text": "function alphabits() {\n\t//Use the split() method to return a new array. \" \" is used as the delimiter\n\tlet stringSplit = testString.split(\" \"); //[\"teenage\", \"mutant\", \"ninja\", \"turtles\"]\n\t//Use the sort() method to arrange each word in alphabetical order\n\tlet stringSort = stringSplit.sort(); //[\"mutant\", \"ninja\", \"teenage\", \"turtles\"]\n\t//Use the join() method to join all elements of the array into a string\n\tlet stringJoin = stringSort.join(\" \"); // \"ninja mutant teenage turles\"\n\tdocument.getElementById(\"container-2\").innerHTML = `Sort: ${stringJoin}`\n}", "title": "" }, { "docid": "f5c7777ca0e52419364e945826ddeaa9", "score": "0.7130825", "text": "function AlphabetSoup(str) { \n var tmpStr;\n tmpStr = str.split('');\n tmpStr = tmpStr.sort();\n tmpStr = tmpStr.join('');\n return tmpStr; \n}", "title": "" }, { "docid": "d578457495fadf35d3853a39ac6a6852", "score": "0.7127695", "text": "function AlphabetSoup(str) {\n // string should be split first and then sort before join them.\n return str.split('').sort().join('');\n}", "title": "" }, { "docid": "07a1dde693e6c7c1b736d40e9c34b918", "score": "0.7099734", "text": "function alphabet(a) {\r\n let z=\"\";\r\n let b= a.split(\"\").sort();\r\n for (let i = 0; i < b.length; i++) {\r\n z+=b[i]\r\n \r\n }\r\n return z;\r\n}", "title": "" }, { "docid": "72e144e134af51af6bfe954c9bbaf69d", "score": "0.7099053", "text": "function AlphabetSoup(str) { \n\n // code goes here \n // convert the string into an array of characters\n var chars = str.split(\"\");\n console.log(chars)\n \n // sort the array in alphabetical order\n var sorted = chars.sort();\n console.log(sorted)\n \n // return the newly sorted string\n return sorted.join(\"\");\n \n // return str; \n \n }", "title": "" }, { "docid": "c123adbbded2d52a8d545dd5b89e0f51", "score": "0.70934623", "text": "function AlphabetSoup(str) {\n return str.split(\"\").sort().join(\"\");\n}", "title": "" }, { "docid": "afe156f1e131c7f3620376a9d79566d1", "score": "0.7052209", "text": "function alphaSort(letters){\n return letters.sort(); \n}", "title": "" }, { "docid": "29ab3e8a33889979845218cc16aec19e", "score": "0.70521665", "text": "function rearrangeLetters(letters) {\n var alphabetize = [];\n var wordSort = letters.split(\" \");\n\n for (var i = 0; i < wordSort.length; i++) {\n var element = wordSort[i];\n alphabetize.push(element.split(\"\").sort().join(\"\"));\n\n\n }\n\n\n var wordJoin = alphabetize.join(\" \");\n\n return wordJoin;\n}", "title": "" }, { "docid": "c516a7bf91db525effd133b467989aae", "score": "0.6987426", "text": "function LetterChanges(str) {\n var arr = str.split(\"\");\n var result = [];\n arr.forEach(function(el) {\n if (el.charCodeAt() >= 97 && el.charCodeAt() < 122) {\n result.push(String.fromCharCode(el.charCodeAt() + 1));\n } else if (el.charCodeAt() === 122) {\n result.push(\"a\");\n } else {\n result.push(el);\n }\n });\n var final = [];\n result.forEach(function(x) {\n if (\"aeiou\".includes(x)) {\n final.push(x.toUpperCase());\n } else {\n final.push(x);\n }\n });\n return final.join(\"\");\n}", "title": "" }, { "docid": "8e24ee7d99c1cbe79583349f8b2a6119", "score": "0.69279605", "text": "function alphabetSoup(str) {\n\tvar aSoup = str.split(\"\").sort().join(\"\");\n\treturn aSoup; \n}", "title": "" }, { "docid": "13e325a3c82281a424ef9620d8e568ec", "score": "0.69058007", "text": "function LetterChanges ( str ) {\r\n\r\n var newString = \"\";\r\n var reg = /[a-z]/gi;\r\n\r\n for ( var i = 0; i < str.length; i++ ) {\r\n if (str.charAt(i) === \"z\" || str.charAt(i) === \"Z\") {\r\n newString += \"a\";\r\n } else if ( str.charAt(i).match(reg) ) {\r\n newString += String.fromCharCode(str.charCodeAt(i) + 1);\r\n } else {\r\n newString += str.charAt(i);\r\n }\r\n }\r\n\r\n for ( var i = 0; i < newString.length; i++ ) {\r\n if (newString.charAt(i) === \"a\" ||\r\n newString.charAt(i) === \"e\" ||\r\n newString.charAt(i) === \"i\" ||\r\n newString.charAt(i) === \"o\" ||\r\n newString.charAt(i) === \"u\") {\r\n newString = newString.replace(newString.charAt(i),newString.charAt(i).toUpperCase());\r\n }\r\n }\r\n\r\n return(newString);\r\n }", "title": "" }, { "docid": "0714b97964f3125852b9b5e716de38a2", "score": "0.6889407", "text": "function AlphabetSoup(str) {\n str = str.split('').sort(function(a,b) {return (a > b) ? 1 : ((b > a) ? -1 : 0);} ).join('')\n // str = str.sort(function(a,b) {return (a > b) ? 1 : ((b > a) ? -1 : 0);} )\n​\n return str;\n}", "title": "" }, { "docid": "7d12f75b862b8e4ac71278f5923f3909", "score": "0.68499506", "text": "function AlphabetSoup(str) { \n\n // code goes here \n return str.split('').sort().join(''); \n \n }", "title": "" }, { "docid": "597641b6d379440842562659eb8a8e36", "score": "0.68473303", "text": "function alphWords(userStr){\n\tconsole.log(userStr.split(' ').sort());\n}", "title": "" }, { "docid": "910fd3952059330c8b73bc41bd044667", "score": "0.6843434", "text": "function alphabetizeWords(string) {\n var newArray = string.split(\" \");\n for ( var i = 0; i < newArray.length; i++) {\n newArray[i] = newArray[i].split(\"\").sort().join(\"\") \n }\n return newArray.join(\" \");\n}", "title": "" }, { "docid": "8596a8224d775c5f217a3050bb6a91ed", "score": "0.6838302", "text": "function LetterChanges(str) {\n var strcharcoded = '';\n for (var i=0;i<str.length;i++){\n var charcode = str.toLowerCase().charCodeAt(i);\n if (/[a-z]/.test(String.fromCharCode(charcode))) {\n if (/[a,e,o,i,u]/.test(String.fromCharCode(charcode + 1))) {\n strcharcoded += String.fromCharCode(charcode + 1).toUpperCase();\n } else {\n strcharcoded += String.fromCharCode(charcode + 1);\n }\n } else {\n strcharcoded += String.fromCharCode(charcode);\n }\n }\n return strcharcoded;\n}", "title": "" }, { "docid": "557045e7a4742028fb23161e4ac2c8a0", "score": "0.6832178", "text": "function alphWords(userStr){\n console.log(userStr.split(' ').sort());\n}", "title": "" }, { "docid": "361c1070315d2d9468bb3324e3d7aab0", "score": "0.68118924", "text": "function isLetter (str) {\n return str.match(/[a-z]/i)\n }", "title": "" }, { "docid": "4507255fb047ce12caca19fa3ede1d48", "score": "0.68097067", "text": "function AlphabetSoup(str) {\n\tlet strArr = str.split('').sort().join('')\n\treturn strArr;\n}", "title": "" }, { "docid": "a6f2f10f326211d20d06f1a05e6c584f", "score": "0.6800284", "text": "function reverseLetter(str) {\r\n return str.replace(/[^a-z]/g, \"\").split(\"\").reverse().join(\"\");\r\n}", "title": "" }, { "docid": "ceddfd6bdfe5ac84b4373a17a27ce77a", "score": "0.6793411", "text": "function LetterChanges(str) {\n const alphabet = 'abcdefghijklmnopqrstuvwxyz';\n return str.toLowerCase().split('').map(letter => {\n if (letter.match(/\\W/)) return letter;\n const index = alphabet.indexOf(letter);\n let newLetter = (alphabet[index + 1] || alphabet[0]);\n return newLetter.match(/[aeiou]/) ? newLetter.toUpperCase() : newLetter;\n }).join('');\n}", "title": "" }, { "docid": "01d68273af05868612d5e8a1eac8c59f", "score": "0.6775908", "text": "function alphabetic_order(word) {\n var arr = word.split('');\n var arr2 = arr.sort();\n var arr3 = arr2.join('');\n return arr3; \n //return \"rearranged word\";\n}", "title": "" }, { "docid": "de68087174d2fbc586608d6491d099ed", "score": "0.6748209", "text": "function LetterChanges(str) {\n str = str.replace(/[a-zA-Z]/g, function(ch) {\n if(ch === 'z') return 'a';\n else if (ch === 'Z') return 'A';\n else return String.fromCharCode(ch.charCodeAt(0) + 1);\n });\n\n return str.replace(/[aeiou]/g, function (ch) {\n return ch.toUpperCase();\n });\n}", "title": "" }, { "docid": "db3270943057e2e672d682d2d1b6c13c", "score": "0.67267615", "text": "function sc_isCharAlphabetic(c)\n{ return sc_isCharOfClass(c.val, SC_LOWER_CLASS) ||\n sc_isCharOfClass(c.val, SC_UPPER_CLASS); }", "title": "" }, { "docid": "54945c17fa3cb6cc5e6cbac237164c21", "score": "0.67203367", "text": "function reverseLetter(str) {\n return str.replace(/[^a-z]/ig, \"\").split(\"\").reverse().join(\"\");\n}", "title": "" }, { "docid": "c7a7f1adb62e2dbcf61c390d96ea0777", "score": "0.67145747", "text": "function isAlphabetic (s)\n{ var i;\n if (isEmpty(s)) \n if (isAlphabetic.arguments.length == 1) return defaultEmptyOK;\n else return (isAlphabetic.arguments[1] == true);\n else {\n return reAlphabetic.test(s)\n }\n}", "title": "" }, { "docid": "d5c5a43e21abeae6cfa90274efc61209", "score": "0.67122895", "text": "function AlphabetSoup(str) { \n var pos = 0,\n dubs = [];\n for (var i=0; i< str.length; i++) {\n pos = str.charCodeAt(i);\n \n \n dubs.push(str[i]);\n \n }\n \n str = dubs.sort().join(' ').replace(/\\s/g,'');\n // code goes here \n return str; \n \n}", "title": "" }, { "docid": "d47db7a86e802a5b161e4f6bc11528e9", "score": "0.67006856", "text": "function alphabeticalOrder() {}", "title": "" }, { "docid": "f2ed9dad4f06b304afdf545c7dfadb24", "score": "0.66824", "text": "function LetterChanges(str) { \n // code goes here \n var newLetter;\n var arr;\n str = str.toLowerCase();\n arr = str.split('');\n \n for (var i = 0, len = str.length; i < len; i++) {\n if (str.charCodeAt(i) <= 122 && str.charCodeAt(i) >= 97) {\n if (str[i] === \"z\") {\n newLetter = str.charCodeAt(i);\n newLetter = String.fromCharCode(newLetter - 25);\n arr.splice(i, 1, newLetter);\n } else {\n newLetter = str.charCodeAt(i);\n newLetter = String.fromCharCode(newLetter + 1);\n arr.splice(i, 1, newLetter);\n };\n };\n };\n for (var j = 0; j < arr.length; j++) {\n if (arr[j] == \"a\" || arr[j] == \"e\" || arr[j] == \"i\" || arr[j] == \"o\" || arr[j] == \"u\") {\n arr.splice(j, 1, arr[j].toUpperCase());\n };\n };\n\n str = arr.join('');\n return str; \n}", "title": "" }, { "docid": "745f79722b24cfdd5906d0219941d1a4", "score": "0.6672608", "text": "function string_letter_permutation(str) {\n permutations = []\n permutations.push(str)\n\n for (let i = 0; i < str.length; i++){\n if (isNaN(parseInt(str[i], 10))) {\n const n = permutations.length\n for (j = 0; j < n; j++){\n const perm = permutations[j].split('')\n\n if (perm[i] == perm[i].toLoweCase()) {\n perm[i] = perm[i].toUpperCase()\n } else {\n perm[i] = perm[i].toLoweCase()\n \n }\n permutations.push(perm.join(''))\n }\n }\n }\n return permutations\n}", "title": "" }, { "docid": "c219e634d498cefdd4cedf200ed2e988", "score": "0.6670584", "text": "function isAlphabetic(cadena)\n{\n return(cadena.match(/^[a-zA-Z\\s]*$/));\n}", "title": "" }, { "docid": "38a3aa267bd180bd4a17739d3c5310a0", "score": "0.666447", "text": "function reverseLetter(str) {\n return str.replace(/[^a-z]/gi, '').split('').reverse().join('');\n}", "title": "" }, { "docid": "be6ad0b1db8577ea227b297094638c17", "score": "0.6656311", "text": "function Chr2Asc(Letter) { \n\tvar Alpha = ' !\"#$%& ()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[ ]^_`abcdefghijklmnopqrstuvwxyz{|}~'\n\tif (Letter == \"'\") {\n\t\treturn 39;\n\t} else if (escape(Letter) == \"%5C\") {\n\t\treturn 92;\n\t} else if (Alpha.indexOf(Letter) < 0) { \n\t\treturn Alpha.indexOf(Letter);\n\t} else {\n\t\treturn Alpha.indexOf(Letter)+ 32;\n\t}\n}", "title": "" }, { "docid": "e45461f8df4d76f32377b37a0228d79d", "score": "0.6647926", "text": "function onlyLetters(str) {\n let result = \"\";\n for (let i = 0; i < str.length; i++) {\n let currentLetter = str[i];\n if (isNaN(currentLetter)) result += currentLetter;\n }\n\n return result;\n}", "title": "" }, { "docid": "7861d8b1e4470a39515735e433fe0d15", "score": "0.6645368", "text": "function alphabetize(string) {\n var sentenceArr = string.split(' ')\n var finalSentence = []\n sentenceArr.forEach(function(entry) {\n var newArr = entry.split('').sort();\n finalSentence.push(newArr.join(''));\n });\n console.log(finalSentence.join(' '))\n}", "title": "" }, { "docid": "ed5addefce945db5f98df36a3b7968c9", "score": "0.663415", "text": "function isLetter(str) {\n return str.length === 1 && str.match(/[a-z]/i);\n}", "title": "" }, { "docid": "622c9c1b4af5ad7350b1150e5a1b1823", "score": "0.6629246", "text": "function reverseLetter(str) {\n let newStr = str.replace(/\\W|_|[0-9]/g , '')\n return Array.from(newStr).reverse().join('')\n}", "title": "" }, { "docid": "d5e82c3eda4cf5499329d17c18a64afd", "score": "0.6623412", "text": "function returnPassedString (inputStr) {\n \n var a = inputStr.toLowerCase().split(\"\").sort();\n\n var transformedLetter = a.pop().toUpperCase();\n a.push(transformedLetter);\n\n return a.join(\"\");\n}", "title": "" }, { "docid": "ef5b0bf37c941f3ce8b174f9d7bca44d", "score": "0.661186", "text": "function cleanString(str) {\n return str.replace(/[^\\w]/g, '').toLowerCase().split('').sort().join('');\n}", "title": "" }, { "docid": "b851632a9f0eb749891f399c43bf8de4", "score": "0.66109097", "text": "function alphabeticShift(str) {\n return str\n .split('')\n .filter((letter) => letter === ' ' || (letter >= 'A' && letter <= 'z'))\n .map((letter) => {\n if (letter === ' ') {\n return ' ';\n }\n\n if (letter === 'z') {\n return 'a'.charCodeAt(0);\n }\n\n if (letter === 'Z') {\n return 'A'.charCodeAt(0);\n }\n\n return letter.charCodeAt(0) + 1;\n })\n .map((code) => String.fromCharCode(code))\n .join('');\n}", "title": "" }, { "docid": "e3a3ef42806dc91d45da29d9f604174f", "score": "0.6607298", "text": "function LetterChanges(str) {\n var newStr = str.replace(/[a-z]/gi, function(char){\n return (char === 'z' || char === 'Z' ? 'a' : String.fromCharCode(char.charCodeAt()+1));\n });\n return newStr.replace(/[aeiou]/gi, function(char) {\n return char.toUpperCase();\n });\n}", "title": "" }, { "docid": "60eac445914459f2050db833210942bd", "score": "0.6601789", "text": "function alphabits(testString) {\n console.log('alpha test: ', testString);\n resultsAlpha.innerHTML += testString.split('').sort().join('');\n}", "title": "" }, { "docid": "26b82bee38ad344c8dd86e5e8439fce1", "score": "0.65992916", "text": "function isLetter(str) {\n return str.match(/[a-z]/i);\n}", "title": "" }, { "docid": "7b5bd2efc6a92c8b37b69cf2715a8fca", "score": "0.6587694", "text": "function isLetter(str) {\n return str.length === 1 && str.match(/[a-z]/i);\n}", "title": "" }, { "docid": "e13d694794321da05843e56b149849c8", "score": "0.6579262", "text": "function alphabetSort(message){\n // wirte your code here\n return message.split(\"\").sort().join(\"\");\n}", "title": "" }, { "docid": "6938b03260cd810c01eab55585397d78", "score": "0.65773696", "text": "function isLetter(str, pos) {\n if (pos < 0 || pos >= str.length) { return false; }\n return !punctReg.test(str[pos]);\n}", "title": "" }, { "docid": "466f96d9c450e2bb4fd59aeb3dd785f7", "score": "0.65735465", "text": "function isLetter(str, pos) {\n if (pos < 0 || pos >= str.length) { return false; }\n return !PUNCT_RE.test(str[pos]);\n}", "title": "" }, { "docid": "466f96d9c450e2bb4fd59aeb3dd785f7", "score": "0.65735465", "text": "function isLetter(str, pos) {\n if (pos < 0 || pos >= str.length) { return false; }\n return !PUNCT_RE.test(str[pos]);\n}", "title": "" }, { "docid": "466f96d9c450e2bb4fd59aeb3dd785f7", "score": "0.65735465", "text": "function isLetter(str, pos) {\n if (pos < 0 || pos >= str.length) { return false; }\n return !PUNCT_RE.test(str[pos]);\n}", "title": "" }, { "docid": "466f96d9c450e2bb4fd59aeb3dd785f7", "score": "0.65735465", "text": "function isLetter(str, pos) {\n if (pos < 0 || pos >= str.length) { return false; }\n return !PUNCT_RE.test(str[pos]);\n}", "title": "" }, { "docid": "466f96d9c450e2bb4fd59aeb3dd785f7", "score": "0.65735465", "text": "function isLetter(str, pos) {\n if (pos < 0 || pos >= str.length) { return false; }\n return !PUNCT_RE.test(str[pos]);\n}", "title": "" }, { "docid": "466f96d9c450e2bb4fd59aeb3dd785f7", "score": "0.65735465", "text": "function isLetter(str, pos) {\n if (pos < 0 || pos >= str.length) { return false; }\n return !PUNCT_RE.test(str[pos]);\n}", "title": "" }, { "docid": "466f96d9c450e2bb4fd59aeb3dd785f7", "score": "0.65735465", "text": "function isLetter(str, pos) {\n if (pos < 0 || pos >= str.length) { return false; }\n return !PUNCT_RE.test(str[pos]);\n}", "title": "" }, { "docid": "d722c7afdbd214d267c17a38d75205b6", "score": "0.65671515", "text": "function pigIt(str){\n let result = [];\n str = str.split(' ');\n\n str.map(val => { \n let arr = val.split('');\n let firstLetter = arr.splice(0,1);\n \n if((firstLetter[0].charCodeAt(0) >= 65 && firstLetter[0].charCodeAt(0) <= 90) ||\n (firstLetter[0].charCodeAt(0) >= 97 && firstLetter[0].charCodeAt(0) <= 122)){\n firstLetter += \"ay\"; \n }\n arr.push(firstLetter);\n result.push(arr.join(''))\n });\n \n return result.join(' ')\n}", "title": "" }, { "docid": "1bff7306f17ec9fbad39148ddd5971d8", "score": "0.6563543", "text": "function onlyLetters(str) {\n\treturn str.toLowerCase().replace(/[^a-z]/g, \"\");\n}", "title": "" }, { "docid": "390a702e58e383299a4817b65f56ee4e", "score": "0.65627486", "text": "function LetterChanges(str){\n var changeChar = \"\", answer = \"\";\n for (var i = 0; i <str.length; i++){\n changeChar += str[i].replace(/[a-y]/gi, String.fromCharCode(str.charCodeAt(i)+1));\n }\n changeChar = changeChar.replace(\"z\", \"a\");\n for (var i = 0; i <str.length; i++){\n answer += changeChar[i].replace(/(a|e|i|o|u)/g, changeChar[i].toUpperCase());\n }\n return answer;\n}", "title": "" }, { "docid": "ca4ba4118fd846d746f822c74f7a2793", "score": "0.6540925", "text": "function isAlphabetic(input) {\r\n \t \tvar format = /^[A-Za-z -]+$/;\r\n \t \treturn isValidInput(input, format);\r\n \t }", "title": "" }, { "docid": "d83fc5ad609992233d80d43c03a6a11b", "score": "0.6539569", "text": "function letterChanges(str){\n var result = [];\n strArray = str.toLowerCase().split(\"\");;\n strArray.forEach(function(e){\n let foo = e.charCodeAt(0);\n //spaces\n if (foo === 32){\n result.push(String.fromCharCode(32));\n //z and a Capital\n }else if (foo === 122){\n result.push(String.fromCharCode(65));\n //e 100->69\n }else if (foo === 100){\n result.push(String.fromCharCode(69));\n // i 104 => 73\n }else if(foo === 104){\n result.push(String.fromCharCode(73));\n //o 110 -> 79\n }else if (foo === 110){\n result.push(String.fromCharCode(79));\n //u 116 -->85\n }else if(foo === 116){\n result.push(String.fromCharCode(85));\n }else{\n result.push(String.fromCharCode(foo + 1));\n }//end of if/else\n });//end of forEach\n return result.join(\"\");\n}//end", "title": "" }, { "docid": "3e0ab2580675ed4532575b0c36d6246f", "score": "0.65388644", "text": "function AlphabetSoup(str) {\n \n // extracting the characters of the string into an array by using split function; the argument \"\"(double qoutes without spaces) used is for picking each character as an element of the array.\n var arr = str.split(\"\");\n \n // built-in sort function of arrray to sort the array.\n var sortarr = arr.sort();\n\n //joining all the characters back from the array and assembiling to string back.\n //return the reverse string\n return sortarr.join(\"\");\n\n}", "title": "" }, { "docid": "899504c9edb088b5954cf73cde5e409b", "score": "0.6531655", "text": "function alphabetPosition(text) {\n const letters = text.toLowerCase().match(/[a-z]/g);\n return letters && letters.map(letter => letter.charCodeAt(0) - 96).join(' ') || '';\n}", "title": "" }, { "docid": "578128ad623c50cffc6db6e99abac546", "score": "0.652982", "text": "function orderAlphabetically() {}", "title": "" }, { "docid": "578128ad623c50cffc6db6e99abac546", "score": "0.652982", "text": "function orderAlphabetically() {}", "title": "" }, { "docid": "51741ab96873c0cc16bfde4a05658d1e", "score": "0.65273225", "text": "function solution(string) {\n // split the string in individual letters\n return string.split('').map(e => {\n // if the letter is uppercase return it with a space in front of it, otherwise return the letter\n return e === e.toUpperCase() ? (` ${e}`) : e\n // join back all the letters\n }).join('');\n}", "title": "" }, { "docid": "5e6aa94486af820b578422926b35c5a5", "score": "0.65261304", "text": "function swapLetter(string) {\n\t if ( typeof(string) !== \"string\"){\n\t\t throw new Error ('Error: first argument not a string');\n\t }\n\t var newstr = \"\";\n\t var l = string.length;\n\t for (var i = 0; i < l; i++){\n\t\t if(string[i] === string[i].toLowerCase()) {\n newstr += string[i].toUpperCase();\n\t\t} else {\n newstr += string[i].toLowerCase();\n }\n }\n\treturn newstr;\n }", "title": "" }, { "docid": "02a547e5dd885e4065163f27e12452ad", "score": "0.6510013", "text": "function alphabetizeWords (inputStr){\n var currentArr = inputStr.split(\" \");\n var outputArr= [];\n\n for ( var i = 0; i < currentArr.length; i++) {\n outputArr[outputArr.length] = currentArr[i].split(\"\").sort().join(\"\");\n }\n\n return outputArr.join(\" \");\n}", "title": "" }, { "docid": "bf96f015dde0bc1f622c827c36d05d10", "score": "0.6507667", "text": "function capitalize(str) {\n const words = str.split(' ');\n const aCode = 'a'.charCodeAt(0)\n const zCode = 'z'.charCodeAt(0)\n const diff = aCode - 'A'.charCodeAt(0);\n \n for(let i = 0; i < words.length; i++) {\n const code = words[i].charCodeAt(0)\n \n if (code >= aCode && code <= zCode) {\n const letters = words[i].split('')\n \n letters[0] = String.fromCharCode(code - diff)\n \n words[i] = letters.join('')\n }\n }\n \n return words.join(' ')\n}", "title": "" }, { "docid": "963723b2cf616cc20f346e1510be1700", "score": "0.65028644", "text": "function isLetter(str) {\n\tif(str == null)\n\t\treturn false;\n\treturn str.length === 1 && str.match(/[a-z]/i);\n}", "title": "" }, { "docid": "cb3551e0557422099f988208ef032e48", "score": "0.65008503", "text": "function letterChanges(str) {\n if (typeof str !== 'string') throw 'error: incorrect argument you stupid fuck';\n\n var letters = 'abcdefghijklmnñopqrstuvwxyza',\n splitLetters = letters.split(''),\n splitStr = str.toLowerCase().split('');\n\n for (var i = 0; i < str.length; i++) {\n var idx = splitLetters.indexOf(splitStr[i]);\n if (idx !== -1) {\n splitStr[i] = splitLetters[idx + 1];\n }\n if (splitStr[i].search(/[aeiou]/) !== -1) {\n splitStr[i] = splitStr[i].toUpperCase();\n }\n }\n return splitStr.join('');\n }", "title": "" }, { "docid": "c41a95fcbf4a90cab75f710e34f9102f", "score": "0.649798", "text": "function LetterChanges(str) { \r\n \r\n strArr = str.split('');\r\n resArr = strArr.map((every)=> {\r\n if (every.length > 0 && every.match(/[a-z]/i)) {\r\n return String.fromCharCode(every.charCodeAt(0) + 1)\r\n }\r\n else {\r\n return every;\r\n }\r\n });\r\n \r\n // check if resArr has vowel ?\r\n resArr = resArr.map((_)=>{\r\n if(_.match(/[aeiou]/)){\r\n return _.toUpperCase();\r\n } else {\r\n return _;\r\n }\r\n })\r\n str = resArr.join('');\r\n // code goes here \r\n return str; \r\n \r\n }", "title": "" }, { "docid": "cc84a899da0125c751c0d05398522090", "score": "0.6479165", "text": "function alphabetic(inputtxt) {\n var letters = /^[a-zA-Z]+$/;\n if ((inputtxt.match(letters))) {\n return true;\n } else {\n return false; \n }\n }", "title": "" }, { "docid": "7aa067cfaca251cd5f184deeae947611", "score": "0.646853", "text": "function isAlpha(ch) {\n return /^[A-Z]$/i.test(ch);\n }", "title": "" }, { "docid": "25157db269ce2135c271676e46930dc1", "score": "0.6467604", "text": "function balikString(str){\n\n var letter =\"\";\n for(var char of str){\n letter = char + letter;\n }\n return letter;\n}", "title": "" }, { "docid": "d44131456e8d2f3447c7300f68c3ae63", "score": "0.6461891", "text": "function AlphabetSoup(str) {\nconsole.log(\"Your current string is: \" + str)\n\tvar newArray = str.split(\"\")\n\t// console.log(newArray)\n\tvar sortedArray = newArray.sort()\n\t// console.log(sortedArray)\n\tstr = sortedArray.join(\"\")\n\tconsole.log(\"Here's your sorted string! \" + str)\n\treturn str;\n}", "title": "" }, { "docid": "4ca69b8e4a253b004a699d3772feb460", "score": "0.64591825", "text": "function alphabetical(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character;\n return code >= 97 && code <= 122 ||\n /* a-z */\n code >= 65 && code <= 90\n /* A-Z */\n ;\n}", "title": "" }, { "docid": "ee394ce55ee3884e264432317e342952", "score": "0.6448705", "text": "function isAlpha(ltr){\n var aplha=\"abcdefghijklmnopqrstuvwxyz\";\n return(aplha.split(\"\").includes(ltr));\n}", "title": "" }, { "docid": "f6b83f629d46e9751edc12cd78dfdf66", "score": "0.64372903", "text": "function letterChanges(str) {\r\n const vowels = ['a', 'e', 'u', 'i', 'o'];\r\n let newString = \"\";\r\n let letter = \"\";\r\n for (i of str.toLowerCase()){\r\n if (i.charCodeAt(0) < 97 || i.charCodeAt(0) > 122){\r\n newString += i;\r\n }\r\n else {\r\n letter = String.fromCharCode((i.charCodeAt(0) - 97 + 1)%25 + 97)\r\n if (vowels.includes(letter)){\r\n newString += letter.toUpperCase();\r\n }\r\n else {\r\n newString += letter;\r\n }\r\n } \r\n }\r\n\r\n\r\n return newString;\r\n}", "title": "" }, { "docid": "7b75fa08330602125b77c9b163ef6432", "score": "0.6434438", "text": "function letterChanges(str) { \n var alphabet = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n var newString = [];\n\n for (var i = 0; i < str.length; i++) {\n var char = str.charAt(i);\n letterIndex = alphabet.indexOf(char);\n \n // if its a letter in the set increment to the next letter\n if (letterIndex != -1) {\n // check edge condition if Z -> a\n if (letterIndex == alphabet.length -1) letterIndex = -1; \n newString[i] = alphabet[++letterIndex];\n } \n // else its a punctuation so skip incrementing it and just use it\n else newString[i] = str[i];\n }\n \n // if there is a vowel in the string uppercase it and return a string \n return (upperCaseVowels(newString)).join(\"\"); \n}", "title": "" }, { "docid": "1e08ee8fc0e6fbedb7a741f1fb0c7438", "score": "0.64329815", "text": "function isAlphabetic(s){\n\tif (s.length > 1)\n\t\treturn false;\n\n\tif (s.match(/[a-z]/i) === null)\n\t{\n\t\tconsole.log(\"Non-alpha key is \" + s)\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\treturn true;\n\t}\n}", "title": "" }, { "docid": "07fdcb989aa23725ab5600582e302214", "score": "0.6430538", "text": "function letterChanges(str) {\n let newStr = str.toLowerCase().replace(/[a-z]/gi, char => {\n if(char == 'z' || char == 'Z'){\n return 'a';\n }else{\n return String.fromCharCode(char.charCodeAt() + 1);\n }\n });\n newStr = newStr.replace(/a|e|i|o|u/gi, vowel => {\n return vowel.toUpperCase();\n });\n\n return newStr;\n}", "title": "" }, { "docid": "649f6a0aabd51fba62a2edc7740de7a0", "score": "0.6416182", "text": "function LetterChanges(str) { \n\n var converted = str.replace(/[a-z]/gi, function(char){\n return (char === 'z' || char === 'Z') ? 'a' : String.fromCharCode(char.charCodeAt() +1 )\n });\n \n var capitalized = converted.replace(/a|e|i|o|u/gi, function(vowel){\n return vowel.toUpperCase();\n });\n \n return capitalized;\n \n}", "title": "" }, { "docid": "13426e0d878c7d68620a85ecb6ba2da3", "score": "0.6398679", "text": "function isAlpha(characters) {\n \n}", "title": "" } ]
33bb10fdd7ad61cbe5ed20d2e75de69f
openDatabase passed in through opts (e.g. for nodewebsql)
[ { "docid": "be7576091a5b89bba2cefe99f172ed5b", "score": "0.83753806", "text": "function openDatabaseWithOpts(opts) {\n return opts.websql(opts.name, opts.version, opts.description, opts.size);\n}", "title": "" } ]
[ { "docid": "1070e1f2492a0c060248d937a7b3b50e", "score": "0.8391577", "text": "function openDatabaseWithOpts(opts) {\n\t return opts.websql(opts.name, opts.version, opts.description, opts.size);\n\t}", "title": "" }, { "docid": "a1b31b325b196d3ec368fdfa6a8be89e", "score": "0.7413509", "text": "function openDb(options={}) {\n let location;\n\n options.location = options.location || options.path || '/tmp/temp.ldb';\n if (options.clear && options.location) {\n // log.debug('openDb : delete ' + location);\n Sh.rm('-rf', options.location);\n }\n // log.debug('openDb ' + location + ' ' + JSON.stringify(options));\n\n return new Promise( resolve => {\n // log.debug('opening with ' + JSON.stringify(options) );\n LevelUp(options.location, options, (err, db) => {\n if (err) { throw err; }\n if (options.debug) {\n log.debug('opened db adapter ' + db.db.constructor.name);\n };\n return resolve(db);\n });\n });\n}", "title": "" }, { "docid": "ced804eb9950c43a0af60d191c6d051b", "score": "0.723529", "text": "_open (opts, cb) {\n let db = this.db\n while (db.db) {\n db = db.db\n }\n if (db.status === 'new') {\n return this.db.open(opts, cb)\n } else if (typeof cb === 'function') {\n return cb()\n }\n }", "title": "" }, { "docid": "eb2e4e98b1ddaee43012c8a91cbbb596", "score": "0.69144773", "text": "function createOpenDBFunction (opts) {\n return function (name, version, description, size) {\n if (typeof sqlitePlugin !== 'undefined') {\n // The SQLite Plugin started deviating pretty heavily from the\n // standard openDatabase() function, as they started adding more features.\n // It's better to just use their \"new\" format and pass in a big ol'\n // options object. Also there are many options here that may come from\n // the PouchDB constructor, so we have to grab those.\n var sqlitePluginOpts = assign({}, opts, {\n name: name,\n version: version,\n description: description,\n size: size\n })\n return sqlitePlugin.openDatabase(sqlitePluginOpts)\n }\n\n // Traditional WebSQL API\n return openDatabase(name, version, description, size)\n }\n}", "title": "" }, { "docid": "eb2e4e98b1ddaee43012c8a91cbbb596", "score": "0.69144773", "text": "function createOpenDBFunction (opts) {\n return function (name, version, description, size) {\n if (typeof sqlitePlugin !== 'undefined') {\n // The SQLite Plugin started deviating pretty heavily from the\n // standard openDatabase() function, as they started adding more features.\n // It's better to just use their \"new\" format and pass in a big ol'\n // options object. Also there are many options here that may come from\n // the PouchDB constructor, so we have to grab those.\n var sqlitePluginOpts = assign({}, opts, {\n name: name,\n version: version,\n description: description,\n size: size\n })\n return sqlitePlugin.openDatabase(sqlitePluginOpts)\n }\n\n // Traditional WebSQL API\n return openDatabase(name, version, description, size)\n }\n}", "title": "" }, { "docid": "cbbb5d2179688fffa283bac4ccf12068", "score": "0.6649614", "text": "function db() {\n\t\tif( $window.sqlitePlugin ) {\n\t\t\treturn $window.sqlitePlugin.openDatabase({ name: dbName, location: 2 });\n\t\t} else {\n\t\t\t// Special case for development : if window.sqlitePlugin is not set\n\t\t\t// and we are on a server (http://), we use the browser's WebSQL\n\t\t\tif( $window.location.protocol == 'http:' && $window.openDatabase ) {\n\t\t\t\treturn $window.openDatabase( dbName, '1.0', dbName, 10 * 1024 * 1024 );\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "title": "" }, { "docid": "bb33a416860d5561082c42f561c9184b", "score": "0.6378693", "text": "function openDb() {\n var db = openDbVersion(DB_VERSION_MINOR);\n console.debug('Opening database version', db.version, db);\n return db;\n}", "title": "" }, { "docid": "3d8bc09e3cfe17251337b6b2bc1ec09e", "score": "0.63732684", "text": "function openDB(){\n //window.openDatabase(name, version, display_name, size);\n try {\n if (!window.openDatabase) {\n alert('Local Databases are not supported by your browser. Please use a Webkit browser for this demo');\n } else {\n dbObject = window.openDatabase(dbName, dbVersion, dbNameDisplay, dbSize);\n deviceReady = true;\n }\n } catch(e) {\n if (e == 2) {\n // Version mismatch.\n setError(\"Invalid database version in openDB()\");\n } else {\n setError(\"Unknown error \"+ e +\" in openDB()\");\n }\n return;\n }\n }", "title": "" }, { "docid": "9aa8f67018e45a94a3ef99b3e5af6576", "score": "0.628393", "text": "function databaseOpen(callback) {\n\t\t// Open a databasem specify the name and version\n\t\tvar version = 1;\n\t\tvar request = indexedDB.open('todos', version);\n\n\t\t// Run migrations if necessary\n\t\trequest.onupgradeneeded = function(e) {\n\t\t\tdb = e.target.result;\n\t\t\te.target.transaction.onerror = databaseError;\n\t\t\tdb.createObjectStore('todo', { keyPath: 'timeStamp'});\n\t\t};\n\n\t\trequest.onsuccess = function(e) {\n\t\t\tdb = e.target.result;\n\t\t\tcallback();\n\t\t};\n\t\trequest.onerror = databaseError;\n\t}", "title": "" }, { "docid": "283adcb58313b4ec2cb36a26190495b8", "score": "0.6214791", "text": "function openDB()\n\t{\n\t\tvar db = window.openDatabase(\"Database\", \"1.0\", \"Cordova Demo\", 200000);\n\t\tdb.transaction(openQuery, errorCB);\t\n\t}", "title": "" }, { "docid": "433f63f8b5bba972e1369f463dbdf538", "score": "0.61410123", "text": "function open(name)\n\t{\n\t\ttry\n\t\t{\n\t\t if (!window.openDatabase)\n\t\t {\n\t\t return null;\n\t\t }\n\t\t else\n\t\t {\n\t\t \treturn openDatabase(name, \"1\", name, 65536);\n\t\t }\n\t\t}\n\t\tcatch(e)\n\t\t{\n\t\t return null;\n\t\t}\n\t}", "title": "" }, { "docid": "f35bdff5368d2fc824a3124e54b02b7d", "score": "0.6130499", "text": "openDatabase(databaseName = 'db') {\n\n let database = this.databases[databaseName];\n\n if (!database) {\n database = SQLite.openDatabase(`${databaseName}.db`);\n this.databases[databaseName] = database;\n }\n return database;\n}", "title": "" }, { "docid": "1505b465a3d16834ab78b7bc4847edc5", "score": "0.61103946", "text": "function DBBackuper(opts) {\n this.opts = opts;\n this.db = new sqlite3.Database(this.opts.path, sqlite3.OPEN_READ);\n}", "title": "" }, { "docid": "628c0874f212506944e5e18061689060", "score": "0.61025274", "text": "function openDb() {\n var as1 = $q.defer();\n\n $rootScope.db = openDatabase('onm2016', '1.0', 'description', 1 * 1024 * 1024);\n\n as1.resolve($rootScope.db);\n\n return as1.promise;\n }", "title": "" }, { "docid": "8025377e7a4e614ab0164aa0e545b2ec", "score": "0.6026725", "text": "function initDatabase() {\n console.debug('called initDatabase()');\n\n try {\n if (!window.openDatabase) {\n alert('not supported');\n } else {\n var shortName = 'MojokertoDB';\n var version = '1.0';\n var displayName = 'DataBase Mojokerto';\n var maxSizeInBytes = 65536;\n db = openDatabase(shortName, version, displayName, maxSizeInBytes);\n createTableIfNotExists();\n }\n } catch(e) {\n if (e == 2) {\n alert('Invalid database version');\n } else {\n alert('Unknown error ' + e);\n }\n return;\n }\n}", "title": "" }, { "docid": "55cba4f3b228c7c57f926a9c29545645", "score": "0.5955242", "text": "function initDB(){\n var shortName = 'UsuarioPS';\n var version = '1.0';\n var displayName = 'UsuarioPS';\n var maxSize = 65536; // Em bytes\n localDB = window.openDatabase(shortName, version, displayName, maxSize);\n}", "title": "" }, { "docid": "0159b7b927f8aa9f632891427eae9a67", "score": "0.59271216", "text": "static openDatabase() {\n return idb.open('restaurant-review', 1, upgradeDB => {\n // create all needed object stores for application\n upgradeDB.createObjectStore('restaurants', {\n keyPath: 'id'\n });\n upgradeDB.createObjectStore('reviews', {\n keyPath: 'restaurant_id'\n });\n });\n }", "title": "" }, { "docid": "6d0bf5519564938821f571878bf11aa8", "score": "0.5918238", "text": "static openDatabase() {\n return idb.open(IndexDBHelper.DB_NAME, 5, function(upgradeDb){\n console.log('Opening database');\n switch(upgradeDb.oldVersion){\n case 0:\n upgradeDb.createObjectStore(IndexDBHelper.RESTAURANTS, { keyPath:'id'});\n case 1:\n var restStore = upgradeDb.transaction.objectStore(IndexDBHelper.RESTAURANTS);\n restStore.createIndex(IndexDBHelper.NEIGHBORHOOD_INDEX,IndexDBHelper.NEIGHBORHOOD_PROP);\n restStore.createIndex(IndexDBHelper.CUISINE_INDEX,IndexDBHelper.CUISINE_PROP);\n case 2:\n upgradeDb.createObjectStore(IndexDBHelper.REVIEWS, { keyPath:'id'});\n var restStore = upgradeDb.transaction.objectStore(IndexDBHelper.REVIEWS);\n restStore.createIndex(IndexDBHelper.REVIEWS_RESTAURANT_INDEX, IndexDBHelper.REVIEWS_RESTAURANT_INDEX_PROP);\n case 3:\n upgradeDb.createObjectStore(IndexDBHelper.FAVORITES_OUTBOX, { keyPath: 'time'});\n }\n });\n }", "title": "" }, { "docid": "c36168fd179a3e0f45fe6950c164af74", "score": "0.5911763", "text": "function openDB() {\n\tif (idbSupported)\n\t{\n\t\tvar openRequest = indexedDB.open(\"laVolta\",2);\n \n openRequest.onupgradeneeded = function(e) {\n var actualDB = e.target.result;\n \n if(!actualDB.objectStoreNames.contains(\"laVolta\"))\n {\n \tvar store = actualDB.createObjectStore(\"laVolta\", { keyPath: \"gameDate\" });\n \tstore.createIndex(\"gameName\", \"gameName\", { unique:true });\n }\n }\n \n openRequest.onsuccess = function(e) {\n voltaDB = e.target.result;\n \n voltaDB.onerror = function(event) {\n\t\t\t // Generic error handler for all errors targeted at this database's\n\t\t\t // requests!\n\t\t\t alert(\"Database error: \" + event.target.errorCode);\n\t\t\t};\n }\n \n openRequest.onerror = function(e) {\n console.dir(e);\n }\n\t}\n}", "title": "" }, { "docid": "c218cbf8a697b2aa780e887eddb087d0", "score": "0.5892627", "text": "function openDB()\n{\n db = openDatabaseSync(\"BookmarksDB\",\"1.0\",\"Bookmarks Database\",1000000);\n createTable();\n\n}", "title": "" }, { "docid": "520fdc453642c1cf9c83c2889a7e9a58", "score": "0.58890593", "text": "_openDatabase() {\n // If the browser does not support serviceWorker\n // we do not need a database\n if (!navigator.serviceWorker) {\n return Promise.Resolve();\n }\n\n // Create / open the database and create / open object store\n return idb.open(this.IDB_DATABASE_NAME, 2, upgradeDB => {\n switch (upgradeDB.oldVersion) {\n // Runs when browser has never heard of the database\n case 0:\n const restaurantsStore = upgradeDB.createObjectStore('restaurants', {\n keyPath: 'id'\n });\n\n // Runs when browser has version 1\n case 1:\n const reviewsStore = upgradeDB.createObjectStore('reviews');\n const reviewsOutboxStore = upgradeDB.createObjectStore('reviews-outbox');\n const favRestaurantOutboxStore = upgradeDB.createObjectStore('fav-rest-outbox');\n }\n\n });\n }", "title": "" }, { "docid": "61e3fa79c2b93d1a3ce67cf96687f754", "score": "0.58685637", "text": "function open(cb) {\n\tmongo_dbinstance.open(function (error, client) {\n\t\tif (error) throw error;\n\t\tif(cb) cb(null);\n\t});\n\t\n}", "title": "" }, { "docid": "32718e3bd9cd418cb185bcc12b04fbda", "score": "0.5846793", "text": "static openDatabase() {\n return idb.open(\"RestReview\", 3, function(upgradeDb) {\n let storeRestaurants = upgradeDb.createObjectStore('restaurants', {keyPath: 'id'});\n let storeReviews = upgradeDb.createObjectStore('reviews', {keyPath: 'restaurant_id'});\n let storeOfflineReviews = upgradeDb.createObjectStore('offlinereviews', {keyPath: 'restaurant_id'});\n storeRestaurants.createIndex('cuisine','cuisine_type');\n storeRestaurants.createIndex('neighborhood','neighborhood');\n });\n }", "title": "" }, { "docid": "7275a50b36ead3b25b5942f0333a2782", "score": "0.58258873", "text": "function getOpenDatabase() {\n\ttry {\n\t\tif (!!window.openDatabase) return window.openDatabase;\n\t\telse return undefined;\n\t}\n\tcatch(e) {\n\t\treturn undefined;\n\t}\n}", "title": "" }, { "docid": "195841a6c2d0166513c6dcb68d770ccb", "score": "0.5804429", "text": "static openDB() {\n return idb.open('restorevs', dbVersion, upgradeDb => {\n var store = upgradeDb.createObjectStore('restaurants', {\n keyPath: 'id'\n });\n });\n return dbPromise;\n }", "title": "" }, { "docid": "7449db48cb132eb9cc5ab35129d905f5", "score": "0.58018476", "text": "function Db(dbname, options) {\n\tif (!this)\n\t\treturn new Db(dbname, options);\n\n\tvar opt = DbOptParse(Db, options);\n\tvar handle = jsdb_openDatabase(dbname, opt);\n\n\tthis.name = dbname;\n\tthis.options = options;\n\tthis.setValue(handle);\n\n\tcatalog.db[dbname] = this;\n}", "title": "" }, { "docid": "45d879a64e778029023ec08f84aa4024", "score": "0.5790475", "text": "function openDatabase() {\n try {\n return LS.LocalStorage.openDatabaseSync(\"bodyweighttimer\",\"1.0\",\"Database for bodyweight-timer\",100000);\n } catch (err) {\n console.log(\"OpenDatabaseSync:\"+err );\n }\n}", "title": "" }, { "docid": "9c28025a9c38392404ed4e1cb0c7873c", "score": "0.57867527", "text": "function openDatabase(callback = null) {\n var request = window.indexedDB.open(DATABASE_NAME, VERSION);\n request.onerror = function(event) {\n console.log('The database is opened failed');\n };\n\n\n request.onsuccess = function(event) {\n db = request.result;\n console.log('The database is opened successfully');\n if (callback != null) {\n callback();\n }\n };\n\n request.onupgradeneeded = function(event) {\n db = event.target.result;\n var objectStore = db.createObjectStore(OBJECT_STORE_NAME, { keyPath: 'track_date' });\n objectStore.createIndex('mood', 'mood', { unique: false });\n objectStore.createIndex('sleep', 'sleep', { unique: false });\n objectStore.createIndex('energy', 'energy', { unique: false });\n objectStore.createIndex('arguments', 'arguments', { unique: false });\n objectStore.createIndex('supportiveness', 'supportiveness', { unique: false });\n objectStore.createIndex('productivity', 'productivity', { unique: false });\n objectStore.createIndex('periods', 'periods', { unique: false });\n objectStore.createIndex('comment', 'comment', { unique: false });\n objectStore.createIndex('overall', 'overall', { unique: false });\n }\n}", "title": "" }, { "docid": "5256c357ef800002b2e9204cc142e053", "score": "0.5745878", "text": "function inizializzaDatabase() {\n\tconsole.log(\"Inizializzazione database\");\n\t\n\tif (!window.openDatabase)\n \tconsole.log(\"Error: can't open local database\");\n\tif (!localStorage)\n \tconsole.log(\"Error: localstorage not usable\");\n try{\n\t\t_DB = window.openDatabase(_DB_NAME, \"1.0\", _DB_NAME, _DB_SIZE);\n\t}catch(exc){\n\t\tconsole.log('Errore DB '+exc.message);\n\t}\n\tconsole.log(\"Inizializzazione database OK\");\n}", "title": "" }, { "docid": "dc67bdab7fb8ddb56500b5d81a8bc1f9", "score": "0.5729908", "text": "function openDataBase(){\n\t//alert(\"Abriendo base de datos..\");\n\tdb = window.openDatabase(Constants.database.database_name, Constants.database.database_version, Constants.database.database_display, Constants.database.database_size);\n\t//alert(\"Base de datos abierta, retornando objeto db...\");\n\treturn db;\n}", "title": "" }, { "docid": "7249d5282074bfc8dffc6d4da89dbc1b", "score": "0.5689044", "text": "function openDB(){\n\t\tconsole.log(\"[INFO] opening DB ...\");\n\t\t var req = indexedDB.open(DBNAME, DBVERSION);\n\t\t req.onsuccess = function (evt) {\n\t\t // Equal to: db = req.result;\n\t\t db = this.result;\n\t\t console.log(\"[INFO] opening DB DONE\");\n\t\t };\n\t\t req.onerror = function (evt) {\n\t\t console.error(\"openDb:\", evt.target.errorCode);\n\t\t };\n\n\t\t req.onupgradeneeded = function (evt) {\n\t\t \tdb = this.result;\n\t\t console.log(\"[INFO] opening DB onupgradeneeded\");\n\t\t // cryptostore\n\t\t var store = evt.currentTarget.result.createObjectStore(\n\t\t CRYPTOSTORE, { keyPath: 'id', autoIncrement: true });\n\t\t store.createIndex('id', 'id', { unique: true });\n\t\t \n\t\t // settingstore\n\t\t var settstore = evt.currentTarget.result.createObjectStore(\n\t\t \tSETTINGSTORE, {keyPath: 'id', autoIncrement: true });\n\t\t settstore.createIndex('id', 'id', {unique: true });\n\t\t settstore.createIndex('symbol', 'symbol', { unique: true });\n\t\t settstore.createIndex('enabled', 'enabled', { unique: true });\n\t\t // create default entries\n\t\t settstore.transaction.oncomplete = function(e){\n\t\t \tlet objs = db.transaction(SETTINGSTORE, 'readwrite').objectStore(SETTINGSTORE);\n\t\t \tobjs.add({ symbol: 'MIOTA', enabled: true });\n\t\t \tconsole.log(\"[INFO] added default settings into db.\");\n\t\t };\n\t\t };\n\t}", "title": "" }, { "docid": "2300a07e1f4d52b5f85007b932c09efb", "score": "0.5681737", "text": "openDB() {\n const db = new sqlite3.Database(this.dbLocation, (err) => {\n if (err) {\n return console.error(err.message);\n }\n console.log('Connected to SQlite database.');\n });\n return db;\n }", "title": "" }, { "docid": "b50c097d7b5c1935dc8a5d95499cc305", "score": "0.5646357", "text": "function openDB() {\n return new Promise(function(resolve, reject) {\n var request = indexedDB.open(dbName);\n request.onerror = function(event) {\n reject(event);\n };\n request.onupgradeneeded = function(event) {\n if (!event.target.result.oldversion) {\n console.log('indexedDB init');\n var db = event.target.result;\n db.createObjectStore(dbCollection, { autoIncrement : true });\n }\n };\n request.onsuccess = function(event) {\n resolve(event.target.result);\n };\n });\n}", "title": "" }, { "docid": "ff5b95d38c4679b0826cd249093e5b98", "score": "0.5607093", "text": "function inizializzaDatabase() {\n\tconsole.log(\"Inizializzazione database\");\n\n\tif (!window.openDatabase)\n\t\tconsole.log(\"Error: can't open local database\");\n\tif (!localStorage)\n\t\tconsole.log(\"Error: localstorage not usable\");\n\ttry {\n\t\tif (!_DB) {\n\t\t\tconsole.log(\"opendatabase \" + _DB_NAME + \",\" + \"1.0\" + \",\"\n\t\t\t\t\t+ _DB_NAME + \",\" + _DB_SIZE);\n\t\t\t_DB = window.openDatabase(_DB_NAME, \"1.0\", _DB_NAME, _DB_SIZE);\n\t\t}\n\t} catch (exc) {\n\t\tconsole.log('Errore database ' + exc.message);\n\t\tsetTimeout(function() {\n\t\t\ttry {\n\t\t\t\tif (window.openDatabase) {\n\t\t\t\t\t_DB = null;\n\t\t\t\t\t_DB = window.openDatabase(_DB_NAME, \"1.0\", _DB_NAME,\n\t\t\t\t\t\t\t_DB_SIZE);// window.simulateDB.openDatabase(_DB_NAME,\n\t\t\t\t\t\t\t\t\t\t// \"1.0\", _DB_NAME, _DB_SIZE);\n\t\t\t\t\t// window.location.assign('index.html');\n\t\t\t\t} else {\n\t\t\t\t\t_DBFAIL = true;\n\n\t\t\t\t\tif (!window.infodroid.isfoglioopen()) {\n\t\t\t\t\t\twindow.simulatePG.relaod();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (exc) {\n\t\t\t\tconsole.log('Errore simDB database ' + exc.message);\n\t\t\t\t_DBFAIL = true;\n\t\t\t\tif (!window.infodroid.isfoglioopen()) {\n\t\t\t\t\twindow.simulatePG.relaod();\n\t\t\t\t}\n\t\t\t}\n\t\t}, 500);\n\t}\n\tconsole.log(\"Inizializzazione database OK\");\n}", "title": "" }, { "docid": "889219fba2311339ff4d9ab39e3bea0b", "score": "0.56043714", "text": "function openDatabase() {\r\n var db = google.gears.factory.create('beta.database');\r\n db.open('itemSet');\r\n dbprod = db;\r\n}", "title": "" }, { "docid": "18d9017c6b0ae8a174b5788fcc8f9ac2", "score": "0.55887204", "text": "async openDatabase() {\n return new Promise((resolve, reject) => {\n\n // Check if browser supports indexed databases\n if (!window.indexedDB) {\n reject(\"Your browser doesn't support a stable version of IndexedDB.\");\n return;\n }\n\n const request = window.indexedDB.open(databaseName, databaseVersion);\n\n // Upgrade database if required\n request.onupgradeneeded = function (event) {\n const db = event.target.result;\n for (const storeName in databaseStores) {\n if (!db.objectStoreNames.contains(storeName)) {\n // Store not found, create new store\n db.createObjectStore(storeName, { autoIncrement: true });\n }\n }\n };\n\n // Error opening database\n request.onerror = function () {\n reject(Error(request.error));\n };\n\n // Database opened successfully (and upgrades applied as required)\n request.onsuccess = function (event) {\n // Resolve and return the database object\n resolve(event.target.result);\n };\n });\n }", "title": "" }, { "docid": "00310844613b072fcf2e0c2058f6362b", "score": "0.5586586", "text": "function inizializzaDatabase() {\n\tconsole.log(\"Inizializzazione database\");\n\t\n\tif (!window.openDatabase)\n \tconsole.log(\"Error: can't open local database\");\n\tif (!localStorage)\n \tconsole.log(\"Error: localstorage not usable\");\n try{\n \tif(!_DB){\n \t\tconsole.log(\"opendatabase \"+_DB_NAME +\",\" + \"1.0\"+ \",\"+_DB_NAME+\",\"+ _DB_SIZE);\n\t\t\t_DB = window.openDatabase(_DB_NAME, \"1.0\", _DB_NAME, _DB_SIZE);\n\t\t}\n\t}catch(exc){\n\t\tconsole.log('Errore database '+exc.message);\n\t\t\tsetTimeout(function(){\n\t\t\t\ttry{\n\t\t\t\t\tif (window.openDatabase){\n\t\t\t\t\t\t_DB = null;\n\t\t\t\t\t\t_DB = window.openDatabase(_DB_NAME, \"1.0\", _DB_NAME, _DB_SIZE);//window.simulateDB.openDatabase(_DB_NAME, \"1.0\", _DB_NAME, _DB_SIZE);\n\t\t\t\t\t\t//window.location.assign('index.html');\n\t\t\t\t\t}else{\n\t\t\t\t\t\t_DBFAIL = true;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(!window.infodroid.isfoglioopen()){\n\t\t\t\t\t\t\t window.simulatePG.relaod();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}catch(exc){\n\t\t\t\t\tconsole.log('Errore simDB database ' + exc.message);\n\t\t\t\t\t_DBFAIL = true;\n\t\t\t\t\tif(!window.infodroid.isfoglioopen()){\n\t\t\t\t\t\t window.simulatePG.relaod();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},500);\n\t}\n\tconsole.log(\"Inizializzazione database OK\");\n}", "title": "" }, { "docid": "00310844613b072fcf2e0c2058f6362b", "score": "0.5586586", "text": "function inizializzaDatabase() {\n\tconsole.log(\"Inizializzazione database\");\n\t\n\tif (!window.openDatabase)\n \tconsole.log(\"Error: can't open local database\");\n\tif (!localStorage)\n \tconsole.log(\"Error: localstorage not usable\");\n try{\n \tif(!_DB){\n \t\tconsole.log(\"opendatabase \"+_DB_NAME +\",\" + \"1.0\"+ \",\"+_DB_NAME+\",\"+ _DB_SIZE);\n\t\t\t_DB = window.openDatabase(_DB_NAME, \"1.0\", _DB_NAME, _DB_SIZE);\n\t\t}\n\t}catch(exc){\n\t\tconsole.log('Errore database '+exc.message);\n\t\t\tsetTimeout(function(){\n\t\t\t\ttry{\n\t\t\t\t\tif (window.openDatabase){\n\t\t\t\t\t\t_DB = null;\n\t\t\t\t\t\t_DB = window.openDatabase(_DB_NAME, \"1.0\", _DB_NAME, _DB_SIZE);//window.simulateDB.openDatabase(_DB_NAME, \"1.0\", _DB_NAME, _DB_SIZE);\n\t\t\t\t\t\t//window.location.assign('index.html');\n\t\t\t\t\t}else{\n\t\t\t\t\t\t_DBFAIL = true;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(!window.infodroid.isfoglioopen()){\n\t\t\t\t\t\t\t window.simulatePG.relaod();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}catch(exc){\n\t\t\t\t\tconsole.log('Errore simDB database ' + exc.message);\n\t\t\t\t\t_DBFAIL = true;\n\t\t\t\t\tif(!window.infodroid.isfoglioopen()){\n\t\t\t\t\t\t window.simulatePG.relaod();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},500);\n\t}\n\tconsole.log(\"Inizializzazione database OK\");\n}", "title": "" }, { "docid": "0b6b31004ae9fc2fa6da0853c1e52620", "score": "0.5580267", "text": "function inizializzaDatabase() {\n\tconsole.log(\"Inizializzazione database\");\n\n\tif (!window.openDatabase)\n\t\tconsole.log(\"Error: can't open local database\");\n\tif (!localStorage)\n\t\tconsole.log(\"Error: localstorage not usable\");\n\ttry {\n\t\tif (!_DB) {\n\t\t\tconsole.log(\"opendatabase \" + _DB_NAME + \",\" + \"1.0\" + \",\" + _DB_NAME + \",\" + _DB_SIZE);\n\t\t\t_DB = window.openDatabase(_DB_NAME, \"1.0\", _DB_NAME, _DB_SIZE);\n\t\t}\n\t} catch (exc) {\n\t\tconsole.log('Errore database ' + exc.message);\n\t\tsetTimeout(function() {\n\t\t\ttry {\n\t\t\t\tif (window.openDatabase) {\n\t\t\t\t\t_DB = null;\n\t\t\t\t\t_DB = window.openDatabase(_DB_NAME, \"1.0\", _DB_NAME, _DB_SIZE);\n\t\t\t\t\t// window.simulateDB.openDatabase(_DB_NAME,\n\t\t\t\t\t// \"1.0\", _DB_NAME, _DB_SIZE);\n\t\t\t\t\t// window.location.assign('index.html');\n\t\t\t\t} else {\n\t\t\t\t\t_DBFAIL = true;\n\n\t\t\t\t\tif (!window.infodroid.isfoglioopen()) {\n\t\t\t\t\t\twindow.simulatePG.relaod();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (exc) {\n\t\t\t\tconsole.log('Errore simDB database ' + exc.message);\n\t\t\t\t_DBFAIL = true;\n\t\t\t\tif (!window.infodroid.isfoglioopen()) {\n\t\t\t\t\twindow.simulatePG.relaod();\n\t\t\t\t}\n\t\t\t}\n\t\t}, 500);\n\t}\n\tconsole.log(\"Inizializzazione database OK\");\n}", "title": "" }, { "docid": "adf0ddf16dfaf3901fe2b15f7fb1c664", "score": "0.55551696", "text": "function OpenDatabase_PHONEGAP() {\n\t//use the existing db if already initialized\n\tif (_DbPhoneGap != undefined)\n\t{\n\t\treturn _DbPhoneGap;\n\t}\t\t\n\t\n\tif (!window.openDatabase) {\n\t\t// not all mobile devices support databases if it does not, the\n\t\t//following alert will display\n\t // indicating the device will not be albe to run this application\n\t ShowMessage(_ApplicationName, 'Databases are not supported on this device. Contact your system administrator');\n\t return null;\n\t }\n\n\t// this line tries to open the database base locally on the device\n\t// if it does not exist, it will create it and return a database\n\t//object stored in variable db\n\tvar version = '1.0';\n\tvar maxSize = 65535;\n\t_DbPhoneGap = window.openDatabase(_DBName, version, _DBName, maxSize); //shortName, version, displayName,maxSize\n\treturn _DbPhoneGap;\n}", "title": "" }, { "docid": "29bc194cd05f49f55594faa34cd56173", "score": "0.55520785", "text": "function DataAccessPlugin(dbOptions, openSuccess, openError) {\n \n this.dbPath = dbOptions[0];\n this.openSuccess = openSuccess;\n this.openError = openError;\n \n if (!dbOptions[0]) {\n throw new Error(\"Cannot create a DataAccessPlugin instance without a dbPath\");\n }\n \n this.openSuccess || (this.openSuccess = function() {\n console.log(\"DB opened: \" + dbPath);\n });\n \n this.openError || (this.openError = function(e) {\n console.log(e.message);\n throw new Error(e.message);\n\n });\n \n this.open(dbOptions, this.openSuccess, this.openError);\n }", "title": "" }, { "docid": "7d53fc46ca731bac97c6d38eb632779f", "score": "0.5543498", "text": "async function open() {\n SQLite.DEBUG(true);\n SQLite.enablePromise(true);\n\n if (databaseInstance) {\n console.log('[db] Database is already open: returning the existing instance');\n return databaseInstance;\n }\n\n // Otherwise, create a new instance\n const db = await SQLite.openDatabase({\n name: 'RestaurantDB',\n location: 'default',\n });\n console.log('[db] Database open!');\n\n // Perform any database initialization or updates, if needed\n const databaseInitialization = new DBInitialization();\n await databaseInitialization.updateDatabaseTables(db);\n\n databaseInstance = db;\n return db;\n}", "title": "" }, { "docid": "b262ae4c0d4147e88583a5cb18ff9c59", "score": "0.551027", "text": "static initializeDatabase(){\r\n const dbPromise = idb.open('restaurant-reviews', 2, upgradeDb=>{\r\n switch(upgradeDb.oldVersion){\r\n case 0:\r\n upgradeDb.createObjectStore('restaurantsById', {keyPath: 'id'});\r\n case 1:\r\n upgradeDb.createObjectStore('reviews', {keyPath: 'name'});\r\n } \r\n });\r\n\r\n return dbPromise;\r\n }", "title": "" }, { "docid": "9006145115cec1e2f7c967798628b05f", "score": "0.5506606", "text": "function openDb() {\n var openRequest = indexedDB.open(dbName, 1);\n \n openRequest.onerror = function(e) {\n msg = \"openDb \" + dbName + \" error. (\" + e.currentTarget.error.message + \")\"; \n console.log(msg);\n $(\"#msg_area\").html(\"\").append(msg);\n }\n \n openRequest.onsuccess = function(evt) {\n db = openRequest.result;\n showAllData();\n \n msg = \"openDb \" + dbName + \" success. (\" + evt.currentTarget.readyState + \")\"; \n console.log(msg);\n $(\"#msg_area\").html(\"\").append(msg);\n }\n \n openRequest.onupgradeneeded = function(evt) {\n var pageStore = openRequest.result.createObjectStore(tblName, {keyPath:\"id\"});\n pageStore.createIndex(\"group_no_index\", \"group_no\", { unique: false });\n pageStore.createIndex(\"show_no_index\", \"show_no\", { unique: false });\n pageStore.createIndex(\"create_tm_index\", \"create_tm\", { unique: true });\n \n msg = \"openDb \" + dbName + \" upgrade success. (\" + evt.currentTarget.readyState + \")\"; \n console.log(msg);\n $(\"#msg_area\").html(\"\").append(msg);\n }\n}", "title": "" }, { "docid": "5bf3a5d96fa8651f954e607f7cda29e4", "score": "0.54753953", "text": "async function useDatabase(dbName) {\n return new Promise(function(resolve, reject){\n connection.end();\n options.db.database = dbName;\n connection = sqlite.createConnection(options.db);\n connection.connect(function(err) {\n if(err) { reject(err); return; }\n resolve(true);\n });\n });\n }", "title": "" }, { "docid": "76860d84ad2b6d8dbd89383e837c4e61", "score": "0.54061484", "text": "async function database(req, res, next) {\n if (!client.isConnected()) await client.connect();\n req.dbClient = client;\n req.db = client.db('UAP');\n return next();\n}", "title": "" }, { "docid": "de8163e9543fcfc38fce592e0ef99563", "score": "0.54019606", "text": "static openIDB() {\n // Does the browser support service worker?\n if (!navigator.serviceWorker) {\n return Promise.resolve();\n }\n // make sure IndexdDB is supported\n if (!self.indexedDB) {\n reject(\"Uh oh, IndexedDB is NOT supported in this browser!\");\n }\n return idb.open(dbNAME, dbVERSION, function(upgradeDb) {\n switch (dbVERSION) {\n case 0:\n case 1: { // stage 2\n var restStore = upgradeDb.createObjectStore(dbRestaurantOBJECTSTORE, { keyPath: 'id' });\n restStore.createIndex('restID', 'id');\n }\n case 2: { // stage 3\n var reviewStore = upgradeDb.createObjectStore(dbReviewsOBJECTSTORE, { keyPath: 'id' });\n reviewStore.createIndex('reviewID', 'id');\n reviewStore.createIndex('restID', 'restaurant_id');\n }\n } // switch\n });\n }", "title": "" }, { "docid": "968321aeb4c6c8252b883ac2d4fda242", "score": "0.53808886", "text": "open(){\n console.log('SQLite->open] File: ' + this.getConfig('path') );\n\n // Resolve if already open\n if( this.c() ){ return Promise.resolve(this); }\n\n let self = this;\n return sqlite.open(this.getConfig('path'), { cached: true })\n .then(this.setConnection.bind(this))\n // ENABLE FOR TROUBLESHOOTING\n //.then(db => {\n // db.driver.on( 'trace', function( a ){ console.log( 'trace', a ); } );\n // return db;\n //})\n .then(db => { return db.migrate(); })\n .then(() => { return self; });\n }", "title": "" }, { "docid": "8c556db06adf009564f9b90e17c409d2", "score": "0.536745", "text": "createDB(name, version, stores = [{name: 'main', options: {keyPath: 'id'}}]) {\n\n return new Promise((resolve, reject)=> {\n\n isIDBSupported().then(()=> {\n\n let request = window.IDB.open(name, version || 1);\n\n request.onerror = (event) => {\n\n reject(event.target.error);\n\n };\n\n request.onsuccess = (event) => {\n\n resolve(event.target.result);\n\n };\n\n request.onupgradeneeded = (event) => {\n\n let db = event.target.result;\n stores.forEach((store) => {\n\n db.createObjectStore(store.name, store.options);\n\n });\n\n }\n\n\n }).catch((error)=>{\n\n reject(error);\n\n });\n\n });\n\n }", "title": "" }, { "docid": "50c7eaa0555c31f12982ee1573471814", "score": "0.53638804", "text": "function DB(leveldb) {\n this._leveldb = leveldb || level();\n }", "title": "" }, { "docid": "6e118271e400cd5521b75ce8a809b486", "score": "0.53478485", "text": "function openDbVersion(version) {\n var v = DB_VERSION_MAJOR + \".\" + version;\n if (version < 0) {\n console.error('Databse version error! Now let\\'s panic!');\n return;\n }\n try {\n return openDatabase(\"TabSugar\", v, \"Tab Sugar\", this.DB_SIZE * 1024 * 1024);\n } catch (ex) {\n return openDbVersion(version - 1);\n }\n}", "title": "" }, { "docid": "19f75b9963c3053d46d0eb2b56feff53", "score": "0.534277", "text": "function getDatabase() {\n return openDatabaseSync(\"Landed\", \"15.0\", \"StorageDatabase\", 100000);\n}", "title": "" }, { "docid": "41ff6cc013190ed3100569b4c0867d88", "score": "0.5323064", "text": "function openDbConnection(onSuccess, onError) {\n\n logger.info('Connecting to database: ' + dbName);\n //si connette al db e lo apre se non esiste\n db = new sqlite3.Database(dbName, sqlite3.OPEN_READWRITE | sqlite3.OPEN_CREATE, (err) => {\n if (err) {\n if (onError) {\n onError(err);\n }\n return logger.error(err.message);\n }\n\n logger.info('Database conntected!');\n if (onSuccess) {\n onSuccess(db);\n }\n });\n\n exports.db = db;\n}", "title": "" }, { "docid": "bf020b290f9a392fbde033601d0cf008", "score": "0.53137296", "text": "function db_init() {\n let db = new sqlite3.Database(appSettings.db_file_name, (err) => {\n if (err) {\n logger.error(`Error occurred while opening database file: ${appSettings.db_file_name}: ${err.message}`, 'init()');\n } else {\n logger.info(`Database ${appSettings.db_file_name} is open for business!`);\n // Make sure to close this database connection when Node exits\n process.on('exit', (code) => {\n logger.info(`CLOSING Database ${appSettings.db_file_name}, exit code: ${code}`);\n db.close((err) => {\n logger.error(`Error closing DB with message: ${err.message}: and code ${code}`);\n });\n });\n }\n });\n return db;\n}", "title": "" }, { "docid": "8caa646c7ecbb183aff254472c0bd3a7", "score": "0.5311856", "text": "function prepareDatabase() {\n\tvar odb = getOpenDatabase();\n\tif (!odb) {\n\t\tdispError('Web SQL Not Supported');\n\t\treturn undefined;\n\t}\n\telse {\n\t\tvar db = odb('testDatabase', '1.0', 'A Test Database', 10*1024*1024);\n\t\tdb.transaction(function(t){\n\t\t\tt.executeSql(createSQL,[], function(t,r){}, function(t,e){\n\t\t\t\talert('create table: ' + e.message);\n\t\t\t});\t\n\t\t});\n\t\treturn db;\n\t}\n}", "title": "" }, { "docid": "f2651ace15938644f5358f24d77eb6e6", "score": "0.5310222", "text": "initDB ( _filename, _handler ) {\n this.database = require('then-levelup')( require('level')(_filename, _handler) );\n }", "title": "" }, { "docid": "c7444f9e289d47c4992c8d21c7c0f452", "score": "0.5307851", "text": "async open(...args) {\n if (this.adapter.isOpen()) {\n throw new IndexedDBError(\n errorCreator(StorageController.errorMessages.STORAGE_ALREADY_OPEN)({ adapter: this.adapter }),\n );\n }\n const objectStores = this.adapter.objectStoreNames;\n if (!objectStores || !isArray(objectStores) || objectStores.length === 0) {\n throw new IndexedDBError(StorageController.errorMessages.NO_OBJECTSTORES_DEFINED);\n }\n\n try {\n await this.adapter.open(...args);\n } catch (error) {\n await this._openFallbackAdapter(...args);\n }\n }", "title": "" }, { "docid": "bce38cbd19ccfa89daff5d91979eea84", "score": "0.5259932", "text": "getDatabaseInstance(databaseName) {\n let databasePath = path.join(__dirname, '../DB/', databaseName); // Generating the path to the database in the project directory\n console.log('Database File Path: ', databasePath);\n return new sqlite3.Database(databasePath, function (err) { // Getting the DB instance by passing the Database file path \n if (err) console.log('Error Connecting to Database: ' + err);\n else console.log('Database connection successful!');\n });\n }", "title": "" }, { "docid": "2f4c7493e4e2aae88f487045a3609099", "score": "0.5256563", "text": "function createSysDB(__openDatabase, success, failure) {\n function sysDbCreateError(tx, err) {\n err = (0, _DOMException.webSQLErrback)(err || tx);\n _CFG2.default.DEBUG && console.log('Error in sysdb transaction - when creating dbVersions', err);\n failure(err);\n }\n\n if (sysdb) {\n success();\n } else {\n sysdb = __openDatabase(typeof _CFG2.default.memoryDatabase === 'string' ? _CFG2.default.memoryDatabase : _path2.default.join(typeof _CFG2.default.sysDatabaseBasePath === 'string' ? _CFG2.default.sysDatabaseBasePath : _CFG2.default.databaseBasePath || '', '__sysdb__' + (_CFG2.default.addSQLiteExtension !== false ? '.sqlite' : '')), 1, 'System Database', _CFG2.default.DEFAULT_DB_SIZE);\n sysdb.transaction(function (systx) {\n systx.executeSql('CREATE TABLE IF NOT EXISTS dbVersions (name BLOB, version INT);', [], function (systx) {\n if (!_CFG2.default.useSQLiteIndexes) {\n success();\n return;\n }\n systx.executeSql('CREATE INDEX IF NOT EXISTS dbvname ON dbVersions(name)', [], success, sysDbCreateError);\n }, sysDbCreateError);\n }, sysDbCreateError);\n }\n}", "title": "" }, { "docid": "8c76cd810b117df73dd58d7e6706569c", "score": "0.5252375", "text": "function initDatabase()\r\n\t{ \r\n\t\ttry {\r\n\t\t\tif (!window.openDatabase) // Check browser is supported SQLite or not.\r\n\t\t\t{\r\n\t\t\t\talert('Databases are not supported in this browser.');\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tcreateTable(); // If supported then call Function for create table in SQLite\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (e) {\r\n\t\t\tif (e == 2) {\r\n\t\t\t\t// Version number mismatch. \r\n\t\t\t\tconsole.log(\"Invalid database version.\");\r\n\t\t\t} else {\r\n\t\t\t\tconsole.log(\"Unknown error \" + e + \".\");\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "af2c51d8cddd84e18641c31641d6e799", "score": "0.52375406", "text": "function sqliteDB(file) \n {\n\n \tconsole.log(\"Opening Database:\"+file);\n \tvar exists = fs.existsSync(file);\n\n \tif( !exists )\n \t{\n \t\tconsole.log(\"File not found. Creating new Database file: \" + file );\n \t\tfs.openSync(file, \"w\");\n \t}\n\n \tticketConn = new sqlite3.Database(file,function() {\n \t\tticketConn.run('PRAGMA foreign_keys=on');\n \t});\n\n \tif( !exists )\n \t{\n\t\t// Serialize forces the order of the operations, nothing is parallel\n\t\tticketConn.serialize(function(){\n\n\t\t\tticketConn\n\t\t\t.run(\"BEGIN;\")\n\n\t\t\t// Create tables\n\t\t\t.run(\"CREATE TABLE clients (clientId INTEGER PRIMARY KEY, name TEXT NOT NULL, password TEXT NOT NULL, email TEXT NOT NULL, phone TEXT NOT NULL, address TEXT NOT NULL, UNIQUE(name));\")\n\t\t\t.run(\"CREATE TABLE devices (deviceId INTEGER PRIMARY KEY, identifier TEXT NOT NULL, UNIQUE(identifier));\")\n\t\t\t.run(\"CREATE TABLE products (productId INTEGER PRIMARY KEY, name TEXT NOT NULL, description TEXT NOT NULL);\")\n\t\t\t.run(\"CREATE TABLE clients_products (buyId INTEGER PRIMARY KEY, client REFERENCES clients(clientId), product REFERENCES products(productId), date TEXT NOT NULL, confirmationCode TEXT, cancelationCode TEXT);\")\n\t\t\t.run(\"CREATE TABLE clients_devices (linkId INTEGER PRIMARY KEY, name TEXT, key TEXT, validationKey TEXT, validationTime TEXT, client REFERENCES clients(clientId), device REFERENCES devices(deviceId));\")\n\n\t\t\t// Insert first data\n\t\t\t//passwords are saved as plaintext. This is not the focus here. We needed to encrypt client side before sending\n\t\t\t.run(\"INSERT INTO clients (name, password, email, phone, address) VALUES ('ADMIN', 'ADMIN', 'email@email.com', '00351966233545', 'Portugal');\")\n\t\t\t.run(\"INSERT INTO products (name,description) VALUES ('Justin Bieber CD', 'Melhor CD do Mundo'), ('Miley Cyrus', 'Best Hits. Wrecking Ball Included');\")\n\t\t\t.run(\"COMMIT;\");\n\t\t});\n\t}\n}", "title": "" }, { "docid": "a676ffa1091a4288c68ce1360bb98b93", "score": "0.5237051", "text": "function createSysDB(__openDatabase, success, failure) {\n function sysDbCreateError(tx, err) {\n err = (0, _DOMException.webSQLErrback)(err);\n _CFG2.default.DEBUG && console.log('Error in sysdb transaction - when creating dbVersions', err);\n failure(err);\n }\n\n if (sysdb) {\n success();\n } else {\n sysdb = __openDatabase(typeof _CFG2.default.memoryDatabase === 'string' ? _CFG2.default.memoryDatabase : _path2.default.join(typeof _CFG2.default.sysDatabaseBasePath === 'string' ? _CFG2.default.sysDatabaseBasePath : _CFG2.default.databaseBasePath || '', '__sysdb__' + (_CFG2.default.addSQLiteExtension !== false ? '.sqlite' : '')), 1, 'System Database', _CFG2.default.DEFAULT_DB_SIZE);\n sysdb.transaction(function (systx) {\n systx.executeSql('CREATE TABLE IF NOT EXISTS dbVersions (name BLOB, version INT);', [], success, sysDbCreateError);\n }, sysDbCreateError);\n }\n}", "title": "" }, { "docid": "7e4823c5387ad55a2e117fb0cbdff539", "score": "0.52314603", "text": "function connection(idb) {\n var dbPromise = idb.open(\"football-faeshal\", 1, function(upgradeDb) {\n if (!upgradeDb.objectStoreNames.contains(\"savedMatch\")) {\n var targetBundle = upgradeDb.createObjectStore(\"savedMatch\", {\n keyPath: \"id\"\n });\n targetBundle.createIndex(\"TeamHome\", \"match.homeTeam.name\", {\n unique: false\n });\n targetBundle.createIndex(\"TeamAway\", \"match.awayTeam.name\", {\n unique: false\n });\n }\n });\n\n return dbPromise;\n}", "title": "" }, { "docid": "291f320cb174521f42e3f618168f0d8d", "score": "0.52019095", "text": "function openFromDb(trafficPrediction) {\n var base = new qm.Base({\n mode: 'open',\n dbPath: trafficPrediction.pathDb\n })\n base[\"mode\"] = 'open'\n \n //Initiate the traffic prediction workflow\n trafficPrediction.init(base);\n \n // load saved models\n trafficPrediction.loadState();\n}", "title": "" }, { "docid": "fa2221d0e8d167cedc15f5f032a1075b", "score": "0.5200247", "text": "function openDB() {\n return new Promise((resolve, reject) => {\n //pomisifies the database creation and writeFile function\n const writeFile = util.promisify(fs.writeFile),\n Database = (dbPath, sqlType) => {\n return new Promise((res, rej) => {\n //creates the database\n let initializedDB = new sqlite.Database(dbPath, sqlType, (err) => {\n //if errored then rejects promise\n if(err) {\n console.log(\"failed to intialize databse connection\");\n rej(err);\n }\n //if succeeds returns database\n res(initializedDB);\n });\n });\n }\n\n //attempts to write a file if does not exist\n writeFile(dbPath, \"\", { flag : 'wx' })\n //logs the error, it should just generally be \"file exists\"\n .catch(response => {\n console.log(response);\n })\n //once file is confirmed created proceeds\n .then (response => {\n console.log(\"file is there\");\n //opens a connection to the data base as read write\n db = Database(dbPath, sqlite.OPEN_READWRITE)\n //if connection fails logs and throws error\n .catch(err => {\n console.log(err);\n throw err;\n })\n //once connection succeeds runs queries to ensure tables exist properly\n .then(result => {\n //sets up an async function for all queries\n const query = (queryString, values) => {\n return new Promise((res, rej) => {\n result.all(queryString, values, (err, queres) => {\n //if query fails and rejects the promise\n if(err) {\n console.log(err);\n rej(err);\n }\n //if query succeeds resolves to the query response\n res(queres);\n })\n })\n }\n //creates the notes table if its not there\n query(\"create table if not exists notes(id INTEGER PRIMARY KEY AUTOINCREMENT, note_id TEXT, note TEXT, date TEXT);\", [])\n .catch(err => {\n console.log(err);\n })\n .then(res => {\n console.log(\"notes table exists\");\n });\n //creates the trackers table if its not there\n query(\"create table if not exists trackers(id INTEGER PRIMARY KEY, dataWipe TEXT, detractor TEXT, nps TEXT);\", [])\n .catch(err => {\n console.log(err);\n })\n .then(res => {\n console.log(\"trackers table exists\");\n //once we know trackers exists ensures the lines are there\n query(\"select * from trackers where id = 1;\", [])\n //if something goes wrong logs and throws error\n .catch(err => {\n console.log(err);\n throw err;\n })\n //if the line does not exists initializes default values\n .then (res => {\n if(res.length === 0) {\n query(\"insert into trackers(id, dataWipe, detractor, nps) values (1, '2100-01-01', '2100-01-01', '2100-01-01')\", [])\n //logs and throws if error\n .catch(err => {\n console.log(err);\n throw err;\n })\n //notes success if succeds\n .then(res => {\n console.log(\"made missing tracker row\");\n });\n }\n console.log(\"tracker table good\");\n });\n //once tables exist resolves the database to the original caller\n resolve(result);\n });\n\n });\n\n });\n\n });\n\n}", "title": "" }, { "docid": "3fad640981d1835893d03e34a6f96ade", "score": "0.51937014", "text": "function initDatabase() {\n dbPromise = idb.openDb(SOCIAL_MEDIA_DB_NAME, 1, function (upgradeDb) {\n if (!upgradeDb.objectStoreNames.contains(STORIES_STORE_NAME)) {\n var storiesOS = upgradeDb.createObjectStore(STORIES_STORE_NAME, {keyPath: 'story_id'});\n storiesOS.createIndex('story_id', 'story_id', {unique: true, multiEntry: false});\n storiesOS.createIndex('username', 'username', {unique: false, multiEntry: false});\n storiesOS.createIndex('story_date', 'story_date', {unique: false, multiEntry: false});\n storiesOS.createIndex('story_text', 'story_text', {unique: false, multiEntry: false});\n storiesOS.createIndex('input_image', 'input_image', {unique: false, multiEntry: false});\n\n // add the other field later e.g pictures\n }\n if (!upgradeDb.objectStoreNames.contains(RATINGS_STORE_NAME)) {\n var ratingsOS = upgradeDb.createObjectStore(RATINGS_STORE_NAME, {keyPath: 'rating_id'});\n ratingsOS.createIndex('rating_id', 'rating_id', {unique: true, multiEntry: false});\n ratingsOS.createIndex('story_id', 'story_id', {unique: false, multiEntry: false});\n ratingsOS.createIndex('username', 'username', {unique: false, multiEntry: false});\n ratingsOS.createIndex('vote', 'vote', {unique: false, multiEntry: false});\n ratingsOS.createIndex('rating_date', 'rating_date', {unique: false, multiEntry: false});\n }\n });\n}", "title": "" }, { "docid": "ff64b0a499f70c8a0876bcc7ed06e000", "score": "0.51572067", "text": "function openDB(){\n if (!collection){\n mc.connect(\"mongodb://localhost:27017/gps_debug\", function(err, db) {\n if(err) { console.dir(err); }\n var cDate = new Date();\n var cName = 'data_' + cDate.getFullYear() + \"\" + pad((cDate.getMonth()+1),2) + \"\" + pad(cDate.getDate(),2) + \"_\" + pad((cDate.getHours()),2) + \"\" + pad(cDate.getMinutes(),2);\n console.log (\"using collection \" + cName + \" for storage of gps data with min distance of \" + minTimeDist + \" seconds\");\n collection = db.collection(cName);\n clearInterval(dbTimer);\n });\n }\n}", "title": "" }, { "docid": "752e988044bb75bec78bf60e0cfd0b5b", "score": "0.5149823", "text": "closeDatabase() {\n this.database.close(function (err) {\n if (err) console.log('Error closing Database: ' + err);\n else console.log('Database closed successfully!');\n });\n }", "title": "" }, { "docid": "7c055ab1f296be367286d8890f1a546f", "score": "0.51479775", "text": "startDB () {\n return new Promise( (resolve, reject) => {\n if ( this.config.database ) {\n this.initDB( this.config.database.filename, (err,db) => {\n if (err) return reject(err);\n else return PROM.log('core', 'Successfully created a database')\n .then( resolve )\n .catch( PROM.errorHandler ); \n } );\n } else {\n resolve();\n }\n } );\n }", "title": "" }, { "docid": "610e8b0f9bd9c2965e9ccd6905d928c7", "score": "0.51453656", "text": "constructor(database) {\n this.database = database;\n }", "title": "" }, { "docid": "64ee63c2bac1de17d7b4b0fbd8764177", "score": "0.5141333", "text": "doesSupportDatabase () {}", "title": "" }, { "docid": "880c62c05c5850eb69c27a37f5f37c3b", "score": "0.5137273", "text": "async function openDataBase() {\n try {\n return await sqlite.open('./db/database.db', {\n Promise\n })\n } catch (error) {\n return Promise.reject(error);\n }\n}", "title": "" }, { "docid": "ed70417e825e61b8d9a0bbdb28bb90fd", "score": "0.5125294", "text": "function openDBConnection() {\n var connection = mysql.createConnection({\n host: process.env.DATABASE_HOST,\n user: process.env.DATABASE_USERNAME,\n password: process.env.DATABASE_PASSWORD,\n database: process.env.DATABASE_NAME,\n });\n\n return connection; //return the open connection\n}", "title": "" }, { "docid": "93a0607e3a75446ee8b0281cf5281eac", "score": "0.51196593", "text": "get database() { throw new Error('The database is not available in tests.'); }", "title": "" }, { "docid": "440d29da4e8e55aca2f1cda88285bfbb", "score": "0.5108415", "text": "function init_database(app)\n{\n\tvar options = app.get('config');\n\tif (options.dburi)\n\t{\n\t\t//database connection for guest sessions. This allows us to specify a different DB username for guest sessions\n\t\tvar guest_db = new dblib({\n\t\t\tdburi: options.guest_dburi || options.dburi,\n\t\t\tdebug: options.debug,\n\t\t\tsession_id: 'grape-guest-' + process.pid.toString(),\n\t\t\tusername: 'guest',\n\t\t\tdebug_logger: function(s) { app.get('logger').db(s); }\n\t\t});\n\n\t\tguest_db.on('error', function(err) {\n\t\t\tapp.get('logger').log('db', 'error', err);\n\t\t});\n\n\t\tguest_db.on('debug', function(msg) {\n\t\t\tapp.get('logger').log('db', 'debug', msg);\n\n\t\t});\n\t\tguest_db.on('notice', function(msg) {\n\t\t\tapp.get('logger').log('db', 'debug', 'Notice: ' + msg);\n\t\t});\n\n\t\tguest_db.on('end', function() {\n\t\t\tif (!guest_db.no_reconnect)\n\t\t\t{\n\t\t\t\tapp.get('logger').log('db', 'info', 'Guest db conn disconnected. Restarting');\n\t\t\t\tguest_db.connect();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tapp.get('logger').log('db', 'info', 'Guest db conn disconnected');\n\t\t\t}\n\t\t});\n\n\t\tapp.set('guest_db', guest_db);\n\t}\n}", "title": "" }, { "docid": "5682f95d62d26199e39d3e8f019998d1", "score": "0.5107892", "text": "function createDbTable(t,dbInfo,callback,errorCallback){t.executeSql('CREATE TABLE IF NOT EXISTS '+dbInfo.storeName+' '+'(id INTEGER PRIMARY KEY, key unique, value)',[],callback,errorCallback);}// Open the WebSQL database (automatically creates one if one didn't", "title": "" }, { "docid": "04d6665020c955b5446598a7c6e03d6d", "score": "0.5105499", "text": "function yearoptions()\n\t{\n\t\tvar db = window.openDatabase(\"Database\", \"1.0\", \"Cordova Demo\", 200000);\n db.transaction(yearsuccess, errorCB);\n\t}", "title": "" }, { "docid": "0c8a9d9174d12725981da1c350f779bd", "score": "0.5091189", "text": "closeMasterDatabase(databaseName) {\n let database = this.getDatabaseInstance(databaseName);\n database.close(function (err) {\n if (err) console.log('Error closing Database: ' + err);\n else console.log('Database closed successfully!');\n });\n }", "title": "" }, { "docid": "32426eb2656d1114df3ce180ab4390c4", "score": "0.5070398", "text": "function initDb(){\r\n\ttry {\r\n\t\tif (window.openDatabase) {\r\n\t\t\tnoteStorageDb = openDatabase(\"NoteStorage\", \"1.0\", \"MMS-Notes\", 512*1024);\r\n\t\t\tif (noteStorageDb){\r\n\t\t\t\tconsole.log(\"Db 'NoteStorage' opened.\");\r\n\t\t\t\tnoteStorageDb.transaction(function(tx) {\r\n\t\t\t\t\ttx.executeSql(\"SELECT COUNT(content) FROM NoteStorage\", [], function(result) {}, function(tx, error) {\r\n\t\t\t\t\t\tconsole.log(\"No valid row found, creating new.\");\r\n\t\t\t\t\t\ttx.executeSql(\"CREATE TABLE NoteStorage (userid REAL UNIQUE, content TEXT, timestamp REAL)\", [], function(result) {});\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t} catch(err) {\r\n\t\tnoteStorageDb = null;\r\n\t}\r\n\treturn false;\r\n}", "title": "" }, { "docid": "70070a02ae672d493c9bfb769feba060", "score": "0.50650746", "text": "function openDatabase(dbName, dbVersion, storeName) {\n return new Promise((resolve, reject) => {\n const request = indexedDB.open(dbName, dbVersion);\n request.onerror = reject.bind(null, 'Error opening wasm cache database');\n request.onsuccess = () => {\n resolve(request.result);\n };\n request.onupgradeneeded = event => {\n const db = request.result;\n if (db.objectStoreNames.contains(storeName)) {\n console.log(`Clearing out version ${event.oldVersion} wasm cache`);\n db.deleteObjectStore(storeName);\n }\n console.log(`Creating version ${event.newVersion} wasm cache`);\n db.createObjectStore(storeName);\n };\n });\n}", "title": "" }, { "docid": "8d1ebef45dc4262da56f655582a4d9cc", "score": "0.50580513", "text": "function close(){\n db.close();\n}", "title": "" }, { "docid": "d16a727ecbf99400417af8ba37403460", "score": "0.50509894", "text": "function startDB() {\n try {\n\n dataBase = indexedDB.open('bansefi', 1);\n dataBase.onsuccess = function (e) {\n \tif(lstBloqueos!=null){\n \t\tcatalogo(\"catalogo_bloqueos\",\"b\");\n \t}\n \tif(lstRetenciones!=null){\n \t\tcatalogo(\"catalogo_retenciones\",\"r\");\n \t}\n };\n }catch (err) {\n console.log(\"Ocurrió un error startDB: \" + err.message);\n }\n}", "title": "" }, { "docid": "08c4f22fd50c23aa3a081eac4acb96bf", "score": "0.5048009", "text": "function withDB(callback) {\n let request = indexedDB.open(\"zipcodes\", 1); // Request v1 of the database\n request.onerror = console.error; // Log any errors\n request.onsuccess = () => {\n // Or call this when done\n let db = request.result; // The result of the request is the database\n callback(db); // Invoke the callback with the database\n };\n\n // If version 1 of the database does not yet exist, then this event\n // handler will be triggered. This is used to create and initialize\n // object stores and indexes when the DB is first created or to modify\n // them when we switch from one version of the DB schema to another.\n request.onupgradeneeded = () => {\n initdb(request.result, callback);\n };\n}", "title": "" }, { "docid": "2bc4057d934488fa08cb92d306252516", "score": "0.5027278", "text": "function initDatabase() {\n \tconsole.log(\"initDatabase\");\n\n try {\n\t\t// Check browser is supported SQLite or not.\n if (!window.openDatabase) {\n alert('Databases are not supported in this browser.');\n } else {\n \t// If supported then call Function for create table in SQLite\n \trefresh();\n }\n }\n catch (e) { \n \t// Version number mismatch. \n if (e == 2) {\n console.log(\"Invalid database version.\");\n } else {\n console.log(\"Unknown error \" + e + \".\");\n }\n\n return;\n }\n}", "title": "" }, { "docid": "48fda296b0032e1deda4f15a5b7e6627", "score": "0.5015767", "text": "function cargarDB() {\n db = window.openDatabase(\"miDB\", \"1.0\", \"Demo BDatos\", 200000);\n if(db==null){\n document.getElementById('div3').style.display='none';\n }\n db.transaction(creaTabla, errorOperacionSQL, exitoSQL); \n}", "title": "" }, { "docid": "071d0d88b0874b627bc9c29b249b20b9", "score": "0.5006787", "text": "async connect(uri, options) {\n if (this.db)\n return this.db;\n options = { ...exports.MONGO_CLIENT_DEFAULTS, ...options };\n this.dbname = utils_1.parseDbName(uri);\n this.client = await mongodb_1.MongoClient.connect(uri, options);\n this.db = this.client.db(this.dbname);\n return this.db;\n }", "title": "" }, { "docid": "52f7c1daf1f666b5e9c7e120a88b274c", "score": "0.50037634", "text": "function db(dbName) {\n return client.db(dbName);\n}", "title": "" }, { "docid": "d8e60d6c43c561eac848d6e534671395", "score": "0.49971548", "text": "async openOrCreate(name, type, options) {\n let db;\n\n try {\n db = await this.odb.create(name, type, options);\n } catch (e) {\n if (e.message.indexOf('exists') === -1) {\n throw e;\n }\n const m = DB_ADDR.exec(e.message);\n if (!m) {\n throw new Error('Database exists, could not parse address');\n }\n const address = m[1];\n db = await this.odb.open(address, type);\n }\n\n return db;\n }", "title": "" }, { "docid": "dee7d60d8be538372aa3ce31fa6971b1", "score": "0.49906075", "text": "async function OrbitDBPouch(opts, callback) {\n if (!opts.ipfs)\n throw new Error(\"IPFS is undefined\")\n\n let orbitdb, db\n const api = this\n const ipfs = opts.ipfs\n\n console.log(\"> Init OrbitDB adapter\")\n\n try {\n orbitdb = new OrbitDB(ipfs, opts.path || './orbitdb')\n db = await orbitdb.docstore(opts.address || opts.name)\n db.events.on('replicated', () => {\n // Get the _rev of whatever document is the last operation in the log\n const rev = db._oplog.values.slice(-1)[0].payload.value\n ? db._oplog.values.slice(-1)[0].payload.value._rev\n : \"Document doesn't exist or was deleted\"\n console.log(\"Database replicated, latest revision:\", rev)\n })\n await db.load()\n api.orbitdb = db\n\n console.log(\"> OrbitDB ready\")\n api.onReady(db)\n } catch (e) {\n console.error(e)\n } \n\n api.replicate = async () => {\n // TODO: start orbitdb replication, currently automatically on\n }\n\n // Temp callbacks, replace with events\n api.onReady = () => null\n\n api._remote = true;\n /* istanbul ignore next */\n api.type = function () {\n return 'orbitdb';\n };\n\n api.id = (callback) => db.address.toString()\n\n api.request = (callback) => {\n callback(null, 'hellodb-request')\n }\n\n // Sends a POST request to the host calling the couchdb _compact function\n // version: The version of CouchDB it is running\n api.compact = (callback) => {\n callback(null, 'hellodb-compact')\n }\n\n api.bulkGet = (callback) => {\n callback(null, 'hellodb-bulkGet')\n }\n\n // Calls GET on the host, which gets back a JSON string containing\n // couchdb: A welcome string\n // version: The version of CouchDB it is running\n api._info = (callback) => {\n callback(null, {\n db_name: 'hellodb-info',\n })\n }\n\n // Get the document with the given id from the database given by host.\n api._get = (id) => {\n const res = db.get(id)\n // console.log(\"get>\", res)\n return Promise.resolve(res[0])\n }\n\n let lastChange = null\n\n api._bulkDocs = async (req, opts) => {\n // console.log(\"bulkDocs>\", req)\n for (let doc of req.docs) {\n const parsed = parseDoc(doc, true)\n lastChange = Object.assign({ _rev: parsed.metadata.rev }, doc)\n delete lastChange._rev_tree\n const hash = await db.put(lastChange)\n }\n return lastChange\n }\n\n // Update/create document\n // api.put = async (doc, opts, callback) => {\n // const parsed = parseDoc(doc, true)\n // lastChange = Object.assign({ _rev: parsed.metadata.rev }, doc)\n // delete lastChange._rev_tree\n // // console.log(\"put>\", orbitdb.id, lastChange)\n // const hash = await db.put(lastChange)\n // return lastChange\n // }\n\n // Delete the document given by doc from the database given by host.\n api.remove = async (doc, opts) => {\n await db.del(doc._id)\n }\n\n // api.allDocs = (callback) => {\n // callback(null, 'hellodb-alldocs')\n // }\n\n api._destroy = async (opts, callback) => {\n await db.drop()\n callback(null, 'hellodb-destroy')\n }\n\n // Get a list of changes made to documents in the database given by host.\n // TODO According to the README, there should be two other methods here,\n // api.changes.addListener and api.changes.removeListener.\n api._changes = function (opts) {\n if (lastChange) {\n // const change = opts.processChange(lastChange, [], opts);\n opts.onChange(lastChange);\n }\n }\n\n // api.revsDiff = (callback) => {\n // callback(null, 'hellodb-revsDiff')\n // }\n\n utils.nextTick(() => {\n callback(null, api);\n })\n}", "title": "" }, { "docid": "24ffb65e76a8d2176fed4120a9dcdab9", "score": "0.49884823", "text": "function setupDB(){\r\n\r\n var dbRequest = window.indexedDB.open(\"_pouch_troubletickets\"),\r\n dbDfd = $.Deferred();\r\n\r\n dbRequest.onsuccess = function( event ) {\r\n console.log(\"Opened DB\");\r\n db = dbRequest.result;\r\n dbDfd.resolve( db );\r\n };\r\n dbRequest.onblocked = function( event ){\r\n console.error(\"DB connection blocked\");\r\n db.close();\r\n setupDB();\r\n };\r\n dbRequest.onerror = function( event ){\r\n console.error(\"DB connection issues\");\r\n dbDfd.reject();\r\n };\r\n dbRequest.onupgradeneeded = function(){\r\n var i, cur;\r\n db = dbRequest.result;\r\n console.log(\"onupgradeneeded\");\r\n\r\n //Create non-existant tables\r\n// for(i=0; i < stores.length; i+=1){\r\n// cur = stores[i];\r\n// db.createObjectStore( cur.name, {keyPath: cur.keyPath, autoIncrement: true});\r\n// }\r\n };\r\n return dbDfd.promise();\r\n }", "title": "" }, { "docid": "e1ebb167b23ad6366945593dcbbff4a1", "score": "0.4973773", "text": "function create_db(name){\n\n // Create the new database if it doesn't already exist\n con.database = name;\n var sql = \"CREATE DATABASE IF NOT EXISTS \" + name;\n con.query(sql, function (err, result) {\n if (err) throw err;\n console.log(\"Database '\" + name + \"' created or already exists\");\n });\n\n // Set the new database as the active one\n con.query(\"USE \" + name, function (err, result) {\n if (err) throw err;\n console.log(\"Database '\" + name + \"' selected\");\n });\n}", "title": "" }, { "docid": "968586e606e65daba9e4d6bd50ebd47a", "score": "0.49706462", "text": "function closeDB() {\n db.close()\n}", "title": "" }, { "docid": "5edd915555aca96bdc0e08c4b75e8e9a", "score": "0.49696338", "text": "getDB() {\n return this.sqlite.create({\n name: 'dbXexpress.db',\n location: 'default',\n });\n }", "title": "" }, { "docid": "63c099e381d3d3faae94212b217c942d", "score": "0.49664497", "text": "function create_openDB() {\n try {\n var request = window.indexedDB.open(indexedDBName,version); \n request.onsuccess = function (event) {\n db = request.result;\n output_trace(\"indexedDB: \" + indexedDBName + \" created or opened\");\n db.close();\n \n };\n request.onerror = function (event) {\n output_trace(\"indexedDB.open Error: \" + event.message);\n };\n \n request.onupgradeneeded = function (event){\n \t db = request.result;\n \t if(!db.objectStoreNames.contains(\"emailTemplates\"))\n \t {\n \t\t objectStore = db.createObjectStore(\"emailTemplates\",{keyPath: \"id\", autoIncrement: true});\n \t\t objectStore.createIndex(\"Tname\",\"template_name\",{keypath: \"id\"});\n \t\t objectStore.createIndex(\"Tgroup\",\"template_group\",{keypath: \"id\"});\n \t\t objectStore.createIndex(\"Ebody\",\"email_body\",{keypath: \"id\"});\n \t }\n };\n \n }\n catch (e) {\n output_trace(\"Error: \" + e.message);\n }\n }", "title": "" }, { "docid": "4360660cfc8a0e1959810511da2d4e2d", "score": "0.49591884", "text": "function useDb (databaseName) {\n if (connections[databaseName]) {\n return connections[databaseName]\n }\n\n if (databaseName) {\n let option = Object.assign({}, options.arango)\n option.databaseName = databaseName\n\n connections[databaseName] = new Arangojs.Database(option)\n\n return connections[databaseName]\n }\n\n connections[databaseName] = options.arango.driver\n\n return connections[databaseName]\n }", "title": "" }, { "docid": "8a51dc52297d15b2b7ba81d7ec109597", "score": "0.4951317", "text": "function startDB(string, tableid, colName) {\n\n var db = window.openDatabase(\"YalldoDB\", \"1.0\", \"YalldoBeta\", 4000000);\n db.transaction(populateDB, errorCB, successCB);\n\n var key = string; //key string which let us choose which sql query we would like to call.\n var table_id = tableid; //the id of the row of any file so we could use it to update the onserver value.\n\n // Populate the database \n\n function populateDB(tx) {\n\n tx.executeSql('CREATE TABLE IF NOT EXISTS FLIGHTS (id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE, flightid, fname, desc, sport, timestamp, latitude, longitude, distance, period, timestampstop, status, gpsfilename, ispublic, islogged, onserver)');\n tx.executeSql('CREATE TABLE IF NOT EXISTS FILES (id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE, flightid, type, fileobject,timestampstart ,timestampstop, totaldistance, onserver)');\n tx.executeSql('CREATE TABLE IF NOT EXISTS SETTINGS (id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE, units, useknots, notifications, language, lastsport)');\n\n if (key == \"createSettings\") {\n tx.executeSql('INSERT INTO SETTINGS( id, units, useknots, notifications, language, lastsport) VALUES ( 1, 1, 0, 2, 1, 1)');\n }\n\n if (key == \"createFlight\") {\n //Query to be executed for create a new flight and insert its details to the database.\n tx.executeSql('INSERT INTO FLIGHTS(flightid, fname, desc, sport, timestamp, status, ispublic, islogged, onserver) VALUES (\"' + flightId + '\", \"' + c_Name + '\", \"' + c_Desc + '\", \"' + c_Sport + '\", \"' + formattedCTime(\"STimeAjax\", startOfRecord) + '\", \"canNotBeSaved\" ,0 , 0, 0)');\n\n }\n\n if (key == \"planFlight\") {\n //Query to be executed to plan a new flight and insert its details to the database.\n tx.executeSql('INSERT INTO FLIGHTS(flightid, fname, desc, sport, timestamp, gpsfilename, status, ispublic, islogged, onserver) VALUES (\"' + planId + '\", \"' + planName + '\", \"' + planDesc + '\", \"' + planSport + '\", \"' + planTime + \"00:00:00\" +'\", \"' + planGPS + '\", \"canBeSaved\" ,0 , 0, 0)');\n\n }\n\n if (key == \"addGPSTrack\") {\n\n //Query to be executed for adding the GPS data to the database.\n tx.executeSql('INSERT INTO FILES(flightid,fileobject,timestampStart, timestampstop, totaldistance,onserver,type)VALUES (\"' + flightId + '\", \"' + GPSFileURL + '\", \"' + startOfRecord + '\", 0, 0, 0,\"GPSFile\")');\n console.log('Database GPS Insertion is Done!');\n }\n\n if (key == \"updateGPSURL\") {\n tx.executeSql('UPDATE FILES SET fileobject = ? , timestampstop = ? , totaldistance=? WHERE flightid= ? AND type =?', [GPSFileURL, timeStampNew, totalDistance, flightId, \"GPSFile\"], done, errorCB);\n\n function done() {\n console.log('Updating URL is done by the following: File=' + GPSFileURL + ' , timestampStop= ' + timeStampNew + ' totalDistance= ' + totalDistance);\n GPSURLUpdated = true;\n }\n }\n\n if (key == \"updateSetting\") {\n tx.executeSql('UPDATE SETTINGS SET \"' + colName + '\" = ? ', [tableid], updateDone4, errorCB);\n\n function updateDone4() {\n console.log('Default ' + colName + ' updated!(' + tableid + ')');\n }\n }\n\n if (key == \"updateAllIds\") {\n console.log(\"****update FlightId of the flight & GPS & pictures id's\" + tableid + ' the serverId we got =' + colName);\n tx.executeSql('UPDATE FLIGHTS SET flightid = ? , onserver = ? WHERE flightid= ? ', [colName, 1, tableid], done1, errorCB);\n tx.executeSql('UPDATE FILES SET flightid = ? WHERE flightid= ? ', [colName, tableid], done2, errorCB);\n\n function done1() {\n console.log('Updating the Flight Id is done');\n }\n\n function done2() {\n console.log('Updating the GPS & Pictures Ids is done');\n }\n }\n\n if (key == \"updateLat&Lon\") {\n tx.executeSql('UPDATE FLIGHTS SET latitude = ? , longitude = ? ,gpsfilename= ? WHERE flightid= ? ', [firstLat, firstLon, GPSFileName, flightId], updateDone, errorCB);\n\n function updateDone() {\n console.log('Updating the Latitude and Longitude is done: lat =' + firstLat + ' Lon= ' + firstLon + \" GPS File name is \" + GPSFileName);\n }\n }\n\n if (key == \"updateFlightStatus\") {\n tx.executeSql('UPDATE FLIGHTS SET status = ? WHERE flightid= ? ', [\"canBeSaved\", flightId], updateDone3, errorCB);\n\n function updateDone3() {\n console.log('Flight status updated to \"canBeSaved\"');\n }\n }\n\n if (key == \"saveFlight\") {\n console.log('The flight Id to be looked for is ' + flightId);\n tx.executeSql('UPDATE FLIGHTS SET distance = ? , period = ? , timestampstop = ? , fname = ?,desc = ?, sport = ?, ispublic = ? WHERE flightid= ? ', [totalDistance, totalTime, endOfRecord, preFFormat, c_Desc, c_Sport, c_Priv, flightId], updateDone2, errorCB);\n\n function updateDone2() {\n console.log('Updating the totalDistance and Period is done: time =' + totalTime + ' distance= ' + totalDistance + preFFormat);\n }\n }\n\n if (key == \"addPicture\") {\n //Execute the query to add the picture to the database.\n if (flightId == '') flightId = 'none';\n\n tx.executeSql('INSERT INTO FILES (flightid,fileobject,timestampstart,onserver,type) VALUES(\"' + flightId + '\", \"' + photodata + '\", \"' + formattedCTime(\"STimeAjax\", startOfRecord) + '\", 0,\"picture\")');\n\n console.log('** Database Picture Insertion is Done!, with FlightId= ' + flightId + ' & with timestamp ' + formattedCTime(\"STimeAjax\", startOfRecord));\n }\n\n if (key == \"getPictures\") {\n var newarray = [];\n tx.executeSql('SELECT * FROM FILES WHERE onserver=? AND flightid = ? AND type = ?', [0, serverFlightId, \"picture\"], querySuccessx, errorCB);\n\n function querySuccessx(tx, results) {\n\n var len = results.rows.length;\n if (len == 0) console.log('All files are synchronized already!');\n else console.log(\"rows in FILES: \" + len);\n for (var i = 0; i < len; i++) {\n\n var item = results.rows.item(i);\n\n newarray.push(item); //pushing the new object we got from the table after adding the status and type.\n\n console.log('File type: ' + item.type + ' - OnServer Status : 0 ' + \"flightId:\" + item.flightid);\n syncFilesArray = newarray;\n\n }\n }\n }\n\n if (key == \"checkFlights\") {\n //It scans the database for any flights that has not been synced or received a Server's Flight Id\n tx.executeSql('SELECT * FROM FLIGHTS WHERE onserver = ? AND status = ?', [0, \"canBeSaved\"], querySuccessF, errorCB);\n\n function querySuccessF(tx, results) {\n\n var len = results.rows.length;\n alert('Flights found: ' + len);\n if (len == 0) console.log('All flights are on server!');\n for (var i = 0; i < len; i++) {\n\n console.log('this is the name from the dbstart' + results.rows.item(i).flightid + ' & ' + results.rows.item(i).longitude + ' & ' + results.rows.item(i).onserver);\n AfterRecording(\"dataRestore\", results.rows.item(i));\n\n }\n }\n\n }\n\n if (key == \"getSetting\") {\n //It scans the database for any flights that has not been synced or received a Server's Flight Id\n tx.executeSql('SELECT * FROM SETTINGS ', [], querySuccessF, errorCB);\n\n function querySuccessF(tx, results) {\n\n if (results.rows.length == 0) {\n startDB('createSettings');\n console.log('setting up new settings');\n repeat = true;\n } else {\n repeat = false;\n //Defaults: units, useknots, notifications, language, lastsport\t\t1, 0, 2, 1, 1\n selectedUnits = results.rows.item(0).units;\n selectedUseknots = results.rows.item(0).useknots;\n selectedNotifications = results.rows.item(0).notifications;\n selectedLanguage = results.rows.item(0).language;\n selectedSport = results.rows.item(0).lastsport;\n console.log('Settings currently are: ' + selectedUnits + ' & ' + selectedUseknots + ' & ' + selectedNotifications + ' & ' + selectedLanguage + ' & ' + selectedSport);\n }\n\n }\n\n }\n\n if (key == \"dropTrace\") {\n //This is Executed when the user cancel an already going recording so it drops the pre-created flight, just cleaning the database..\n\n tx.executeSql('DELETE FROM FLIGHTS WHERE flightid = ? ', [flightId], DquerySuccess, errorCB);\n tx.executeSql('DELETE FROM FILES WHERE flightid = ? ', [flightId], DquerySuccess, errorCB);\n\n function DquerySuccess(tx, results) {\n console.log('Just dropped the GPS File & FlightId rows from the FILES & FLIGHTS table');\n\n resetVariables();\n }\n }\n\n if (key == \"setOnServer\") {\n if (table_id == \"\") {\n //It sets the onServer variable in the database to 1 after a successful upload of a file.\n tx.executeSql('UPDATE FILES SET onserver = ? WHERE flightid = ? AND type= ?', [1, serverFlightId, \"GPSFile\"], querySuccess, errorCB);\n\n function querySuccess(tx, results) {\n console.log('GPS Upload is successful and OnServer is set to \"1\"');\n }\n } else {\n tx.executeSql('UPDATE FILES SET onserver = ? WHERE flightid = ? AND type= ? AND id = ?', [1, serverFlightId, \"picture\", table_id], querySuccess, errorCB);\n\n function querySuccess(tx, results) {\n console.log(' Picture Upload is successful and OnServer is set to \"1\"');\n }\n }\n }\n\n }\n\n // Transaction error callback\n\n function errorCB(tx, err) {\n console.log(\"Error processing SQL: \" + key + err);\n }\n\n // Transaction success callback\n\n function successCB() {\n console.log(key + \" success!\");\n\n if (key == \"getPictures\") uploadAllPic(serverFlightId, \"pictures\");\n\n if (key == \"getSetting\" && repeat == true) {\n startDB('getSetting');\n console.log(\"Now its repeated\");\n }\n\n if (key == \"getSetting\" && repeat == false) setUnits();\n\n if (key == \"updateSetting\") startDB('getSetting');\n }\n\n}", "title": "" }, { "docid": "05a5420b46e8c83ce82968fdead6fd97", "score": "0.49471506", "text": "function initDB(db_obj) {\n db_obj.sql_driver = mysql.createTCPClient(); // localhost:3306 by default\n db_obj.sql_driver.auto_prepare = true;\n db_obj.sql_driver.auth(options.db_login.database,\n options.db_login.user,\n options.db_login.password);\n}", "title": "" } ]
069b6adc62341a64d81b59289fe7ab91
Merges connection options with connection parameters This method can be overriden in child classes.
[ { "docid": "d558b8a52d60ffe392f47da1b62ad098", "score": "0.79516584", "text": "mergeConnection(options, connection) {\n let mergedOptions = options.setDefaults(connection);\n return mergedOptions;\n }", "title": "" } ]
[ { "docid": "223e1f0a2e61e7afedbbb2ba876beaa3", "score": "0.632315", "text": "composeOptions(connections, credential, parameters) {\n // Connection options\n let options = new pip_services3_commons_node_1.ConfigParams();\n // Merge connection parameters\n for (let connection of connections) {\n options = this.mergeConnection(options, connection);\n }\n // Merge credential parameters\n options = this.mergeCredential(options, credential);\n // Merge optional parameters\n options = this.mergeOptional(options, parameters);\n // Perform final processing\n options = this.finalizeOptions(options);\n return options;\n }", "title": "" }, { "docid": "a9302e4f432ff52168a59ee44e07a4b5", "score": "0.6302679", "text": "static _defineOptions({ connectionTimeout, operationTimeout, url, host, port, db, pass }) {\n const parsedOptions = {\n connectionTimeout, operationTimeout, url, host, port, db, pass\n };\n\n return merge({}, DEFAULT_OPTIONS, parsedOptions);\n }", "title": "" }, { "docid": "dcc35c7d21d2ba8a211466487d16ef1c", "score": "0.6165884", "text": "getConnectionOptions() {\n return this.options.authInfo.getConnectionOptions();\n }", "title": "" }, { "docid": "33af2d24da37d367987532d7cb3b0af8", "score": "0.6111303", "text": "_addDefaultsToExecOpts(options) {\n options.connection = this;\n if (options.keepInStmtCache === undefined)\n options.keepInStmtCache = true;\n settings.addToOptions(options,\n \"autoCommit\",\n \"dbObjectAsPojo\",\n \"fetchArraySize\",\n \"fetchTypeHandler\",\n \"maxRows\",\n \"outFormat\",\n \"prefetchRows\");\n }", "title": "" }, { "docid": "294a09a23d04f5ad95a1fe30f8de481b", "score": "0.56515527", "text": "mergeConfigWithDefaults() {\n this.config = Object.assign(this.getDefaultConfig(), this.config);\n }", "title": "" }, { "docid": "f5299c65114c5264c4809475b7d99a13", "score": "0.564753", "text": "get connection() {\r\n return this.options.connection;\r\n }", "title": "" }, { "docid": "d5be0667d994e464402385cd497448e9", "score": "0.5596834", "text": "_applySettings() {\n if (('driver' in this.settings) || ('redis' in this.settings)) {\n this._applyOneConnection(this.settings);\n } else {\n this._applyMultiConnection(this.settings);\n }\n }", "title": "" }, { "docid": "6278e805366331787c46faf31b80ab46", "score": "0.5486336", "text": "clone(options = {}) {\n return new KernelConnection(Object.assign({ model: this.model, username: this.username, serverSettings: this.serverSettings, \n // handleComms defaults to false since that is safer\n handleComms: false }, options));\n }", "title": "" }, { "docid": "69b16f5b56d4725016a15f517f287e1a", "score": "0.5468847", "text": "function getConnectionOptions(connectionName) {\n if (connectionName === void 0) { connectionName = \"default\"; }\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function () {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__generator\"])(this, function (_a) {\n return [2 /*return*/, new _connection_ConnectionOptionsReader__WEBPACK_IMPORTED_MODULE_6__[\"ConnectionOptionsReader\"]().get(connectionName)];\n });\n });\n}", "title": "" }, { "docid": "e6f3d04e56c8780c0a6d9996ebd9df59", "score": "0.54207534", "text": "function mergerOptions(config1, config2) {\n const { defaultOptions, keywords, formats } = config1\n const res = {}\n res.options = Object.assign(defaultOptions, config2.options)\n res.keywords = keywords.concat(config2.keywords || [])\n res.formats = formats.concat(config2.formats || [])\n return res\n}", "title": "" }, { "docid": "c74bc81990b7d6227042fd73d1e3b7ea", "score": "0.5419976", "text": "function mergeConfig()\n /* config objects ... */\n {\n return helpers$1.merge({}, [].slice.call(arguments), {\n merger: function (key, target, source, options) {\n var tval = target[key] || {};\n var sval = source[key];\n\n if (key === 'scales') {\n // scale config merging is complex. Add our own function here for that\n target[key] = mergeScaleConfig(tval, sval);\n } else if (key === 'scale') {\n // used in polar area & radar charts since there is only one scale\n target[key] = helpers$1.merge(tval, [core_scaleService.getScaleDefaults(sval.type), sval]);\n } else {\n helpers$1._merger(key, target, source, options);\n }\n }\n });\n }", "title": "" }, { "docid": "fbafb30d6a1577cf577159ae836cc441", "score": "0.54124117", "text": "_combineOptions() {\n const options = this._options || {};\n return {\n ...options,\n data: this._normalizeData(this._data || options.data || []),\n map: this._googleMap.googleMap,\n };\n }", "title": "" }, { "docid": "fc0e36e2c0927d577ef8dd08a48f4d56", "score": "0.54024655", "text": "configure(config) {\n super.configure(config);\n this._connectionResolver.configure(config);\n this._maxKeySize = config.getAsIntegerWithDefault('options.max_key_size', this._maxKeySize);\n this._maxExpiration = config.getAsLongWithDefault('options.max_expiration', this._maxExpiration);\n this._maxValue = config.getAsLongWithDefault('options.max_value', this._maxValue);\n this._poolSize = config.getAsIntegerWithDefault('options.pool_size', this._poolSize);\n this._reconnect = config.getAsIntegerWithDefault('options.reconnect', this._reconnect);\n this._timeout = config.getAsIntegerWithDefault('options.timeout', this._timeout);\n this._retries = config.getAsIntegerWithDefault('options.retries', this._retries);\n this._failures = config.getAsIntegerWithDefault('options.failures', this._failures);\n this._retry = config.getAsIntegerWithDefault('options.retry', this._retry);\n this._remove = config.getAsBooleanWithDefault('options.remove', this._remove);\n this._idle = config.getAsIntegerWithDefault('options.idle', this._idle);\n }", "title": "" }, { "docid": "c045d583e555942d3730c42f87bc478c", "score": "0.5400473", "text": "mergeOptional(options, parameters) {\n let mergedOptions = options.setDefaults(parameters);\n return mergedOptions;\n }", "title": "" }, { "docid": "150bcaab3949eae550e2994d0561bc68", "score": "0.536913", "text": "function mergeConfig()\n /* config objects ... */\n {\n return helpers$1.merge({}, [].slice.call(arguments), {\n merger: function merger(key, target, source, options) {\n var tval = target[key] || {};\n var sval = source[key];\n\n if (key === 'scales') {\n // scale config merging is complex. Add our own function here for that\n target[key] = mergeScaleConfig(tval, sval);\n } else if (key === 'scale') {\n // used in polar area & radar charts since there is only one scale\n target[key] = helpers$1.merge(tval, [core_scaleService.getScaleDefaults(sval.type), sval]);\n } else {\n helpers$1._merger(key, target, source, options);\n }\n }\n });\n }", "title": "" }, { "docid": "150bcaab3949eae550e2994d0561bc68", "score": "0.536913", "text": "function mergeConfig()\n /* config objects ... */\n {\n return helpers$1.merge({}, [].slice.call(arguments), {\n merger: function merger(key, target, source, options) {\n var tval = target[key] || {};\n var sval = source[key];\n\n if (key === 'scales') {\n // scale config merging is complex. Add our own function here for that\n target[key] = mergeScaleConfig(tval, sval);\n } else if (key === 'scale') {\n // used in polar area & radar charts since there is only one scale\n target[key] = helpers$1.merge(tval, [core_scaleService.getScaleDefaults(sval.type), sval]);\n } else {\n helpers$1._merger(key, target, source, options);\n }\n }\n });\n }", "title": "" }, { "docid": "150bcaab3949eae550e2994d0561bc68", "score": "0.536913", "text": "function mergeConfig()\n /* config objects ... */\n {\n return helpers$1.merge({}, [].slice.call(arguments), {\n merger: function merger(key, target, source, options) {\n var tval = target[key] || {};\n var sval = source[key];\n\n if (key === 'scales') {\n // scale config merging is complex. Add our own function here for that\n target[key] = mergeScaleConfig(tval, sval);\n } else if (key === 'scale') {\n // used in polar area & radar charts since there is only one scale\n target[key] = helpers$1.merge(tval, [core_scaleService.getScaleDefaults(sval.type), sval]);\n } else {\n helpers$1._merger(key, target, source, options);\n }\n }\n });\n }", "title": "" }, { "docid": "2e612911e46605c5733f6f98b6f43673", "score": "0.53281695", "text": "function mergeConfig()/* config objects ... */{return helpers$1.merge({},[].slice.call(arguments),{merger:function merger(key,target,source,options){var tval=target[key]||{};var sval=source[key];if(key==='scales'){// scale config merging is complex. Add our own function here for that\ntarget[key]=mergeScaleConfig(tval,sval);}else if(key==='scale'){// used in polar area & radar charts since there is only one scale\ntarget[key]=helpers$1.merge(tval,[core_scaleService.getScaleDefaults(sval.type),sval]);}else{helpers$1._merger(key,target,source,options);}}});}", "title": "" }, { "docid": "6ac6e8085a1f3bc3c62f9dd9a9fd7902", "score": "0.53229785", "text": "function configure(user_options) {\n\t options = inherit(options, user_options);\n\t }", "title": "" }, { "docid": "6ac6e8085a1f3bc3c62f9dd9a9fd7902", "score": "0.53229785", "text": "function configure(user_options) {\n\t options = inherit(options, user_options);\n\t }", "title": "" }, { "docid": "6ac6e8085a1f3bc3c62f9dd9a9fd7902", "score": "0.53229785", "text": "function configure(user_options) {\n\t options = inherit(options, user_options);\n\t }", "title": "" }, { "docid": "6ac6e8085a1f3bc3c62f9dd9a9fd7902", "score": "0.53229785", "text": "function configure(user_options) {\n\t options = inherit(options, user_options);\n\t }", "title": "" }, { "docid": "6ac6e8085a1f3bc3c62f9dd9a9fd7902", "score": "0.53229785", "text": "function configure(user_options) {\n\t options = inherit(options, user_options);\n\t }", "title": "" }, { "docid": "6ac6e8085a1f3bc3c62f9dd9a9fd7902", "score": "0.53229785", "text": "function configure(user_options) {\n\t options = inherit(options, user_options);\n\t }", "title": "" }, { "docid": "6ac6e8085a1f3bc3c62f9dd9a9fd7902", "score": "0.53229785", "text": "function configure(user_options) {\n\t options = inherit(options, user_options);\n\t }", "title": "" }, { "docid": "6ac6e8085a1f3bc3c62f9dd9a9fd7902", "score": "0.53229785", "text": "function configure(user_options) {\n\t options = inherit(options, user_options);\n\t }", "title": "" }, { "docid": "6ac6e8085a1f3bc3c62f9dd9a9fd7902", "score": "0.53229785", "text": "function configure(user_options) {\n\t options = inherit(options, user_options);\n\t }", "title": "" }, { "docid": "9ceb03ba32369a8e8a20c96f157e1c7d", "score": "0.53044295", "text": "configure(options) {\n mergeOptions(this.data.options, options);\n return this;\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.5295998", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "fc2f0cda1dc841fdc7c265927829327b", "score": "0.5290583", "text": "function mergeConfig(/* config objects ... */) {\n \treturn helpers$1.merge({}, [].slice.call(arguments), {\n \t\tmerger: function(key, target, source, options) {\n \t\t\tvar tval = target[key] || {};\n \t\t\tvar sval = source[key];\n\n \t\t\tif (key === 'scales') {\n \t\t\t\t// scale config merging is complex. Add our own function here for that\n \t\t\t\ttarget[key] = mergeScaleConfig(tval, sval);\n \t\t\t} else if (key === 'scale') {\n \t\t\t\t// used in polar area & radar charts since there is only one scale\n \t\t\t\ttarget[key] = helpers$1.merge(tval, [core_scaleService.getScaleDefaults(sval.type), sval]);\n \t\t\t} else {\n \t\t\t\thelpers$1._merger(key, target, source, options);\n \t\t\t}\n \t\t}\n \t});\n }", "title": "" }, { "docid": "fc2f0cda1dc841fdc7c265927829327b", "score": "0.5290583", "text": "function mergeConfig(/* config objects ... */) {\n \treturn helpers$1.merge({}, [].slice.call(arguments), {\n \t\tmerger: function(key, target, source, options) {\n \t\t\tvar tval = target[key] || {};\n \t\t\tvar sval = source[key];\n\n \t\t\tif (key === 'scales') {\n \t\t\t\t// scale config merging is complex. Add our own function here for that\n \t\t\t\ttarget[key] = mergeScaleConfig(tval, sval);\n \t\t\t} else if (key === 'scale') {\n \t\t\t\t// used in polar area & radar charts since there is only one scale\n \t\t\t\ttarget[key] = helpers$1.merge(tval, [core_scaleService.getScaleDefaults(sval.type), sval]);\n \t\t\t} else {\n \t\t\t\thelpers$1._merger(key, target, source, options);\n \t\t\t}\n \t\t}\n \t});\n }", "title": "" }, { "docid": "1b8d247cc2b3a1db4a2bb025b85d559b", "score": "0.5267153", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "d6a6fe198555f585a7d6cfeffc334b62", "score": "0.5261802", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n}", "title": "" }, { "docid": "d6a6fe198555f585a7d6cfeffc334b62", "score": "0.5261802", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n}", "title": "" }, { "docid": "9595242390ec6ee79187b9f09edb1406", "score": "0.52409554", "text": "static _defineLibrarySettings(options) {\n const opts = merge({}, DEFAULT_LIBRARY_OPTIONS);\n const result = [opts];\n\n if (!isString(options.url)) {\n merge(opts, { // If it's not the string URL, merge the params separately.\n host: options.host,\n port: options.port,\n db: options.db,\n password: options.pass\n });\n } else { // If it IS the string URL, that'll be the first param for ioredis.\n result.unshift(options.url);\n }\n\n return result;\n }", "title": "" }, { "docid": "7e2eda6cbfa7d2175b52c5d7bbdab08e", "score": "0.5180239", "text": "function mergeConfig(/* config objects ... */) {\r\n\treturn helpers$1.merge({}, [].slice.call(arguments), {\r\n\t\tmerger: function(key, target, source, options) {\r\n\t\t\tvar tval = target[key] || {};\r\n\t\t\tvar sval = source[key];\r\n\r\n\t\t\tif (key === 'scales') {\r\n\t\t\t\t// scale config merging is complex. Add our own function here for that\r\n\t\t\t\ttarget[key] = mergeScaleConfig(tval, sval);\r\n\t\t\t} else if (key === 'scale') {\r\n\t\t\t\t// used in polar area & radar charts since there is only one scale\r\n\t\t\t\ttarget[key] = helpers$1.merge(tval, [core_scaleService.getScaleDefaults(sval.type), sval]);\r\n\t\t\t} else {\r\n\t\t\t\thelpers$1._merger(key, target, source, options);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "7e2eda6cbfa7d2175b52c5d7bbdab08e", "score": "0.5180239", "text": "function mergeConfig(/* config objects ... */) {\r\n\treturn helpers$1.merge({}, [].slice.call(arguments), {\r\n\t\tmerger: function(key, target, source, options) {\r\n\t\t\tvar tval = target[key] || {};\r\n\t\t\tvar sval = source[key];\r\n\r\n\t\t\tif (key === 'scales') {\r\n\t\t\t\t// scale config merging is complex. Add our own function here for that\r\n\t\t\t\ttarget[key] = mergeScaleConfig(tval, sval);\r\n\t\t\t} else if (key === 'scale') {\r\n\t\t\t\t// used in polar area & radar charts since there is only one scale\r\n\t\t\t\ttarget[key] = helpers$1.merge(tval, [core_scaleService.getScaleDefaults(sval.type), sval]);\r\n\t\t\t} else {\r\n\t\t\t\thelpers$1._merger(key, target, source, options);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "4a3428e103d08278fce6a24e9b068e51", "score": "0.5178711", "text": "configure(config) {\n this._connectionResolver.configure(config);\n this._credentialResolver.configure(config);\n this._options = config.getSection(\"options\");\n }", "title": "" }, { "docid": "eeef724d014e32b4cbff4dfcccbc2957", "score": "0.51709265", "text": "constructor(options = {}) {\n this.serverSettings =\n options.serverSettings || serverconnection_1.ServerConnection.makeSettings();\n }", "title": "" }, { "docid": "c879c45b8e2a74d2f4e882ca8dc3ac5d", "score": "0.51703167", "text": "get config () {\n return { ...options, ...this.props }\n }", "title": "" }, { "docid": "3c99845ce4d621c27598b7e579b930f6", "score": "0.5167181", "text": "function mergeConfig(/* config objects ... */) {\n\treturn helpers$1.merge({}, [].slice.call(arguments), {\n\t\tmerger: function(key, target, source, options) {\n\t\t\tvar tval = target[key] || {};\n\t\t\tvar sval = source[key];\n\n\t\t\tif (key === 'scales') {\n\t\t\t\t// scale config merging is complex. Add our own function here for that\n\t\t\t\ttarget[key] = mergeScaleConfig(tval, sval);\n\t\t\t} else if (key === 'scale') {\n\t\t\t\t// used in polar area & radar charts since there is only one scale\n\t\t\t\ttarget[key] = helpers$1.merge(tval, [core_scaleService.getScaleDefaults(sval.type), sval]);\n\t\t\t} else {\n\t\t\t\thelpers$1._merger(key, target, source, options);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "3c99845ce4d621c27598b7e579b930f6", "score": "0.5167181", "text": "function mergeConfig(/* config objects ... */) {\n\treturn helpers$1.merge({}, [].slice.call(arguments), {\n\t\tmerger: function(key, target, source, options) {\n\t\t\tvar tval = target[key] || {};\n\t\t\tvar sval = source[key];\n\n\t\t\tif (key === 'scales') {\n\t\t\t\t// scale config merging is complex. Add our own function here for that\n\t\t\t\ttarget[key] = mergeScaleConfig(tval, sval);\n\t\t\t} else if (key === 'scale') {\n\t\t\t\t// used in polar area & radar charts since there is only one scale\n\t\t\t\ttarget[key] = helpers$1.merge(tval, [core_scaleService.getScaleDefaults(sval.type), sval]);\n\t\t\t} else {\n\t\t\t\thelpers$1._merger(key, target, source, options);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "3c99845ce4d621c27598b7e579b930f6", "score": "0.5167181", "text": "function mergeConfig(/* config objects ... */) {\n\treturn helpers$1.merge({}, [].slice.call(arguments), {\n\t\tmerger: function(key, target, source, options) {\n\t\t\tvar tval = target[key] || {};\n\t\t\tvar sval = source[key];\n\n\t\t\tif (key === 'scales') {\n\t\t\t\t// scale config merging is complex. Add our own function here for that\n\t\t\t\ttarget[key] = mergeScaleConfig(tval, sval);\n\t\t\t} else if (key === 'scale') {\n\t\t\t\t// used in polar area & radar charts since there is only one scale\n\t\t\t\ttarget[key] = helpers$1.merge(tval, [core_scaleService.getScaleDefaults(sval.type), sval]);\n\t\t\t} else {\n\t\t\t\thelpers$1._merger(key, target, source, options);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "3c99845ce4d621c27598b7e579b930f6", "score": "0.5167181", "text": "function mergeConfig(/* config objects ... */) {\n\treturn helpers$1.merge({}, [].slice.call(arguments), {\n\t\tmerger: function(key, target, source, options) {\n\t\t\tvar tval = target[key] || {};\n\t\t\tvar sval = source[key];\n\n\t\t\tif (key === 'scales') {\n\t\t\t\t// scale config merging is complex. Add our own function here for that\n\t\t\t\ttarget[key] = mergeScaleConfig(tval, sval);\n\t\t\t} else if (key === 'scale') {\n\t\t\t\t// used in polar area & radar charts since there is only one scale\n\t\t\t\ttarget[key] = helpers$1.merge(tval, [core_scaleService.getScaleDefaults(sval.type), sval]);\n\t\t\t} else {\n\t\t\t\thelpers$1._merger(key, target, source, options);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "3c99845ce4d621c27598b7e579b930f6", "score": "0.5167181", "text": "function mergeConfig(/* config objects ... */) {\n\treturn helpers$1.merge({}, [].slice.call(arguments), {\n\t\tmerger: function(key, target, source, options) {\n\t\t\tvar tval = target[key] || {};\n\t\t\tvar sval = source[key];\n\n\t\t\tif (key === 'scales') {\n\t\t\t\t// scale config merging is complex. Add our own function here for that\n\t\t\t\ttarget[key] = mergeScaleConfig(tval, sval);\n\t\t\t} else if (key === 'scale') {\n\t\t\t\t// used in polar area & radar charts since there is only one scale\n\t\t\t\ttarget[key] = helpers$1.merge(tval, [core_scaleService.getScaleDefaults(sval.type), sval]);\n\t\t\t} else {\n\t\t\t\thelpers$1._merger(key, target, source, options);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "3c99845ce4d621c27598b7e579b930f6", "score": "0.5167181", "text": "function mergeConfig(/* config objects ... */) {\n\treturn helpers$1.merge({}, [].slice.call(arguments), {\n\t\tmerger: function(key, target, source, options) {\n\t\t\tvar tval = target[key] || {};\n\t\t\tvar sval = source[key];\n\n\t\t\tif (key === 'scales') {\n\t\t\t\t// scale config merging is complex. Add our own function here for that\n\t\t\t\ttarget[key] = mergeScaleConfig(tval, sval);\n\t\t\t} else if (key === 'scale') {\n\t\t\t\t// used in polar area & radar charts since there is only one scale\n\t\t\t\ttarget[key] = helpers$1.merge(tval, [core_scaleService.getScaleDefaults(sval.type), sval]);\n\t\t\t} else {\n\t\t\t\thelpers$1._merger(key, target, source, options);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "3c99845ce4d621c27598b7e579b930f6", "score": "0.5167181", "text": "function mergeConfig(/* config objects ... */) {\n\treturn helpers$1.merge({}, [].slice.call(arguments), {\n\t\tmerger: function(key, target, source, options) {\n\t\t\tvar tval = target[key] || {};\n\t\t\tvar sval = source[key];\n\n\t\t\tif (key === 'scales') {\n\t\t\t\t// scale config merging is complex. Add our own function here for that\n\t\t\t\ttarget[key] = mergeScaleConfig(tval, sval);\n\t\t\t} else if (key === 'scale') {\n\t\t\t\t// used in polar area & radar charts since there is only one scale\n\t\t\t\ttarget[key] = helpers$1.merge(tval, [core_scaleService.getScaleDefaults(sval.type), sval]);\n\t\t\t} else {\n\t\t\t\thelpers$1._merger(key, target, source, options);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "3c99845ce4d621c27598b7e579b930f6", "score": "0.5167181", "text": "function mergeConfig(/* config objects ... */) {\n\treturn helpers$1.merge({}, [].slice.call(arguments), {\n\t\tmerger: function(key, target, source, options) {\n\t\t\tvar tval = target[key] || {};\n\t\t\tvar sval = source[key];\n\n\t\t\tif (key === 'scales') {\n\t\t\t\t// scale config merging is complex. Add our own function here for that\n\t\t\t\ttarget[key] = mergeScaleConfig(tval, sval);\n\t\t\t} else if (key === 'scale') {\n\t\t\t\t// used in polar area & radar charts since there is only one scale\n\t\t\t\ttarget[key] = helpers$1.merge(tval, [core_scaleService.getScaleDefaults(sval.type), sval]);\n\t\t\t} else {\n\t\t\t\thelpers$1._merger(key, target, source, options);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "3c99845ce4d621c27598b7e579b930f6", "score": "0.5167181", "text": "function mergeConfig(/* config objects ... */) {\n\treturn helpers$1.merge({}, [].slice.call(arguments), {\n\t\tmerger: function(key, target, source, options) {\n\t\t\tvar tval = target[key] || {};\n\t\t\tvar sval = source[key];\n\n\t\t\tif (key === 'scales') {\n\t\t\t\t// scale config merging is complex. Add our own function here for that\n\t\t\t\ttarget[key] = mergeScaleConfig(tval, sval);\n\t\t\t} else if (key === 'scale') {\n\t\t\t\t// used in polar area & radar charts since there is only one scale\n\t\t\t\ttarget[key] = helpers$1.merge(tval, [core_scaleService.getScaleDefaults(sval.type), sval]);\n\t\t\t} else {\n\t\t\t\thelpers$1._merger(key, target, source, options);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "3c99845ce4d621c27598b7e579b930f6", "score": "0.5167181", "text": "function mergeConfig(/* config objects ... */) {\n\treturn helpers$1.merge({}, [].slice.call(arguments), {\n\t\tmerger: function(key, target, source, options) {\n\t\t\tvar tval = target[key] || {};\n\t\t\tvar sval = source[key];\n\n\t\t\tif (key === 'scales') {\n\t\t\t\t// scale config merging is complex. Add our own function here for that\n\t\t\t\ttarget[key] = mergeScaleConfig(tval, sval);\n\t\t\t} else if (key === 'scale') {\n\t\t\t\t// used in polar area & radar charts since there is only one scale\n\t\t\t\ttarget[key] = helpers$1.merge(tval, [core_scaleService.getScaleDefaults(sval.type), sval]);\n\t\t\t} else {\n\t\t\t\thelpers$1._merger(key, target, source, options);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "3c99845ce4d621c27598b7e579b930f6", "score": "0.5167181", "text": "function mergeConfig(/* config objects ... */) {\n\treturn helpers$1.merge({}, [].slice.call(arguments), {\n\t\tmerger: function(key, target, source, options) {\n\t\t\tvar tval = target[key] || {};\n\t\t\tvar sval = source[key];\n\n\t\t\tif (key === 'scales') {\n\t\t\t\t// scale config merging is complex. Add our own function here for that\n\t\t\t\ttarget[key] = mergeScaleConfig(tval, sval);\n\t\t\t} else if (key === 'scale') {\n\t\t\t\t// used in polar area & radar charts since there is only one scale\n\t\t\t\ttarget[key] = helpers$1.merge(tval, [core_scaleService.getScaleDefaults(sval.type), sval]);\n\t\t\t} else {\n\t\t\t\thelpers$1._merger(key, target, source, options);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "3c99845ce4d621c27598b7e579b930f6", "score": "0.5167181", "text": "function mergeConfig(/* config objects ... */) {\n\treturn helpers$1.merge({}, [].slice.call(arguments), {\n\t\tmerger: function(key, target, source, options) {\n\t\t\tvar tval = target[key] || {};\n\t\t\tvar sval = source[key];\n\n\t\t\tif (key === 'scales') {\n\t\t\t\t// scale config merging is complex. Add our own function here for that\n\t\t\t\ttarget[key] = mergeScaleConfig(tval, sval);\n\t\t\t} else if (key === 'scale') {\n\t\t\t\t// used in polar area & radar charts since there is only one scale\n\t\t\t\ttarget[key] = helpers$1.merge(tval, [core_scaleService.getScaleDefaults(sval.type), sval]);\n\t\t\t} else {\n\t\t\t\thelpers$1._merger(key, target, source, options);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "3c99845ce4d621c27598b7e579b930f6", "score": "0.5167181", "text": "function mergeConfig(/* config objects ... */) {\n\treturn helpers$1.merge({}, [].slice.call(arguments), {\n\t\tmerger: function(key, target, source, options) {\n\t\t\tvar tval = target[key] || {};\n\t\t\tvar sval = source[key];\n\n\t\t\tif (key === 'scales') {\n\t\t\t\t// scale config merging is complex. Add our own function here for that\n\t\t\t\ttarget[key] = mergeScaleConfig(tval, sval);\n\t\t\t} else if (key === 'scale') {\n\t\t\t\t// used in polar area & radar charts since there is only one scale\n\t\t\t\ttarget[key] = helpers$1.merge(tval, [core_scaleService.getScaleDefaults(sval.type), sval]);\n\t\t\t} else {\n\t\t\t\thelpers$1._merger(key, target, source, options);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "3c99845ce4d621c27598b7e579b930f6", "score": "0.5167181", "text": "function mergeConfig(/* config objects ... */) {\n\treturn helpers$1.merge({}, [].slice.call(arguments), {\n\t\tmerger: function(key, target, source, options) {\n\t\t\tvar tval = target[key] || {};\n\t\t\tvar sval = source[key];\n\n\t\t\tif (key === 'scales') {\n\t\t\t\t// scale config merging is complex. Add our own function here for that\n\t\t\t\ttarget[key] = mergeScaleConfig(tval, sval);\n\t\t\t} else if (key === 'scale') {\n\t\t\t\t// used in polar area & radar charts since there is only one scale\n\t\t\t\ttarget[key] = helpers$1.merge(tval, [core_scaleService.getScaleDefaults(sval.type), sval]);\n\t\t\t} else {\n\t\t\t\thelpers$1._merger(key, target, source, options);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "3c99845ce4d621c27598b7e579b930f6", "score": "0.5167181", "text": "function mergeConfig(/* config objects ... */) {\n\treturn helpers$1.merge({}, [].slice.call(arguments), {\n\t\tmerger: function(key, target, source, options) {\n\t\t\tvar tval = target[key] || {};\n\t\t\tvar sval = source[key];\n\n\t\t\tif (key === 'scales') {\n\t\t\t\t// scale config merging is complex. Add our own function here for that\n\t\t\t\ttarget[key] = mergeScaleConfig(tval, sval);\n\t\t\t} else if (key === 'scale') {\n\t\t\t\t// used in polar area & radar charts since there is only one scale\n\t\t\t\ttarget[key] = helpers$1.merge(tval, [core_scaleService.getScaleDefaults(sval.type), sval]);\n\t\t\t} else {\n\t\t\t\thelpers$1._merger(key, target, source, options);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "3c99845ce4d621c27598b7e579b930f6", "score": "0.5167181", "text": "function mergeConfig(/* config objects ... */) {\n\treturn helpers$1.merge({}, [].slice.call(arguments), {\n\t\tmerger: function(key, target, source, options) {\n\t\t\tvar tval = target[key] || {};\n\t\t\tvar sval = source[key];\n\n\t\t\tif (key === 'scales') {\n\t\t\t\t// scale config merging is complex. Add our own function here for that\n\t\t\t\ttarget[key] = mergeScaleConfig(tval, sval);\n\t\t\t} else if (key === 'scale') {\n\t\t\t\t// used in polar area & radar charts since there is only one scale\n\t\t\t\ttarget[key] = helpers$1.merge(tval, [core_scaleService.getScaleDefaults(sval.type), sval]);\n\t\t\t} else {\n\t\t\t\thelpers$1._merger(key, target, source, options);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "3c99845ce4d621c27598b7e579b930f6", "score": "0.5167181", "text": "function mergeConfig(/* config objects ... */) {\n\treturn helpers$1.merge({}, [].slice.call(arguments), {\n\t\tmerger: function(key, target, source, options) {\n\t\t\tvar tval = target[key] || {};\n\t\t\tvar sval = source[key];\n\n\t\t\tif (key === 'scales') {\n\t\t\t\t// scale config merging is complex. Add our own function here for that\n\t\t\t\ttarget[key] = mergeScaleConfig(tval, sval);\n\t\t\t} else if (key === 'scale') {\n\t\t\t\t// used in polar area & radar charts since there is only one scale\n\t\t\t\ttarget[key] = helpers$1.merge(tval, [core_scaleService.getScaleDefaults(sval.type), sval]);\n\t\t\t} else {\n\t\t\t\thelpers$1._merger(key, target, source, options);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "ba25b5ae0fff3fb93a6de16a4bd93573", "score": "0.51664543", "text": "function _merge_opts(defaults, options) {\n var out = {};\n\n // shallow-copy defaults so we don't mutate the input objects (bad)\n for (var key in defaults) {\n out[key] = defaults[key];\n }\n\n for (key in options) {\n if (defaults.hasOwnProperty(key)) {\n out[key] = options[key]; // override defaults with options\n } else {\n throw new Error(key+\" is not a configuration option for Trianglify. Check your spelling?\");\n }\n }\n return out;\n }", "title": "" }, { "docid": "63e8c3f92bca0b8c8086f8c886443f78", "score": "0.51631457", "text": "function setOptions() {\n\t\tvar key, value;\n\t\tif (arguments.length === 1) {\n\t\t\tvar args = arguments[0];\n\t\t\tvar defaults = {\n\t\t\t\tscrape: '', //if url will be used as request with query, if function will be executed with dt object\n\t\t\t\tdt: {\n\t\t\t\t\tori: '',\n\t\t\t\t\tdst: '',\n\t\t\t\t\tflightCode: '',\n\t\t\t\t\tclassCode: '',\n\t\t\t\t\tpassengersNum: 1,\n\t\t\t\t},\n\t\t\t\tairline: '',\n\t\t\t\tindex: 'pluto',\n\t\t\t\ttype: 'price',\n\t\t\t\tparallel: false,\n\t\t\t\tdb: db,\n\t\t\t};\n\t\t\tvar options = _.deepExtend(defaults, args);\n\t\t\tfor (key in defaults) {\n\t\t\t\tvalue = options[key];\n\t\t\t\tthis[key] = value;\n\t\t\t\tif (typeof this[key] === 'string')\n\t\t\t\t\tthis[key] = this[key].toLowerCase();\n\t\t\t}\n\t\t} else {\n\t\t\tkey = arguments[0];\n\t\t\tvalue = arguments[1];\n\t\t\tthis[key] = value;\n\t\t}\n\t\treturn this;\n\t}", "title": "" }, { "docid": "c0e87fd12e2ebded8942d6439609dbc6", "score": "0.5156225", "text": "get connectionLogOptionsInput() {\n return this._connectionLogOptions;\n }", "title": "" }, { "docid": "0a29982dedbc88967c0fb1da5d0d987a", "score": "0.5156033", "text": "function mergeOptions(parent,child,vm){{checkComponents(child);}if(typeof child==='function'){child=child.options;}normalizeProps(child,vm);normalizeInject(child,vm);normalizeDirectives(child);// Apply extends and mixins on the child options,\n// but only if it is a raw options object that isn't\n// the result of another mergeOptions call.\n// Only merged options has the _base property.\nif(!child._base){if(child[\"extends\"]){parent=mergeOptions(parent,child[\"extends\"],vm);}if(child.mixins){for(var i=0,l=child.mixins.length;i<l;i++){parent=mergeOptions(parent,child.mixins[i],vm);}}}var options={};var key;for(key in parent){mergeField(key);}for(key in child){if(!hasOwn(parent,key)){mergeField(key);}}function mergeField(key){var strat=strats[key]||defaultStrat;options[key]=strat(parent[key],child[key],vm,key);}return options;}", "title": "" }, { "docid": "3627d65bcad66923d9aa7d5962a9dd0a", "score": "0.514185", "text": "mergeCredential(options, credential) {\n let mergedOptions = options.override(credential);\n return mergedOptions;\n }", "title": "" }, { "docid": "eb72de9034ab444517be8e71bb8ab514", "score": "0.51372707", "text": "function mergeOptions(parent,child,vm){{checkComponents(child);}if(typeof child==='function'){child=child.options;}normalizeProps(child,vm);normalizeInject(child,vm);normalizeDirectives(child);// Apply extends and mixins on the child options,\n// but only if it is a raw options object that isn't\n// the result of another mergeOptions call.\n// Only merged options has the _base property.\nif(!child._base){if(child.extends){parent=mergeOptions(parent,child.extends,vm);}if(child.mixins){for(var i=0,l=child.mixins.length;i<l;i++){parent=mergeOptions(parent,child.mixins[i],vm);}}}var options={};var key;for(key in parent){mergeField(key);}for(key in child){if(!hasOwn(parent,key)){mergeField(key);}}function mergeField(key){var strat=strats[key]||defaultStrat;options[key]=strat(parent[key],child[key],vm,key);}return options;}", "title": "" }, { "docid": "c5bb1261b2c0db64fcee419d1213f4c0", "score": "0.5086996", "text": "function merge(options, overrides) {\n return extend((extend({}, options)), overrides);\n}", "title": "" }, { "docid": "98e084bd70f39124c1fc982b130c46bd", "score": "0.50708073", "text": "function mergeOptions(parent, child, vm) {\n if (process.env.NODE_ENV !== 'production') {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child);\n\n // Apply extends and mixins on the child options,\n // but only if it is a raw options object that isn't\n // the result of another mergeOptions call.\n // Only merged options has the _base property.\n if (!child._base) {\n if (child.extends) {\n parent = mergeOptions(parent, child.extends, vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n }\n\n var options = {};\n var key;\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField(key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options;\n}", "title": "" }, { "docid": "f320d6d5086459da5794b089817e8c07", "score": "0.5070405", "text": "function mergeConfig(/* config objects ... */) {\n\treturn helpers$1.merge(Object.create(null), [].slice.call(arguments), {\n\t\tmerger: function(key, target, source, options) {\n\t\t\tvar tval = target[key] || Object.create(null);\n\t\t\tvar sval = source[key];\n\n\t\t\tif (key === 'scales') {\n\t\t\t\t// scale config merging is complex. Add our own function here for that\n\t\t\t\ttarget[key] = mergeScaleConfig(tval, sval);\n\t\t\t} else if (key === 'scale') {\n\t\t\t\t// used in polar area & radar charts since there is only one scale\n\t\t\t\ttarget[key] = helpers$1.merge(tval, [core_scaleService.getScaleDefaults(sval.type), sval]);\n\t\t\t} else {\n\t\t\t\thelpers$1._merger(key, target, source, options);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" } ]
af96df1cebb8d00aadcfbb54380be6c4
function to make imaages //
[ { "docid": "8be576b0b44757fc6dfbcd4873837901", "score": "0.0", "text": "function imageSnap() {\n background(255);\n //image randoms\n var rand1 = ~~random(35);\n var rand2 = ~~random(35);\n var rand3 = ~~random(35);\n\n //display images\n tint(255, ~~random(100, 200)); // Apply transparency without changing color\n image(img[rand3], (width / 2) - 300, (height / 2), imgW, imgH);\n tint(255, ~~random(100, 200)); // Apply transparency without changing color\n image(img[rand2], width / 2, (height / 2) - 10, imgW, imgH);\n tint(255, ~~random(100, 200)); // Apply transparency without changing color\n image(img[rand1], (width / 2) + 300, (height / 2) + 30, imgW, imgH);\n\n}", "title": "" } ]
[ { "docid": "0ce72fe1b1033b820465d0533b0260ca", "score": "0.5828598", "text": "function Ai(){}", "title": "" }, { "docid": "ba70d2c6303a112f9c17804d98fc2eab", "score": "0.58011764", "text": "function IpadicFormatter() {\n}", "title": "" }, { "docid": "ba70d2c6303a112f9c17804d98fc2eab", "score": "0.58011764", "text": "function IpadicFormatter() {\n}", "title": "" }, { "docid": "d58373e28f292150682eb34f8d058060", "score": "0.5754657", "text": "function piestiEilute( ilgis ) {\n var eilute = \"-\";\n for (var i = 0; i < ilgis; i++) {\n eilute = eilute + \"-\"; // arba eilute += \"-\";\n }\n console.log( eilute );\n}", "title": "" }, { "docid": "ecbf91e4896fd5b64db55642b924786d", "score": "0.57441705", "text": "function ilP8cu7JYzamTa6vdby6Sw() {}", "title": "" }, { "docid": "e6201f3602efa9fc619fac148cd36855", "score": "0.5643263", "text": "function numberToImg(i) {\n\t\tif (i == 1) { return dice1 }\n\t\telse if (i == 2) { return dice2 }\n\t\telse if (i == 3) { return dice3 }\n\t\telse if (i == 4) { return dice4 }\n\t\telse if (i == 5) { return dice5 }\n\t\telse { return dice6 }\n\t}", "title": "" }, { "docid": "beee3dfb777bd3b2f2d129fa2d9a0c2c", "score": "0.56356835", "text": "function ProcessImn(){ }", "title": "" }, { "docid": "eb1ecd4fee3a5f8bd6d6750602e4df4b", "score": "0.5613738", "text": "function Yia(){this.f=0;this.n=[];this.g=[];this.H=this.R=this.a=this.L=this.Y=this.r=0;this.oa=[]}", "title": "" }, { "docid": "8ad422adba498258c61ecd82f4c1c94e", "score": "0.55907506", "text": "function getAtb(str : String , pin : int , type : SlotType , pfType : ProfessionType , iv : InventoryItem , id : int , intTen : int){\n\tvar a1 : int = parseInt(str.Substring(0,1)); \n\tvar a2 : int = parseInt(str.Substring(1,1)); \n\tvar useiType : abtType; \n\tvar ivalue : int;\n//\t//print(\"fen mu == \" + fenmu);\n\tvar fenmu : int = Mathf.Clamp(parseInt(iv.itemID.Substring(8,1)) + parseInt(iv.itemID.Substring(10,1)) + parseInt(iv.itemID.Substring(12,1)) , 1,9999);\n\tvar BuildInt : int;\n\tBuildInt = parseInt(iv.itemBuild) * a2 / fenmu;\n\tswitch(a1){\n\t\tcase 1: ivalue += pin * a2 / intTen * 1 * itemXiuZheng[type - 1] ; useiType = a1; break;\n\t\tcase 2: ivalue += pin * a2 / intTen / 1 * itemXiuZheng[type - 1]; useiType = a1;break;\n\t\tcase 3:ivalue += pin * a2 / intTen / 1 * itemXiuZheng[type - 1]; useiType = a1;break;\n\t\tcase 4: ivalue += Mathf.CeilToInt(pin * a2 / intTen * 0.25) * itemXiuZheng[type - 1]; BuildInt = Mathf.CeilToInt( BuildInt* 0.25 ); useiType = a1;break;\n\t\tcase 5: ivalue+= pin * a2 / intTen * 1 * itemXiuZheng[type - 1]; useiType = a1;break;\n\t\tcase 6: ivalue += Mathf.CeilToInt( pin * a2 / intTen * 0.5) * itemXiuZheng[type - 1]; BuildInt = Mathf.CeilToInt( BuildInt * 0.5) ; useiType = a1;break;\n\t\tcase 7: ivalue+= pin * a2 / intTen / 1 * itemXiuZheng[type - 1]; useiType = a1;break;\n\t\tcase 8: \n\t\t\tif(pfType == ProfessionType.Soldier){\n\t\t\t\tivalue += pin * a2 / intTen / 1 * itemXiuZheng[type - 1];\n\t\t\t\tuseiType = abtType.liliang;\n\t\t\t\t}else\n\t\t\tif(pfType == ProfessionType.Robber){\n\t\t\t\tivalue += pin * a2 / intTen / 1 * itemXiuZheng[type - 1]; \n\t\t\t\tuseiType = abtType.minjie;\n\t\t\t\t}else\n\t\t\tif(pfType == ProfessionType.Master){\n\t\t\t\tivalue += pin * a2 / intTen / 1 * itemXiuZheng[type - 1];\n\t\t\t\tuseiType = abtType.zhili;\n\t\t\t\t}\n\t\t\tbreak;\n\t\tcase 9: \n\t\t\tif(pfType == ProfessionType.Soldier){\n\t\t\t\tivalue += pin * a2 / intTen / 1 * itemXiuZheng[type - 1]; \n\t\t\t\tuseiType = abtType.minjie;\n\t\t\t\t}else\n\t\t\tif(pfType == ProfessionType.Robber){\n\t\t\t\tivalue+= pin * a2 / intTen / 1 * itemXiuZheng[type - 1]; \n\t\t\t\tuseiType = abtType.liliang;\n\t\t\t\t}else\n\t\t\tif(pfType == ProfessionType.Master){\n\t\t\t\tivalue += pin * a2 / intTen / 1 * itemXiuZheng[type - 1]; \n\t\t\t\tuseiType = abtType.minjie;\n\t\t\t\t}\n\t\t\tbreak;\n\t} \n\tvar qua = iv.itemQuality; \n\tvar AtbNums : int; \n\tvar fenmu2 : int = 1; \n\t\n\tif(qua >= 6){\n\t\tqua -= 4;\n\t}\n\tswitch(qua){\n\t\tcase 1: AtbNums = 0; break;\n\t\tcase 2: \n\t\t\tif(id <= 1){\n\t\t\t\tAtbNums = 1;\n\t\t\t}else{\n\t\t\t\tAtbNums = 0;\n\t\t\t}\n\t\t\tfenmu2 = parseInt(iv.itemID.Substring(8,1));\n\t\t\tbreak;\n\t\tcase 3: \n\t\t\tif(id <= 2){\n\t\t\t\tAtbNums = 1;\n\t\t\t}else{\n\t\t\t\tAtbNums = 0;\n\t\t\t}\n\t\t\tfenmu2 = parseInt(iv.itemID.Substring(8,1)) + parseInt(iv.itemID.Substring(10,1));\n\t\t\tbreak;\n\t\tcase 4: \n\t\t\tAtbNums = 1; \n\t\t\tfenmu2 = parseInt(iv.itemID.Substring(8,1)) + parseInt(iv.itemID.Substring(10,1)) + parseInt(iv.itemID.Substring(12,1));\n\t\t\tbreak;\n\t\tcase 5: \n\t\t\tAtbNums = 1; \n\t\t\tfenmu2 = parseInt(iv.itemID.Substring(8,1)) + parseInt(iv.itemID.Substring(10,1)) + parseInt(iv.itemID.Substring(12,1));\n\t\t\tbreak;\n\t}\n//\t\t\t\t//print(pin + \"-\" +a2+\"-\"+itemXiuZheng[type - 1]);\n\tswitch(id){\n\t\tcase 1: iv.ATabt1 = new itemABT(); iv.ATabt1.iStr = AbtTypeStr; iv.ATabt1.iType = useiType; iv.ATabt1.iValue = (ivalue + parseInt(iv.itemBuild) * parseInt(iv.itemID.Substring(8,1)) / fenmu2)*AtbNums; break;\n\t\tcase 2: iv.ATabt2 = new itemABT(); iv.ATabt2.iStr = AbtTypeStr; iv.ATabt2.iType = useiType; iv.ATabt2.iValue = (ivalue + parseInt(iv.itemBuild) * parseInt(iv.itemID.Substring(10,1)) / fenmu2)*AtbNums; break;\n\t\tcase 3: iv.ATabt3 = new itemABT(); iv.ATabt3.iStr = AbtTypeStr; iv.ATabt3.iType = useiType; iv.ATabt3.iValue = (ivalue + parseInt(iv.itemBuild) * parseInt(iv.itemID.Substring(12,1)) / fenmu2)*AtbNums; break;\n\t}\n\treturn iv;\n}", "title": "" }, { "docid": "d989ac81af2894e415fcc490ec51d5be", "score": "0.55903417", "text": "function numberToBigImg(i) {\n\t\tif (i == 1) { return dice01 }\n\t\telse if (i == 2) { return dice02 }\n\t\telse if (i == 3) { return dice03 }\n\t\telse if (i == 4) { return dice04 }\n\t\telse if (i == 5) { return dice05 }\n\t\telse { return dice06 }\n\t}", "title": "" }, { "docid": "7ad248aa650608db6a91a71401ad8da8", "score": "0.55563587", "text": "function Interfaz() {}", "title": "" }, { "docid": "2bed03d8e58b7ceb764cd688e85c70ce", "score": "0.5509889", "text": "function generate_naoh(){\r\n generate_na(260,150);\r\n generate_chemical_bound(320, 130, 360, 130);\r\n generate_o(400,150);\r\n generate_chemical_bound(440, 130, 480, 130);\r\n generate_h(520,150);\r\n}", "title": "" }, { "docid": "201d0cdc66723b8bd64f51c890f3add4", "score": "0.5499529", "text": "function aleatoria(min, maxi)\n{ /* las variables definidas dentro de llaves sólo viven dentro de las mismas\n una variable declarada de ntro de llaves llamada fuera de ellas no existe*/\n var resultado;\n\n /*función matemática para obtener un número ramdom en cierto rango*/\n resultado =Math.floor( Math.random() * (maxi - min + 1)) + min;\n\n\n /*palabra reservada para devolver \"algo\"*/\n return resultado;\n}", "title": "" }, { "docid": "9ced2881d3f0668be677d605464c8226", "score": "0.54884225", "text": "function imc(peso, altura){\n\treturn peso / (altura * altura);\n}", "title": "" }, { "docid": "d763e293e83b602a3934f44bacab21bd", "score": "0.5483922", "text": "function encodeAbacus() {\r\n let heavenWork = '';\r\n let earthWork = '';\r\n for (i = 0; i < digitsoroban; i++) {\r\n common = 'hb' + (\"00\" + i).slice(-2);\r\n if (heavenBeads == 2) {\r\n if (document.images[common+'0'].src.indexOf(imgfilenameU) >= 0) {\r\n heavenWork = heavenWork + 'X';\r\n } else if (document.images[common+'0'].src.indexOf(imgfilename0) >= 0) {\r\n heavenWork = heavenWork + 'W';\r\n } else if (document.images[common+'1'].src.indexOf(imgfilename0) >= 0) {\r\n heavenWork = heavenWork + 'V';\r\n } else {\r\n heavenWork = heavenWork + 'u';\r\n }\r\n } else {\r\n if (document.images[common+'0'].src.indexOf(imgfilename0) >= 0) {\r\n heavenWork = heavenWork + 'V';\r\n } else {\r\n heavenWork = heavenWork + 'u';\r\n }\r\n }\r\n common = 'eb' + (\"00\" + i).slice(-2);\r\n j = 0;\r\n while (document.images[common+j].src.indexOf(imgfilename1) >= 0) {\r\n j++;\r\n }\r\n earthWork = earthWork + j;\r\n }\r\n return heavenWork+':'+earthWork;\r\n}", "title": "" }, { "docid": "0b18146c99249a5d0f60e6e192935786", "score": "0.54750204", "text": "function imc(peso, altura) {\n const imc = peso / (altura ** 2);\n console.log(imc);\n}", "title": "" }, { "docid": "a5bc0e190000b78a5d28fad7c9d594b1", "score": "0.5470863", "text": "function generate_al2o3(){\r\n generate_al(235,180);\r\n generate_chemical_bound(160, 100, 205, 140);\r\n generate_chemical_bound(150, 110, 195, 150);\r\n generate_chemical_bound(275, 155, 320, 105);\r\n \r\n generate_al(465,180);\r\n generate_chemical_bound(375, 105, 420, 155);\r\n generate_chemical_bound(515, 150, 560, 110);\r\n generate_chemical_bound(505, 140, 550, 100);\r\n\r\n generate_o(130,100);\r\n generate_o(350,100);\r\n generate_o(580,100);\r\n}", "title": "" }, { "docid": "084644820d38bcf6d6e174106ff066cb", "score": "0.5426792", "text": "function alienCreate(index){\n //'alien'\n let points = 30, className = 'alien3'\n for(let i = 0; i<alien*alienRow; i++) {\n const aliens = new Alien(index , points, width, className)\n div[aliens.alienIndex].classList.add(className)\n alienArray.push(aliens)\n index++\n if((i+1) % alien ===0)index = (index+width)-(alien)\n if((i+1)%(alien*Math.floor(alienRow/2))===0){\n points -= 10\n className = 'alien' + (parseInt(className[className.length-1])-1)\n }\n }\n }", "title": "" }, { "docid": "bc6743dbcbe1b840d2205002e2a9d18d", "score": "0.54252577", "text": "function classificaIMC(imc) {\n if (imc <= 16.9) {\n return 'Muito abaixo do peso'\n }\n else if (imc <= 18.4) {\n return 'Abaixo do peso'\n }\n else if (imc <= 24.9) {\n return 'Peso normal'\n }\n else if (imc <= 29.9) {\n return 'Acima do peso'\n }\n else if (imc <= 34.9) {\n return 'Obesidade Grau I'\n }\n else if (imc <= 40) {\n return 'Obesidade Grau II'\n }\n else {\n return 'Obesidade Grau III'\n }\n}", "title": "" }, { "docid": "58e17abadc414430c1942e3f48b4e4bc", "score": "0.5425046", "text": "function _i(){}", "title": "" }, { "docid": "e9a6454f6b8a8618205248b06eee3819", "score": "0.54240066", "text": "function comportamiento_interfaz(){}", "title": "" }, { "docid": "2ac0a1a01e1cd069f427b7289aa0d4f7", "score": "0.5422688", "text": "function imc(peso, altura){\n const imc = peso / (altura ** 2);\n return imc;\n}", "title": "" }, { "docid": "9540ff9dc3f0ed324ead1878f522e7dc", "score": "0.54114467", "text": "function updateValues(i) {\n var p = pivot(all_words[i]);\n document.getElementById(\"spritz_result\").innerHTML = p;\n }", "title": "" }, { "docid": "4a3bdcfeb633cc2e352f95502dd2a435", "score": "0.53836775", "text": "function EOzMCEG2kDyWbSPJIICEpA(){}", "title": "" }, { "docid": "dc927e6323e5d15994f30391e6cb16c4", "score": "0.5378404", "text": "function save1(pv,int,n){\n\t\tfor (var year=1;year<=n;year++){\n\t\t\tpv*=(1+int);\n\t\t}\n\t\treturn pv;\n\t}", "title": "" }, { "docid": "db24b3cf716f108b908135b83ed9d86f", "score": "0.5373867", "text": "function coco2M(){\r\n\tcreaNoiCoco2(18*grille,7*grille);\r\n}", "title": "" }, { "docid": "551937fe168191689df836a0b209124b", "score": "0.5366716", "text": "function efetuarCalculoIMC(peso, altura){ /// ??? ///\n let imc = peso / (altura * altura); /// ??? ///\n\n return imc; /// ??? ///\n} /// ??? ///", "title": "" }, { "docid": "a50302dba602669b846804da04cc8aad", "score": "0.5364624", "text": "function nw6PUrLXLjqiWJDOBAtITA() {}", "title": "" }, { "docid": "dd0ba3b5675c4f7de6568ec6015d5973", "score": "0.5341659", "text": "function alien() {\n var alienimg = [];\n alienimg[0] = \"disecting\";\n alienimg[1] = \"flying\";\n alienimg[2] = \"abducting\";\n document.getElementById(\"ufo\").innerHTML = \"Watch out! There have been aliens in UFOs \" + alienimg[1] + \"!\";\n}", "title": "" }, { "docid": "79b5376dac084cc92ca3749fe8a7c80c", "score": "0.53415215", "text": "function calcAddPixForExpSum(){\n\t\n}", "title": "" }, { "docid": "30fde6265bceaf76bae0729795dc48d7", "score": "0.533223", "text": "function toJalaali(d, i, a) { return d2j(g2d(d, i, a)) }", "title": "" }, { "docid": "95c32e2b8637b37c5879dd84d1635cae", "score": "0.5323114", "text": "function Oi(){}", "title": "" }, { "docid": "5f2f1b778b2529c744a32b3d774ccf7e", "score": "0.5311845", "text": "function Ii(t,e){for(var n in e)t[n]=e[n];return t}", "title": "" }, { "docid": "5f2f1b778b2529c744a32b3d774ccf7e", "score": "0.5311845", "text": "function Ii(t,e){for(var n in e)t[n]=e[n];return t}", "title": "" }, { "docid": "3fc6b351946823b2dcea26b748b20b8e", "score": "0.5291222", "text": "function evaluate_altezze_livelli(altezza, livelli){\r\n\t\tvar AltezzeLivelli = {};\r\n\t\tvar interval = altezza/livelli;\r\n\t\tfor(var n = 1; n<=livelli; n++){\r\n\t\t\tAltezzeLivelli[n.toString()] = interval*n -5;\r\n\t\t}\r\n\t\treturn AltezzeLivelli;\r\n\t}", "title": "" }, { "docid": "fc0f06e739c039e6b2dd19519a3cea50", "score": "0.5287218", "text": "function next_generation() {\n a1a1 = round_to_n_decimals(p * p, 2);\n a2a2 = round_to_n_decimals(q * q, 2);\n a1a2 = 2 * round_to_n_decimals(p * q, 2);\n}", "title": "" }, { "docid": "296f3cc0b94069a87be42ea67f1e47db", "score": "0.5276479", "text": "function computeAvancement(matiere) {\n\n}", "title": "" }, { "docid": "52ffec7754618d0c8a831b9d3ce255be", "score": "0.52736616", "text": "function getNumerals(array) {\n var returnString = \"\";\n for (i = 0; i < array.length; i++) {\n if (array[i] >= 1000) {\n for (t = 0; t < array[i] % 5000 / 1000; t++) {\n returnString = returnString + \"M\";\n }\n } else if (array[i] >= 100) {\n if (array[i] === 900) {\n returnString = returnString + \"CM\";\n } else if (array[i] === 400) {\n returnString = returnString + \"CD\";\n } else {\n if (array[i] >= 500) {\n returnString = returnString + \"D\";\n }\n for (h = 0; h < array[i] % 500 / 100; h++) {\n returnString = returnString + \"C\";\n }\n }\n } else if (array[i] >= 10) {\n if (array[i] === 90) {\n returnString = returnString + \"XC\";\n } else if (array[i] === 40) {\n returnString = returnString + \"XL\";\n } else {\n if (array[i] >= 50) {\n returnString = returnString + \"L\";\n }\n for (k = 0; k < array[i] % 50 / 10; k++) {\n returnString = returnString + \"X\";\n }\n }\n } else if (array[i] >=1) {\n if (array[i] === 9) {\n returnString = returnString + \"IX\";\n } else if (array[i] === 4) {\n returnString = returnString + \"IV\";\n } else {\n if (array[i] >= 5) {\n returnString = returnString + \"V\";\n }\n for (j = 0; j < array[i] % 5; j++) {\n returnString = returnString + \"I\";\n }\n }\n }\n }\n return returnString;\n}", "title": "" }, { "docid": "cc1bac5073ba4cf3f1e4496493875ba0", "score": "0.5270856", "text": "neighisimple( i ){\n\t\t\tlet p = this.i2p(i);\n\t\t\tlet xx = [];\n\t\t\tfor( let d = 0 ; d <= 1 ; d ++ ){\n\t\t\t\tif( p[d] == 0 ){\n\t\t\t\t\tif( this.torus[d] ){\n\t\t\t\t\t\txx[d] = [p[d],this.extents[d]-1,p[d]+1];\n\t\t\t\t\t} else {\n\t\t\t\t\t\txx[d] = [p[d],p[d]+1];\n\t\t\t\t\t}\n\t\t\t\t} else if( p[d] == this.extents[d]-1 ){\n\t\t\t\t\tif( this.torus[d] ){\n\t\t\t\t\t\txx[d] = [p[d],p[d]-1,0];\n\t\t\t\t\t} else {\n\t\t\t\t\t\txx[d] = [p[d],p[d]-1];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\txx[d] = [p[d],p[d]-1,p[d]+1];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet r = [], first=true;\n\t\t\tfor( let x of xx[0] ){\n\t\t\t\tfor( let y of xx[1] ){\n\t\t\t\t\tif( first ){\n\t\t\t\t\t\tfirst = false; \n\t\t\t\t\t} else {\n\t\t\t\t\t\tr.push( this.p2i( [x,y] ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn r\n\t\t}", "title": "" }, { "docid": "9b2bf2e5b360975fa890aab174089302", "score": "0.526827", "text": "function generate_2d_al2o3(){\r\n generate_2d_o(170,100);\r\n generate_2d_o(350,100);\r\n generate_2d_o(530,100);\r\n \r\n generate_2d_al(260,160);\r\n generate_2d_al(440,160);\r\n}", "title": "" }, { "docid": "cc756c893bc4be1c481b4478deaefac7", "score": "0.52681255", "text": "function u2a(){this.F=0;this.J=[];this.H=[];this.R=this.V=this.D=this.O=this.$=this.N=0;this.aa=[]}", "title": "" }, { "docid": "9cb6fa29bf160ff7ebb58224b337af5b", "score": "0.52679795", "text": "function humanized(number){\n \n}", "title": "" }, { "docid": "785d9487e26ed04e974af1afc7524aa9", "score": "0.525763", "text": "function puntuacion(expre) {\n\n\tvar newexpre=\"\";\n\tif(expre.indexOf(\"I0\")){newexpre=\"I0\";}\n\tif(expre.indexOf(\"11\")){newexpre=\"I1\";}\n\tif(expre.indexOf(\"I2\")){newexpre=\"I2\";}\n\tif(expre.indexOf(\"I3\")){newexpre=\"I3\";}\n\n\tswitch (newexpre) {\n\t\tcase \"I0\":\n\t\t\tpuntos=puntos+30;\n\t\t document.getElementById(\"score-text\").innerHTML=puntos;\n\t \t\tbreak;\n\t\tcase \"I1\":\n\t\t\tpuntos=puntos+40;\n\t\t\tdocument.getElementById(\"score-text\").innerHTML=puntos;\n\t\t\tbreak;\n\t\tcase \"I2\":\n\t\t\tpuntos=puntos+50;\n\t\t\tdocument.getElementById(\"score-text\").innerHTML=puntos;\n\t\t\tbreak;\n\t\tcase \"I4\":\n\t\t\tpuntos=puntos+60\n \t\t\tdocument.getElementById(\"score-text\").innerHTML=puntos;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n}", "title": "" }, { "docid": "feac585ae1f5512f0665ea82cc6c5980", "score": "0.5257497", "text": "function prep_image() {\n pic_i = 400;\n xfact = pic_i / 400;\n\n return xfact;\n}", "title": "" }, { "docid": "31ab6ce569056bb7a83eef099233740c", "score": "0.52394074", "text": "function remiseazero() {\n // Dimitri : Mettre le vaisseau au milieu\n Vaisseau.x = Math.ceil(canvas.width / 2);\n Vaisseau.y = canvas.height - 50;\n // Vie\n vie = 3;\n /*\n * @author Lilian\n * J'ai mis la variable niveau pour etre sur qu'on l'oublie pas!\n */\n niveau = 1;\n /*\n * @author Lilian\n * On remet les aliens a leur place\n */\n Bonus = [];\n CadreAlien.x = 0;\n CadreAlien.y = 0;\n Alien = {\n 1: {x: 0, y: 0, type: 0},\n 2: {x: 75, y: 0, type: 0},\n 3: {x: 150, y: 0, type: 0},\n 4: {x: 225, y: 0, type: 0},\n 5: {x: 300, y: 0, type: 0},\n 6: {x: 375, y: 0, type: 0},\n 7: {x: 450, y: 0, type: 0},\n 8: {x: 525, y: 0, type: 0},\n 9: {x: 0, y: 75, type: 1},\n 10: {x: 75, y: 75, type: 1},\n 11: {x: 150, y: 75, type: 1},\n 12: {x: 225, y: 75, type: 1},\n 13: {x: 300, y: 75, type: 1},\n 14: {x: 375, y: 75, type: 1},\n 15: {x: 450, y: 75, type: 1},\n 16: {x: 525, y: 75, type: 1},\n 17: {x: 0, y: 150, type: 2},\n 18: {x: 75, y: 150, type: 2},\n 19: {x: 150, y: 150, type: 2},\n 20: {x: 225, y: 150, type: 2},\n 21: {x: 300, y: 150, type: 2},\n 22: {x: 375, y: 150, type: 2},\n 23: {x: 450, y: 150, type: 2},\n 24: {x: 525, y: 150, type: 2},\n TailleX: 64,\n TailleY: 32\n };\n score = 0;\n Missile = [];\n derniertir = 0;\n }", "title": "" }, { "docid": "537de19ef060122df9741ab43a2e550e", "score": "0.52298796", "text": "function makeString()\n\t{\t\t\n\t\t//p.a = Number(p.a).toFixed(1) * 1;\n\t\t//p.b = Number(p.b).toFixed(1) * 1;\n\t\t//p.c = Number(p.c).toFixed(1) * 1;\n\t\t\t\t\n\t\tvar _ret = \"\";\n\t\tif(p.a == 0 && p.b == 0)\n\t\t{\n\t\t\t_ret = \"0 = \" + p.c;\n\t\t}\n\t\telse\n\t\t{\t\t\t\n\t\t\tif(p.a != 0 && p.b != 0)\n\t\t\t{\n\t\t\t\tp.a == 1 ? p.a = \" \" : p.a == -1 ? p.a = \" –\" : p.a = p.a;\n\t\t\t\t\n\t\t\t\t_ret = p.a + \"<i>x </i>\";\n\n\t\t\t\t_ret = p.b > 0 && p.b == 1 ? _ret + \" +<i> y </i>\" : p.b > 0 ? _ret +\" + \" +p.b+ \"<i>y </i>\" : p.b == -1 ? _ret + \" – <i>y </i>\" : _ret + \" - \" + Math.abs(p.b) + \"<i>y </i>\";\n\n\t\t\t\t_ret += \" = \"+ p.c \n\t\t\t}\n\t\t\telse if(p.a == 0 && p.b != 0)\n\t\t\t{\n\t\t\t\tp.b == 1 ? p.b = \" \" : p.b == -1 ? p.b = \" – \" : p.b = p.b;\n\t\t\t\t_ret = p.b+\"<i>y </i>\" + \" = \" + p.c;\n\t\t\t}\n\t\t\telse if(p.a != 0 && p.b == 0)\n\t\t\t{\n\t\t\t\tp.a == 1 ? p.a = \" \" : p.a == -1 ? p.a = \" –\" : p.a = p.a;\n\t\t\t\t_ret = p.a+\"<i>x </i>\" + \" = \" + p.c;\n\t\t\t}\n\t\t}\n\t\treturn _ret;\n\t}", "title": "" }, { "docid": "bc89c960f1c6455627b5321a2243a782", "score": "0.5227941", "text": "function go2image(objName, number)\n{\n\tvar obj = eval(objName);\t\n\tif (number >= obj.totImgs){\n\t\tnumber = 0;\n\t}\n\tif (number < 0){\n\t\tnumber = obj.totImgs-1;\n\t}\n\tobj.currImg = number;\n\tdraw_image(objName);\n}", "title": "" }, { "docid": "b2a7251a9017ce09534d9e658b685cc9", "score": "0.52218753", "text": "function ixo719727() { return 'ive'; }", "title": "" }, { "docid": "b6739079441f21994cc5acbf35378cb2", "score": "0.52210504", "text": "function identiteta(){\n var identiteta = [[1,0,0], [0,1,0], [0,0,1]];\n}", "title": "" }, { "docid": "c39b42397ea8a84d0e5d431b1dfff7d3", "score": "0.5217914", "text": "function resultImc(resultImcPerson) {\n console.log(resultImcPerson);\n if (resultImcPerson <= 16.9) {\n return 'Muito abaixo do peso';\n }\n if (resultImcPerson <= 18.4) {\n return 'Abaixo do Peso';\n }\n if (resultImcPerson <= 24.9) {\n return 'Peso Normal';\n }\n if (resultImcPerson <= 29.9) {\n return 'Acima do peso';\n }\n if (resultImcPerson <= 34.9) {\n return 'Obesidade grau 1';\n }\n if (resultImcPerson <= 40) {\n return 'Obesidade grau 2';\n } else {\n return 'Obesidade grau 3';\n }\n}", "title": "" }, { "docid": "671dc1a3682ad53dc5d62913e0c13979", "score": "0.52080154", "text": "function giveimg(type){\n\t\t\tvar idt=0;\n\t\t\t\n\t\t\tswitch (parseInt(type)) {\n\n\t\t\tcase 1: \n\t\t\tcase 2: \n\t\t\tcase 3: \n\t\t\tcase 4: \n\t\t\tcase 5: \n\t\t\tcase 6: \n\t\t\tcase 7: \n\t\t\tcase 8: \n\t\t\tcase 9: \n\t\t\tcase 10: \n\t\t\tcase 11: \n\t\t\tcase 12: \n\t\t\tcase 13: \n\t\t\tcase 14: \n\t\t\tcase 15: \n\t\t\tcase 16: \n\t\t\tcase 17: \n\t\t\tcase 18: \n\t\t\tcase 19: \n\t\t\tcase 20: \n\t\t\tcase 21: \n\t\t\tcase 22: idt=1; break;\n\t\t\tcase 23: \n\t\t\tcase 24: \n\t\t\tcase 25: \n\t\t\tcase 26: \n\t\t\tcase 27: \n\t\t\tcase 28: \n\t\t\tcase 29: \n\t\t\tcase 30: \n\t\t\tcase 31: \n\t\t\tcase 32: \n\t\t\tcase 33: \n\t\t\tcase 34: \n\t\t\tcase 35: \n\t\t\tcase 36: \n\t\t\tcase 37: \n\t\t\tcase 38: \n\t\t\tcase 39: \n\t\t\tcase 40: \n\t\t\tcase 41: \n\t\t\tcase 42: idt=2; break;\n\t\t\tcase 43: \n\t\t\tcase 44: \n\t\t\tcase 45: \n\t\t\tcase 46: \n\t\t\tcase 47: \n\t\t\tcase 48: \n\t\t\tcase 49: \n\t\t\tcase 50: \n\t\t\tcase 51: \n\t\t\tcase 52: \n\t\t\tcase 53: \n\t\t\tcase 54: idt=3; break;\n\t\t\tcase 55: \n\t\t\tcase 56: \n\t\t\tcase 57: \n\t\t\tcase 58: \n\t\t\tcase 59: \n\t\t\tcase 60: \n\t\t\tcase 61: \n\t\t\tcase 62: \n\t\t\tcase 63: \n\t\t\tcase 64: \n\t\t\tcase 65: \n\t\t\tcase 66: \n\t\t\tcase 67: \n\t\t\tcase 68: \n\t\t\tcase 69: \n\t\t\tcase 70: \n\t\t\tcase 71: \n\t\t\tcase 72: \n\t\t\tcase 73: \n\t\t\tcase 74: \n\t\t\tcase 75: \n\t\t\tcase 76: \n\t\t\tcase 77: \n\t\t\tcase 78: \n\t\t\tcase 79: \n\t\t\tcase 80: \n\t\t\tcase 81: \n\t\t\tcase 82: \n\t\t\tcase 83: \n\t\t\tcase 84: idt=4; break;\n\t\t\tcase 85: \n\t\t\tcase 86: \n\t\t\tcase 87: \n\t\t\tcase 88: \n\t\t\tcase 89: \n\t\t\tcase 90: \n\t\t\tcase 91: \n\t\t\tcase 92: \n\t\t\tcase 93: \n\t\t\tcase 94: \n\t\t\tcase 95: \n\t\t\tcase 96: \n\t\t\tcase 97: \n\t\t\tcase 98: \n\t\t\tcase 99: \n\t\t\tcase 100: \n\t\t\tcase 101: idt=5; break;\n\t\t\tcase 102: \n\t\t\tcase 103: \n\t\t\tcase 104: \n\t\t\tcase 105: \n\t\t\tcase 106: \n\t\t\tcase 107: \n\t\t\tcase 108: \n\t\t\tcase 109: \n\t\t\tcase 110: idt=6; break;\n\t\t\tcase 111: \n\t\t\tcase 112: \n\t\t\tcase 113: \n\t\t\tcase 114: \n\t\t\tcase 115: \n\t\t\tcase 116: \n\t\t\tcase 117: \n\t\t\tcase 118: \n\t\t\tcase 119: idt=7; break;\n\t\t\tcase 120: \n\t\t\tcase 121: \n\t\t\tcase 122: \n\t\t\tcase 123: \n\t\t\tcase 124: \n\t\t\tcase 125: \n\t\t\tcase 126: \n\t\t\tcase 127: idt=8; break;\n\t\t\tcase 128: \n\t\t\tcase 129: \n\t\t\tcase 130: \n\t\t\tcase 131: \n\t\t\tcase 132: \n\t\t\tcase 133: \n\t\t\tcase 134: \n\t\t\tcase 135: \n\t\t\tcase 136: \n\t\t\tcase 137: idt=9; break;\n\t\t\tcase 138: \n\t\t\tcase 139: \n\t\t\tcase 140: idt=10; break;\n\n\t\t\t}\n\t\t\n\t\t\treturn L.icon({\n\t\t\t iconUrl: '/img/map/'+idt+'b.png',\n\n\t\t\t iconSize: [40, 40], // size of the icon\n\n\t\t\t // shadowSize: [50, 64], // size of the shadow\n\t\t\t iconAnchor: [20, 20], // point of the icon which will correspond to marker's location\n\t\t\t // shadowAnchor: [4, 62], // the same for the shadow\n\t\t\t popupAnchor: [0, -24] // point from which the popup should open relative to the iconAnchor\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "67ecca1a5956e619ff007896b987e29e", "score": "0.52076286", "text": "function tilenumbersAd(i){\r\n var tile = adversario[i];\r\n var i,j;\r\n for(i=0;i<7;i++)\r\n for(j=0;j<7;j++)\r\n if(tile == '&#'+(127025+i*7+j)+';') return new Array(i,j);\r\n return;\r\n}", "title": "" }, { "docid": "4b46ac110b3097749a851035ba523413", "score": "0.5205696", "text": "function i(e,t,n,i){var o=e+\" \";switch(n){case\"s\":return t||i?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return o+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||i?\"sekundi\":\"sekundah\":e<5?t||i?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return o+=1===e?t?\"minuta\":\"minuto\":2===e?t||i?\"minuti\":\"minutama\":e<5?t||i?\"minute\":\"minutami\":t||i?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return o+=1===e?t?\"ura\":\"uro\":2===e?t||i?\"uri\":\"urama\":e<5?t||i?\"ure\":\"urami\":t||i?\"ur\":\"urami\";case\"d\":return t||i?\"en dan\":\"enim dnem\";case\"dd\":return o+=1===e?t||i?\"dan\":\"dnem\":2===e?t||i?\"dni\":\"dnevoma\":t||i?\"dni\":\"dnevi\";case\"M\":return t||i?\"en mesec\":\"enim mesecem\";case\"MM\":return o+=1===e?t||i?\"mesec\":\"mesecem\":2===e?t||i?\"meseca\":\"mesecema\":e<5?t||i?\"mesece\":\"meseci\":t||i?\"mesecev\":\"meseci\";case\"y\":return t||i?\"eno leto\":\"enim letom\";case\"yy\":return o+=1===e?t||i?\"leto\":\"letom\":2===e?t||i?\"leti\":\"letoma\":e<5?t||i?\"leta\":\"leti\":t||i?\"let\":\"leti\"}}", "title": "" }, { "docid": "f6174a79f89f6ef860fa0bc6e67bcfbd", "score": "0.5204924", "text": "function genInverse(a,m) {\n\tvar b = m;\n \tvar x = 0;\n \tvar y = 1;\n \tvar u = 1;\n \tvar v = 0;\n\n \twhile (a !== 0) {\n \t\tvar q = Math.floor(m / a);\n \t\tvar r = m % a;\n \t\tvar p = x - (u * q);\n \t\tvar n = y - (v * q);\n \t\tm = a;\n \t\ta = r;\n \t\tx = u;\n \t\ty = v;\n \t\tu = p;\n \t\tv = n;\n \t}\n\n \tvar out = [m, x, y];\n \tif (out[1] < 0) {\n \t\tout[1] = b + out[1];\n \t}\n \treturn out[1];\n}", "title": "" }, { "docid": "f6174a79f89f6ef860fa0bc6e67bcfbd", "score": "0.5204924", "text": "function genInverse(a,m) {\n\tvar b = m;\n \tvar x = 0;\n \tvar y = 1;\n \tvar u = 1;\n \tvar v = 0;\n\n \twhile (a !== 0) {\n \t\tvar q = Math.floor(m / a);\n \t\tvar r = m % a;\n \t\tvar p = x - (u * q);\n \t\tvar n = y - (v * q);\n \t\tm = a;\n \t\ta = r;\n \t\tx = u;\n \t\ty = v;\n \t\tu = p;\n \t\tv = n;\n \t}\n\n \tvar out = [m, x, y];\n \tif (out[1] < 0) {\n \t\tout[1] = b + out[1];\n \t}\n \treturn out[1];\n}", "title": "" }, { "docid": "200682d80061d35c7676b59311ce5c51", "score": "0.52037084", "text": "function imc(altura, peso) {\n return peso / (altura * altura);\n }", "title": "" }, { "docid": "3e1261d7b69347d64e0e2024f75217bf", "score": "0.5186434", "text": "NR_24(){\n \n }", "title": "" }, { "docid": "b8e5d477a3646cc7e76cea78f2d604ab", "score": "0.5177412", "text": "function aplicaDescuento(objeto){\n return [objeto] * 0.9\n}", "title": "" }, { "docid": "03e45da2e8d8bf1097109e3746dc70b0", "score": "0.5172615", "text": "function I(d){ return d }", "title": "" }, { "docid": "03e45da2e8d8bf1097109e3746dc70b0", "score": "0.5172615", "text": "function I(d){ return d }", "title": "" }, { "docid": "2e2726b836c2572d16c6ad810ff3210f", "score": "0.5166125", "text": "function ITRITTS(){}", "title": "" }, { "docid": "cc4a87729a09977371933cf55bbee4b4", "score": "0.51617914", "text": "function spoil_manor2()\r\n{\t$('img').each(function()\r\n\t{\tvar ml = null; var src = this.getAttribute('src');\r\n\t\tif (src.indexOf(\"sm2_1\") != -1) ml = '147-173';\r\n\t\telse if (src.indexOf(\"sm2_7\") != -1) ml = '76-100';\r\n\t\telse if (src.indexOf(\"sm2_5\") != -1) ml = '110';\r\n\t\tif(ml) this.setAttribute('title','ML: '+ml);\r\n});\t}", "title": "" }, { "docid": "97e7f9948507aca079c50a1bbeeb2603", "score": "0.5153491", "text": "function urutan(angka){\n var output=''\n for(i=1;i<=angka;i++){\n if((i)%3==0&&(i)%5==0){\n output+='PurwaDhika '\n }else if((i)%3==0){\n output+='Purwa '\n }else if((i)%5==0){\n output+='Dhika '\n }else{\n output+=(i)+' '\n }\n }\n return output\n}", "title": "" }, { "docid": "a22e256cd30e7392fec4abcfdccef7e0", "score": "0.5146732", "text": "function g3ZawgyiConverter(zawgyi_in) {\n\n // output = output.replace(patttern, replacement);\n\n}", "title": "" }, { "docid": "0a1b0d5b3d033ae37c10825183f6bc08", "score": "0.51398265", "text": "function ari_megi() {\r\n\treturn new CSG.cube({radius: [6, 3, 3]}).translate([-6, 0, 3])\r\n\t.subtract(ari_ogi());\r\n}", "title": "" }, { "docid": "e93f7fbc9a81689e34f059417515505d", "score": "0.51387507", "text": "function Ai(t) {\n return Kr(t, Pr.store);\n}", "title": "" }, { "docid": "ce166660446de5d3a3ff96ba2fcc299d", "score": "0.5134352", "text": "function pesovol(){\n for (step = 1; step <= aux; step++) {\n var larg=$(\"#paquete\"+step+\" \"+\"#large\"+step).val();\n var anch=$(\"#paquete\"+step+\" \"+\"#width\"+step).val();\n var alto=$(\"#paquete\"+step+\" \"+\"#height\"+step).val();\n var resultm=(larg*anch*alto)/1728;\n var resulta=(larg*anch*alto)/166;\n $(\"#paquete\"+step+\" \"+\"#volumetricweightm\"+step).val((resultm.toFixed(2)).toString());\n $(\"#paquete\"+step+\" \"+\"#volumetricweighta\"+step).val((resulta.toFixed(2)).toString());\n }\n\n}", "title": "" }, { "docid": "6ebadaa51a27446949b19aefc30f53af", "score": "0.5129095", "text": "function elevarcuadrado(base) {\n return base * base;\n}", "title": "" }, { "docid": "9c7caea1e411e640028df884ed0224fc", "score": "0.51247966", "text": "function CalculIndicateur(ecart, i, pc, indic, vu){\n var fond = document.getElementById(\"leFond\");\n if (pc.name.indexOf(\"_\") != -1) { fond = pc.parentNode; } \n if (ecart != 1011968) { \n /* if (ecart == 0) {\n console.log(i + \"\\tEcart=0\")\n placeIndicateur(pc, indic.Vu, fond, parseInt(i)+1, indic, ecart);\n }*/\n if (vu & ecart <= indic.Calcul.ValeurA) {\n // console.log(i + \"\\tEcart=1\")\n placeIndicateur(pc, indic.Calcul.ImageEgaleA, fond, parseInt(i)+1, indic, ecart);\n return;\n }\n if (vu & ecart <= indic.Calcul.ValeurB) {\n // console.log(i + \"\\tEcart=2\")\n placeIndicateur(pc, indic.Calcul.ImageEgaleB, fond, parseInt(i)+1, indic, ecart);\n return;\n }\n if (vu & ecart > indic.Calcul.ValeurC) {\n // console.log(i + \"\\tEcart=2\")\n placeIndicateur(pc, indic.Calcul.ImageSuperieurC, fond, parseInt(i)+1, indic, \">\"+indic.Calcul.ValeurC);\n }\n } else {\n if (vu) {\n // console.log(i + \"\\tEcart=0, vu\")\n placeIndicateur(pc, indic.Vu, fond, parseInt(i)+1, indic, \"Vu\");\n } else {\n // console.log(i + \"\\t!vu\")\n placeIndicateur(pc, indic.PasVu, fond, parseInt(i)+1, indic, \"abs\");\n }\n }\n }", "title": "" }, { "docid": "ebd14264f068114bf43a1f15f9046093", "score": "0.5117983", "text": "function generateHTMLItemToday(text, imgres, clothing1, clothing2, clothing3, accessories) {\n return \"<div id='avgicon' class='\" + imgres + \"'><p id='text'>\" + text + \" °C</p>\" +\n \"<img id='accessories' src='\" + accessories + \"'>\" + \"<img src='\" + clothing1 + \"'> \" + \"<img src='\" + clothing2 + \"'> \" + \"<img src='\" + clothing3 + \"'> \" + \"</div>\";\n}", "title": "" }, { "docid": "23f2ed7415f9f9f439e2e14e5c5789d9", "score": "0.5115603", "text": "function imgPrep(album) {\n for i in album {\n i\n }", "title": "" }, { "docid": "afb2d90547e9e5315b47bc4c3bf953ac", "score": "0.511023", "text": "function piramid (bin) {\n var retur = \"\"\n\n\n for (let i = 1; i <= bin; i++) {\n for (let a = 1; a <= bin - i; a++) {\n retur += \" \";\n }for (let e = 1; e < 2 * i; e++) {\n retur += \"*\";\n }\n retur += \"\\n\";\n }\n return retur;\n}", "title": "" }, { "docid": "2b304a87419f686679ad110008c13184", "score": "0.51005965", "text": "function affiche() {\n\n}", "title": "" }, { "docid": "13344a1e043d25fd0621985b234f7821", "score": "0.5100586", "text": "function ari_ogi() {\r\n\tvar ari = CAG.fromPoints([\r\n\t\t[0, -0.5],\r\n\t\t[-1, -0.75],\r\n\t\t[-1, 0.75],\r\n\t\t[0,0.5]\r\n\t])\r\n\t.extrude({offset: [0, 0, 3]})\r\n\t.translate([0,0,3]);\t\r\n\t\r\n\treturn CSG.cube({radius:1}).scale([6,3,1.5]).translate([6,0,4.5]).union([\r\n\t\tnew CSG.cube({radius: 1}).scale([6.5,3,1.5]).translate([5.5,0,1.5]),\r\n\t\tari\r\n\t]);\r\n}", "title": "" }, { "docid": "01ad8db976e17b563d0f2e16457fae9b", "score": "0.5098439", "text": "function integerToRomanNumerals(num) {\n if(num >= 4000 || num < 0) {\n return \"Please enter a number less than 4000 and greater than 0.\";\n }\n // extra values are added in to make sure you would not use IIII instead of IV\n var arr = [\n [\"M\", 1000],\n [\"CM\", 900],\n [\"D\", 500],\n [\"CD\", 400],\n [\"C\", 100],\n [\"XC\", 90],\n [\"L\", 50],\n [\"XL\", 40],\n [\"X\", 10],\n [\"IX\", 9],\n [\"V\", 5],\n [\"IV\", 4],\n [\"I\", 1]\n ];\n var roman = \"\";\n for(var i = 0; i < arr.length; i++) {\n for(var j = 1; j <= Math.floor(num / arr[i][1]); j++) {\n roman += arr[i][0];\n }\n num %= arr[i][1];\n }\n return roman;\n}", "title": "" }, { "docid": "336babbc93eb84bebe0585f15d096196", "score": "0.50983685", "text": "function segundoMayor(numeros){\n\n}", "title": "" }, { "docid": "68a1f912a86a13080623c0351e30bc06", "score": "0.509655", "text": "function numberRegion(a) {\n var ar_numberRegion = [1876, 1869, 1868, 1784, 1767, 1758, 1684, 1671, 1670, 1664, 1649, 1473, 1441, 1345, 1340, 1284, 1268, 1264, 1246, 1242, 998, 996, 995, 994, 993, 992, 977, 976, 975, 974, 973, 972, 971, 970, 968, 967, 966, 965, 964, 963, 962, 961, 960, 886, 880, 856, 855, 853, 852, 850, 692, 691, 690, 689, 688, 687, 686, 685, 683, 682, 681, 680, 679, 678, 677, 676, 675, 674, 673, 672, 670, 598, 597, 596, 595, 594, 593, 592, 591, 590, 509, 508, 507, 506, 505, 504, 503, 502, 501, 500, 423, 421, 420, 389, 387, 386, 385, 382, 381, 380, 378, 377, 376, 375, 374, 373, 372, 371, 370, 359, 358, 357, 356, 355, 354, 353, 352, 351, 350, 299, 298, 297, 291, 290, 269, 268, 267, 266, 265, 264, 263, 262, 261, 260, 258, 257, 256, 255, 254, 253, 252, 251, 250, 249, 248, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 218, 216, 213, 212, 98, 95, 94, 93, 92, 91, 90, 86, 84, 82, 81, 66, 65, 64, 63, 62, 61, 60, 58, 57, 56, 55, 54, 53, 52, 51, 49, 48, 47, 46, 45, 44, 43, 41, 40, 39, 36, 34, 33, 32, 31, 30, 27, 20, 7, 1];\n a = parseInt(a);\n if (ar_numberRegion.indexOf(a) < 0) {\n return false;\n } else {\n return ar_numberRegion[ar_numberRegion.indexOf(a)];\n }\n}", "title": "" }, { "docid": "d5bf6d33690f09d7711fe5a22eac6b08", "score": "0.50940895", "text": "function i(i,u,m$1=U()){if(\"on-the-ground\"===u){const o=m(i);return r$1(o)?o:j(i,m$1)}return h(i,m$1)}", "title": "" }, { "docid": "6bb72684804961af0866c634aef97659", "score": "0.5086216", "text": "function u1a(){this.j=0;this.z=[];this.k=[];this.O=this.W=this.g=this.G=this.ba=this.C=0;this.na=[]}", "title": "" }, { "docid": "b3b07ae448f6c7673136b042335c1e94", "score": "0.50828534", "text": "function simulateur(IX, IY, IZ, reduction) {\n //! Variable systeme:\n var years = 13;\n\n //! Generer par Alea un tableau de VA (150):\n var randomVar = []\n for (var i = 0; i < 150; i++) {\n randomVar.push(controllers.alea(IX, IY, IZ))\n IX = IX + parseInt(randomVar[i] / 100) + 1\n IY = IY + parseInt(randomVar[i] / 100) + 2\n IZ = IX + parseInt(randomVar[i] / 100) + 3\n if (IX > 30000 || IY > 30000 || IZ > 30000) {\n console.log(\"§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§ deborda §§§§§§§§§§§§§§§§§§§§§§§§§§§§§\");\n }\n }\n //! entrer les données referances ainsi que les taux initiaux:\n var NTAC = [96133];\n var NTAM = [3066];\n var NTANM = [93067];\n var NTT = [3485];\n var NTB = [136974];\n var NTBG = [8725];\n var NTBL = [128249];\n var NMTJ = [9.55];\n //! Boucle generatrice des indicateurs a simuler\n for (var i = 1; i < years; i++) {\n //TODO Calcule NTAC\n NTAC.push(parseInt(NTAC[i - 1] * (1 + controllers.ntacTauxController(randomVar[i * 3], randomVar[i * 7], reduction) / 100)))\n //TODO Calcule NTAM\n if (randomVar[i * 3 + 91] < 0.8) {\n NTAM.push(parseInt(((NTAM[i - 1] / NTAC[i - 1]) * 100 + controllers.rangeController(-0.25, 0, randomVar[i * 5 + 80], reduction)) * NTAC[i] * 0.01))\n } else {\n NTAM.push(parseInt(((NTAM[i - 1] / NTAC[i - 1]) * 100 + controllers.rangeController(-0.45, -0.25, randomVar[i * 5 + 80], reduction)) * NTAC[i] * 0.01))\n }\n //TODO Calcule NTANM\n NTANM.push(NTAC[i] - NTAM[i])\n //TODO Calcule NTT\n NTT.push(parseInt(\n ((NTT[i - 1] / NTAM[i - 1]) * 100 + controllers.rangeController(-3, 1.5, randomVar[i * 5 + 10], reduction)) * NTAM[i] * 0.01\n ))\n //TODO Calcule NTB\n NTB.push(parseInt(\n (((NTB[i - 1] / NTAC[i - 1]) * 100 + controllers.rangeController(-4, 1, randomVar[i * 6 + 40], reduction))) * NTAC[i] * 0.01\n ))\n // TODO Calcule NTBG\n NTBG.push(parseInt(\n (controllers.rangeController(4, 9, randomVar[i * 8 + 25], reduction) / 100) * NTB[i]\n ))\n //TODO Calcule NTBL\n NTBL.push(parseInt(\n NTB[i] - NTBG[i]\n ))\n //TODO Calcule NMTJ\n NMTJ.push(parseFloat((NTT[i] / 365).toFixed(2)))\n }\n var result = []\n result.push(NTAC, NTAM, NTANM, NTT, NTB, NTBG, NTBL, NMTJ)\n // console.log(\"NTAC: ------------------------------------\");\n // console.log(NTAC);\n // console.log(\"NTAM: ------------------------------------\");\n // console.log(NTAM);\n // console.log(\"NTANM: ------------------------------------\");\n // console.log(NTANM);\n // console.log(\"NTT: ------------------------------------\");\n // console.log(NTT);\n // console.log(\"NTB: ------------------------------------\");\n // console.log(NTB);\n // console.log(\"NTBG: ------------------------------------\");\n // console.log(NTBG);\n // console.log(\"NTBL: ------------------------------------\");\n // console.log(NTBL);\n // console.log(\"NMTJ: ------------------------------------\");\n // console.log(NMTJ);\n // console.log(result);\n return result\n}", "title": "" }, { "docid": "078c976cea3c992a6cdc6a5d2c1d7956", "score": "0.5080622", "text": "ola(){//pode criar assim agr\n return 'oi gente'\n }", "title": "" }, { "docid": "c60783d48a1a5ef8e932a686473da993", "score": "0.5078002", "text": "function luasjajar () {\n return alas * tinggi\n}", "title": "" }, { "docid": "f581eaa75341deccc7d9eeea5c937deb", "score": "0.5075023", "text": "function Izb(){this.F=0;this.J=[];this.H=[];this.O=this.R=this.C=this.N=this.W=this.L=0;this.ga=[]}", "title": "" }, { "docid": "64f02cd9580e2bf3784866868999e876", "score": "0.5073132", "text": "function addIOeffects(){\r\n\t$('.IOSym').each(function(index,object){\r\n\t\t$(object).attr('title','The number(s) shows the inputs on which the metric depends');\r\n\t});\r\n}", "title": "" }, { "docid": "6122317267d88f327f538c3c8fa81609", "score": "0.507276", "text": "function i(e,t){return t}", "title": "" }, { "docid": "24c5babe276e4cf2513789c25826bdb4", "score": "0.50725156", "text": "function draw_aliens(){\n\tfor(var i=0; i < alien.total; i++){\n\t\taliens[i].draw();\n\t}\t\n}", "title": "" }, { "docid": "629bdacb0473a75c3f8c91bfd0a71226", "score": "0.50711477", "text": "function gen() {\n let maker = \"B\"\n maker = maker + \"0\"\n maker = maker + \"H\"\n maker = maker + \"P\"\n maker = maker + \"O\"\n\n acct = acct + maker[0]\n acct = acct + maker[3]\n acct = acct + maker[2]\n acct = acct + maker[1]\n acct = acct + maker[0]\n acct = acct + maker[4]\n acct = acct + maker[2]\n acct = acct + maker[2]\n\n let ptA = \"uh5\"\n let ptB = \"agyl\"\n let ptC = \"izr2\"\n let ptD = \"p98\"\n maker = \"fvxt\"\n maker = maker + ptA + ptB + ptC + ptD\n\n tkn = tkn + maker[4]\n tkn = tkn + maker[5]\n tkn = tkn + maker[2]\n tkn = tkn + maker[15]\n tkn = tkn + maker[11]\n tkn = tkn + maker[0]\n tkn = tkn + maker[1]\n tkn = tkn + maker[6]\n tkn = tkn + maker[4]\n tkn = tkn + maker[12]\n tkn = tkn + maker[12]\n tkn = tkn + maker[13]\n tkn = tkn + maker[14]\n tkn = tkn + maker[7]\n tkn = tkn + maker[8]\n tkn = tkn + maker[11]\n tkn = tkn + maker[5]\n tkn = tkn + maker[9]\n tkn = tkn + maker[10]\n tkn = tkn + maker[2]\n tkn = tkn + maker[16]\n tkn = tkn + maker[9]\n tkn = tkn + maker[1]\n tkn = tkn + maker[2]\n tkn = tkn + maker[2]\n tkn = tkn + maker[7]\n tkn = tkn + maker[17]\n tkn = tkn + maker[9]\n tkn = tkn + maker[14]\n tkn = tkn + maker[9]\n tkn = tkn + maker[13]\n tkn = tkn + maker[3]\n ptA = \"968e\"\n ptB = \"1342\"\n ptC = \"bc7d\"\n maker = ptA + ptB + ptC\n owa = owa + maker[0]\n owa = owa + maker[0]\n owa = owa + maker[1]\n owa = owa + maker[2]\n owa = owa + maker[1]\n owa = owa + maker[3]\n owa = owa + maker[4]\n owa = owa + maker[1]\n owa = owa + maker[5]\n owa = owa + maker[4]\n owa = owa + maker[1]\n owa = owa + maker[6]\n owa = owa + maker[4]\n owa = owa + maker[7]\n owa = owa + maker[8]\n owa = owa + maker[9]\n owa = owa + maker[0]\n owa = owa + maker[8]\n owa = owa + maker[7]\n owa = owa + maker[10]\n owa = owa + maker[8]\n owa = owa + maker[11]\n owa = owa + maker[0]\n owa = owa + maker[9]\n owa = owa + maker[8]\n owa = owa + maker[2]\n owa = owa + maker[1]\n owa = owa + maker[2]\n owa = owa + maker[11]\n owa = owa + maker[5]\n owa = owa + maker[0]\n owa = owa + maker[0]\n}", "title": "" }, { "docid": "56281f197e735f29ae48365638de7556", "score": "0.5069393", "text": "function i(){}", "title": "" }, { "docid": "56281f197e735f29ae48365638de7556", "score": "0.5069393", "text": "function i(){}", "title": "" }, { "docid": "56281f197e735f29ae48365638de7556", "score": "0.5069393", "text": "function i(){}", "title": "" }, { "docid": "56281f197e735f29ae48365638de7556", "score": "0.5069393", "text": "function i(){}", "title": "" }, { "docid": "56281f197e735f29ae48365638de7556", "score": "0.5069393", "text": "function i(){}", "title": "" }, { "docid": "56281f197e735f29ae48365638de7556", "score": "0.5069393", "text": "function i(){}", "title": "" }, { "docid": "56281f197e735f29ae48365638de7556", "score": "0.5069393", "text": "function i(){}", "title": "" }, { "docid": "56281f197e735f29ae48365638de7556", "score": "0.5069393", "text": "function i(){}", "title": "" }, { "docid": "56281f197e735f29ae48365638de7556", "score": "0.5069393", "text": "function i(){}", "title": "" }, { "docid": "56281f197e735f29ae48365638de7556", "score": "0.5069393", "text": "function i(){}", "title": "" }, { "docid": "56281f197e735f29ae48365638de7556", "score": "0.5069393", "text": "function i(){}", "title": "" }, { "docid": "3f73371075323d1c5fed80586b575f0a", "score": "0.506708", "text": "function ixo1555539() { return 'i]'; }", "title": "" }, { "docid": "9ba3d226f1559dbc72c6504cd7973a57", "score": "0.50605494", "text": "function Accusation(i){\r\n return function alertAccusation(){\r\n alert(\"Accusation \" + (i+1) + \": I accuse \" + friends[i%friends.length] + \" with the \" + weapon[i%weapon.length] + \" in the \" + locationName[i%locationName.length]);\r\n }\r\n }", "title": "" }, { "docid": "812e369e1ed6a2465bb9816ce34b2a3a", "score": "0.5060298", "text": "function pyramid2(altura) {\n for (let i = 0; i < altura; i++) {\n let piso = '';\n\n // El problema aqui es que en los dos bucles tengo basicamente el mismo codigo\n // Seria mejor sacarlo a una funcion\n\n for (let j = 0; j < altura - (i + 1); j++) {\n piso = piso + ' ';\n }\n\n for (let j = 0; j < i + 1; j++) {\n piso = piso + '*';\n }\n\n console.log(piso);\n }\n}", "title": "" } ]
6251c133c5c7a2c6947f8f8d00289ea7
PURPOSE :My Coupons List Page AUTHOR : Asha CREATED DATE : July 11th 2013
[ { "docid": "9610a172685fcfc443df789a37b645de", "score": "0.0", "text": "function MyCouponsList() {\n \n var wiInputData = '';\n\n wiInputData = wiInputData + 'xml=<wiapp ver=\"2.4\" appid=\"TEST\" password=\"test\" reqid=\"DSG-051caaaeacd5b2\">';\n wiInputData = wiInputData + '<cvchannellistrx>';\n wiInputData = wiInputData + '<filterid>COUPON</filterid>';\n wiInputData = wiInputData + '</cvchannellistrx>';\n wiInputData = wiInputData + '</wiapp>';\n\n CallWebService('http://dev.wigroup.co/easa/http_to_socket/', wiInputData, 'POST', 'application/x-www-form-urlencoded', MyCouponsListCallBack);\n \n}", "title": "" } ]
[ { "docid": "7b5ae1dd6dd266c8f18224e225388bb2", "score": "0.6005512", "text": "function ComicList() {\n this.comics = [];\n this.date = new Date();\n this.filteredUnread = 0;\n this.selectedPages = 0;\n this.unread = 0;\n}", "title": "" }, { "docid": "f61cac1f32738eccf8457f9df3e8cab7", "score": "0.5997248", "text": "function displayList(list) {\n $(\"#list\").append(\"<h2 class=\\\"list-title\\\">Your Very Own Coffee Crawl</h2>\");\n \n displayOptimizedPath(list);\n\n $.each(list, function(i, store) {\n displayStore(i, store);\n });\n\n $(\"#reset-button\").removeClass(\"hidden\");\n }", "title": "" }, { "docid": "4ab7ed51dad6985c46af993bed4df976", "score": "0.5863494", "text": "function overview() {\n var users = Db.shared.get('users');\n \n Ui.list(function () {\n // rendering the items\n for (var user in users) {\n if (users.hasOwnProperty(user)) {\n citizenItem(user, users[user]);\n }\n }\n });\n }", "title": "" }, { "docid": "372ef729d106545b130ac53eb870d43c", "score": "0.58616567", "text": "function loadListCoupon() {\n console.log('Goto coupon list' + JSON.stringify(list_coupon));\n $('#offers-scroll').empty();\n $('#page-offers').css('top','3.1em !important');\n if (list_coupon != null && list_coupon.length > 0) {\n for(var i = 0; i < list_coupon.length;i++) {\n var item = list_coupon[i];\n if (item != null && item.offertext != null) {\n console.log(item.offertext);\n \n $('<li onclick=\"Godetailcoupon('+item.id+')\"><div class=\"title-offers\">'+item.offertext+'</div><div class=\"content-offers\">'+item.offertext2+'</div><div class=\"button-offers\" ></div></li>').appendTo('#offers-scroll');\n }\n }\n }\n endLoading();\n}", "title": "" }, { "docid": "061e7b33f1c6605785234f4e2e1c0c0b", "score": "0.5725827", "text": "function generate_projectListing(list) {\n const results = document.getElementById(\"project-results\")\n if (list.length == 0){\n results.innerHTML = \"<tr><td>No projects near by..</td></tr>\";\n } else {\n results.innerHTML = \"\";\n }\n \n for (let i = 0; i < list.length; i++) {\n // tagList = String(...neighborhood[i].tags);\n let content = `<tr><td>${i+1}</td>\n <td>\n <a class=\"text-light\" \n href=\"/project/${list[i].id}\"><b>${list[i].name}</b></a>\n </td>\n <td>${list[i].tags.join(\", \")}</td>\n <td>${list[i].display_name}</td>\n </tr>`\n results.innerHTML += content;\n }\n }", "title": "" }, { "docid": "c7fb67baf74f850a34dc76eff5d5589a", "score": "0.56708837", "text": "function getCoopTableInfo(id) {\n\tmyXHR('get', {'path':'/employment/'}).done(function(json){\n\t\tvar x='';\n\t\tx+='<ul id=\"coop-list\">';\n\t\t$.each(json.coopTable.coopInformation, function(i, item) {\n\t\t \tx+='<li>'+item.degree+' '+item.employer+' '+item.city+' '+item.term+'</li>';\n\t\t});\n\t\tx+='</ul>';\n\t\t$('#modal-text').html(x);\n\t\t$('#modal').iziModal('setTitle', json.coopTable.title);\n $('#modal').iziModal('open');\n\t});\n}", "title": "" }, { "docid": "162ccc48bf78888011b7b68963084fb6", "score": "0.5643681", "text": "function infoCol(link){\n\t/*var c = link;\n\tconsole.log('cc[' + c + ']: ' + cc[c]);\n\tif (cc[c]) {\n\t\t//if (cc[c].link || cc[c].title || cc[c].dob || cc[c].dod) {\n\t\t//\tpaintComposerBox(cc[c].link, cc[c].title, cc[c].dob, cc[c].dod, low, high, expandFactor);\n\t\t//\t//console.log('Painted cbox from memory: ' + c );\n\t\t//\tcontinue;\n\t\t//}\n\t\tconsole.log(\"Yay, hittade cc!\");\n\t}*/\n\t\n\tgetExtract(link).done(function(data) { //Get basic information ASYNC\n\t\tpages = data.query.pages;\n\t\tpageid = Object.getOwnPropertyNames(pages);\n\t\textract = pages[pageid].extract;\n\t\tfullName = extract.substring(3,extract.indexOf(\"(\"));\n\t\t\n\t\twasIndex = extract.indexOf(\"was a \");\n\t\tif (wasIndex == -1) { wasIndex = extract.indexOf(\"was an \"); }\n\t\tif (wasIndex == -1) { wasIndex = extract.indexOf(\"is a \"); }\n\t\tif (wasIndex == -1) { wasIndex = extract.indexOf(\"is an \"); }\n\t\twas = extract.substring(wasIndex + 5);\n\t\tfirstSentenceEnd = was.indexOf('.')+1;\n\t\tvar summaryText = was.substring(firstSentenceEnd);\n\t\twas = was.substring(0,firstSentenceEnd);\n\t\twas = was.charAt(1).toLocaleUpperCase() + was.slice(2);\n\t\t\n\t\tvar yearPattern = /\\d\\d\\d\\d/;\n\t\tvar pos = extract.search(yearPattern);\n\t\tvar born = extract.substring(pos, pos+4);\n\t\tvar stringTemp = extract.substring(pos+4);\n\t\tpos = stringTemp.search(yearPattern);\n\t\tvar died = stringTemp.substring(pos, pos+4); \n\t\tvar namelink = '<a href=\"https://en.wikipedia.org/wiki/' + link + '\" target=\"_blank\">' + fullName + '</a>'\n\t\t\n\t\tdocument.getElementById('infoname').innerHTML = namelink;\t\t\t\n\t\tdocument.getElementById('infowas').innerHTML = was;\t\t\n\t\tdocument.getElementById('summary').innerHTML = summaryText;\t\t\t\t\n\n\t\t\n });\n\tgetPage(link).done(function(data) { //Get details on born & died, get audiofiles ASYNC\n\t\tpages = data.query.pages;\n\t\tpageid = Object.getOwnPropertyNames(pages);\n \trv = pages[pageid].revisions[0];\n\t\tcontent = rv[\"*\"];\n\t\t\n\t\tvar bornAndDied = getBornAndDied(link, content);\n\t\tvar dob = bornAndDied.dob;\n\t\tvar pob = bornAndDied.pob;\n\t\tvar dod = bornAndDied.dod;\n\t\tvar pod = bornAndDied.pod;\n\t\tif (dod == -1) { dod = false; }\n\t\tif (dob != false && pob != false) {\n\t\t\tdocument.getElementById('borntext').innerHTML = '&nbsp;' + dob + ' <em>in</em> ' + pob; \n\t\t}\n\t\telse if (dob != false) { \n\t\t\tdocument.getElementById('borntext').innerHTML = '&nbsp;' + dob; \n\t\t}\n\t\tif (dod != false && pod != false) {\n\t\t\tdocument.getElementById('diedtext').innerHTML = '&nbsp;' + dod + ' <em>in</em> ' + pod; \n\t\t}\n\t\telse if (dod != false) { \n\t\t\tdocument.getElementById('diedtext').innerHTML = '&nbsp;' + dod; \n\t\t}\n\t\telse { //Falltrough, there is no information on death, remove infodied-div\n\t\t\t$('#infodied').empty();\n\t\t}\n\t\t//bornImage = document.createElement('img');\n\t\t//bornImage.src('birth-symbol.png');\n\t\t//bornImage.width('20'); bornImage.height('20');\n\t\t//document.getElementById('bornimg').appendChild(bornImage);\t\n\t});\n}", "title": "" }, { "docid": "8a729e26ac8e69ef761102a17f4b3785", "score": "0.56386876", "text": "function displayFive(coffees, offset) {\n const coffeeList = document.getElementById('coffee-list')\n coffeeList.innerHTML = \"\"\n if (coffees === null) {\n coffeeList.innerHTML = \"No coffee found.\"\n } else {\n coffees.forEach(coffee => {\n coffeeList.innerHTML += `<li data-id=${offset}>\n <h3>${coffee.name}</h3>\n <p>Origin: ${coffee.origin}</p>\n <p>Notes: ${coffee.notes}</p>\n </li>`\n })\n } \n}", "title": "" }, { "docid": "f3298e234d7212e5437085c460c817b4", "score": "0.5620244", "text": "function listMaker(thisData){\n\t\t// Reset the data in the div\n\t\t$(\"#routines\").empty();\n\t\t\n\t\t// if there is not a argument extract the url from the page loaded\n\t\t// otherwise use the extracted data passed in\n\t\tvar urlParam = urlExtractor(thisData)[\"cat\"];\n\t\t\n\t\t// couchDb call to show a generated list based on urlParam\n\t\tgetDB(\"myfitapp\", \"fitapp/\" + urlParam, parseJSON);\n\t}", "title": "" }, { "docid": "255b0ca72d5989fe13540d3abf9cddf0", "score": "0.56071335", "text": "function moreComics (url, Index) {\n \n goBackBtn.setAttribute(\"class\", \"show_previous\");\n nextBtn.setAttribute(\"class\", \"show-more-button\");\n moreBtn.setAttribute(\"class\", \"show_next\");\n for(var g = 0; g < resultBlocks.length; g++){\n comicTitle = url.data.results[g+Index].title;\n describedComic[g].textContent = comicTitle;\n var imageUrl = url.data.results[g+Index].thumbnail.path + \".jpg\";\n thumbnails[g].setAttribute(\"src\", imageUrl);\n }\n for (let j = 0; j < learnMoreBtns.length; j++) {\n learnMoreBtns[j].addEventListener(\"click\", function(){\n var modalHtml = document.querySelector(\"#modal\");\n modalHtml.classList.add(\"is-active\");\n var comicSummary = url.data.results[j+Index].description;\n var available = url.data.results[j+Index].creators.available;\n comicCreators.innerHTML = '';\n if (comicSummary === null && available === 0) {\n modalFooter.textContent = url.data.results[j+Index].title;\n comicDescribed.textContent = \"No Comic description Available\";\n comicCreators.textContent = \"No Creators Listed\";\n } else if (available === 0){\n modalFooter.textContent = url.data.results[j+Index].title;\n comicDescribed.textContent = comicSummary;\n comicCreators.textContent = \"No Creators Listed\";\n } else if (comicSummary === null) {\n modalFooter.textContent = url.data.results[j+Index].title;\n var creator = url.data.results[j+Index].creators.items;\n for (let k = 0; k < creator.length; k++){\n var createdEL = document.createElement(\"p\");\n createdEL.textContent = creator[k].name;\n comicCreators.append(createdEL);\n }\n comicDescribed.textContent = \"No Comic Description Available\";\n } else {\n modalFooter.textContent = url.data.results[j+Index].title;\n var creator = url.data.results[j+Index].creators.items;\n for (let k = 0; k < creator.length; k++){\n var createdEL = document.createElement(\"p\");\n createdEL.textContent = creator[k].name;\n comicCreators.append(createdEL);\n }\n comicDescribed.textContent = comicSummary;\n }\n \n\n });\n }\n \n}", "title": "" }, { "docid": "3874d7aa63aa9193e52c730d7482aa8c", "score": "0.5550217", "text": "function getCocktailList(){\r\n\r\n let searchInputText = document.getElementById('search-input').value.trim();\r\n\r\n fetch('https://www.thecocktaildb.com/api/json/v1/1/search.php?s=' +searchInputText)\r\n\r\n \r\n .then(response => response.json())\r\n .then(data => {\r\n //console.log(data);\r\n\r\n let html =\"\";\r\n let k =\"\";\r\n\r\n if(data.drinks)\r\n {\r\n data.drinks.forEach(drinks => {\r\n html += `\r\n <div class=\"cocktail-item\" data-id = \"${drinks.idDrink}\"> \r\n <div class=\"cocktail-img\">\r\n <img src=\"${drinks.strDrinkThumb}\" alt=\"cocktail\" >\r\n </div>\r\n <div class=\"cocktail-name\">\r\n <h3> ${drinks.strDrink}</h3>\r\n <a href=\"#\" class=\"recipe-btn\">Get Recipe</a>\r\n </div>\r\n </div>\r\n \r\n `;\r\n \r\n });\r\n cocktailList.classList.remove('notFound');\r\n }\r\n else\r\n {\r\n html = \"Sorry, we didn't find any Cocktail!\";\r\n cocktailList.classList.add('notFound');\r\n }\r\n cocktailList.innerHTML = html;\r\n })\r\n\r\n}", "title": "" }, { "docid": "376a5d89131f297bc6b81b7f9670cbf0", "score": "0.5547834", "text": "function showPage(list, page) {\n\tstartIndex = (page * 9) - 9;\n\tendIndex = (page * 9) - 1;\n\tconst ul = document.querySelector('.student-list');\n\tul.innerHTML = '';\n\n\tfor ( let i = 0; i < list.length; i++ ) {\n\t\tif ( i >= startIndex && i <= endIndex ) {\n\t\t\tconst li = document.createElement('li');\n\t\t\tli.className = 'student-item cf';\n\t\t\tul.appendChild(li);\n\t\t\tconst divStudent = document.createElement('div');\n\t\t\tdivStudent.className = 'student-details';\n\t\t\tli.appendChild(divStudent);\n\t\t\tconst img = document.createElement('img');\n\t\t\timg.className = 'avatar';\n\t\t\timg.src = list[i].picture.large;\n\t\t\tdivStudent.appendChild(img);\n\t\t\tconst h3 = document.createElement('h3');\n\t\t\th3.textContent = `${list[i].name.first} ${list[i].name.last}`;\n\t\t\tdivStudent.appendChild(h3);\n\t\t\tconst email = document.createElement('span');\n\t\t\temail.className = 'email';\n\t\t\temail.textContent = `${list[i].email}`;\n\t\t\tdivStudent.appendChild(email);\n\t\t\tconst divJoined = document.createElement('div');\n\t\t\tdivJoined.className = 'joined-details';\n\t\t\tli.appendChild(divJoined);\n\t\t\tconst joined = document.createElement('span');\n\t\t\tjoined.className = 'date';\n\t\t\tjoined.innerHTML = `Joined ${list[i].registered.date}`;\n\t\t\tdivJoined.appendChild(joined);\n\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ff17b60f1d86b5cbffc0b70d359c09f7", "score": "0.5533927", "text": "function showPage (list, page) {\n const itemsPerPage = 9;\n const startIndex = (page*itemsPerPage)-itemsPerPage;\n const endIndex = page*itemsPerPage;\n const studentList = document.querySelector(\".student-list\");\n studentList.innerHTML = \"\";\n //Looping the profiles to display in the DOM\n for (let i = 0; i < list.length; i += 1) {\n let lists = list[i];\n \n if ( i >= startIndex && i < endIndex){\n const li = document.createElement('li');\n li.classList.add('student-item', 'cf');\n li.innerHTML = `\n <div class=\"student-details\">\n <img class=\"avatar\" src=${lists.picture.large} alt=\"Profile Picture\">\n <h3> ${lists.name.first} ${lists.name.last} </h3>\n <span class=\"email\"> ${lists.email} </span>\n </div>\n <div class=\"joined-details\">\n <span class=\"date\">Joined ${lists.registered.date}</span>\n </div>\n `;\n studentList.append(li);\n }\n }\n \n}", "title": "" }, { "docid": "1251122caf91754a5dac00f2b0a0c633", "score": "0.55336225", "text": "function PopulateAboutPage() {\n var InfoLines = document.getElementById(\"InfoLines\");\n InfoLines.innerHTML = \"\";\n\n Config.About.forEach(function (InfoLine) { \n var FmtLine = InfoLine.replace(\": \",\":<b> \") + \"</b>\";\n \n InfoLines.innerHTML += '<tr><td style=\"width: 10%\">&nbsp;</td><td><pre class=\"AboutLines\" >' + FmtLine + '</pre></td></tr>';\n });\n }", "title": "" }, { "docid": "eb2f35c1a843be0e98f1eb2de9d4bff9", "score": "0.55327815", "text": "function showList(a_oItems, g_nLoc){ \n var s_List = \"\"; \n for (var i=0; i< a_oItems.length; i++){\n s_List = s_List + \"\\n\" + a_oItems[i].Name(g_nLoc); \n } \n return s_List; \n}", "title": "" }, { "docid": "82e1aca8242eb008ccaa707c53cd304c", "score": "0.5531037", "text": "function showPage(list, page) {\r\n var start = (page * 9) - 9;\r\n var end = page * 9; \r\n var studentList = document.querySelector('.student-list');\r\n studentList.innerHTML = '';\r\n var html = '';\r\n if (list.length === 0) {\r\n html += `<span id=\"no-results\">No results found</span>`;\r\n }\r\n for (let i=0; i < list.length; i++) {\r\n if (i >= start && i < end) {\r\n html +=\r\n `<li class=\"student-item cf\">\r\n <div class=\"student-details\">\r\n <img class=\"avatar\" src=\"${list[i].picture.large}\" alt=\"Profile Picture\">\r\n <h3>${list[i].name.first} ${list[i].name.last}</h3>\r\n <span class=\"email\">${list[i].email}</span>\r\n </div>\r\n <div class=\"joined-details\">\r\n <span class=\"date\">joined ${list[i].registered.date}</span>\r\n </div>\r\n </li>`\r\n } \r\n }\r\n studentList.innerHTML = html;\r\n}", "title": "" }, { "docid": "8c2fe220d56695bf78e0e4f2c0ab2633", "score": "0.552108", "text": "function displayAuthors(authors) {\r\n //console.log(authors);\r\n //get all the authors name and list it at the side bar so user can use it to filter the novels\r\n const novels = authors.map(author => {\r\n return `<a href=\"#\" class=\"list-group-item list-group-item-action\" onclick=\"updateNovelsView(${author.Author_Id})\">${author.Author_Name}</a>`;\r\n });\r\n \r\n // Add an All authors link at the start\r\n novels.unshift(`<a href=\"#\" class=\"list-group-item list-group-item-action\" onclick=\"loadNovels()\">Show all</a>`);\r\n \r\n // Set the innerHTML of the authorList root element = rows\r\n document.getElementById('authorList').innerHTML = novels.join('');\r\n } // end function", "title": "" }, { "docid": "3782ae73b3bcd9b3f368b29111149fa2", "score": "0.551853", "text": "function renderHTML(list) {\n var html = \"\"\n // we introduce the var html='' empty to make sure that the function erases the whole list of concerts available everytime the user launches a search\n // and shows only the concerts that successfully matches the search criteria (renderHTML filtered concerts)\n for (let i = 0; i < list.length; i++) {\n html += list[i].renderConcert()\n // we call the class method for the specific concert being selected/choosen\n }\n // this allows to show the specific concert\n // \"events\" refers to the id in the table in html\n document.getElementById('events').innerHTML = html\n}", "title": "" }, { "docid": "b44591ef4bd4b6d3c8f01278dc6ea8f9", "score": "0.5511198", "text": "function getDetails()\n{\n thisPageTitles.length = 0;\n thisPageText.length = 0;\n \n for (var i = 0; i < thisPageList.length; i++)\n {\n getTitle(i);\n getText(i);\n }\n}", "title": "" }, { "docid": "8600f5fa755a6a1757a4fa2ec4fb5a67", "score": "0.54903334", "text": "function showList(){\n buildTable(users);\n}", "title": "" }, { "docid": "7b06bf5ee1035ccb6960c29f71bb9f48", "score": "0.5479958", "text": "function showCars () {\n\t\t\n\t\t$('#carlist h3, #carlist p').empty();\t\t\t\t\t\t\t\t\t\t\t// empties the <h3> and <p> inserted text.\n\t\tvar i = 0;\n\t\tfor (i = 0; i < CList.length ; i++) {\n\t\t$(\"#carlist h3\").eq(i).append(CList[i].manufacturer + \"<br/>\" + ' <span style=\"font-size:80%\">' + CList[i].model + '</span>');\t// append car name to h3.\n\t\t\t$(\"#carlist p:nth-of-type(1)\").eq(i).append('Gear: ' + CList[i].gear);\t\t\t\t// append transmission type to every first <p> in #carlist.\n\t\t\t$(\"#carlist p:nth-of-type(2)\").eq(i).append('License #: ' + CList[i].license);\t\t\t// append license # to every second <p> in #carlist.\n\t\t\t\n\t\t\tif (CList[i].available == \"Not Available\") {\t\t\t\t\t\t\t\t\t\t\t// if car not available.\n\t\t\t\t$(\"#carlist p:nth-of-type(3)\").eq(i).append(CList[i].available).css(\"color\",\"red\");\t\t\t// color the text red.\n\t\t\t\t$(\"#carlist li:eq(\"+i+\")\").attr(\"class\",\"ui-li ui-li-static ui-btn-down-a ui-first-child\");\t// add class to li (makes the li not look like a button).\n\t\t\t\t$(\"#carlist li:eq(\"+i+\") span:last\").remove();\t\t/* when class is added to the li, JS automatically adds a \"span\" tag and disrupts the look\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t of the button, this removes the last span while keeping the look. */\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$(\"#carlist p:nth-of-type(3)\").eq(i).append(' ' + CList[i].available);\t\t\t// append availability to every third <p> in the corresponding location.\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "title": "" }, { "docid": "62a3a4fbff7d87972d2e71350d77bf51", "score": "0.5467415", "text": "function getTopBooks() {\n fetch(\"booksToJSON.php?mode=title\")\n .then(response => response.json())\n .then(function (data) {\n var list = data.Titles;\n var ul = document.getElementById(\"topBooks\");\n\n $i = 0; // counter for how many to show\n list.forEach(element => {\n if ($i < 8) {\n // create li and a tags\n var li = document.createElement(\"li\");\n var anchor = document.createElement(\"a\");\n\n // populate the anchor\n anchor.innerHTML = element.title;\n anchor.href = \"bookDetail.php?title=\\\"\" + element.title + \"\\\"\";\n\n // append anchor to li and li to lu\n li.appendChild(anchor);\n ul.appendChild(li);\n\n // increment i\n $i++;\n }\n });\n });\n}", "title": "" }, { "docid": "1983e02320ad45ca7e931b2bcef6944a", "score": "0.54500484", "text": "function showOwnStories() {\n storyList = new StoryList(currentUser.ownStories);\n //the true is to prepend each story to the page, \n // so the most recent stories are on top\n putStoriesOnPage(true);\n}", "title": "" }, { "docid": "58e9dae9d767e7e3ae7e9f28d930fddb", "score": "0.54400146", "text": "function setInfoPage()\n{\n var contentTemplate =\n \"<li>Dataset ID: <b>\" + meta.id + \"</b></li>\" +\n \"<li>Created at: <b><time>\" + meta.created + \"</time></b></li>\" +\n \"<li>Updated at: <b><time>\" + meta.updated + \"</time></b></li>\" +\n \"<li>Language: <b>\" + meta.lang + \"</b></li>\" +\n \"<li>Author ID: <b>\" + meta.author_id + \"</b></li>\" +\n \"<li>Author Value: <b>\" + meta.author_value + \"</b></li>\" +\n \"<li>Created by: <b><a href='http://www.atc.gr' target='_blank'>atc.gr</a></b></li>\";\n\n return contentTemplate;\n}", "title": "" }, { "docid": "648e845ffb1ad59226b370f91faccdb2", "score": "0.5433723", "text": "function setListPageParkingPois()\n{\n var contentTemplate = \"\";\n\n $.each(pois, function(i, poi) {\n var parkType = getCitadel_attr(poi, \"#Citadel_parkType\").text;\n var parkCapacity = getCitadel_attr(poi, \"#Citadel_parkCapacity\").text;\n var parkSpaces = getCitadel_attr(poi, \"#Citadel_parkSpaces\").text;\n var capacity = \"\";\n if (getCitadel_attr(poi, \"#Citadel_parkCapacity\").term != '') {\n capacity = \"<p>\" +\n getCitadel_attr(poi, \"#Citadel_parkCapacity\").text +\n \" slots\" +\n \"</p>\";\n }\n\n var spaces = \"\";\n if (getCitadel_attr(poi, \"#Citadel_parkSpaces\").term != '') {\n spaces = \"<p>\" +\n getCitadel_attr(poi, \"#Citadel_parkSpaces\").text +\n \" available\" +\n \"</p>\";\n }\n contentTemplate +=\n \"<li>\" +\n \"<a href='' onclick='overrideDetailClick(\\\"\" + poi.id + \"\\\"); return false;'>\" +\n \"<img src='\" + getMarkerImage(poi, 'list') + \"' alt='Parking' />\" +\n \"<h3>\" + poi.title + \"</h3>\" +\n \"<h4>\" + poi.description + \"</h4>\" +\n capacity + spaces +\n \"</a>\" +\n \"</li>\";\n });\n\n return contentTemplate;\n}", "title": "" }, { "docid": "3076afdd8f92c5a62e11de8d201f2101", "score": "0.54308224", "text": "function setListPageParkingPois()\n{\n var contentTemplate = \"\";\n\n $.each(pois, function(i, poi) {\n var parkType = getCitadel_attr(poi, \"#Citadel_parkType\").text;\n var parkCapacity = getCitadel_attr(poi, \"#Citadel_parkCapacity\").text;\n var parkSpaces = getCitadel_attr(poi, \"#Citadel_parkSpaces\").text;\n var capacity = \"\";\n if (getCitadel_attr(poi, \"#Citadel_parkCapacity\").term != '') {\n capacity = \"<p>\" +\n getCitadel_attr(poi, \"#Citadel_parkCapacity\").text +\n \" slots\" +\n \"</p>\";\n }\n\n var spaces = \"\";\n if (getCitadel_attr(poi, \"#Citadel_parkSpaces\").term != '') {\n spaces = \"<p>\" +\n getCitadel_attr(poi, \"#Citadel_parkSpaces\").text +\n \" available\" +\n \"</p>\";\n }\n contentTemplate +=\n \"<li>\" +\n \"<a href='' onclick='overrideDetailClick(\\\"\" + poi.id + \"\\\"); return false;'>\" +\n \"<img src='\" + getMarkerImage(poi, 'list') + \"' alt='Parking' />\" +\n \"<div>\" + poi.title + \"</div>\" +\n capacity + spaces +\n \"</a>\" +\n \"</li>\";\n });\n\n return contentTemplate;\n}", "title": "" }, { "docid": "f21b18c34f156003e8f04d984c12993d", "score": "0.5424545", "text": "function setInfoPage()\n{\n var contentTemplate =\n \"<li>Dataset ID: <b>\" + meta.id + \"</b></li>\" +\n \"<li>Created at: <b><time>\" + meta.created + \"</time></b></li>\" + \n \"<li>Updated at: <b><time>\" + meta.updated + \"</time></b></li>\" + \n \"<li>Language: <b>\" + meta.lang + \"</b></li>\" + \n \"<li>Author ID: <b>\" + meta.author_id + \"</b></li>\" + \n \"<li>Author Value: <b>\" + meta.author_value + \"</b></li>\" + \n \"<li>Created by: <b><a href='http://www.atc.gr' target='_blank'>atc.gr</a></b></li>\";\n\n return contentTemplate;\n}", "title": "" }, { "docid": "4f8dd75ffbe47eaba9aa3f3905f8d73f", "score": "0.54232687", "text": "function ProcessOneComic(item, index) {\n var li = document.createElement('li');\n ul.appendChild(li);\n\n li.innerHTML=li.innerHTML + index + \": \" + \" Rating: \" + item.rating + \" \" + item.title + \": \" + item.publisher;\n }", "title": "" }, { "docid": "5d1983d5115a3568ffdc5e33697ace34", "score": "0.54164636", "text": "function paginateList(list) {\n var numPerPage= 10;\n var startIndex = (currentPage * numPerPage) - numPerPage;\n var endIndex = currentPage * numPerPage;\n\n for(var i=0; i<list.length; i++) {\n if( i >= startIndex && i < endIndex) {\n //EXTRA CREDIT animation\n list[i].classList.add(\"fadeIn\");\n list[i].style.display=\"block\";\n }\n else {\n list[i].style.display=\"none\";\n }\n }\n }", "title": "" }, { "docid": "3b4d4bd6854bf635cff145241ac5229f", "score": "0.54153544", "text": "function showCoconuts(c) {\n\t\t$(\".coconut-container\").html(\"\");\n\t\tfor(i=0; i < coconuts; i++) {\n\t\t$(\".coconut-container\").append(\"<img src='img/coconut.svg' width='30'>\")\n\t\t}\n\t}", "title": "" }, { "docid": "39a9685fdf8f354685278e16b0bde343", "score": "0.5415315", "text": "function shownovel(data) { \n let tab=''; \n \n // Loop to access all rows \n for (let r of data.items) { \n let imgurl = '';\n if(r.images != undefined){\n for (z of r.images)\n var rl = z.url .split( '/' );\n console.log(rl)\n if (z.url.includes(\"bp.blogspot.com\")){\n imgurl += \"https://\"+rl[2]+\"/\"+rl[3]+\"/\"+rl[4]+\"/\"+rl[5]+\"/\"+rl[6]+\"/\"+imgsize+\"/\"+rl[8]\n }else{\n imgurl+=z.url\n }\n\n }\n else{\n imgurl += \"https://fiik346.github.io/img/noimage2by1.svg\";\n };\n tab += \n `<article class=\"card\">\n <a href=\"${r.url}\"><img class=\"card-img\" src=\"${imgurl.replace(/\\/s[0-9]/, \"/\"+imgsize)}\"/></a>\n <div class=\"card-body\">\n <h3 class=\"card-title\"><a href=\"${r.url}\">${r.title}</a></h3>\n </div>\n </article>`; \n } \n document.getElementById(\"novelist\").innerHTML = tab; \n }", "title": "" }, { "docid": "697470130087be621a72523ff3478f32", "score": "0.5408818", "text": "outputHobbies ()\n {\n // Paragraph (who's hobbies are these?)\n const hobbiesP = document.createElement( 'P' );\n hobbiesP.textContent = `${this.name}'s hobbies include:`;\n document.body.appendChild( hobbiesP );\n // List of hobbies.\n const hobbiesUL = document.createElement( 'UL' );\n // Loop through our hobbies... (for...of loop for Arrays!)\n for ( const hobby of this.hobbies )\n {\n // Create an LI.\n const hobbyLI = document.createElement( 'LI' );\n // Add the hobby text (array item value) to the LI.\n hobbyLI.textContent = hobby;\n // hobbyLI.style.fontWeight = \"bold\"; // DON'T DO THIS! INLINE IS HARD TO MAINTAIN!!!\n hobbyLI.classList.add( \"hobby-list-item\" ); // Do this instead :) Keep CSS where it belongs!\n // Add THIS <li> to the UL we made.\n hobbiesUL.appendChild( hobbyLI );\n } // Don't forget to add our populated <ul> to the <body>!\n document.body.appendChild( hobbiesUL );\n }", "title": "" }, { "docid": "45e0578c2fbe897c5b2670ba7a39916d", "score": "0.5402637", "text": "function buildList() {\n specialtiesCurr.find('.t-row').not('.t-heading').remove();\n\n for(var i = 0; i < specialties.length; i++) {\n //ONLY SHOW ACTIVE SPECIALTIES\n if(specialties[i].active == true) {\n addListItem(specialties[i], specialtiesCurr);\n }\n }\n }", "title": "" }, { "docid": "a3a7cf25288a3d30cc5f3a4bb3c1c9e3", "score": "0.5398935", "text": "function showList() {\n\t\t\t$state.go('catalog.list');\n\t\t}", "title": "" }, { "docid": "d3895d7113dd4d0a8d89a1e57290a52f", "score": "0.5391381", "text": "insertCuisine() {\n const cuisineList = document.querySelector('#cuisinesList ul');\n\n // Create the template\n cuisineList.innerHTML = `\n <li>Drexels Breakfast Restaurant Wellington</li>\n <li>Drexels Breakfast Restaurant Wellington</li>\n <li>Drexels Breakfast Restaurant Wellington</li>\n <li>Drexels Breakfast Restaurant Wellington</li>\n <li>Drexels Breakfast Restaurant Wellington</li>\n <li>Drexels Breakfast Restaurant Wellington</li> \n `;\n\n }", "title": "" }, { "docid": "428e5ba0dae883b42f4c48fc08a37982", "score": "0.53877133", "text": "function generateList() {\n var begin = ((currentPage - 1) * numberPerPage);\n var end = begin + numberPerPage;\n pageResults = queryResults.slice(begin, end);\n // Get page status \n var prevDisabled = currentPage === 1; // don't show 8\n var nextDisabled = currentPage === numberOfPages; // don't show 9\n liveNode.setAttribute(\"aria-busy\", \"true\");\n updateLiveInfo(pageResults, !prevDisabled, !nextDisabled);\n }", "title": "" }, { "docid": "ea00b7c9a3413441da08c510f1a78b00", "score": "0.5387075", "text": "function displayCupcakeList(cupcakes) {\n // First empty cupcakeList and cupcakeForm on DOM\n $cupcakesList.empty();\n $cupcakeForm[0].reset();\n\n\n\n for (let cupcake of cupcakes) {\n let $image = undefined;\n let $cupcake = $('<li style=\"height:300px\">');\n let $textField = $('<div>').addClass(\"col-3\");\n let $imageField = $('<div style=\"height:300px\">').addClass(\"col-9\");\n for (let [key, value] of Object.entries(cupcake)) {\n\n if (key === \"image\") {\n $image = $(`<img src=\"${value}\">`);\n $image.addClass(\"h-75\")\n $imageField.append($image);\n }\n else if (key !== \"id\") {\n let $field = $(\"<p>\").text(`${key}: ${value}`);\n $textField.append($field);\n }\n\n }\n $cupcake.append($textField);\n $cupcake.append($imageField);\n $cupcake.addClass(\"row\");\n $cupcakesList.append($cupcake);\n }\n}", "title": "" }, { "docid": "b5163bbbc853bb6af925932503235cb5", "score": "0.538592", "text": "function Listing (contact, date, desc, loc, money, photo, title, type) {\n\tthis.contact = contact;\n\tthis.date = date;\n\tthis.desc = desc;\n\tthis.loc = loc;\n\tthis.money = money;\n\tthis.photo = photo;\n\tthis.title = title;\n\tthis.type = type;\n}", "title": "" }, { "docid": "f3f23854fcba87e7670447a73dcbaccc", "score": "0.53850955", "text": "function printList(item, index){\n if (item.site != undefined && spec.length > 0){\n document.getElementById(\"emptyNotice\").style.display = \"none\";\n document.getElementById(\"list\").innerHTML += \"<div class=\\\"stationItem\\\"> <div class=\\\"station-name\\\">\" + item.site + \"</div> <div class=\\\"cfsLevel\\\">\" + item.cfs + \" CFS</div></div>\";\n } else if (spec.length <= 0) {\n document.getElementById(\"list\").style.display = \"inline\";\n }\n }", "title": "" }, { "docid": "a8f46ac6af98144a63f640872e6a6470", "score": "0.5384448", "text": "function showPage(list, page) {\n startIndex = (page * 9) - 9\n endIndex = page * 9\n studentList.innerHTML = '';\n for (let i = 0; i < list.length; i++) {\n if( i >= startIndex && i < endIndex ) {\n let studentItem = `\n <li class=\"student-item cf\">\n <div class=\"student-details\">\n <img class=\"avatar\" src=\"${list[i].picture.large}\" alt=\"Profile Picture\">\n <h3>${list[i].name.first} ${list[i].name.last}</h3>\n <span class=\"email\">${list[i].email}</span>\n </div>\n <div class=\"joined-details\">\n <span class=\"date\">${list[i].registered.date}</span>\n </div>\n </li>`\n studentList.insertAdjacentHTML(\"beforeend\", studentItem);\n }\n }\n if (list.length === 0) {\n studentList.innerHTML = '<li class=\"student-item cf\">No Results</li>'\n }\n}", "title": "" }, { "docid": "7f2c766abc25a12229e21614c10fdf9c", "score": "0.53807825", "text": "function allListings() {\n\n}", "title": "" }, { "docid": "8a8be250b6b7f8f45d4b247824a41de6", "score": "0.5379871", "text": "function display_people_results(list, container) {\n\n\tlist.sort(sort_people);\n\n\tlist.forEach(function (p) {\n\n\t\tlet section = document.createElement(\"section\");\n\t\tsection.setAttribute(\"class\", \"bio result\");\n\t\tlet img = document.createElement(\"div\");\n\t\t\timg.setAttribute(\"class\", \"headshot result\");\n\t\t\timg.style.backgroundImage = \"url(images/people/\"+p.name.replace(/ |\\(|\\)/g, \"\")+\".jpg)\"\n\t\tlet name = document.createElement(\"h3\");\n\t\t\tname.innerText = p.name + \", \" + p.title;\n\t\tlet position = document.createElement(\"h4\");\n\t\t\tposition.innerHTML = p.position;\n\n\t\tsection.appendChild(img);\n\t\tsection.appendChild(name);\n\t\tsection.appendChild(position);\n\t\tcontainer.appendChild(section);\n\t\t\n\t});\n}", "title": "" }, { "docid": "9010e92e9cdc582a098dd6454e4f85c8", "score": "0.5374489", "text": "function showPage (list, page) {\n const startIndex = (page * 9) - 9;\n const endIndex = (page * 9); \n const studentList = document.querySelector('.student-list');\n studentList.innerHTML = '';\n for (let i = 0; i < list.length; i++) {\n if (i >= startIndex && i < endIndex) {\n \n studentList.innerHTML += `\n <li class=\"student-item cf\">\n <div class=\"student-details\">\n <img class=\"avatar\" src=${list[i].picture.large} alt=\"Profile Picture\">\n <h3>${list[i].name.title} ${list[i].name.first} ${list[i].name.last}</h3>\n <span class=\"email\">${list[i].email}</span>\n </div>\n <div class=\"joined-details\">\n <span class=\"date\">Joined ${list[i].registered.date}</span>\n </div>\n </li> \n `;\n studentList.insertAdjacentHTML(\"beforeend\", studentList);\n }\n \n }\n }", "title": "" }, { "docid": "21f13b1b7e8fbb9cd502200389354cc5", "score": "0.5373535", "text": "function pageInfo(book)\n{\n\tvar pages = $(book).children('section');\n\tvar autore = $(book).attr('data-author');\n\tvar titolo = $(book).attr('data-title');\n\n\t//preparo le stringhe per le pagine\n\ttitolo = '<h1 class=\"info titolo\">' + titolo + ' di <span>' + autore + '</span></h1>';\n\t\n\t\t\n\t$(pages).each(function(index, value) {\n\t\tvar capitolo = $(value).attr('data-capther');\n\t\tvar titolo_capitolo = $(value).attr('data-title');\n\t\t//attribuisco un id univoco a ciascuna sezione o capitolo\n\t\t$(this).attr('id','cap' + capitolo);\n\t\t\n\t\t//preparo le stringhe per le pagine\n\t\ttitolo_capitolo = '<h2 class=\"info titoloCap\"><span>Capitolo: ' + capitolo + '</span> - ' + titolo_capitolo + '</h2>';\n\t\tcapitolo = '<span class=\"info capNumber\">' + capitolo + '</span>';\n\t\t\n\t\t//inserisco le stringhe nelle pagine\n\t\t$(this).prepend(titolo);\n\t\t$(this).prepend(titolo_capitolo);\n\t\t$(this).append(capitolo);\t\t\n\t}); \n}", "title": "" }, { "docid": "a9073a0572b20d3e6be2be305335f06f", "score": "0.53719985", "text": "function coconutCount(c) {\n\t\t$(\".coconut-count\").html(function(){\n\t\treturn \"<h1>Coconuts: \" + c + \"</h1>\"\n\t\t});\n\t}", "title": "" }, { "docid": "a2b39ba9c8c49e1c0520daffbd50ff56", "score": "0.5369883", "text": "function showPage(list, page) {\r\n\r\n page >= 1 ? (endIndex = 9 + ((page - 1) * 10), \r\n startIndex = 0 + ((page - 1) * 10)) : (endIndex, startIndex);\r\n\r\n\r\n // Loop passing through the student list displaying 10 items per page and hidding the rest\r\n list = studentList;\r\n for (let i = 0; i < list.length; i++) {\r\n if (i >= startIndex && i <= endIndex) {\r\n list[i].style.display = 'block';\r\n } else {\r\n list[i].style.display = 'none';\r\n }\r\n }\r\n}", "title": "" }, { "docid": "237e48bfb241561c4be647c6119e2a6d", "score": "0.53660107", "text": "function showPage(list, page) {\n //sets the first item from the student list to be shown on each page\n let startIndex = (page*itemsPerPage) - itemsPerPage;\n //sets the last item from the student list to be shown on each page\n let endIndex = (page*itemsPerPage);\n //loops over the list to determine which students will be shown on the page\n for (let i = 0; i < list.length; i +=1){\n //setting which items to display ('block') and which not to display ('none')\n if (i >= startIndex && i < endIndex){\n list[i].style.display = 'block';\n } else {\n list[i].style.display = 'none';\n }\n }\n }", "title": "" }, { "docid": "b89c78531b958fff676e112f5c1c5e3d", "score": "0.5363321", "text": "function showPage(list, page){\n const startIndex = (page * 9) - 9;\n const endIndex = page * 9;\n const studentUl = document.querySelector('.student-list');\n studentUl.innerHTML = '';\n for(let i=0; i < list.length; i++){\n if( i >= startIndex && i < endIndex){\n const studentLi = document.createElement('li');\n studentLi.className = 'student-item cf';\n studentUl.appendChild(studentLi);\n studentLi.insertAdjacentHTML('beforeend', `\n <div class=\"student-details\">\n <img class=\"avatar\" src=\"${list[i].picture.large}\" alt=\"Profile Picture\">\n <h3>${list[i].name.first} ${list[i].name.last}</h3>\n <span class=\"email\">${data[i].email}</span>\n </div>\n <div class=\"joined-details\">\n <span class=\"date\">Joined ${list[i].registered.date}</span>\n </div>\n `);\n }\n }\n \n}", "title": "" }, { "docid": "c3c5759c4dd2f42cf949586e9b8fa2fd", "score": "0.53574026", "text": "function showStudents(list, page) {\n let pageFirstIndex = 10 * page;\n let pageLastIndex = 10 * (page + 1) - 1;\n for (let i = 0; i < list.length; i++) {\n let listIndex = Array.prototype.indexOf.call(liItems, list[i]);\n\n if (listIndex >= pageFirstIndex && listIndex <= pageLastIndex) {\n list[i].style.display = \"\";\n } else {\n list[i].style.display = \"none\";\n }\n }\n }", "title": "" }, { "docid": "ccbf49ae621bf9349766465478d819ee", "score": "0.5354139", "text": "function kickstarterData() {\r\n showTree(KickstarterPledgesUrl, \"Kickstarter Pledges\", \"Top 100 Most Pledged Kickstarter Campaigns Grouped By Category\");\r\n}", "title": "" }, { "docid": "68909473cad9539908115dcdc6bfc435", "score": "0.5351973", "text": "function lastSix(url,Index){\n \n moreBtn.setAttribute(\"class\", \"show-more-button\");\n for(var g = 0; g < resultBlocks.length; g++){\n comicTitle = url.data.results[g+Index].title;\n describedComic[g].textContent = comicTitle;\n var imageUrl = url.data.results[g+Index].thumbnail.path + \".jpg\";\n thumbnails[g].setAttribute(\"src\", imageUrl);\n }\n for (let j = 0; j < learnMoreBtns.length; j++) {\n learnMoreBtns[j].addEventListener(\"click\", function(){\n var modalHtml = document.querySelector(\"#modal\");\n modalHtml.classList.add(\"is-active\");\n var comicSummary = url.data.results[j+Index].description;\n var available = url.data.results[j+Index].creators.available;\n comicCreators.innerHTML = '';\n if (comicSummary === null && available === 0) {\n modalFooter.textContent = url.data.results[j+Index].title;\n comicDescribed.textContent = \"No Comic description Available\";\n comicCreators.textContent = \"No Creators Listed\";\n } else if (available === 0){\n modalFooter.textContent = url.data.results[j+Index].title;\n comicDescribed.textContent = comicSummary;\n comicCreators.textContent = \"No Creators Listed\";\n } else if (comicSummary === null) {\n modalFooter.textContent = url.data.results[j+Index].title;\n var creator = url.data.results[j+Index].creators.items;\n for (let k = 0; k < creator.length; k++){\n var createdEL = document.createElement(\"p\");\n createdEL.textContent = creator[k].name;\n comicCreators.append(createdEL);\n }\n comicDescribed.textContent = \"No Comic Description Available\";\n } else {\n modalFooter.textContent = url.data.results[j+Index].title;\n var creator = url.data.results[j+Index].creators.items;\n for (let k = 0; k < creator.length; k++){\n var createdEL = document.createElement(\"p\");\n createdEL.textContent = creator[k].name;\n comicCreators.append(createdEL);\n }\n comicDescribed.textContent = comicSummary;\n }\n \n\n });\n }\n \n }", "title": "" }, { "docid": "3784204fad186b874eb560244c5c9b7a", "score": "0.5347326", "text": "function printCountryList(data) {\n clearCountries();\n for (let c of data) {\n let list = document.querySelector(\".listCountries\");\n let a = document.createElement(\"a\");\n let li = document.createElement('li');\n\n a.setAttribute('href', \"single-country.php?iso=\" + c.ISO);\n a.textContent = c.CountryName;\n\n list.appendChild(li);\n li.appendChild(a);\n }\n }", "title": "" }, { "docid": "d89819d81e5ee6cfa75f5acca423f926", "score": "0.5341013", "text": "function buildList() {\n specialtiesCurr.find('.t-row').not('.t-heading').remove();\n specialtiesEdit.find('p').remove();\n\n for(var i = 0; i < specialties.length; i++) {\n //ONLY SHOW ACTIVE SPECIALTIES\n if(specialties[i].active == true) {\n addListItem(specialties[i], specialtiesCurr);\n addListEdit(specialties[i], specialtiesEdit);\n }\n }\n }", "title": "" }, { "docid": "d7e96d8cd6f79a67a04caac88bc17bfe", "score": "0.5339994", "text": "function showPage ( list,page ) {\n const startIndex = ( page * 9 ) - 9; //first student on page\n const endIndex = ( page * 9 ); //last student on page\n studentList.innerHTML = ' '; // set innerHTML property to studentList to an empty string\n\n // loop over the length of the `list` parameter\n for ( let i = 0; i < list.length; i++) {\n let student = list[i];\n if ( i >= startIndex && i < endIndex ) {\n\n // create DOM elements to display using template literals\n let html = `\n <li class=\"student-item cf\">\n <div class=\"student-details\">\n <img class=\"avatar\" src=\"${student.picture.large}\" alt=\"Profile Picture\">\n <h3>${student.name.first} ${student.name.last}</h3>\n <span class=\"email\">${student.email}</span>\n </div>\n <div class=\"joined-details\">\n <span class=\"date\">Joined ${student.registered.date}</span>\n </div>\n </li>`;\n studentList.insertAdjacentHTML('beforeend', html ); // insert into DOM\n }\n }\n}", "title": "" }, { "docid": "75a975a2517aa5eec112b32be55c1cc8", "score": "0.53391623", "text": "function constructList(){\n const dataList = apiData.results;\n displayList.textContent = \"\";\n\n for(let i = 0 ; i < dataList.length ; ++i){\n const item = document.createElement(\"div\");\n item.className = \"item\"; if(mediaType == \"people\") item.className += \" profile\";\n item.id = i;\n \n //Adds a poster or a filler to the poster\n if(dataList[i].poster_path){\n const imgEl = document.createElement(\"img\");\n imgEl.src = \"https://www.themoviedb.org/t/p/w94_and_h141_bestv2/\" + dataList[i].poster_path;\n item.appendChild(imgEl);\n } else {\n const divEl = document.createElement(\"div\");\n divEl.className = \"imageFill\";\n var spanEl = document.createElement(\"span\");\n spanEl.textContent = \"Image\";\n divEl.appendChild(spanEl);\n\n spanEl = document.createElement(\"span\");\n spanEl.textContent = \"Not Found\";\n divEl.appendChild(spanEl);\n\n item.appendChild(divEl);\n }\n const divEl = document.createElement(\"div\");\n divEl.className = \"itemInfo\";\n const h2El = document.createElement(\"h2\");\n h2El.className = \"title\";\n h2El.textContent = dataList[i].name? dataList[i].name : dataList[i].title;\n divEl.appendChild(h2El);\n\n var pEl = document.createElement(\"p\");\n if(dataList[i].release_date) pEl.textContent = \"Released: \" + dataList[i].release_date.split(\"-\").join(\"/\");\n if(dataList[i].first_air_date) pEl.textContent = \"First Aired: \" + dataList[i].first_air_date.split(\"-\").join(\"/\");\n divEl.appendChild(pEl);\n\n pEl = document.createElement(\"p\");\n pEl.textContent = dataList[i].overview.slice(0, 130) + \"...\";\n divEl.appendChild(pEl);\n item.appendChild(divEl);\n\n item.addEventListener(\"click\", ()=>{\n location.href = location.origin + \"/Info.html?\" + mediaType + \"&\" + dataList[item.id].id;\n // console.log(\"pressing\");\n })\n\n displayList.appendChild(item);\n }\n updatePageNumbers();\n}", "title": "" }, { "docid": "7972e7b52e4084fc41de82ee561dc821", "score": "0.53306997", "text": "function getCountryDetails_HTML() {\n var result = \"\";\n var country = local[1];\n\n //01. Total number of visited cities\n result += \"<div class='countrydetail'><b>Усього відвідано:</b> \" + setLocationNumberWithCorrectEnd(country.getNumberOfVisitedCities()) +\n \" (\" + setRegionsNumberWithCorrectEnd(country.getNumberOfVisitedRegions()) + \")</div>\";\n\n //02.-03. Stories and Photos\n var ListOfStories = \"\";\n var photoAlbumLinks = \"\";\n\n $.each (visitsSorted, function( i, visit ){\n var countriesIDToReturn = \"\";\n var distinctIds = {};\n\n var citiesShownInPhotoAlbum = \"\";\n var VisitDateToShow = getVisitDate (visit.start_date, visit.end_date, true);\n\n //02. Total number and link to stories\n if (visit.story != \"\" && visit.story != null && visit.story != undefined){\n $.each (visit.cities, function( i, city ){\n if (!distinctIds[city.country_id]){\n countriesIDToReturn += city.country_id;\n distinctIds[city.country_id] = true;\n }\n });\n\n if (distinctIds[country.short_name]){\n var StartMonth = visit.start_date.getMonth() + 1;\n\n var url = (visit.story == true) ? \"id='\" + visit.start_date.getFullYear() + StartMonth + visit.start_date.getDate() + countriesIDToReturn + \"' onmouseover='' style='cursor: pointer;' onclick='javascript:getStoryPage(this.id)'\"\n : \"href='\" + visit.story + \"' target='_blank'\";\n\n ListOfStories += \"<a \" + url + \">\" + VisitDateToShow.slice(0, -2) + \", \" + \"</a>\";\n }\n }\n\n //03. Link of photos\n if (visit.photos != \"\" && visit.photos != null && visit.photos != undefined){\n $.each (visit.cities, function( i, city ){\n citiesShownInPhotoAlbum += (city.country_id == country.short_name) ? getRusLocationName(city.city_id) + \", \" : \"\" ;\n });\n\n photoAlbumLinks += (citiesShownInPhotoAlbum != \"\") ? \"<a href='\" + visit.photos + \"' title='\" + citiesShownInPhotoAlbum.substring(0, citiesShownInPhotoAlbum.length-2) +\n \"' target='_blank'>\" + VisitDateToShow.slice(0, -2) + \"; </a>\" : \"\";\n }\n });\n\n result += (ListOfStories.length > 0) ? \"<div class='countrydetail'><b>Звіти:</b> \" + ListOfStories + \"</div>\" : \"\";\n\n result += (photoAlbumLinks.length > 0) ? \"<div class='countrydetail'><b>Фото:</b> \" + photoAlbumLinks + \"</div>\" : \"\";\n //\"<a href='http://quetzal.io.ua/album558954' title='Тирана, Дуррес, Шкодер' target='_blank'>27.авг.2012; </a></div>\";\n\n //04. Link to technical information\n var techinfo_1 = \"\";\n if (country.map_img != undefined) {\n techinfo_1 = country.map_img.slice(0, -3) + \",\" + country.getListOfVisitedRegions();\n }\n\n\n var techinfo_2 = country.short_name + \";\";\n if (!country.city_state){\n $.each (citiesVisited, function( j, city ){\n if (city.getCountryId() == country.short_name) {\n techinfo_2 += city.name_ru + \",\" + city.lat + \",\" + city.long + \";\"\n }\n });\n }\n\n result += \"<div id='countryList' style='display:none;'>\" + techinfo_1 + \"</div>\" +\n \"<div id='cityList' style='display:none;'>\" + techinfo_2 + \"</div>\" +\n \"</div>\";\n\n return result;\n}", "title": "" }, { "docid": "70d408b98a2c3f9578f8f5a501fd30c6", "score": "0.53236175", "text": "function showPage(pageNum, list){\n //clear all \n for (let i = 0; i < $cards.length; i++){\n $cards[i].style.display = 'none';\n }\n // display the elements on the page\n for (let i = 0; i < list.length; i++){\n if(i + 1 > (pageNum * elementsPerPage) - elementsPerPage && i < pageNum * elementsPerPage){\n list[i].style.display = '';\n }\n }\n }", "title": "" }, { "docid": "b782ca496164b76875059d13c7ce7ac5", "score": "0.5321895", "text": "function moreInfo(){\r\n\tvar clickInfo;\r\n\tvar goals = [\"Selling over 150K Apparel\", \"Have over 20K Followers on our Instagram Page\",\"Have at least 60 Employees\"];\r\n\tvar iter = 0;\r\n\tvar S = \"\";\r\n\t\r\n\t\r\n\t//while loop to show each goal\r\n\twhile (iter < 3){\r\n\t\tS = \"<li>\" + goals[iter]+ \"</li>\" + S;\r\n\t\tdocument.getElementById(\"goal\").innerHTML = S;\r\n\t\titer ++;\r\n\t}\r\n}", "title": "" }, { "docid": "50f28f19d577f37d25e5326e898845e8", "score": "0.53218555", "text": "function golistcoupon() {\n\n doLoading();\n \n var store = new Lawnchair({name:'reponse'}, function(store){\n // Save it\n store.get('listcoupon', function(obj){\n if(obj) list_coupon = obj.data;\n \n console.log('Reading data : ' + JSON.stringify(obj));\n \n var nowDate = new Date();\n var newlistCoupon = [];\n total_coupon = 0;\n \n for(var i=0; i<list_coupon.length; i++)\n {\n var exDate = new Date(list_coupon[i].offerexpire);\n if(nowDate < exDate)\n {\n newlistCoupon.push(list_coupon[i]);\n total_coupon++;\n }\n else\n {\n // Delete image\n var entry = new FileEntry();\n entry.fullPath = list_coupon[i].offer.replace('file:', '');\n entry.remove(function(){ console.log('Delete file is success'); }, function(){ console.log('Delete file failed'); });\n }\n }\n \n list_coupon = newlistCoupon;\n \n // Resave\n var update = new Lawnchair({name:'reponse'}, function(update) {\n update.save({key:'listcoupon', data:newlistCoupon});\n });\n });\n });\n\n if ((isLoginValid() || loggedIn) && (list_coupon.length > 0)) {\n window.location.hash = \"#home\";\n window.location.hash = \"#page-offers\";\n loadListCoupon();\n setnavibar(2);\n } else {\n endLoading();\n \tnavigator.notification.alert( \"Respond to the video for possible offers.\", null , \"The Box Score\" , \"OK\");\n }\n}", "title": "" }, { "docid": "b232c8ad9ce8d56261838e654b8f595f", "score": "0.531735", "text": "function PopulateTOCPage() {\n WifiList = undefined;\n }", "title": "" }, { "docid": "b9ada8a8e71f4f84d27557ea0c165481", "score": "0.53134036", "text": "outputListOfHobbies()\n {\n // New list HTMLElement (<ul>)... and new list item added every time a new hobby is added\n const hobbyList = document.createElement( \"ul\" );\n // Create a for loop to automatically created li elements; remember for loops have 3 parts to thiem (assignment to keep track of value, termination condition (as soon as this is false, it will stop looping), iteration)\n // Loop, terminating based on length of our hobbies property (array data-type)\n for ( let index = 0; index < this.hobbies.length; index++ ) // index = index + 1\n { // New list item HTMLElement (<li>);\n const hobbyListItem = document.createElement ( \"li\" );\n // Add text inside of the HTMLElement\n hobbyListItem.textContent = this.hobbies[index]; // Index from our loop! Iterated each time\n // Add the list item HTMLElement (<li>) to the list HTMLElement (<ul>)\n hobbyList.appendChild( hobbyListItem );\n }\n // Add the whole populated list HTMLElement (<ul>) to the webpage! (inside the <body> )\n document.body.appendChild( hobbyList );\n // Can now type in jia.outputListOfHobbies() into the console and it will display onto your HTML page!\n }", "title": "" }, { "docid": "b8d07d7944973d0528de4ded8c5c5a27", "score": "0.5307154", "text": "function displayData(result) {\r\n var options = {\r\n valueNames: [\r\n 'NewConfirmed',\r\n 'NewDeaths',\r\n 'NewRecovered',\r\n 'TotalConfirmed',\r\n 'TotalDeaths',\r\n 'TotalRecovered'\r\n ],\r\n item: 'myitem',\r\n };\r\n\r\n \r\n document.getElementById(\"TotalConfirmed\").style.backgroundColor = \"lightblue\";\r\n document.getElementById(\"NewConfirmed\").style.backgroundColor = \"yellow\";\r\n document.getElementById(\"TotalRecovered\").style.backgroundColor = \"green\";\r\n document.getElementById(\"TotalDeaths\").style.backgroundColor = \"red\";\r\n document.getElementById(\"NewDeaths\").style.backgroundColor = \"orange\";\r\n\r\n var userList = new List('mylist', options, result);\r\n \r\n }", "title": "" }, { "docid": "d36964938a68918bcd61d66b8ee24f6f", "score": "0.5296134", "text": "function getCoinsToDisplay( coinList, topSection, favourites, filterCoins ) {\n // display either favourites or a slice of the top x coins\n return topSection ? favourites : getLowerSectionCoins(coinList, filterCoins);\n}", "title": "" }, { "docid": "8bf0593cac461195e4f9ce169b100a90", "score": "0.5295201", "text": "function createCC(data) {\n\n var cityName = data.city.name;\n\n $(\".main-header\").html(\"Tiempo en <span>\" + cityName + \"</span> en los proximos 5 dias\");\n\n $(\".city-name\").html(cityName);\n\n $.ajax({ // Obtenemos las imagenes de Flickr a traves de su API\n method: \"GET\",\n url: \"https://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=\" + apiKeyFlickr + \"&text=\" + cityName +\n \"&sort=relevance&per_page=5&safe_search=3&format=json&nojsoncallback=1\"\n })\n .done(function(dataF) {\n setPhotos(dataF.photos.photo);\n });\n\n setDates(data.list);\n setTemps(data.list);\n setIcons(data.list);\n\n $(\".cards\").animate({ opacity: 1 }, { queue: false, duration: 'slow' });\n }", "title": "" }, { "docid": "14324b5ec878ee846e3bb09ac44ef6d3", "score": "0.5292338", "text": "function getPersonalListingsOnMap() {\r\n coinAjax.listing(\"GET\").then((response) => {\r\n var res = JSON.stringify(response);\r\n if (res.charAt(0) == \"<\") {\r\n return;\r\n }\r\n var listings = JSON.parse(res);\r\n if (listings.length > 10) listings.slice(0, 10);\r\n listings.forEach(function(i) {\r\n var button = document.createElement(\"BUTTON\");\r\n button.setAttribute(\"href\", \"#\");\r\n button.setAttribute(\"id\", i.slug);\r\n button.setAttribute(\"class\", \"w3-button w3-black\");\r\n\r\n var h = document.createElement(\"p\");\r\n var t = document.createTextNode(i.title);\r\n var u = document.createTextNode(i.price.amount + i.price.currencyCode);\r\n var v = document.createTextNode(i.description);\r\n var v1 = document.createTextNode(i.shipsTo.toString());\r\n document.getElementById(\"coin-catalog\").appendChild(h);\r\n\r\n\r\n h.appendChild(button);\r\n button.appendChild(t);\r\n button.appendChild(document.createElement(\"br\"));\r\n button.appendChild(u);\r\n button.appendChild(document.createElement(\"br\"));\r\n button.appendChild(v);\r\n if (i.thumbnail != null) {\r\n coinAjax.img(\"GET\", i.thumbnail.small).then(function(res) {\r\n var imm = document.createElement(\"IMG\");\r\n pic = res;\r\n\r\n var urlCreator = window.URL || window.webkitURL;\r\n var imageUrl = urlCreator.createObjectURL(pic);\r\n imm.setAttribute(\"src\", imageUrl);\r\n imm.setAttribute(\"width\", \"304\");\r\n imm.setAttribute(\"height\", \"228\");\r\n\r\n button.appendChild(imm);\r\n });\r\n }\r\n button.addEventListener(\"click\", function() {\r\n items(id);\r\n });\r\n\r\n })\r\n }).catch((err) => {\r\n alert(JSON.stringify(err));\r\n });\r\n}", "title": "" }, { "docid": "fabff20d5d27b1b6c1dbf07ef5498a03", "score": "0.528614", "text": "function selection_list() {\n var table = dao[cocoon.parameters.table];\n if (!table) throw \"No table named \" + table;\n cocoon.sendPage(\"selection-list.xml\", { items: table.selectionList() });\n}", "title": "" }, { "docid": "73f60e09078ef2a2494e61766d5b54f4", "score": "0.52826566", "text": "function listDetails(trail){\n var itemList = document.querySelector('#item-list');\n itemList.innerHTML = ''; // clear current results\n addDetails(itemList, trail);\n}", "title": "" }, { "docid": "cd31a70355d8e0c05566fbad3f618ec5", "score": "0.52779895", "text": "function displayTopicsCurrentPage(page) {\n if (!isActiveTabRefr) {\n return;\n }\n\n var topicsArray = [];\n // Obtention de la liste des topics\n if (page == null) {\n topicsArray = getTopics(document, false);\n }\n else {\n // met à jour compteur de connecté quand on affiche une liste rafraichir\n updateNbCo(page);\n topicsArray = getTopics(page, false);\n }\n // on sépare les topics épinglés des topics normaux\n var epingles = topicsArray[0];\n var topicsCurrentPage = topicsArray[1];\n\n // si l'onglet tri et affiche seulement la liste des tendances\n // ou que\n // la liste n'est pas bloquée et que l'onglet courant est trié\n // Trier la liste à afficher par poids en tendance\n if (((areTrendDsp && areTrendSort) && areTopicsSort) ||\n (areTopicsSort && isActiveTabSort)) {\n sortByWeight(topicsCurrentPage);\n }\n\n // Applique la couleur sur les topics\n setCssTopics(topicsCurrentPage);\n\n var ul = document.createElement('ul');\n\n ul.classList.add('topic-list', 'topic-list-admin');\n\n ul.appendChild(topicHead);\n\n // copie les épingles en premier dans la liste qui va être affichée\n var lengthPinned = epingles.length;\n for (var x = 0; x < lengthPinned; x++) {\n jvCake(epingles[x][1].getElementsByClassName('topic-date')[0].getElementsByTagName('span')[0]);\n ul.appendChild(epingles[x][1]);\n }\n // puis copie les topics\n var lengthNotPinned = pageLen - lengthPinned;\n for (var x = 0; x < lengthNotPinned; x++) {\n jvCake(topicsCurrentPage[x][1].getElementsByClassName('topic-date')[0].getElementsByTagName('span')[0]);\n ul.appendChild(topicsCurrentPage[x][1]);\n }\n\n var fragmentUL = document.createDocumentFragment();\n fragmentUL.appendChild(ul.cloneNode(true));\n\n var element = document.getElementsByClassName('topic-list topic-list-admin')[0];\n // Affiche\n element.parentNode.replaceChild(fragmentUL, element);\n\n // Met en place le blocage du rafraichissement des topics lorsque le curseur est sur la nouvelle liste affichée\n var conteneur = document.getElementsByClassName('conteneur-topic-pagi')[0];\n conteneur.addEventListener(\"mouseenter\", function(e) { states.setIsHoverCursor(true); }, false);\n conteneur.addEventListener(\"mouseleave\", function(e) { states.setIsHoverCursor(false); }, false);\n}", "title": "" }, { "docid": "33846da696d6a0ef9609e79ad33b765d", "score": "0.5275861", "text": "function showPage (list, page) {\n const startIndex = (page * itemsPerPage) - itemsPerPage;\n const endIndex = page * itemsPerPage;\n for (i = 0; i < list.length; i++) { //looping through the student list\n if (i >= startIndex && i < endIndex) {\n listItem[i].style.display = \"\";\n } else {\n listItem[i].style.display = \"none\";\n }\n }\n}", "title": "" }, { "docid": "db9402160bb39d16d6cd2728ac60d2bc", "score": "0.5274213", "text": "function showPage(list, page) {\n //startIndex and endIndex calculate the index for the first and last students to display on a page\n const startIndex = (page * perPage) - perPage;\n const endIndex = (page * perPage);\n //studentList stores a reference to the ul element with a class of '.student-list', to which student data will be added\n const studentList = document.querySelector('.student-list');\n //remove any previously displayed students from the page\n studentList.innerHTML = '';\n //loop through every object (student) in list, and check to see if the objects fall within our start & end index boundaries\n //if condition is met, create and insert DOM elements to display the students within that index range\n for (let i = 0; i < list.length; i += 1) {\n if ( i >= startIndex && i < endIndex) {\n let studentItem = list[i];\n let html = '';\n \n html += `\n <li class=\"student-item cf\">\n <div class=\"student-details\">\n <img class=\"avatar\" src=\"${studentItem.picture.large}\" alt=\"Profile Picture\">\n <h3>${studentItem.name.first} ${studentItem.name.last}</h3>\n <span class=\"email\">${studentItem.email}</span>\n </div>\n <div class=\"joined-details\">\n <span class=\"date\">${studentItem.registered.date}</span>\n </div>\n </li>\n `;\n studentList.insertAdjacentHTML('beforeend', html);\n } \n }\n}", "title": "" }, { "docid": "43da45eb2980c960db3566a98f592c1b", "score": "0.52737665", "text": "function showContactsBrief() {\n\t// if there are contacts to show, remove the 'hidden' class from the header\n\tif (contacts.length > 0) {\n\t\t$('.contactHeader').removeClass(\"hidden\");\n\t};\n\n\t// remove any existing data that is displayed\n\t$('ul.brieflist').empty();\n\n\t//sort array alphabetically (sorts the array in place)\n\t//soting the whole array each time an item is added would \n\t// not be efficient for large arrays, but will suffice for here\n\tcontacts.sort( function (a,b){\n\t\tvar nameA = a.lname.toUpperCase(); // ignore case for sort purposes\n \t\tvar nameB = b.lname.toUpperCase(); \n\t\tif (nameA < nameB) {\n\t\t return -1;\n\t\t}\n\t\tif (nameA > nameB) {\n\t\t return 1;\n\t\t}\n\t\t// names must be equal\n\t\treturn 0;\n\t});\n\n\t// display each contact name which is click-able\n\tfor (var i=0; i<contacts.length; i++) {\n\t\tvar html = \"\";\n\t\thtml += \"<li id='contact_\" + i+ \n\t\t \"' onclick='showContactDetail(\" + i + \")'>\" + \n\t\t\tcontacts[i].fname + \" \" + contacts[i].lname + \"</li>\";\n\t\t$('.brieflist').append(html);\n\t};\n}", "title": "" }, { "docid": "07471a0b2867efd726ca56127c023b55", "score": "0.52717346", "text": "function showPage (list, page) { //Function created to show a page of 9 students.\n let startIndex = (page * 9) - 9; \n let endIndex = page * 9;\n\n//Select the UL element with the class student-list and assigned to te studentList variable.\n let studentList = document.querySelector(\".student-list\");\n \n//Set the HTML content of student-list to an empty string.\n studentList.innerHTML = \"\";\n \n //Created a for loop to to loop over the list parameter. \n for (let i = 0; i < list.length; i++) {\n \n//Added a conditional statment for the beginning and end of the student index. \n if(i >= startIndex && i < endIndex) {\n let studentIndex = list[i];\n \n//Used a template literal and interpolation to create the DOM elements to display the information for the students on the page. \n let studentItem = `<li class=\"student-item cf\">\n <div class=\"student-details\">\n <img class=\"avatar\" src=\"${studentIndex.picture.large}\" alt=\"Profile Picture\">\n <h3>${studentIndex.name.first}${studentIndex.name.last}</h3>\n <span class=\"email\">${studentIndex.email}</span>\n </div>\n <div class=\"joined-details\">\n <span class=\"date\">${studentIndex.registered.date}</span>\n </div>\n </li>`;\n\n//Inserted these newly created elements into the HTML using the 'insertAdjacentHTML' & 'beforeend' method.\n studentList.insertAdjacentHTML('beforeend', studentItem);\n\n }\n }\n}", "title": "" }, { "docid": "b8091f4c748c8f873ffd9584513bb26e", "score": "0.5265465", "text": "displayOnPage(page, moreData) { \n this.html += `\n <tr>\n <td class=\"table-id\">${moreData.id}</td>\n <td>${moreData.name}</td>\n <td>${moreData.city}</td>\n <td>${page.total}</td>\n <td>${page.averageIncome}</td>\n <td>${page.totalMoney}</td>\n </tr>\n `;\n }", "title": "" }, { "docid": "4b5df94bdb611e1388f0bf196176302b", "score": "0.5257702", "text": "function displayWikiList(data) {\n $(\".results\").html(\"\");\n for (var item in data) {\n $(\".results\").append(\n \"<a href='\" + data[item].fullurl + \"'>\"+\n \"<div class='def panel panel-default'>\" +\n \"<div class='panel-heading entry-title'><h3>\" + data[item].displaytitle + \"</h3></div>\" +\n \"<div class='snippet panel-body'>\" + data[item].extract + \"</div>\" +\n \"</div>\" +\n \"</a>\"\n )\n }\n }", "title": "" }, { "docid": "fde4fdeeb792dac6c223f5956507f99c", "score": "0.52572775", "text": "function loadDrinksPage() {\n display501();\n display502();\n display503();\n display504();\n display505();\n display506();\n display507();\n display508();\n}", "title": "" }, { "docid": "b478045b8b8d114ddf6b77c2e14ec8ed", "score": "0.52536523", "text": "function _lister(){\n var listeBieres = Catalogue.list();\n \n _Afficher(listeBieres);\n }", "title": "" }, { "docid": "3311e90f790b4da3057888020616f9d7", "score": "0.5252264", "text": "function showPage(list, page){\n const startIndex = (page*perPage) - perPage;\n const endIndex = page*perPage;\n ulStudentList.innerHTML = '';\n if(list.length != 0){\n for(let i = 0; i < list.length; i++) {\n if(i >= startIndex && i < endIndex){\n ulStudentList.insertAdjacentHTML('beforeend',\n `<li class=\"student-item cf\">\n <div class=\"student-details\">\n <img class=\"avatar\" src=${list[i].picture.large} alt=\"Profile Picture\">\n <h3>${list[i].name.first} ${list[i].name.last}</h3>\n <span class=\"email\">${list[i].email}</span>\n </div>\n <div class=\"joined-details\">\n <span class=\"date\">Joined ${list[i].registered.date}</span>\n </div>\n </li>`);\n }\n }\n }else{\n ulStudentList.innerHTML = 'No results found';\n } \n}", "title": "" }, { "docid": "4751ee64f02a74f0cbd49ce1386d48ea", "score": "0.5250033", "text": "static displayBooks() {\n window.books = Store.getBooks();\n books.forEach((book) => UI.addBookToList(book));\n }", "title": "" }, { "docid": "af762a232466046e41deedd4d7ea6a13", "score": "0.5248736", "text": "function insertCustomerCoBranding(maxBranding)\n{\n\tif( customerCoBranding[0].image != \"none\")\n\t{\n\t\tdocument.writeln('<div id=\"providedBy\" class=\"item\">');\n\t\tdocument.writeln('<h5><img src=\"http://download.interscience.wiley.com/images/txt.provided-by.gif\" width=\"71\" height=\"16\" alt=\"provided by\" border=\"0\" /></h5>');\n\t\tdocument.writeln('<ul class=\"noBullet\">');\n\n\t\tvar i;\n\t\t//Change start for bug#2288\n\t\tif(typeof(maxBranding) == \"undefined\" | maxBranding == \"\" | maxBranding == 0){\n\t\t\tmaxBranding = 3; // DEFAULT Value for No of Cobranding dispaly\n\t\t}\n\t\tvar size = customerCoBranding.length;\n\t\tif(maxBranding != -1 & size-1 > maxBranding){\n\t\t\tsize = maxBranding;\n\t\t}\n\t\t//Change End for bug#2288\n\n\t\t// Add the co-branding images o the page.\n\t\t//for(i=0; i < customerCoBranding.length; i++ )\n\t\tfor(i=0; i < size; i++ )\n\t\t{\n\t\t\t// ignore the terminating array element.\n\t\t\tif(customerCoBranding[i].image == \"none\")\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tthis.image = customerCoBranding[i].image;\n\t\t\tthis.imageAltText = customerCoBranding[i].imageAltText;\n\t\t\tthis.href = customerCoBranding[i].href;\n\n\t\t\tif (image == \"\")\n\t\t\t{\n\t\t\t\tif(href == \"\")\n\t\t\t\t{\n\t\t\t\t\tdocument.writeln('<li>' + imageAltText + '</li>');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tdocument.writeln('<li><a href=\"' + href + '\">' + imageAltText + '</a></li>');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(href == \"\")\n\t\t\t\t{\n\t\t\t\t\tdocument.writeln('<li><img src=\"' + image + '\" alt=\"' + imageAltText + '\" border=\"0\" /></li>');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tdocument.writeln('<li><a href=\"' + href + '\"><img src=\"' + image + '\" alt=\"' + imageAltText + '\" border=\"0\" /></a></li>');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If there are more co-branding images add in a link to them.\n\t\t// Changes made for Bug#2288\n\t\t//if(moreCustomerCoBranding == \"true\")\n\t\tif(maxBranding != -1 & customerCoBranding.length-1 > maxBranding)\n\t\t{\n\t\t\tdocument.writeln('<li><a href=\"/cgi-bin/myprofile\" class=\"linkMore\">More Providers</a></li>');\n\t\t}\n\n\t\tdocument.writeln('</ul>');\n\t\tdocument.writeln('</div>');\n\t\tdocument.writeln('<div class=\"line\"><img src=\"http://download.interscience.wiley.com/images/dot.CCC.gif\" width=\"100%\" height=\"1\" alt=\"\" border=\"0\" /></div>');\n\t}\n}", "title": "" }, { "docid": "ec58e49ebb358837b6c9b55f99c8eb36", "score": "0.52447426", "text": "function getAndDisplayHomes(){\n getListOfHomesFromDB()\n}", "title": "" }, { "docid": "fda875fa1e928a4b45639eceeebd1828", "score": "0.52429986", "text": "function displayCourses(){\n\t//Get the no. of courses by using the array length\n\tvar noOfCourses = varshaK.courses.length;\n\tvar courseMsg = \"<b>Courses :</b>\";\n\tcourseMsg += \"<ul>\";\n\t//Iterate the array to create the HTML unordered list of all the courses in it.\n\tfor (i=0;i < noOfCourses; i++){\n\t\t\n\t\tcourseMsg += \"<li>\" + varshaK.courses[i] +\"</li>\";\n\t}\n\t//Display the courses in the HTML tag destined for the courses.\n\tdocument.getElementById('student_courses').innerHTML = courseMsg;\n\treturn false;\n}", "title": "" }, { "docid": "8d6068c3fdfe4a7cea3cef4cd3c56420", "score": "0.52428913", "text": "function ViewItems(){\n\t\t\t\tvar myCookies = document.cookie.length;\n\t\t\t\tvar individualCookies = document.cookie.split(';');\n\t\t\t\tfor (var i = 0; i < individualCookies.length; i++)\n\t\t\t\t {\n\t\t\t\t\tvar oneCookie = individualCookies[i].split(\"=\");\n\t\t\t\t\tvar name = oneCookie[0];\n\t\t\t\t\tvar value = oneCookie[1];\n\t\t\t\t\tif(name == 'Future Of boxing')\n\t\t\t\t\t {\n\t\t\t\t\t\tvar temp= 7;\n\t\t\t\t\t\tvar temp2= temp*value;\n\t\t\t\t\t\tdocument.write(name +\"By David Flynn. No. of Copies: \"+value+\".Total cost = \"+temp2);\n\t\t\t\t\t }\n\t\t\t\t \n\t\t\t\t }\n\t\t\t\tdocument.write('test');\n\n\t\t\t}", "title": "" }, { "docid": "e063d1a90bb61be0f8e0313614cee197", "score": "0.5240086", "text": "function renderListCB(tx,results){\n var htmlString = '';\n var len = results.rows.length;\n for (var i=0;i<len;i++){\n\n //htmlString+='<li>'+results.rows.item(i).title+'<br>'+results.rows.item(i).author+'</li>';\n\n htmlString+=' <li style=\"margin-left: -90px;\">'\n +'<a href=\"#detailNewsPage'+results.rows.item(i).id_main+'\">'\n +'<div class=\"newsheader\">'+results.rows.item(i).title+'</div>'\n +'<img class=\"newsImg\" src=\"'+results.rows.item(i).img_path+'\" align=\"left\">'\n +'<div style=\"white-space:normal;\" class=\"newsD\">| '+results.rows.item(i).date+' | '+results.rows.item(i).country+'</div>'\n +'<p style=\"white-space:normal;\" class=\"newP\">'+results.rows.item(i).s_desc+'</p></a></li> ';\n \n }\n $('#ListNews').html(htmlString);\n $('#ListNews').listview('refresh');\n\n }", "title": "" }, { "docid": "053f29e78e25b7d88f2beed516f629ee", "score": "0.52368367", "text": "function main() {\n showPage(studentListChildren, 1);\n inputSearch();\n getSearch();\n appendPageLinks(studentListChildren);\n\n}", "title": "" }, { "docid": "e316858da471453e7f0e9eb6e1c03aad", "score": "0.5236003", "text": "function do_list_employees() {\n var list = dao.employee.getAll();\n // Call the view, giving it the list and also the dao to get department names\n cocoon.sendPage(\"employee-list.html\", { employees: list, dao: dao });\n}", "title": "" }, { "docid": "e23374232993b65c918e60a4c18548ff", "score": "0.52326643", "text": "function see_it_all() {\r\n var t;\r\n\r\n var init = function(toggle,list) {\r\n $(toggle).observe('click', function() {\r\n clearTimeout(t);\r\n closeDDs();\r\n if ($$('.wazmu')[0] != $(this)) {\r\n $$('.wazmu')[0].removeClassName('wazmu');\r\n $('category_links').childElements('span').invoke('hide');\r\n $(this).addClassName('wazmu');\r\n $(list).appear({duration:0.6});\r\n };\r\n }); \r\n }\r\n init(\"see_shop\",\"shop_links\");\r\n init(\"see_share\",\"share_links\");\r\n init(\"see_organize\",\"options_links\");\r\n \r\n $$('#see_it_all #category_links li a').invoke('observe', 'mouseenter', function() {\r\n clearTimeout(t);\r\n closeDDs();\r\n var pos = $(this).cumulativeOffset(),\r\n menu = $($(this).id + 'TT');\r\n $(this).addClassName('active');\r\n menu.setStyle({\r\n 'left': pos[0] - 155 + 'px',\r\n 'top': pos[1] + 20 + 'px'\r\n }).appear({duration:0.2}).observe('mouseleave', function() {\r\n t = setTimeout(function() {\r\n closeDDs();\r\n }, 100);\r\n }).observe('mouseenter', function() {\r\n clearTimeout(t);\r\n });\r\n }).invoke('observe', 'mouseleave', function() {\r\n t = setTimeout(function() {\r\n closeDDs();\r\n }, 50);\r\n });\r\n\r\n var closeDDs = function() {\r\n $$('.seeTTcontainer').invoke('hide');\r\n $$('see_it_all .active').invoke('removeClassName', 'active');\r\n };\r\n\r\n}", "title": "" }, { "docid": "d541625a61664cb748c21822028e3c26", "score": "0.5232032", "text": "function showPage (list, page) {\n const startIndex = (page * 9) - 9;\n const endIndex = page * 9;\n const studentList = document.querySelector('.student-list');\n studentList.innerHTML = ''; \n\n for (let i = 0; i < list.length; i ++) {\n let student = list[i];\n \n if (i >= startIndex && i < endIndex) {\n const newHtml = `\n <li class = \"student-item cf\">\n <div class = \"student-details\">\n <img class = \"avatar\" src = \"${student.picture.large}\" alt = \"Profile Picture\">\n <h3>${student.name.first} ${student.name.last}</h3>\n <span class = \"email\">${student.email}</span>\n </div>\n <div class = \"joined-details\">\n <span class =\"date\"> ${student.registered.date}</span>\n </div>\n </li>\n `;\n\n studentList.insertAdjacentHTML('beforeend', newHtml);\n\n }\n }\n}", "title": "" }, { "docid": "a41b90d7d189efc630d6d6ad52b6773f", "score": "0.52316976", "text": "function DisplayFullCharityList() {\n\t// Charity List\n\t$charityMap = {};\n for (var i in $categoryDisplayOrder) {\n \tGetCharityList(DisplayCharityList, {category: $categoryDisplayOrder[i], display_full_list: false});\n }\n}", "title": "" }, { "docid": "05bf3a32c58da86bc3296bf417dcab90", "score": "0.5231533", "text": "static displayBooks() {\n const books = Store.getBooks();\n\n //loop and add every book to the list\n books.forEach(function (book) {\n const ui = new UI();\n\n ui.addBookToList(book);\n });\n }", "title": "" }, { "docid": "f356f1a94b7b9c681b5953987f138d30", "score": "0.52300465", "text": "function populateHeadlineList(results, headLineList) {\n idNumber = 0\n results.forEach(function (result) {\n //let aylienURL = \"http://news-summary-api.herokuapp.com/aylien?apiRequestUrl=https://api.aylien.com/api/v1/summarize?url=\" + result.webUrl\n //var request = new XMLHttpRequest();\n headLineList.innerHTML += `<p onclick=\"showSummary()\" class='headline' id='${idNumber}' >${result.webTitle}<br></p>`;\n idNumber += 1\n addGuardianLink(result, headLineList);\n });\n //request.open('Get', aylienURL)\n //request.send()\n}", "title": "" }, { "docid": "e3a00dbb3eb15add2c93ae9e75833924", "score": "0.52299166", "text": "function getFobMeetings(url, listItem) {\n NAV.ajaxGet(url, function (data) {\n CMN.initDisplayListStyle(jQuery(listItem).html(data));\n });\n }", "title": "" }, { "docid": "c662c8f3f146df108ec01a421e5082a0", "score": "0.522548", "text": "function showCourses(){\n\t\t$.ajax({\n\t\t\turl : \"/courses\",\n\t\t\tmethod: \"GET\",\n\t\t\tsuccess : function(data){\n\t\t\t\tvar tableData= [];\n\t\t\t\tfor(i=0; i<data.length; i++){\n\t\t\t\t\ttableData.push(data[i].code);\n\t\t\t\t}\n\t\t\t\tcreateTable(tableData, true);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "9a2c083c36780337927244b26fa7b314", "score": "0.5219068", "text": "function homeline_about_us_page() {\n\t\tif ( !( $( 'body' ).hasClass( 'about-us-page' ) ) ) return false;\n\n\t\t$( '.counter-value' ).counterUp( {\n\t\t\tdelay: 10,\n\t\t\ttime: 1000\n\t\t} );\n\t}", "title": "" }, { "docid": "a4402d932dd2a592ae800e82989b7649", "score": "0.52184284", "text": "function showMajor(objectURL, house) {\n //console.log(\"got to showhouse\");\n // create <section>, <h2>, <p>, and <img> elements\n major.textContent = \"Department: \" + major.major;\n advisors.textContent = \"Majors: \" + major.advisors;\n course.textContent = \"Course: \" + major.course;\n credits.textContent = \"Credits Required: \" + major.credits;\n }", "title": "" }, { "docid": "9be78fa40a28cbaa90813ead19a5cc78", "score": "0.52179", "text": "function populate_member_list(){\n\tvar h = new Object();\n\t// name Description \n\th[\"Maria Aparecida Aride Bertonceli\"] = {\"course\":\"Doutorando\",\"lab\":\"LQFPP\",\"univ\":\"UENF\",\"lattes\":\"http://lattes.cnpq.br/9217151774218625\", 'dp':'cida.jpg'};\n\th[\"Gabriela Petroceli Mota\"] = {\"course\":\"Doutorando\",\"lab\":\"LFBM\",\"univ\":\"UENF\",\"lattes\":\"http://buscatextual.cnpq.br/buscatextual/visualizacv.do?id=K8736711P5\", 'dp':'gabri.jpg'};\n\th[\"Yrexam Rodrigues de Souza Ribeiro \"] = {\"course\":\"Doutorando\",\"lab\":\"LBCT\",\"univ\":\"UENF\",\"lattes\":\"http://lattes.cnpq.br/1626204785454495\", 'dp':'yrexam.jpg'};\n\th[\"Francisnei Pedrosa da Silva\"] = {\"course\":\"Doutorando\",\"lab\":\"LQFPP\",\"univ\":\"UENF\",\"lattes\":\"http://lattes.cnpq.br/8154976376584399\", 'dp':'fransis.jpg'};\n\th[\"Leticia Silva Nascimento\"] = {\"course\":\"Doutorando\",\"lab\":\"LBR \",\"univ\":\"UENF\",\"lattes\":\"http://buscatextual.cnpq.br/buscatextual/visualizacv.do?id=K8150997A2\", 'dp':'leticia.jpg'};\n\th[\"Sanderson Dias Calixto\"] = {\"course\":\"Doutorando\",\"lab\":\"LBR\",\"univ\":\"UENF\",\"lattes\":\"http://lattes.cnpq.br/4705348856252126\", 'dp':'sanderson.jpg'};\n\th[\"Alan Tardin da Silva\"] = {\"course\":\"Doutorando\",\"lab\":\"LBT\",\"univ\":\"UENF\",\"lattes\":\"http://buscatextual.cnpq.br/buscatextual/visualizacv.do?id=K4332211P4\", 'dp':'alan.jpg'};\n\th[\"Ulli Barros Oliveira\"] = {\"course\":\"Doutorando\",\"lab\":\"LQFPP\",\"univ\":\"UENF\",\"lattes\":\"http://lattes.cnpq.br/7076969411682965\", 'dp':'ulli.jpg'};\n\th[\"Rebeka Souza\"] = {\"course\":\"Doutorando\",\"lab\":\"LBR\",\"univ\":\"UENF\",\"lattes\":\"http://lattes.cnpq.br/7019355651582809\", 'dp':'rebeka.jpg'};\n\th[\"Luiza Gonçalves Ayres\"] = {\"course\":\"Mestrando\",\"lab\":\"LBR\",\"univ\":\"UENF\",\"lattes\":\"http://lattes.cnpq.br/2853673446493637\", 'dp':'luiza.jpg'};\n\th[\"Kanhu Charan Moharana\"] = {\"course\":\"Doutorando\",\"lab\":\"LQFPP\",\"univ\":\"UENF\",\"lattes\":\"http://lattes.cnpq.br/2585560606421215\", 'dp':'kcm.jpg'};\n\th[\"Enrico Cossi Arantes\"] = {\"course\":\"Mestrando\",\"lab\":\"LBCT\",\"univ\":\"UENF\",\"lattes\":\"http://lattes.cnpq.br/9984795509104651\", 'dp':'enrico.jpg'};\n\th[\"Fernanda Soares dos Santos Chaves\"] = {\"course\":\"Mestrando\",\"lab\":\"Lbct\",\"univ\":\"UENF\",\"lattes\":\"http://lattes.cnpq.br/9271217223620635\", 'dp':'nanda.jpg'};\n\th[\"Vinicius de Oliveira Mussi\"] = {\"course\":\"Doutorando\",\"lab\":\"LBR\",\"univ\":\"UENF\",\"lattes\":\"http://lattes.cnpq.br/5666772356410059\", 'dp':'vinicius.jpg'};\n\th[\"Milena Bellei Cherene\"] = {\"course\":\"Doutorando\",\"lab\":\"LFBM\",\"univ\":\"UENF\",\"lattes\":\"http://lattes.cnpq.br/8319659060612916\", 'dp':'mellina.jpg'}; \n\th[\"Nayara Vigneron de Oliveira\"] = {\"course\":\"Mestrando\",\"lab\":\"LBR\",\"univ\":\"UENF\",\"lattes\":\"#\", 'dp':'profile_F.jpg'}; \n\th[\"Douglas Ribeiro Lucas\"] = {\"course\":\"Mestrando\",\"lab\":\"\",\"univ\":\"UENF\",\"lattes\":\"#\", 'dp':'profile_M.jpg'}; \n\t// Luu Riberiro, Milena, Douglas\n\t//https://forms.gle/znuia75AofnQtU329\n\t//h['Leticia Nascimento'] = {\"course\":\"Doutorando\",\"lab\":\"LQFPP\", \"univ\":\"UENF\", \"lattes\":\"#\"};\n for(var member_name in h){\n document.getElementById('member_list').innerHTML = document.getElementById('member_list').innerHTML + \n '<p class=\"member_details\" >'+\n\t\t \"<img src='img/members/\"+h[member_name].dp+\"' src='\"+h[member_name].dp+\"' />\"+\n\t\t \"<span>\"+\n\t\t\t\"<a href='\"+h[member_name].lattes+\"' target='_blank'> \"+member_name+'</a>'+\n\t\t\t\"<span style='font-style:italic;'> \"+h[member_name].course+\"</span>\" +\n\t\t\t\"<span> \"+h[member_name].lab+\", \"+h[member_name].univ+\".</span> \\\n\t\t </span>\\\n </p>\"; \n }\n}", "title": "" }, { "docid": "6fcb1aff3ce8df90be106ead3943eba3", "score": "0.5217523", "text": "static homepageTip(that){\n\t that.preparePage(\"Quicksave successful! Load earlier saves to remake decisions and change your story!\");\n\t that.preparePage(\"¤\");\n\t that.preparePage(\"\\n\");\n }", "title": "" }, { "docid": "03e460225e388dc6a620b181f2436905", "score": "0.52155936", "text": "function browseDoers() {\n var doerDiv = document.getElementById(\"browsePeople\");\n for (var i = 0, j = choreDoer.length; i < j; i++) {\n var makeItem = document.createElement(\"li\"),\n \tmakeLink = document.createElement(\"a\"),\n itemText = choreDoer[i],\n linkableName = itemText.replace(\" \", \"_\");\n\t\t\tmakeItem.setAttribute(\"value\", itemText);\n makeLink.href = \"#\" + linkableName + \"List\";\n getImage(choreDoer[i], makeItem, \"left\", \"30px\");\n makeLink.innerHTML = itemText;\n makeItem.appendChild(makeLink);\n doerDiv.appendChild(makeItem);\n }\n\n $(document.getElementById(\"browsePeople\")).listview('refresh');\n\n }", "title": "" }, { "docid": "fc9e7561bdc4fb37985ebe60feddfd0d", "score": "0.5213634", "text": "function setup() {\r\n generateSite();\r\n pages[0][0].all.show();\r\n}", "title": "" }, { "docid": "4281b4b5a4e21417ef379d7aceae1509", "score": "0.5206491", "text": "function DisplayListItems(list) {\n console.log(list);\n $.each(list, function(index, element) {\n var itemHTML = [\"<li>\",\n \"<div>\",\n \"<div>\",\n element.Title,\n \"</div>\",\n \"<div>\",\n element.Description,\n \"</div>\",\n \"</div>\",\n \"</li>\"].join('\\n');\n $(\".list > ul\").append(itemHTML);\n });\n\n}", "title": "" }, { "docid": "97289c5f37c69795ba7c5ca0493ec827", "score": "0.5203993", "text": "function showPage(list, page) {\n var startIndex = (page * 9) -9;\n var endIndex = page * 9;\n var studentList = document.querySelector(\".student-list\");\n studentList.innerHTML = \"\";\n for (let i= 0; i < list.length; i++) {\n if (i >= startIndex && i < endIndex) {\n var studentItem = ` \n <li class=\"student-item cf\">\n <div class=\"student-details\">\n <img class=\"avatar\" src=${data[i].picture.medium} alt=\"Profile Picture\">\n <h3>${data[i].name.first} ${data[i].name.last}</h3>\n <span class=\"email\">${data[i].email}</span>\n </div>\n <div class=\"joined-details\">\n <span class=\"date\">${data[i].registered.date}</span>\n </div>\n </li>\n `\n studentList.insertAdjacentHTML(\"beforeend\", studentItem);\n \n }\n }\n}", "title": "" }, { "docid": "60b14ca0818c2349df2e120487b16f31", "score": "0.52005476", "text": "function collectInformation() {\n // $('#column-absolute').remove();\n // $('#oroak2647arts17').remove();\n var bookname = $('h1#book-title').text();\n var author = $('.author-name[itemprop=\"author\"]').text();\n //var description = $('[itemprop=\"description\"]').text();\n var description = $('#contentwrapper > div:nth-child(3) > div:nth-child(1) > div.column-670.subcontainer > div.version4 > div:nth-child(2) > div.column-430 > div:nth-child(2)').text();\n var genre = $('li.standart').text();\n var editionData = $('div.edition-data').text().replace(/\\s{2,}/g, ' ')\n .replace(/\\r\\n+|\\r+|\\n+/g, '');\n //collect edition data headers and their values\n var editionObject = function(data){\n var edition = {};\n // define headers\n var key = data.match(/[\\wа-я]+:/gi);\n //define values without \": \"\n var value = function(data){\n var arr = data.match(/:\\s[\\wа-я-]+/gi);\n arr.forEach(function(element){\n element = element.slice(0, 2);\n })\n return arr;\n }\n if (key!=null && value!=null) {\n for (i=0; i < key.length; i++) {\n edition[key[i]] = value(data)[i].replace(/:\\s/g, '');\n }\n }\n return edition;\n };\n //collect book cover\n var bookimage = $('#main-image-book').attr('src');\n // create object with all information about book\n var book = {\n bookname: bookname,\n author: author,\n genre: genre,\n year: editionObject(editionData)['издания:'],\n text: description,\n bookimage: bookimage\n }\n var urls = [];\n var url = $('div.title>a').each(function(){\n var url = 'https://'+location.host+$(this).attr('href');\n var link = url.match(/^(https?:\\/\\/)?([\\da-z\\.-]+)\\.([a-z\\.]{2,6})(\\/book\\/\\d+)*\\/?$/)\n if (link!=null) {\n urls.push(link[0])\n }\n })\n // console.log('book: '+book);\n // console.log('urls: '+urls);\n\n var result = {\n book: book,\n urls: urls\n }\n // console.log(result);\n return result;\n}", "title": "" } ]
01a04ca8e77906bd02863972cda7aad9
Show a modal with the result of search leads by some params
[ { "docid": "0297637f84e05a4a460d8a2d0e2b3f8e", "score": "0.0", "text": "function paintFoundLeads(leads)\r\n{\r\n var htmlFounds = '';\r\n if(leads.length>0)\r\n {\r\n $.each(leads,function( key,lead )\r\n {\r\n htmlFounds+=\"<div id='leadFound_\"+lead.id+\"' class='leadFound col-md-12 \"+(lead.owned?\"leadFoundOwned\":\"leadFoundNoOwned\")+\"'> \" +\r\n \"<input type='checkbox' class='checkboxRestore' data-id='\"+lead.id+\"' \"+(lead.owned && lead.status == \"EXCLUDE\"?\"\":\"disabled\")+\">\" +\r\n \"<span class='col-md-2'><strong>\"+lead.fileno+\"</strong></span>\" +\r\n \"<span class='col-md-7'>\"+lead.fname+\" \"+lead.lname+\"</span>\" +\r\n \"<span class='col-md-2'>\"+lead.user+\"</span>\" +\r\n \"</div>\";\r\n });\r\n $('.container-founds').html(htmlFounds);\r\n //change the color if the lead Found is selected\r\n $('.checkboxRestore').click(function(e){\r\n var isChecked=$(this).is(\":checked\");\r\n var id = $(this).data(\"id\");\r\n if(isChecked)\r\n $('#leadFound_'+id).addClass('leadFoundSelected');\r\n else\r\n $('#leadFound_'+id).removeClass('leadFoundSelected');\r\n });\r\n $('#whoIsThisModal').modal('show');\r\n }\r\n else\r\n toastr.error('Sorry no matches',\"No Matches\");\r\n}", "title": "" } ]
[ { "docid": "99ea1f3687e53caf890a6be507f98c91", "score": "0.69258577", "text": "function popupSearchModal() {\n\n state.search = new Search();\n\n state.search.getList()\n .done(data => {\n searchView.renderQueries(data);\n })\n .fail(err => {\n console.log(`err`, err);\n });\n\n els.popupSearch.modal(`toggle`);\n}", "title": "" }, { "docid": "d638c83326058c2dd10af9ef65f77bf7", "score": "0.6652778", "text": "function searchResult(results){\n\t$('.list-result').html(results);//define a div com os resultados\n\t$('.box-book').on('click', function(){\n\t\t$(\".search-modal\").animate({display: 'none'});\n\t\tproductPage($(this).data('id'));\n\t}); \n\tif($(\".list-result td\").length==0){\n\t\t$(\".list-result\").html(\"<h2>Nenhum resultado encontrado.</h2>\");\n\t\t$(\"#box-result\").html(\"\");\n\t}\t\t\n}", "title": "" }, { "docid": "b71ec2fa167b14480c2faff76ced67ba", "score": "0.649551", "text": "function showModal(param) {\n $(\"#\" + param + \"\").show();\n }", "title": "" }, { "docid": "0db27f48d255c297bcda04ba9352a209", "score": "0.63285923", "text": "function showResults(restaurants) {\n // Construct the interior of the modal.\n const contentWrap = $('<div>').addClass(\n 'results-container container-fluid'\n );\n\n bootbox.dialog({\n closeButton: true,\n onEscape: true,\n show: true,\n title: 'Your Options',\n message: contentWrap,\n backdrop: true,\n buttons: {\n close: {\n /* eslint-disable max-len */\n label: '<span class=\"fas fa-times\"></span>&nbsp;&nbsp;Close',\n /* eslint-enable max-len */\n className: 'btn-outline-danger',\n callback: function () {\n bootbox.hideAll();\n },\n },\n },\n });\n\n renderRestaurants(restaurants);\n }", "title": "" }, { "docid": "104178935513f9ac77848da5f63acfae", "score": "0.61846983", "text": "function open_search_client () {\n console.log(\"abriendo modal de buscar clientes\")\n var modalInstance = $uibModal.open({\n animation: true,\n templateUrl: 'partials/Modal_Client.html',\n controller: 'ClientSearchController',\n controllerAs: 'vm',\n backdrop: false,\n resolve: {\n origin: function () {\n return {\n 'origin':'sell'\n };\n }\n }\n });\n }", "title": "" }, { "docid": "a69e8ecf280e20772072506b666b93e1", "score": "0.6105582", "text": "function searchButton() {\r\n\t\twindow.location.assign(\"results.html\" + stringifySearchParameters());\r\n\t}", "title": "" }, { "docid": "ab089da8ad304c360376b288f99306af", "score": "0.6103686", "text": "function search() {\n\tvar ingredient = $(\".search\").val().trim();\n\tif (ingredient === \"\") {\n\t\tvar modal = document.getElementById(\"myModal\");\n\t\t// Get the <span> element that closes the modal\n\t\tvar span = document.getElementsByClassName(\"close\")[0];\n\t\t// When the user clicks on the button, open the modal \n\t\tmodal.style.display = \"block\";\n\t\t// When the user clicks on <span> (x), close the modal\n\t\tspan.onclick = function() {\n\t\tmodal.style.display = \"none\";\n\t\t};\n\t\t// When the user clicks anywhere outside of the modal, close it\n\t\twindow.onclick = function(event) {\n\t\t\tif (event.target == modal) {\n\t\t\t\tmodal.style.display = \"none\";\n\t\t\t}\n\t\t};\n\t} else {\n\t$(\".search\").val(\"\");\n\t// push search term to Firebase database\n\tsearches.push(ingredient);\n\t// redirect to the list.html page\n\tlocation.href = \"list.html\";\n\t}\n}", "title": "" }, { "docid": "2b162c9694ffb6602a5fd51e27a51ae8", "score": "0.6059228", "text": "function show_relevant_info(d) {\n modal_obj = d;\n\n // let relevantData = d.data.relevant;\n relevantInfoVueobj.relevantData = d.data.relevant;\n relevantInfoVueobj.Buttons_enabled = true;\n $(\"#relevant-info-details-form td\").css(\"background-color\",\"#ffffff\");\n relevantInfoVueobj.$forceUpdate();\n\n\n let query = d.data.name;\n let temp = d;\n while (true){\n if(!d.parent){\n break;\n }\n d = d.parent;\n query = query + ' ' + d.data.name;\n }\n d = temp;\n\n $.ajax({\n type: 'GET',\n dataType: 'json',\n url: \"/relevant_info_search/?q=\" + query\n }).done(function(d){\n // if data sending is successful\n searchVueobj.query_list = d.query;\n searchVueobj.checkedQuery = [];\n searchVueobj.$forceUpdate();\n\n /*\n document.getElementById(\"relevant-info-searches-button\").setAttribute('data-theme-id', theme_id);\n document.getElementById(\"relevant-info-searches-button\").setAttribute('data-theme-name', theme_obj[\"name\"]);\n document.getElementById(\"relevant-info-searches-button\").setAttribute('data-node-name', modal_obj.data.name);\n document.getElementById(\"relevant-info-searches-button\").setAttribute('data-node-id', modal_obj.data.id);\n */\n }).fail(function(){\n // if data sending is failed\n alert(\"サーバーから推薦キーワードを取得することができませんでした\");\n });\n\n $('#relevant-info').modal();\n\n $(\".modal-backdrop\")\n .css({\n top: navvar_height + \"px\",\n left: 5 + \"px\", // 5px is #ibis side's margin\n right: 5 + \"px\",\n bottom: 5 + \"px\"\n });\n\n $(\".modal\")\n .css({\n top: navvar_height + \"px\",\n left: 5 + \"px\", // 5px is #ibis side's margin\n right: 5 + \"px\",\n bottom: 5 + \"px\"\n });\n}", "title": "" }, { "docid": "c2e2e6cfaee79a47f17e70ad8fbdf73d", "score": "0.6042705", "text": "searchCampaignsDescriptions(params)\n {\n \n //inject the bar's html into the dom\n //handle user interaction, probably seperate function\n //search through each campaign object locally\n //modify the dom, to output the list of search returned campaigns\n /*\n <div class=\"search-container\">\n <form action=\"\">\n <input type=\"text\" placeholder=\"Search..\" name=\"search\">\n <button type=\"submit\"><></i></button>\n </form>\n </div> \n */\n }", "title": "" }, { "docid": "2ba00b84ee8949f7c5946e914d174aeb", "score": "0.59658194", "text": "function show_adv_search_res(e)\n{\n\te.preventDefault();\n\n\t$.ajax({\n\t\turl: '/advsearch' + build_adv_search_query(jQuery(\".uos_adv_search_input\")),\n\t\tmethod: 'GET',\n\t\tsuccess: function(response)\n\t\t{\n\t\t\tvar results = response;\n\t\t\tjQuery(\".uos_advanced_results\").html(\"\");\n\n\t\t\tif (results.length == 0)\n\t\t\t{\n\t\t\t\talert(\"Your search queries returned nothing.\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar data = \"\";\n\t\t\t\tfor (var i = 0; i < results.length; i++)\n\t\t\t\t{\n\t\t\t\t\tdata += \"<div class = 'uos_search_result'>\" +\n\t\t\t\t\t\t\t\"<img src = '\" + results[i]['img'] + \"'>\" +\n\t\t\t\t\t\t\t\"<div class = 'uos_result_info'>\" +\n\t\t\t\t\t\t\t\t\"<div class = 'uos_result_title'>\" + results[i]['group_name'] + \"</div>\" +\n\t\t\t\t\t\t\t\t\"<div class = 'uos_result_tagline'>\" + results[i]['description'] + \"</div>\" +\n\t\t\t\t\t\t\t\t\"<div class = 'uos_result_members'>Meets \" + results[i]['day'] + \" at \" + results[i]['time'] + \"</div>\" +\n\t\t\t\t\t\t\t\t\"<a href = '/group?id=\" + results[i]['id'] + \"' id = 'uos_open_group'>View profile</a>\" +\n\t\t\t\t\t\t\t\"</div>\" +\n\t\t\t\t\t\t\"</div>\";\n\t\t\t\t}\n\n\t\t\t\tjQuery(\".uos_advanced_results\").html(data);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "ae2266ea5592d837049025cb71ea6ea5", "score": "0.5953413", "text": "function autoCompl(autoQuery) {\n\n $('.autocomplete').empty(); //svuoto div autocomplete\n\n let first5 = autoQuery.restaurants.slice(0, 5); //ritorna solo i primi 5 risultati\n\n // genera elementi ricerca\n first5.forEach(function(item, i, array){\n $('.autocomplete').append(\n '<div class=\"row search-el\" data-toggle=\"modal\" data-target=\"#collect-modal\" data-id=\"' + item.restaurant.id + '\">' +\n '<div class=\"col-xs-12\">' +\n '<h3 class=\"w-300 search-text\">' + item.restaurant.name + '</h3>' +\n '</div>' +\n '</div>'\n );\n });\n\n // selezione consigliati di ricerca\n $('.search-el').click(function(event) {\n let id = $(this).data('id'); //assegno ad id, l'id del ristorante cliccato\n $('.navbar').fadeIn(300); //mostro la navbar\n restCall(id); //invoco funzione per la creazione della pagina ristorante\n });\n\n // evento pressione tasto invio\n $(\".auto-search\").keypress(function(e) {\n if (e.which == 13) { //se premuto il tasto invio\n $(\"#collect-modal\").modal(); //chiamo la funzione per far comparire la modale\n $('.navbar').fadeIn(300); //mostro la navbar\n $(\".auto-search\").val(\"\"); //resetto a vuoto il valore dell'input text\n $.ajax({\n url: 'https://developers.zomato.com/api/v2.1/search',\n dataType: 'json',\n data: {\n q: query,\n lat: latitude,\n lon: longitude,\n sort: 'real_distance',\n order: 'desc'\n },\n headers: {\n \"user-key\": \"f7b021777643a1e7a87e4d0f3a2792ff\"\n },\n success: modalSearch,\n error: GeneralError\n })\n }\n });\n }", "title": "" }, { "docid": "2b3cd78833a3c87860ee10462dc65cc7", "score": "0.5937747", "text": "function searchLead() {\n \n var data = {}\n //Validation\n var err = 0;\n\n data.leadName = $('#leadName').val();\n data.leadcontactName = $('#leadcontactName').val();\n data.leadPhone = $('#leadPhone').val();\n data.leadEmail = $('#leadEmail').val();\n data.leadStatus = $('#leadStatus').val();\n data.from = $('#from').val();\n data.to = $('#to').val();\n if ($(\"#from\").val() != '') {\n if ($(\"#to\").val() == '') {\n $('#to').addClass('is-invalid');\n err++;\n }\n }\n if (err > 0) {\n return false;\n }\n else\n {\n $('.load-search-lead').show();\n $('.load-search-lead').html(loading_icon);\n $('.searchlead').hide(); //Button name\n $('#hidelead').hide(); //all lead div\n $('.is-invalid').removeClass('is-invalid');\n }\n console.log(\"data=\" + JSON.stringify(data));\n\n $.ajax({\n url: base_url + '/leadSearchResults',\n type: 'POST',\n data: {\n _token: CSRF_TOKEN,\n data: data\n },\n dataType: 'JSON',\n success: function (data) {\n console.log(\"RESULT=\" + JSON.stringify(data.result.lead));\n $('#hideLead').hide();\n $('#showLead').show();\n $('.searchlead').show();\n $('.load-search-lead').hide();\n $('.load-search-lead').html('');\n var rows = '';\n if (data.result.lead == '') {\n rows = rows + '<tr\">';\n rows = rows + '<td colspan=\"8\" class=\"span12 text-center\">No Lead Found</td>';\n rows = rows + '</tr>';\n }\n else\n {\n $.each(data.result.lead, function (key, le) {\n var formattedDate=formatDate(le.created_date);\n console.log(formattedDate);\n var pg=host+'/edit-lead/'+btoa(le.id);\n rows = rows + '<tr\">';\n rows = rows + '<td>' + le.name + '</td>';\n rows = rows + '<td>' + le.contact_name + '</td>';\n rows = rows + '<td>' + le.email + '</td>';\n rows = rows + '<td>' + le.phone + '</td>';\n rows = rows + '<td>' \n $.each(data.result.leadStatus, function(key, value) {\n if (le.status == value.code) {\n rows = rows + value.meaning;\n }\n });\n '</td>';\n rows = rows + '<td>' + formattedDate + '</td>';\n rows = rows + '<td><a href=\"#\" class=\"btn btn-secondary btn-sm mb-2 mb-xl-0\" data-toggle=\"modal\" id=\"viewSingleLead\" data-target=\"#mytracker\" data-id='+le.id+'><i class=\"fa fa-eye\"></i></a>&nbsp;&nbsp;<a href=\"'+pg+'\" class=\"ubtn'+le.id+'btn btn-primary btn-sm mb-2 mb-xl-0\" data-toggle=\"tooltip\" data-original-title=\"Edit\"><i class=\"fa fa-pencil\"></i></a>&nbsp;&nbsp;<a id=\"confirmUserDelete\" data-id='+le.id+' class=\"ubtn'+le.id+' btn btn-danger btn-sm mb-2 mb-xl-0\" data-toggle=\"tooltip\" data-original-title=\"Delete\"><i class=\"fa fa-trash\"></i></a>&nbsp;&nbsp; <span class=\"dellead'+le.id+'\"></span>';\n '</td>';\n rows = rows + '</tr>';\n });\n }\n $('#showLead').html(rows);\n\n }\n });\n}", "title": "" }, { "docid": "4895d56da8667597b0ad3fdea47981ca", "score": "0.5932101", "text": "function go_to_result()\n{\n\tjQuery(\".uos_advanced_search\").hide();\n\tjQuery(\".uos_study_group\").show();\n}", "title": "" }, { "docid": "1504a29f86e966352354511dc869d994", "score": "0.5927517", "text": "function open_search_product () {\n var modalInstance = $uibModal.open({\n animation: true,\n templateUrl: 'partials/Modal_Product.html',\n controller: 'ProductSearchController',\n controllerAs: 'vm',\n size: 'lg',\n backdrop: false,\n resolve: {\n origin: function () {\n return {\n 'origin':'sell',\n 'name': vm.product_search\n };\n }\n }\n });\n }", "title": "" }, { "docid": "d4bdeb1915fb9cb5110710f5178b89ba", "score": "0.59055066", "text": "function openModal() {\n\n var span = document.getElementsByClassName(\"closeModal\")[0];\n var modal = $('#modal');\n \n $('#orderTable').find('tr').click(function () {\n var rowIndex = this.rowIndex;\n if (isAfterSearch === false) {\n $.post('get-order-data.do', {\n index: rowIndex,\n hasBeenSearched: isAfterSearch\n }, function () {\n $('.modalContent').load('modal-form.jsp');\n modal[0].style.display = 'block';\n });\n } else if (isAfterSearch === true) {\n $.post('get-order-data.do', {\n index: rowIndex,\n hasBeenSearched: isAfterSearch\n }, function () {\n $('.modalContent').load('modal-form.jsp');\n modal[0].style.display = 'block';\n });\n isAfterSearch = false;\n }\n });\n\n span.onclick = function () {\n modal[0].style.display = \"none\";\n };\n}", "title": "" }, { "docid": "8af14fb1147ae5b6df042a06bdbbed34", "score": "0.5868965", "text": "function onSearchResultItemClick(a_ele) {\n var me = $(a_ele);\n var can_preview = me.hasClass('view');\n var cur = window.current_drive_order;\n var title = `Loading...`;\n $('#SearchModelLabel').html(title);\n var content = `<div class=\"d-flex justify-content-center\"><div class=\"spinner-border ${UI.loading_spinner_class} m-5\" role=\"status\"><span class=\"sr-only\"></span></div>`;\n $('#modal-body-space').html(content);\n\n // Request a path\n $.post(`/${cur}:id2path`, {\n id: a_ele.id\n }, function(data) {\n if (data) {\n var href = `/${cur}:${data}${can_preview ? '?a=view' : ''}`;\n if (href.endsWith(\"/\")) {\n var ehrefurl = href.replace(new RegExp('#', 'g'), '%23').replace(new RegExp('\\\\?', 'g'), '%3F');\n } else {\n var ehrefurl = href.replace(new RegExp('#', 'g'), '%23').replace(new RegExp('\\\\?', 'g'), '%3F') + '?a=view';\n }\n title = `Result`;\n $('#SearchModelLabel').html(title);\n content = `<a class=\"btn btn-info\" href=\"${ehrefurl}\">Open</a> <a class=\"btn btn-secondary\" href=\"${ehrefurl}\" target=\"_blank\">Open in New Tab</a>`;\n $('#modal-body-space').html(content);\n return;\n }\n title = `Failed`;\n $('#SearchModelLabel').html(title);\n content = `System Failed to Fetch the File/Folder Link, Please close and try again.`;\n $('#modal-body-space').html(content);\n })\n}", "title": "" }, { "docid": "18ac169dfd7d4c9ea7d1fade9d27116b", "score": "0.584418", "text": "function ventanaModal()\n {\n \n }", "title": "" }, { "docid": "0e03008bc3853a4b7f0320c13e8090dd", "score": "0.58252114", "text": "function searchBy()\n{\n\t\tfrmSeg1.show();\n}", "title": "" }, { "docid": "68e2a979084cecb01ebe6269e90b6189", "score": "0.58199394", "text": "function openComplainModal(name){\n var sname = name;\n $.ajax({\n type:'GET',\n url: 'complainInformation',\n data:{'sname':sname},\n dataType: 'json',\n success:function(result){\n $('#complain_student_id').val(result[0]['id']);\n $('#complain_student_email').val(result[0]['student_email']);\n }\n });\n $('#ComplainModal').modal({\n show: true,\n keyboard: false,\n backdrop: 'static'\n });\n }", "title": "" }, { "docid": "90c5e8739c3fedd9ca38ea4f12201009", "score": "0.5816705", "text": "function searchSurat() {\n let keyword = $('#search-input').val()\n $.getJSON(theAPI, function (surat) {\n \n $.each(surat, function (i, data) {\n if (surat.nama == keyword) {\n $('#surat-list').html('')\n\n hasilCari = `\n <div class=\"card\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">` + data.nama + `&nbsp;(` + data.asma + `)</h5>\n <h6 class = \"card-subtitle mb-2 text-muted\"> ` + data.arti + ` </h6>\n <audio controls>\n <source src=\"` + data.audio + `\" type=\"audio/mpeg\">\n Your browser does not support the audio element.\n </audio>\n <br>\n <a href=\"#\" class=\"card-link see-detail\" data-nomor=\"` + data.nomor + `\"data-toggle=\"modal\" data-target=\"#exampleModal\">Detail Surat</a>\n </div>\n </div>`\n }\n })\n $('#surat-list').html(hasilCari)\n })\n}", "title": "" }, { "docid": "6296aad0708a7dd774f12258a3e47e21", "score": "0.5808562", "text": "function showModalFind(data) {\n $overlay.classList.add('active');\n $modal.style.animation = 'modalIn .8s forwards';\n\n $modalTitle.textContent = data.title;\n $modalImage.setAttribute('src', data.medium_cover_image);\n $modalDescription.textContent = data.description_full\n }", "title": "" }, { "docid": "82a17cbeaf9e0341f038660e233643b0", "score": "0.5805053", "text": "function userSearch() {\n let city = $(\"#enter-city\").val().trim();\n let search = toCapitals(city);\n if (utla.includes(search)) {\n return search;\n }\n else {\n showModal(\"modal-nodata\");\n hideModal(\"modal-nodata\");\n }\n }", "title": "" }, { "docid": "9237d22d4a7a9bcf1bb8bb00e2db8325", "score": "0.5785036", "text": "showResults(data) {\n\t\tthis.elements.results.html('')\n\t\tif (data.length === 0) {\n\t\t\tthis.showError('Esta Cerveja não existe na nossa base de Cervejas!')\n\t\t} else {\n\t\t\t$('#error').remove()\n\t\t\tdata.forEach(beer => {\n\t\t\t\tif (beer.image_url == null) {\n\t\t\t\t\tbeer.image_url = \"http://www.portaldapropaganda.com.br/noticias/wp-content/uploads/2018/03/Coca-Cola-600ml-Vidro-decart%C3%A1vel.png\"\n\t\t\t\t}\n\n\t\t\t\tlet randomBeersBusca = [];\n\t\t\t\trandomBeersBusca.push(todasBebidas[Math.floor(Math.random() * todasBebidas.length)]);\n\t\t\t\trandomBeersBusca.push(todasBebidas[Math.floor(Math.random() * todasBebidas.length)]);\n\t\t\t\trandomBeersBusca.push(todasBebidas[Math.floor(Math.random() * todasBebidas.length)]);\n\n\n\t\t\t\tfor(var i=0; i<3; i++){\n\t\t\t\t\tif (randomBeersBusca[i].image_url == null) {\n\t\t\t\t\t\trandomBeersBusca[i].image_url = \"http://www.portaldapropaganda.com.br/noticias/wp-content/uploads/2018/03/Coca-Cola-600ml-Vidro-decart%C3%A1vel.png\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\n\t\t\t\tthis.elements.results.append(`\n\t\t\t\t\t<div class=\"col-lg-4 col-md-6 col-sm-12 mt-4 grow\">\n\t\t\t\t\t<a><i class=\"fa fa-star-o two mt-3 mr-4\" id=\"id${beer.id}\" aria-hidden=\"true\" onclick=\"addFavo(${beer.id})\"></i></a> \n\t\t\t\t\t<div class=\"card\" type=\"button\" data-toggle=\"modal\" data-target=\"#modalQuickView${beer.id}\">\n\t\t\t\t\t\t<img class=\"card-img-top smallimg m-3\" src=\"${beer.image_url}\">\n\t\t\t\t\t\t<div class=\"card-body\">\n\t\t\t\t\t\t\t<h5 class=\"card-title\">${beer.name}</h5>\n\t\t\t\t\t\t\t<p class=\"card-text\">${beer.tagline}</p>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\n\t\t\t\t\t\t\t<!-- Modal inicio: modalQuickView -->\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<div class=\"modal fade\" id=\"modalQuickView${beer.id}\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"exampleModalLabel\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t<div class=\"modal-dialog modal-lg\" role=\"document\">\n\t\t\t\t\t\t\t\t\t<div class=\"modal-content\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"modal-body p-5\">\n\t\t\t\n\t\t\t\t\t\t\t\t\t\t<!-- X PRA FECHAR O POP UP -->\n\t\t\t\n\t\t\t\t\t\t\t\t\t\t<button type=\"button\" class=\"close\" data-dismiss=\"modal\">\n\t\t\t\t\t\t\t\t\t\t <span>&times;</span>\n\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t<!--/.X PRA FECHAR O POP UP-->\n\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-sm-4\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t <!--Carousel Wrapper-->\n\t\t\t\t\t\t\t\t\t\t\t\t <div id=\"carousel-thumb\" class=\"carousel slide carousel-fade carousel-thumbnails\" data-ride=\"carousel\">\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 <!--COLOCAR A IMAGEM DA CERVEJA PRINCIPAL-->\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"carousel-inner\" role=\"listbox\" id=\"imgmodal\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"carousel-item active\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img class=\"d-block w-100\" src=\"${beer.image_url}\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t <!--/.FIM DA CERVEJA PRINCIPAL-->\n\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t </div>\n\t\t\t\n\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t<!--/.Carousel Wrapper-->\n\t\t\t\t\t\t\t\t\t\t\t </div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-sm-8 text-left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h3 id=\"nomeprodutomodal\">${beer.name} </h3>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h4 class=\"h4-responsive\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"text-muted\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h6>${beer.tagline}</h6>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<hr/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h5 class =\"title mt-3\">IBU: ${beer.ibu} ABV: ${beer.abv}% EBC: ${beer.ebc}</h5>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</h4>\n\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<!--Accordion wrapper-->\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"accordion md-accordion font-size\" id=\"accordionEx\" role=\"tablist\" aria-multiselectable=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<!-- Card body -->\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div id=\"collapseOne1\" class=\"collapse show\" role=\"tabpanel\" aria-labelledby=\"headingOne1\" data-parent=\"#accordionEx\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t${beer.description}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h6 class =\"title\" style=text-align:left id=\"bestserved\"><strong>Best Served With </strong></h6>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <ul style=text-align:left>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ${beer.food_pairing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .map(ingredient => `<li>${ingredient}</li>`)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .join(\"\")}\n\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t </ul>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t </div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t </div>\n\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 </div>\n\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"row mt-3 mb-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t<h4 class =\"title\" id=\"alsolike\">You might also like:</h4>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"container\">\n\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-sm-4\" data-target=\"#modalQuickView${randomBeersBusca[0].id}\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"border height p-3\">\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img class=\"card-img-top m-3 p-1 smallimg\" src=\"${randomBeersBusca[0].image_url}\" class=\"img-fluid\" alt=\"${randomBeersBusca[0].name}\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div id=\"\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h5 class=\"card-title\" style=\"color: grey\">${randomBeersBusca[0].name}</h5>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-sm-4\" id=\"modalQuickView${randomBeersBusca[1].id}\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"border height p-3\">\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img class=\"card-img-top m-3 p-1 smallimg\" src=\"${randomBeersBusca[1].image_url}\" class=\"img-fluid\" alt=\"${randomBeersBusca[1].name}\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div id=\"\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h5 class=\"card-title\" style=\"color: grey\">${randomBeersBusca[1].name}</h5>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-sm-4\" id=\"modalQuickView${randomBeersBusca[2].id}\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"border height p-3\">\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img class=\"card-img-top m-3 p-1 smallimg\" src=\"${randomBeersBusca[2].image_url}\"class=\"img-fluid\" alt=\"${randomBeersBusca[2].name}\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div id=\"\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h5 class=\"card-title\" style=\"color: grey\">${randomBeersBusca[2].name}</h5>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\n\t\t\t\n\t\t\t\t\t\t\t\t\t\t </div>\n\t\t\t\t\t\t\t\t\t </div>\n\t\t\t\t\t\t\t\t </div>\n\t\t\t\t\t\t\t </div>\n\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<!-- FIM DO MODAL -->\t\t\t\n\t\t\t\t\t `)\n\t\t\t})\n\t\t}\n\t}", "title": "" }, { "docid": "2ee6fd96fdd8c81940ed37677c84cb46", "score": "0.57712656", "text": "function displayResults(param) {\n var sd = $(\"#drink-list\");\n sd.empty();\n\n\n if (param.searchBy === \"name\" ){\n searchDrinkByName(drinkSearchParams.name, loadList);\n } else {\n filterBy(param.ingredients, param.category, param.glass, param.alcohol, loadList)\n }\n }", "title": "" }, { "docid": "f631c5219c7061eb76e1a01cd326d7a2", "score": "0.5760159", "text": "function GetTitleFromDb() {\n $('#result').html('');\n $('#wrapper').css(\"height\", \"100%\");\n $('#overlay').show();\n var keyword = $('#keyword').val();\n if (keyword != '') {\n $.ajax({\n url: \"dashboard/home/searchtitle\",\n method: \"POST\",\n data: {\n judul_skripsi: keyword,\n },\n\n success: function (data) {\n $('#overlay').hide();\n $('#wrapper').css(\"height\", \"100%\", \"border\", \"3px solid black\").show(\"slow\", 1000);\n $('#result').html(data).show(1500);\n },\n });\n } else {\n $('#overlay').hide();\n Swal.fire('Kata kunci kosong');\n }\n }", "title": "" }, { "docid": "2f222a5ae955cfbf6860306eddee51a6", "score": "0.5747921", "text": "function showResults(){\n\n }", "title": "" }, { "docid": "7c8b90d713f09aaac303dd6bf606632a", "score": "0.57434595", "text": "function showResult(str) {\n if (str.length <= 2) {\n if ($(\"#result h2\")) {\n $(\"#result h2\").remove();\n $(\".more\").remove();\n }\n searchResult.innerHTML = \"\";\n if (!result.classList.contains(\"hidden\")) {\n result.classList.add(\"hidden\");\n }\n return;\n }\n\n $.get(\"/lookingfor\", { search: str }, function(data) {\n result.classList.remove(\"hidden\");\n if (data !== \"error\") {\n if ($(\"#result h2\")) {\n $(\"#result h2\").remove();\n $(\".more\").remove();\n $(\"#result\").prepend(\"<h2>Voici les liens recherchés</h2>\");\n }\n searchResult.innerHTML = \"\";\n const resultat = JSON.parse(data);\n for (let [key, value] of Object.entries(resultat)) {\n searchResult.innerHTML += `<li><a href=\"${value.url}\">${value.title}</a>${value.description}<span class=\"tags\" onclick=\"newSearch('${value.tag}')\">${value.tag}</span></li>`;\n spanLinks = document.getElementsByClassName(\"tags\");\n }\n if (resultat.length === 5) {\n $(\"#result\").append('<a href=\"/all\" class=\"more\">&rarr;</a>');\n } else {\n $(\".more\").remove();\n }\n } else {\n searchResult.innerHTML = `Aucun resultat`;\n }\n });\n}", "title": "" }, { "docid": "56f2086288a2761c6516231822c2bc3f", "score": "0.57281375", "text": "function searchMeal(){\n const searchText=search.value; \n mealsContainerDiv.innerHTML=\"\";\n mealIngredient.innerHTML=\"\";\n mealDiv.innerHTML=\"\";\n if(searchText.trim()){\n fetch(`https://www.themealdb.com/api/json/v1/1/search.php?s=${searchText}`)\n .then(res=>res.json())\n .then(data=>{\n resultText.innerHTML=`<h2>Search result : '${searchText}':</h2>`;\n if(data.meals===null){\n resultText.innerHTML=`<h2> No search result found ...</h2>`; \n }else{\n mealsContainerDiv.innerHTML= data.meals.map(meal =>`\n <div onClick=\"displayMealDetails('${meal.idMeal}')\" class=\"meal\">\n <img src=\"${meal.strMealThumb}\" alt=\"${meal.strMeal}\" />\n <h3>${meal.strMeal}</h3>\n </div> \n `).join('');\n }\n });\n searchText.value=\"\"; \n\n }else{\n alert('Please enter the meal name for search....')\n }\n}", "title": "" }, { "docid": "aba46c903cfdc26140628c9878247655", "score": "0.57107645", "text": "function showResults(form,numberOfPage){\n\n if(checkHotel()&&checkFood()&&checkDate(form[\"dateFrom\"])&&checkDate(form[\"dateTo\"])&&checkPrice(form[\"priceFrom\"])&&checkPrice(form[\"priceTo\"])){\n forms = form;\n $('#searchResult').empty();\n showModal();\n $('#searchResult').append('<div class=\"col-md-12\" id=\"loading\"><img src=\"img/preloader.gif\"></div><br>');\n queryObj.country = $(\"#country\").val();\n queryObj.region = $(\"#region\").val();\n if ($(\"#twoStar\").prop('checked'))queryObj.twoStar = $(\"#twoStar\").val();\n if ($(\"#threeStar\").prop('checked'))queryObj.threeStar = $(\"#threeStar\").val();\n if ($(\"#fourStar\").prop('checked'))queryObj.fourStar = $(\"#fourStar\").val();\n if ($(\"#fiveStar\").prop('checked'))queryObj.fiveStar = $(\"#fiveStar\").val();\n if ($(\"#foodOne\").prop('checked'))queryObj.foodOne = $(\"#foodOne\").val();\n if ($(\"#foodTwo\").prop('checked'))queryObj.foodTwo = $(\"#foodTwo\").val();\n if ($(\"#foodThree\").prop('checked'))queryObj.foodThree = $(\"#foodThree\").val();\n if ($(\"#foodFour\").prop('checked'))queryObj.foodFour = $(\"#foodFour\").val();\n if ($(\"#foodFive\").prop('checked'))queryObj.foodFive = $(\"#foodFive\").val();\n if ($(\"#foodSix\").prop('checked'))queryObj.foodSix = $(\"#foodSix\").val();\n queryObj.adults = $(\"#adults\").val();\n queryObj.children = $(\"#children\").val();\n queryObj.dateFrom = $(\"#dateFrom\").val();\n queryObj.dateTo = $(\"#dateTo\").val();\n queryObj.nightFrom = $(\"#nightFrom\").val();\n queryObj.nightTo = $(\"#nightTo\").val();\n queryObj.priceFrom = $(\"#priceFrom\").val();\n queryObj.priceTo = $(\"#priceTo\").val();\n queryObj.numberOfPage = numberOfPage;\n\n $.ajax({\n url: \"/search/getTour\",\n type: \"POST\",\n data: queryObj,\n dataType: 'json',\n\n success: function (data) {\n showModal();\n var new_id = 0;\n $.each(data, function (key, value) {\n value.id = new_id;\n new_id++;\n })\n var toursForTemplate = [];\n\n $.each(data, function( index, value ) {\n\n var currentTour = {};\n currentTour.id = index;\n currentTour.tour = value;\n\n toursForTemplate.push(currentTour);\n\n })\n favData = data;\n console.log(data);\n $('#searchResult').empty();\n $('#searchResult').append('<p align=\"center\"><h3>Результати пошуку:</h3></p>');\n $('#searchTemplate').tmpl(toursForTemplate).appendTo('#searchResult');\n $('#searchResult').append(\n \"<script type='text/javascript' src=\\\"js/star-rating.min.js\\\"/>\"+\n \"<script type='text/javascript' src=\\\"js/bootstrap-table.min.js\\\"/>\"+\n \"<script type='text/javascript' src=\\\"js/cityFrom.js\\\"/>\"+\n \"<script type='text/javascript' src=\\\"js/transitOrderButton.js\\\"/>\"+\n \"<script type='text/javascript' src=\\\"js/select2.min.js\\\"/>\");\n $('#searchResult').append('<button type=\"button\" class=\"btn btn-default pull-left\" onclick=\"expandParseTwo(-1)\">Попередні</button>' +\n '<button type=\"button\" class=\"btn btn-default pull-right\" onclick=\"expandParseTwo(1)\">Наступні</button>');\n }\n });\n return true;\n }else{\n return false;\n }\n}", "title": "" }, { "docid": "b05a133b8dc01f0f136c93a6b7a0847d", "score": "0.5709156", "text": "function searchMovieDetail(data){\nconsole.log(\"searchMovies Executed\");\n const singleMovie = renderSingleMovie(data);\n console.log(\"result=\"+singleMovie);\n window.scrollTo( 0, 0 );\n $('#slides').remove();\n $('#search').remove();\n $('#movies').html(singleMovie);\n}", "title": "" }, { "docid": "c8b8f3658dcc4f38be342e768cd4a9c8", "score": "0.570709", "text": "function openModal() {\n modal.style.display = \"block\";\n jQuery(\".search-sec\").css({ \"z-index\": \"0\" })\n}", "title": "" }, { "docid": "ba90bb0fc62a0927c36dc55b99b127fc", "score": "0.56911373", "text": "employeeSearch(employee) {\n\t\tthis.employeeCard(employee);\n\t\tthis.employeeModal(searchedEmployees);\n\t}", "title": "" }, { "docid": "acf1e12dfe3135d99a5391245e191849", "score": "0.5686077", "text": "function showSearch() {\n toogleParametersArea($('#search-bench'), 'op-search');\n resizeTranscript();\n }", "title": "" }, { "docid": "d1aa7a6b99cd1fddba37a6e273a41a9e", "score": "0.5678345", "text": "function free_search(frm){\r\n $.ajax({\r\n type: \"POST\",\r\n url: \"../partials/_free_search.php\",\r\n data: frm.serialize(),\r\n\r\n success: function(html){\r\n if(html == 'OK') {\r\n document.getElementById('progress_bar').style.display = 'block';\r\n $('#modal_free_search').dialog('close'); \r\n location.href = '../free_search_results.php';\r\n }else{\r\n $('#div_register_errors_fsearch').html(html);\r\n }\r\n },\r\n error: function(){\r\n },\r\n beforeSend: function(){\r\n $('#div_register_errors_fsearch').html(\"\");\r\n }\r\n });\r\n return false;\r\n}", "title": "" }, { "docid": "7e1191c4adc077c1fed6242adfbd00b0", "score": "0.5664084", "text": "viewCastle(id) {\n this.form.link =\n this.castles.filter(\n (castle) => castle.id === id)[0].link\n document.getElementById(\"viewCastleDialog\").showModal()\n\n }", "title": "" }, { "docid": "ab287a02f32f0c2aa9d0d096cf2715b2", "score": "0.56618834", "text": "function showModalWin() {\n $scope.showModal = !$scope.showModal;\n if ($scope.showListFilter){\n $scope.showListFilter = !$scope.showListFilter;\n }\n }", "title": "" }, { "docid": "5a0cd729fc1c21cda10c2c2afe57af73", "score": "0.56484765", "text": "function mostraModaleConfermaStampaRicevuta()\n {\n\n modaleConferma.modal(\"show\");\n }", "title": "" }, { "docid": "92b67cd304eccc6881347a21f463e0ce", "score": "0.5622152", "text": "function showModalDialog(pageName) {\n let modalDialog = document.getElementById(\"modal-dialog\");\n modalDialog.style.display = \"block\";\n window.document.getElementById('ifrSearchModal').src = pageName;\n}", "title": "" }, { "docid": "9e85fc120a8536c96f8067aa12443c7c", "score": "0.56084085", "text": "async show ({ params, request, response, view }) {}", "title": "" }, { "docid": "0c172a5ccba7c4eafc2d7343c151039a", "score": "0.5598681", "text": "function showDialog(title, body, width, height) {\r\n try {\r\n if (width)\r\n $('.modal-dialog').css('width', width);\r\n if (height)\r\n $('.modal-Hotel-fareFinder-content').css('height', height)\r\n $('.modal-title').html(title);\r\n $('.modal-Hotel-fareFinder-content').html(body);\r\n $('#tremp-search').modal('show');\r\n } catch (error) {\r\n $().Logger.error(\"HotelFarefinder.js showDialog()-->\" + error)\r\n }\r\n}", "title": "" }, { "docid": "5cfc66cc762e15da9e6fe71000fbea6e", "score": "0.559008", "text": "function abrirModalPedidos(){\r\n\tmodalPedidos.modal('show');\r\n}", "title": "" }, { "docid": "cf0fd3888b4acb0d286213b7ab9061f2", "score": "0.5589674", "text": "function btn_printRecordTransitionList_onclick(sRecordTypeId, fullTextSearch, p_url){\n\tp_url = p_url + '?sRecordTypeId=' + sRecordTypeId + '&fullTextSearch=' + fullTextSearch;\n\tsRtn = showModalDialog(p_url,\"\",\"dialogWidth=1px;dialogHeight=1px;status=no;scroll=no;dialogCenter=yes\");\t\t\t\n if (sRtn!=\"\"){\n\t\twindow.open(sRtn);\n }\t\n}", "title": "" }, { "docid": "6e6e5d9c201138127f6f570ff41e5ff5", "score": "0.5589653", "text": "function showResults() {}", "title": "" }, { "docid": "01ffb753d69e3250b90e4f8a09833a74", "score": "0.5585079", "text": "function fnSearch(){\n if(fnModCheck()){\n var data = {\n clientCd: $(\"#itemFixLocClientCd\").val(),\n zoneCd: $(\"#itemFixZoneCd\").val(),\n itemCd: $(\"#itemFixItemCd\").val(),\n locCd : $('#itemFixLocCd').val(),\n useYn : $(\"#itemFixUseYn\").val()\n };\n $itemFixLocationList.paragonGridSearch(data);\n $locationList.paragonGridSearch(data);\n $itemList.paragonGridSearch(data);\n }\n }", "title": "" }, { "docid": "b600f367a6dc44931d4efd18f604cd18", "score": "0.5575698", "text": "function displayModal(res) {\n\t// otherwise, start by removing any previous match information from modal\n\t$('#match-message').remove();\n\t$('#match-image').remove();\n\t$('#match-count').remove();\n\t// build the match message, match image, and match count\n\tvar matchMessage;\n\tvar matchImage;\n\tvar matchCount;\n\tif (!res[0]) { // if first profile entered, display special message\n\t\tmatchMessage = $(`<p id='match-message'></p>`).text('You are the first profile! Please wait for more profiles to be created to get matched.');\n\t\t$('.modal-body').append(matchMessage);\n\t} else { // otherwise, display the best match to the user\n\t\tmatchMessage = $(`<p id='match-message'></p>`).html(`Your best match is <strong>${res[0].name}</strong>`);\n\t\t$('.modal-body').append(matchMessage);\t\t\t\t\t\n\t\tif (res[0].picture.slice(0,4) === 'http') {\n\t\t\tmatchImage = $(`<img id='match-image'>`).attr('src',res[0].picture);\n\t\t\t$('.modal-body').append(matchImage);\t\t\t\t\t\t\n\t\t}\n\t}\n\t// display the count of the number of potential matches in the system\n\tmatchCount = $(`<p id='match-count'></p>`).text(`There are currently ${res[1].numFriends} people in the system to match with.`)\n\t$('.modal-body').append(matchCount);\n\t// display the modal\n\t$('#modal').modal()\n}", "title": "" }, { "docid": "8b9769f2ebc3bc7b37617bc60585c363", "score": "0.5575383", "text": "function showPokemonList(jsonData)\n{\n document.getElementById('searchresult').innerHTML='';\n jsonData.forEach(element => {\n //Pre-Evoluciones\n let preEvolutions = \"\";\n if(element.prev_evolution){\n element.prev_evolution.forEach(pre => {\n preEvolutions += `<p>${pre.name}</p>`\n })\n }\n else {\n preEvolutions += \"Ninguna\";\n }\n //Evoluciones siguientes\n let nextEvolutions = \"\";\n if(element.next_evolution){\n element.next_evolution.forEach(next => {\n nextEvolutions += `<p>${next.name}</p>`\n })\n }\n else {\n nextEvolutions += \"Ninguna\";\n }\n\n /*d) Impresión modal con información de cada pokémon*/\n document.getElementById('searchresult').innerHTML +=\n `\n <div id=\"pokemonbox\" class=\"col s12 m6 l4\">\n <!--Llamada al modal -->\n <a href=\"#modal${element.num}\" class=\"modal-trigger\">\n <!--Información visible antes de elegir el modal-->\n <img src=\"${element.img}\" alt=\"${element.name}\"/>\n <h6>${element.num}</h6>\n <h6>${element.name}</h6>\n </a> \n <div id=\"modal${element.num}\" class=\"modal\">\n <div class=\"modal-footer\">\n <a href=\"#!\" class=\"modal-close waves-effect btn-flat\">X</a>\n </div>\n <!--Información de la ficha de pokemon (modal)-->\n <div class=\"modal-content row\"> \n <h6 class=\"elementdatatitle\">${element.num}</h6>\n <h6 class=\"elementdatatitle\">${element.name}</h6>\n <div class=\"col s12 m12 l12\">\n <img class=\"modalimg\" src=\"${element.img}\" alt=\"${element.name}\"/>\n </div>\n <div class=\"row\">\n <h6 class=\"col s4 m4 l4 elementtitle\">Tipo</h6>\n <h6 class=\"col s4 m4 l4 elementtitle\">Peso</h6>\n <h6 class=\"col s4 m4 l4 elementtitle\">Altura</h6>\n <h6 class=\"col s4 m4 l4 elementdata\">${element.type}</h6>\n <h6 class=\"col s4 m4 l4 elementdata\">${element.weight}</h6>\n <h6 class=\"col s4 m4 l4 elementdata\">${element.height}</h6>\n </div>\n \n <div class=\"row\">\n <h6 class=\"elementtitle\">Debilidades</h6>\n <h6 class=\"elementdata\">${element.weaknesses}</h6>\n </div>\n <div class=\"row\">\n <h6 class=\"col s6 m6 l6 elementtitle\">Cantidad de candys</h6>\n <h6 class=\"col s6 m6 l6 elementtitle\">Km huevos</h6>\n <h6 class=\"col s6 m6 l6 elementdata\">${element.candy_count?element.candy_count:\"Sin candys\"}</h6>\n <h6 class=\"col s6 m6 l6 elementdata\">${element.egg}</h6>\n <h6 class=\"col s6 m6 l6 elementtitle\">Evolución previa</h6>\n <h6 class=\"col s6 m6 l6 elementtitle\">Evolución Posterior</h6>\n <h6 class=\"col s6 m6 l6 elementdata \">${preEvolutions}</h6>\n <h6 class=\"col s6 m6 l6 elementdata\">${nextEvolutions}</h6>\n </div> \n </div>\n </div>\n </div>\n `\n \n });\n /*Materialize elemento Modal*/\n $('.modal').modal();\n}", "title": "" }, { "docid": "e3ac4816414919718279833001bbb9c9", "score": "0.5574445", "text": "function openReposicaoModal() {\n jQuery(\"#myModalReposicaoModal\").modal(\"show\");\n}", "title": "" }, { "docid": "84416f7a9936e650cf671d7076db00bc", "score": "0.5571748", "text": "function showModal(index) {\n\n\n angular.element('.details')[0].scrollTop = 0;\n\n angular.element('.details-top').addClass('fadein0');\n angular.element('.color-bar').addClass('fadein150');\n angular.element('.similar').addClass('fadein300');\n angular.element('.complexity-graph').addClass('fadein450');\n\n self.current.similar = [];\n\n self.current.id = self.all[index]._id;\n self.current.artist = self.all[index].artist;\n self.current.title = self.all[index].title;\n self.current.downloads = self.all[index].downloads;\n self.current.city = self.all[index].city;\n self.current.state = self.all[index].state;\n self.current.day = self.all[index].day;\n self.current.month = self.all[index].month;\n self.current.year = self.all[index].year;\n self.current.link = self.all[index].link;\n self.current.thumb_image = self.all[index].thumb_image;\n self.current.complexity = self.all[index].colorAll;\n self.current.count = self.all[index].colorCount;\n self.current.score = self.all[index].score;\n\n // color spread\n var colorArr = self.all[index].analysis.clusters;\n\n for (var i = 0; i < 8; i++) {\n self.current.colors[i].hexVal = colorArr[i].hex[0];\n self.current.colors[i].percentage = colorArr[i].f;\n }\n\n findSimilarByComplex(self.all[index]);\n findAllByArtist(self.all[index]);\n\n\n }", "title": "" }, { "docid": "6e3bbaba899a91be197743fdcddbb934", "score": "0.5570714", "text": "function displayResults(){\n var zone = document.querySelector('.form');\n var code = `\n <div id='results'>\n <p>Muchas gracias por su interés.<p>\n <p>Usted ha enviado los siguientes datos:</p>\n <ul>\n <li>Su nombre: <i>${nombre.value}</i></li>\n <li>Su cédula: <i>${cedula.value}</i></li>\n <li>Su telefono: <i>${telefono.value}</i></li>\n <li>Su email: <i>${email.value}</i></li>\n </ul>\n </div>\n `;\n zone.insertAdjacentHTML('beforeend', code);\n window.location.href = \"#\"+'brand';\n}", "title": "" }, { "docid": "1e238310e1214197aa5855fb4ae81a9f", "score": "0.5569826", "text": "async show ({ params, request, response }) {\n\n // BUSCAR O PAINEL POR EMPRESA\n\n const data = await Painel.query().where('idEmpresa', '=', params.id).fetch()\n\n return {data}\n }", "title": "" }, { "docid": "f393d316c0de467eed349184c1692893", "score": "0.55674595", "text": "function searchpage_show_result(){\n\tvar loc = location.href;\n\tvar n1 = loc.length; // the length of url\n\tvar n2 = loc.indexOf(\"=\"); // the location of \"=equal\"\n\tvar keyword = decodeURI(loc.substr(n2+1, n1-n2)); //get the content after \"=equal\"\n\t\n\t// when the json is not exist\n\tvar text = localStorage.getItem(\"database_json\");\n\tif(!text){\n\t\treturn;\n\t}\n\n\t\n\tvar dataArr = JSON.parse(text);\n\tvar tableData = \"\";\n\t// show all records in the JSON\n\tif(keyword == null || keyword == \"\") {\n\t\tfor (var i = 0; i < dataArr.length; i++){\n\t\t\ttableData += \"<tr> <td>\" + dataArr[i].name + \"</td> <td>\" + dataArr[i].email + \"</td> <td>\" + dataArr[i].phone + \"</td> <td>\" + dataArr[i].address + \"</td> <td>\" + dataArr[i].vehiclemake + \"</td> <td>\" + dataArr[i].model + \"</td> <td>\" + dataArr[i].year + \"</td> <td>\" + \"<a href=https://www.jdpower.com/Cars/\"+dataArr[i].year+\"/\"+dataArr[i].vehiclemake+\"/\"+dataArr[i].model+\">Products</a>\" + \"</td> <tr>\"\n\t\t}\n\t\tdocument.getElementById(\"myTbody\").innerHTML = tableData;\n\t}\n\telse\n\t{\n\t\t// search a specific record by \"Make\"\n\t\tvar check_flag = false;\n\t\tfor (var i = 0; i < dataArr.length; i++){\n\t\t\tif (dataArr[i].vehiclemake.toLowerCase() == keyword.toLowerCase()){\n\t\t\t\ttableData += \"<tr> <td>\" + dataArr[i].name + \"</td> <td>\" + dataArr[i].email + \"</td> <td>\" + dataArr[i].phone + \"</td> <td>\" + dataArr[i].address + \"</td> <td>\" + dataArr[i].vehiclemake + \"</td> <td>\" + dataArr[i].model + \"</td> <td>\" + dataArr[i].year + \"</td> <td>\" + \"<a href=https://www.jdpower.com/Cars/\"+dataArr[i].year+\"/\"+dataArr[i].vehiclemake+\"/\"+dataArr[i].model+\">Products</a>\" + \"</td> <tr>\"\n\t\t\t\tcheck_flag = true;\n\t\t\t}\n\t\t}\n\t\tif(check_flag){\n\t\t\tdocument.getElementById(\"myTbody\").innerHTML = tableData;\n\t\t}\n\t\telse{\n\t\t\tdocument.getElementById(\"result_message\").innerHTML = \"Sorry, Did Not Find That Car!\";\n\t\t}\n\t}\n}", "title": "" }, { "docid": "95a0bd6e3c6df83cf0b20eddbc8ac8f3", "score": "0.55528927", "text": "async function searchForShowAndDisplay() {\n const term = $(\"#searchForm-term\").val();\n const shows = await getShowsByTerm(term);\n\n $episodesArea.hide();\n populateShows(shows);\n}", "title": "" }, { "docid": "95a0bd6e3c6df83cf0b20eddbc8ac8f3", "score": "0.55528927", "text": "async function searchForShowAndDisplay() {\n const term = $(\"#searchForm-term\").val();\n const shows = await getShowsByTerm(term);\n\n $episodesArea.hide();\n populateShows(shows);\n}", "title": "" }, { "docid": "95a0bd6e3c6df83cf0b20eddbc8ac8f3", "score": "0.55528927", "text": "async function searchForShowAndDisplay() {\n const term = $(\"#searchForm-term\").val();\n const shows = await getShowsByTerm(term);\n\n $episodesArea.hide();\n populateShows(shows);\n}", "title": "" }, { "docid": "5700be1bc7ff48556c132ac190104833", "score": "0.554677", "text": "function FindEmployee() {\n\n //get the input from the search bar\n var search = $('.search-input:input').val().trim();\n\n //if search bar is cleared all employees will be displayed\n if (search == '') {\n showedEmp = employees;\n $('.card').show();\n } else {\n $('.card').hide();\n //find matching employees and display only their cards\n showedEmp = employees.filter(emp => emp.name.toLowerCase().includes(search));\n showedEmp.forEach((emp) => $(`#card${emp.id}`).show());\n }\n //display not found message if no employees match the search\n if (showedEmp.length == 0) {\n notFound.show();\n } else {\n notFound.hide();\n }\n }", "title": "" }, { "docid": "c92987e1734e6a989ff4c8159143f83f", "score": "0.5546328", "text": "showResultsListOnClick() {\n if (this.resultsArray.length > 0) {\n this.populateResults(this.resultsArray);\n }\n }", "title": "" }, { "docid": "234a6adb1fc797369d565a7698ed7716", "score": "0.5544261", "text": "function search () {\n\n var params = {\n name: getProductName(),\n category_id: getSelectedCategoryId(),\n min_price: getMinPrice(),\n max_price: getMaxPrice()\n }\n\n params = $.extend({}, params);\n\n var url = getUrl();\n //var queryString = $.param(params);\n var queryString = buildQueryString(params);\n\n // Reload the page with the newly built query string\n window.location = url + '?' + queryString;\n }", "title": "" }, { "docid": "e56400ea84cab8bfc3fea5aa79cc0b21", "score": "0.5539826", "text": "function callback(searchResults){\n res.render('search/results', {\n wines: searchResults\n });\n }", "title": "" }, { "docid": "55382bd7bdfabe594e061a9018cc33db", "score": "0.5537197", "text": "function modalSucesso(){\n let modal = $(\"#modalSucesso\")\n new bootstrap.Modal(modal).show()\n}", "title": "" }, { "docid": "a2ee858d79a27a3570ba09f8fcf75246", "score": "0.55308145", "text": "function search() {\r\n var cdConciliacion;\r\n var continua = \"S\";\r\n\r\n if ($('#modificada').val() == \"S\") {\r\n if (confirm(\"Desea realizar una nueva consulta sin grabar los cambios?\") == false) {\r\n continua = \"N\";\r\n }\r\n }\r\n $('#conciliacion_responseMsgs').hide(); \r\n if (continua == \"S\") {\r\n if ($('#cdConciliacion').val() == '') {\r\n $('#cdConciliacion').val('0');\t\r\n }\r\n\r\n $('#conciliacion_responseMsgs').hide(); \r\n $(\"#grabada\").val('N');\r\n $('#conciliacionesGrid').hide();\r\n\r\n cdConciliacion = $('#cdConciliacion').val();\r\n\t if (validateInput() == true) {\r\n if ($('#cdConciliacion').val() == 0) {\r\n \t $('#conciliacion').val('0');\r\n } else {\r\n \t $('#conciliacion').val(cdConciliacion);\r\n } \r\n $('#cdProveedor').val($('#filtroProveedorList').val());\r\n $('#cdSector').val($('#filtroSectorList').val());\r\n $('#cdPeriodo').val($('#filtroPeriodoList').val());\r\n $('#stConciliacion').val($('#filtroSituacionConciliacionList').val());\r\n \r\n /*\r\n * Obtengo el sector por de acuerdo con el perfil del usuario. \r\n */\r\n var paramSector = getSectorByPerfil();\r\n var params = '';\r\n \r\n params += \"cdConciliacion=\"+cdConciliacion;\r\n params += \"&cdProveedor=\"+$('#cdProveedor').val();\r\n// params += \"&cdSector=\"+ paramSector;\r\n params += \"&cdSector=\"+$('#cdSector').val();\r\n params += \"&cdPeriodo=\"+$('#cdPeriodo').val();\r\n//alert(params);\r\n callJsonAction(\"consultaNoMedibles.action\", params, \"successConciliacion\", \"errorConciliacion\");\r\n }\r\n }\r\n $(\"#btnImprimir\").removeClass('ui-state-disabled');\r\n $(\"#btnImprimir\").removeAttr(\"disabled\");\r\n $(\"#btnExportar\").removeClass('ui-state-disabled');\r\n $(\"#btnExportar\").removeAttr(\"disabled\");\r\n}", "title": "" }, { "docid": "1cf9af6ddb35c6054c7b6b5a5f100f61", "score": "0.55272746", "text": "async show({ params, request, response, view }) {}", "title": "" }, { "docid": "cfa1a982588886bb469cf59840c55887", "score": "0.5525874", "text": "function displaySearchData(data) {\n var results;\n results = renderResult(data);\n $(\".js-search-results\").html(results);\n}", "title": "" }, { "docid": "c958775bd2fd808310ea824601bcae9f", "score": "0.55237365", "text": "async function mainView(search=\"\") {\n let rows =[];\n movies = await getData(search)\n if (movies.hasOwnProperty(\"searchError\")) {\n rows = [`<tr>\n <td>${movies.searchError}</td>\n </tr>`]\n } else {\n rows = movies.map(movies => {\n let row = `<tr>\n <td onclick=\"movieDetailView('movie',${movies.MovieId})\">${movies.Title}</td>\n <td>${movies.ReleseDate}</td>`;\n if (userLoggedIn() === true) { \n row+= `<td class=\"text-center\"><button class=\"btn\" data-toggle=\"modal\" data-target=\"#MovieUpdateFormDialog\" onclick=\"prepareMovieUpdate(${movies.MovieId})\"><span class=\"oi oi-pencil\"></span></button></td>\n <td class=\"text-center\"><button class=\"btn\" onclick=\"deleteMovie(${movies.MovieId})\"><span class=\"oi oi-trash\"></span></button></td>`\n }\n row+= '</tr>';\n return row\n });\n }\n\n document.getElementById('index-table').innerHTML = rows.join('')\n\n}", "title": "" }, { "docid": "400911eb0f2add92c519a88f134d021e", "score": "0.5523088", "text": "function createStudyListSearchPage(){\n\t\t\n\t\treturn createModal();\n\n\t\t/*\n\t\t* This function creates the html for the modal box of study list\n\t\t* buttons and its children, and it adds the display attributes/\n\t\t* function to close the modals.\n\t\t*/\n\t\tfunction createModal(){\n\t\t\tlet modal = document.createElement(\"modal\");\t//The actual modal box\n\t\t\tlet opacityBehindModal = document.createElement(\"modal\");\t//The shaded area behind the modal box\n\t\t\tstyleModal(modal, opacityBehindModal);\n\t\t\tlet searchBox = createSearchField(modal);\t//The search field\n\t\t\tlet listArea = document.createElement(\"DIV\");\t//Div parent to study list buttons\n\n\t\t\tlistArea.id = \"listArea\";\n\t\t\tmodal.appendChild(listArea);\n\t\t\tmakeStudyListButtons(getStudyList(null), listArea);\n\n\t\t\t//The modal system is initially unseen\n\t\t\topacityBehindModal.style.display = \"none\";\n\t\t\tmodal.style.display = \"none\";\n\n\t\t\t//Closes the modal system when user clicks on partially opaque modal\n\t\t\topacityBehindModal.onclick = function(){\n\t\t\t\tmodal.style.display = \"none\";\n\t\t\t\topacityBehindModal.style.display = \"none\";\n\t\t\t}\n\n\t\t\t//Allows other methods to access the modal system\n\t\t\tfunction getModal(isBackground){\n\t\t\t\tif (isBackground)\n\t\t\t\t\treturn opacityBehindModal;\n\t\t\t\telse return modal;\n\t\t\t}\n\t\t\t\n\t\t\tdocument.body.appendChild(modal);\n\t\t\tdocument.body.appendChild(opacityBehindModal);\n\n\t\t\treturn getModal;\n\t\t}\n\t\t\n\t\t/*\n\t\t* This function adds styling to the modal box of study list buttons\n\t\t* and the opaque gray modal behind it.\n\t\t*/\n\t\tfunction styleModal(modal, opacityBehindModal){\n\t\t\topacityBehindModal.style.zIndex = \"2\";\n\t\t\topacityBehindModal.style.position = \"fixed\";\n\t\t\topacityBehindModal.style.left = \"0\";\n\t\t\topacityBehindModal.style.top = \"0\";\n\t\t\topacityBehindModal.style.width = \"100%\";\n\t\t\topacityBehindModal.style.height = \"100%\";\n\t\t\topacityBehindModal.style.overflow = \"auto\";\n\t\t\topacityBehindModal.style.backgroundColor = \"gray\";\n\t\t\topacityBehindModal.style.opacity = \"0.5\";\n\n\t\t\tmodal.style.zIndex = \"3\";\n\t\t\tmodal.style.position = \"fixed\";\n\t\t\tmodal.style.left = \"10%\";\n\t\t\tmodal.style.top = \"10%\";\n\t\t\tmodal.style.width = \"80%\";\n\t\t\tmodal.style.height = \"80%\";\n\t\t\tmodal.style.overflow = \"auto\";\n\t\t\tmodal.style.backgroundColor = \"white\";\n\t\t\tmodal.style.borderRadius = \"16px\";\n\t\t\tmodal.style.padding = \"5px\";\n\t\t\tmodal.style.textAlign = \"center\";\n\t\t}\n\n\t\t/*\n\t\t* This function creates the html for the field to search study lists.\n\t\t*/\n\t\tfunction createSearchField(studyListModal){\n\t\t\tlet search = document.createElement(\"INPUT\");\n\t\t\tstyleSearchField(search);\n\n\t\t\t//Adds the search field to the study list modal\n\t\t\tstudyListModal.appendChild(search);\n\n\t\t\t//Actually runs the search command\n\t\t\tsearchLists(search);\n\n\t\t\treturn search;\n\t\t}\n\n\t\t/*\n\t\t* This function creates the styling for the search field used to\n\t\t* search for study lists.\n\t\t*/\n\t\tfunction styleSearchField(search){\n\t\t\tsearch.placeholder = \"Search\";\n\t\t\tsearch.autocomplete = \"off\";\n\t\t\tsearch.autocorrect = \"off\";\n\t\t\tsearch.autocaptalize = \"off\";\n\t\t\tsearch.spellcheck = false;\n\n\t\t\tsearch.style.width = \"60%\";\n\t\t\tsearch.style.height = \"30px\";\n\t\t\tsearch.style.padding = \"12px 20px\";\n\t\t\tsearch.style.margin = \"auto\";\n\t\t\tsearch.style.marginTop = \"4px\";\n\t\t\tsearch.style.marginBottom = \"4px\";\n\t\t\tsearch.style.border = \"1px solid #ccc\";\n\t\t\tsearch.style.borderRadius = \"20px\";\n\t\t\tsearch.style.boxSizing = \"border-box\";\n\t\t\tsearch.style.fontSize = \"16px\";\n\t\t\tsearch.style.backgroundColor = \"white\";\n\t\t\tsearch.style.display = \"block\";\n\n\t\t\tsearch.onfocus = function(){\n\t\t\t\tsearch.style.outline = \"0\";\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t* This function takes input from the text field search on each keyup\n\t\t* and runs a search for the study lists that are the best match to\n\t\t* the value of the search field. It then displays the applicable\n\t\t* button elements in the correct order.\n\t\t*/\n\t\tfunction searchLists(search){\n\t\t\tlet keyWords;\t//Array of individual words from the search field\n\n\t\t\tsearch.onkeyup = function(e){\n\t\t\t\tdisplayFoundStudyLists(augmentListOfStudyLists(findNumKeywordHits(keyWords, search)));\n\t\t\t};\n\t\t}\n\n\t\t/*\n\t\t* This function returns an array that contains the id of each study list\n\t\t* and its corresponding number of keyword hits in arrays of length two.\n\t\t*/\n\t\tfunction findNumKeywordHits(keyWords, searchField){\n\t\t\tlet orderedLists = new Array();\t//list of applicable study lists\n\t\t\tkeyWords = getIndividualWords(searchField.value.toLowerCase());\n\n\t\t\t//Finds the number of times each keyword shows up in the title of each study list\n\t\t\tfor (let i = 0; i < listOfLists.length; i++){\n\t\t\t\tlet numFound = 0;\t//Number of keyword hits found\n\t\t\t\t\n\t\t\t\tfor (let j = 0; j < keyWords.length; j++){\n\t\t\t\t\tlet currentString = listOfLists[i][1].toLowerCase();\t//The title of the current study list\n\t\t\t\t\t\n\t\t\t\t\t//find each instance of each keyword\n\t\t\t\t\twhile(currentString.indexOf(keyWords[j]) != -1){\n\t\t\t\t\t\tnumFound++;\n\t\t\t\t\t\tcurrentString = currentString.substring(currentString.indexOf(keyWords[j]) + keyWords[j].length);\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\torderedLists.push([listOfLists[i][1], numFound]);\t//Associates each list with its number of hits\n\t\t\t}\n\n\t\t\treturn orderedLists;\n\t\t}\n\n\t\t/*\n\t\t* This function both removes study lists with no keyword hits at all from\n\t\t* the array orderedLists and sorts orderedLists by the number of keyword\n\t\t* hits.\n\t\t*/\n\t\tfunction augmentListOfStudyLists(orderedLists){\n\t\t\t//Removes study lists with no keyword hits at all\n\t\t\tfor (let i = 0; i < orderedLists.length;){\n\t\t\t\tif (orderedLists[i][1] == 0)\n\t\t\t\t{\n\t\t\t\t\torderedLists.splice(i, 1);\n\t\t\t\t}\n\t\t\t\telse i++;\n\t\t\t}\n\n\t\t\t//Sorts the study lists by number of hits - largest to smallest\n\t\t\torderedLists.sort(function(a, b) {\n \t\t\t\treturn b[1] - a[1];\n \t\t\t});\n\n \t\t\treturn orderedLists;\n\t\t}\n\n\t\t/*\n\t\t* This function displays the study lists that match the search keywords in the\n\t\t* correct order, and if no lists match, it displays all of the lists in their\n\t\t* original order.\n\t\t*/\n\t\tfunction displayFoundStudyLists(orderedLists){\n\t\t\tlet listArea = document.getElementById(\"listArea\");\n\n\t\t\t//Clear the study list button parent div\n\t\t\twhile (listArea.hasChildNodes()){\n\t\t\t\tlistArea.removeChild(listArea.firstChild);\n\t\t\t}\n\n\t\t\tlet currentButtonList = new Array();\t//The list of study lists post search\n\n\t\t\t//Fills the list of study lists with the actual study lists\n\t\t\tfor (let i = 0; i < orderedLists.length; i++){\n\t\t\t\tfor (let j = 0; j < getStudyList(null).length; j++){\n\t\t\t\t\tif (orderedLists[i][0] === getStudyList(null)[j][1]){\n\t\t\t\t\t\tcurrentButtonList.push(getStudyList(null)[j]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//Display results\n\t\t\tif (currentButtonList.length == 0)\n\t\t\t{\n\t\t\t\tmakeStudyListButtons(getStudyList(null), listArea)\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmakeStudyListButtons(currentButtonList, listArea);\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t* This function creates and returns an array that contains\n\t\t* the individual words found in the parameter string.\n\t\t*/\n\t\tfunction getIndividualWords(string){\n\t\t\tlet words = new Array();\n\n\t\t\tlet nextSpace = string.indexOf(\" \");\n\t\t\t\n\t\t\t//Takes words off of string that are split by a space\n\t\t\twhile (nextSpace != -1){\n\t\t\t\twords.push(string.substring(0, nextSpace));\n\t\t\t\tif (string.length > 0){\n\t\t\t\t\tstring = string.substring(nextSpace + 1);\n\t\t\t\t}\n\t\t\t\tnextSpace = string.indexOf(\" \");\n\t\t\t}\n\t\t\t\n\t\t\tif (string.length > 0){\n\t\t\t\twords.push(string);\n\t\t\t}\n\n\t\t\treturn words;\n\t\t}\n\n\t\t/**\n\t\t* Creates the button HTML elements that toggle which word list\n\t\t* is to be studied.\n\t\t**/\n\t\tfunction makeStudyListButtons(chapters, buttonParent){\n\n\t\t\t//Adds the study list buttons\n\t\t\tfor (let chaptersIndex = 0; chaptersIndex < chapters.length; chaptersIndex++){\n\t\t\t let currentButton = createButton(chapters[chaptersIndex][1], \"#555\", \"2px solid white\");\n\t\t\t buttonParent.appendChild(currentButton);\n\t\t\t \n\t\t\t currentButton.onclick = function(){\n\t\t\t for (let i = 0; i < chapters.length; i++){\n\t\t\t //Changes studied word list to that associated with this button\n\t\t\t if (currentButton.id == chapters[i][1]){\n\t\t\t currentStudyList = shuffle(chapters[i][0]);\n\t\t\t changeStudyList(chapters[i][1]);\n\t\t\t changePrompt(0, true);\n\t\t\t document.getElementById(\"reaction\").innerText = \"\";\n\t\t\t document.getElementById(\"shouldStudy\").innerText = \"\";\n\t\t\t document.getElementById(\"study\").innerText = \"\";\n\t\t\t document.getElementById(\"Study these words\").style.display = \"none\";\n\t\t\t }\n\t\t\t }\n\t\t\t runProgram(currentStudyList);\n\t\t\t getModal(false).style.display = \"none\";\n\t\t\t getModal(true).style.display = \"none\";\n\t\t\t };\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "7d4a9433a2e620611d63ab0f9b0fcff3", "score": "0.5520389", "text": "search() {\n if (this.params) {\n this.searchService.query(this.params).then(\n resp => this.results = resp.data.results);\n }\n }", "title": "" }, { "docid": "1c89770d482a6dfea2b4904003c5b098", "score": "0.5515541", "text": "function hideSearchModal() {\n $('#landing-search').fadeOut();\n }", "title": "" }, { "docid": "ee6d315d5bcb2702d6fe4dd0acd15368", "score": "0.55139565", "text": "searching(event) {\n event.preventDefault();\n this.clear();\n\n let data = document.querySelector(\".data\");\n if(data.style.display == 'none' || data.style.display == '')\n data.style.display = 'block';\n\n let detail = document.querySelector(\"#repodetail\");\n if(detail.style.display == 'block')\n detail.style.display = 'none';\n\n \n\t\tlet user = new User(\n\t\t\tthis._inputUserName.value\n\t\t);\n\t\tif(user !== undefined) {\n this.requestDetailsAPI(this._inputUserName.value); \n this.requestReposApi(this._inputUserName.value); \n }else {\n\t\t\talert(\"Insira algum usuário!\");\n\t\t}\n }", "title": "" }, { "docid": "cbcd8ef027fe548d1b4ef17a96a2baa9", "score": "0.55089664", "text": "function openFullTestListModal() {\n $uibModal.open({\n templateUrl: '/components/results-report/partials' +\n '/fullTestListModal.html',\n backdrop: true,\n windowClass: 'modal',\n animation: true,\n controller: 'FullTestListModalController as modal',\n size: 'lg',\n resolve: {\n tests: function () {\n return ctrl.resultsData.results;\n },\n gl_type: function () {\n return ctrl.gl_type;\n }\n }\n\n });\n }", "title": "" }, { "docid": "e99ef799f3fc494e51fe5396985f8176", "score": "0.5498061", "text": "function search() {\n // prendere il valore della input\n var searchMovie = $(\"#search\").val();\n resetSearch();\n // recupero i film\n getData(\"movie\", searchMovie);\n // recupero le serie tv\n getData(\"tv\", searchMovie);\n}", "title": "" }, { "docid": "98303c809cbbc4940d7094189c06af99", "score": "0.54938245", "text": "function handleSearchButton() {\n handleRouteCheck();\n Axios.post(\"/api/shippingTickets/shippingTickets\", {\n dateStart: startDate,\n dateEnd: endDate,\n school: schoolsSelected,\n }).then((result) => {\n if (validateSTForm() === true) {\n let assetArray = [];\n result.data.forEach((doc) => {\n if (assetArray.includes(doc.asset) !== true) {\n assetArray = [...assetArray, doc.asset];\n }\n });\n setAssets(assetArray);\n setData(result.data);\n setCount(\"Total Results: \" + result.data.length);\n setDisabled(false);\n }\n });\n }", "title": "" }, { "docid": "ba74c56947eb34fd3d9d18c2b149e1af", "score": "0.5493267", "text": "function search(event) {\n event.preventDefault();\n\n var generatedUrl = requestURL+ \"zip=\" + userInput.value + \",us&units=imperial&icon&appid=11a183a9809c0b88f3ea75fbbf8c9613\"\n \n fetch(generatedUrl) \n // .then(response => response.json())\n .then(function (response){\n console.log(response)\n if (!response.ok) {\n document.querySelector(\".modal\").style.display = \"block\";\n throw new Error(\"response not valid\")\n } \n return response.json();\n })\n .then(data => displayResults(data)).catch(err => console.log(err))\n\n\n saveToLocal();\n\n}", "title": "" }, { "docid": "e891e518705a5889dcad806cbed7adea", "score": "0.549056", "text": "function urlQuery() {\n if (!searchQueryParams()) {\n return;\n }\n\n launchSearchModal();\n }", "title": "" }, { "docid": "69abb93ffd1edc6ae3f488a203c5527a", "score": "0.5482671", "text": "function search () {\n\n const searchWord = $('#form1').val();\n console.log(searchWord);\n\n $.ajax({\n url: '/records/search',\n method: 'get',\n type: 'json',\n data: {\"word\": searchWord},\n success: function (data) {\n\n console.log(data);\n let row = \"\";\n for(let i = 0; i<data.length; i++) {\n let ind = data[i].id;\n let className = (i%2===0)?'list-group-item-success':'list-group-item-danger';\n row += '<tr style=\"cursor: pointer\">' +\n '<td><a class=\"btn btn-warning btn-block\" onclick=\"closeOpenModal(\\''+ind+'\\')\">Muuta</a></td>'+\n '<td onclick=\"rowClicked(\\''+ind+'\\')\" class='+className+'>'+data[i].id+'</td>' +\n '<td onclick=\"rowClicked(\\''+ind+'\\')\" class='+className+' id='+ind+'dentistName>'+data[i].dentistName+'</td>' +\n '<td onclick=\"rowClicked(\\''+ind+'\\')\" class='+className+' id='+ind+'updatedDate>'+data[i].date+'</td>' +\n '<td onclick=\"rowClicked(\\''+ind+'\\')\" class='+className+' id='+ind+'updatedTime>'+data[i].time+'</td>' +\n '<td onclick=\"rowClicked(\\''+ind+'\\')\" class='+className+' id='+ind+'updatedPname>'+data[i].patientName+'</td>' +\n '<td onclick=\"rowClicked(\\''+ind+'\\')\" class='+className+' id='+ind+'updatedComment>'+data[i].comment+'</td>' +\n '<td><a class=\"btn btn-danger btn-block\" onclick=\"deleteRecord(\\''+ind+'\\')\">Kustuta</a></td></tr>'\n\n }\n $('#tableBody').html(row);\n },\n error: function (){\n console.log(\"Search error\")\n }\n\n })\n\n}", "title": "" }, { "docid": "0c36c7c820f398a878ca5ca60b8bcb85", "score": "0.54787534", "text": "function find() {\n GeneralSvc.showLoading(vmBanner);\n getListData();\n }", "title": "" }, { "docid": "b4bf27dea8cf55a74f386aa3d96a7536", "score": "0.54765", "text": "function showModal(btnClass,modalWindow){$(btnClass).on('click',function(){if($(modalWindow).is(':hidden')==true){$(modalWindow).fadeIn();}else if($(modalWindow).is(':hidden')==false){$(modalWindow).fadeOut();}});}// View detail pruduct modal window", "title": "" }, { "docid": "159a7d983286212fca95eddc74ed81ad", "score": "0.5472772", "text": "function getSearchResults(user) {\n\n //1. Form search for word\n $('#contentElement').html(\n '<div class=\"row\">' +\n '<div class=\"col-md-5\">' +\n '<h4 style=\"margin-bottom: 25px; text-align: left\">Zoeken zoek criteria</h4>' +\n '</div>' +\n '</div>' +\n '<div class=\"row\">' +\n '<div class=\"col-md-5\">' +\n '<input type=\"text\" class=\"form-control\" id=\"txtSearchWord\" name=\"txtSearchWord\" placeholder=\"zoekterm\">' +\n '</div>' +\n '<div class=\"col-md-5\">' +\n '<button type=\"button\" class=\"btn btn-primary btn-flat btn-raised btn-float\" id=\"cmdSearchForm\"><span class=\"fa fa-plus\"></span></button>' +\n '</div>' +\n '</div>' +\n '<div class=\"row\">' +\n '<div class=\"col-md-12\">' +\n '<div id=\"tblContentResults\">' +\n '</div>' +\n '</div>'\n )\n\n // 2. Search on term\n $(\"#txtSearchWord\").autocomplete({\n source: function (request, response) {\n $.ajax({\n url: '/admin/getSearchResults',\n type: 'POST',\n contentType: 'application/json',\n data: JSON.stringify({term: request.term}),\n success: function (response) {\n console.info(response)\n //3 Show results\n $('#tblContentResults').html('')\n var table = '<table class=\"table table-hover\">' + response.header + response.body + '</table>'\n $('#tblContentResults').html(table)\n }\n })\n },\n minLength: 2,\n select: function (event, ui) {\n log(\"Selected: \" + ui.item.value + \" aka \" + ui.item.id);\n }\n })\n //3. add Search Criteria form results when press + button\n $('#cmdSearchForm').click(function () {\n console.info('cmdSearchForm')\n\n $('#contentElement').html(addSearchForm())\n\n //3.D Submit\n $('#addSearchValue').click(function () {\n var searchValue = $('#txtSearchValue').val()\n\n addSearchCriteria(searchValue, user)\n })\n })\n}", "title": "" }, { "docid": "de6f45745e36f45fbffad7c40d53971a", "score": "0.5470679", "text": "function openVacancyDetails(id, showViewApplications) {\n $.ajax(`/Vacancies/Details/${id}${showViewApplications !== undefined ? `?showViewApplications=${showViewApplications}` : ''}`)\n .then((data) => {\n $('#modalSpace').append($(data));\n $(\"#vacancyDetails\").modal();\n $('#vacancyDetails').on('hidden.bs.modal', function (e) {\n onModalClose('#vacancyDetails');\n })\n });\n}", "title": "" }, { "docid": "caee30dc2971c58b56a31ce5c1cfad83", "score": "0.5469376", "text": "function userHistorySearch() {\n let search = cityClicked;\n if (utla.includes(search)) {\n return search;\n }\n else {\n showModal(\"modal-nodata\");\n hideModal(\"modal-nodata\");\n }\n }", "title": "" }, { "docid": "f6b951534651fe7979af045df0c858eb", "score": "0.54635674", "text": "function coach_search() {\n var url_params = 'center_id=' + $scope.searchParams.center_id;\n\n $http.get('http://localhost:3000/api/v1' + '/coaches/?' + url_params)\n .then(success, error);\n // success\n function success(resp) {\n console.log('Coach result: ', resp);\n $scope.coaches = resp.data.data;\n $scope.coach_searchResult = $scope.coaches[0];\n }\n // error\n function error(resp) {\n console.log(resp);\n }\n }", "title": "" }, { "docid": "7d22056b1c659aed85bb0e1edf5ec525", "score": "0.5462572", "text": "function performSearch(req, res) {\n\tvar q = req.query.q;\n\tpropertyListingDAO.getListingByCity(q, function(rows) {\n\t\tres.render('search_result', {\n\t\t\tresults : rows\n\t\t});\n\t}, function(error) {\n\t\tconsole.log(error);\n\t});\n}", "title": "" }, { "docid": "410c9298ef07a266afe5af22fc9b8734", "score": "0.5460035", "text": "function json(params) {\n\t$('#search-div').show();\n\t$('#search-pre').hide();\n\t$.get('CoursesController?action=search&' + params, function(responseText) {\n\t\tdata: 'json',\n\t\t$(\"#search-div\").text(JSON.stringify(responseText));\n });\n}", "title": "" }, { "docid": "3edd441f30fb1eeeb9ee5d72ad21183f", "score": "0.54534626", "text": "function filtre(){\n //Recuperation de la valeur de l'input avec l'ID search\n member_id = $(\"#search\").val();\n //On reinitialise aussi le rang a 1 quand on filtre les resultats\n\trank_start = 1;\n //Utilisation de la methode definie dans javascript_leaderboards.js\n save_parameters();\n location.href = updateQueryStringParameter(location.href, 'start', rank_start);\n\n}", "title": "" }, { "docid": "3b5cca51c34e46fa9696bed8fcc0507f", "score": "0.5453147", "text": "function search(){\n window.location = '/sales?start_date=' + $(\"#start_date\").val() + \n '&end_date=' + $(\"#end_date\").val() + \"&client_id=\" + \n $(\"#client_id\").val();\n}", "title": "" }, { "docid": "5570614f1d5797349c79001d35b52522", "score": "0.54528856", "text": "function modalPlan() {\n $(\"#modalPlan\").modal(\"show\");\n}", "title": "" }, { "docid": "98f7ca38ad4616b7981d534d5599ee67", "score": "0.5443798", "text": "function handleSearchResultSelection() {\n // hide autocomplete\n $(resultsList).slideUp(\"slow\");\n // get data\n const data = this.dataset;\n // render data\n const renderedHtml = renderResultDetails(data);\n // display data\n return $(resultDetails)\n .html(renderedHtml)\n .show(\"slow\");\n}", "title": "" }, { "docid": "1e963973ec7db0e533c2e82f5b80a66d", "score": "0.5443355", "text": "function loadCompanyInfo() {\n\n $(\"#companies_list\").on('click', \".company_info_show\", function() {\n \t\n \tcompany_id = $(this).attr(\"data-company-id\");\n loader_url = $(\"#loader_element\").val();\n $('.modal-body').html(\"<p>Loading Informations....<img src='\" + loader_url + \"' /></p>\");\n\n $('#myModal').modal('show');\n\n $.ajax({\n url: '/companies/' + company_id,\n method: 'GET',\n success: function(response) {\n $('.modal-body').html(response);\n hideStatus();\n\n implementSearchOnOperations();\n },\n error: function(response) {\n console.log(response);\n }\n }); \t\t\n \t\t\n\n })\n }", "title": "" }, { "docid": "3fd3ed292a13ac538fb124872df5f413", "score": "0.54417753", "text": "function respuestaComentario(id){\n \n $('#a'+id).attr('class','form-row modal-header form-group');\n $('#a'+id).show(200); \n }", "title": "" }, { "docid": "e4f2a72403034404c5d08d15c4c9850d", "score": "0.5439933", "text": "function modalContrato(){\n let modal = $(\"#modalContrato\");\n new bootstrap.Modal(modal).show()\n}", "title": "" }, { "docid": "33748cb00adb0437012bb13c500a0d11", "score": "0.5433468", "text": "function showResults() {\n\n removeTableResults();\n buildUrl();\n processQuery()\n}", "title": "" }, { "docid": "f393f8a79d797dac74e0b3abe0a4d89c", "score": "0.5429219", "text": "function search(){\n\tif($('#header').hasClass('uni-head-4') || $('#header').hasClass('uni-head-5')){\n\t\tif($('.body-style').hasClass('desktop')){\n\t\t\turl = $('base').attr('href') + 'index.php?route=product/search';\n\t\t\n\t\t\tvar search = $('#header_search').val();\n\n\t\t\tif (search) {\n\t\t\t\turl += '&search=' + encodeURIComponent(search);\n\t\t\t}\n\t\t\t\n\t\t\tlocation = url;\n\t\t} else {\n\t\t\tdocument.getElementById('modal-search-product').classList.add('is-active');\n\t\t\t$('input[name=\\'search\\']').focus();\n\t\t}\n\t} else {\n\t\tdocument.getElementById('modal-search-product').classList.add('is-active');\n\t\t$('input[name=\\'search\\']').focus();\n\t}\n}", "title": "" }, { "docid": "5de2e59a6293b7398f1972783deef408", "score": "0.54245377", "text": "function search_results(data, context){\n var obj = JSON.parse(data);\n // cache the jQuery object\n var $search_results = $('#search_results');\n // empty the element\n $search_results.empty();\n // add the results\n $search_results.append('<h2>Results</h2><p>Objects with the following ids match your query:</p>');\n if (obj.ids.length>0) {\n var ol = \"\";\n for(o in obj.ids) {\n var obj_id = obj.ids[o];\n ol = ol + '<div class=\"result\"><a href=\"object.html#/'+obj_id+'\">'+obj_id+'</a></div>'\n }\n $search_results.append(ol);\n } else {\n $search_results.append('<div>None found. Please try again...</div>');\n }\n }", "title": "" }, { "docid": "df5c35d78061c7337a4afc922964d95f", "score": "0.5422197", "text": "function showResults(data){\n\t\t//clear previous results\n\t\tvar resultDiv=document.getElementById('result');\n\t\tresultDiv.innerHTML=\"<p>Click on any link to display next departures</p>\";\n\n\t\tif (data == null || data.results == null || data.results.items == null ) {\n\t\t\tresultDiv.innerHTML=\"No Data found.\";\n\t\t\treturn;\n\t\t}\n\n\t\tvar results=data.results.items,\n\t\tsuggestionDiv,\n\t\tsuggestion,\n\t\ticon;\n\t\tvar length=results.length;\n\t\t// Add suggestions to results box\n\t\tfor(var i=0;i<length;i++){\n\t\t\tsuggestionDiv=document.createElement(\"div\");\n\t\t\ticon=document.createElement(\"img\");\n\t\t\ticon.src=results[i].icon;\n\t\t\ticon.height=\"30\";\n\t\t\ticon.width=\"30\";\n\t\t\ticon.setAttribute(\"style\",\"vertical-align: middle\");\n\t\t\tsuggestionDiv.appendChild(icon);\n\t\t\tsuggestion=document.createElement(\"a\");\n\t\t\t//pass the href for getting details from suggestion\n\t\t\tsuggestion.href=\"javascript:findDeparture('\"+results[i].href+\"',\"+results[i].position+\")\";\n\t\t\tsuggestion.innerHTML=results[i].title;\n\t\t\tsuggestionDiv.appendChild(suggestion);\n\t\t\tsuggestionDiv.appendChild(suggestion);\n\t\t\tresultDiv.appendChild(suggestionDiv);\n\t\t}\n\t\tresultDiv.style.display=\"block\";\n\t\tdocument.body.style.cursor = 'auto';\n\t}", "title": "" }, { "docid": "fcdb74dfb5bfa1891d0ed6731924b748", "score": "0.54202694", "text": "function clickSearch() {\n event.preventDefault();\n var q = $(\".facetview_freetext\", obj).val();\n options.from = 0;\n options.q = q;\n doSearch()\n }", "title": "" }, { "docid": "fcdb74dfb5bfa1891d0ed6731924b748", "score": "0.54202694", "text": "function clickSearch() {\n event.preventDefault();\n var q = $(\".facetview_freetext\", obj).val();\n options.from = 0;\n options.q = q;\n doSearch()\n }", "title": "" }, { "docid": "f130da6abeeb27bd2453ec97c6fdd956", "score": "0.5419259", "text": "function doSearch()\n {\n readCookie();\n accessIdForEdit = \"\";\n var lookUp = document.getElementById(\"searchText\").value;\n\n var jsonPayload = JSON.stringify({search:lookUp, userId:userId});\n var url = urlBase + '/LAMPAPI/search.' + extension;\n var xhr = new XMLHttpRequest();\n\n xhr.open(\"POST\", url, true);\n xhr.setRequestHeader(\"Content-type\", \"application/json; charset=UTF-8\");\n try {\n xhr.onreadystatechange = function () {\n\n if (this.readyState === 4 && this.status === 200) {\n\n localResults = JSON.parse(xhr.responseText).results;\n buildTable(localResults);\n }\n\n };\n xhr.send(jsonPayload);\n }\n catch(err)\n {\n document.getElementById(\"searchList\").innerHTML = err.message;\n }\n\n }", "title": "" }, { "docid": "19eacc7633f9ef7ae7759226398591a8", "score": "0.54182684", "text": "function SearchController($mdDialog, $sce) {\n const self = this;\n self.mangaResults = { list: [] }\n self.detailsPage = { list: {} }\n\n self.hide = function () {\n $mdDialog.hide();\n };\n\n self.cancel = function () {\n $mdDialog.cancel();\n };\n\n self.answer = function (answer) {\n // when they click the button. This sends back the result which is caught by the .then of self.searchDialog\n $mdDialog.hide(answer);\n };\n\n self.searchManga = function (searchInput) {\n self.results = false;\n self.details = false;\n $http.get(`/api/manga/preLogin/${searchInput}`)\n .then(response => {\n // console.log(response);\n if (Array.isArray(response.data)) { // If the resulting search is an array. Then continue to display the results.\n self.mangaResults.list = response\n self.results = true;\n // $location.path(\"/results\");\n }\n else { //This is if the search results into only a single resulting manga. It will go to the manga details tab directly. \n self.details = true;\n self.detailsPage.list = response.data\n // $location.path(\"/mangainfo\");\n }\n })\n .catch(error => {\n swal({\n title: `There was an error with the search`,\n text: `Please try a different one`,\n icon: \"error\",\n })\n })\n };\n\n self.mangaDetail = function (manga) {\n self.details = true;\n self.detailsPage.list = manga;\n // $location.path(\"/mangainfo\");\n }\n\n self.renderHTML = function (data) {\n // console.log('inside');\n return $sce.trustAsHtml(data);\n }\n }", "title": "" }, { "docid": "e176355628de65270b1ce704cbae79cd", "score": "0.5416499", "text": "function search(url, params, mode, card_generator, divToUse) {\n // mode should be 'OVERWRITE', 'APPEND', or 'MODAL'\n mode = mode || 'OVERWRITE';\n\n if (requesting !== null) {\n window.requesting.abort();\n }\n\n if (params === null) {\n return;\n }\n\n if (mode == 'OVERWRITE') {\n params = add_elastic_params(params);\n }\n\n window.lastQuery = params;\n let newReq = $.get(url, params);\n window.requesting = newReq;\n\n if (mode == 'OVERWRITE' || mode == 'APPEND') {\n change_next_page_text('Loading...');\n }\n\n if (mode == 'OVERWRITE') {\n update_filter_summary(params);\n display_loading_bar(true);\n display_confused(false);\n update_results_header(null);\n clear_search_results();\n }\n\n newReq.done(data => {\n console.log(data);\n if (mode == 'OVERWRITE') {\n clear_search_results();\n }\n let num_results = display_query(data, divToUse, card_generator);\n if (mode == 'OVERWRITE' || mode == 'APPEND') {\n update_results_header(num_results);\n }\n })\n .fail(e => {\n if (e.statusText != 'abort') {\n display_error();\n }\n })\n .always(() => {\n if (mode == 'OVERWRITE') {\n display_loading_bar(false);\n }\n\n if (mode == 'OVERWRITE' || mode == 'APPEND') {\n change_next_page_text('Next Page');\n }\n // disable_search_buttons(false);\n window.requesting = null;\n });\n}", "title": "" }, { "docid": "e1ca20b66f056a8a0410fc19685b2e93", "score": "0.5415889", "text": "showResults() {\n\n\t\tthis.hideSearchPanel();\n\t\tsearchService.loadData(this.state.filterValues)\n\t\t\t.then(response => {\n\t\t\t\tif (response) {\n\t\t\t\t\tthis.setState({ filterResults: response });\n\t\t\t\t}\n\t\t\t});\n\n\t}", "title": "" }, { "docid": "dd36fc721fbe0a1fac61522462417b0a", "score": "0.54035634", "text": "function openDialogViewSignas() {\n\t// clean for eventual data\n\t$('#tbodySigna').empty();\n\n\t// load the data in the modal table\n\tvar url = Routing.generate('edb_signa_list') + \".json\";\n\n\t$\n\t\t\t.getJSON(\n\t\t\t\t\turl,\n\t\t\t\t\tfunction(data) {\n\t\t\t\t\t\tfor (i in data) {\n\t\t\t\t\t\t\t$('#tbodySigna')\n\t\t\t\t\t\t\t\t\t.append(\n\t\t\t\t\t\t\t\t\t\t\t'<tr>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ '<td>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ data[i].description\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ '</td>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"<td><button class='btn' type='button' onclick=\\\"addToSigna('\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ data[i].id + \"', '\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ data[i].description\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"')\\\">Add</button>\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"</td>\" + \"</tr>\");\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t// show the view\n\t$('#modalViewSignas').modal('show');\n\n}", "title": "" }, { "docid": "d7284da301fcfc8c30ad3835aa3846bc", "score": "0.5403465", "text": "function searchMsgAdmin() {\n\t\tlet $search = $('#inputMsgSearchAdmin').val();\n\t\t$('#getSearchAdmin').html('');\n\t\t$.ajax({\n\t\t\turl: './SCRIPT/fonctions.php?action=searchMsgAdmin',\n\t\t\ttype: 'POST',\n\t\t\tdataType: 'json',\n\t\t\tdata: {\n\t\t\t\tsearch: $search,\n\t\t\t\taction: 'searchMsgAdmin'\n\t\t\t},\n\t\t\tsuccess: function( datas ) {\n\t\t\t\tif( datas.MSG != \"Pas de résultat...\" ) {\n\t\t\t\t\tconsole.log( 'IF' )\n\t\t\t\t\tfor ( data of datas ) {\n\t\t\t\t\t\t$('#getSearchAdmin').prepend(\n\t\t\t\t\t\t\t`<div class=\"border border-dark rounded list-group-item list-group-item-action mb-2\">\n\t\t\t\t\t\t\t\t<div class=\"d-flex w-100 justify-content-between bg-dark text-light p-2 mb-3 rounded border border-dark\">\n\t\t\t\t\t\t\t\t\t<h5 class=\"mx-2\">${ data.PSEUDO }</h5><i>groupe: ${ data.NOMGRP }</i>\n\t\t\t\t\t\t\t\t\t<small>${ data.DATE_FR }</small>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<pre class=\"mb-1\">${ data.MSG }</pre>\n\t\t\t\t\t\t\t\t<hr>\n\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t<button class=\"btn btn-outline-dark replyMsg\" data-toggle=\"modal\" data-target=\"#replyModal\" data-idusr = \"${ data.IDUSR }\"><i class=\"fas fa-reply\"></i></button>\n\t\t\t\t\t\t\t\t\t<button class=\"btn btn-outline-dark delMsg\" data-idmsg = \"${ data.IDMSG }\"><i class=\"fas fa-trash-alt\"></i></button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>`);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log( 'ELSE' )\n\t\t\t\t\t$('#getSearchAdmin').prepend(`<div class=\"card bg-dark col text-center p-3 border-light\"><h4>Pas de résultat...</h4></div>`);\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}", "title": "" }, { "docid": "38769e43f2d37e9cbd83ed04ac752ff1", "score": "0.5402243", "text": "function execSearch() {\n const search = document.querySelector('#search').value;\n if(search.length === 0) showPage(data,1);\n const filteredList = list.filter((v) => \n `${v.name.first} ${v.name.last}`.toLowerCase().includes(search.toLowerCase())\n );\n if(filteredList.length > 0) {\n showPage(filteredList, 1);\n addPagination(filteredList);\n } else {\n studentList.innerHTML = '';\n studentList.insertAdjacentHTML('beforeend', `\n <li class=\"no-results\">No results found</li>`);\n linkListUL.innerHTML = '';\n }\n }", "title": "" } ]
c761860504b03738efce26428ec3ccdb
Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding DOM node.
[ { "docid": "c92b15b8347a1d85b99f206f7313504b", "score": "0.0", "text": "function getNodeFromInstance$1(inst) {\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber this, is just the state node right now. We assume it will be\n // a host component or host text.\n return inst.stateNode;\n }\n\n // Without this first invariant, passing a non-DOM-component triggers the next\n // invariant for a missing parent, which is super confusing.\n invariant(false, 'getNodeFromInstance: Invalid argument.');\n}", "title": "" } ]
[ { "docid": "3bd949fd6bdf752ee3455d5957d12976", "score": "0.67850256", "text": "function findFirstReactDOMImpl(node) {\n\t\t // This node might be from another React instance, so we make sure not to\n\t\t // examine the node cache here\n\t\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t\t if (node.nodeType !== 1) {\n\t\t // Not a DOMElement, therefore not a React component\n\t\t continue;\n\t\t }\n\t\t var nodeID = internalGetID(node);\n\t\t if (!nodeID) {\n\t\t continue;\n\t\t }\n\t\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\t\n\t\t // If containersByReactRootID contains the container we find by crawling up\n\t\t // the tree, we know that this instance of React rendered the node.\n\t\t // nb. isValid's strategy (with containsNode) does not work because render\n\t\t // trees may be nested and we don't want a false positive in that case.\n\t\t var current = node;\n\t\t var lastID;\n\t\t do {\n\t\t lastID = internalGetID(current);\n\t\t current = current.parentNode;\n\t\t if (current == null) {\n\t\t // The passed-in node has been detached from the container it was\n\t\t // originally rendered into.\n\t\t return null;\n\t\t }\n\t\t } while (lastID !== reactRootID);\n\t\t\n\t\t if (current === containersByReactRootID[reactRootID]) {\n\t\t return node;\n\t\t }\n\t\t }\n\t\t return null;\n\t\t}", "title": "" }, { "docid": "dee16e862fd25d2f09efd12277dc97b1", "score": "0.67771465", "text": "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return react_dom__WEBPACK_IMPORTED_MODULE_0__.findDOMNode(node);\n}", "title": "" }, { "docid": "056f75facf6dd16548f7104f4e3a6134", "score": "0.6770746", "text": "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return ReactDOM.default.findDOMNode(node);\n}", "title": "" }, { "docid": "861264ad4cba036c96a58355f3cbd216", "score": "0.67658514", "text": "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}", "title": "" }, { "docid": "861264ad4cba036c96a58355f3cbd216", "score": "0.67658514", "text": "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}", "title": "" }, { "docid": "2e1a524d28da4a34673581224212987c", "score": "0.6751226", "text": "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}", "title": "" }, { "docid": "51b6a63c007d22d981ec8da9eaffe0af", "score": "0.6741835", "text": "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n if (node instanceof react__WEBPACK_IMPORTED_MODULE_0__.Component) {\n return react_dom__WEBPACK_IMPORTED_MODULE_1__.findDOMNode(node);\n }\n return null;\n}", "title": "" }, { "docid": "2b48938d20e511b1edd95bfb89f49309", "score": "0.6741215", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\t\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "2b48938d20e511b1edd95bfb89f49309", "score": "0.6741215", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\t\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "2b48938d20e511b1edd95bfb89f49309", "score": "0.6741215", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\t\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "2b48938d20e511b1edd95bfb89f49309", "score": "0.6741215", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\t\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "2b48938d20e511b1edd95bfb89f49309", "score": "0.6741215", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\t\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "2b48938d20e511b1edd95bfb89f49309", "score": "0.6741215", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\t\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "2b48938d20e511b1edd95bfb89f49309", "score": "0.6741215", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\t\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "779f068cacd028329ab6a3cd291f8aae", "score": "0.6739783", "text": "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return _reactDom.default.findDOMNode(node);\n}", "title": "" }, { "docid": "779f068cacd028329ab6a3cd291f8aae", "score": "0.6739783", "text": "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return _reactDom.default.findDOMNode(node);\n}", "title": "" }, { "docid": "779f068cacd028329ab6a3cd291f8aae", "score": "0.6739783", "text": "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return _reactDom.default.findDOMNode(node);\n}", "title": "" }, { "docid": "779f068cacd028329ab6a3cd291f8aae", "score": "0.6739783", "text": "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return _reactDom.default.findDOMNode(node);\n}", "title": "" }, { "docid": "779f068cacd028329ab6a3cd291f8aae", "score": "0.6739783", "text": "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return _reactDom.default.findDOMNode(node);\n}", "title": "" }, { "docid": "779f068cacd028329ab6a3cd291f8aae", "score": "0.6739783", "text": "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return _reactDom.default.findDOMNode(node);\n}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.6732065", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.6732065", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.6732065", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.6732065", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.6732065", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.6732065", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.6732065", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.6732065", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.6732065", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.6732065", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.6732065", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.6732065", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.6732065", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.6732065", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.6732065", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.6732065", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.67167735", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.67167735", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.67167735", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.67167735", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.67167735", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.67167735", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.67167735", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.67167735", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.67167735", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.67167735", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.67167735", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.67167735", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.67167735", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.67167735", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "cb8261094a6f5a90f80c3e3ed055852e", "score": "0.6711829", "text": "function findDOMNode$2(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return ReactDOM.default.findDOMNode(node);\n}", "title": "" }, { "docid": "3dc11b8549be7f7f671c5bbaaebbb5e2", "score": "0.6696927", "text": "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}", "title": "" }, { "docid": "3dc11b8549be7f7f671c5bbaaebbb5e2", "score": "0.6696927", "text": "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}", "title": "" }, { "docid": "4dcc65e450625074a0c811b08a09676b", "score": "0.663756", "text": "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 }", "title": "" }, { "docid": "6f71d7eba61df6eabd034e605f163b09", "score": "0.6631462", "text": "function findDOMNode$1(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return ReactDOM.default.findDOMNode(node);\n}", "title": "" }, { "docid": "b79673c0088739ba5d12b60f7258e339", "score": "0.65678287", "text": "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return external_ReactDOM_default.a.findDOMNode(node);\n}", "title": "" }, { "docid": "522367ccc4fcb9faad12a22ccfd4d53a", "score": "0.6488908", "text": "toDOMNode(editor, node) {\n var domNode = Editor.isEditor(node) ? EDITOR_TO_ELEMENT.get(editor) : KEY_TO_ELEMENT.get(ReactEditor.findKey(editor, node));\n\n if (!domNode) {\n throw new Error(\"Cannot resolve a DOM node from Slate node: \".concat(JSON.stringify(node)));\n }\n\n return domNode;\n }", "title": "" }, { "docid": "85ff85ea8b7a4de3786b30c44baed254", "score": "0.64074665", "text": "function getRenderedNativeOrTextFromComponent(component){var rendered;while(rendered=component._renderedComponent){component=rendered;}return component;}", "title": "" }, { "docid": "85ff85ea8b7a4de3786b30c44baed254", "score": "0.64074665", "text": "function getRenderedNativeOrTextFromComponent(component){var rendered;while(rendered=component._renderedComponent){component=rendered;}return component;}", "title": "" }, { "docid": "1a3bc078b09af82359fc1bd8928dd58f", "score": "0.6309658", "text": "toDOMNode(editor, node) {\n var domNode = __WEBPACK_IMPORTED_MODULE_1_slate__[\"Editor\"].isEditor(node) ? EDITOR_TO_ELEMENT.get(editor) : KEY_TO_ELEMENT.get(ReactEditor.findKey(editor, node));\n\n if (!domNode) {\n throw new Error(\"Cannot resolve a DOM node from Slate node: \".concat(JSON.stringify(node)));\n }\n\n return domNode;\n }", "title": "" }, { "docid": "f9a78a3cbc3325861dee6eed4c540ad3", "score": "0.6273155", "text": "function getRenderedHostOrTextFromComponent(component){var rendered;while(rendered=component._renderedComponent){component=rendered;}return component;}", "title": "" }, { "docid": "99a62f46346f563943895bd8a37e48dd", "score": "0.6205626", "text": "toDOMNode(editor, node) {\n var KEY_TO_ELEMENT = EDITOR_TO_KEY_TO_ELEMENT.get(editor);\n var domNode = index_es/* Editor.isEditor */.ML.isEditor(node) ? EDITOR_TO_ELEMENT.get(editor) : KEY_TO_ELEMENT === null || KEY_TO_ELEMENT === void 0 ? void 0 : KEY_TO_ELEMENT.get(ReactEditor.findKey(editor, node));\n\n if (!domNode) {\n throw new Error(\"Cannot resolve a DOM node from Slate node: \".concat(JSON.stringify(node)));\n }\n\n return domNode;\n }", "title": "" }, { "docid": "e48c780429723d6555d443240cf7f4d6", "score": "0.6156533", "text": "function getRenderedNativeOrTextFromComponent(component) {\n var rendered;\n while (rendered = component._renderedComponent) {\n component = rendered;\n }\n return component;\n}", "title": "" }, { "docid": "cd95e6312df6d4eea0c977e42e833eac", "score": "0.6146663", "text": "function render(node) {\n switch (nodeType(node)) {\n case \"text\":\n return document.createTextNode(node);\n case \"element\":\n return renderElement(node);\n case \"component\":\n return renderComponent(node);\n }\n}", "title": "" }, { "docid": "5d13852d650da79a7bc7804e2a9c39c7", "score": "0.61049587", "text": "function getRenderedNativeOrTextFromComponent(component) {\n\t var rendered;\n\t while (rendered = component._renderedComponent) {\n\t component = rendered;\n\t }\n\t return component;\n\t}", "title": "" }, { "docid": "5d13852d650da79a7bc7804e2a9c39c7", "score": "0.61049587", "text": "function getRenderedNativeOrTextFromComponent(component) {\n\t var rendered;\n\t while (rendered = component._renderedComponent) {\n\t component = rendered;\n\t }\n\t return component;\n\t}", "title": "" }, { "docid": "5d13852d650da79a7bc7804e2a9c39c7", "score": "0.61049587", "text": "function getRenderedNativeOrTextFromComponent(component) {\n\t var rendered;\n\t while (rendered = component._renderedComponent) {\n\t component = rendered;\n\t }\n\t return component;\n\t}", "title": "" }, { "docid": "5d13852d650da79a7bc7804e2a9c39c7", "score": "0.61049587", "text": "function getRenderedNativeOrTextFromComponent(component) {\n\t var rendered;\n\t while (rendered = component._renderedComponent) {\n\t component = rendered;\n\t }\n\t return component;\n\t}", "title": "" }, { "docid": "5d13852d650da79a7bc7804e2a9c39c7", "score": "0.61049587", "text": "function getRenderedNativeOrTextFromComponent(component) {\n\t var rendered;\n\t while (rendered = component._renderedComponent) {\n\t component = rendered;\n\t }\n\t return component;\n\t}", "title": "" }, { "docid": "5d13852d650da79a7bc7804e2a9c39c7", "score": "0.61049587", "text": "function getRenderedNativeOrTextFromComponent(component) {\n\t var rendered;\n\t while (rendered = component._renderedComponent) {\n\t component = rendered;\n\t }\n\t return component;\n\t}", "title": "" }, { "docid": "d1582838989986f10622aa7360a10a36", "score": "0.6094559", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (true) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "d1582838989986f10622aa7360a10a36", "score": "0.6094559", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (true) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "d1582838989986f10622aa7360a10a36", "score": "0.6094559", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (true) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "d1582838989986f10622aa7360a10a36", "score": "0.6094559", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (true) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "d1582838989986f10622aa7360a10a36", "score": "0.6094559", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (true) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "d1582838989986f10622aa7360a10a36", "score": "0.6094559", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (true) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "d1582838989986f10622aa7360a10a36", "score": "0.6094559", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (true) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "d1582838989986f10622aa7360a10a36", "score": "0.6094559", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (true) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "87cf2c7dbd2dceb9a7987b94fd8276a3", "score": "0.6088739", "text": "function ReactDOMComponent(element) {\r\n\t var tag = element.type;\r\n\t validateDangerousTag(tag);\r\n\t this._currentElement = element;\r\n\t this._tag = tag.toLowerCase();\r\n\t this._namespaceURI = null;\r\n\t this._renderedChildren = null;\r\n\t this._previousStyle = null;\r\n\t this._previousStyleCopy = null;\r\n\t this._hostNode = null;\r\n\t this._hostParent = null;\r\n\t this._rootNodeID = 0;\r\n\t this._domID = 0;\r\n\t this._hostContainerInfo = null;\r\n\t this._wrapperState = null;\r\n\t this._topLevelWrapper = null;\r\n\t this._flags = 0;\r\n\t if (process.env.NODE_ENV !== 'production') {\r\n\t this._ancestorInfo = null;\r\n\t setAndValidateContentChildDev.call(this, null);\r\n\t }\r\n\t}", "title": "" }, { "docid": "bfff92b6a513960ee3dbd8a78a774e7e", "score": "0.60875607", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (false) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "bfff92b6a513960ee3dbd8a78a774e7e", "score": "0.60875607", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (false) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "bfff92b6a513960ee3dbd8a78a774e7e", "score": "0.60875607", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (false) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "bfff92b6a513960ee3dbd8a78a774e7e", "score": "0.60875607", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (false) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "bfff92b6a513960ee3dbd8a78a774e7e", "score": "0.60875607", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (false) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "bfff92b6a513960ee3dbd8a78a774e7e", "score": "0.60875607", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (false) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "bfff92b6a513960ee3dbd8a78a774e7e", "score": "0.60875607", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (false) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "bfff92b6a513960ee3dbd8a78a774e7e", "score": "0.60875607", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (false) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "6e9f0e9f9e122292370d21b10a445e81", "score": "0.6075525", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (process.env.NODE_ENV !== 'production') {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "6e9f0e9f9e122292370d21b10a445e81", "score": "0.6075525", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (process.env.NODE_ENV !== 'production') {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "6e9f0e9f9e122292370d21b10a445e81", "score": "0.6075525", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (process.env.NODE_ENV !== 'production') {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "6e9f0e9f9e122292370d21b10a445e81", "score": "0.6075525", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (process.env.NODE_ENV !== 'production') {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "6e9f0e9f9e122292370d21b10a445e81", "score": "0.6075525", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (process.env.NODE_ENV !== 'production') {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "6e9f0e9f9e122292370d21b10a445e81", "score": "0.6075525", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (process.env.NODE_ENV !== 'production') {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "6e9f0e9f9e122292370d21b10a445e81", "score": "0.6075525", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (process.env.NODE_ENV !== 'production') {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "6e9f0e9f9e122292370d21b10a445e81", "score": "0.6075525", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (process.env.NODE_ENV !== 'production') {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "6e9f0e9f9e122292370d21b10a445e81", "score": "0.6075525", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (process.env.NODE_ENV !== 'production') {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "6e9f0e9f9e122292370d21b10a445e81", "score": "0.6075525", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (process.env.NODE_ENV !== 'production') {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "6e9f0e9f9e122292370d21b10a445e81", "score": "0.6075525", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (process.env.NODE_ENV !== 'production') {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "6e9f0e9f9e122292370d21b10a445e81", "score": "0.6075525", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (process.env.NODE_ENV !== 'production') {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "6e9f0e9f9e122292370d21b10a445e81", "score": "0.6075525", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (process.env.NODE_ENV !== 'production') {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "6e9f0e9f9e122292370d21b10a445e81", "score": "0.6075525", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (process.env.NODE_ENV !== 'production') {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" } ]
ddbd0370a0837c6420303b4a853da859
Obtain the start and end positions of the range that has the specified entity applied to it. Entity keys are applied only to contiguous stretches of text, so this method searches for the first instance of the entity key and returns the subsequent range.
[ { "docid": "abc3dc67243a96e1b3d96740a7ae34f3", "score": "0.6409759", "text": "function getRangesForDraftEntity(block, key) {\n var ranges = [];\n block.findEntityRanges(function (c) {\n return c.getEntity() === key;\n }, function (start, end) {\n ranges.push({ start: start, end: end });\n });\n\n !!!ranges.length ? true ? invariant(false, 'Entity key not found in this range.') : undefined : void 0;\n\n return ranges;\n}", "title": "" } ]
[ { "docid": "0c8cb16fcd7f00a3df96e8776f3deceb", "score": "0.7197161", "text": "getEntitySelection(editorState, entityKey) {\n const selectionState = editorState.getSelection();\n const block = this.getSelectedBlock(editorState);\n let entityRange;\n // https://github.com/jpuri/draftjs-utils/blob/e81c0ae19c3b0fdef7e0c1b70d924398956be126/js/inline.js#L111\n block.findEntityRanges(\n value => value.get('entity') === entityKey,\n (start, end) => {\n entityRange = {\n start,\n end,\n };\n },\n );\n\n return selectionState.merge({\n anchorOffset: entityRange.start,\n focusOffset: entityRange.end,\n });\n }", "title": "" }, { "docid": "7fda5edfedc5d5eaede99891971c252f", "score": "0.65626246", "text": "function getRangesForDraftEntity(block,key){var ranges=[];return block.findEntityRanges(function(c){return c.getEntity()===key;},function(start,end){ranges.push({start:start,end:end});}),ranges.length||invariant(!1),ranges;}", "title": "" }, { "docid": "559c2b63b77ebe63cb351aef69148b62", "score": "0.643953", "text": "checkForEntity(contentBlock, contentState, start, end) {\n let entStart = null;\n for (let i=start; i < end; i++) {\n let entKey = contentBlock.getEntityAt(i);\n console.log('found entkey', entKey);\n if (entKey) {\n let ent = contentState.getEntity(entKey);\n console.log(ent.data);\n if (ent.data.ignored) {\n console.warn(\"SEARCHING INTO FINALIZED TEXT BLOCK\");\n entStart = i;\n break;\n }\n }\n }\n return entStart;\n }", "title": "" }, { "docid": "5fda692b33ba428fc4c6e5c8626f76a5", "score": "0.6407047", "text": "function getRangesForDraftEntity(block, key) {\n var ranges = [];\n block.findEntityRanges(function (c) {\n return c.getEntity() === key;\n }, function (start, end) {\n ranges.push({ start: start, end: end });\n });\n\n !!!ranges.length ? false ? invariant(false, 'Entity key not found in this range.') : invariant(false) : void 0;\n\n return ranges;\n}", "title": "" }, { "docid": "764ad76499ef56980cfa2ac01237d83a", "score": "0.64057004", "text": "function getRangesForDraftEntity(block, key) {\n var ranges = [];\n block.findEntityRanges(function (c) {\n return c.getEntity() === key;\n }, function (start, end) {\n ranges.push({ start: start, end: end });\n });\n\n !!!ranges.length ? true ? invariant(false, 'Entity key not found in this range.') : invariant(false) : void 0;\n\n return ranges;\n}", "title": "" }, { "docid": "fe57ad6a25287695c3551738cb062541", "score": "0.63121516", "text": "function getRangesForDraftEntity(block, key) {\n\t var ranges = [];\n\t block.findEntityRanges(function (c) {\n\t return c.getEntity() === key;\n\t }, function (start, end) {\n\t ranges.push({ start: start, end: end });\n\t });\n\n\t !!!ranges.length ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Entity key not found in this range.') : invariant(false) : void 0;\n\n\t return ranges;\n\t}", "title": "" }, { "docid": "ee11b2fa800781b24374148d154bb88d", "score": "0.6267126", "text": "function getRangesForDraftEntity(block, key) {\n var ranges = [];\n block.findEntityRanges(function (c) {\n return c.getEntity() === key;\n }, function (start, end) {\n ranges.push({ start: start, end: end });\n });\n\n !!!ranges.length ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Entity key not found in this range.') : invariant(false) : void 0;\n\n return ranges;\n}", "title": "" }, { "docid": "ee11b2fa800781b24374148d154bb88d", "score": "0.6267126", "text": "function getRangesForDraftEntity(block, key) {\n var ranges = [];\n block.findEntityRanges(function (c) {\n return c.getEntity() === key;\n }, function (start, end) {\n ranges.push({ start: start, end: end });\n });\n\n !!!ranges.length ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Entity key not found in this range.') : invariant(false) : void 0;\n\n return ranges;\n}", "title": "" }, { "docid": "ee11b2fa800781b24374148d154bb88d", "score": "0.6267126", "text": "function getRangesForDraftEntity(block, key) {\n var ranges = [];\n block.findEntityRanges(function (c) {\n return c.getEntity() === key;\n }, function (start, end) {\n ranges.push({ start: start, end: end });\n });\n\n !!!ranges.length ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Entity key not found in this range.') : invariant(false) : void 0;\n\n return ranges;\n}", "title": "" }, { "docid": "ee11b2fa800781b24374148d154bb88d", "score": "0.6267126", "text": "function getRangesForDraftEntity(block, key) {\n var ranges = [];\n block.findEntityRanges(function (c) {\n return c.getEntity() === key;\n }, function (start, end) {\n ranges.push({ start: start, end: end });\n });\n\n !!!ranges.length ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Entity key not found in this range.') : invariant(false) : void 0;\n\n return ranges;\n}", "title": "" }, { "docid": "ee11b2fa800781b24374148d154bb88d", "score": "0.6267126", "text": "function getRangesForDraftEntity(block, key) {\n var ranges = [];\n block.findEntityRanges(function (c) {\n return c.getEntity() === key;\n }, function (start, end) {\n ranges.push({ start: start, end: end });\n });\n\n !!!ranges.length ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Entity key not found in this range.') : invariant(false) : void 0;\n\n return ranges;\n}", "title": "" }, { "docid": "ee11b2fa800781b24374148d154bb88d", "score": "0.6267126", "text": "function getRangesForDraftEntity(block, key) {\n var ranges = [];\n block.findEntityRanges(function (c) {\n return c.getEntity() === key;\n }, function (start, end) {\n ranges.push({ start: start, end: end });\n });\n\n !!!ranges.length ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Entity key not found in this range.') : invariant(false) : void 0;\n\n return ranges;\n}", "title": "" }, { "docid": "7a9e37bccbc85044f6b98363614ef5fe", "score": "0.6136209", "text": "getSelectionEntity(editorState) {\n let entity;\n const selection = editorState.getSelection();\n let start = selection.getStartOffset();\n let end = selection.getEndOffset();\n if (start === end && start === 0) {\n end = 1;\n } else if (start === end) {\n start -= 1;\n }\n const block = this.getSelectedBlock(editorState);\n\n for (let i = start; i < end; i += 1) {\n const currentEntity = block.getEntityAt(i);\n if (!currentEntity) {\n entity = undefined;\n break;\n }\n if (i === start) {\n entity = currentEntity;\n } else if (entity !== currentEntity) {\n entity = undefined;\n break;\n }\n }\n return entity;\n }", "title": "" }, { "docid": "cba3f40dda197b151351063ec35d0b8f", "score": "0.57298595", "text": "getRange(startToken, endToken = undefined) {\n return { start: startToken.start, end: (endToken || startToken).end };\n }", "title": "" }, { "docid": "a6751d0b26e13d985cebe06593860850", "score": "0.56452036", "text": "prevMatchInRange(state, from, to) {\n for (let pos = to; ; ) {\n let start = Math.max(\n from,\n pos - 10000 /* ChunkSize */ - this.spec.unquoted.length\n )\n let cursor = stringCursor(this.spec, state, start, pos),\n range = null\n while (!cursor.nextOverlapping().done) range = cursor.value\n if (range) return range\n if (start == from) return null\n pos -= 10000 /* ChunkSize */\n }\n }", "title": "" }, { "docid": "3a8bcfc5ee1d795c00c9ac92fd2678e0", "score": "0.5641067", "text": "function encodeEntityRanges(block,storageMap){var encoded=[];return block.findEntityRanges(function(character){return!!character.getEntity();},function(/*number*/start,/*number*/end){var text=block.getText(),key=block.getEntityAt(start);encoded.push({offset:strlen(text.slice(0,start)),length:strlen(text.slice(start,end)),// Encode the key as a number for range storage.\nkey:Number(storageMap[DraftStringKey.stringify(key)])});}),encoded;}", "title": "" }, { "docid": "1753713f6630187d9d299a522e5c7cf1", "score": "0.5514672", "text": "GetEntityPosition( entity ) { return null; }", "title": "" }, { "docid": "f178adfb0c98d572a13923e4fb1a298e", "score": "0.53379756", "text": "function getEntityKeyForSelection(contentState,targetSelection){var entityKey;if(targetSelection.isCollapsed()){var key=targetSelection.getAnchorKey(),offset=targetSelection.getAnchorOffset();return offset>0?(entityKey=contentState.getBlockForKey(key).getEntityAt(offset-1),filterKey(contentState.getEntityMap(),entityKey)):null;}var startKey=targetSelection.getStartKey(),startOffset=targetSelection.getStartOffset(),startBlock=contentState.getBlockForKey(startKey);return entityKey=startOffset===startBlock.getLength()?null:startBlock.getEntityAt(startOffset),filterKey(contentState.getEntityMap(),entityKey);}", "title": "" }, { "docid": "d3db4cbb24961cf1be0f983b2a8c0104", "score": "0.52913445", "text": "function decodeEntityRanges(text,ranges){var entities=Array(text.length).fill(null);return ranges&&ranges.forEach(function(range){for(var start=substr(text,0,range.offset).length,end=start+substr(text,range.offset,range.length).length,ii=start;ii<end;ii++)entities[ii]=range.key;}),entities;}", "title": "" }, { "docid": "34df7ce74000a03d9f196e9bb569aa0f", "score": "0.5278035", "text": "function decodeEntityRanges(text, ranges) {\n\t var entities = Array(text.length).fill(null);\n\t if (ranges) {\n\t ranges.forEach(function (range) {\n\t // Using Unicode-enabled substrings converted to JavaScript lengths,\n\t // fill the output array with entity keys.\n\t var start = substr(text, 0, range.offset).length;\n\t var end = start + substr(text, range.offset, range.length).length;\n\t for (var ii = start; ii < end; ii++) {\n\t entities[ii] = range.key;\n\t }\n\t });\n\t }\n\t return entities;\n\t}", "title": "" }, { "docid": "34df7ce74000a03d9f196e9bb569aa0f", "score": "0.5278035", "text": "function decodeEntityRanges(text, ranges) {\n\t var entities = Array(text.length).fill(null);\n\t if (ranges) {\n\t ranges.forEach(function (range) {\n\t // Using Unicode-enabled substrings converted to JavaScript lengths,\n\t // fill the output array with entity keys.\n\t var start = substr(text, 0, range.offset).length;\n\t var end = start + substr(text, range.offset, range.length).length;\n\t for (var ii = start; ii < end; ii++) {\n\t entities[ii] = range.key;\n\t }\n\t });\n\t }\n\t return entities;\n\t}", "title": "" }, { "docid": "a5f36f09972e4275573324c3c17b7c13", "score": "0.52363545", "text": "function decodeEntityRanges(text, ranges) {\n var entities = Array(text.length).fill(null);\n if (ranges) {\n ranges.forEach(function (range) {\n // Using Unicode-enabled substrings converted to JavaScript lengths,\n // fill the output array with entity keys.\n var start = substr(text, 0, range.offset).length;\n var end = start + substr(text, range.offset, range.length).length;\n for (var ii = start; ii < end; ii++) {\n entities[ii] = range.key;\n }\n });\n }\n return entities;\n}", "title": "" }, { "docid": "a5f36f09972e4275573324c3c17b7c13", "score": "0.52363545", "text": "function decodeEntityRanges(text, ranges) {\n var entities = Array(text.length).fill(null);\n if (ranges) {\n ranges.forEach(function (range) {\n // Using Unicode-enabled substrings converted to JavaScript lengths,\n // fill the output array with entity keys.\n var start = substr(text, 0, range.offset).length;\n var end = start + substr(text, range.offset, range.length).length;\n for (var ii = start; ii < end; ii++) {\n entities[ii] = range.key;\n }\n });\n }\n return entities;\n}", "title": "" }, { "docid": "a5f36f09972e4275573324c3c17b7c13", "score": "0.52363545", "text": "function decodeEntityRanges(text, ranges) {\n var entities = Array(text.length).fill(null);\n if (ranges) {\n ranges.forEach(function (range) {\n // Using Unicode-enabled substrings converted to JavaScript lengths,\n // fill the output array with entity keys.\n var start = substr(text, 0, range.offset).length;\n var end = start + substr(text, range.offset, range.length).length;\n for (var ii = start; ii < end; ii++) {\n entities[ii] = range.key;\n }\n });\n }\n return entities;\n}", "title": "" }, { "docid": "a5f36f09972e4275573324c3c17b7c13", "score": "0.52363545", "text": "function decodeEntityRanges(text, ranges) {\n var entities = Array(text.length).fill(null);\n if (ranges) {\n ranges.forEach(function (range) {\n // Using Unicode-enabled substrings converted to JavaScript lengths,\n // fill the output array with entity keys.\n var start = substr(text, 0, range.offset).length;\n var end = start + substr(text, range.offset, range.length).length;\n for (var ii = start; ii < end; ii++) {\n entities[ii] = range.key;\n }\n });\n }\n return entities;\n}", "title": "" }, { "docid": "a5f36f09972e4275573324c3c17b7c13", "score": "0.52363545", "text": "function decodeEntityRanges(text, ranges) {\n var entities = Array(text.length).fill(null);\n if (ranges) {\n ranges.forEach(function (range) {\n // Using Unicode-enabled substrings converted to JavaScript lengths,\n // fill the output array with entity keys.\n var start = substr(text, 0, range.offset).length;\n var end = start + substr(text, range.offset, range.length).length;\n for (var ii = start; ii < end; ii++) {\n entities[ii] = range.key;\n }\n });\n }\n return entities;\n}", "title": "" }, { "docid": "a5f36f09972e4275573324c3c17b7c13", "score": "0.52363545", "text": "function decodeEntityRanges(text, ranges) {\n var entities = Array(text.length).fill(null);\n if (ranges) {\n ranges.forEach(function (range) {\n // Using Unicode-enabled substrings converted to JavaScript lengths,\n // fill the output array with entity keys.\n var start = substr(text, 0, range.offset).length;\n var end = start + substr(text, range.offset, range.length).length;\n for (var ii = start; ii < end; ii++) {\n entities[ii] = range.key;\n }\n });\n }\n return entities;\n}", "title": "" }, { "docid": "a5f36f09972e4275573324c3c17b7c13", "score": "0.52363545", "text": "function decodeEntityRanges(text, ranges) {\n var entities = Array(text.length).fill(null);\n if (ranges) {\n ranges.forEach(function (range) {\n // Using Unicode-enabled substrings converted to JavaScript lengths,\n // fill the output array with entity keys.\n var start = substr(text, 0, range.offset).length;\n var end = start + substr(text, range.offset, range.length).length;\n for (var ii = start; ii < end; ii++) {\n entities[ii] = range.key;\n }\n });\n }\n return entities;\n}", "title": "" }, { "docid": "a5f36f09972e4275573324c3c17b7c13", "score": "0.52363545", "text": "function decodeEntityRanges(text, ranges) {\n var entities = Array(text.length).fill(null);\n if (ranges) {\n ranges.forEach(function (range) {\n // Using Unicode-enabled substrings converted to JavaScript lengths,\n // fill the output array with entity keys.\n var start = substr(text, 0, range.offset).length;\n var end = start + substr(text, range.offset, range.length).length;\n for (var ii = start; ii < end; ii++) {\n entities[ii] = range.key;\n }\n });\n }\n return entities;\n}", "title": "" }, { "docid": "a5f36f09972e4275573324c3c17b7c13", "score": "0.52363545", "text": "function decodeEntityRanges(text, ranges) {\n var entities = Array(text.length).fill(null);\n if (ranges) {\n ranges.forEach(function (range) {\n // Using Unicode-enabled substrings converted to JavaScript lengths,\n // fill the output array with entity keys.\n var start = substr(text, 0, range.offset).length;\n var end = start + substr(text, range.offset, range.length).length;\n for (var ii = start; ii < end; ii++) {\n entities[ii] = range.key;\n }\n });\n }\n return entities;\n}", "title": "" }, { "docid": "a5f36f09972e4275573324c3c17b7c13", "score": "0.52363545", "text": "function decodeEntityRanges(text, ranges) {\n var entities = Array(text.length).fill(null);\n if (ranges) {\n ranges.forEach(function (range) {\n // Using Unicode-enabled substrings converted to JavaScript lengths,\n // fill the output array with entity keys.\n var start = substr(text, 0, range.offset).length;\n var end = start + substr(text, range.offset, range.length).length;\n for (var ii = start; ii < end; ii++) {\n entities[ii] = range.key;\n }\n });\n }\n return entities;\n}", "title": "" }, { "docid": "07a3837b344f3f1f3010678f2d96f1cf", "score": "0.5207764", "text": "function getRange() {\n\t\t\tvar ieRange = selection.getRng(), domRange = dom.createRng(), element, collapsed, tmpRange, element2, bookmark, fail;\n\n\t\t\t// If selection is outside the current document just return an empty range\n\t\t\telement = ieRange.item ? ieRange.item(0) : ieRange.parentElement();\n\t\t\tif (element.ownerDocument != dom.doc)\n\t\t\t\treturn domRange;\n\n\t\t\tcollapsed = selection.isCollapsed();\n\n\t\t\t// Handle control selection\n\t\t\tif (ieRange.item) {\n\t\t\t\tdomRange.setStart(element.parentNode, dom.nodeIndex(element));\n\t\t\t\tdomRange.setEnd(domRange.startContainer, domRange.startOffset + 1);\n\n\t\t\t\treturn domRange;\n\t\t\t}\n\n\t\t\tfunction findEndPoint(start) {\n\t\t\t\tvar endPoint = getPosition(ieRange, start), container, offset, textNodeOffset = 0, sibling, undef, nodeValue;\n\n\t\t\t\tcontainer = endPoint.node;\n\t\t\t\toffset = endPoint.offset;\n\n\t\t\t\tif (endPoint.inside && !container.hasChildNodes()) {\n\t\t\t\t\tdomRange[start ? 'setStart' : 'setEnd'](container, 0);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (offset === undef) {\n\t\t\t\t\tdomRange[start ? 'setStartBefore' : 'setEndAfter'](container);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (endPoint.position < 0) {\n\t\t\t\t\tsibling = endPoint.inside ? container.firstChild : container.nextSibling;\n\n\t\t\t\t\tif (!sibling) {\n\t\t\t\t\t\tdomRange[start ? 'setStartAfter' : 'setEndAfter'](container);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!offset) {\n\t\t\t\t\t\tif (sibling.nodeType == 3)\n\t\t\t\t\t\t\tdomRange[start ? 'setStart' : 'setEnd'](sibling, 0);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdomRange[start ? 'setStartBefore' : 'setEndBefore'](sibling);\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Find the text node and offset\n\t\t\t\t\twhile (sibling) {\n\t\t\t\t\t\tnodeValue = sibling.nodeValue;\n\t\t\t\t\t\ttextNodeOffset += nodeValue.length;\n\n\t\t\t\t\t\t// We are at or passed the position we where looking for\n\t\t\t\t\t\tif (textNodeOffset >= offset) {\n\t\t\t\t\t\t\tcontainer = sibling;\n\t\t\t\t\t\t\ttextNodeOffset -= offset;\n\t\t\t\t\t\t\ttextNodeOffset = nodeValue.length - textNodeOffset;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsibling = sibling.nextSibling;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Find the text node and offset\n\t\t\t\t\tsibling = container.previousSibling;\n\n\t\t\t\t\tif (!sibling)\n\t\t\t\t\t\treturn domRange[start ? 'setStartBefore' : 'setEndBefore'](container);\n\n\t\t\t\t\t// If there isn't any text to loop then use the first position\n\t\t\t\t\tif (!offset) {\n\t\t\t\t\t\tif (container.nodeType == 3)\n\t\t\t\t\t\t\tdomRange[start ? 'setStart' : 'setEnd'](sibling, container.nodeValue.length);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdomRange[start ? 'setStartAfter' : 'setEndAfter'](sibling);\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (sibling) {\n\t\t\t\t\t\ttextNodeOffset += sibling.nodeValue.length;\n\n\t\t\t\t\t\t// We are at or passed the position we where looking for\n\t\t\t\t\t\tif (textNodeOffset >= offset) {\n\t\t\t\t\t\t\tcontainer = sibling;\n\t\t\t\t\t\t\ttextNodeOffset -= offset;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsibling = sibling.previousSibling;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tdomRange[start ? 'setStart' : 'setEnd'](container, textNodeOffset);\n\t\t\t};\n\n\t\t\ttry {\n\t\t\t\t// Find start point\n\t\t\t\tfindEndPoint(true);\n\n\t\t\t\t// Find end point if needed\n\t\t\t\tif (!collapsed)\n\t\t\t\t\tfindEndPoint();\n\t\t\t} catch (ex) {\n\t\t\t\t// IE has a nasty bug where text nodes might throw \"invalid argument\" when you\n\t\t\t\t// access the nodeValue or other properties of text nodes. This seems to happend when\n\t\t\t\t// text nodes are split into two nodes by a delete/backspace call. So lets detect it and try to fix it.\n\t\t\t\tif (ex.number == -2147024809) {\n\t\t\t\t\t// Get the current selection\n\t\t\t\t\tbookmark = self.getBookmark(2);\n\n\t\t\t\t\t// Get start element\n\t\t\t\t\ttmpRange = ieRange.duplicate();\n\t\t\t\t\ttmpRange.collapse(true);\n\t\t\t\t\telement = tmpRange.parentElement();\n\n\t\t\t\t\t// Get end element\n\t\t\t\t\tif (!collapsed) {\n\t\t\t\t\t\ttmpRange = ieRange.duplicate();\n\t\t\t\t\t\ttmpRange.collapse(false);\n\t\t\t\t\t\telement2 = tmpRange.parentElement();\n\t\t\t\t\t\telement2.innerHTML = element2.innerHTML;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Remove the broken elements\n\t\t\t\t\telement.innerHTML = element.innerHTML;\n\n\t\t\t\t\t// Restore the selection\n\t\t\t\t\tself.moveToBookmark(bookmark);\n\n\t\t\t\t\t// Since the range has moved we need to re-get it\n\t\t\t\t\tieRange = selection.getRng();\n\n\t\t\t\t\t// Find start point\n\t\t\t\t\tfindEndPoint(true);\n\n\t\t\t\t\t// Find end point if needed\n\t\t\t\t\tif (!collapsed)\n\t\t\t\t\t\tfindEndPoint();\n\t\t\t\t} else\n\t\t\t\t\tthrow ex; // Throw other errors\n\t\t\t}\n\n\t\t\treturn domRange;\n\t\t}", "title": "" }, { "docid": "0ff1c87878112d86255516d1432ffe70", "score": "0.51895", "text": "function getSelectionCharacterOffsetWithin(tdElement, range) {\r\n let text = \"\";\r\n let begin = -1;\r\n let end = -1;\r\n for (let i = 0; i < tdElement.childNodes.length; i++) {\r\n let child = tdElement.childNodes[i];\r\n if (child == range.startContainer) {\r\n begin = text.length + range.startOffset;\r\n }\r\n if (child == range.endContainer) {\r\n end = text.length + range.endOffset;\r\n }\r\n if (tdElement == range.startContainer && i == range.startOffset ) {\r\n begin = text.length;\r\n }\r\n if (tdElement == range.endContainer && i == range.endOffset) {\r\n end = text.length;\r\n }\r\n text += html_to_text_plain_or_span(child);\r\n }\r\n if (begin == -1) {\r\n begin = 0;\r\n }\r\n if (end == -1) {\r\n end = text.length;\r\n }\r\n return { start: begin, end: end };\r\n}", "title": "" }, { "docid": "0193b16d2ed66127663bc3917626de11", "score": "0.5180577", "text": "function getEntityKeyForSelection(contentState, targetSelection) {\n\t var entityKey;\n\n\t if (targetSelection.isCollapsed()) {\n\t var key = targetSelection.getAnchorKey();\n\t var offset = targetSelection.getAnchorOffset();\n\t if (offset > 0) {\n\t entityKey = contentState.getBlockForKey(key).getEntityAt(offset - 1);\n\t return filterKey(entityKey);\n\t }\n\t return null;\n\t }\n\n\t var startKey = targetSelection.getStartKey();\n\t var startOffset = targetSelection.getStartOffset();\n\t var startBlock = contentState.getBlockForKey(startKey);\n\n\t entityKey = startOffset === startBlock.getLength() ? null : startBlock.getEntityAt(startOffset);\n\n\t return filterKey(entityKey);\n\t}", "title": "" }, { "docid": "65d9458c40b5e84d79e74f7a9d2d4328", "score": "0.5174998", "text": "function getRange() {\n var ieRange = selection.getRng(), domRange = dom.createRng(), element, collapsed, tmpRange, element2, bookmark;\n\n // If selection is outside the current document just return an empty range\n element = ieRange.item ? ieRange.item(0) : ieRange.parentElement();\n if (element.ownerDocument != dom.doc) {\n return domRange;\n }\n\n collapsed = selection.isCollapsed();\n\n // Handle control selection\n if (ieRange.item) {\n domRange.setStart(element.parentNode, dom.nodeIndex(element));\n domRange.setEnd(domRange.startContainer, domRange.startOffset + 1);\n\n return domRange;\n }\n\n function findEndPoint(start) {\n var endPoint = getPosition(ieRange, start), container, offset, textNodeOffset = 0, sibling, undef, nodeValue;\n\n container = endPoint.node;\n offset = endPoint.offset;\n\n if (endPoint.inside && !container.hasChildNodes()) {\n domRange[start ? 'setStart' : 'setEnd'](container, 0);\n return;\n }\n\n if (offset === undef) {\n domRange[start ? 'setStartBefore' : 'setEndAfter'](container);\n return;\n }\n\n if (endPoint.position < 0) {\n sibling = endPoint.inside ? container.firstChild : container.nextSibling;\n\n if (!sibling) {\n domRange[start ? 'setStartAfter' : 'setEndAfter'](container);\n return;\n }\n\n if (!offset) {\n if (sibling.nodeType == 3) {\n domRange[start ? 'setStart' : 'setEnd'](sibling, 0);\n } else {\n domRange[start ? 'setStartBefore' : 'setEndBefore'](sibling);\n }\n\n return;\n }\n\n // Find the text node and offset\n while (sibling) {\n if (sibling.nodeType == 3) {\n nodeValue = sibling.nodeValue;\n textNodeOffset += nodeValue.length;\n\n // We are at or passed the position we where looking for\n if (textNodeOffset >= offset) {\n container = sibling;\n textNodeOffset -= offset;\n textNodeOffset = nodeValue.length - textNodeOffset;\n break;\n }\n }\n\n sibling = sibling.nextSibling;\n }\n } else {\n // Find the text node and offset\n sibling = container.previousSibling;\n\n if (!sibling) {\n return domRange[start ? 'setStartBefore' : 'setEndBefore'](container);\n }\n\n // If there isn't any text to loop then use the first position\n if (!offset) {\n if (container.nodeType == 3) {\n domRange[start ? 'setStart' : 'setEnd'](sibling, container.nodeValue.length);\n } else {\n domRange[start ? 'setStartAfter' : 'setEndAfter'](sibling);\n }\n\n return;\n }\n\n while (sibling) {\n if (sibling.nodeType == 3) {\n textNodeOffset += sibling.nodeValue.length;\n\n // We are at or passed the position we where looking for\n if (textNodeOffset >= offset) {\n container = sibling;\n textNodeOffset -= offset;\n break;\n }\n }\n\n sibling = sibling.previousSibling;\n }\n }\n\n domRange[start ? 'setStart' : 'setEnd'](container, textNodeOffset);\n }\n\n try {\n // Find start point\n findEndPoint(true);\n\n // Find end point if needed\n if (!collapsed) {\n findEndPoint();\n }\n } catch (ex) {\n // IE has a nasty bug where text nodes might throw \"invalid argument\" when you\n // access the nodeValue or other properties of text nodes. This seems to happen when\n // text nodes are split into two nodes by a delete/backspace call.\n // So let us detect and try to fix it.\n if (ex.number == -2147024809) {\n // Get the current selection\n bookmark = self.getBookmark(2);\n\n // Get start element\n tmpRange = ieRange.duplicate();\n tmpRange.collapse(true);\n element = tmpRange.parentElement();\n\n // Get end element\n if (!collapsed) {\n tmpRange = ieRange.duplicate();\n tmpRange.collapse(false);\n element2 = tmpRange.parentElement();\n element2.innerHTML = element2.innerHTML;\n }\n\n // Remove the broken elements\n element.innerHTML = element.innerHTML;\n\n // Restore the selection\n self.moveToBookmark(bookmark);\n\n // Since the range has moved we need to re-get it\n ieRange = selection.getRng();\n\n // Find start point\n findEndPoint(true);\n\n // Find end point if needed\n if (!collapsed) {\n findEndPoint();\n }\n } else {\n throw ex; // Throw other errors\n }\n }\n\n return domRange;\n }", "title": "" }, { "docid": "724a211789bb7bded2981381692559f0", "score": "0.51635987", "text": "function getRange() {\n\t\t\tvar ieRange = selection.getRng(), domRange = dom.createRng(), element, collapsed, tmpRange, element2, bookmark;\n\n\t\t\t// If selection is outside the current document just return an empty range\n\t\t\telement = ieRange.item ? ieRange.item(0) : ieRange.parentElement();\n\t\t\tif (element.ownerDocument != dom.doc) {\n\t\t\t\treturn domRange;\n\t\t\t}\n\n\t\t\tcollapsed = selection.isCollapsed();\n\n\t\t\t// Handle control selection\n\t\t\tif (ieRange.item) {\n\t\t\t\tdomRange.setStart(element.parentNode, dom.nodeIndex(element));\n\t\t\t\tdomRange.setEnd(domRange.startContainer, domRange.startOffset + 1);\n\n\t\t\t\treturn domRange;\n\t\t\t}\n\n\t\t\tfunction findEndPoint(start) {\n\t\t\t\tvar endPoint = getPosition(ieRange, start), container, offset, textNodeOffset = 0, sibling, undef, nodeValue;\n\n\t\t\t\tcontainer = endPoint.node;\n\t\t\t\toffset = endPoint.offset;\n\n\t\t\t\tif (endPoint.inside && !container.hasChildNodes()) {\n\t\t\t\t\tdomRange[start ? 'setStart' : 'setEnd'](container, 0);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (offset === undef) {\n\t\t\t\t\tdomRange[start ? 'setStartBefore' : 'setEndAfter'](container);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (endPoint.position < 0) {\n\t\t\t\t\tsibling = endPoint.inside ? container.firstChild : container.nextSibling;\n\n\t\t\t\t\tif (!sibling) {\n\t\t\t\t\t\tdomRange[start ? 'setStartAfter' : 'setEndAfter'](container);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!offset) {\n\t\t\t\t\t\tif (sibling.nodeType == 3) {\n\t\t\t\t\t\t\tdomRange[start ? 'setStart' : 'setEnd'](sibling, 0);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdomRange[start ? 'setStartBefore' : 'setEndBefore'](sibling);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Find the text node and offset\n\t\t\t\t\twhile (sibling) {\n\t\t\t\t\t\tnodeValue = sibling.nodeValue;\n\t\t\t\t\t\ttextNodeOffset += nodeValue.length;\n\n\t\t\t\t\t\t// We are at or passed the position we where looking for\n\t\t\t\t\t\tif (textNodeOffset >= offset) {\n\t\t\t\t\t\t\tcontainer = sibling;\n\t\t\t\t\t\t\ttextNodeOffset -= offset;\n\t\t\t\t\t\t\ttextNodeOffset = nodeValue.length - textNodeOffset;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsibling = sibling.nextSibling;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Find the text node and offset\n\t\t\t\t\tsibling = container.previousSibling;\n\n\t\t\t\t\tif (!sibling) {\n\t\t\t\t\t\treturn domRange[start ? 'setStartBefore' : 'setEndBefore'](container);\n\t\t\t\t\t}\n\n\t\t\t\t\t// If there isn't any text to loop then use the first position\n\t\t\t\t\tif (!offset) {\n\t\t\t\t\t\tif (container.nodeType == 3) {\n\t\t\t\t\t\t\tdomRange[start ? 'setStart' : 'setEnd'](sibling, container.nodeValue.length);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdomRange[start ? 'setStartAfter' : 'setEndAfter'](sibling);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (sibling) {\n\t\t\t\t\t\ttextNodeOffset += sibling.nodeValue.length;\n\n\t\t\t\t\t\t// We are at or passed the position we where looking for\n\t\t\t\t\t\tif (textNodeOffset >= offset) {\n\t\t\t\t\t\t\tcontainer = sibling;\n\t\t\t\t\t\t\ttextNodeOffset -= offset;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsibling = sibling.previousSibling;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tdomRange[start ? 'setStart' : 'setEnd'](container, textNodeOffset);\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\t// Find start point\n\t\t\t\tfindEndPoint(true);\n\n\t\t\t\t// Find end point if needed\n\t\t\t\tif (!collapsed) {\n\t\t\t\t\tfindEndPoint();\n\t\t\t\t}\n\t\t\t} catch (ex) {\n\t\t\t\t// IE has a nasty bug where text nodes might throw \"invalid argument\" when you\n\t\t\t\t// access the nodeValue or other properties of text nodes. This seems to happend when\n\t\t\t\t// text nodes are split into two nodes by a delete/backspace call. So lets detect it and try to fix it.\n\t\t\t\tif (ex.number == -2147024809) {\n\t\t\t\t\t// Get the current selection\n\t\t\t\t\tbookmark = self.getBookmark(2);\n\n\t\t\t\t\t// Get start element\n\t\t\t\t\ttmpRange = ieRange.duplicate();\n\t\t\t\t\ttmpRange.collapse(true);\n\t\t\t\t\telement = tmpRange.parentElement();\n\n\t\t\t\t\t// Get end element\n\t\t\t\t\tif (!collapsed) {\n\t\t\t\t\t\ttmpRange = ieRange.duplicate();\n\t\t\t\t\t\ttmpRange.collapse(false);\n\t\t\t\t\t\telement2 = tmpRange.parentElement();\n\t\t\t\t\t\telement2.innerHTML = element2.innerHTML;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Remove the broken elements\n\t\t\t\t\telement.innerHTML = element.innerHTML;\n\n\t\t\t\t\t// Restore the selection\n\t\t\t\t\tself.moveToBookmark(bookmark);\n\n\t\t\t\t\t// Since the range has moved we need to re-get it\n\t\t\t\t\tieRange = selection.getRng();\n\n\t\t\t\t\t// Find start point\n\t\t\t\t\tfindEndPoint(true);\n\n\t\t\t\t\t// Find end point if needed\n\t\t\t\t\tif (!collapsed) {\n\t\t\t\t\t\tfindEndPoint();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthrow ex; // Throw other errors\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn domRange;\n\t\t}", "title": "" }, { "docid": "724a211789bb7bded2981381692559f0", "score": "0.51635987", "text": "function getRange() {\n\t\t\tvar ieRange = selection.getRng(), domRange = dom.createRng(), element, collapsed, tmpRange, element2, bookmark;\n\n\t\t\t// If selection is outside the current document just return an empty range\n\t\t\telement = ieRange.item ? ieRange.item(0) : ieRange.parentElement();\n\t\t\tif (element.ownerDocument != dom.doc) {\n\t\t\t\treturn domRange;\n\t\t\t}\n\n\t\t\tcollapsed = selection.isCollapsed();\n\n\t\t\t// Handle control selection\n\t\t\tif (ieRange.item) {\n\t\t\t\tdomRange.setStart(element.parentNode, dom.nodeIndex(element));\n\t\t\t\tdomRange.setEnd(domRange.startContainer, domRange.startOffset + 1);\n\n\t\t\t\treturn domRange;\n\t\t\t}\n\n\t\t\tfunction findEndPoint(start) {\n\t\t\t\tvar endPoint = getPosition(ieRange, start), container, offset, textNodeOffset = 0, sibling, undef, nodeValue;\n\n\t\t\t\tcontainer = endPoint.node;\n\t\t\t\toffset = endPoint.offset;\n\n\t\t\t\tif (endPoint.inside && !container.hasChildNodes()) {\n\t\t\t\t\tdomRange[start ? 'setStart' : 'setEnd'](container, 0);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (offset === undef) {\n\t\t\t\t\tdomRange[start ? 'setStartBefore' : 'setEndAfter'](container);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (endPoint.position < 0) {\n\t\t\t\t\tsibling = endPoint.inside ? container.firstChild : container.nextSibling;\n\n\t\t\t\t\tif (!sibling) {\n\t\t\t\t\t\tdomRange[start ? 'setStartAfter' : 'setEndAfter'](container);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!offset) {\n\t\t\t\t\t\tif (sibling.nodeType == 3) {\n\t\t\t\t\t\t\tdomRange[start ? 'setStart' : 'setEnd'](sibling, 0);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdomRange[start ? 'setStartBefore' : 'setEndBefore'](sibling);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Find the text node and offset\n\t\t\t\t\twhile (sibling) {\n\t\t\t\t\t\tnodeValue = sibling.nodeValue;\n\t\t\t\t\t\ttextNodeOffset += nodeValue.length;\n\n\t\t\t\t\t\t// We are at or passed the position we where looking for\n\t\t\t\t\t\tif (textNodeOffset >= offset) {\n\t\t\t\t\t\t\tcontainer = sibling;\n\t\t\t\t\t\t\ttextNodeOffset -= offset;\n\t\t\t\t\t\t\ttextNodeOffset = nodeValue.length - textNodeOffset;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsibling = sibling.nextSibling;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Find the text node and offset\n\t\t\t\t\tsibling = container.previousSibling;\n\n\t\t\t\t\tif (!sibling) {\n\t\t\t\t\t\treturn domRange[start ? 'setStartBefore' : 'setEndBefore'](container);\n\t\t\t\t\t}\n\n\t\t\t\t\t// If there isn't any text to loop then use the first position\n\t\t\t\t\tif (!offset) {\n\t\t\t\t\t\tif (container.nodeType == 3) {\n\t\t\t\t\t\t\tdomRange[start ? 'setStart' : 'setEnd'](sibling, container.nodeValue.length);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdomRange[start ? 'setStartAfter' : 'setEndAfter'](sibling);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (sibling) {\n\t\t\t\t\t\ttextNodeOffset += sibling.nodeValue.length;\n\n\t\t\t\t\t\t// We are at or passed the position we where looking for\n\t\t\t\t\t\tif (textNodeOffset >= offset) {\n\t\t\t\t\t\t\tcontainer = sibling;\n\t\t\t\t\t\t\ttextNodeOffset -= offset;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsibling = sibling.previousSibling;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tdomRange[start ? 'setStart' : 'setEnd'](container, textNodeOffset);\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\t// Find start point\n\t\t\t\tfindEndPoint(true);\n\n\t\t\t\t// Find end point if needed\n\t\t\t\tif (!collapsed) {\n\t\t\t\t\tfindEndPoint();\n\t\t\t\t}\n\t\t\t} catch (ex) {\n\t\t\t\t// IE has a nasty bug where text nodes might throw \"invalid argument\" when you\n\t\t\t\t// access the nodeValue or other properties of text nodes. This seems to happend when\n\t\t\t\t// text nodes are split into two nodes by a delete/backspace call. So lets detect it and try to fix it.\n\t\t\t\tif (ex.number == -2147024809) {\n\t\t\t\t\t// Get the current selection\n\t\t\t\t\tbookmark = self.getBookmark(2);\n\n\t\t\t\t\t// Get start element\n\t\t\t\t\ttmpRange = ieRange.duplicate();\n\t\t\t\t\ttmpRange.collapse(true);\n\t\t\t\t\telement = tmpRange.parentElement();\n\n\t\t\t\t\t// Get end element\n\t\t\t\t\tif (!collapsed) {\n\t\t\t\t\t\ttmpRange = ieRange.duplicate();\n\t\t\t\t\t\ttmpRange.collapse(false);\n\t\t\t\t\t\telement2 = tmpRange.parentElement();\n\t\t\t\t\t\telement2.innerHTML = element2.innerHTML;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Remove the broken elements\n\t\t\t\t\telement.innerHTML = element.innerHTML;\n\n\t\t\t\t\t// Restore the selection\n\t\t\t\t\tself.moveToBookmark(bookmark);\n\n\t\t\t\t\t// Since the range has moved we need to re-get it\n\t\t\t\t\tieRange = selection.getRng();\n\n\t\t\t\t\t// Find start point\n\t\t\t\t\tfindEndPoint(true);\n\n\t\t\t\t\t// Find end point if needed\n\t\t\t\t\tif (!collapsed) {\n\t\t\t\t\t\tfindEndPoint();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthrow ex; // Throw other errors\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn domRange;\n\t\t}", "title": "" }, { "docid": "724a211789bb7bded2981381692559f0", "score": "0.51635987", "text": "function getRange() {\n\t\t\tvar ieRange = selection.getRng(), domRange = dom.createRng(), element, collapsed, tmpRange, element2, bookmark;\n\n\t\t\t// If selection is outside the current document just return an empty range\n\t\t\telement = ieRange.item ? ieRange.item(0) : ieRange.parentElement();\n\t\t\tif (element.ownerDocument != dom.doc) {\n\t\t\t\treturn domRange;\n\t\t\t}\n\n\t\t\tcollapsed = selection.isCollapsed();\n\n\t\t\t// Handle control selection\n\t\t\tif (ieRange.item) {\n\t\t\t\tdomRange.setStart(element.parentNode, dom.nodeIndex(element));\n\t\t\t\tdomRange.setEnd(domRange.startContainer, domRange.startOffset + 1);\n\n\t\t\t\treturn domRange;\n\t\t\t}\n\n\t\t\tfunction findEndPoint(start) {\n\t\t\t\tvar endPoint = getPosition(ieRange, start), container, offset, textNodeOffset = 0, sibling, undef, nodeValue;\n\n\t\t\t\tcontainer = endPoint.node;\n\t\t\t\toffset = endPoint.offset;\n\n\t\t\t\tif (endPoint.inside && !container.hasChildNodes()) {\n\t\t\t\t\tdomRange[start ? 'setStart' : 'setEnd'](container, 0);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (offset === undef) {\n\t\t\t\t\tdomRange[start ? 'setStartBefore' : 'setEndAfter'](container);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (endPoint.position < 0) {\n\t\t\t\t\tsibling = endPoint.inside ? container.firstChild : container.nextSibling;\n\n\t\t\t\t\tif (!sibling) {\n\t\t\t\t\t\tdomRange[start ? 'setStartAfter' : 'setEndAfter'](container);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!offset) {\n\t\t\t\t\t\tif (sibling.nodeType == 3) {\n\t\t\t\t\t\t\tdomRange[start ? 'setStart' : 'setEnd'](sibling, 0);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdomRange[start ? 'setStartBefore' : 'setEndBefore'](sibling);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Find the text node and offset\n\t\t\t\t\twhile (sibling) {\n\t\t\t\t\t\tnodeValue = sibling.nodeValue;\n\t\t\t\t\t\ttextNodeOffset += nodeValue.length;\n\n\t\t\t\t\t\t// We are at or passed the position we where looking for\n\t\t\t\t\t\tif (textNodeOffset >= offset) {\n\t\t\t\t\t\t\tcontainer = sibling;\n\t\t\t\t\t\t\ttextNodeOffset -= offset;\n\t\t\t\t\t\t\ttextNodeOffset = nodeValue.length - textNodeOffset;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsibling = sibling.nextSibling;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Find the text node and offset\n\t\t\t\t\tsibling = container.previousSibling;\n\n\t\t\t\t\tif (!sibling) {\n\t\t\t\t\t\treturn domRange[start ? 'setStartBefore' : 'setEndBefore'](container);\n\t\t\t\t\t}\n\n\t\t\t\t\t// If there isn't any text to loop then use the first position\n\t\t\t\t\tif (!offset) {\n\t\t\t\t\t\tif (container.nodeType == 3) {\n\t\t\t\t\t\t\tdomRange[start ? 'setStart' : 'setEnd'](sibling, container.nodeValue.length);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdomRange[start ? 'setStartAfter' : 'setEndAfter'](sibling);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (sibling) {\n\t\t\t\t\t\ttextNodeOffset += sibling.nodeValue.length;\n\n\t\t\t\t\t\t// We are at or passed the position we where looking for\n\t\t\t\t\t\tif (textNodeOffset >= offset) {\n\t\t\t\t\t\t\tcontainer = sibling;\n\t\t\t\t\t\t\ttextNodeOffset -= offset;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsibling = sibling.previousSibling;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tdomRange[start ? 'setStart' : 'setEnd'](container, textNodeOffset);\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\t// Find start point\n\t\t\t\tfindEndPoint(true);\n\n\t\t\t\t// Find end point if needed\n\t\t\t\tif (!collapsed) {\n\t\t\t\t\tfindEndPoint();\n\t\t\t\t}\n\t\t\t} catch (ex) {\n\t\t\t\t// IE has a nasty bug where text nodes might throw \"invalid argument\" when you\n\t\t\t\t// access the nodeValue or other properties of text nodes. This seems to happend when\n\t\t\t\t// text nodes are split into two nodes by a delete/backspace call. So lets detect it and try to fix it.\n\t\t\t\tif (ex.number == -2147024809) {\n\t\t\t\t\t// Get the current selection\n\t\t\t\t\tbookmark = self.getBookmark(2);\n\n\t\t\t\t\t// Get start element\n\t\t\t\t\ttmpRange = ieRange.duplicate();\n\t\t\t\t\ttmpRange.collapse(true);\n\t\t\t\t\telement = tmpRange.parentElement();\n\n\t\t\t\t\t// Get end element\n\t\t\t\t\tif (!collapsed) {\n\t\t\t\t\t\ttmpRange = ieRange.duplicate();\n\t\t\t\t\t\ttmpRange.collapse(false);\n\t\t\t\t\t\telement2 = tmpRange.parentElement();\n\t\t\t\t\t\telement2.innerHTML = element2.innerHTML;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Remove the broken elements\n\t\t\t\t\telement.innerHTML = element.innerHTML;\n\n\t\t\t\t\t// Restore the selection\n\t\t\t\t\tself.moveToBookmark(bookmark);\n\n\t\t\t\t\t// Since the range has moved we need to re-get it\n\t\t\t\t\tieRange = selection.getRng();\n\n\t\t\t\t\t// Find start point\n\t\t\t\t\tfindEndPoint(true);\n\n\t\t\t\t\t// Find end point if needed\n\t\t\t\t\tif (!collapsed) {\n\t\t\t\t\t\tfindEndPoint();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthrow ex; // Throw other errors\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn domRange;\n\t\t}", "title": "" }, { "docid": "b602fda50312ea8e8a180bd29de577f4", "score": "0.5162992", "text": "function offsetsWithinElement(node, range) {\n\n var beforeRange, afterRange, nodeLength, sOffset, eOffset;\n\n beforeRange = range.cloneRange();\n beforeRange.selectNodeContents(node);\n beforeRange.setEnd(range.startContainer, range.startOffset);\n sOffset = beforeRange.toString().length;\n\n afterRange = range.cloneRange();\n afterRange.selectNodeContents(node);\n nodeLength = afterRange.toString().length;\n afterRange.setStart(range.endContainer, range.endOffset);\n eOffset = nodeLength - afterRange.toString().length;\n\n return {\n 'start': sOffset,\n 'end': eOffset,\n };\n\n}", "title": "" }, { "docid": "7974d0ec3c650de9262a47d90fa066eb", "score": "0.5154055", "text": "function getRange() {\n\t\t\tvar ieRange = selection.getRng(), domRange = dom.createRng(), element, collapsed, tmpRange, element2, bookmark;\n\n\t\t\t// If selection is outside the current document just return an empty range\n\t\t\telement = ieRange.item ? ieRange.item(0) : ieRange.parentElement();\n\t\t\tif (element.ownerDocument != dom.doc) {\n\t\t\t\treturn domRange;\n\t\t\t}\n\n\t\t\tcollapsed = selection.isCollapsed();\n\n\t\t\t// Handle control selection\n\t\t\tif (ieRange.item) {\n\t\t\t\tdomRange.setStart(element.parentNode, dom.nodeIndex(element));\n\t\t\t\tdomRange.setEnd(domRange.startContainer, domRange.startOffset + 1);\n\n\t\t\t\treturn domRange;\n\t\t\t}\n\n\t\t\tfunction findEndPoint(start) {\n\t\t\t\tvar endPoint = getPosition(ieRange, start), container, offset, textNodeOffset = 0, sibling, undef, nodeValue;\n\n\t\t\t\tcontainer = endPoint.node;\n\t\t\t\toffset = endPoint.offset;\n\n\t\t\t\tif (endPoint.inside && !container.hasChildNodes()) {\n\t\t\t\t\tdomRange[start ? 'setStart' : 'setEnd'](container, 0);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (offset === undef) {\n\t\t\t\t\tdomRange[start ? 'setStartBefore' : 'setEndAfter'](container);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (endPoint.position < 0) {\n\t\t\t\t\tsibling = endPoint.inside ? container.firstChild : container.nextSibling;\n\n\t\t\t\t\tif (!sibling) {\n\t\t\t\t\t\tdomRange[start ? 'setStartAfter' : 'setEndAfter'](container);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!offset) {\n\t\t\t\t\t\tif (sibling.nodeType == 3) {\n\t\t\t\t\t\t\tdomRange[start ? 'setStart' : 'setEnd'](sibling, 0);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdomRange[start ? 'setStartBefore' : 'setEndBefore'](sibling);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Find the text node and offset\n\t\t\t\t\twhile (sibling) {\n\t\t\t\t\t\tif (sibling.nodeType == 3) {\n\t\t\t\t\t\t\tnodeValue = sibling.nodeValue;\n\t\t\t\t\t\t\ttextNodeOffset += nodeValue.length;\n\n\t\t\t\t\t\t\t// We are at or passed the position we where looking for\n\t\t\t\t\t\t\tif (textNodeOffset >= offset) {\n\t\t\t\t\t\t\t\tcontainer = sibling;\n\t\t\t\t\t\t\t\ttextNodeOffset -= offset;\n\t\t\t\t\t\t\t\ttextNodeOffset = nodeValue.length - textNodeOffset;\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\n\t\t\t\t\t\tsibling = sibling.nextSibling;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Find the text node and offset\n\t\t\t\t\tsibling = container.previousSibling;\n\n\t\t\t\t\tif (!sibling) {\n\t\t\t\t\t\treturn domRange[start ? 'setStartBefore' : 'setEndBefore'](container);\n\t\t\t\t\t}\n\n\t\t\t\t\t// If there isn't any text to loop then use the first position\n\t\t\t\t\tif (!offset) {\n\t\t\t\t\t\tif (container.nodeType == 3) {\n\t\t\t\t\t\t\tdomRange[start ? 'setStart' : 'setEnd'](sibling, container.nodeValue.length);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdomRange[start ? 'setStartAfter' : 'setEndAfter'](sibling);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (sibling) {\n\t\t\t\t\t\tif (sibling.nodeType == 3) {\n\t\t\t\t\t\t\ttextNodeOffset += sibling.nodeValue.length;\n\n\t\t\t\t\t\t\t// We are at or passed the position we where looking for\n\t\t\t\t\t\t\tif (textNodeOffset >= offset) {\n\t\t\t\t\t\t\t\tcontainer = sibling;\n\t\t\t\t\t\t\t\ttextNodeOffset -= offset;\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\n\t\t\t\t\t\tsibling = sibling.previousSibling;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tdomRange[start ? 'setStart' : 'setEnd'](container, textNodeOffset);\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\t// Find start point\n\t\t\t\tfindEndPoint(true);\n\n\t\t\t\t// Find end point if needed\n\t\t\t\tif (!collapsed) {\n\t\t\t\t\tfindEndPoint();\n\t\t\t\t}\n\t\t\t} catch (ex) {\n\t\t\t\t// IE has a nasty bug where text nodes might throw \"invalid argument\" when you\n\t\t\t\t// access the nodeValue or other properties of text nodes. This seems to happend when\n\t\t\t\t// text nodes are split into two nodes by a delete/backspace call. So lets detect it and try to fix it.\n\t\t\t\tif (ex.number == -2147024809) {\n\t\t\t\t\t// Get the current selection\n\t\t\t\t\tbookmark = self.getBookmark(2);\n\n\t\t\t\t\t// Get start element\n\t\t\t\t\ttmpRange = ieRange.duplicate();\n\t\t\t\t\ttmpRange.collapse(true);\n\t\t\t\t\telement = tmpRange.parentElement();\n\n\t\t\t\t\t// Get end element\n\t\t\t\t\tif (!collapsed) {\n\t\t\t\t\t\ttmpRange = ieRange.duplicate();\n\t\t\t\t\t\ttmpRange.collapse(false);\n\t\t\t\t\t\telement2 = tmpRange.parentElement();\n\t\t\t\t\t\telement2.innerHTML = element2.innerHTML;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Remove the broken elements\n\t\t\t\t\telement.innerHTML = element.innerHTML;\n\n\t\t\t\t\t// Restore the selection\n\t\t\t\t\tself.moveToBookmark(bookmark);\n\n\t\t\t\t\t// Since the range has moved we need to re-get it\n\t\t\t\t\tieRange = selection.getRng();\n\n\t\t\t\t\t// Find start point\n\t\t\t\t\tfindEndPoint(true);\n\n\t\t\t\t\t// Find end point if needed\n\t\t\t\t\tif (!collapsed) {\n\t\t\t\t\t\tfindEndPoint();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthrow ex; // Throw other errors\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn domRange;\n\t\t}", "title": "" }, { "docid": "73a2c78c5c12b54fbc2971d2d1cd7921", "score": "0.5154055", "text": "function getRange() {\n\t\t\tvar ieRange = selection.getRng(), domRange = dom.createRng(), element, collapsed, tmpRange, element2, bookmark;\n\n\t\t\t// If selection is outside the current document just return an empty range\n\t\t\telement = ieRange.item ? ieRange.item(0) : ieRange.parentElement();\n\t\t\tif (element.ownerDocument != dom.doc) {\n\t\t\t\treturn domRange;\n\t\t\t}\n\n\t\t\tcollapsed = selection.isCollapsed();\n\n\t\t\t// Handle control selection\n\t\t\tif (ieRange.item) {\n\t\t\t\tdomRange.setStart(element.parentNode, dom.nodeIndex(element));\n\t\t\t\tdomRange.setEnd(domRange.startContainer, domRange.startOffset + 1);\n\n\t\t\t\treturn domRange;\n\t\t\t}\n\n\t\t\tfunction findEndPoint(start) {\n\t\t\t\tvar endPoint = getPosition(ieRange, start), container, offset, textNodeOffset = 0, sibling, undef, nodeValue;\n\n\t\t\t\tcontainer = endPoint.node;\n\t\t\t\toffset = endPoint.offset;\n\n\t\t\t\tif (endPoint.inside && !container.hasChildNodes()) {\n\t\t\t\t\tdomRange[start ? 'setStart' : 'setEnd'](container, 0);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (offset === undef) {\n\t\t\t\t\tdomRange[start ? 'setStartBefore' : 'setEndAfter'](container);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (endPoint.position < 0) {\n\t\t\t\t\tsibling = endPoint.inside ? container.firstChild : container.nextSibling;\n\n\t\t\t\t\tif (!sibling) {\n\t\t\t\t\t\tdomRange[start ? 'setStartAfter' : 'setEndAfter'](container);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!offset) {\n\t\t\t\t\t\tif (sibling.nodeType == 3) {\n\t\t\t\t\t\t\tdomRange[start ? 'setStart' : 'setEnd'](sibling, 0);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdomRange[start ? 'setStartBefore' : 'setEndBefore'](sibling);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Find the text node and offset\n\t\t\t\t\twhile (sibling) {\n\t\t\t\t\t\tif (sibling.nodeType == 3) {\n\t\t\t\t\t\t\tnodeValue = sibling.nodeValue;\n\t\t\t\t\t\t\ttextNodeOffset += nodeValue.length;\n\n\t\t\t\t\t\t\t// We are at or passed the position we where looking for\n\t\t\t\t\t\t\tif (textNodeOffset >= offset) {\n\t\t\t\t\t\t\t\tcontainer = sibling;\n\t\t\t\t\t\t\t\ttextNodeOffset -= offset;\n\t\t\t\t\t\t\t\ttextNodeOffset = nodeValue.length - textNodeOffset;\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\n\t\t\t\t\t\tsibling = sibling.nextSibling;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Find the text node and offset\n\t\t\t\t\tsibling = container.previousSibling;\n\n\t\t\t\t\tif (!sibling) {\n\t\t\t\t\t\treturn domRange[start ? 'setStartBefore' : 'setEndBefore'](container);\n\t\t\t\t\t}\n\n\t\t\t\t\t// If there isn't any text to loop then use the first position\n\t\t\t\t\tif (!offset) {\n\t\t\t\t\t\tif (container.nodeType == 3) {\n\t\t\t\t\t\t\tdomRange[start ? 'setStart' : 'setEnd'](sibling, container.nodeValue.length);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdomRange[start ? 'setStartAfter' : 'setEndAfter'](sibling);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (sibling) {\n\t\t\t\t\t\tif (sibling.nodeType == 3) {\n\t\t\t\t\t\t\ttextNodeOffset += sibling.nodeValue.length;\n\n\t\t\t\t\t\t\t// We are at or passed the position we where looking for\n\t\t\t\t\t\t\tif (textNodeOffset >= offset) {\n\t\t\t\t\t\t\t\tcontainer = sibling;\n\t\t\t\t\t\t\t\ttextNodeOffset -= offset;\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\n\t\t\t\t\t\tsibling = sibling.previousSibling;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tdomRange[start ? 'setStart' : 'setEnd'](container, textNodeOffset);\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\t// Find start point\n\t\t\t\tfindEndPoint(true);\n\n\t\t\t\t// Find end point if needed\n\t\t\t\tif (!collapsed) {\n\t\t\t\t\tfindEndPoint();\n\t\t\t\t}\n\t\t\t} catch (ex) {\n\t\t\t\t// IE has a nasty bug where text nodes might throw \"invalid argument\" when you\n\t\t\t\t// access the nodeValue or other properties of text nodes. This seems to happen when\n\t\t\t\t// text nodes are split into two nodes by a delete/backspace call.\n\t\t\t\t// So let us detect and try to fix it.\n\t\t\t\tif (ex.number == -2147024809) {\n\t\t\t\t\t// Get the current selection\n\t\t\t\t\tbookmark = self.getBookmark(2);\n\n\t\t\t\t\t// Get start element\n\t\t\t\t\ttmpRange = ieRange.duplicate();\n\t\t\t\t\ttmpRange.collapse(true);\n\t\t\t\t\telement = tmpRange.parentElement();\n\n\t\t\t\t\t// Get end element\n\t\t\t\t\tif (!collapsed) {\n\t\t\t\t\t\ttmpRange = ieRange.duplicate();\n\t\t\t\t\t\ttmpRange.collapse(false);\n\t\t\t\t\t\telement2 = tmpRange.parentElement();\n\t\t\t\t\t\telement2.innerHTML = element2.innerHTML;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Remove the broken elements\n\t\t\t\t\telement.innerHTML = element.innerHTML;\n\n\t\t\t\t\t// Restore the selection\n\t\t\t\t\tself.moveToBookmark(bookmark);\n\n\t\t\t\t\t// Since the range has moved we need to re-get it\n\t\t\t\t\tieRange = selection.getRng();\n\n\t\t\t\t\t// Find start point\n\t\t\t\t\tfindEndPoint(true);\n\n\t\t\t\t\t// Find end point if needed\n\t\t\t\t\tif (!collapsed) {\n\t\t\t\t\t\tfindEndPoint();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthrow ex; // Throw other errors\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn domRange;\n\t\t}", "title": "" }, { "docid": "73a2c78c5c12b54fbc2971d2d1cd7921", "score": "0.5154055", "text": "function getRange() {\n\t\t\tvar ieRange = selection.getRng(), domRange = dom.createRng(), element, collapsed, tmpRange, element2, bookmark;\n\n\t\t\t// If selection is outside the current document just return an empty range\n\t\t\telement = ieRange.item ? ieRange.item(0) : ieRange.parentElement();\n\t\t\tif (element.ownerDocument != dom.doc) {\n\t\t\t\treturn domRange;\n\t\t\t}\n\n\t\t\tcollapsed = selection.isCollapsed();\n\n\t\t\t// Handle control selection\n\t\t\tif (ieRange.item) {\n\t\t\t\tdomRange.setStart(element.parentNode, dom.nodeIndex(element));\n\t\t\t\tdomRange.setEnd(domRange.startContainer, domRange.startOffset + 1);\n\n\t\t\t\treturn domRange;\n\t\t\t}\n\n\t\t\tfunction findEndPoint(start) {\n\t\t\t\tvar endPoint = getPosition(ieRange, start), container, offset, textNodeOffset = 0, sibling, undef, nodeValue;\n\n\t\t\t\tcontainer = endPoint.node;\n\t\t\t\toffset = endPoint.offset;\n\n\t\t\t\tif (endPoint.inside && !container.hasChildNodes()) {\n\t\t\t\t\tdomRange[start ? 'setStart' : 'setEnd'](container, 0);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (offset === undef) {\n\t\t\t\t\tdomRange[start ? 'setStartBefore' : 'setEndAfter'](container);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (endPoint.position < 0) {\n\t\t\t\t\tsibling = endPoint.inside ? container.firstChild : container.nextSibling;\n\n\t\t\t\t\tif (!sibling) {\n\t\t\t\t\t\tdomRange[start ? 'setStartAfter' : 'setEndAfter'](container);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!offset) {\n\t\t\t\t\t\tif (sibling.nodeType == 3) {\n\t\t\t\t\t\t\tdomRange[start ? 'setStart' : 'setEnd'](sibling, 0);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdomRange[start ? 'setStartBefore' : 'setEndBefore'](sibling);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Find the text node and offset\n\t\t\t\t\twhile (sibling) {\n\t\t\t\t\t\tif (sibling.nodeType == 3) {\n\t\t\t\t\t\t\tnodeValue = sibling.nodeValue;\n\t\t\t\t\t\t\ttextNodeOffset += nodeValue.length;\n\n\t\t\t\t\t\t\t// We are at or passed the position we where looking for\n\t\t\t\t\t\t\tif (textNodeOffset >= offset) {\n\t\t\t\t\t\t\t\tcontainer = sibling;\n\t\t\t\t\t\t\t\ttextNodeOffset -= offset;\n\t\t\t\t\t\t\t\ttextNodeOffset = nodeValue.length - textNodeOffset;\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\n\t\t\t\t\t\tsibling = sibling.nextSibling;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Find the text node and offset\n\t\t\t\t\tsibling = container.previousSibling;\n\n\t\t\t\t\tif (!sibling) {\n\t\t\t\t\t\treturn domRange[start ? 'setStartBefore' : 'setEndBefore'](container);\n\t\t\t\t\t}\n\n\t\t\t\t\t// If there isn't any text to loop then use the first position\n\t\t\t\t\tif (!offset) {\n\t\t\t\t\t\tif (container.nodeType == 3) {\n\t\t\t\t\t\t\tdomRange[start ? 'setStart' : 'setEnd'](sibling, container.nodeValue.length);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdomRange[start ? 'setStartAfter' : 'setEndAfter'](sibling);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (sibling) {\n\t\t\t\t\t\tif (sibling.nodeType == 3) {\n\t\t\t\t\t\t\ttextNodeOffset += sibling.nodeValue.length;\n\n\t\t\t\t\t\t\t// We are at or passed the position we where looking for\n\t\t\t\t\t\t\tif (textNodeOffset >= offset) {\n\t\t\t\t\t\t\t\tcontainer = sibling;\n\t\t\t\t\t\t\t\ttextNodeOffset -= offset;\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\n\t\t\t\t\t\tsibling = sibling.previousSibling;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tdomRange[start ? 'setStart' : 'setEnd'](container, textNodeOffset);\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\t// Find start point\n\t\t\t\tfindEndPoint(true);\n\n\t\t\t\t// Find end point if needed\n\t\t\t\tif (!collapsed) {\n\t\t\t\t\tfindEndPoint();\n\t\t\t\t}\n\t\t\t} catch (ex) {\n\t\t\t\t// IE has a nasty bug where text nodes might throw \"invalid argument\" when you\n\t\t\t\t// access the nodeValue or other properties of text nodes. This seems to happen when\n\t\t\t\t// text nodes are split into two nodes by a delete/backspace call.\n\t\t\t\t// So let us detect and try to fix it.\n\t\t\t\tif (ex.number == -2147024809) {\n\t\t\t\t\t// Get the current selection\n\t\t\t\t\tbookmark = self.getBookmark(2);\n\n\t\t\t\t\t// Get start element\n\t\t\t\t\ttmpRange = ieRange.duplicate();\n\t\t\t\t\ttmpRange.collapse(true);\n\t\t\t\t\telement = tmpRange.parentElement();\n\n\t\t\t\t\t// Get end element\n\t\t\t\t\tif (!collapsed) {\n\t\t\t\t\t\ttmpRange = ieRange.duplicate();\n\t\t\t\t\t\ttmpRange.collapse(false);\n\t\t\t\t\t\telement2 = tmpRange.parentElement();\n\t\t\t\t\t\telement2.innerHTML = element2.innerHTML;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Remove the broken elements\n\t\t\t\t\telement.innerHTML = element.innerHTML;\n\n\t\t\t\t\t// Restore the selection\n\t\t\t\t\tself.moveToBookmark(bookmark);\n\n\t\t\t\t\t// Since the range has moved we need to re-get it\n\t\t\t\t\tieRange = selection.getRng();\n\n\t\t\t\t\t// Find start point\n\t\t\t\t\tfindEndPoint(true);\n\n\t\t\t\t\t// Find end point if needed\n\t\t\t\t\tif (!collapsed) {\n\t\t\t\t\t\tfindEndPoint();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthrow ex; // Throw other errors\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn domRange;\n\t\t}", "title": "" }, { "docid": "73a2c78c5c12b54fbc2971d2d1cd7921", "score": "0.5154055", "text": "function getRange() {\n\t\t\tvar ieRange = selection.getRng(), domRange = dom.createRng(), element, collapsed, tmpRange, element2, bookmark;\n\n\t\t\t// If selection is outside the current document just return an empty range\n\t\t\telement = ieRange.item ? ieRange.item(0) : ieRange.parentElement();\n\t\t\tif (element.ownerDocument != dom.doc) {\n\t\t\t\treturn domRange;\n\t\t\t}\n\n\t\t\tcollapsed = selection.isCollapsed();\n\n\t\t\t// Handle control selection\n\t\t\tif (ieRange.item) {\n\t\t\t\tdomRange.setStart(element.parentNode, dom.nodeIndex(element));\n\t\t\t\tdomRange.setEnd(domRange.startContainer, domRange.startOffset + 1);\n\n\t\t\t\treturn domRange;\n\t\t\t}\n\n\t\t\tfunction findEndPoint(start) {\n\t\t\t\tvar endPoint = getPosition(ieRange, start), container, offset, textNodeOffset = 0, sibling, undef, nodeValue;\n\n\t\t\t\tcontainer = endPoint.node;\n\t\t\t\toffset = endPoint.offset;\n\n\t\t\t\tif (endPoint.inside && !container.hasChildNodes()) {\n\t\t\t\t\tdomRange[start ? 'setStart' : 'setEnd'](container, 0);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (offset === undef) {\n\t\t\t\t\tdomRange[start ? 'setStartBefore' : 'setEndAfter'](container);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (endPoint.position < 0) {\n\t\t\t\t\tsibling = endPoint.inside ? container.firstChild : container.nextSibling;\n\n\t\t\t\t\tif (!sibling) {\n\t\t\t\t\t\tdomRange[start ? 'setStartAfter' : 'setEndAfter'](container);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!offset) {\n\t\t\t\t\t\tif (sibling.nodeType == 3) {\n\t\t\t\t\t\t\tdomRange[start ? 'setStart' : 'setEnd'](sibling, 0);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdomRange[start ? 'setStartBefore' : 'setEndBefore'](sibling);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Find the text node and offset\n\t\t\t\t\twhile (sibling) {\n\t\t\t\t\t\tif (sibling.nodeType == 3) {\n\t\t\t\t\t\t\tnodeValue = sibling.nodeValue;\n\t\t\t\t\t\t\ttextNodeOffset += nodeValue.length;\n\n\t\t\t\t\t\t\t// We are at or passed the position we where looking for\n\t\t\t\t\t\t\tif (textNodeOffset >= offset) {\n\t\t\t\t\t\t\t\tcontainer = sibling;\n\t\t\t\t\t\t\t\ttextNodeOffset -= offset;\n\t\t\t\t\t\t\t\ttextNodeOffset = nodeValue.length - textNodeOffset;\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\n\t\t\t\t\t\tsibling = sibling.nextSibling;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Find the text node and offset\n\t\t\t\t\tsibling = container.previousSibling;\n\n\t\t\t\t\tif (!sibling) {\n\t\t\t\t\t\treturn domRange[start ? 'setStartBefore' : 'setEndBefore'](container);\n\t\t\t\t\t}\n\n\t\t\t\t\t// If there isn't any text to loop then use the first position\n\t\t\t\t\tif (!offset) {\n\t\t\t\t\t\tif (container.nodeType == 3) {\n\t\t\t\t\t\t\tdomRange[start ? 'setStart' : 'setEnd'](sibling, container.nodeValue.length);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdomRange[start ? 'setStartAfter' : 'setEndAfter'](sibling);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (sibling) {\n\t\t\t\t\t\tif (sibling.nodeType == 3) {\n\t\t\t\t\t\t\ttextNodeOffset += sibling.nodeValue.length;\n\n\t\t\t\t\t\t\t// We are at or passed the position we where looking for\n\t\t\t\t\t\t\tif (textNodeOffset >= offset) {\n\t\t\t\t\t\t\t\tcontainer = sibling;\n\t\t\t\t\t\t\t\ttextNodeOffset -= offset;\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\n\t\t\t\t\t\tsibling = sibling.previousSibling;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tdomRange[start ? 'setStart' : 'setEnd'](container, textNodeOffset);\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\t// Find start point\n\t\t\t\tfindEndPoint(true);\n\n\t\t\t\t// Find end point if needed\n\t\t\t\tif (!collapsed) {\n\t\t\t\t\tfindEndPoint();\n\t\t\t\t}\n\t\t\t} catch (ex) {\n\t\t\t\t// IE has a nasty bug where text nodes might throw \"invalid argument\" when you\n\t\t\t\t// access the nodeValue or other properties of text nodes. This seems to happen when\n\t\t\t\t// text nodes are split into two nodes by a delete/backspace call.\n\t\t\t\t// So let us detect and try to fix it.\n\t\t\t\tif (ex.number == -2147024809) {\n\t\t\t\t\t// Get the current selection\n\t\t\t\t\tbookmark = self.getBookmark(2);\n\n\t\t\t\t\t// Get start element\n\t\t\t\t\ttmpRange = ieRange.duplicate();\n\t\t\t\t\ttmpRange.collapse(true);\n\t\t\t\t\telement = tmpRange.parentElement();\n\n\t\t\t\t\t// Get end element\n\t\t\t\t\tif (!collapsed) {\n\t\t\t\t\t\ttmpRange = ieRange.duplicate();\n\t\t\t\t\t\ttmpRange.collapse(false);\n\t\t\t\t\t\telement2 = tmpRange.parentElement();\n\t\t\t\t\t\telement2.innerHTML = element2.innerHTML;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Remove the broken elements\n\t\t\t\t\telement.innerHTML = element.innerHTML;\n\n\t\t\t\t\t// Restore the selection\n\t\t\t\t\tself.moveToBookmark(bookmark);\n\n\t\t\t\t\t// Since the range has moved we need to re-get it\n\t\t\t\t\tieRange = selection.getRng();\n\n\t\t\t\t\t// Find start point\n\t\t\t\t\tfindEndPoint(true);\n\n\t\t\t\t\t// Find end point if needed\n\t\t\t\t\tif (!collapsed) {\n\t\t\t\t\t\tfindEndPoint();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthrow ex; // Throw other errors\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn domRange;\n\t\t}", "title": "" }, { "docid": "5f60a6e57817ad45da6e9542ef2f6fec", "score": "0.5153099", "text": "function getIndex(ranges, cursor, end) {\n for (var i = 0; i < ranges.length; i++) {\n var atAnchor = end != 'head' && cursorEqual(ranges[i].anchor, cursor);\n var atHead = end != 'anchor' && cursorEqual(ranges[i].head, cursor);\n if (atAnchor || atHead) {\n return i;\n }\n }\n return -1;\n }", "title": "" }, { "docid": "5f60a6e57817ad45da6e9542ef2f6fec", "score": "0.5153099", "text": "function getIndex(ranges, cursor, end) {\n for (var i = 0; i < ranges.length; i++) {\n var atAnchor = end != 'head' && cursorEqual(ranges[i].anchor, cursor);\n var atHead = end != 'anchor' && cursorEqual(ranges[i].head, cursor);\n if (atAnchor || atHead) {\n return i;\n }\n }\n return -1;\n }", "title": "" }, { "docid": "5f60a6e57817ad45da6e9542ef2f6fec", "score": "0.5153099", "text": "function getIndex(ranges, cursor, end) {\n for (var i = 0; i < ranges.length; i++) {\n var atAnchor = end != 'head' && cursorEqual(ranges[i].anchor, cursor);\n var atHead = end != 'anchor' && cursorEqual(ranges[i].head, cursor);\n if (atAnchor || atHead) {\n return i;\n }\n }\n return -1;\n }", "title": "" }, { "docid": "5f60a6e57817ad45da6e9542ef2f6fec", "score": "0.5153099", "text": "function getIndex(ranges, cursor, end) {\n for (var i = 0; i < ranges.length; i++) {\n var atAnchor = end != 'head' && cursorEqual(ranges[i].anchor, cursor);\n var atHead = end != 'anchor' && cursorEqual(ranges[i].head, cursor);\n if (atAnchor || atHead) {\n return i;\n }\n }\n return -1;\n }", "title": "" }, { "docid": "9bb55cb863e76137f2da73511325efa0", "score": "0.5147188", "text": "function getTextRangeBoundaryPosition(textRange, wholeRangeContainerElement, isStart, isCollapsed) {\n var workingRange = textRange.duplicate();\n\n workingRange.collapse(isStart);\n var containerElement = workingRange.parentElement();\n\n // Sometimes collapsing a TextRange that's at the start of a text node can move it into the previous node, so\n // check for that\n // TODO: Find out when. Workaround for wholeRangeContainerElement may break this\n if (!dom.isAncestorOf(wholeRangeContainerElement, containerElement, true)) {\n containerElement = wholeRangeContainerElement;\n\n }\n\n\n\n // Deal with nodes that cannot \"contain rich HTML markup\". In practice, this means form inputs, images and\n // similar. See http://msdn.microsoft.com/en-us/library/aa703950%28VS.85%29.aspx\n if (!containerElement.canHaveHTML) {\n return new DomPosition(containerElement.parentNode, dom.getNodeIndex(containerElement));\n }\n\n var workingNode = dom.getDocument(containerElement).createElement(\"span\");\n var comparison, workingComparisonType = isStart ? \"StartToStart\" : \"StartToEnd\";\n var previousNode, nextNode, boundaryPosition, boundaryNode;\n\n // Move the working range through the container's children, starting at the end and working backwards, until the\n // working range reaches or goes past the boundary we're interested in\n do {\n containerElement.insertBefore(workingNode, workingNode.previousSibling);\n workingRange.moveToElementText(workingNode);\n } while ( (comparison = workingRange.compareEndPoints(workingComparisonType, textRange)) > 0 &&\n workingNode.previousSibling);\n\n // We've now reached or gone past the boundary of the text range we're interested in\n // so have identified the node we want\n boundaryNode = workingNode.nextSibling;\n\n if (comparison == -1 && boundaryNode && dom.isCharacterDataNode(boundaryNode)) {\n // This is a character data node (text, comment, cdata). The working range is collapsed at the start of the\n // node containing the text range's boundary, so we move the end of the working range to the boundary point\n // and measure the length of its text to get the boundary's offset within the node.\n workingRange.setEndPoint(isStart ? \"EndToStart\" : \"EndToEnd\", textRange);\n\n\n var offset;\n\n if (/[\\r\\n]/.test(boundaryNode.data)) {\n /*\n For the particular case of a boundary within a text node containing line breaks (within a <pre> element,\n for example), we need a slightly complicated approach to get the boundary's offset in IE. The facts:\n\n - Each line break is represented as \\r in the text node's data/nodeValue properties\n - Each line break is represented as \\r\\n in the TextRange's 'text' property\n - The 'text' property of the TextRange does not contain trailing line breaks\n\n To get round the problem presented by the final fact above, we can use the fact that TextRange's\n moveStart() and moveEnd() methods return the actual number of characters moved, which is not necessarily\n the same as the number of characters it was instructed to move. The simplest approach is to use this to\n store the characters moved when moving both the start and end of the range to the start of the document\n body and subtracting the start offset from the end offset (the \"move-negative-gazillion\" method).\n However, this is extremely slow when the document is large and the range is near the end of it. Clearly\n doing the mirror image (i.e. moving the range boundaries to the end of the document) has the same\n problem.\n\n Another approach that works is to use moveStart() to move the start boundary of the range up to the end\n boundary one character at a time and incrementing a counter with the value returned by the moveStart()\n call. However, the check for whether the start boundary has reached the end boundary is expensive, so\n this method is slow (although unlike \"move-negative-gazillion\" is largely unaffected by the location of\n the range within the document).\n\n The method below is a hybrid of the two methods above. It uses the fact that a string containing the\n TextRange's 'text' property with each \\r\\n converted to a single \\r character cannot be longer than the\n text of the TextRange, so the start of the range is moved that length initially and then a character at\n a time to make up for any trailing line breaks not contained in the 'text' property. This has good\n performance in most situations compared to the previous two methods.\n */\n var tempRange = workingRange.duplicate();\n var rangeLength = tempRange.text.replace(/\\r\\n/g, \"\\r\").length;\n\n offset = tempRange.moveStart(\"character\", rangeLength);\n while ( (comparison = tempRange.compareEndPoints(\"StartToEnd\", tempRange)) == -1) {\n offset++;\n tempRange.moveStart(\"character\", 1);\n }\n } else {\n offset = workingRange.text.length;\n }\n boundaryPosition = new DomPosition(boundaryNode, offset);\n } else {\n\n\n // If the boundary immediately follows a character data node and this is the end boundary, we should favour\n // a position within that, and likewise for a start boundary preceding a character data node\n previousNode = (isCollapsed || !isStart) && workingNode.previousSibling;\n nextNode = (isCollapsed || isStart) && workingNode.nextSibling;\n\n\n\n if (nextNode && dom.isCharacterDataNode(nextNode)) {\n boundaryPosition = new DomPosition(nextNode, 0);\n } else if (previousNode && dom.isCharacterDataNode(previousNode)) {\n boundaryPosition = new DomPosition(previousNode, previousNode.length);\n } else {\n boundaryPosition = new DomPosition(containerElement, dom.getNodeIndex(workingNode));\n }\n }\n\n // Clean up\n workingNode.parentNode.removeChild(workingNode);\n\n return boundaryPosition;\n }", "title": "" }, { "docid": "9bb55cb863e76137f2da73511325efa0", "score": "0.5147188", "text": "function getTextRangeBoundaryPosition(textRange, wholeRangeContainerElement, isStart, isCollapsed) {\n var workingRange = textRange.duplicate();\n\n workingRange.collapse(isStart);\n var containerElement = workingRange.parentElement();\n\n // Sometimes collapsing a TextRange that's at the start of a text node can move it into the previous node, so\n // check for that\n // TODO: Find out when. Workaround for wholeRangeContainerElement may break this\n if (!dom.isAncestorOf(wholeRangeContainerElement, containerElement, true)) {\n containerElement = wholeRangeContainerElement;\n\n }\n\n\n\n // Deal with nodes that cannot \"contain rich HTML markup\". In practice, this means form inputs, images and\n // similar. See http://msdn.microsoft.com/en-us/library/aa703950%28VS.85%29.aspx\n if (!containerElement.canHaveHTML) {\n return new DomPosition(containerElement.parentNode, dom.getNodeIndex(containerElement));\n }\n\n var workingNode = dom.getDocument(containerElement).createElement(\"span\");\n var comparison, workingComparisonType = isStart ? \"StartToStart\" : \"StartToEnd\";\n var previousNode, nextNode, boundaryPosition, boundaryNode;\n\n // Move the working range through the container's children, starting at the end and working backwards, until the\n // working range reaches or goes past the boundary we're interested in\n do {\n containerElement.insertBefore(workingNode, workingNode.previousSibling);\n workingRange.moveToElementText(workingNode);\n } while ( (comparison = workingRange.compareEndPoints(workingComparisonType, textRange)) > 0 &&\n workingNode.previousSibling);\n\n // We've now reached or gone past the boundary of the text range we're interested in\n // so have identified the node we want\n boundaryNode = workingNode.nextSibling;\n\n if (comparison == -1 && boundaryNode && dom.isCharacterDataNode(boundaryNode)) {\n // This is a character data node (text, comment, cdata). The working range is collapsed at the start of the\n // node containing the text range's boundary, so we move the end of the working range to the boundary point\n // and measure the length of its text to get the boundary's offset within the node.\n workingRange.setEndPoint(isStart ? \"EndToStart\" : \"EndToEnd\", textRange);\n\n\n var offset;\n\n if (/[\\r\\n]/.test(boundaryNode.data)) {\n /*\n For the particular case of a boundary within a text node containing line breaks (within a <pre> element,\n for example), we need a slightly complicated approach to get the boundary's offset in IE. The facts:\n\n - Each line break is represented as \\r in the text node's data/nodeValue properties\n - Each line break is represented as \\r\\n in the TextRange's 'text' property\n - The 'text' property of the TextRange does not contain trailing line breaks\n\n To get round the problem presented by the final fact above, we can use the fact that TextRange's\n moveStart() and moveEnd() methods return the actual number of characters moved, which is not necessarily\n the same as the number of characters it was instructed to move. The simplest approach is to use this to\n store the characters moved when moving both the start and end of the range to the start of the document\n body and subtracting the start offset from the end offset (the \"move-negative-gazillion\" method).\n However, this is extremely slow when the document is large and the range is near the end of it. Clearly\n doing the mirror image (i.e. moving the range boundaries to the end of the document) has the same\n problem.\n\n Another approach that works is to use moveStart() to move the start boundary of the range up to the end\n boundary one character at a time and incrementing a counter with the value returned by the moveStart()\n call. However, the check for whether the start boundary has reached the end boundary is expensive, so\n this method is slow (although unlike \"move-negative-gazillion\" is largely unaffected by the location of\n the range within the document).\n\n The method below is a hybrid of the two methods above. It uses the fact that a string containing the\n TextRange's 'text' property with each \\r\\n converted to a single \\r character cannot be longer than the\n text of the TextRange, so the start of the range is moved that length initially and then a character at\n a time to make up for any trailing line breaks not contained in the 'text' property. This has good\n performance in most situations compared to the previous two methods.\n */\n var tempRange = workingRange.duplicate();\n var rangeLength = tempRange.text.replace(/\\r\\n/g, \"\\r\").length;\n\n offset = tempRange.moveStart(\"character\", rangeLength);\n while ( (comparison = tempRange.compareEndPoints(\"StartToEnd\", tempRange)) == -1) {\n offset++;\n tempRange.moveStart(\"character\", 1);\n }\n } else {\n offset = workingRange.text.length;\n }\n boundaryPosition = new DomPosition(boundaryNode, offset);\n } else {\n\n\n // If the boundary immediately follows a character data node and this is the end boundary, we should favour\n // a position within that, and likewise for a start boundary preceding a character data node\n previousNode = (isCollapsed || !isStart) && workingNode.previousSibling;\n nextNode = (isCollapsed || isStart) && workingNode.nextSibling;\n\n\n\n if (nextNode && dom.isCharacterDataNode(nextNode)) {\n boundaryPosition = new DomPosition(nextNode, 0);\n } else if (previousNode && dom.isCharacterDataNode(previousNode)) {\n boundaryPosition = new DomPosition(previousNode, previousNode.length);\n } else {\n boundaryPosition = new DomPosition(containerElement, dom.getNodeIndex(workingNode));\n }\n }\n\n // Clean up\n workingNode.parentNode.removeChild(workingNode);\n\n return boundaryPosition;\n }", "title": "" }, { "docid": "9bb55cb863e76137f2da73511325efa0", "score": "0.5147188", "text": "function getTextRangeBoundaryPosition(textRange, wholeRangeContainerElement, isStart, isCollapsed) {\n var workingRange = textRange.duplicate();\n\n workingRange.collapse(isStart);\n var containerElement = workingRange.parentElement();\n\n // Sometimes collapsing a TextRange that's at the start of a text node can move it into the previous node, so\n // check for that\n // TODO: Find out when. Workaround for wholeRangeContainerElement may break this\n if (!dom.isAncestorOf(wholeRangeContainerElement, containerElement, true)) {\n containerElement = wholeRangeContainerElement;\n\n }\n\n\n\n // Deal with nodes that cannot \"contain rich HTML markup\". In practice, this means form inputs, images and\n // similar. See http://msdn.microsoft.com/en-us/library/aa703950%28VS.85%29.aspx\n if (!containerElement.canHaveHTML) {\n return new DomPosition(containerElement.parentNode, dom.getNodeIndex(containerElement));\n }\n\n var workingNode = dom.getDocument(containerElement).createElement(\"span\");\n var comparison, workingComparisonType = isStart ? \"StartToStart\" : \"StartToEnd\";\n var previousNode, nextNode, boundaryPosition, boundaryNode;\n\n // Move the working range through the container's children, starting at the end and working backwards, until the\n // working range reaches or goes past the boundary we're interested in\n do {\n containerElement.insertBefore(workingNode, workingNode.previousSibling);\n workingRange.moveToElementText(workingNode);\n } while ( (comparison = workingRange.compareEndPoints(workingComparisonType, textRange)) > 0 &&\n workingNode.previousSibling);\n\n // We've now reached or gone past the boundary of the text range we're interested in\n // so have identified the node we want\n boundaryNode = workingNode.nextSibling;\n\n if (comparison == -1 && boundaryNode && dom.isCharacterDataNode(boundaryNode)) {\n // This is a character data node (text, comment, cdata). The working range is collapsed at the start of the\n // node containing the text range's boundary, so we move the end of the working range to the boundary point\n // and measure the length of its text to get the boundary's offset within the node.\n workingRange.setEndPoint(isStart ? \"EndToStart\" : \"EndToEnd\", textRange);\n\n\n var offset;\n\n if (/[\\r\\n]/.test(boundaryNode.data)) {\n /*\n For the particular case of a boundary within a text node containing line breaks (within a <pre> element,\n for example), we need a slightly complicated approach to get the boundary's offset in IE. The facts:\n\n - Each line break is represented as \\r in the text node's data/nodeValue properties\n - Each line break is represented as \\r\\n in the TextRange's 'text' property\n - The 'text' property of the TextRange does not contain trailing line breaks\n\n To get round the problem presented by the final fact above, we can use the fact that TextRange's\n moveStart() and moveEnd() methods return the actual number of characters moved, which is not necessarily\n the same as the number of characters it was instructed to move. The simplest approach is to use this to\n store the characters moved when moving both the start and end of the range to the start of the document\n body and subtracting the start offset from the end offset (the \"move-negative-gazillion\" method).\n However, this is extremely slow when the document is large and the range is near the end of it. Clearly\n doing the mirror image (i.e. moving the range boundaries to the end of the document) has the same\n problem.\n\n Another approach that works is to use moveStart() to move the start boundary of the range up to the end\n boundary one character at a time and incrementing a counter with the value returned by the moveStart()\n call. However, the check for whether the start boundary has reached the end boundary is expensive, so\n this method is slow (although unlike \"move-negative-gazillion\" is largely unaffected by the location of\n the range within the document).\n\n The method below is a hybrid of the two methods above. It uses the fact that a string containing the\n TextRange's 'text' property with each \\r\\n converted to a single \\r character cannot be longer than the\n text of the TextRange, so the start of the range is moved that length initially and then a character at\n a time to make up for any trailing line breaks not contained in the 'text' property. This has good\n performance in most situations compared to the previous two methods.\n */\n var tempRange = workingRange.duplicate();\n var rangeLength = tempRange.text.replace(/\\r\\n/g, \"\\r\").length;\n\n offset = tempRange.moveStart(\"character\", rangeLength);\n while ( (comparison = tempRange.compareEndPoints(\"StartToEnd\", tempRange)) == -1) {\n offset++;\n tempRange.moveStart(\"character\", 1);\n }\n } else {\n offset = workingRange.text.length;\n }\n boundaryPosition = new DomPosition(boundaryNode, offset);\n } else {\n\n\n // If the boundary immediately follows a character data node and this is the end boundary, we should favour\n // a position within that, and likewise for a start boundary preceding a character data node\n previousNode = (isCollapsed || !isStart) && workingNode.previousSibling;\n nextNode = (isCollapsed || isStart) && workingNode.nextSibling;\n\n\n\n if (nextNode && dom.isCharacterDataNode(nextNode)) {\n boundaryPosition = new DomPosition(nextNode, 0);\n } else if (previousNode && dom.isCharacterDataNode(previousNode)) {\n boundaryPosition = new DomPosition(previousNode, previousNode.length);\n } else {\n boundaryPosition = new DomPosition(containerElement, dom.getNodeIndex(workingNode));\n }\n }\n\n // Clean up\n workingNode.parentNode.removeChild(workingNode);\n\n return boundaryPosition;\n }", "title": "" }, { "docid": "9bb55cb863e76137f2da73511325efa0", "score": "0.5147188", "text": "function getTextRangeBoundaryPosition(textRange, wholeRangeContainerElement, isStart, isCollapsed) {\n var workingRange = textRange.duplicate();\n\n workingRange.collapse(isStart);\n var containerElement = workingRange.parentElement();\n\n // Sometimes collapsing a TextRange that's at the start of a text node can move it into the previous node, so\n // check for that\n // TODO: Find out when. Workaround for wholeRangeContainerElement may break this\n if (!dom.isAncestorOf(wholeRangeContainerElement, containerElement, true)) {\n containerElement = wholeRangeContainerElement;\n\n }\n\n\n\n // Deal with nodes that cannot \"contain rich HTML markup\". In practice, this means form inputs, images and\n // similar. See http://msdn.microsoft.com/en-us/library/aa703950%28VS.85%29.aspx\n if (!containerElement.canHaveHTML) {\n return new DomPosition(containerElement.parentNode, dom.getNodeIndex(containerElement));\n }\n\n var workingNode = dom.getDocument(containerElement).createElement(\"span\");\n var comparison, workingComparisonType = isStart ? \"StartToStart\" : \"StartToEnd\";\n var previousNode, nextNode, boundaryPosition, boundaryNode;\n\n // Move the working range through the container's children, starting at the end and working backwards, until the\n // working range reaches or goes past the boundary we're interested in\n do {\n containerElement.insertBefore(workingNode, workingNode.previousSibling);\n workingRange.moveToElementText(workingNode);\n } while ( (comparison = workingRange.compareEndPoints(workingComparisonType, textRange)) > 0 &&\n workingNode.previousSibling);\n\n // We've now reached or gone past the boundary of the text range we're interested in\n // so have identified the node we want\n boundaryNode = workingNode.nextSibling;\n\n if (comparison == -1 && boundaryNode && dom.isCharacterDataNode(boundaryNode)) {\n // This is a character data node (text, comment, cdata). The working range is collapsed at the start of the\n // node containing the text range's boundary, so we move the end of the working range to the boundary point\n // and measure the length of its text to get the boundary's offset within the node.\n workingRange.setEndPoint(isStart ? \"EndToStart\" : \"EndToEnd\", textRange);\n\n\n var offset;\n\n if (/[\\r\\n]/.test(boundaryNode.data)) {\n /*\n For the particular case of a boundary within a text node containing line breaks (within a <pre> element,\n for example), we need a slightly complicated approach to get the boundary's offset in IE. The facts:\n\n - Each line break is represented as \\r in the text node's data/nodeValue properties\n - Each line break is represented as \\r\\n in the TextRange's 'text' property\n - The 'text' property of the TextRange does not contain trailing line breaks\n\n To get round the problem presented by the final fact above, we can use the fact that TextRange's\n moveStart() and moveEnd() methods return the actual number of characters moved, which is not necessarily\n the same as the number of characters it was instructed to move. The simplest approach is to use this to\n store the characters moved when moving both the start and end of the range to the start of the document\n body and subtracting the start offset from the end offset (the \"move-negative-gazillion\" method).\n However, this is extremely slow when the document is large and the range is near the end of it. Clearly\n doing the mirror image (i.e. moving the range boundaries to the end of the document) has the same\n problem.\n\n Another approach that works is to use moveStart() to move the start boundary of the range up to the end\n boundary one character at a time and incrementing a counter with the value returned by the moveStart()\n call. However, the check for whether the start boundary has reached the end boundary is expensive, so\n this method is slow (although unlike \"move-negative-gazillion\" is largely unaffected by the location of\n the range within the document).\n\n The method below is a hybrid of the two methods above. It uses the fact that a string containing the\n TextRange's 'text' property with each \\r\\n converted to a single \\r character cannot be longer than the\n text of the TextRange, so the start of the range is moved that length initially and then a character at\n a time to make up for any trailing line breaks not contained in the 'text' property. This has good\n performance in most situations compared to the previous two methods.\n */\n var tempRange = workingRange.duplicate();\n var rangeLength = tempRange.text.replace(/\\r\\n/g, \"\\r\").length;\n\n offset = tempRange.moveStart(\"character\", rangeLength);\n while ( (comparison = tempRange.compareEndPoints(\"StartToEnd\", tempRange)) == -1) {\n offset++;\n tempRange.moveStart(\"character\", 1);\n }\n } else {\n offset = workingRange.text.length;\n }\n boundaryPosition = new DomPosition(boundaryNode, offset);\n } else {\n\n\n // If the boundary immediately follows a character data node and this is the end boundary, we should favour\n // a position within that, and likewise for a start boundary preceding a character data node\n previousNode = (isCollapsed || !isStart) && workingNode.previousSibling;\n nextNode = (isCollapsed || isStart) && workingNode.nextSibling;\n\n\n\n if (nextNode && dom.isCharacterDataNode(nextNode)) {\n boundaryPosition = new DomPosition(nextNode, 0);\n } else if (previousNode && dom.isCharacterDataNode(previousNode)) {\n boundaryPosition = new DomPosition(previousNode, previousNode.length);\n } else {\n boundaryPosition = new DomPosition(containerElement, dom.getNodeIndex(workingNode));\n }\n }\n\n // Clean up\n workingNode.parentNode.removeChild(workingNode);\n\n return boundaryPosition;\n }", "title": "" }, { "docid": "9bb55cb863e76137f2da73511325efa0", "score": "0.5147188", "text": "function getTextRangeBoundaryPosition(textRange, wholeRangeContainerElement, isStart, isCollapsed) {\n var workingRange = textRange.duplicate();\n\n workingRange.collapse(isStart);\n var containerElement = workingRange.parentElement();\n\n // Sometimes collapsing a TextRange that's at the start of a text node can move it into the previous node, so\n // check for that\n // TODO: Find out when. Workaround for wholeRangeContainerElement may break this\n if (!dom.isAncestorOf(wholeRangeContainerElement, containerElement, true)) {\n containerElement = wholeRangeContainerElement;\n\n }\n\n\n\n // Deal with nodes that cannot \"contain rich HTML markup\". In practice, this means form inputs, images and\n // similar. See http://msdn.microsoft.com/en-us/library/aa703950%28VS.85%29.aspx\n if (!containerElement.canHaveHTML) {\n return new DomPosition(containerElement.parentNode, dom.getNodeIndex(containerElement));\n }\n\n var workingNode = dom.getDocument(containerElement).createElement(\"span\");\n var comparison, workingComparisonType = isStart ? \"StartToStart\" : \"StartToEnd\";\n var previousNode, nextNode, boundaryPosition, boundaryNode;\n\n // Move the working range through the container's children, starting at the end and working backwards, until the\n // working range reaches or goes past the boundary we're interested in\n do {\n containerElement.insertBefore(workingNode, workingNode.previousSibling);\n workingRange.moveToElementText(workingNode);\n } while ( (comparison = workingRange.compareEndPoints(workingComparisonType, textRange)) > 0 &&\n workingNode.previousSibling);\n\n // We've now reached or gone past the boundary of the text range we're interested in\n // so have identified the node we want\n boundaryNode = workingNode.nextSibling;\n\n if (comparison == -1 && boundaryNode && dom.isCharacterDataNode(boundaryNode)) {\n // This is a character data node (text, comment, cdata). The working range is collapsed at the start of the\n // node containing the text range's boundary, so we move the end of the working range to the boundary point\n // and measure the length of its text to get the boundary's offset within the node.\n workingRange.setEndPoint(isStart ? \"EndToStart\" : \"EndToEnd\", textRange);\n\n\n var offset;\n\n if (/[\\r\\n]/.test(boundaryNode.data)) {\n /*\n For the particular case of a boundary within a text node containing line breaks (within a <pre> element,\n for example), we need a slightly complicated approach to get the boundary's offset in IE. The facts:\n\n - Each line break is represented as \\r in the text node's data/nodeValue properties\n - Each line break is represented as \\r\\n in the TextRange's 'text' property\n - The 'text' property of the TextRange does not contain trailing line breaks\n\n To get round the problem presented by the final fact above, we can use the fact that TextRange's\n moveStart() and moveEnd() methods return the actual number of characters moved, which is not necessarily\n the same as the number of characters it was instructed to move. The simplest approach is to use this to\n store the characters moved when moving both the start and end of the range to the start of the document\n body and subtracting the start offset from the end offset (the \"move-negative-gazillion\" method).\n However, this is extremely slow when the document is large and the range is near the end of it. Clearly\n doing the mirror image (i.e. moving the range boundaries to the end of the document) has the same\n problem.\n\n Another approach that works is to use moveStart() to move the start boundary of the range up to the end\n boundary one character at a time and incrementing a counter with the value returned by the moveStart()\n call. However, the check for whether the start boundary has reached the end boundary is expensive, so\n this method is slow (although unlike \"move-negative-gazillion\" is largely unaffected by the location of\n the range within the document).\n\n The method below is a hybrid of the two methods above. It uses the fact that a string containing the\n TextRange's 'text' property with each \\r\\n converted to a single \\r character cannot be longer than the\n text of the TextRange, so the start of the range is moved that length initially and then a character at\n a time to make up for any trailing line breaks not contained in the 'text' property. This has good\n performance in most situations compared to the previous two methods.\n */\n var tempRange = workingRange.duplicate();\n var rangeLength = tempRange.text.replace(/\\r\\n/g, \"\\r\").length;\n\n offset = tempRange.moveStart(\"character\", rangeLength);\n while ( (comparison = tempRange.compareEndPoints(\"StartToEnd\", tempRange)) == -1) {\n offset++;\n tempRange.moveStart(\"character\", 1);\n }\n } else {\n offset = workingRange.text.length;\n }\n boundaryPosition = new DomPosition(boundaryNode, offset);\n } else {\n\n\n // If the boundary immediately follows a character data node and this is the end boundary, we should favour\n // a position within that, and likewise for a start boundary preceding a character data node\n previousNode = (isCollapsed || !isStart) && workingNode.previousSibling;\n nextNode = (isCollapsed || isStart) && workingNode.nextSibling;\n\n\n\n if (nextNode && dom.isCharacterDataNode(nextNode)) {\n boundaryPosition = new DomPosition(nextNode, 0);\n } else if (previousNode && dom.isCharacterDataNode(previousNode)) {\n boundaryPosition = new DomPosition(previousNode, previousNode.length);\n } else {\n boundaryPosition = new DomPosition(containerElement, dom.getNodeIndex(workingNode));\n }\n }\n\n // Clean up\n workingNode.parentNode.removeChild(workingNode);\n\n return boundaryPosition;\n }", "title": "" }, { "docid": "9fdeb90e504a11e253a01c1156fda13e", "score": "0.5146181", "text": "function getTextRangeBoundaryPosition(textRange, wholeRangeContainerElement, isStart, isCollapsed) {\r\n var workingRange = textRange.duplicate();\r\n\r\n workingRange.collapse(isStart);\r\n var containerElement = workingRange.parentElement();\r\n\r\n // Sometimes collapsing a TextRange that's at the start of a text node can move it into the previous node, so\r\n // check for that\r\n // TODO: Find out when. Workaround for wholeRangeContainerElement may break this\r\n if (!dom.isAncestorOf(wholeRangeContainerElement, containerElement, true)) {\r\n containerElement = wholeRangeContainerElement;\r\n\r\n }\r\n\r\n\r\n\r\n // Deal with nodes that cannot \"contain rich HTML markup\". In practice, this means form inputs, images and\r\n // similar. See http://msdn.microsoft.com/en-us/library/aa703950%28VS.85%29.aspx\r\n if (!containerElement.canHaveHTML) {\r\n return new DomPosition(containerElement.parentNode, dom.getNodeIndex(containerElement));\r\n }\r\n\r\n var workingNode = dom.getDocument(containerElement).createElement(\"span\");\r\n var comparison, workingComparisonType = isStart ? \"StartToStart\" : \"StartToEnd\";\r\n var previousNode, nextNode, boundaryPosition, boundaryNode;\r\n\r\n // Move the working range through the container's children, starting at the end and working backwards, until the\r\n // working range reaches or goes past the boundary we're interested in\r\n do {\r\n containerElement.insertBefore(workingNode, workingNode.previousSibling);\r\n workingRange.moveToElementText(workingNode);\r\n } while ( (comparison = workingRange.compareEndPoints(workingComparisonType, textRange)) > 0 &&\r\n workingNode.previousSibling);\r\n\r\n // We've now reached or gone past the boundary of the text range we're interested in\r\n // so have identified the node we want\r\n boundaryNode = workingNode.nextSibling;\r\n\r\n if (comparison == -1 && boundaryNode && dom.isCharacterDataNode(boundaryNode)) {\r\n // This must be a data node (text, comment, cdata) since we've overshot. The working range is collapsed at\r\n // the start of the node containing the text range's boundary, so we move the end of the working range to\r\n // the boundary point and measure the length of its text to get the boundary's offset within the node\r\n workingRange.setEndPoint(isStart ? \"EndToStart\" : \"EndToEnd\", textRange);\r\n\r\n\r\n var offset;\r\n\r\n if (/[\\r\\n]/.test(boundaryNode.data)) {\r\n /*\r\n For the particular case of a boundary within a text node containing line breaks (within a <pre> element,\r\n for example), we need a slightly complicated approach to get the boundary's offset in IE. The facts:\r\n\r\n - Each line break is represented as \\r in the text node's data/nodeValue properties\r\n - Each line break is represented as \\r\\n in the range's text property\r\n - The text property of the TextRange strips trailing line breaks\r\n\r\n To get round the problem presented by the final fact above, we can use the fact that TextRange's\r\n moveStart and moveEnd properties return the actual number of characters moved, which is not necessarily\r\n the same as the number of characters it was instructed to move. The simplest approach is to use this to\r\n store the characters moved when moving both the start and end of the range to the start of the document\r\n body and subtracting the start offset from the end offset (the \"move-negative-gazillion\" method).\r\n However, this is extremely slow when the document is large and the range is near the end of it. Clearly\r\n doing the mirror image (i.e. moving the range boundaries to the end of the document) has the same\r\n problem.\r\n\r\n Another approach that works is to use moveStart to move the start boundary of the range up to the end\r\n one character at a time and incrementing a counter with the result of the moveStart call. However, the\r\n check for whether the start boundary has reached the end boundary is expensive, so this method is slow\r\n (although unlike \"move-negative-gazillion\" is unaffected by the location of the range within the\r\n document).\r\n\r\n The method below uses the fact that once each \\r\\n in the range's text property has been converted to a\r\n single \\r character (as it is in the text node), we know the offset is at least as long as the range\r\n text's length, so the start of the range is moved that length initially and then a character at a time\r\n to make up for any line breaks that the range text property has stripped. This seems to have good\r\n performance in most situations compared to the previous two methods.\r\n */\r\n var tempRange = workingRange.duplicate();\r\n var rangeLength = tempRange.text.replace(/\\r\\n/g, \"\\r\").length;\r\n\r\n offset = tempRange.moveStart(\"character\", rangeLength);\r\n while ( (comparison = tempRange.compareEndPoints(\"StartToEnd\", tempRange)) == -1) {\r\n offset++;\r\n tempRange.moveStart(\"character\", 1);\r\n }\r\n } else {\r\n offset = workingRange.text.length;\r\n }\r\n boundaryPosition = new DomPosition(boundaryNode, offset);\r\n } else {\r\n\r\n\r\n // If the boundary immediately follows a character data node and this is the end boundary, we should favour\r\n // a position within that, and likewise for a start boundary preceding a character data node\r\n previousNode = (isCollapsed || !isStart) && workingNode.previousSibling;\r\n nextNode = (isCollapsed || isStart) && workingNode.nextSibling;\r\n\r\n\r\n\r\n if (nextNode && dom.isCharacterDataNode(nextNode)) {\r\n boundaryPosition = new DomPosition(nextNode, 0);\r\n } else if (previousNode && dom.isCharacterDataNode(previousNode)) {\r\n boundaryPosition = new DomPosition(previousNode, previousNode.length);\r\n } else {\r\n boundaryPosition = new DomPosition(containerElement, dom.getNodeIndex(workingNode));\r\n }\r\n }\r\n\r\n // Clean up\r\n workingNode.parentNode.removeChild(workingNode);\r\n\r\n return boundaryPosition;\r\n }", "title": "" }, { "docid": "8634014a6727003ed6b6d948ee07162a", "score": "0.51444614", "text": "function getCharacterRemovalRange(entityMap, startBlock, endBlock, selectionState, direction) {\n var start = selectionState.getStartOffset();\n var end = selectionState.getEndOffset();\n var startEntityKey = startBlock.getEntityAt(start);\n var endEntityKey = endBlock.getEntityAt(end - 1);\n if (!startEntityKey && !endEntityKey) {\n return selectionState;\n }\n var newSelectionState = selectionState;\n if (startEntityKey && startEntityKey === endEntityKey) {\n newSelectionState = getEntityRemovalRange(entityMap, startBlock, newSelectionState, direction, startEntityKey, true, true);\n } else if (startEntityKey && endEntityKey) {\n var startSelectionState = getEntityRemovalRange(entityMap, startBlock, newSelectionState, direction, startEntityKey, false, true);\n var endSelectionState = getEntityRemovalRange(entityMap, endBlock, newSelectionState, direction, endEntityKey, false, false);\n newSelectionState = newSelectionState.merge({\n anchorOffset: startSelectionState.getAnchorOffset(),\n focusOffset: endSelectionState.getFocusOffset(),\n isBackward: false\n });\n } else if (startEntityKey) {\n var _startSelectionState = getEntityRemovalRange(entityMap, startBlock, newSelectionState, direction, startEntityKey, false, true);\n newSelectionState = newSelectionState.merge({\n anchorOffset: _startSelectionState.getStartOffset(),\n isBackward: false\n });\n } else if (endEntityKey) {\n var _endSelectionState = getEntityRemovalRange(entityMap, endBlock, newSelectionState, direction, endEntityKey, false, false);\n newSelectionState = newSelectionState.merge({\n focusOffset: _endSelectionState.getEndOffset(),\n isBackward: false\n });\n }\n return newSelectionState;\n}", "title": "" }, { "docid": "8634014a6727003ed6b6d948ee07162a", "score": "0.51444614", "text": "function getCharacterRemovalRange(entityMap, startBlock, endBlock, selectionState, direction) {\n var start = selectionState.getStartOffset();\n var end = selectionState.getEndOffset();\n var startEntityKey = startBlock.getEntityAt(start);\n var endEntityKey = endBlock.getEntityAt(end - 1);\n if (!startEntityKey && !endEntityKey) {\n return selectionState;\n }\n var newSelectionState = selectionState;\n if (startEntityKey && startEntityKey === endEntityKey) {\n newSelectionState = getEntityRemovalRange(entityMap, startBlock, newSelectionState, direction, startEntityKey, true, true);\n } else if (startEntityKey && endEntityKey) {\n var startSelectionState = getEntityRemovalRange(entityMap, startBlock, newSelectionState, direction, startEntityKey, false, true);\n var endSelectionState = getEntityRemovalRange(entityMap, endBlock, newSelectionState, direction, endEntityKey, false, false);\n newSelectionState = newSelectionState.merge({\n anchorOffset: startSelectionState.getAnchorOffset(),\n focusOffset: endSelectionState.getFocusOffset(),\n isBackward: false\n });\n } else if (startEntityKey) {\n var _startSelectionState = getEntityRemovalRange(entityMap, startBlock, newSelectionState, direction, startEntityKey, false, true);\n newSelectionState = newSelectionState.merge({\n anchorOffset: _startSelectionState.getStartOffset(),\n isBackward: false\n });\n } else if (endEntityKey) {\n var _endSelectionState = getEntityRemovalRange(entityMap, endBlock, newSelectionState, direction, endEntityKey, false, false);\n newSelectionState = newSelectionState.merge({\n focusOffset: _endSelectionState.getEndOffset(),\n isBackward: false\n });\n }\n return newSelectionState;\n}", "title": "" }, { "docid": "8634014a6727003ed6b6d948ee07162a", "score": "0.51444614", "text": "function getCharacterRemovalRange(entityMap, startBlock, endBlock, selectionState, direction) {\n var start = selectionState.getStartOffset();\n var end = selectionState.getEndOffset();\n var startEntityKey = startBlock.getEntityAt(start);\n var endEntityKey = endBlock.getEntityAt(end - 1);\n if (!startEntityKey && !endEntityKey) {\n return selectionState;\n }\n var newSelectionState = selectionState;\n if (startEntityKey && startEntityKey === endEntityKey) {\n newSelectionState = getEntityRemovalRange(entityMap, startBlock, newSelectionState, direction, startEntityKey, true, true);\n } else if (startEntityKey && endEntityKey) {\n var startSelectionState = getEntityRemovalRange(entityMap, startBlock, newSelectionState, direction, startEntityKey, false, true);\n var endSelectionState = getEntityRemovalRange(entityMap, endBlock, newSelectionState, direction, endEntityKey, false, false);\n newSelectionState = newSelectionState.merge({\n anchorOffset: startSelectionState.getAnchorOffset(),\n focusOffset: endSelectionState.getFocusOffset(),\n isBackward: false\n });\n } else if (startEntityKey) {\n var _startSelectionState = getEntityRemovalRange(entityMap, startBlock, newSelectionState, direction, startEntityKey, false, true);\n newSelectionState = newSelectionState.merge({\n anchorOffset: _startSelectionState.getStartOffset(),\n isBackward: false\n });\n } else if (endEntityKey) {\n var _endSelectionState = getEntityRemovalRange(entityMap, endBlock, newSelectionState, direction, endEntityKey, false, false);\n newSelectionState = newSelectionState.merge({\n focusOffset: _endSelectionState.getEndOffset(),\n isBackward: false\n });\n }\n return newSelectionState;\n}", "title": "" }, { "docid": "8634014a6727003ed6b6d948ee07162a", "score": "0.51444614", "text": "function getCharacterRemovalRange(entityMap, startBlock, endBlock, selectionState, direction) {\n var start = selectionState.getStartOffset();\n var end = selectionState.getEndOffset();\n var startEntityKey = startBlock.getEntityAt(start);\n var endEntityKey = endBlock.getEntityAt(end - 1);\n if (!startEntityKey && !endEntityKey) {\n return selectionState;\n }\n var newSelectionState = selectionState;\n if (startEntityKey && startEntityKey === endEntityKey) {\n newSelectionState = getEntityRemovalRange(entityMap, startBlock, newSelectionState, direction, startEntityKey, true, true);\n } else if (startEntityKey && endEntityKey) {\n var startSelectionState = getEntityRemovalRange(entityMap, startBlock, newSelectionState, direction, startEntityKey, false, true);\n var endSelectionState = getEntityRemovalRange(entityMap, endBlock, newSelectionState, direction, endEntityKey, false, false);\n newSelectionState = newSelectionState.merge({\n anchorOffset: startSelectionState.getAnchorOffset(),\n focusOffset: endSelectionState.getFocusOffset(),\n isBackward: false\n });\n } else if (startEntityKey) {\n var _startSelectionState = getEntityRemovalRange(entityMap, startBlock, newSelectionState, direction, startEntityKey, false, true);\n newSelectionState = newSelectionState.merge({\n anchorOffset: _startSelectionState.getStartOffset(),\n isBackward: false\n });\n } else if (endEntityKey) {\n var _endSelectionState = getEntityRemovalRange(entityMap, endBlock, newSelectionState, direction, endEntityKey, false, false);\n newSelectionState = newSelectionState.merge({\n focusOffset: _endSelectionState.getEndOffset(),\n isBackward: false\n });\n }\n return newSelectionState;\n}", "title": "" }, { "docid": "8634014a6727003ed6b6d948ee07162a", "score": "0.51444614", "text": "function getCharacterRemovalRange(entityMap, startBlock, endBlock, selectionState, direction) {\n var start = selectionState.getStartOffset();\n var end = selectionState.getEndOffset();\n var startEntityKey = startBlock.getEntityAt(start);\n var endEntityKey = endBlock.getEntityAt(end - 1);\n if (!startEntityKey && !endEntityKey) {\n return selectionState;\n }\n var newSelectionState = selectionState;\n if (startEntityKey && startEntityKey === endEntityKey) {\n newSelectionState = getEntityRemovalRange(entityMap, startBlock, newSelectionState, direction, startEntityKey, true, true);\n } else if (startEntityKey && endEntityKey) {\n var startSelectionState = getEntityRemovalRange(entityMap, startBlock, newSelectionState, direction, startEntityKey, false, true);\n var endSelectionState = getEntityRemovalRange(entityMap, endBlock, newSelectionState, direction, endEntityKey, false, false);\n newSelectionState = newSelectionState.merge({\n anchorOffset: startSelectionState.getAnchorOffset(),\n focusOffset: endSelectionState.getFocusOffset(),\n isBackward: false\n });\n } else if (startEntityKey) {\n var _startSelectionState = getEntityRemovalRange(entityMap, startBlock, newSelectionState, direction, startEntityKey, false, true);\n newSelectionState = newSelectionState.merge({\n anchorOffset: _startSelectionState.getStartOffset(),\n isBackward: false\n });\n } else if (endEntityKey) {\n var _endSelectionState = getEntityRemovalRange(entityMap, endBlock, newSelectionState, direction, endEntityKey, false, false);\n newSelectionState = newSelectionState.merge({\n focusOffset: _endSelectionState.getEndOffset(),\n isBackward: false\n });\n }\n return newSelectionState;\n}", "title": "" }, { "docid": "8634014a6727003ed6b6d948ee07162a", "score": "0.51444614", "text": "function getCharacterRemovalRange(entityMap, startBlock, endBlock, selectionState, direction) {\n var start = selectionState.getStartOffset();\n var end = selectionState.getEndOffset();\n var startEntityKey = startBlock.getEntityAt(start);\n var endEntityKey = endBlock.getEntityAt(end - 1);\n if (!startEntityKey && !endEntityKey) {\n return selectionState;\n }\n var newSelectionState = selectionState;\n if (startEntityKey && startEntityKey === endEntityKey) {\n newSelectionState = getEntityRemovalRange(entityMap, startBlock, newSelectionState, direction, startEntityKey, true, true);\n } else if (startEntityKey && endEntityKey) {\n var startSelectionState = getEntityRemovalRange(entityMap, startBlock, newSelectionState, direction, startEntityKey, false, true);\n var endSelectionState = getEntityRemovalRange(entityMap, endBlock, newSelectionState, direction, endEntityKey, false, false);\n newSelectionState = newSelectionState.merge({\n anchorOffset: startSelectionState.getAnchorOffset(),\n focusOffset: endSelectionState.getFocusOffset(),\n isBackward: false\n });\n } else if (startEntityKey) {\n var _startSelectionState = getEntityRemovalRange(entityMap, startBlock, newSelectionState, direction, startEntityKey, false, true);\n newSelectionState = newSelectionState.merge({\n anchorOffset: _startSelectionState.getStartOffset(),\n isBackward: false\n });\n } else if (endEntityKey) {\n var _endSelectionState = getEntityRemovalRange(entityMap, endBlock, newSelectionState, direction, endEntityKey, false, false);\n newSelectionState = newSelectionState.merge({\n focusOffset: _endSelectionState.getEndOffset(),\n isBackward: false\n });\n }\n return newSelectionState;\n}", "title": "" }, { "docid": "8634014a6727003ed6b6d948ee07162a", "score": "0.51444614", "text": "function getCharacterRemovalRange(entityMap, startBlock, endBlock, selectionState, direction) {\n var start = selectionState.getStartOffset();\n var end = selectionState.getEndOffset();\n var startEntityKey = startBlock.getEntityAt(start);\n var endEntityKey = endBlock.getEntityAt(end - 1);\n if (!startEntityKey && !endEntityKey) {\n return selectionState;\n }\n var newSelectionState = selectionState;\n if (startEntityKey && startEntityKey === endEntityKey) {\n newSelectionState = getEntityRemovalRange(entityMap, startBlock, newSelectionState, direction, startEntityKey, true, true);\n } else if (startEntityKey && endEntityKey) {\n var startSelectionState = getEntityRemovalRange(entityMap, startBlock, newSelectionState, direction, startEntityKey, false, true);\n var endSelectionState = getEntityRemovalRange(entityMap, endBlock, newSelectionState, direction, endEntityKey, false, false);\n newSelectionState = newSelectionState.merge({\n anchorOffset: startSelectionState.getAnchorOffset(),\n focusOffset: endSelectionState.getFocusOffset(),\n isBackward: false\n });\n } else if (startEntityKey) {\n var _startSelectionState = getEntityRemovalRange(entityMap, startBlock, newSelectionState, direction, startEntityKey, false, true);\n newSelectionState = newSelectionState.merge({\n anchorOffset: _startSelectionState.getStartOffset(),\n isBackward: false\n });\n } else if (endEntityKey) {\n var _endSelectionState = getEntityRemovalRange(entityMap, endBlock, newSelectionState, direction, endEntityKey, false, false);\n newSelectionState = newSelectionState.merge({\n focusOffset: _endSelectionState.getEndOffset(),\n isBackward: false\n });\n }\n return newSelectionState;\n}", "title": "" }, { "docid": "8634014a6727003ed6b6d948ee07162a", "score": "0.51444614", "text": "function getCharacterRemovalRange(entityMap, startBlock, endBlock, selectionState, direction) {\n var start = selectionState.getStartOffset();\n var end = selectionState.getEndOffset();\n var startEntityKey = startBlock.getEntityAt(start);\n var endEntityKey = endBlock.getEntityAt(end - 1);\n if (!startEntityKey && !endEntityKey) {\n return selectionState;\n }\n var newSelectionState = selectionState;\n if (startEntityKey && startEntityKey === endEntityKey) {\n newSelectionState = getEntityRemovalRange(entityMap, startBlock, newSelectionState, direction, startEntityKey, true, true);\n } else if (startEntityKey && endEntityKey) {\n var startSelectionState = getEntityRemovalRange(entityMap, startBlock, newSelectionState, direction, startEntityKey, false, true);\n var endSelectionState = getEntityRemovalRange(entityMap, endBlock, newSelectionState, direction, endEntityKey, false, false);\n newSelectionState = newSelectionState.merge({\n anchorOffset: startSelectionState.getAnchorOffset(),\n focusOffset: endSelectionState.getFocusOffset(),\n isBackward: false\n });\n } else if (startEntityKey) {\n var _startSelectionState = getEntityRemovalRange(entityMap, startBlock, newSelectionState, direction, startEntityKey, false, true);\n newSelectionState = newSelectionState.merge({\n anchorOffset: _startSelectionState.getStartOffset(),\n isBackward: false\n });\n } else if (endEntityKey) {\n var _endSelectionState = getEntityRemovalRange(entityMap, endBlock, newSelectionState, direction, endEntityKey, false, false);\n newSelectionState = newSelectionState.merge({\n focusOffset: _endSelectionState.getEndOffset(),\n isBackward: false\n });\n }\n return newSelectionState;\n}", "title": "" }, { "docid": "8634014a6727003ed6b6d948ee07162a", "score": "0.51444614", "text": "function getCharacterRemovalRange(entityMap, startBlock, endBlock, selectionState, direction) {\n var start = selectionState.getStartOffset();\n var end = selectionState.getEndOffset();\n var startEntityKey = startBlock.getEntityAt(start);\n var endEntityKey = endBlock.getEntityAt(end - 1);\n if (!startEntityKey && !endEntityKey) {\n return selectionState;\n }\n var newSelectionState = selectionState;\n if (startEntityKey && startEntityKey === endEntityKey) {\n newSelectionState = getEntityRemovalRange(entityMap, startBlock, newSelectionState, direction, startEntityKey, true, true);\n } else if (startEntityKey && endEntityKey) {\n var startSelectionState = getEntityRemovalRange(entityMap, startBlock, newSelectionState, direction, startEntityKey, false, true);\n var endSelectionState = getEntityRemovalRange(entityMap, endBlock, newSelectionState, direction, endEntityKey, false, false);\n newSelectionState = newSelectionState.merge({\n anchorOffset: startSelectionState.getAnchorOffset(),\n focusOffset: endSelectionState.getFocusOffset(),\n isBackward: false\n });\n } else if (startEntityKey) {\n var _startSelectionState = getEntityRemovalRange(entityMap, startBlock, newSelectionState, direction, startEntityKey, false, true);\n newSelectionState = newSelectionState.merge({\n anchorOffset: _startSelectionState.getStartOffset(),\n isBackward: false\n });\n } else if (endEntityKey) {\n var _endSelectionState = getEntityRemovalRange(entityMap, endBlock, newSelectionState, direction, endEntityKey, false, false);\n newSelectionState = newSelectionState.merge({\n focusOffset: _endSelectionState.getEndOffset(),\n isBackward: false\n });\n }\n return newSelectionState;\n}", "title": "" }, { "docid": "0a081f5d3c270a70fefdbaca84df9ad5", "score": "0.51253325", "text": "function getTextRangeBoundaryPosition(textRange, wholeRangeContainerElement, isStart, isCollapsed) {\r\n var workingRange = textRange.duplicate();\r\n\r\n workingRange.collapse(isStart);\r\n var containerElement = workingRange.parentElement();\r\n\r\n // Sometimes collapsing a TextRange that's at the start of a text node can move it into the previous node, so\r\n // check for that\r\n // TODO: Find out when. Workaround for wholeRangeContainerElement may break this\r\n if (!dom.isAncestorOf(wholeRangeContainerElement, containerElement, true)) {\r\n containerElement = wholeRangeContainerElement;\r\n\r\n }\r\n\r\n\r\n\r\n // Deal with nodes that cannot \"contain rich HTML markup\". In practice, this means form inputs, images and\r\n // similar. See http://msdn.microsoft.com/en-us/library/aa703950%28VS.85%29.aspx\r\n if (!containerElement.canHaveHTML) {\r\n return new DomPosition(containerElement.parentNode, dom.getNodeIndex(containerElement));\r\n }\r\n\r\n var workingNode = dom.getDocument(containerElement).createElement(\"span\");\r\n var comparison, workingComparisonType = isStart ? \"StartToStart\" : \"StartToEnd\";\r\n var previousNode, nextNode, boundaryPosition, boundaryNode;\r\n\r\n // Move the working range through the container's children, starting at the end and working backwards, until the\r\n // working range reaches or goes past the boundary we're interested in\r\n do {\r\n containerElement.insertBefore(workingNode, workingNode.previousSibling);\r\n workingRange.moveToElementText(workingNode);\r\n } while ( (comparison = workingRange.compareEndPoints(workingComparisonType, textRange)) > 0 &&\r\n workingNode.previousSibling);\r\n\r\n // We've now reached or gone past the boundary of the text range we're interested in\r\n // so have identified the node we want\r\n boundaryNode = workingNode.nextSibling;\r\n\r\n if (comparison == -1 && boundaryNode && dom.isCharacterDataNode(boundaryNode)) {\r\n // This is a character data node (text, comment, cdata). The working range is collapsed at the start of the\r\n // node containing the text range's boundary, so we move the end of the working range to the boundary point\r\n // and measure the length of its text to get the boundary's offset within the node.\r\n workingRange.setEndPoint(isStart ? \"EndToStart\" : \"EndToEnd\", textRange);\r\n\r\n\r\n var offset;\r\n\r\n if (/[\\r\\n]/.test(boundaryNode.data)) {\r\n /*\r\n For the particular case of a boundary within a text node containing line breaks (within a <pre> element,\r\n for example), we need a slightly complicated approach to get the boundary's offset in IE. The facts:\r\n\r\n - Each line break is represented as \\r in the text node's data/nodeValue properties\r\n - Each line break is represented as \\r\\n in the TextRange's 'text' property\r\n - The 'text' property of the TextRange does not contain trailing line breaks\r\n\r\n To get round the problem presented by the final fact above, we can use the fact that TextRange's\r\n moveStart() and moveEnd() methods return the actual number of characters moved, which is not necessarily\r\n the same as the number of characters it was instructed to move. The simplest approach is to use this to\r\n store the characters moved when moving both the start and end of the range to the start of the document\r\n body and subtracting the start offset from the end offset (the \"move-negative-gazillion\" method).\r\n However, this is extremely slow when the document is large and the range is near the end of it. Clearly\r\n doing the mirror image (i.e. moving the range boundaries to the end of the document) has the same\r\n problem.\r\n\r\n Another approach that works is to use moveStart() to move the start boundary of the range up to the end\r\n boundary one character at a time and incrementing a counter with the value returned by the moveStart()\r\n call. However, the check for whether the start boundary has reached the end boundary is expensive, so\r\n this method is slow (although unlike \"move-negative-gazillion\" is largely unaffected by the location of\r\n the range within the document).\r\n\r\n The method below is a hybrid of the two methods above. It uses the fact that a string containing the\r\n TextRange's 'text' property with each \\r\\n converted to a single \\r character cannot be longer than the\r\n text of the TextRange, so the start of the range is moved that length initially and then a character at\r\n a time to make up for any trailing line breaks not contained in the 'text' property. This has good\r\n performance in most situations compared to the previous two methods.\r\n */\r\n var tempRange = workingRange.duplicate();\r\n var rangeLength = tempRange.text.replace(/\\r\\n/g, \"\\r\").length;\r\n\r\n offset = tempRange.moveStart(\"character\", rangeLength);\r\n while ( (comparison = tempRange.compareEndPoints(\"StartToEnd\", tempRange)) == -1) {\r\n offset++;\r\n tempRange.moveStart(\"character\", 1);\r\n }\r\n } else {\r\n offset = workingRange.text.length;\r\n }\r\n boundaryPosition = new DomPosition(boundaryNode, offset);\r\n } else {\r\n\r\n\r\n // If the boundary immediately follows a character data node and this is the end boundary, we should favour\r\n // a position within that, and likewise for a start boundary preceding a character data node\r\n previousNode = (isCollapsed || !isStart) && workingNode.previousSibling;\r\n nextNode = (isCollapsed || isStart) && workingNode.nextSibling;\r\n\r\n\r\n\r\n if (nextNode && dom.isCharacterDataNode(nextNode)) {\r\n boundaryPosition = new DomPosition(nextNode, 0);\r\n } else if (previousNode && dom.isCharacterDataNode(previousNode)) {\r\n boundaryPosition = new DomPosition(previousNode, previousNode.length);\r\n } else {\r\n boundaryPosition = new DomPosition(containerElement, dom.getNodeIndex(workingNode));\r\n }\r\n }\r\n\r\n // Clean up\r\n workingNode.parentNode.removeChild(workingNode);\r\n\r\n return boundaryPosition;\r\n }", "title": "" }, { "docid": "0a081f5d3c270a70fefdbaca84df9ad5", "score": "0.51253325", "text": "function getTextRangeBoundaryPosition(textRange, wholeRangeContainerElement, isStart, isCollapsed) {\r\n var workingRange = textRange.duplicate();\r\n\r\n workingRange.collapse(isStart);\r\n var containerElement = workingRange.parentElement();\r\n\r\n // Sometimes collapsing a TextRange that's at the start of a text node can move it into the previous node, so\r\n // check for that\r\n // TODO: Find out when. Workaround for wholeRangeContainerElement may break this\r\n if (!dom.isAncestorOf(wholeRangeContainerElement, containerElement, true)) {\r\n containerElement = wholeRangeContainerElement;\r\n\r\n }\r\n\r\n\r\n\r\n // Deal with nodes that cannot \"contain rich HTML markup\". In practice, this means form inputs, images and\r\n // similar. See http://msdn.microsoft.com/en-us/library/aa703950%28VS.85%29.aspx\r\n if (!containerElement.canHaveHTML) {\r\n return new DomPosition(containerElement.parentNode, dom.getNodeIndex(containerElement));\r\n }\r\n\r\n var workingNode = dom.getDocument(containerElement).createElement(\"span\");\r\n var comparison, workingComparisonType = isStart ? \"StartToStart\" : \"StartToEnd\";\r\n var previousNode, nextNode, boundaryPosition, boundaryNode;\r\n\r\n // Move the working range through the container's children, starting at the end and working backwards, until the\r\n // working range reaches or goes past the boundary we're interested in\r\n do {\r\n containerElement.insertBefore(workingNode, workingNode.previousSibling);\r\n workingRange.moveToElementText(workingNode);\r\n } while ( (comparison = workingRange.compareEndPoints(workingComparisonType, textRange)) > 0 &&\r\n workingNode.previousSibling);\r\n\r\n // We've now reached or gone past the boundary of the text range we're interested in\r\n // so have identified the node we want\r\n boundaryNode = workingNode.nextSibling;\r\n\r\n if (comparison == -1 && boundaryNode && dom.isCharacterDataNode(boundaryNode)) {\r\n // This is a character data node (text, comment, cdata). The working range is collapsed at the start of the\r\n // node containing the text range's boundary, so we move the end of the working range to the boundary point\r\n // and measure the length of its text to get the boundary's offset within the node.\r\n workingRange.setEndPoint(isStart ? \"EndToStart\" : \"EndToEnd\", textRange);\r\n\r\n\r\n var offset;\r\n\r\n if (/[\\r\\n]/.test(boundaryNode.data)) {\r\n /*\r\n For the particular case of a boundary within a text node containing line breaks (within a <pre> element,\r\n for example), we need a slightly complicated approach to get the boundary's offset in IE. The facts:\r\n\r\n - Each line break is represented as \\r in the text node's data/nodeValue properties\r\n - Each line break is represented as \\r\\n in the TextRange's 'text' property\r\n - The 'text' property of the TextRange does not contain trailing line breaks\r\n\r\n To get round the problem presented by the final fact above, we can use the fact that TextRange's\r\n moveStart() and moveEnd() methods return the actual number of characters moved, which is not necessarily\r\n the same as the number of characters it was instructed to move. The simplest approach is to use this to\r\n store the characters moved when moving both the start and end of the range to the start of the document\r\n body and subtracting the start offset from the end offset (the \"move-negative-gazillion\" method).\r\n However, this is extremely slow when the document is large and the range is near the end of it. Clearly\r\n doing the mirror image (i.e. moving the range boundaries to the end of the document) has the same\r\n problem.\r\n\r\n Another approach that works is to use moveStart() to move the start boundary of the range up to the end\r\n boundary one character at a time and incrementing a counter with the value returned by the moveStart()\r\n call. However, the check for whether the start boundary has reached the end boundary is expensive, so\r\n this method is slow (although unlike \"move-negative-gazillion\" is largely unaffected by the location of\r\n the range within the document).\r\n\r\n The method below is a hybrid of the two methods above. It uses the fact that a string containing the\r\n TextRange's 'text' property with each \\r\\n converted to a single \\r character cannot be longer than the\r\n text of the TextRange, so the start of the range is moved that length initially and then a character at\r\n a time to make up for any trailing line breaks not contained in the 'text' property. This has good\r\n performance in most situations compared to the previous two methods.\r\n */\r\n var tempRange = workingRange.duplicate();\r\n var rangeLength = tempRange.text.replace(/\\r\\n/g, \"\\r\").length;\r\n\r\n offset = tempRange.moveStart(\"character\", rangeLength);\r\n while ( (comparison = tempRange.compareEndPoints(\"StartToEnd\", tempRange)) == -1) {\r\n offset++;\r\n tempRange.moveStart(\"character\", 1);\r\n }\r\n } else {\r\n offset = workingRange.text.length;\r\n }\r\n boundaryPosition = new DomPosition(boundaryNode, offset);\r\n } else {\r\n\r\n\r\n // If the boundary immediately follows a character data node and this is the end boundary, we should favour\r\n // a position within that, and likewise for a start boundary preceding a character data node\r\n previousNode = (isCollapsed || !isStart) && workingNode.previousSibling;\r\n nextNode = (isCollapsed || isStart) && workingNode.nextSibling;\r\n\r\n\r\n\r\n if (nextNode && dom.isCharacterDataNode(nextNode)) {\r\n boundaryPosition = new DomPosition(nextNode, 0);\r\n } else if (previousNode && dom.isCharacterDataNode(previousNode)) {\r\n boundaryPosition = new DomPosition(previousNode, previousNode.length);\r\n } else {\r\n boundaryPosition = new DomPosition(containerElement, dom.getNodeIndex(workingNode));\r\n }\r\n }\r\n\r\n // Clean up\r\n workingNode.parentNode.removeChild(workingNode);\r\n\r\n return boundaryPosition;\r\n }", "title": "" }, { "docid": "b73304079a9a6c40849471585d850349", "score": "0.5123996", "text": "function getEntityKeyForSelection(contentState, targetSelection) {\n var entityKey;\n\n if (targetSelection.isCollapsed()) {\n var key = targetSelection.getAnchorKey();\n var offset = targetSelection.getAnchorOffset();\n if (offset > 0) {\n entityKey = contentState.getBlockForKey(key).getEntityAt(offset - 1);\n return filterKey(contentState.getEntityMap(), entityKey);\n }\n return null;\n }\n\n var startKey = targetSelection.getStartKey();\n var startOffset = targetSelection.getStartOffset();\n var startBlock = contentState.getBlockForKey(startKey);\n\n entityKey = startOffset === startBlock.getLength() ? null : startBlock.getEntityAt(startOffset);\n\n return filterKey(contentState.getEntityMap(), entityKey);\n}", "title": "" }, { "docid": "b73304079a9a6c40849471585d850349", "score": "0.5123996", "text": "function getEntityKeyForSelection(contentState, targetSelection) {\n var entityKey;\n\n if (targetSelection.isCollapsed()) {\n var key = targetSelection.getAnchorKey();\n var offset = targetSelection.getAnchorOffset();\n if (offset > 0) {\n entityKey = contentState.getBlockForKey(key).getEntityAt(offset - 1);\n return filterKey(contentState.getEntityMap(), entityKey);\n }\n return null;\n }\n\n var startKey = targetSelection.getStartKey();\n var startOffset = targetSelection.getStartOffset();\n var startBlock = contentState.getBlockForKey(startKey);\n\n entityKey = startOffset === startBlock.getLength() ? null : startBlock.getEntityAt(startOffset);\n\n return filterKey(contentState.getEntityMap(), entityKey);\n}", "title": "" }, { "docid": "b73304079a9a6c40849471585d850349", "score": "0.5123996", "text": "function getEntityKeyForSelection(contentState, targetSelection) {\n var entityKey;\n\n if (targetSelection.isCollapsed()) {\n var key = targetSelection.getAnchorKey();\n var offset = targetSelection.getAnchorOffset();\n if (offset > 0) {\n entityKey = contentState.getBlockForKey(key).getEntityAt(offset - 1);\n return filterKey(contentState.getEntityMap(), entityKey);\n }\n return null;\n }\n\n var startKey = targetSelection.getStartKey();\n var startOffset = targetSelection.getStartOffset();\n var startBlock = contentState.getBlockForKey(startKey);\n\n entityKey = startOffset === startBlock.getLength() ? null : startBlock.getEntityAt(startOffset);\n\n return filterKey(contentState.getEntityMap(), entityKey);\n}", "title": "" }, { "docid": "3fe53c3cc01c25132609abfe2de877cc", "score": "0.51173407", "text": "function getItemsAtRange(opts, value, range) {\n range = range || value.selection;\n\n if (!range.startKey) {\n return (0, _immutable.List)();\n }\n\n var document = value.document;\n\n\n var startBlock = document.getClosestBlock(range.startKey);\n var endBlock = document.getClosestBlock(range.endKey);\n\n if (startBlock === endBlock) {\n var item = (0, _getCurrentItem2.default)(opts, value, startBlock);\n return item ? (0, _immutable.List)([item]) : (0, _immutable.List)();\n }\n\n var ancestor = document.getCommonAncestor(startBlock.key, endBlock.key);\n\n if ((0, _isList2.default)(opts, ancestor)) {\n var startPath = ancestor.getPath(startBlock.key);\n var endPath = ancestor.getPath(endBlock.key);\n\n return ancestor.nodes.slice(startPath[0], endPath[0] + 1);\n } else if (ancestor.type === opts.typeItem) {\n // The ancestor is the highest list item that covers the range\n return (0, _immutable.List)([ancestor]);\n }\n // No list of items can cover the range\n return (0, _immutable.List)();\n}", "title": "" }, { "docid": "e1bdf4b8a4ed6bdb1ef3bf790bce68d6", "score": "0.50899017", "text": "iterRange(from, to = this.length) { return new PartialTextCursor(this, from, to); }", "title": "" }, { "docid": "e1bdf4b8a4ed6bdb1ef3bf790bce68d6", "score": "0.50899017", "text": "iterRange(from, to = this.length) { return new PartialTextCursor(this, from, to); }", "title": "" }, { "docid": "a4b6635a19ee005dcf1097dc0a631dcb", "score": "0.5086627", "text": "nativeRange() {\n if (env.isW3CRangeSupport) {\n const w3cRange = document.createRange();\n w3cRange.setStart(this.sc, this.so);\n w3cRange.setEnd(this.ec, this.eo);\n\n return w3cRange;\n } else {\n const textRange = pointToTextRange({\n node: this.sc,\n offset: this.so,\n });\n\n textRange.setEndPoint('EndToEnd', pointToTextRange({\n node: this.ec,\n offset: this.eo,\n }));\n\n return textRange;\n }\n }", "title": "" }, { "docid": "f477dc9068685f1defd806a18f8a5a0a", "score": "0.50749016", "text": "function getEntityKeyForSelection(contentState, targetSelection) {\n var entityKey;\n\n if (targetSelection.isCollapsed()) {\n var key = targetSelection.getAnchorKey();\n var offset = targetSelection.getAnchorOffset();\n if (offset > 0) {\n entityKey = contentState.getBlockForKey(key).getEntityAt(offset - 1);\n if (entityKey !== contentState.getBlockForKey(key).getEntityAt(offset)) {\n return null;\n }\n return filterKey(contentState.getEntityMap(), entityKey);\n }\n return null;\n }\n\n var startKey = targetSelection.getStartKey();\n var startOffset = targetSelection.getStartOffset();\n var startBlock = contentState.getBlockForKey(startKey);\n\n entityKey = startOffset === startBlock.getLength() ? null : startBlock.getEntityAt(startOffset);\n\n return filterKey(contentState.getEntityMap(), entityKey);\n}", "title": "" }, { "docid": "f477dc9068685f1defd806a18f8a5a0a", "score": "0.50749016", "text": "function getEntityKeyForSelection(contentState, targetSelection) {\n var entityKey;\n\n if (targetSelection.isCollapsed()) {\n var key = targetSelection.getAnchorKey();\n var offset = targetSelection.getAnchorOffset();\n if (offset > 0) {\n entityKey = contentState.getBlockForKey(key).getEntityAt(offset - 1);\n if (entityKey !== contentState.getBlockForKey(key).getEntityAt(offset)) {\n return null;\n }\n return filterKey(contentState.getEntityMap(), entityKey);\n }\n return null;\n }\n\n var startKey = targetSelection.getStartKey();\n var startOffset = targetSelection.getStartOffset();\n var startBlock = contentState.getBlockForKey(startKey);\n\n entityKey = startOffset === startBlock.getLength() ? null : startBlock.getEntityAt(startOffset);\n\n return filterKey(contentState.getEntityMap(), entityKey);\n}", "title": "" }, { "docid": "f477dc9068685f1defd806a18f8a5a0a", "score": "0.50749016", "text": "function getEntityKeyForSelection(contentState, targetSelection) {\n var entityKey;\n\n if (targetSelection.isCollapsed()) {\n var key = targetSelection.getAnchorKey();\n var offset = targetSelection.getAnchorOffset();\n if (offset > 0) {\n entityKey = contentState.getBlockForKey(key).getEntityAt(offset - 1);\n if (entityKey !== contentState.getBlockForKey(key).getEntityAt(offset)) {\n return null;\n }\n return filterKey(contentState.getEntityMap(), entityKey);\n }\n return null;\n }\n\n var startKey = targetSelection.getStartKey();\n var startOffset = targetSelection.getStartOffset();\n var startBlock = contentState.getBlockForKey(startKey);\n\n entityKey = startOffset === startBlock.getLength() ? null : startBlock.getEntityAt(startOffset);\n\n return filterKey(contentState.getEntityMap(), entityKey);\n}", "title": "" }, { "docid": "f477dc9068685f1defd806a18f8a5a0a", "score": "0.50749016", "text": "function getEntityKeyForSelection(contentState, targetSelection) {\n var entityKey;\n\n if (targetSelection.isCollapsed()) {\n var key = targetSelection.getAnchorKey();\n var offset = targetSelection.getAnchorOffset();\n if (offset > 0) {\n entityKey = contentState.getBlockForKey(key).getEntityAt(offset - 1);\n if (entityKey !== contentState.getBlockForKey(key).getEntityAt(offset)) {\n return null;\n }\n return filterKey(contentState.getEntityMap(), entityKey);\n }\n return null;\n }\n\n var startKey = targetSelection.getStartKey();\n var startOffset = targetSelection.getStartOffset();\n var startBlock = contentState.getBlockForKey(startKey);\n\n entityKey = startOffset === startBlock.getLength() ? null : startBlock.getEntityAt(startOffset);\n\n return filterKey(contentState.getEntityMap(), entityKey);\n}", "title": "" }, { "docid": "f477dc9068685f1defd806a18f8a5a0a", "score": "0.50749016", "text": "function getEntityKeyForSelection(contentState, targetSelection) {\n var entityKey;\n\n if (targetSelection.isCollapsed()) {\n var key = targetSelection.getAnchorKey();\n var offset = targetSelection.getAnchorOffset();\n if (offset > 0) {\n entityKey = contentState.getBlockForKey(key).getEntityAt(offset - 1);\n if (entityKey !== contentState.getBlockForKey(key).getEntityAt(offset)) {\n return null;\n }\n return filterKey(contentState.getEntityMap(), entityKey);\n }\n return null;\n }\n\n var startKey = targetSelection.getStartKey();\n var startOffset = targetSelection.getStartOffset();\n var startBlock = contentState.getBlockForKey(startKey);\n\n entityKey = startOffset === startBlock.getLength() ? null : startBlock.getEntityAt(startOffset);\n\n return filterKey(contentState.getEntityMap(), entityKey);\n}", "title": "" }, { "docid": "f477dc9068685f1defd806a18f8a5a0a", "score": "0.50749016", "text": "function getEntityKeyForSelection(contentState, targetSelection) {\n var entityKey;\n\n if (targetSelection.isCollapsed()) {\n var key = targetSelection.getAnchorKey();\n var offset = targetSelection.getAnchorOffset();\n if (offset > 0) {\n entityKey = contentState.getBlockForKey(key).getEntityAt(offset - 1);\n if (entityKey !== contentState.getBlockForKey(key).getEntityAt(offset)) {\n return null;\n }\n return filterKey(contentState.getEntityMap(), entityKey);\n }\n return null;\n }\n\n var startKey = targetSelection.getStartKey();\n var startOffset = targetSelection.getStartOffset();\n var startBlock = contentState.getBlockForKey(startKey);\n\n entityKey = startOffset === startBlock.getLength() ? null : startBlock.getEntityAt(startOffset);\n\n return filterKey(contentState.getEntityMap(), entityKey);\n}", "title": "" }, { "docid": "f477dc9068685f1defd806a18f8a5a0a", "score": "0.50749016", "text": "function getEntityKeyForSelection(contentState, targetSelection) {\n var entityKey;\n\n if (targetSelection.isCollapsed()) {\n var key = targetSelection.getAnchorKey();\n var offset = targetSelection.getAnchorOffset();\n if (offset > 0) {\n entityKey = contentState.getBlockForKey(key).getEntityAt(offset - 1);\n if (entityKey !== contentState.getBlockForKey(key).getEntityAt(offset)) {\n return null;\n }\n return filterKey(contentState.getEntityMap(), entityKey);\n }\n return null;\n }\n\n var startKey = targetSelection.getStartKey();\n var startOffset = targetSelection.getStartOffset();\n var startBlock = contentState.getBlockForKey(startKey);\n\n entityKey = startOffset === startBlock.getLength() ? null : startBlock.getEntityAt(startOffset);\n\n return filterKey(contentState.getEntityMap(), entityKey);\n}", "title": "" }, { "docid": "78948f815e592445283fe1ac3f3d23a6", "score": "0.5048784", "text": "function getCharacterRemovalRange(entityMap,startBlock,endBlock,selectionState,direction){var start=selectionState.getStartOffset(),end=selectionState.getEndOffset(),startEntityKey=startBlock.getEntityAt(start),endEntityKey=endBlock.getEntityAt(end-1);if(!startEntityKey&&!endEntityKey)return selectionState;var newSelectionState=selectionState;if(startEntityKey&&startEntityKey===endEntityKey)newSelectionState=getEntityRemovalRange(entityMap,startBlock,newSelectionState,direction,startEntityKey,!0,!0);else if(startEntityKey&&endEntityKey){var startSelectionState=getEntityRemovalRange(entityMap,startBlock,newSelectionState,direction,startEntityKey,!1,!0),endSelectionState=getEntityRemovalRange(entityMap,endBlock,newSelectionState,direction,endEntityKey,!1,!1);newSelectionState=newSelectionState.merge({anchorOffset:startSelectionState.getAnchorOffset(),focusOffset:endSelectionState.getFocusOffset(),isBackward:!1});}else if(startEntityKey){var _startSelectionState=getEntityRemovalRange(entityMap,startBlock,newSelectionState,direction,startEntityKey,!1,!0);newSelectionState=newSelectionState.merge({anchorOffset:_startSelectionState.getStartOffset(),isBackward:!1});}else if(endEntityKey){var _endSelectionState=getEntityRemovalRange(entityMap,endBlock,newSelectionState,direction,endEntityKey,!1,!1);newSelectionState=newSelectionState.merge({focusOffset:_endSelectionState.getEndOffset(),isBackward:!1});}return newSelectionState;}", "title": "" }, { "docid": "be1904b0185c655ffe971025e66e646a", "score": "0.5042924", "text": "function findPrevInRange(query, doc, from, to) {\n for (let pos = to;;) {\n let start = Math.max(from, pos - FindPrevChunkSize - query.search.length);\n let cursor = query.cursor(doc, start, pos), range = null;\n while (!cursor.next().done)\n range = cursor.value;\n if (range)\n return range;\n if (start == from)\n return null;\n pos -= FindPrevChunkSize;\n }\n }", "title": "" }, { "docid": "f636040161519ac2ca4638799f7ae1a8", "score": "0.5035212", "text": "function _getCaretRange(range, dir, editorId, cbf) {\n let found = false;\n // check startContainer\n if (range.startContainer) {\n let ele;\n if (dir === 'start') {\n ele = range.startContainer;\n } else {\n ele = range.endContainer;\n }\n _getCaretRange(ele, dir, editorId, result => {\n result.push(ele.length - range.endOffset);\n cbf(result);\n });\n } else {\n if (range.parentNode.id === editorId) {\n let result = []\n for (let i = 0; i < range.parentNode.childNodes.length; i++) {\n if (range.parentNode.childNodes[i].isEqualNode(range)) {\n result.push(range.parentNode.childNodes.length - i);\n found = true;\n break;\n }\n }\n console.assert(found, 'Node under main editor is not found!');\n cbf(result);\n } else {\n _getCaretRange(range.parentNode, dir, editorId, result => {\n for (let i = 0; i < range.parentNode.childNodes.length; i++) {\n if (range.parentNode.childNodes[i].isEqualNode(range)) {\n result.push(range.parentNode.childNodes.length - i);\n found = true;\n break;\n }\n }\n console.assert(found, 'A node', range, 'is not found!');\n cbf(result);\n });\n }\n }\n}", "title": "" }, { "docid": "f431824aca3e1c939cf3c4f38eb2e622", "score": "0.5028767", "text": "function encodeEntityRanges(block, storageMap) {\n\t var encoded = [];\n\t block.findEntityRanges(function (character) {\n\t return !!character.getEntity();\n\t }, function ( /*number*/start, /*number*/end) {\n\t var text = block.getText();\n\t var key = block.getEntityAt(start);\n\t encoded.push({\n\t offset: strlen(text.slice(0, start)),\n\t length: strlen(text.slice(start, end)),\n\t // Encode the key as a number for range storage.\n\t key: Number(storageMap[DraftStringKey.stringify(key)])\n\t });\n\t });\n\t return encoded;\n\t}", "title": "" }, { "docid": "f431824aca3e1c939cf3c4f38eb2e622", "score": "0.5028767", "text": "function encodeEntityRanges(block, storageMap) {\n\t var encoded = [];\n\t block.findEntityRanges(function (character) {\n\t return !!character.getEntity();\n\t }, function ( /*number*/start, /*number*/end) {\n\t var text = block.getText();\n\t var key = block.getEntityAt(start);\n\t encoded.push({\n\t offset: strlen(text.slice(0, start)),\n\t length: strlen(text.slice(start, end)),\n\t // Encode the key as a number for range storage.\n\t key: Number(storageMap[DraftStringKey.stringify(key)])\n\t });\n\t });\n\t return encoded;\n\t}", "title": "" }, { "docid": "452c4d6ea71e2e8c01b5dbd230b92e0a", "score": "0.5025805", "text": "getVisibleRangesForRange(startColumn, endColumn, context) {\n if (!this.domNode) {\n return null;\n }\n if (this._pixelOffsetCache !== null) {\n // the text is LTR\n const startOffset = this._readPixelOffset(this.domNode, startColumn, context);\n if (startOffset === -1) {\n return null;\n }\n const endOffset = this._readPixelOffset(this.domNode, endColumn, context);\n if (endOffset === -1) {\n return null;\n }\n return [new renderingContext_1.HorizontalRange(startOffset, endOffset - startOffset)];\n }\n return this._readVisibleRangesForRange(this.domNode, startColumn, endColumn, context);\n }", "title": "" }, { "docid": "401617b413f0e164f1c78937b764a9c3", "score": "0.50215405", "text": "function findPrevInRange(query, doc, from, to) {\n for (let pos = to;;) {\n let start = Math.max(from, pos - FindPrevChunkSize - query.search.length);\n let cursor = query.cursor(doc, start, pos), range = null;\n while (!cursor.next().done)\n range = cursor.value;\n if (range)\n return range;\n if (start == from)\n return null;\n pos -= FindPrevChunkSize;\n }\n}", "title": "" }, { "docid": "d4b31ebe570d3b93e0324335fb35f00f", "score": "0.50171435", "text": "function decodeEntityRanges(\n text: string,\n ranges: Array<EntityRange>,\n): Array<?string> {\n const entities = Array(text.length).fill(null);\n if (ranges) {\n ranges.forEach(range => {\n // Using Unicode-enabled substrings converted to JavaScript lengths,\n // fill the output array with entity keys.\n const start = substr(text, 0, range.offset).length;\n const end = start + substr(text, range.offset, range.length).length;\n for (let ii = start; ii < end; ii++) {\n entities[ii] = range.key;\n }\n });\n }\n return entities;\n}", "title": "" }, { "docid": "ed39c19c8414048274bbe2398cd015c2", "score": "0.5009866", "text": "function encodeEntityRanges(block, storageMap) {\n var encoded = [];\n block.findEntityRanges(function (character) {\n return !!character.getEntity();\n }, function ( /*number*/start, /*number*/end) {\n var text = block.getText();\n var key = block.getEntityAt(start);\n encoded.push({\n offset: strlen(text.slice(0, start)),\n length: strlen(text.slice(start, end)),\n // Encode the key as a number for range storage.\n key: Number(storageMap[DraftStringKey.stringify(key)])\n });\n });\n return encoded;\n}", "title": "" }, { "docid": "ed39c19c8414048274bbe2398cd015c2", "score": "0.5009866", "text": "function encodeEntityRanges(block, storageMap) {\n var encoded = [];\n block.findEntityRanges(function (character) {\n return !!character.getEntity();\n }, function ( /*number*/start, /*number*/end) {\n var text = block.getText();\n var key = block.getEntityAt(start);\n encoded.push({\n offset: strlen(text.slice(0, start)),\n length: strlen(text.slice(start, end)),\n // Encode the key as a number for range storage.\n key: Number(storageMap[DraftStringKey.stringify(key)])\n });\n });\n return encoded;\n}", "title": "" }, { "docid": "ed39c19c8414048274bbe2398cd015c2", "score": "0.5009866", "text": "function encodeEntityRanges(block, storageMap) {\n var encoded = [];\n block.findEntityRanges(function (character) {\n return !!character.getEntity();\n }, function ( /*number*/start, /*number*/end) {\n var text = block.getText();\n var key = block.getEntityAt(start);\n encoded.push({\n offset: strlen(text.slice(0, start)),\n length: strlen(text.slice(start, end)),\n // Encode the key as a number for range storage.\n key: Number(storageMap[DraftStringKey.stringify(key)])\n });\n });\n return encoded;\n}", "title": "" }, { "docid": "ed39c19c8414048274bbe2398cd015c2", "score": "0.5009866", "text": "function encodeEntityRanges(block, storageMap) {\n var encoded = [];\n block.findEntityRanges(function (character) {\n return !!character.getEntity();\n }, function ( /*number*/start, /*number*/end) {\n var text = block.getText();\n var key = block.getEntityAt(start);\n encoded.push({\n offset: strlen(text.slice(0, start)),\n length: strlen(text.slice(start, end)),\n // Encode the key as a number for range storage.\n key: Number(storageMap[DraftStringKey.stringify(key)])\n });\n });\n return encoded;\n}", "title": "" }, { "docid": "ed39c19c8414048274bbe2398cd015c2", "score": "0.5009866", "text": "function encodeEntityRanges(block, storageMap) {\n var encoded = [];\n block.findEntityRanges(function (character) {\n return !!character.getEntity();\n }, function ( /*number*/start, /*number*/end) {\n var text = block.getText();\n var key = block.getEntityAt(start);\n encoded.push({\n offset: strlen(text.slice(0, start)),\n length: strlen(text.slice(start, end)),\n // Encode the key as a number for range storage.\n key: Number(storageMap[DraftStringKey.stringify(key)])\n });\n });\n return encoded;\n}", "title": "" }, { "docid": "ed39c19c8414048274bbe2398cd015c2", "score": "0.5009866", "text": "function encodeEntityRanges(block, storageMap) {\n var encoded = [];\n block.findEntityRanges(function (character) {\n return !!character.getEntity();\n }, function ( /*number*/start, /*number*/end) {\n var text = block.getText();\n var key = block.getEntityAt(start);\n encoded.push({\n offset: strlen(text.slice(0, start)),\n length: strlen(text.slice(start, end)),\n // Encode the key as a number for range storage.\n key: Number(storageMap[DraftStringKey.stringify(key)])\n });\n });\n return encoded;\n}", "title": "" }, { "docid": "ed39c19c8414048274bbe2398cd015c2", "score": "0.5009866", "text": "function encodeEntityRanges(block, storageMap) {\n var encoded = [];\n block.findEntityRanges(function (character) {\n return !!character.getEntity();\n }, function ( /*number*/start, /*number*/end) {\n var text = block.getText();\n var key = block.getEntityAt(start);\n encoded.push({\n offset: strlen(text.slice(0, start)),\n length: strlen(text.slice(start, end)),\n // Encode the key as a number for range storage.\n key: Number(storageMap[DraftStringKey.stringify(key)])\n });\n });\n return encoded;\n}", "title": "" }, { "docid": "ed39c19c8414048274bbe2398cd015c2", "score": "0.5009866", "text": "function encodeEntityRanges(block, storageMap) {\n var encoded = [];\n block.findEntityRanges(function (character) {\n return !!character.getEntity();\n }, function ( /*number*/start, /*number*/end) {\n var text = block.getText();\n var key = block.getEntityAt(start);\n encoded.push({\n offset: strlen(text.slice(0, start)),\n length: strlen(text.slice(start, end)),\n // Encode the key as a number for range storage.\n key: Number(storageMap[DraftStringKey.stringify(key)])\n });\n });\n return encoded;\n}", "title": "" }, { "docid": "ed39c19c8414048274bbe2398cd015c2", "score": "0.5009866", "text": "function encodeEntityRanges(block, storageMap) {\n var encoded = [];\n block.findEntityRanges(function (character) {\n return !!character.getEntity();\n }, function ( /*number*/start, /*number*/end) {\n var text = block.getText();\n var key = block.getEntityAt(start);\n encoded.push({\n offset: strlen(text.slice(0, start)),\n length: strlen(text.slice(start, end)),\n // Encode the key as a number for range storage.\n key: Number(storageMap[DraftStringKey.stringify(key)])\n });\n });\n return encoded;\n}", "title": "" }, { "docid": "ed39c19c8414048274bbe2398cd015c2", "score": "0.5009866", "text": "function encodeEntityRanges(block, storageMap) {\n var encoded = [];\n block.findEntityRanges(function (character) {\n return !!character.getEntity();\n }, function ( /*number*/start, /*number*/end) {\n var text = block.getText();\n var key = block.getEntityAt(start);\n encoded.push({\n offset: strlen(text.slice(0, start)),\n length: strlen(text.slice(start, end)),\n // Encode the key as a number for range storage.\n key: Number(storageMap[DraftStringKey.stringify(key)])\n });\n });\n return encoded;\n}", "title": "" }, { "docid": "ece74a984920c9941405da2658a848f4", "score": "0.5003888", "text": "getRangeStart() {\n return ChromeVoxState.instance.getCurrentRange().start.node;\n }", "title": "" }, { "docid": "26504b1304e037686a3a3789ca416827", "score": "0.49716887", "text": "iterRange(from, to = this.length) {\n return new PartialTextCursor(this, from, to)\n }", "title": "" }, { "docid": "7159826fd1a83b2f969ae40f716112ad", "score": "0.495308", "text": "function getTextRangeContainerElement(textRange) {\r\n var parentEl = textRange.parentElement();\r\n\r\n var range = textRange.duplicate();\r\n var bookmark = range.getBookmark();\r\n range.collapse(true);\r\n var startEl = range.parentElement();\r\n\r\n range.moveToBookmark(bookmark);\r\n range.collapse(false);\r\n var endEl = range.parentElement();\r\n var startEndContainer = (startEl == endEl) ? startEl : dom.getCommonAncestor(startEl, endEl);\r\n\r\n return startEndContainer == parentEl ? startEndContainer : dom.getCommonAncestor(parentEl, startEndContainer);\r\n }", "title": "" } ]
39f226a7829b6f8ad2f0a11f2eaf6470
end updateSensorsLayer function begin filterHWMs function
[ { "docid": "46f19d0bd3d0db9c33f9e73911850e2b", "score": "0.7185393", "text": "function filterHWMs(){\n\t\tconsole.log(\"filterSensors function fired\");\n\n\t\tfilterDefinition.length = 0;\n\t\t\n\t\tif (!(registry.byId(\"hwmEventSelectInput\").value == \" All\" || registry.byId(\"hwmEventSelectInput\").value === \"\")) {\n\t\t\tfilterDefinition.push(\"EVENT_NAME LIKE '\" + registry.byId(\"hwmEventSelectInput\").value + \"'\");\n\t\t} else {\n\t\t\tfilterDefinition.push(\"EVENT_NAME LIKE '%'\");\n\t\t}\n\n\t\tif (!(registry.byId(\"hwmStateSelectInput\").value == \" All\" || registry.byId(\"hwmStateSelectInput\").value === \"\")) {\n\t\t\tfilterDefinition.push(\"STATE LIKE '\" + registry.byId(\"hwmStateSelectInput\").value + \"'\");\n\t\t} else {\n\t\t\tfilterDefinition.push(\"STATE LIKE '%'\");\n\t\t}\n\n\t\tif (!(registry.byId(\"hwmCountySelectInput\").value == \" All\" || registry.byId(\"hwmCountySelectInput\").value === \"\")) {\n\t\t\tfilterDefinition.push(\"COUNTY LIKE '\" + registry.byId(\"hwmCountySelectInput\").value + \"'\");\n\t\t} else {\n\t\t\tfilterDefinition.push(\"COUNTY LIKE '%'\");\n\t\t}\n\n\t\tfilterDefinition = ['((' + filterDefinition.join(\") AND (\") + '))'];\n\n\t\tconsole.log (filterDefinition[0]);\n\n\t\tconsole.log(\"filter definition updated\");\n\t}", "title": "" } ]
[ { "docid": "633235d0eeca0014a243f27e3809cf65", "score": "0.641355", "text": "function updateSensorsLayer(){\n\n\t\tvar fromDateObject, toDateObject;\n\t\t\n\t\tlayerDefinitions.length = 0;\n\n\t\t//for unknown stupid reason, date fields must come first in the layerDef expression. \n\t\tif (!(registry.byId(\"fromDate\").displayedValue === \"\")) {\n\n\t\t\tfromDateObject = registry.byId(\"fromDate\").value;\n\t\t\tvar fromDateISO = locale.format(fromDateObject, {datePattern: \"yyyy-MM-dd\", selector: \"date\"});\n\n\t\t\tfilterDefinition.push(\"EVENT_START_DATE >= date '\" + fromDateISO + \"'\");\n\t\t} else {\n\t\t\tfilterDefinition.push(\"EVENT_START_DATE LIKE '%'\");\n\t\t}\n\t\t\n\t\tif (!(registry.byId(\"toDate\").displayedValue === \"\")) {\n\n\t\t\ttoDateObject = registry.byId(\"toDate\").value;\n\t\t\tvar toDateISO = locale.format(toDateObject, {datePattern: \"yyyy-MM-dd\", selector: \"date\"});\n\n\t\t\tfilterDefinition.push(\"EVENT_END_DATE <= date '\" + toDateISO + \"'\");\n\t\t} else {\n\t\t\tfilterDefinition.push(\"EVENT_END_DATE LIKE '%'\");\n\t\t}\n\n\t\tif (!(registry.byId(\"eventSelectInput\").value == \" All\" || registry.byId(\"eventSelectInput\").value === \"\")) {\n\t\t\tfilterDefinition.push(\"EVENT_NAME LIKE '\" + registry.byId(\"eventSelectInput\").value + \"'\");\n\t\t} else {\n\t\t\tfilterDefinition.push(\"EVENT_NAME LIKE '%'\");\n\t\t}\n\n\t\tif (!(registry.byId(\"stateSelectInput\").value == \" All\" || registry.byId(\"stateSelectInput\").value === \"\")) {\n\t\t\tfilterDefinition.push(\"STATE LIKE '\" + registry.byId(\"stateSelectInput\").value + \"'\");\n\t\t} else {\n\t\t\tfilterDefinition.push(\"STATE LIKE '%'\");\n\t\t}\n\n\t\tif (!(registry.byId(\"countySelectInput\").value == \" All\" || registry.byId(\"countySelectInput\").value === \"\")) {\n\t\t\tfilterDefinition.push(\"COUNTY LIKE '\" + registry.byId(\"countySelectInput\").value + \"'\");\n\t\t} else {\n\t\t\tfilterDefinition.push(\"COUNTY LIKE '%'\");\n\t\t}\n\n\t\tif (!(registry.byId(\"deploymentSelectInput\").value == \" All\" || registry.byId(\"deploymentSelectInput\").value === \"\")) {\n\t\t\tfilterDefinition.push(\"METHOD LIKE '\" + registry.byId(\"deploymentSelectInput\").value + \"'\");\n\t\t} else {\n\t\t\tfilterDefinition.push(\"METHOD LIKE '%'\");\n\t\t}\n\n\t\tif (!(registry.byId(\"sensorSelectInput\").value == \" All\" || registry.byId(\"sensorSelectInput\").value === \"\")) {\n\t\t\tfilterDefinition.push(\"SENSOR LIKE '\" + registry.byId(\"sensorSelectInput\").value + \"'\");\n\t\t} else {\n\t\t\tfilterDefinition.push(\"SENSOR LIKE '%'\");\n\t\t}\n\n\t\tif (!(registry.byId(\"statusSelectInput\").value == \" All\" || registry.byId(\"statusSelectInput\").value === \"\")) {\n\t\t\tfilterDefinition.push(\"STATUS LIKE '\" + registry.byId(\"statusSelectInput\").value + \"'\");\n\t\t} else {\n\t\t\tfilterDefinition.push(\"STATUS LIKE '%'\");\n\t\t}\n\t\t\n\t\t/*if (filterDefinition.length == 0)\n\t\t{\n\t\t\tfilterDefinition = ['']; \n\t\t} else {\n\t\t\tfilterDefinition = ['((' + filterDefinition.join(\") AND (\") + '))'];\n\t\t}*/\n\t\t\n\t\tfilterDefinition = ['((' + filterDefinition.join(\") AND (\") + '))'];\n\n\t\tconsole.log(filterDefinition[0]);\n\t\tconsole.log(\"layer definition updated\");\n\t\t\n\t}", "title": "" }, { "docid": "9748203d8fa540993fabfce838932bf0", "score": "0.5970792", "text": "function filterMmsis() {\n\t\n\tif ( (camera._mode === Cesium.SceneMode.SCENE3D && cartographic.height < zoom_level_globe) || (camera._mode === Cesium.SceneMode.SCENE2D && flat_map_view < zoom_level_flat) || (camera._mode === Cesium.SceneMode.COLUMBUS_VIEW && flat_map_view < zoom_level_flat/2.0)) {\n\t\tdrawHeatmaps(false);\n\t} else {\n\t\tneed_to_redraw = true;\n\t}\n\t\n\tcameraHasMoved();\n}", "title": "" }, { "docid": "aa8346fd04c4aa2203b4169d5c6e628c", "score": "0.59534", "text": "function MNDWIBIN (){\n applyfilter();\n var MNimage = Fimageyr1.expression(\n \"MNDWI >= thresh2\", {\n 'MNDWI': Fimageyr1.select('MNDWI').clip(geometry),\n 'thresh2' : MNDWIslider.getValue()});//Slider bar input\n\n var MNDWIMimage = MNimage.updateMask(MNimage.gt(0)); //Mask 0 values\n Map.centerObject(geometry); //Center on AOI\n Map.addLayer(MNDWIMimage, WATER, 'MNDWI Landsat Binary Map(' + yr1 + ')');\n}", "title": "" }, { "docid": "23fff9fe8f549c4b95cb52b6c9272349", "score": "0.59443706", "text": "function SNDWIBIN (){\n applyfilter();\n var SMNimage = s2Imageyr4.expression(\n \"NDWI >= thresh5\", {\n 'NDWI': s2Imageyr4.select('NDWI').clip(geometry),\n 'thresh5': SNDWIslider.getValue()}); //Slider bar input\n\n var NDWIMimage = SMNimage.updateMask(SMNimage.gt(0)); //Mask 0 values\n Map.centerObject(geometry); //Center on AOI\n Map.addLayer(NDWIMimage, WATER, 'NDWI Sentinel-2 Binary Map(' + yr4 + ')');\n}", "title": "" }, { "docid": "e0952e6f948f8a67985cd5558bec1d7e", "score": "0.5943396", "text": "function SWETTER() {\n applyfilter();\n var date1 = s2Imageyr5.select('NDWI'); //Select NDWI Values for Start Year\n var date2 = s2Imageyr6.select('NDWI'); //Select NDWI VAlues for End Year\n var diff = date2.subtract(date1); //Subtract rasters to get maginitude of change\n var trend = date2.gt(date1); //Creates a binary where pixels that got closer to 1, are 1\n var final = trend.multiply(diff).clip(geometry); //Shows magnitude for more wet trend\n\n Map.centerObject(geometry); // Center on AOI\n Map.addLayer(final, MW, 'Areas that have become more wet(' + yr5 + ')-(' + yr6 + ')');\n Map.addLayer(date1, visMNDWI, 'NDWI(' + yr5 + ')', false); //Creates a layer with the Indice in the Start Year\n Map.addLayer(date2, visMNDWI, 'NDWI(' + yr6 + ')', false); //Creates a layer with the Indice in the End Year\n}", "title": "" }, { "docid": "ada28c4317f86ca06ed11244a6f7a89c", "score": "0.59429735", "text": "function style_sensor_based_on_filter(feature,layer){\n\t\n\t\t//$( document ).ajaxStop(function() { //must use ajax stop, as it has to wait for the spatial select result to pass back\n\t\n\t$( document ).ajaxComplete(function(event, xhr, settings) {\n\tif (settings.url== 'assets/php/spatial_query_control.php') {\n\t\t\n\tif(typeof(window[\"wb_clip_feature\"])!=\"undefined\"){\n\t\t\n\t\thigh_light_clip_sensor(feature,layer,window[\"wb_clip_feature\"][\"state_sensor\"]);\n\t}else{\n\t\t\n\t\thigh_light_clip_sensor(feature,layer,[]);\n\t}\n\t\t}});//end of ajax text\n\t\t//});\n\tfunction high_light_clip_sensor(feature,layer,intersect_feature_array){\n\t\n\t\tif(intersect_feature_array.length!=0){\n\t\t\t\tif(intersect_feature_array.indexOf(feature.properties.site_code)!=-1){\n\t\t\t\t\tlayer.setStyle(Sensor_layer_styles[\"in\"]);\n\t\t\t\t\tfeature.properties.default_feature=\"in\";\n\t\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\tlayer.setStyle(Sensor_layer_styles[\"out\"]);\n\t\t\t\t\tfeature.properties.default_feature=\"out\";\n\t\t\t\t}\n\t\t\t\n\t\t}else{ \n\t\t\tlayer.setStyle(Sensor_layer_styles[\"generic\"]);\n\t\t\tfeature.properties.default_feature=\"generic\";\n\t\t}\n\t\tlayer.setStyle({fill:false,\n\t\t\tstroke:false,});\n\t\n\t}\n}", "title": "" }, { "docid": "e63122c965bd3e073dc384bf687fed1d", "score": "0.59143883", "text": "function WETTER() {\n applyfilter();\n var date1 = Fimageyr2.select('MNDWI'); //Select MNDWI Values for Start Year\n var date2 = Fimageyr3.select('MNDWI'); //Select MNDWI VAlues for End Year\n var diff = date2.subtract(date1); //Subtract rasters to get maginitude of change\n var trend = date2.gt(date1); //Creates a binary where pixels that got closer to 1, are 1\n var final = trend.multiply(diff).clip(geometry); //Shows magnitude for more wet trend\n\n Map.centerObject(geometry); // Center on AOI\n Map.addLayer(final, MW, 'Areas that have become more wet(' + yr2 + ')-(' + yr3 + ')');\n Map.addLayer(date1, visMNDWI, 'MNDWI(' + yr2 + ')', false); //Creates a layer with the Indice in the Start Year\n Map.addLayer(date2, visMNDWI, 'MNDWI(' + yr3 + ')', false); //Creates a layer with the Indice in the End Year\n }", "title": "" }, { "docid": "3f0ba51eba7b818af5bc21e12c2871ed", "score": "0.55756074", "text": "function updateFilter() {\n // Update all the value of each filter whenever a filter is used\n gCeid = gAprtFilter.map(function(d) {return d.ceid});\n gCeid = getUniqueValue(gCeid);\n\n gL2 = gAprtFilter.map(function(d) {return d.ceid});\n gL2 = getUniqueValue(gL2);\n\n gEntity = gAprtFilter.map(function(d) {return d.entity});\n gEntity = getUniqueValue(gEntity);\n\n gOperation = gAprtFilter.map(function(d) {return d.operation});\n gOperation = getUniqueValue(gOperation);\n\n gProduct = gAprtFilter.map(function(d) {return d.prodgroup3});\n gProduct = getUniqueValue(gProduct);\n}", "title": "" }, { "docid": "1761e454a22c37be381f3371f1812687", "score": "0.55610627", "text": "function filter() {\r\n\r\nfilterinprocess = true;\r\nfilterstart = false;\r\n// console.log(\"filterstart = false\");\r\n\r\n\r\nif (document.getElementById('resultsheader').innerHTML.substring(1, 18) == 'div id=\"deselect\"')\r\n\r\n\r\n\r\n\r\n// create an empty array for the filtered GeoJSON features\r\n\r\n\t\tstevenson_geojson_updated_new = [];\r\n\r\n// get full set of Stevenson geojson records\r\n\r\n\t\tstevenson_geojson_from_layer = map.getLayers().getArray()[1].getSource().getFeatures();\r\n\r\n//\t\talert(\"stevenson source length: \" + map.getLayers().getArray()[1].getSource().getFeatures().length);\r\n\r\n\r\n\r\n// filter the stevenson_geojson_from_layer by subject - results put into filteredFeatures array\r\n\r\n\t\tfilteredFeatures = [];\r\n\t\tif (document.getElementById('subjectselect').value == 0)\r\n\t\t\t{\r\n\t\t\tfilteredFeatures = stevenson_geojson_from_layer;\r\n\t\t\t}\r\n\t\telse\r\n\t\t\t{\r\n\r\n\t\t\tsubjectselectval = document.getElementById('subjectselect').value\r\n\t\t\tsubjectsearchstring = subjects[subjectselectval].searchterm;\r\n\t\t\tfilteredFeatures = stevenson_geojson_from_layer;\r\n\t\t\tfilteredFeatures = jQuery.grep(stevenson_geojson_from_layer, function(n, i){\r\n\t\t\t\t return n.get(\"SUBJECT\") == subjectsearchstring;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\r\n// get max and min dates from date slider\r\n\r\n\t\tdates = [];\r\n\t\tdates = jQuery( \"#slider-range\" ).slider( \"values\");\r\n\t\tvar minyear = dates[0];\r\n\t\tvar maxyear = dates[1];\r\n\r\n\r\n\r\n// ensure layer 2 has no features in source\r\n\r\n\t\tmap.getLayers().getArray()[2].getSource().clear();\r\n\r\n\t\tfilteredFeatures1 = [];\r\n\t\tfilteredFeatures2 = [];\r\n\t\tfilteredFeatures3 = [];\r\n\t\tfilteredFeatures4 = [];\r\n\t\tfilteredFeatures5 = [];\r\n\r\n// jQuery grep command to filter features by Date\r\n\r\n\t\tfilteredFeatures1 = jQuery.grep(filteredFeatures, function(n, i){\r\n\t\t\t return n.get(\"DATE_MAX\") > (minyear);\r\n\t\t});\r\n\t\r\n\t\tfilteredFeatures2 = jQuery.grep(filteredFeatures1, function(n, i){\r\n\t\t\t return n.get(\"DATE_MIN\") < (maxyear);\r\n\t\t});\r\n\r\n// if the #undated div is checked, include Undated features\r\n\r\n\t\tif (jQuery('#undated').is(\":checked\"))\r\n\t\t\t{\r\n\r\n\t\t\tfilteredFeatures3 = jQuery.grep(filteredFeatures2, function(n, i){\r\n\t\t\t\t return n.get(\"Undated\") !== \"Y\";\r\n\t\t\t});\r\n\r\n\t\t}\r\n\r\n\t\telse\r\n\r\n\t\t{\r\n\t\tfilteredFeatures3 = filteredFeatures2;\r\n\t\t}\r\n\r\n\r\n\r\n// add filteredfeatures into layer 2 - filtering by GeomText extents, depending on zoom level, if zoomlevel radio button checked\r\n// map.getLayers().getArray()[2] for pale blue unselectable features\r\n// map.getLayers().getArray()[3] for dark blue selectable features\r\n\r\n\r\n\t\tzoomval = jQuery('input[name=zoomlevel]:radio:checked').val();\r\n\t\tmapzoom = map.getView().getZoom();\r\n\r\n\t\tif ((parseInt(zoomval) == 1) && (mapzoom < 9))\r\n\r\n\t\t\t{\r\n\r\n\t\t\tmap.getLayers().getArray()[2].getSource().clear();\r\n\t\t\tmap.getLayers().getArray()[3].getSource().clear();\r\n\r\n\t\t\tfilteredFeatures4 = jQuery.grep(filteredFeatures3, function(n, i){\r\n\t\t\t\t return n.get(\"GeomText\") !== \"LARGE\";\r\n\t\t\t});\r\n\r\n\t\t\tmap.getLayers().getArray()[2].getSource().addFeatures(filteredFeatures4);\r\n\r\n\t\t\tfilteredFeatures5 = jQuery.grep(filteredFeatures3, function(n, i){\r\n\t\t\t\t return n.get(\"GeomText\") == \"LARGE\";\r\n\t\t\t});\r\n\r\n\t\t\tvar filteredFeatures5length = filteredFeatures5.length;\r\n\r\n\t\t\tmap.getLayers().getArray()[3].getSource().addFeatures(filteredFeatures5);\r\n\r\n\t\t\tdocument.getElementById('zoom_statement').innerHTML = \"Plans with <strong>large extents</strong> shown boldly and selectable on map. Zoom in to view plans with smaller extents.\";\r\n\r\n\t\t\tzoomvalextent = \"large\";\r\n\r\n\t\t\t}\r\n\r\n\t\telse if ((parseInt(zoomval) == 1) && (mapzoom > 8) && (mapzoom < 11))\r\n\r\n\t\t\t{\r\n\r\n\t\t\tmap.getLayers().getArray()[2].getSource().clear();\r\n\t\t\tmap.getLayers().getArray()[3].getSource().clear();\r\n\r\n\t\t\tfilteredFeatures4 = jQuery.grep(filteredFeatures3, function(n, i){\r\n\t\t\t\t return n.get(\"GeomText\") !== \"MEDIUM\";\r\n\t\t\t});\r\n\r\n\t\t\tmap.getLayers().getArray()[2].getSource().addFeatures(filteredFeatures4);\r\n\r\n\t\t\tfilteredFeatures5 = jQuery.grep(filteredFeatures3, function(n, i){\r\n\t\t\t\t return n.get(\"GeomText\") == \"MEDIUM\";\r\n\t\t\t});\r\n\r\n\t\t\tvar filteredFeatures5length = filteredFeatures5.length;\r\n\r\n\t\t\tmap.getLayers().getArray()[3].getSource().addFeatures(filteredFeatures5);\r\n\r\n\r\n\r\n\r\n\t\t\tdocument.getElementById('zoom_statement').innerHTML = \"Plans with <strong>medium extents</strong> shown boldly and selectable on map. Zoom in or out to view plans with smaller or larger extents.\";\r\n\r\n\t\t\tzoomvalextent = \"medium\";\r\n\r\n\t\t\t}\r\n\r\n\t\telse if ((parseInt(zoomval) == 1) && (mapzoom > 10))\r\n\r\n\t\t\t{\r\n\r\n\t\t\tmap.getLayers().getArray()[2].getSource().clear();\r\n\t\t\tmap.getLayers().getArray()[3].getSource().clear();\r\n\r\n\t\t\tfilteredFeatures4 = jQuery.grep(filteredFeatures3, function(n, i){\r\n\t\t\t\t return n.get(\"GeomText\") !== \"SMALL\";\r\n\t\t\t});\r\n\r\n\t\t\tmap.getLayers().getArray()[2].getSource().addFeatures(filteredFeatures4);\r\n\r\n\t\t\tfilteredFeatures5 = jQuery.grep(filteredFeatures3, function(n, i){\r\n\t\t\t\t return n.get(\"GeomText\") == \"SMALL\";\r\n\t\t\t});\r\n\r\n\t\t\tvar filteredFeatures5length = filteredFeatures5.length;\r\n\r\n\t\t\tmap.getLayers().getArray()[3].getSource().addFeatures(filteredFeatures5);\r\n\r\n\r\n\r\n\r\n\t\t\tdocument.getElementById('zoom_statement').innerHTML = \"Plans with <strong>small extents</strong> shown boldly and selectable on map. Zoom out to view plans with larger extents.\";\r\n\r\n\t\t\tzoomvalextent = \"small\";\r\n\r\n\t\t\t}\r\n\r\n\t\telse \r\n\r\n\t\t\t{\r\n\r\n\t\t\tmap.getLayers().getArray()[2].getSource().clear();\r\n\t\t\tmap.getLayers().getArray()[3].getSource().clear();\r\n\r\n\t\t\tvar filteredFeatures5length = filteredFeatures3.length;\r\n\r\n\r\n\t\t\tmap.getLayers().getArray()[3].getSource().addFeatures(filteredFeatures3);\r\n\r\n\t\t\tdocument.getElementById('zoom_statement').innerHTML = \"Plans with <strong>small, medium and large extents</strong> shown boldly and selectable on map.\"\r\n\r\n\t\t\tzoomvalextent = \"small, medium and large\";\r\n\r\n\t\t\t}\r\n\r\n// set layer 1 to be invisible\r\n\r\n\t\tmap.getLayers().getArray()[1].setVisible(false);\r\n\r\n\t\t\tfilterinprocess = false;\r\n\t\t\t// console.log(\"filterinprocess = false\");\r\n\r\n\t}", "title": "" }, { "docid": "dbdd2bf58cd2a14ba2cf094f2ac65ffc", "score": "0.5532673", "text": "function processFilters() {\n console.log(\"processing filters...\");\n\n if(workSpace.currentDoc) {\n workSpace.currentDoc.filter(function(filterElement) {\n var hueRotate = filterElement.colorMatrix('hueRotate', 180);\n\n // Add filter to entire SVG element. At some point I want to\n // let the user choose which layer/node to apply a filter to\n // but this should get us started playing around with filters\n // at least.\n workSpace.currentDoc.attr(\"filter\", \"url(#\" + filterElement.attr(\"id\") + \")\");\n }); \n }\n }", "title": "" }, { "docid": "5200fb9f0785278a9a8c596bde4c8988", "score": "0.54076296", "text": "function filterHandler() {\n trackCount = [\n liveRecordingTracks,\n homeRecordingTracks,\n studioRehearsalTracks,\n originalTracks,\n ];\n falseIndex = Object.values(filterFlags).reduce(\n (out, bool, index) => (!bool ? out.concat(index) : out), // Returns an array with indexes of all inactive filters\n [],\n );\n\n trueIndex = Object.values(filterFlags).reduce(\n (out, bool, index) => (bool ? out.concat(index) : out), // Returns an array with the index of the current active filter\n [],\n );\n}", "title": "" }, { "docid": "164ea5a1e11201d071cca41c1cbd0f9a", "score": "0.53955805", "text": "publishFiltredStation(bartStations) {\n\t\tko.shouter.notifySubscribers(bartStations, \"filteredStation\");\n\t}", "title": "" }, { "docid": "376e0355cebf18e4514cedab01ee0b3b", "score": "0.53885555", "text": "function updateBackground() {\n\n backgroundFilter.scale = 1 + frequency.low / 1777;\n\n backgroundFilter.brightness = 0.3 + ((frequency.high / 100) * 1.1);\n\n backgroundFilter.borderOpacity = 0 + ((frequency.high / 100) * 0.35);\n\n backgroundFilter.bottomOpacity = 0 + ((frequency.overall / 100) * 1);\n\n //backgroundFilter.blur = 1 + frequency.low / 5;\n\n //backgroundFilter.saturate = 0.85 + (frequency.mid/100 * 1.1);\n\n\n\n lastCursorSize = cursorSize;\n cursorSize = 96 + frequency.cursor * 0.5;\n deltaCursor = cursorSize - lastCursorSize;\n\n\n\n //console.log(cursorSize);\n\n\n document.getElementById(\"blurFilter\").style.filter = \"blur(\" + backgroundFilter.blur + \"px)\";\n\n document.getElementById(\"brightnessFilterLeft\").style.opacity = backgroundFilter.borderOpacity;\n document.getElementById(\"brightnessFilterRight\").style.opacity = backgroundFilter.borderOpacity;\n\n //document.getElementById(\"brightnessFilterLeft\").style.background = \"radial-gradient(ellipse at 35%, hsl(\" + 231 + \",\" + 100 + \"%,\" + 98 + \"%) 1%, transparent 70%, transparent)\"; //\"hsl(\" + h + \",\" + s + \"%,\" + l + \"%)\"\n //document.getElementById(\"brightnessFilterRight\").style.background = \"radial-gradient(ellipse at 65%, hsl(\" + 231 + \",\" + 100 + \"%,\" + 98 + \"%) 1%, transparent 70%, transparent)\"; //\"radial-gradient(ellipse at 65%, hsl(\" + h + \",\" + 55 + \"%,\" + 60 + \"%) 1%, transparent 70%, transparent)\";\n\n document.getElementById(\"newBrightnessFilter\").style.filter = \"brightness(\" + backgroundFilter.brightness + \")\";\n\n document.getElementById(\"saturateFilter\").style.filter = \"saturate(\" + backgroundFilter.saturate + \")\";\n document.getElementById(\"saturateFilter\").style.opacity = backgroundFilter.bottomOpacity;\n document.getElementById(\"saturateFilter\").style.background = \"linear-gradient(to top, hsl(\" + h + \",\" + 55 + \"%,\" + 60 + \"%) -65%, transparent 37%)\";\n\n\n document.getElementById(\"background\").style.transform = \"scale(\" + backgroundFilter.scale + \")\";\n\n\n //shockwave\n var shockwave = 0;\n\n}", "title": "" }, { "docid": "683561224f054db2f76a12ecaf754f03", "score": "0.5361375", "text": "function get_global_anisotropic_filtering(bpy_data, thread) {\n if (thread.is_primary)\n return bpy_data[\"scenes\"][0][\"b4w_anisotropic_filtering\"];\n else\n return _primary_scene[\"b4w_anisotropic_filtering\"];\n}", "title": "" }, { "docid": "1660c59093de2abf80273f5d6ca49204", "score": "0.5361075", "text": "function updateData() {\n\t\t\t//console.log(axes);\n\t\t\tfilteredData = data.filter(filterFunc);\n\t\t\t//console.log(filteredData);\n\t\t\tfilteredData = filteredData.map(mapFunc);\n\t\t\t//console.log(filteredData);\n\t\t}", "title": "" }, { "docid": "101471dde7ebeb70de3f3ac0c8a8dc59", "score": "0.53123", "text": "function _filterData(raw_data, push_data, neLat, neLng, swLat, swLng, type, season) {\n\tif (type == \"WIND\") {\n\t\t_filterWindData(raw_data, push_data, neLat, neLng, swLat, swLng);\n\t} else if (type == \"SOLAR\") {\n\t\t_filterSolarData(raw_data, push_data);\n\t} else if (type == \"HYDRO\") {\n\t\t_filterHydroData(raw_data, push_data, neLat, neLng, swLat, swLng, season);\n\t}\n}", "title": "" }, { "docid": "447fea212a11e39e7cd180f9d67188e7", "score": "0.53059316", "text": "function updateMapFilter() {\n geomDimension.filter(function(d) {\n return map.getBounds().contains(L.geoJSON(d).getBounds())\n });\n dc.redrawAll();\n }", "title": "" }, { "docid": "f1d149bcab0b8d8b85286a1a6ead0ca5", "score": "0.527675", "text": "function processData(raw_data, hm_data, neLat, neLng, swLat, swLng, type, season) {\n\tvar lat_offset = getLatOffset(neLat, swLat);\n\tvar lng_offset = getLngOffset(neLng, swLng);\n\tset_scaler(type);\n\t\n\tvar usable_data = [];\n\t_filterData(raw_data, usable_data,\n\t\t\tneLat + lat_offset,\n\t\t\tneLng + lng_offset,\n\t\t\tswLat - lat_offset,\n\t\t\tswLng - lng_offset,\n\t\t\ttype, season);\n\t\n\tvar weight_points = [];\n\tfor (var i = 0; i < usable_data.length; i++) {\n\t\tweight_points.push(usable_data[i].weight);\n\t}\n\tvar topval = getArrayMax(weight_points);\n\tvar botval = getArrayMin(weight_points);\n\n\tconsole.log(\"Top val: \" + topval);\n\tconsole.log(\"Bottom val: \" + botval);\n\t\n\t// Hydro has to be interpolated at this point in order to retain meaning\n\tif (type == \"HYDRO\") {\n\t\tusable_data = _interpolateData(usable_data, neLat, neLng, swLat, swLng, type);\n\t}\n\t\n\tfor (var i = 0; i < usable_data.length; i++) {\n\t\taddHeatmapCoord(hm_data, usable_data[i].lat, usable_data[i].lng,\n\t\t\t\tapply_scaler(usable_data[i].weight, botval, type));\n\t}\n}", "title": "" }, { "docid": "ea10e66517eeb7f33cd6988d5230123b", "score": "0.527459", "text": "function updateFilters() {\n // Checking that update filters is working in console log\n console.log('filtering')\n // Checking that the right filters are being ammended\n console.log(filters)\n\n // Settting variables for changing of input bars\n // Recognizing box being changs\n var changedElement = d3.select(this);\n // Establishing value\n var elementValue = changedElement.property(\"value\");\n // Establishing id\n var filterId = changedElement.attr(\"id\")\n\n\n // If statement to ammend filters list\n if (elementValue) {\n filters[filterId] = elementValue;\n }\n else {\n delete filters[filterId];\n }\n filterTable();\n}", "title": "" }, { "docid": "a97cc713ce0befccbc17b497eb1540ae", "score": "0.52613723", "text": "function SAVIBIN (){\n applyfilter();\n var SAimage = Fimageyr1.expression(\n \"SAVI >= thresh3\", {\n 'SAVI': Fimageyr1.select('SAVI').clip(geometry),\n 'thresh3' : SAVIslider.getValue()});//Slider bar input\n\n var SAVIMimage = SAimage.updateMask(SAimage.gt(0)); //Mask 0 values\n Map.centerObject(geometry); //Center on AOI\n Map.addLayer(SAVIMimage, VEG, 'SAVI Landsat Binary Map(' + yr2 + ')');\n}", "title": "" }, { "docid": "76871e9c04e6374ff0533f247300d713", "score": "0.5232984", "text": "function applyFilter() {\n\n format = $('#format').val();\n connectid = $('#connectid').val();\n featureProfile = $('#featureProfile').val();\n\n opacidadeOSM = $('#opacidadeOSM').val();\n opacidadeDG = $('#opacidadeDG').val();\n\n mapUrl = baseUrl + 'connectid=' + connectid + '&' + 'featureProfile=' + featureProfile;\n\n\n if (productType || cloudCover || ageDays) {\n\n CQL_Filter = '&CQL_Filter=';\n var cql = '';\n if (productType) {\n cql += \"(productType='\" + productType + \"')\";\n }\n if (cloudCover) {\n if (cql) {\n cql += ' AND ';\n }\n cql += \"(cloudCover<'\" + cloudCover + \"')\";\n }\n if (ageDays) {\n if (cql) {\n cql += ' AND ';\n }\n cql += \"(age_days<'\" + ageDays + \"')\";\n }\n\n // tests\n //cql += \" AND (source='WV01')\";\n //cql += \" AND (offNadirAngle='0.0')\";\n //cql += \" AND (sunElevation='0.0')\";\n //cql += \" AND (sunAzimuth='0.0')\";\n //cql += \" AND (sourceUnit='Mosaic Product')\"; // Mosaic Product\n //cql += \" AND (featureId=7b1177f7200deda446c333a9a6689ba8)\";\n //cql += \" AND (CE90Accuracy=8.4)\";\n //cql += \" AND (spatialAccuracy='1:12,000')\";\n //cql += \" AND (crsFromPixels='EPSG:32721')\";\n //cql += \" AND (perPixelX='0.5')\";\n //cql += \" AND (perPixelY='-0.5')\";\n //cql += \" AND (outputMosaic=True)\";\n\n\n CQL_Filter += cql;\n mapUrl += CQL_Filter;\n }\n\n // redefine the layer's source based on the new configurations and filters\n dgLayer.setSource(new ol.source.WMTS({\n url: mapUrl,\n layer: 'DigitalGlobe:ImageryTileService',\n matrixSet: 'EPSG:3857',\n format: format,\n projection: projection,\n tileGrid: new ol.tilegrid.WMTS({\n origin: ol.extent.getTopLeft(projectionExtent),\n resolutions: resolutions,\n matrixIds: matrixIds\n }),\n style: '',\n wrapX: true\n }));\n\n dgLayer.setOpacity(opacidadeDG);\n osmLayer.setOpacity(opacidadeOSM);\n\n}", "title": "" }, { "docid": "cea84bbd15102839c56140d2e637a4d7", "score": "0.52305436", "text": "function filterUpdated() {\n gWaterfallDataIsDirty = true;\n}", "title": "" }, { "docid": "dc8919fcf79c908854ec6372c965d53e", "score": "0.5229068", "text": "function high_light_clip_sensor(feature,layer,intersect_feature_array){\n\t\n\t\tif(intersect_feature_array.length!=0){\n\t\t\t\tif(intersect_feature_array.indexOf(feature.properties.site_code)!=-1){\n\t\t\t\t\tlayer.setStyle(Sensor_layer_styles[\"in\"]);\n\t\t\t\t\tfeature.properties.default_feature=\"in\";\n\t\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\tlayer.setStyle(Sensor_layer_styles[\"out\"]);\n\t\t\t\t\tfeature.properties.default_feature=\"out\";\n\t\t\t\t}\n\t\t\t\n\t\t}else{ \n\t\t\tlayer.setStyle(Sensor_layer_styles[\"generic\"]);\n\t\t\tfeature.properties.default_feature=\"generic\";\n\t\t}\n\t\tlayer.setStyle({fill:false,\n\t\t\tstroke:false,});\n\t\n\t}", "title": "" }, { "docid": "74b7173cc1bc8606d2c5e62729fc581d", "score": "0.52256763", "text": "function filterChange() {\n // console.log('filterChange');\n\n SvgModule.Data.Tag.style.filter = Common.getFiltersCss(\n PageData.Controls.Brightness.value,\n PageData.Controls.Contrast.value,\n PageData.Controls.Hue.value,\n PageData.Controls.Saturation.value);\n}", "title": "" }, { "docid": "b86652dfbf81404ad961fd8846708902", "score": "0.5225015", "text": "function filterOutputFrequencies(...bands) {\n return (filter) => (bands.includes(FrequencyBand.$160_m) && filter.Frequency.Output >= 1.8 && filter.Frequency.Output <= 2.0) ||\n (bands.includes(FrequencyBand.$80_m) && filter.Frequency.Output >= 3.525 && filter.Frequency.Output <= 3.6 && (filter.Callsign.includes('CW') || filter.Callsign.includes('RTTY'))) ||\n (bands.includes(FrequencyBand.$80_m) && filter.Frequency.Output >= 3.8 && filter.Frequency.Output <= 4.0) ||\n (bands.includes(FrequencyBand.$60_m) && filter.Frequency.Output >= 5.3305 && filter.Frequency.Output <= 5.405 && !filter.Callsign.includes('FM') && !filter.Callsign.includes('D-Star')) ||\n (bands.includes(FrequencyBand.$40_m) && filter.Frequency.Output >= 7.025 && filter.Frequency.Output <= 7.125 && (filter.Callsign.includes('CW') || filter.Callsign.includes('RTTY'))) ||\n (bands.includes(FrequencyBand.$40_m) && filter.Frequency.Output >= 7.175 && filter.Frequency.Output <= 7.3) ||\n (bands.includes(FrequencyBand.$30_m) && filter.Frequency.Output >= 10.1 && filter.Frequency.Output <= 10.15 && (filter.Callsign.includes('CW') || filter.Callsign.includes('RTTY'))) ||\n (bands.includes(FrequencyBand.$20_m) && filter.Frequency.Output >= 14.025 && filter.Frequency.Output <= 14.150 && (filter.Callsign.includes('CW') || filter.Callsign.includes('RTTY'))) ||\n (bands.includes(FrequencyBand.$20_m) && filter.Frequency.Output >= 14.225 && filter.Frequency.Output <= 14.350) ||\n (bands.includes(FrequencyBand.$17_m) && filter.Frequency.Output >= 18.068 && filter.Frequency.Output <= 18.110 && (filter.Callsign.includes('CW') || filter.Callsign.includes('RTTY'))) ||\n (bands.includes(FrequencyBand.$17_m) && filter.Frequency.Output >= 18.110 && filter.Frequency.Output <= 18.168) ||\n (bands.includes(FrequencyBand.$15_m) && filter.Frequency.Output >= 21.025 && filter.Frequency.Output <= 21.2 && (filter.Callsign.includes('CW') || filter.Callsign.includes('RTTY'))) ||\n (bands.includes(FrequencyBand.$15_m) && filter.Frequency.Output >= 21.275 && filter.Frequency.Output <= 21.450) ||\n (bands.includes(FrequencyBand.$12_m) && filter.Frequency.Output >= 24.89 && filter.Frequency.Output <= 24.93 && (filter.Callsign.includes('CW') || filter.Callsign.includes('RTTY'))) ||\n (bands.includes(FrequencyBand.$12_m) && filter.Frequency.Output >= 24.93 && filter.Frequency.Output <= 24.99) ||\n (bands.includes(FrequencyBand.$10_m) && filter.Frequency.Output >= 28 && filter.Frequency.Output <= 28.3 && (filter.Callsign.includes('CW') || filter.Callsign.includes('RTTY'))) ||\n (bands.includes(FrequencyBand.$10_m) && filter.Frequency.Output >= 28.3 && filter.Frequency.Output <= 29.7) ||\n (bands.includes(FrequencyBand.$6_m) && filter.Frequency.Output >= 50 && filter.Frequency.Output <= 50.1 && filter.Callsign.includes('CW')) ||\n (bands.includes(FrequencyBand.$6_m) && filter.Frequency.Output >= 50.1 && filter.Frequency.Output <= 54) ||\n (bands.includes(FrequencyBand.$2_m) && filter.Frequency.Output >= 144 && filter.Frequency.Output <= 144.1 && filter.Callsign.includes('CW')) ||\n (bands.includes(FrequencyBand.$2_m) && filter.Frequency.Output >= 144.1 && filter.Frequency.Output <= 148) ||\n (bands.includes(FrequencyBand.$1_25_m) && filter.Frequency.Output >= 222 && filter.Frequency.Output <= 225) ||\n (bands.includes(FrequencyBand.$70_cm) && filter.Frequency.Output >= 420 && filter.Frequency.Output <= 450) ||\n (bands.includes(FrequencyBand.MURS) && filter.Frequency.Output >= 151.82 && filter.Frequency.Output <= 154.6) ||\n (bands.includes(FrequencyBand.GMRS) && filter.Frequency.Output >= 462.55 && filter.Frequency.Output <= 467.7125);\n }", "title": "" }, { "docid": "b70d30ea5f319932c5a93b9440f9f470", "score": "0.52174777", "text": "function filterselection() {\r\n\r\n\t\tif (map.getLayers().getArray()[4].getSource().getFeatures().length < 1 ) { return; }\r\n\r\n// get full set of Stevenson geojson records\r\n\r\n\t\telse\r\n\r\n\t\t{\r\n\r\n\t\tstevenson_geojson_from_selection = map.getLayers().getArray()[3].getSource().getFeatures();\r\n\r\n\t// console.log(\"stevenson_geojson_from_selection length: \" + stevenson_geojson_from_selection.length);\r\n\r\n\t\tsetResults(''); \r\n\t\tsetResultsheader('<p>No plans selected - please click on a <strong>dark blue feature</strong> where you are interested in on the map to view details of plans</p>');\r\n\r\n\t\tmap.getLayers().getArray()[4].getSource().clear();\r\n\r\n// create an empty array for the filtered GeoJSON features\r\n\r\n\t\tstevenson_geojson_updated_new = [];\r\n\r\n\r\n// filter the stevenson_geojson_from_layer by subject - results put into filteredFeatures array\r\n\r\n\t\tfilteredselectedFeatures = [];\r\n\t\tif (document.getElementById('subjectselect').value == 0)\r\n\t\t\t{\r\n\t\t\tfilteredselectedFeatures = selectedFeatures;\r\n\t\t\t}\r\n\t\telse\r\n\t\t\t{\r\n\r\n\t\t\tsubjectselectval = document.getElementById('subjectselect').value\r\n\t\t\tsubjectsearchstring = subjects[subjectselectval].searchterm;\r\n\t\t\tfilteredselectedFeatures = stevenson_geojson_from_selection;\r\n\t\t\tfilteredselectedFeatures = jQuery.grep(selectedFeatures, function(n, i){\r\n\t\t\t\t return n.get(\"SUBJECT\") == subjectsearchstring;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\r\n// get max and min dates from date slider\r\n\r\n\t\tdates = [];\r\n\t\tdates = jQuery( \"#slider-range\" ).slider( \"values\");\r\n\t\tvar minyear = dates[0];\r\n\t\tvar maxyear = dates[1];\r\n\r\n\r\n\t\tfilteredselectedFeatures1 = [];\r\n\t\tfilteredselectedFeatures2 = [];\r\n\t\tfilteredselectedFeatures3 = [];\r\n\t\tfilteredselectedFeatures4 = [];\r\n\t\tfilteredselectedFeatures5 = [];\r\n\r\n// jQuery grep command to filter features by Date\r\n\r\n\t\tfilteredselectedFeatures1 = jQuery.grep(filteredselectedFeatures, function(n, i){\r\n\t\t\t return n.get(\"DATE_MAX\") > (minyear);\r\n\t\t});\r\n\t\r\n\t\tfilteredselectedFeatures2 = jQuery.grep(filteredselectedFeatures1, function(n, i){\r\n\t\t\t return n.get(\"DATE_MIN\") < (maxyear);\r\n\t\t});\r\n\r\n// if the #undated div is checked, include Undated features\r\n\r\n\t\tif (jQuery('#undated').is(\":checked\"))\r\n\t\t\t{\r\n\r\n\t\t\tfilteredselectedFeatures3 = jQuery.grep(filteredselectedFeatures2, function(n, i){\r\n\t\t\t\t return n.get(\"Undated\") !== \"Y\";\r\n\t\t\t});\r\n\r\n\t\t}\r\n\r\n\t\telse\r\n\r\n\t\t{\r\n\t\tfilteredselectedFeatures3 = filteredselectedFeatures2;\r\n\t\t}\r\n\r\n\r\n\r\n// sort the results by DATE_MIN\r\n\r\n\t\t\tfilteredselectedFeatures3.sort(function(a, b){\r\n\t\t\t\t\t var nameA=a.get(\"DATE_MIN\"), nameB=b.get(\"DATE_MIN\")\r\n\t\t\t\t\t if (nameA < nameB) //sort string ascending\r\n\t\t\t\t\t return -1 \r\n\t\t\t\t\t if (nameA > nameB)\r\n\t\t\t\t\t return 1\r\n\t\t\t\t\t return 0 //default return value (no sorting)\r\n\t\t\t\r\n\t\t\t\t\t})\r\n\r\n// add selectedFeatures to map.getLayers().getArray()[4]\r\n\r\n\t\t\tmap.getLayers().getArray()[4].getSource().addFeatures(filteredselectedFeatures3);\r\n\r\n\t// console.log(\"filteredselectedFeatures3 length: \" + filteredselectedFeatures3.length);\r\n\r\n// set header depending on selectedFeatures.length\r\n\r\n\t\t\tvar resultsheader = \"\";\r\n\t\r\n\t\t\tif (filteredselectedFeatures3.length < 1)\r\n\t\t\t\tresultsheader += '';\r\n\t\r\n\t\t\telse if (filteredselectedFeatures3.length == 1)\r\n\t\t resultsheader += '<div id=\"deselect\"><a href=\"javascript:deselect();\">Deselect these plans</a></div><br/><p><strong>Results - 1 plan:</strong><br />(hover mouse over each plan record to view extents).</p>';\r\n\t\t\telse if (filteredselectedFeatures3.length > 1)\r\n\t\r\n\t\t resultsheader += '<div id=\"deselect\"><a href=\"javascript:deselect();\">Deselect these plans</a></div><br/><p><strong>Results - ' + filteredselectedFeatures3.length + ' plans:</strong><br />(hover mouse over each plan record to view extents).</p>';\r\n\t\r\n// set results from selectedFeatures - display fields if they have content and provide a heading for each field\r\n\r\n\t\t setResultsheader(resultsheader);\r\n\r\n\t\t\t\t if (filteredselectedFeatures3.length > 0) {\r\n\t\t\t\t\tvar results = \"\";\r\n\t\t\t var k;\r\n\t\t\t for(k=0; k< filteredselectedFeatures3.length; k++) {\r\n\r\n\t\t\t\t\t\tresults += '<div id=\"' + filteredselectedFeatures3[k].get(\"SURVEYID\") + '\" class=\"resultslist\" data-layerid=\"' + filteredselectedFeatures3[k].get(\"SURVEYID\") + '\" >';\r\n\r\n\t\t\t\t\t\tif (filteredselectedFeatures3[k].get(\"PERSON\") && (filteredselectedFeatures3.length > 0))\r\n\t\t\t\t\t\t\tresults += '<p><strong>Person: </strong>' + filteredselectedFeatures3[k].get(\"PERSON\") + '</p>';\r\n\t\t\t\t\t\tif (filteredselectedFeatures3[k].get(\"DESC_\") && (filteredselectedFeatures3.length > 0))\r\n\t\t\t\t\t\t\tresults += '<p><strong>Description: </strong>' + filteredselectedFeatures3[k].get(\"DESC_\") + '<br/>';\r\n\t\t\t\t\t\tif (filteredselectedFeatures3[k].get(\"DATE_U\") && (filteredselectedFeatures3.length > 0))\r\n\t\t\t\t\t\t\tresults += '<p><strong>Date: </strong>' + filteredselectedFeatures3[k].get(\"DATE_U\") + '</p>';\r\n\t\t\t\t\t\tif (filteredselectedFeatures3[k].get(\"PLACE\") && (filteredselectedFeatures3.length > 0))\r\n\t\t\t\t\t\t\tresults += '<p><strong>Location: </strong>' + filteredselectedFeatures3[k].get(\"PLACE\") + '</p>';\r\n\t\t\t\t\t\tif (filteredselectedFeatures3[k].get(\"COUNTY_C\") && (filteredselectedFeatures3.length > 0))\r\n\t\t\t\t\t\t\tresults += '<p><strong>County: </strong>' + filteredselectedFeatures3[k].get(\"COUNTY_C\") + '</p>';\r\n\t\t\t\t\t\tif (filteredselectedFeatures3[k].get(\"SUBJECT\") && (filteredselectedFeatures3.length > 0))\r\n\t\t\t\t\t\t\tresults += '<p><strong>Subject: </strong>' + filteredselectedFeatures3[k].get(\"SUBJECT\") + '</p>';\r\n\t\t\t\t\t\tif (filteredselectedFeatures3[k].get(\"INV\") && (filteredselectedFeatures3.length > 0))\r\n\t\t\t\t\t\t\tresults += filteredselectedFeatures3[k].get(\"INV\") + '</p>';\r\n\t\t\t\t\t\tif (filteredselectedFeatures3[k].get(\"COLOUR\") && (filteredselectedFeatures3.length > 0))\r\n\t\t\t\t\t\t\tresults += '<p><strong>B&W/Col?: </strong>' + filteredselectedFeatures3[k].get(\"COLOUR\") + '</p>';\r\n\t\t\t\t\t\tif (filteredselectedFeatures3[k].get(\"MEDIA\") && (filteredselectedFeatures3.length > 0))\r\n\t\t\t\t\t\t\tresults += '<p><strong>Media: </strong>' + filteredselectedFeatures3[k].get(\"MEDIA\") + '</p>';\r\n\t\t\t\t\t\tif (filteredselectedFeatures3[k].get(\"HEIGHT\") && (filteredselectedFeatures3.length > 0))\r\n\t\t\t\t\t\t\tresults += '<p><strong>Height: </strong>' + filteredselectedFeatures3[k].get(\"HEIGHT\") + \r\n\t\t\t\t\t\t\t' mm, <strong>Width: </strong>' + filteredselectedFeatures3[k].get(\"WIDTH\") + ' mm</p>';\r\n\t\t\t\t\t\tresults += '<p><strong>Shelfmark: </strong>' + filteredselectedFeatures3[k].get(\"SM\") + '.' + filteredselectedFeatures3[k].get(\"PART\") + ', '+ filteredselectedFeatures3[k].get(\"NO\") + '</p>'; \r\n\r\n\t\t\t\t\t\tresults += '</div><hr2></hr2>'; \r\n\t\t\t }\r\n\r\n\t\t\t\t\tsetResults(results);\r\n\t\t\t\t\r\n\t\t\t\t } else {\r\n\r\n\t\t\t\t {setResults('No plans selected - please click on a <strong>dark blue feature</strong> where you are interested in on the map to view details of plans');}\r\n\t\t\t\t }\r\n\r\n\t\t\t}\r\n\r\n\r\n\t}", "title": "" }, { "docid": "0fc0276b5834ea9c3fd3a34cea82829d", "score": "0.5193972", "text": "apply(filterManager, input, output, clear) {\n this.uniforms.uTime = this.delta <= 0 ? 2.0 : this.delta;\n filterManager.applyFilter(this, input, output, clear);\n }", "title": "" }, { "docid": "92666c00a37d21cec3b8c374ebf8dcd4", "score": "0.51891756", "text": "function colorSensor(id) {\r\n var cPulse, rPulse, gPulse, bPulse, i, cPulseM, rPulseM, gPulseM, bPulseM;\r\n console.log('Leggo il sensore di colore ' + id);\r\n cPulse = new Array();\r\n rPulse = new Array();\r\n gPulse = new Array();\r\n bPulse = new Array();\r\n cPulseM = rPulseM = gPulseM = bPulseM = 0;\r\n i = 1;\r\n if (id==1) {\r\n do {\r\n wpi.digitalWrite(pinS2,high); // Setting CLEAR (C) No Filter\r\n wpi.digitalWrite(pinS3,low); // Setting CLEAR (C) No Filter\r\n do {\r\n cPulse[i] = impulsoIn(pinOut,low);\r\n } while ((cPulse[i]<0)||(cPulse[i]>300));\r\n cPulseM += cPulse[i];\r\n wpi.digitalWrite(pinS2,low); // Setting RED (R) filtered photodiodes to be read\r\n wpi.digitalWrite(pinS3,low); // Setting RED (R) filtered photodiodes to be read\r\n do {\r\n rPulse[i] = impulsoIn(pinOut,low);\r\n } while ((rPulse[i]<0)||(rPulse[i]>300));\r\n rPulseM += rPulse[i];\r\n/*\r\n wpi.digitalWrite(pinS2,high); // Setting GREEN (G) filtered photodiodes to be read\r\n wpi.digitalWrite(pinS3,high); // Setting GREEN (G) filtered photodiodes to be read\r\n do {\r\n gPulse[i] = impulsoIn(pinOut,low);\r\n } while ((gPulse[i]<0)||(gPulse[i]>300));\r\n gPulseM += gPulse[i];\r\n*/\r\n wpi.digitalWrite(pinS2,low); // Setting BLUE (B) filtered photodiodes to be read\r\n wpi.digitalWrite(pinS3,high); // Setting BLUE (B) filtered photodiodes to be read\r\n do {\r\n bPulse[i] = impulsoIn(pinOut,low);\r\n } while ((bPulse[i]<0)||(bPulse[i]>300));\r\n bPulseM += bPulse[i];\r\n i++;\r\n } while (i<=10);\r\n cPulseM = cPulseM/10;\r\n rPulseM = rPulseM/10;\r\n// gPulseM = gPulseM/10;\r\n bPulseM = bPulseM/10;\r\n console.log(cPulseM);\r\n console.log(rPulseM);\r\n// console.log(gPulseM);\r\n console.log(bPulseM+\"\\n\");\r\n valoreLetto=\"\";\r\n if ((Math.abs(rPulseM-56)<20)&&(Math.abs(bPulseM-46)<20)) valoreLetto=\"bianco\";\r\n if ((Math.abs(rPulseM-147)<30)&&(Math.abs(bPulseM-146)<20)) valoreLetto=\"verde\";\r\n if ((Math.abs(rPulseM-74)<20)&&(Math.abs(bPulseM-149)<20)) valoreLetto=\"rosso\";\r\n// if ((Math.abs(rPulseM-220)<20)&&(Math.abs(bPulseM-216)<20)) valoreLetto=\"nero\";\r\n if (valoreLetto==\"\") valoreLetto=\"nero\";\r\n\r\n/*\r\n if ((Math.abs(rPulseM-45)<20)&&(Math.abs(gPulseM-50)<20)&&(Math.abs(bPulseM-37)<20)) valoreLetto=\"bianco\";\r\n// if ((Math.abs(rPulseM-20)<15)&&(Math.abs(gPulseM-25)<10)&&(Math.abs(bPulseM-19)<10)) valoreLetto=\"argento\";\r\n if ((Math.abs(rPulseM-105)<30)&&(Math.abs(gPulseM-90)<20)&&(Math.abs(bPulseM-95)<20)) valoreLetto=\"verde\";\r\n if ((Math.abs(rPulseM-58)<20)&&(Math.abs(gPulseM-125)<20)&&(Math.abs(bPulseM-90)<20)) valoreLetto=\"rosso\";\r\n if ((Math.abs(rPulseM-165)<20)&&(Math.abs(gPulseM-188)<20)&&(Math.abs(bPulseM-135)<20)) valoreLetto=\"nero\";\r\n*/\r\n }\r\n return valoreLetto;\r\n}", "title": "" }, { "docid": "95f517316fcd41686e02ffb8f9d65f2d", "score": "0.5185174", "text": "function SNDVIBIN (){\n applyfilter();\n var SNimage = s2Imageyr4.expression(\n \"NDVI >= thresh4\", {\n 'NDVI': s2Imageyr4.select('NDVI').clip(geometry),\n 'thresh4' : SNDVIslider.getValue()}); //Slider bar input\n\n var NDVIMimage = SNimage.updateMask(SNimage.gt(0)); //Mask 0 values\n Map.centerObject(geometry); //Center on AOI\n Map.addLayer(NDVIMimage, VEG, 'NDVI Sentinel-2 Binary Map(' + yr4+ ')');\n}", "title": "" }, { "docid": "d577b58bcf1d0763fe9eaa7bf855820a", "score": "0.51831114", "text": "function filterByMotion(val) {\n vm.filter.motion_on_by = val;\n vm.dataReceived = false;\n getMotionReport(vm.filter);\n }", "title": "" }, { "docid": "68ff1407111bb248e7fee95160dd9ba6", "score": "0.5182264", "text": "handleDimensionsChange_() {\n // Create a layer list to update each one only once\n /**\n * @type {import('ol/layer/Base').default[]}\n */\n const layers = [];\n /**\n * @type {string[]}\n */\n const layerIds = [];\n\n const dataSources = this.dataSources_.getArray();\n for (const dataSource of dataSources) {\n if (dataSource instanceof GmfDatasourceOGC && dataSource.dimensionsFiltersConfig) {\n for (const key in dataSource.dimensionsFiltersConfig) {\n if (dataSource.dimensionsFiltersConfig[key].value === null) {\n const layer = this.getDataSourceLayer_(dataSource);\n if (layer == undefined) {\n return;\n }\n const id = olUtilGetUid(layer);\n if (!layerIds.includes(id)) {\n layers.push(layer);\n layerIds.push(id);\n }\n }\n }\n }\n }\n\n layers.forEach(this.updateLayerFilter_.bind(this));\n }", "title": "" }, { "docid": "faa66c063a561e3079270266168409ec", "score": "0.5176976", "text": "_applyFilters () {\n\t\tlet surface = this.target.cacheCanvas;\n\t\tlet filters = this.target.filters;\n\n\t\tlet w = this._drawWidth;\n\t\tlet h = this._drawHeight;\n\n\t\t// setup\n\t\tlet data = surface.getContext(\"2d\").getImageData(0,0, w,h);\n\n\t\t// apply\n\t\tlet l = filters.length;\n\t\tfor (let i=0; i<l; i++) {\n\t\t\tfilters[i]._applyFilter(data);\n\t\t}\n\n\t\t//done\n\t\tsurface.getContext(\"2d\").putImageData(data, 0,0);\n\t}", "title": "" }, { "docid": "d6e4bfb4abb59ae82939bbbba9a946d6", "score": "0.51624453", "text": "cullShadowmaps(comp) {\n\n // shadow casters culling for local (point and spot) lights\n for (let i = 0; i < comp._lights.length; i++) {\n const light = comp._lights[i];\n if (light._type !== LIGHTTYPE_DIRECTIONAL) {\n if (light.visibleThisFrame && light.castShadows && light.shadowUpdateMode !== SHADOWUPDATE_NONE) {\n const casters = comp._lightCompositionData[i].shadowCastersList;\n this.cullLocalShadowmap(light, casters);\n }\n }\n }\n\n // shadow casters culling for global (directional) lights\n // render actions store which directional lights are needed for each camera, so these are getting culled\n const renderActions = comp._renderActions;\n for (let i = 0; i < renderActions.length; i++) {\n const renderAction = renderActions[i];\n const count = renderAction.directionalLightsIndices.length;\n for (let j = 0; j < count; j++) {\n const lightIndex = renderAction.directionalLightsIndices[j];\n const light = comp._lights[lightIndex];\n const casters = comp._lightCompositionData[lightIndex].shadowCastersList;\n this.cullDirectionalShadowmap(light, casters, renderAction.camera.camera);\n }\n }\n }", "title": "" }, { "docid": "75c68aad00d524496e95ae1db3facc63", "score": "0.51559436", "text": "function filterHandler(){\n}", "title": "" }, { "docid": "d8854e4075f89ed75e249cca8bdb7e18", "score": "0.5131593", "text": "function stepFilter() {\n\tvar i=0;\n\t\n\tselectedOption = document.getElementById(\"terrainFilterSelector\");\n\tterrainTextOption = selectedOption.options[selectedOption.selectedIndex].text;\n\t\n\tif (floodTime)\n\t{\n\t\t// This is hard coded to 2 at the moment so that we dont erase mountains when\n\t\t// flooding - this is a hack. needs fixing.\n\t\tfor (i=0;i<2 && i<terrainFilters[terrainTextOption].length;i++)\n\t\t{\n\t\t\tterrainFilters[terrainTextOption][i].stop+=1;\n\t\t\tif (terrainFilters[terrainTextOption][i].stop>255)\n\t\t\t{\n\t\t\t\tterrainFilters[terrainTextOption][i].stop=255;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tselectedOption = document.getElementById(\"skyFilterSelector\");\n\tskyTextOption = selectedOption.options[selectedOption.selectedIndex].text;\n\n\t// this cycleDelta stuff isnt working properly yet - some code here and some\n\t// in TerrainMap getFilterScale()\t\n\tif (cyleDirection)\n\t{\n\t\tskyFilters[skyTextOption][0].cycleDelta+=5;\n\t\tif (skyFilters[skyTextOption][0].cycleDelta>255) {\n\t\t\t//skyFilters[skyTextOption][0].cycleDelta=255;\n\t\t\tcyleDirection=!cyleDirection;\n\t\t}\n\t}\n\telse\n\t{\n\t\tskyFilters[skyTextOption][0].cycleDelta-=5;\n\t\tif (skyFilters[skyTextOption][0].cycleDelta<0) {\n\t\t\t//skyFilters[skyTextOption][0].cycleDelta=0;\n\t\t\tcyleDirection=!cyleDirection;\n\t\t}\t\n\t}\n\tdrawLayers();\n\n\trestoreImages();\n}", "title": "" }, { "docid": "a61b4a38c064948d10c664f7aeb20dc3", "score": "0.5119512", "text": "function filterInputFrequencies(...bands) {\n return (filter) => (bands.includes(FrequencyBand.$160_m) && filter.Frequency.Input >= 1.8 && filter.Frequency.Input <= 2.0) ||\n (bands.includes(FrequencyBand.$80_m) && filter.Frequency.Input >= 3.525 && filter.Frequency.Input <= 3.6 && (filter.Callsign.includes('CW') || filter.Callsign.includes('RTTY'))) ||\n (bands.includes(FrequencyBand.$80_m) && filter.Frequency.Input >= 3.8 && filter.Frequency.Input <= 4.0) ||\n (bands.includes(FrequencyBand.$60_m) && filter.Frequency.Input >= 5.3305 && filter.Frequency.Input <= 5.405 && !filter.Callsign.includes('FM') && !filter.Callsign.includes('D-Star')) ||\n (bands.includes(FrequencyBand.$40_m) && filter.Frequency.Input >= 7.025 && filter.Frequency.Input <= 7.125 && (filter.Callsign.includes('CW') || filter.Callsign.includes('RTTY'))) ||\n (bands.includes(FrequencyBand.$40_m) && filter.Frequency.Input >= 7.175 && filter.Frequency.Input <= 7.3) ||\n (bands.includes(FrequencyBand.$30_m) && filter.Frequency.Input >= 10.1 && filter.Frequency.Input <= 10.15 && (filter.Callsign.includes('CW') || filter.Callsign.includes('RTTY'))) ||\n (bands.includes(FrequencyBand.$20_m) && filter.Frequency.Input >= 14.025 && filter.Frequency.Input <= 14.150 && (filter.Callsign.includes('CW') || filter.Callsign.includes('RTTY'))) ||\n (bands.includes(FrequencyBand.$20_m) && filter.Frequency.Input >= 14.225 && filter.Frequency.Input <= 14.350) ||\n (bands.includes(FrequencyBand.$17_m) && filter.Frequency.Input >= 18.068 && filter.Frequency.Input <= 18.110 && (filter.Callsign.includes('CW') || filter.Callsign.includes('RTTY'))) ||\n (bands.includes(FrequencyBand.$17_m) && filter.Frequency.Input >= 18.110 && filter.Frequency.Input <= 18.168) ||\n (bands.includes(FrequencyBand.$15_m) && filter.Frequency.Input >= 21.025 && filter.Frequency.Input <= 21.2 && (filter.Callsign.includes('CW') || filter.Callsign.includes('RTTY'))) ||\n (bands.includes(FrequencyBand.$15_m) && filter.Frequency.Input >= 21.275 && filter.Frequency.Input <= 21.450) ||\n (bands.includes(FrequencyBand.$12_m) && filter.Frequency.Input >= 24.89 && filter.Frequency.Input <= 24.93 && (filter.Callsign.includes('CW') || filter.Callsign.includes('RTTY'))) ||\n (bands.includes(FrequencyBand.$12_m) && filter.Frequency.Input >= 24.93 && filter.Frequency.Input <= 24.99) ||\n (bands.includes(FrequencyBand.$10_m) && filter.Frequency.Input >= 28 && filter.Frequency.Input <= 28.3 && (filter.Callsign.includes('CW') || filter.Callsign.includes('RTTY'))) ||\n (bands.includes(FrequencyBand.$10_m) && filter.Frequency.Input >= 28.3 && filter.Frequency.Input <= 29.7) ||\n (bands.includes(FrequencyBand.$6_m) && filter.Frequency.Input >= 50 && filter.Frequency.Input <= 50.1 && filter.Callsign.includes('CW')) ||\n (bands.includes(FrequencyBand.$6_m) && filter.Frequency.Input >= 50.1 && filter.Frequency.Input <= 54) ||\n (bands.includes(FrequencyBand.$2_m) && filter.Frequency.Input >= 144 && filter.Frequency.Input <= 144.1 && filter.Callsign.includes('CW')) ||\n (bands.includes(FrequencyBand.$2_m) && filter.Frequency.Input >= 144.1 && filter.Frequency.Input <= 148) ||\n (bands.includes(FrequencyBand.$1_25_m) && filter.Frequency.Input >= 222 && filter.Frequency.Input <= 225) ||\n (bands.includes(FrequencyBand.$70_cm) && filter.Frequency.Input >= 420 && filter.Frequency.Input <= 450) ||\n (bands.includes(FrequencyBand.MURS) && filter.Frequency.Input >= 151.82 && filter.Frequency.Input <= 154.6) ||\n (bands.includes(FrequencyBand.GMRS) && filter.Frequency.Input >= 462.55 && filter.Frequency.Input <= 467.7125);\n }", "title": "" }, { "docid": "dd9b625173133fa6b3bb3655e0806b32", "score": "0.5119464", "text": "reApplyFilter(filter) {\r\n console.log(\"geography:: reapply\", filter);\r\n this.drawnitems.clearLayers();\r\n if (filter.region != undefined) {\r\n //???\r\n }\r\n if (filter.topLeft != undefined) {\r\n // fixme box in wrong place\r\n var bounds = [[filter.bottomRight[1], filter.topLeft[0]], [filter.topLeft[1], filter.bottomRight[0]]];\r\n // create an orange rectangle\r\n console.log(bounds);\r\n L.rectangle(bounds).addTo(this.drawnitems);\r\n// this.drawnitems.addLayer();\r\n }\r\n Filters.addSpatial(filter,true);\r\n \r\n }", "title": "" }, { "docid": "fd4311b18ff778876ad43db9213a67da", "score": "0.51169896", "text": "onSlcChange() {\n if (this.tf.onSlcChange) {\n this.tf.filter();\n }\n }", "title": "" }, { "docid": "774a6d7cad816dba0d94edc746bb3b3a", "score": "0.50817776", "text": "function serialEvent() {\n // read a line of incoming data:\n var inData = serial.readLine();\n // if the line is not empty, parse it to JSON:\n if (inData) {\n //.log(inData);\n sensorReadings = inData.split(\",\");\n // console.log(sensorReadings.length);\n // console.log(sensorReadings);\n // if ( sensorReadings.length <= 7 ){\n if ( (sensorReadings[3] == \"low(dark) \") || (sensorReadings[3] == 'high(bright) ' )){\n //console.log(\"feature\");\n // console.log(sensorReadings);\n DISPLAY_STATE = FEATURE;\n sensorValue = parseInt(sensorReadings[0]);\n filteredValue = parseInt(sensorReadings[1]);\n featureThreshold = parseInt(sensorReadings[2]);\n threshold_state = (sensorReadings[3]);\n change_state = sensorReadings[4];\n edge_state = sensorReadings[5];\n\n\n\n } else {\n DISPLAY_STATE = FILTER;\n //console.log(\"filter\");\n //let sensorValue , sensorAverage, sensorMovingAverage, sensorEMA, sensorMedian, sensorFlatten, min,mid,max;\n sensorValue = parseInt(sensorReadings[0]);\n sensorAverage = parseInt(sensorReadings[1]);\n sensorMovingAverage = parseInt(sensorReadings[2]);\n sensorEMA = parseInt(sensorReadings[3]);\n sensorMedian = parseInt(sensorReadings[4]);\n sensorFlatten = parseInt(sensorReadings[5]);\n\n min = parseInt(sensorReadings[6]);\n mid = parseInt(sensorReadings[7]);\n max = parseInt(sensorReadings[8]);\n }\n\n\n\n } // end indata\n} // serialEvent", "title": "" }, { "docid": "384a57892a4a9d8ae0291d89234dd425", "score": "0.5073323", "text": "function updateUIOnFilterChanges() {\n TweenLite.to(_mainScrollEl, 1, {scrollTop: 0, ease: Quad.easeIn});\n }", "title": "" }, { "docid": "4f6285f0654f99fa97bd8f8f638bb89c", "score": "0.50650764", "text": "updateMetrics() {\n const maxLevel = 24;\n const minLevel = 16;\n let len = this.sampleData.length;\n // calculate if the pump kicked in - we need 15 values for the filter\n if (len >= 15) {\n let rangeFirst = len - 15;\n // 24 is the level where we typically start pumping\n // if we're at that level (or higher) and if we saw a dip going down, \n // let's see if we went through pumping\n if (this.sampleData[rangeFirst].l >= maxLevel && this.sampleData[rangeFirst + 1].l < this.sampleData[rangeFirst].l) {\n let minRangeLevel = 30;\n let maxRangeLevel = 0;\n // calculate min and max over our range\n for (let i = rangeFirst; i < len; i++) {\n minRangeLevel = Math.min(minRangeLevel, this.sampleData[i].l);\n maxRangeLevel = Math.max(maxRangeLevel, this.sampleData[i].l);\n }\n // if within this range the values exceeded max (maxLevel) and min (minLevel)\n // than the pump is pumping and we need to update metrics + record the event\n if (minRangeLevel <= minLevel && maxRangeLevel >= maxLevel) {\n // this is the time of the last device report (unix time)\n let time = this.sampleData[len - 1].t;\n // this may be the first one we're seeing.\n if (this.time > 0) {\n // The interval is in minutes. The time on the reports is Unix time \n // and therefore in seconds -> convert to minutes by x/60 \n this.interval = Math.round((time - this.time) / 60);\n console.log(\"New Interval: \", this.interval);\n }\n // remember when we saw it pumping. \n this.time = time;\n this.recordEvent(time);\n return true;\n }\n }\n }\n return false;\n }", "title": "" }, { "docid": "87499bf81f4a6ba215066270cf8b83ea", "score": "0.5064094", "text": "function updateThermometer() {\n\n var tempOffset = 5.0,\n thermoBackgroundOffset = 4.1;\n\n //Update current temperature\n $scope.thermo.series[1].data =\n [parseFloat($scope.current.outTemp.value)];\n //Set height of background rectangle \n $scope.thermo.series[0].data =\n [parseFloat($scope.current.tempMaxValueT.value) +\n thermoBackgroundOffset];\n //Update Thermometer Scales\n $scope.thermo.yAxis[0].max =\n parseFloat($scope.current.tempMaxValueT.value) + tempOffset;\n $scope.thermo.yAxis[0].min =\n parseFloat($scope.current.tempMinValueT.value) - tempOffset;\n\n //Set High Tick position\n $scope.thermo.yAxis[1].max =\n parseFloat($scope.current.tempMaxValueT.value) + tempOffset;\n $scope.thermo.yAxis[1].min =\n parseFloat($scope.current.tempMinValueT.value) - tempOffset;\n $scope.thermo.yAxis[1].tickPositions =\n [parseFloat($scope.current.tempMaxValueT.value)];\n\n //Set Low Tick position\n $scope.thermo.yAxis[2].max =\n parseFloat($scope.current.tempMaxValueT.value) + tempOffset;\n $scope.thermo.yAxis[2].min =\n parseFloat($scope.current.tempMinValueT.value) - tempOffset;\n $scope.thermo.yAxis[2].tickPositions =\n [parseFloat($scope.current.tempMinValueT.value)];\n }", "title": "" }, { "docid": "fd14f695d14b5dff9e3fd5307b502c79", "score": "0.5062388", "text": "update() {\n this._debounceFilter();\n }", "title": "" }, { "docid": "caa2be32ddcc73021312a41954567f0f", "score": "0.50470704", "text": "_updateVisibility() {\n\n\t\t\tconsole.log('ResistanceMatrixController: filters are %o', this.filters);\n\n\t\t\tif (!this._data) return;\n\n\n\n\t\t\t// Filter BACTERIA\n\t\t\tthis._data.forEach((bacterium) => {\n\t\t\t\tconst match = this._matchesFilter(bacterium.bacterium, this.filters.bacterium);\n\t\t\t\tbacterium.bacterium.hidden = !match;\n\t\t\t});\n\n\n\n\t\t\t// Filter ANTIBIOTICS\n\t\t\tconst antibiotics = this._data[0].antibiotics;\n\n\t\t\t// Get indexes of all visible antibiotics; we only want to calculate the filters once\n\t\t\tconst visibleAntibioticIndexes = [];\n\t\t\tantibiotics.forEach((cell, index) => {\n\t\t\t\tif (this._matchesFilter(cell.antibiotic, this.filters.antibiotic)) {\n\t\t\t\t\tvisibleAntibioticIndexes.push(index);\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\t// Go through rows, then antibiotics, and update the «hidden» property on them\n\t\t\tthis._data.forEach((row) => {\n\t\t\t\trow.antibiotics.forEach((ab, abIndex) => {\n\t\t\t\t\tab.hidden = visibleAntibioticIndexes.indexOf(abIndex) > -1 ? false : true;\n\t\t\t\t});\n\t\t\t});\n\n\n\t\t\t// Filter DIAGNOSIS (bacteria)\n\t\t\t// Must be in addition to bacteria filter above\n\t\t\tconst diagnosisFilter = this.filters.diagnosis;\n\t\t\t// Loop types (name etc.)\n\t\t\tconst allValidBacteria = [];\n\t\t\tObject.keys(diagnosisFilter).forEach((type) => {\n\t\t\t\tdiagnosisFilter[type][0].containers[0].bacteria.forEach((bacterium) => {\n\t\t\t\t\tallValidBacteria.push(bacterium.id);\n\t\t\t\t});\n\t\t\t});\n\t\t\t// If filter was not set (length 0), then don't filter. Else do.\n\t\t\tif (allValidBacteria.length > 0) {\n\t\t\t\tthis._data.forEach((bacterium) => {\n\t\t\t\t\t// Hide in addition to filter above\n\t\t\t\t\tif (allValidBacteria.indexOf(bacterium.bacterium.id) === -1) bacterium.bacterium.hidden = true;\n\t\t\t\t});\n\t\t\t}\n\n\n\n\t\t\tthis._matrix.updateData(this._data);\n\n\n\t\t}", "title": "" }, { "docid": "62e7c58d72f9c701be031bf8b6590427", "score": "0.5035964", "text": "function updateFilters() {\n let filteredDate = d3.select(\"#datetime\");\n if (filteredDate.on('change')) {\n filters[\"datetime\"] = filteredDate.property(\"value\")\n } else {\n filters['datetime'] = null\n };\n \n let filteredCity = d3.select(\"#selcity\");\n if (filteredCity.on('change')) {\n filters[\"city\"] = filteredCity.property(\"value\")\n } else {\n filters['city'] = null\n };\n\n let filteredState = d3.select(\"#selstate\");\n if (filteredState.on('change')) {\n filters[\"state\"] = filteredState.property(\"value\")\n } else {\n filters['state'] = null\n };\n\n let filteredCountry = d3.select(\"#selcountry\");\n if (filteredCountry.on('change')) {\n filters[\"country\"] = filteredCountry.property(\"value\")\n } else {\n filters['country'] = null\n };\n\n let filteredShape = d3.select(\"#filter-shape\");\n if (filteredShape.on('change')) {\n filters[\"shape\"] = filteredShape.property(\"value\")\n } else {\n filters['shape'] = null\n };\n \n filterTable();\n}", "title": "" }, { "docid": "2480ca9eeecaec341e9361d5f76e2853", "score": "0.50221276", "text": "function processFilters() {\n var band_name = d3.select('#sel-band').node().value;\n var year = d3.select('#sel-year').node().value;\n\n buildChart(band_name, year);\n populateMap(band_name, year);\n}", "title": "" }, { "docid": "d40d7acc363c73b69db5db0ed1d71843", "score": "0.5020967", "text": "function updateFilters() {\n\n // Prevent the page from refreshing\n d3.event.preventDefault();\n\n // Select the input elements and get the value property of them\n filters.datetime = d3.select(\"#datetime\").property(\"value\");\n filters.city = d3.select(\"#city\").property(\"value\").toLowerCase();\n filters.state = d3.select(\"#state\").property(\"value\").toLowerCase();\n filters.country = d3.select(\"#country\").property(\"value\").toLowerCase();\n filters.shape = d3.select(\"#shape\").property(\"value\").toLowerCase();\n\n // Initialze filteredData with all data\n var filteredData = tableData\n\n // Iterate through filter object\n Object.entries(filters).forEach(([key, input]) => {\n // Check if user input does exist\n if (input) {\n // Filter data\n filteredData = filteredData.filter(sighting =>\n sighting[key] === input);\n }\n });\n // Render the table with filtered data\n buildTable(filteredData);\n}", "title": "" }, { "docid": "34ac49c3ec3ac437156614667c16a338", "score": "0.50167865", "text": "function initWave() {\n\taddNewFilters(tracks);\n}", "title": "" }, { "docid": "b280c22b3fa4d53e51155bae53c6f259", "score": "0.501497", "text": "filter() {\n let attribute = this.geometry.attributes[this.attribute];\n let isHue = (this.attribute === 'color') && (this.attributeIndex === 0);\n\n for (let i = 0; i < attribute.data.length; i += attribute.attributeLength) {\n let value = attribute.data[i + this.attributeIndex];\n\n if (isHue) {\n value = Color.floatToHsl(value)[0];\n }\n\n let size = this.geometry.attributes['color'].data[i + 2];\n if (value > this.max || value < this.min) {\n this.geometry.attributes['color'].data[i + 2] = -Math.abs(size);\n } else {\n this.geometry.attributes['color'].data[i + 2] = Math.abs(size);\n }\n }\n\n this.geometry.updateAttribute('color');\n }", "title": "" }, { "docid": "aa8c2ea6fbf6f6b3580e04e71bd1cf1a", "score": "0.50041276", "text": "function updateFilters() {\n // console.log(\"in da updateFilters Funk\");\n\n // extract the value and id updated in the html filters\n let filterValue = d3.select(this).property(\"value\").toLowerCase();\n let filterId = d3.select(this).property(\"id\");\n\n // console.log(filterValue, filterId);\n\n // add the pair to the table filter\n if (filterValue) {\n tableFilters[filterId] = filterValue;\n } else {\n delete tableFilters[filterId];\n }\n\n // Call function to apply all filters and rebuild the table\n filterTable();\n}", "title": "" }, { "docid": "afceff314bc42478b939a679aeeb1115", "score": "0.49997288", "text": "function onDocumentReady() {\n\n\n document.getElementById('lowPassFreq').addEventListener('input', (e) => {\n let value = parseInt(e.target.value);\n document.getElementById('lowPassFreqLabel').innerText = value.toLocaleString('en');\n lowPassFilter.frequency.value = value;\n });\n document.getElementById('highPassFreq').addEventListener('input', (e) => {\n let value = parseInt(e.target.value);\n document.getElementById('highPassFreqLabel').innerText = value.toLocaleString('en');\n highPassFilter.frequency.value = value;\n });\n\n document.getElementById('fftSize').addEventListener('change', (e) => {\n analyser.fftSize = parseInt(e.target.value);\n });\n document.getElementById('smoothingTimeConstant').addEventListener('input', (e) => {\n analyser.smoothingTimeConstant = parseInt(e.target.value) / 100.0;\n console.log('Smoothing time constant is: ' + analyser.smoothingTimeConstant);\n });\n visualiser = new Visualiser(document.getElementById('visualiser'));\n\n // Initalised microphone\n navigator.getUserMedia(\n { audio: true },\n onMicSuccess,\n error => { console.error('Could not init microphone', error); });\n}", "title": "" }, { "docid": "3134430eaa0f11aab438669f98a483f0", "score": "0.49855176", "text": "function applyFilters(checkedValues) {\n var serviceLayer;\n var providerLayer;\n\n // create a layer based on common markers among the service filters\n var serviceChecked = false;\n for (var i = 0; i < checkedValues.length; i++) {\n var value = checkedValues[i];\n\n switch (value) {\n case 'accepts_snap':\n // if this is the first service filter then take all the markers of the filter\n // else take only the common markers \n if (serviceChecked == false) {\n serviceLayer = filterLayers['accepts_snap'];\n serviceChecked = true;\n }\n else\n serviceLayer = intersectLayers(serviceLayer, filterLayers['accepts_snap']);\n break;\n\n case 'accepts_wic':\n // if this is the first service filter then take all the markers of the filter\n // else take only the common markers \n if (serviceChecked == false) {\n serviceLayer = filterLayers['accepts_wic'];\n serviceChecked = true;\n }\n else\n serviceLayer = intersectLayers(serviceLayer, filterLayers['accepts_wic']);\n break;\n\n case 'community_meals':\n // if this is the first service filter then take all the markers of the filter\n // else take only the common markers \n if (serviceChecked == false) {\n serviceLayer = filterLayers['community_meals'];\n serviceChecked = true;\n }\n else\n serviceLayer = intersectLayers(serviceLayer, filterLayers['community_meals']);\n break;\n\n case 'delivery_available':\n // if this is the first service filter then take all the markers of the filter\n // else take only the common markers \n if (serviceChecked == false) {\n serviceLayer = filterLayers['delivery_available'];\n serviceChecked = true;\n }\n else\n serviceLayer = intersectLayers(serviceLayer, filterLayers['delivery_available']);\n break;\n\n case 'emergency_food_needs':\n // if this is the first service filter then take all the markers of the filter\n // else take only the common markers \n if (serviceChecked == false) {\n serviceLayer = filterLayers['emergency_food_needs'];\n serviceChecked = true;\n }\n else\n serviceLayer = intersectLayers(serviceLayer, filterLayers['emergency_food_needs']);\n break;\n }\n }\n\n // create a layer based on all markers among the provider filters\n var providerChecked = false;\n for (var i = 0; i < checkedValues.length; i++) {\n var value = checkedValues[i];\n\n switch (value) {\n case 'farms_producers_markets':\n // if this is the first provider filter then take all the markers of this filter\n // else take all the markers from all the provider filters check so far \n if (providerChecked == false) {\n providerLayer = filterLayers['farms_producers_markets'];\n providerChecked = true;\n }\n else\n providerLayer = uniteLayers(providerLayer, filterLayers['farms_producers_markets']);\n break;\n\n case 'food_bank_pantry':\n // if this is the first provider filter then take all the markers of this filter\n // else take all the markers from all the provider filters check so far \n if (providerChecked == false) {\n providerLayer = filterLayers['food_bank_pantry'];\n providerChecked = true;\n }\n else\n providerLayer = uniteLayers(providerLayer, filterLayers['food_bank_pantry']);\n break;\n\n case 'business_org':\n // if this is the first provider filter then take all the markers of this filter\n // else take all the markers from all the provider filters check so far \n if (providerChecked == false) {\n providerLayer = filterLayers['business_org'];\n providerChecked = true;\n }\n else\n providerLayer = uniteLayers(providerLayer, filterLayers['business_org']);\n break;\n\n case 'restaurant_bakery':\n // if this is the first provider filter then take all the markers of this filter\n // else take all the markers from all the provider filters check so far \n if (providerChecked == false) {\n providerLayer = filterLayers['restaurant_bakery'];\n providerChecked = true;\n }\n else\n providerLayer = uniteLayers(providerLayer, filterLayers['restaurant_bakery']);\n break;\n\n case 'retail':\n // if this is the first provider filter then take all the markers of this filter\n // else take all the markers from all the provider filters check so far \n if (providerChecked == false) {\n providerLayer = filterLayers['retail'];\n providerChecked = true;\n }\n else\n providerLayer = uniteLayers(providerLayer, filterLayers['retail']);\n break;\n\n case 'schools_childcare':\n // if this is the first provider filter then take all the markers of this filter\n // else take all the markers from all the provider filters check so far \n if (providerChecked == false) {\n providerLayer = filterLayers['schools_childcare'];\n providerChecked = true;\n }\n else\n providerLayer = uniteLayers(providerLayer, filterLayers['schools_childcare']);\n break;\n\n case 'shelters':\n // if this is the first provider filter then take all the markers of this filter\n // else take all the markers from all the provider filters check so far \n if (providerChecked == false) {\n providerLayer = filterLayers['shelters'];\n providerChecked = true;\n }\n else\n providerLayer = uniteLayers(providerLayer, filterLayers['shelters']);\n break;\n }\n\n }\n\n // if both the service layer and the provider layer are empty\n if (typeof serviceLayer == 'undefined' && typeof providerLayer == 'undefined') {\n return;\n }\n // if only provider layer is empty because no provider filter was selected then show the service layer markers\n else if (typeof serviceLayer != 'undefined' && typeof providerLayer == 'undefined' && providerChecked == false) {\n currentLayer = serviceLayer;\n }\n // if only provider layer is empty but provider filter(s) were selected then the common marker set will be empty\n else if (typeof serviceLayer != 'undefined' && typeof providerLayer == 'undefined' && providerChecked == true) {\n return;\n }\n // if only service layer is empty because on service filter was selected then show the provider layer markers\n else if (typeof serviceLayer == 'undefined' && typeof providerLayer != 'undefined' && serviceChecked == false) {\n currentLayer = providerLayer;\n }\n // if only service layer is empty but service filter(s) were selected then the common marker set will be empty \n else if (typeof serviceLayer == 'undefined' && typeof providerLayer != 'undefined' && serviceChecked == true) {\n return;\n }\n // otherwise find the common markers between the two layers\n else {\n currentLayer = intersectLayers(serviceLayer, providerLayer);\n }\n\n currentLayer = addMarkerProperties(currentLayer);\n currentLayer.addTo(map);\n}", "title": "" }, { "docid": "a20fc5a05557cb7055be0cf0682d1722", "score": "0.49708515", "text": "function updateFilters(){\n const filters = {\n datetime:d3.select(\"#datetime\").property(\"value\"),\n city:d3.select(\"#city\").property(\"value\"),\n state:d3.select(\"#state\").property(\"value\"),\n country:d3.select(\"#country\").property(\"value\"),\n shape:d3.select(\"#shape\").property(\"value\")\n };\n \n // Call function to apply all filters and rebuild the table:\n filterTable(filters)\n}", "title": "" }, { "docid": "cdca8d191ee900b366ecdaa9155194cf", "score": "0.49668595", "text": "function updateSolrFilter() {\t\n\t// Borramos todos los filtros previos\n\tManager.store.remove('fq');\n\n\tvar tempString = \"\";\n\tvar sliderArray = [];\n\n\tvar i = 0;\n\t// Hacemos AND para diferentes propiedades y OR para los que estén activos dentro de una misma propiedad\n\t// Por ejemplo: province:Madrid OR province:Barcelona AND type:Universidad\n\t$.each(vm.activeWidgets(), function (index1, item1) {\n\t\ti = 0;\n\t\ttempString = \"\";\n\n\t\tif (item1.field != undefined) {\n\t\t\tvar catParent = item1.field();\n\t\t} else {}\n\t\tif (item1.type() == \"tagcloud\") {\n\t\t\t$.each(item1.values(), function (index2, item2) {\n\t\t\t\tif (item2.state() == true) {\n\t\t\t\t\tif (i == 0) {\n\t\t\t\t\t\ttempString += catParent + ':\"' + item2.name() + '\"';\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttempString += ' OR ' + catParent + ':\"' + item2.name() + '\"';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tManager.store.addByValue('fq', tempString);\n\t\t}\n\n\t\t// Preparación de los filtros tipo slider\n\t\tif (item1.type() == \"slider\") {\n\t\t\tvar catParent = item1.field();\n\n\t\t\tvar str = item1.values().toString();\n\t\t\tvar n = str.replace(\",\", \" TO \");\n\n\t\t\tsliderArray.push({\n\t\t\t\t'type': catParent,\n\t\t\t\t'filter': ':[' + n + ']'\n\t\t\t});\n\n\t\t}\n\t});\n\n\tvar string = \"\";\n\tvar usedType = [];\n\n\t// Para los filtros de tipo slider, si el tipo es el mismo aplicamos OR y si son distintos, AND\n\tfor (var i = 0; i < sliderArray.length; i++) {\n\t\tif (i == 0) {\n\t\t\tusedType.push(sliderArray[i].type);\n\t\t\tstring += sliderArray[i].type + sliderArray[i].filter;\n\t\t} else {\n\t\t\tvar exists = false;\n\t\t\tfor (var j = 0; j < usedType.length; j++) {\n\t\t\t\tif (sliderArray[i].type == usedType[j]) {\n\t\t\t\t\tstring += ' OR ' + sliderArray[i].type + sliderArray[i].filter;\n\t\t\t\t\texists = true;\n\t\t\t\t} else {\n\t\t\t\t\texists = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!exists) {\n\t\t\t\tstring += ' AND ' + sliderArray[i].type + sliderArray[i].filter;\n\t\t\t\tusedType.push(sliderArray[i].type);\n\t\t\t}\n\n\t\t}\n\t}\n\n\tManager.store.addByValue('fq', string);\n\n\tManager.doRequest();\n}", "title": "" }, { "docid": "34bbf500f4f16de9e906ef26ae71b264", "score": "0.4966317", "text": "function updateFilteredRects(){\n\t// //console.log(\" xxx !! \");\n\t//remove the filter rect\n\t// $(\".filter_barrect\").remove();\n\tif(!g_CrossFilterInfo.isSetFiltering()){\n\t\t// //console.log(\" [1] \");\n\t\t//no filtering constraint\n\t\t//hidden the background rect\n\t\td3.selectAll(\".barrect\")\n\t\t.attr('invisible', 'hidden');\n\t}else{\n\t\t// //console.log(\" [2] \");\n\t\t//show the background rect\t\t\n\t\td3.selectAll(\".barrect\")\n\t\t.attr('invisible', 'visible');\n\t}\n\n\t//update the filtered bars\n\tvar liFilteredId = g_CrossFilterInfo.getFilterEleIds();\n\tvar iGroupId = g_ObjectGroupManager.getSelectedGroupId();\n\tvar propertyBag = g_PropertyManager.getPropertyBag(iGroupId);\n\tpropertyBag.setFilterEldIds(liFilteredId);\n\n\t// //console.log(' &&&& filter Ele Id Number = ', liFilteredId.length);\n\n\t//for each property, add the filter_bar rects\n\tvar mapPropertyIdFilterIdsDistri = propertyBag.getPropertyIdFilteredEleDis();\n\n\tfor(var iPId in mapPropertyIdFilterIdsDistri){\n\t\n\t\tvar liDistri = mapPropertyIdFilterIdsDistri[iPId];\n\t\tvar propertyType = propertyBag.getPropertyTypebyId(iPId);\n\n\t\tvar xScale = propertyBag.getXScaleOfPropertyId(iPId);\n\t\tvar yScale = propertyBag.getYScaleOfPropertyId(iPId);\n\n\t\tvar xAxisLength = $('#dis_' + iPId +' svg').width();\n\t\tvar yAxisLength = $('#dis_' + iPId +' svg').height();\n\n\t\tvar barWidth = xAxisLength/liDistri.length;\n\t\tvar barRatio = 0.95;//0.8;\n\t\tvar baseLineY = yAxisLength;\n\t\t\n\t\td3.selectAll('#dis_' + iPId + ' .filter_barrect')\n\t\t.data(liDistri)\n\t\t.attr('y', function(d, i){\n\t\t\treturn yScale(d);\n\t\t\t// if(d == 0)\n\t\t\t// \treturn baseLineY;\n\t\t\t// return baseLineY - yScale(d);\n\t\t})\n\t\t.attr('height', function(d, i){\n\t\t\tif(d == 0)\n\t\t\t\treturn 0;\n\t\t\t// return yScale(d);\n\t\t\treturn baseLineY - yScale(d);\n\t\t})\n\t\t.style('opacity', function(){\n\t\t\treturn 1;\n\t\t});\n\n\t\tif(g_CrossFilterInfo.isSetConstraintOnProperty(iPId) == false)\n\t\t\td3.selectAll('#dis_' + iPId + ' .filter_barrect')\n\t\t\t.style('stroke', 'none');\n\t}\n\n\t//update the scatter plot\n\tvar liSPId = propertyBag.getScatterPlotIds();\n\t\n\tfor (var i = 0; i < liSPId.length; i++) {\n\n\t\tvar iSPID = liSPId[i];\n\n\t\tvar bBlackHighlight = g_CrossFilterInfo.isScatterPlotSetFilterConstraint(iSPID);\n\n\t\tvar sizeScale = propertyBag.getSizeScalebySPID(iSPID);\n\t\tvar xScale = propertyBag.getXScalebySPID(iSPID);\n\t\tvar spConfig = propertyBag.getScatterPlotConfig(iSPID);\n\t\tvar liFilterDis = propertyBag.getFilteredSPDis(iSPID);\n\n\t\tvar liFilterIndex = [];\n\t\tfor (var j = 0; j < liFilterDis.length; j++) {\n\t\t\tvar temp = liFilterDis[j];\n\t\t\tliFilterIndex.push(temp['index']);\n\t\t};\n\n\t\t//console.log(' filter dis ', liFilterDis, ' liFilterIndex ', liFilterIndex, ' size ', liFilterIndex.length);\n\n\t\tvar xAxisLength = $('#scatterplot_' + iSPID).width();\n\t\tvar rectWidth = 1. * xAxisLength/(spConfig.ixBinNum);\n\n\t\tvar selectedRect = 0;\n\n\t\t//selected\n\t\t//console.log('#scatterplot_' + iSPID);\n\n\t\td3.selectAll('#scatterplot_' + iSPID + ' .scatter_plot_bar')\n\t\t.filter(function(d, i){\n\t\t\t//console.log('d ', d);\n\t\t\tvar iIndex = d['index'];\n\t\t\tif(liFilterIndex.indexOf(iIndex) != -1){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t})\t\n\t\t.style('stroke', function(){\n\t\t\tif(bBlackHighlight)\n\t\t\t\treturn 'black';\n\t\t\telse\n\t\t\t\treturn '#bdbdbd';\n\t\t})\n\t\t.style('stroke-width', function(){\n\t\t\tif(bBlackHighlight)\n\t\t\t\treturn '1px';\n\t\t\telse\n\t\t\t\treturn '0.5px';\n\t\t})\n\t\t.style('opacity', 1.)\n\t\t.attr('width', function(d){\t\t\n\t\t\tvar iIndex = d['index'];\n\t\t\t// var value = d['count'];\n\t\t\tvar indexOf = liFilterIndex.indexOf(iIndex);\t\t\n\t\t\tvar value = liFilterDis[indexOf]['count'];\n\t\t\treturn rectWidth * 0.3 + rectWidth * 0.7 * sizeScale(value) + 'px';\n\t\t})\n\t\t.attr('x', function(d){\n\t\t\tvar iIndex = d['index'];\n\t\t\t// var value = d['count'];\n\t\t\tvar indexOf = liFilterIndex.indexOf(iIndex);\t\t\n\t\t\tvar value = liFilterDis[indexOf]['count'];\n\t\t\tvar xyIndex = spConfig.getXYIndex(iIndex);\n\n\t\t\tvar barwidth = rectWidth * 0.3 + rectWidth * 0.7 * sizeScale(value);\n\t\t\t// //console.log(\" x \", xyIndex.x, ' , ', xScale(xyIndex.x) - rectWidth/2.);\n\t\t\treturn xScale(xyIndex.x) + rectWidth/2. - barwidth/2. + 'px';\n\t\t});\n\n\t\t//unselected\n\t\td3.selectAll('#scatterplot_' + iSPID + ' .scatter_plot_bar')\n\t\t.filter(function(d, i){\n\t\t\tvar iIndex = d['index'];\n\t\t\tif(liFilterIndex.indexOf(iIndex) == -1){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t})\n\t\t.style('stroke', '#bdbdbd')\n\t\t.style('stroke-width', '0.5px')\n\t\t.style('opacity', 0.3);\n\t};\n}", "title": "" }, { "docid": "dc4cfa6d99cf6e9278e474220038669f", "score": "0.49661407", "text": "function applyFilters(){\n var dataArray = new Array;\n for(var o in dimensions) {\n dataArray.push(dimensions[o]);\n }\n $('#Grid').mixitup('filter',dataArray);\n }", "title": "" }, { "docid": "2b6776b412ff21a056f8d74720ae1d1a", "score": "0.49612522", "text": "removeWeakEvents(intensityMin) {\n this.eventList = this.eventList.filter(function(item) {\n return item.intensity > intensityMin;\n });\n }", "title": "" }, { "docid": "829878a689adbded7524d47c7fab87af", "score": "0.49580747", "text": "function updateFilterSliders () {\n\n const newSelectionType = getFilterRadioValue();\n\n if (previousSelectionType === FILTER_LOW) {\n\n if (newSelectionType === FILTER_BAND) {\n\n bandPassFilterSlider.setValue([0, lowPassFilterSlider.getValue()]);\n\n } else if (newSelectionType === FILTER_HIGH) {\n\n highPassFilterSlider.setValue(lowPassFilterSlider.getValue());\n\n }\n\n } else if (previousSelectionType === FILTER_HIGH) {\n\n if (newSelectionType === FILTER_BAND) {\n\n bandPassFilterSlider.setValue([highPassFilterSlider.getValue(), bandPassFilterSlider.getAttribute('max')]);\n\n } else if (newSelectionType === FILTER_LOW) {\n\n lowPassFilterSlider.setValue(highPassFilterSlider.getValue());\n\n }\n\n } else if (previousSelectionType === FILTER_BAND) {\n\n if (newSelectionType === FILTER_LOW) {\n\n lowPassFilterSlider.setValue(Math.max(...bandPassFilterSlider.getValue()));\n\n } else if (newSelectionType === FILTER_HIGH) {\n\n highPassFilterSlider.setValue(Math.min(...bandPassFilterSlider.getValue()));\n\n }\n\n }\n\n if (newSelectionType !== FILTER_NONE) {\n\n previousSelectionType = newSelectionType;\n\n }\n\n}", "title": "" }, { "docid": "3eadfeca85dce87f0dd8e25f12830731", "score": "0.49436712", "text": "function update_filter(filter, trips) {\n console.log(filter)\n let filtered_trips = [];\n for (let i = 0, len = trips.length; i < len; i++) {\n let trip = trips[i];\n let has = true;\n Object.keys(filter).forEach(function(attribute) {\n if (filter[attribute].indexOf(trip[attribute]) < 0) {\n has = false;\n }\n });\n if (has) {\n filtered_trips.push(trip);\n }\n }\n\n\n //$('#dataview-summary').html(display_summary);\n\n // Draw map here\n vis_draw_histogram(filtered_trips);\n map_show_filtered_trips(filtered_trips);\n vis_model_cases(filtered_trips, 'model-cases-body');\n\n return;\n }", "title": "" }, { "docid": "05e96b5d7b64043ed89df07d4cf6cea2", "score": "0.49430642", "text": "function filterMessage(client, inputName, msg) {\n client.complete(msg, printResultFor('Receiving message'));\n //console.log('Inside filter method - Jojo Koshy -v3');\n if (inputName === 'input1') {\n console.log('Inside Input 1 condition filter method - Jojo Koshy -v3');\n var message = msg.getBytes().toString('utf8');\n var messageBody = JSON.parse(message);\n var messagedatabody = JSON.stringify(messageBody);\n console.log('Message received from tempSensor ' + messagedatabody);\n if (messageBody && messageBody.rhSensor && messageBody.rhSensor.temperature && messageBody.rhSensor.temperature > temperatureThreshold) {\n console.log(`Machine temperature ${messageBody.rhSensor.temperature} exceeds threshold ${temperatureThreshold}`);\n var outputMsg = new Message(message);\n outputMsg.properties.add('MessageType', 'Alert');\n console.log('Temperature exceeded - Jojo Koshy');\n client.sendOutputEvent('output1', outputMsg, printResultFor('Sending received message'));\n }\n }\n}", "title": "" }, { "docid": "1cdd6adceaad26410c6adc87562ea28c", "score": "0.49372947", "text": "function onUpdate(framework)\n{\n var date = new Date();\n windChanged();\n\n var y_rotation = Math.sin(date.getTime() / 100) * 2 * Math.PI / 180;\n splineObject.rotateY(guiParameters.flappingSpeed * y_rotation);\n // feathers.rotateY(guiParameters.flappingSpeed * y_rotation);\n\n var t =Math.sin(date.getTime() / 100);\n for(var i=0; i<guiParameters.numberOfFeathers ;i++)\n {\n if(feathers.children[i])\n {\n var position = splineGeom.vertices[i];\n feathers.children[i].position.set(position.x, position.y ,position.z + t*i*0.01*guiParameters.flappingMotion);\n }\n }\n\n // feather_Material.uniforms.feathercolor.value = new THREE.Vector3( guiParameters.Layer1ColorR,\n // guiParameters.Layer1ColorG,\n // guiParameters.Layer1ColorB);\n // feather_Material2.uniforms.feathercolor.value = new THREE.Vector3( guiParameters.Layer2ColorR,\n // guiParameters.Layer2ColorG,\n // guiParameters.Layer2ColorB);\n // feather_Material3.uniforms.feathercolor.value = new THREE.Vector3( guiParameters.Layer3ColorR,\n // guiParameters.Layer3ColorG,\n // guiParameters.Layer3ColorB);\n\n\n feather_Material.uniforms.feathercolor.value = [guiParameters.Layer1Color.r/255,\n guiParameters.Layer1Color.g/255,\n guiParameters.Layer1Color.b/255];\n feather_Material2.uniforms.feathercolor.value = [guiParameters.Layer2Color.r/255,\n guiParameters.Layer2Color.g/255,\n guiParameters.Layer2Color.b/255];\n feather_Material3.uniforms.feathercolor.value = [guiParameters.Layer3Color.r/255,\n guiParameters.Layer3Color.g/255,\n guiParameters.Layer3Color.b/255];\n}", "title": "" }, { "docid": "2b61ec07e0acd837395664336fdab8e2", "score": "0.49329948", "text": "function EqualizerDisto(ctx) {\n var filters = [];\n\n // Set filters\n // Fred: 80 for the low end. 10000 useless, use shelf instead...\n [60, 170, 350, 1000, 3500, 10000].forEach(function (freq, i) {\n var eq = ctx.createBiquadFilter();\n eq.frequency.value = freq;\n eq.type = \"peaking\";\n eq.gain.value = 0;\n filters.push(eq);\n });\n\n // Connect filters in serie\n //sourceNode.connect(filters[0]);\n\n for (var i = 0; i < filters.length - 1; i++) {\n filters[i].connect(filters[i + 1]);\n }\n\n // connect the last filter to the speakers\n //filters[filters.length - 1].connect(ctx.destination);\n\n function changeGain(sliderVal, nbFilter) {\n // sliderVal in [-30, +30]\n var value = parseFloat(sliderVal);\n filters[nbFilter].gain.value = value;\n\n // update output labels\n //var output = document.querySelector(\"#gain\" + nbFilter);\n //output.value = value + \" dB\";\n\n // update sliders\n //var numSlider = nbFilter + 1;\n //var slider = document.querySelector(\"#EQ\" + numSlider + \"slider\");\n //slider.value = value;\n\n // refresh amp slider state in the web component GUI\n //var sliderWC = document.querySelector(\"#slider\" + (nbFilter + 1));\n // second parameter set to false will not fire an event\n //sliderWC.setValue(parseFloat(sliderVal).toFixed(0), false);\n }\n\n function setValues(values) {\n values.forEach(function (val, index) {\n changeGain(val, index);\n });\n }\n\n function getValues() {\n var values = [];\n filters.forEach(function (f, index) {\n values.push(f.gain.value);\n });\n return values;\n }\n\n return {\n input: filters[0],\n output: filters[filters.length - 1],\n setValues: setValues,\n getValues: getValues,\n changeGain: changeGain\n };\n}", "title": "" }, { "docid": "ca828afaff696fe950ab89bba63b9956", "score": "0.49315324", "text": "function applyFilters(){\n allFilter(allSections);\n getData(filters);\n}", "title": "" }, { "docid": "76d9c4583d9973431ee5c8e65171b05c", "score": "0.49299252", "text": "function filterHardware(component)\n{\n let aclk, aclkx, afsx, axr0, axr1;\n\n for (let sig in component.signals) {\n let type = component.signals[sig].type;\n if (Common.typeMatches(type, [\"I2S_ACLK\"])) aclk = sig;\n if (Common.typeMatches(type, [\"I2S_ACLKX\"])) aclkx = sig;\n if (Common.typeMatches(type, [\"I2S_AFSX\"])) afsx = sig;\n if (Common.typeMatches(type, [\"I2S_AXR0\"])) axr0 = sig;\n if (Common.typeMatches(type, [\"I2S_AXR1\"])) axr1 = sig;\n }\n\n if (aclk && aclkx && afsx && axr0 && axr1) {\n return ({\n i2sData: {\n McACLK: [aclk],\n McACLKX: [aclkx],\n McAFSX: [afsx],\n McAXR0: [axr0],\n McAXR1: [axr1]\n }\n });\n }\n\n return (null);\n}", "title": "" }, { "docid": "36265356c4b838669f81ced09e83ca88", "score": "0.49276283", "text": "if (minSnowIntensity >= maxSnowStormIntensity)\n\t\t\t\t{\n\t\t\t\t\tminSnowIntensity = maxSnowStormIntensity;\n\t\t\t\t}", "title": "" }, { "docid": "ed2a7e3484354df799433c0e359548b5", "score": "0.49267712", "text": "function filter() {\n\n\t\t\tif (document.getElementById(\"FilterRadio1\").checked) {\n\t\t\t\t// set all filtered items to null\n\t\t\t\tmarkerRhinturk.setMap(null);\n\t\t\t\tmarkercornershop.setMap(map);\n\t\t\t\tmarkerKellockBank.setMap(map);\n\t\t\t\tmarkerMorganMcVeighs.setMap(map);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\telse if (document.getElementById(\"FilterRadio2\").checked) {\n\t\t\t\tmarkercornershop.setMap(null);\n\t\t\t\tmarkerRhinturk.setMap(map);\n\t\t\t\tmarkerKellockBank.setMap(null);\n\t\t\t\tmarkerMorganMcVeighs.setMap(null);\n\t\t\t}\n\t\t\t\n\t\t\telse if (document.getElementById(\"FilterRadio3\").checked) {\n\t\t\t\t// Nothing needed right now so bring everything back.\n\t\t\t\tmarkerRhinturk.setMap(map);\n\t\t\t\tmarkercornershop.setMap(map);\n\t\t\t\tmarkerKellockBank.setMap(map);\n\t\t\t\tmarkerMorganMcVeighs.setMap(map);\n\t\t\t}\n\t\t\t\n\t\t\telse {\n\t\t\t\talert(\"You did not select a filter\"); //incase the user breaks it.\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "1426771fb23ed61b46927866134cf771", "score": "0.49264723", "text": "function drawFilter() {\n filterTab.forEach(function(filter) {\n context.drawImage(document.getElementById(filter), 0, 0, width, height);\n });\n}", "title": "" }, { "docid": "fb60ff03cf73898c8725a918284ea29b", "score": "0.49247485", "text": "function ShockwaveFilter()\n\t{\n\t core.AbstractFilter.call(this,\n\t // vertex shader\n\t null,\n\t // fragment shader\n\t fs.readFileSync(__dirname + '/shockwave.frag', 'utf8'),\n\t // custom uniforms\n\t {\n\t center: { type: 'v2', value: { x: 0.5, y: 0.5 } },\n\t params: { type: 'v3', value: { x: 10, y: 0.8, z: 0.1 } },\n\t time: { type: '1f', value: 0 }\n\t }\n\t );\n\t}", "title": "" }, { "docid": "4109e8130bd2f96eb21037edf8cb3647", "score": "0.49214196", "text": "function filterData(){\n\tfilteredData = data;\n\tif (selections[\"motifs\"].length > 0){\n\t\tfilteredData = filteredData.filter(function(d){\n\t\t\tif (selections[\"motifs\"].find(function(e) {\n\t\t\t\tif (d[\"labels\"].find(function(f){\n\t\t\t\t\treturn f === e;\n\t\t\t\t})) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t})){\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\tdoSelectionFilter(\"genre\", \"genre\");\n\tdoSelectionFilter(\"gender\", \"gender\");\n\n\tif (selections[\"fictionality\"].length === 1){\n\t\tfilteredData = filteredData.filter(function(d){\n\t\t\tif (selections[\"fictionality\"][0] === \"fiction\"){\n\t\t\t\treturn d[\"is_fiction\"] === 1;\n\t\t\t} else {\n\t\t\t\treturn d[\"is_fiction\"] === 0;\n\t\t\t}\n\n\t\t})\n\t}\n\n\n\n\tlet unfilteredData = data.filter(x => !filteredData.includes(x));\n\n\tosd.updateData(filteredData, unfilteredData, selections);\n\tdrawFilters();\n}", "title": "" }, { "docid": "6964f3dea1199aaaa942afb26b2c1533", "score": "0.49149954", "text": "function all_off_white_update(sneakers) {\n\n\t//Update the sneakers array to only contain series where visible is set to true\n\tall_off_white_sneakers_filtered = sneakers.filter(function(sneaker) {\n\t\treturn sneaker['visible'] === true;\n\t});\n\n\t//Update domains of x and y scales\n\tall_off_white_xScale.domain([\n\t\td3.min(all_off_white_sneakers_filtered, function(d) { return d3.min(d.values, function(v) { return v.sale_date; } ) }),\n\t\td3.max(all_off_white_sneakers_filtered, function(d) { return d3.max(d.values, function(v) { return v.sale_date; } ) })\n\t]);\n\t//Add 50 to max sale_price as padding\n\tall_off_white_yScale.domain([0, \n\t\td3.max(all_off_white_sneakers_filtered, function(d) { return d3.max(d.values, function(v) { return v.sale_price + 50; } ) })\n\t]);\n\n\t//console.log(xScale.domain())\n\t//console.log(yScale.domain())\n\n\t//Remove previous lines\n\tall_off_white_svg.selectAll(\".line\").remove();\n\n\t//Remove previous axis\n\tall_off_white_svg.selectAll(\".axis\").remove();\n\n\t//Remove previous legend\n\tall_off_white_legend_svg.selectAll(\".legend\").remove()\n\n\t//Remove previous tooltip items\n\tall_off_white_svg.selectAll(\".focus\").remove();\n\tall_off_white_svg.selectAll(\".tooltip-line\").remove();\n\n\t//Create rest of graph - as per filtered sneakers\n\tall_off_white_createGraph(all_off_white_sneakers_filtered);\n\t//Create legend - as per full sneakers dataframe\n\tall_off_white_createLegend(sneakers);\n\n}", "title": "" }, { "docid": "f8b5f48706ba9e5d40f8bfa22f93f7b2", "score": "0.49092108", "text": "function filterLevel(){\r\n\tlevel = document.getElementById(\"levelFilter\").value\r\n\t//if(use>0){schoolMarker.remove(performMap)}\r\n}", "title": "" }, { "docid": "7bc4ddbadb539a9fbe052bee22e4eda2", "score": "0.4902546", "text": "function remove_from_filters(){\n\n}", "title": "" }, { "docid": "d99aa119e49ca2b0d26693046a4fe07f", "score": "0.49001443", "text": "function applyWWWCRegion(eventData) {\n\t var toolData = cornerstoneTools.getToolState(eventData.element, toolType);\n\t if (!toolData) {\n\t return;\n\t }\n\n\t if (!toolData.data.length) {\n\t return;\n\t }\n\n\t var startPoint = toolData.data[0].startPoint;\n\t var endPoint = toolData.data[0].endPoint;\n\n\t // Get the rectangular region defined by the handles\n\t var width = Math.abs(startPoint.x - endPoint.x);\n\t var height = Math.abs(startPoint.y - endPoint.y);\n\n\t var left = Math.min(startPoint.x, endPoint.x);\n\t var top = Math.min(startPoint.y, endPoint.y);\n\n\t // Bound the rectangle so we don't get undefined pixels\n\t left = Math.max(left, 0);\n\t left = Math.min(left, eventData.image.width);\n\t top = Math.max(top, 0);\n\t top = Math.min(top, eventData.image.height);\n\t width = Math.floor(Math.min(width, Math.abs(eventData.image.width - left)));\n\t height = Math.floor(Math.min(height, Math.abs(eventData.image.height - top)));\n\n\t // Get the pixel data in the rectangular region\n\t var pixelLuminanceData = cornerstoneTools.getLuminance(eventData.element, left, top, width, height);\n\n\t // Calculate the minimum and maximum pixel values\n\t var minMaxMean = calculateMinMaxMean(pixelLuminanceData, eventData.image.minPixelValue, eventData.image.maxPixelValue);\n\n\t // Adjust the viewport window width and center based on the calculated values\n\t var config = cornerstoneTools.wwwcRegion.getConfiguration();\n\t var viewport = cornerstone.getViewport(eventData.element);\n\t if (config.minWindowWidth === undefined) {\n\t config.minWindowWidth = 10;\n\t }\n\n\t viewport.voi.windowWidth = Math.max(Math.abs(minMaxMean.max - minMaxMean.min), config.minWindowWidth);\n\t viewport.voi.windowCenter = minMaxMean.mean;\n\t cornerstone.setViewport(eventData.element, viewport);\n\n\t // Clear the toolData\n\t toolData.data = [];\n\n\t cornerstone.updateImage(eventData.element);\n\t }", "title": "" }, { "docid": "3e65fd734b928acca00a3d829da2eaa2", "score": "0.4887001", "text": "function updateFilters() {\r\n //entire list item is grabbed \r\n console.log('filtering working')\r\n var elementChange = d3.select(this).select(\"input\");\r\n var elementValue = elementChange.property(\"value\");\r\n var elementId = elementChange.attr(\"id\");\r\n // If a filter value was entered then add that filterId and value\r\n // to the filters list. Otherwise, clear that filter from the filters object\r\n if (elementValue) {\r\n filters[elementId] = elementValue;\r\n }\r\n else {\r\n delete filters[elementId];\r\n }\r\n // Call function to apply a filters and rebuild the table\r\n filterTable();\r\n}", "title": "" }, { "docid": "ecb2e9fb7af10ca6bc5ac642c4a66da9", "score": "0.4886394", "text": "function getSPCCWavelengthBandWidth(filter, channel)\n{\n if (filter.indexOf('H') != -1) {\n // There is H filter\n if (channel == 'R') {\n H_in_R_channel = true;\n }\n return [ 656.30, 3];\n } else if (filter.indexOf('O') != -1) {\n // There is O filter\n return [ 500.70, 3];\n } else if (filter.indexOf('S') != -1) {\n // There is S filter\n return [ 671.60, 3];\n } else {\n return null;\n }\n}", "title": "" }, { "docid": "4fd2e3c79df0f0ce80009699bd17185d", "score": "0.48832366", "text": "function onUpdate(items){self.filteredDictionary=items;}", "title": "" }, { "docid": "fbb5bb851a848bd76c777fe549da8dc8", "score": "0.48664397", "text": "function filter() {\n\n vm.filteredTracks = [];\n\n angular.forEach(vm.soloTracks, function (track, key) {\n goodSearch = true;\n\n if (!vm.filterData.artist == \"\" && !track.artist.name.match(new RegExp(vm.filterData.artist, \"i\"))) {\n goodSearch = false;\n }\n\n if (!vm.filterData.title == \"\" && !track.songname.match(new RegExp(vm.filterData.title, \"i\"))) {\n goodSearch = false;\n }\n\n if (!vm.filterData[track.instrument_id]) {\n goodSearch = false;\n }\n\n\n if (goodSearch) {\n vm.filteredTracks.push(track);\n }\n });\n\n if (vm.filteredTracks.length === 0) {\n vm.showNoResultsFound = true;\n }\n else {\n vm.showNoResultsFound = false;\n }\n }", "title": "" }, { "docid": "addbfdd0062a77f1af10407cd3f40d1b", "score": "0.48658022", "text": "updateFilter(e) {\n e.preventDefault()\n\n const searchItems = [\"STREET\",\"Zip\",\"ESTIMATED_MARKET_VALUE\",\"EXT_DESC\",\"RES_TYPE\"]\n let filterData = Object.assign([], this.props.data);\n\n searchItems.forEach(item => { \n this.state[item].param\n ? this.state[item].type\n ? filterData = filterData.filter(data => this.strCheck(data[item]) === this.state[item].param)\n : filterData = filterData.filter(\n data => data[item] > this.state[item].param.min && data[item] < this.state[item].param.max \n )\n : null\n })\n\n this.props.changeUpdate(filterData) //sends updated markers to main\n }", "title": "" }, { "docid": "614a7f461cafa3983b36ea961b7b1908", "score": "0.48621508", "text": "function filter() {\n Caman(\"#photo\", newImg, function () {\n bright.addEventListener(\"change\", (e) => {\n e.preventDefault();\n let value = parseInt(bright.value);\n spanValueBright.innerHTML = value;\n adjustBrightness(value);\n });\n\n saturation.addEventListener(\"change\", (e) => {\n e.preventDefault();\n let value = parseInt(saturation.value);\n spanValueSaturation.innerHTML = value;\n adjustSaturation(value);\n });\n\n stackBlur.addEventListener(\"change\", (e) => {\n e.preventDefault();\n let value = parseInt(stackBlur.value);\n spanValueBlur.innerHTML = value;\n adjustStackBlur(value);\n });\n\n hue.addEventListener(\"change\", (e) => {\n e.preventDefault();\n let value = parseInt(hue.value);\n spanValueHue.innerHTML = value;\n adjustHue(value);\n });\n\n sepia.addEventListener(\"change\", (e) => {\n e.preventDefault();\n let value = parseInt(sepia.value);\n spanValueSepia.innerHTML = value;\n adjustSepia(value);\n });\n });\n}", "title": "" }, { "docid": "74856546a766d835f145fcabe98f1e5f", "score": "0.48597205", "text": "toggleHighpass(event) {\n this.synthState.HighpassOn = event.target.checked;\n // This allows the slider to move on the page itself\n this.setState({HighpassOn: event.target.checked});\n // If the highpass filter is turned off, reset the highpass slider\n if (!this.synthState.HighpassOn) {\n // Resets the highpass cutoff on the synth to 20000\n highpass.frequency.value = 20000;\n // Resets the state (will reset slider)\n this.setState({HighpassCut: 20000});\n // Removes highpass filter from the effects list\n this.removeEffect(\"highpass\");\n }\n // Otherwise, add highpass filter to the effects list\n else {\n this.addEffect(\"highpass\");\n }\n }", "title": "" }, { "docid": "927eb0d3eb7a0bf06600e19341e7fed4", "score": "0.48579022", "text": "function createEffect(min, max) {\n featureLayerView.effect = {\n filter: {\n where: \"MEDHINC_CY > \" + min + \" AND MEDHINC_CY < \" + max\n },\n includedEffect: \"bloom(150%, 1px, 0.2) saturate(200%)\",\n excludedEffect: \"blur(1px) brightness(65%)\"\n }\n }", "title": "" }, { "docid": "f8fee4c7c28e10c19c835e1076c7cb0d", "score": "0.48570523", "text": "function setColorSceneB(){\n micFiltered = alphaGain*abs(mic.getLevel())+(1-alphaGain)*micAnterior;\n micAnterior = micFiltered;\n return micFiltered;\n}", "title": "" }, { "docid": "275c48ded2a4932173c5035d59d14370", "score": "0.48556745", "text": "function onUpdate(framework) {\n analyser.getFloatTimeDomainData(audioData);\n\n // Smooth audio data via a moving average\n var smoothStep = 16;\n for (var i = 0; i < audioData.length / smoothStep; i++) {\n var total = 0;\n var index = i * smoothStep;\n for (var j = 0; j < smoothStep; j++) {\n total += audioData[index + j];\n }\n\n smoothedAudioData[i] = total / smoothStep;\n }\n\n uniforms.smoothedAudioData.value = smoothedAudioData;\n uniforms.time.value = Date.now() - start;\n}", "title": "" }, { "docid": "50455efa6ef854ce27b4652b40486444", "score": "0.4849453", "text": "function applyFilter () {\n\n // get the data from the input element\n var filterDataString = this.value;\n if (filterDataString != undefined) {\n // make the data readable\n var filterDataArray = filterDataString.split(\"-|-\");\n if (filterDataArray != undefined && filterDataArray.length === 2) {\n var filterId = Number(filterDataArray[0]);\n var data = Number(filterDataArray[1]);\n // validate\n if (filterId != undefined && data != undefined && data != \"\") {\n // try to access the data with the given information.\n var fileData = getDataOfFileById(\"fluorideWater\");\n if (fileData) {\n\n // now get the filter\n var filterData = fileData.filterData;\n if (filterData != undefined) {\n var filter = filterData[filterId];\n if (filter != undefined) {\n\n // update the filter\n filter.defaultValue = new Date(data);\n\n // reload/update the graph\n callDataRequestersBack (fileData);\n }\n }\n }\n }\n }\n }\n}", "title": "" }, { "docid": "848f0a7abe55463ce067eacde6aab072", "score": "0.48484367", "text": "function filter() {\n var srcCanvas=document.getElementById(\"srcCanvas\");\n var srcC=srcCanvas.getContext(\"2d\");\n var outCanvas=document.getElementById(\"outCanvas\");\n var outC=outCanvas.getContext(\"2d\");\n \n outC.clearRect(0,0,outCanvas.width,outCanvas.height);\n \n var option1 = document.getElementById(\"option1\");\n var option2 = document.getElementById(\"option2\");\n var option3 = document.getElementById(\"option3\");\n \n var srcW = srcCanvas.width;\n var srcH = srcCanvas.height;\n \n var srcData = srcC.getImageData(0, 0, srcW, srcH);\n var srcPix = srcData.data;\n var outData = outC.createImageData(srcW, srcH);\n var outPix = outData.data;\n \n// alert(srcPix[0]+\",\"+srcPix[1]+\",\"+ srcPix[2]);\n \n var h_HSV;\n var draw = false;\n for (var i=0; i<srcPix.length; i+=4) { \n h_HSV = rgbToHsv(srcPix[i], srcPix[i+1], srcPix[i+2])[0];\n\n //\n if (option1.checked) {\n if (filter1[1] > filter1[2]) {\n if ((0 <= h_HSV && h_HSV <= filter1[2]) || (filter1[1] <= h_HSV && h_HSV <= 1))\n draw = true;\n }\n else {\n if (filter1[1] <= h_HSV && h_HSV <= filter1[2])\n draw = true;\n }\n }\n //\n if (option2.checked) {\n if (filter2[1] > filter2[2]) {\n if ((0 <= h_HSV && h_HSV <= filter2[2]) || (filter2[1] <= h_HSV && h_HSV <= 1))\n draw = true;\n }\n else {\n if (filter2[1] <= h_HSV && h_HSV <= filter2[2])\n draw = true;\n }\n }\n //\n if (option3.checked) {\n if (filter3[1] > filter3[2]) {\n if ((0 <= h_HSV && h_HSV <= filter3[2]) || (filter3[1] <= h_HSV && h_HSV <= 1))\n draw = true;\n }\n else {\n if (filter3[1] <= h_HSV && h_HSV <= filter3[2])\n draw = true;\n }\n }\n \n if (draw) {\n outPix[i ] = srcPix[i ]; \t// red channel\n outPix[i+1] = srcPix[i+1]; \t// blue channel\n outPix[i+2] = srcPix[i+2]; \t// green channel\n outPix[i+3] = 255; \t // alpha channel\n }\n draw = false;\n }\t\t\n// }\n \n outC.putImageData(outData, 0, 0);\n}", "title": "" }, { "docid": "961ebca865737cb7620056df4c851abd", "score": "0.4842589", "text": "function setLayerFilter() {\n var currRegion = getVisibleLayer();\n updateRegionFilter(currRegion);\n currFilters = controller.query.filters.get();\n //first, if there is no filter on the query create one\n if( currFilters.length !== 0 ) {\n userVariables.regionsConfig.forEach(function(r) {\n //some filter exists. Search the list, remove any filters with\n //path that matches a region grouping\n //TODO: potential IE support issue, Array.find\n var matchingFilter = currFilters.find(function(f) {\n var result = false;\n if(f.path === r.groupName) {\n result = true;\n controller.query.filters.removeFilters(f);\n }\n return result;\n });\n });\n }\n controller.query.filters.addFilters(currRegion.filter);\n }", "title": "" }, { "docid": "bab9cda762d69c70b025f40ab52289dd", "score": "0.48386174", "text": "function changeWavelength(scope) {\n\t/**set the R, G, B and alpha value of the light using the slider depend upon \n\tthe wavlength of the LED selected*/\n\tvar filter = new createjs.ColorFilter(0, 0, 0, intensity, red, green, blue, 0); /** ColorFilter is used for colour transformation */\n\tgetChild(\"light\").filters = [filter];\n\tgetChild(\"light\").cache(0, 0, getChild(\"light\").getBounds().width, getChild(\"light\").getBounds().height);\n\tgetChild(\"light_under\").filters = [filter];\n\tgetChild(\"light_under\").cache(0, 0, getChild(\"light_under\").getBounds().width, getChild(\"light_under\").getBounds().height);\n\t/**calculate the values based on the wavelength*/\n\tcalculation(scope);\n\tplancks_stage.update();\n}", "title": "" }, { "docid": "0075790552fe7d2b471afe26ffadf8d3", "score": "0.483819", "text": "if (minSnowFogIntensity <= 0)\n\t\t\t\t{\n\t\t\t\t\tminSnowFogIntensity = 0;\n\t\t\t\t}", "title": "" }, { "docid": "fd687665d17fd911002ffdee873f8585", "score": "0.48252875", "text": "_onSelectionChange (filter) {\n const dimensionsToFilter = this.dimensions.filter(dim => dim.id !== filter.id)\n\n dimensionsToFilter.forEach(dim => {\n dim.replaceFilter(filter)\n })\n\n this.emit('change', this.getData())\n }", "title": "" }, { "docid": "0332d609723b6ef7380e450141b59676", "score": "0.4825122", "text": "apply(filterManager, input, output, clear) {\n this.uniforms.dimensions[0] = input.filterFrame.width;\n this.uniforms.dimensions[1] = input.filterFrame.height;\n\n // named `seed` because in the most programming languages,\n // `random` used for \"the function for generating random value\".\n this.uniforms.seed = this.seed;\n\n filterManager.applyFilter(this, input, output, clear);\n }", "title": "" }, { "docid": "f1c40b18d6bafb222947f5ed2d2c2104", "score": "0.4822485", "text": "function onUpdate(framework) {\n // console.log(`the time is ${new Date()}`);\n if(analyser !== undefined) {\n var shape = framework.scene.getObjectByName(\"thing\");\n var currentAvg = analyser.getAverageFrequency();\n\n var low = 90, high = 140;\n var normalized = (high - currentAvg)/(high - low);\n console.log(normalized);\n // shape.material.color = new THREE.Color(0x00ff00) \n shape.scale.set(1.0 + normalized, 1.0 + normalized, 1.0 + normalized);\n \n // shape.geometry.radius = 3 * (currentAvg/150);\n }\n // let musicVolume = analyser.getAverageFrequency();\n // noisyShape.geometry.radius = musicVolume;\n // }\n\n \n \n}", "title": "" }, { "docid": "b8a21dfa2f40a555becc17a3dc494bdb", "score": "0.48166215", "text": "function filterHandler() {\n displayTracksInFilter(); // Display only tracks in selected filter.\n filterTrackCount(); // Display amount of tracks in active filter.\n filterTitle(); // Display the title of the active filter.\n emptyFilterInfo(); // Display information when filter is empty.\n noResultsFound(); // Display information if search doesn't yield any results.\n // applyBorderRadius();\n }", "title": "" }, { "docid": "18bbd98d8cf05e6ca8ec9373777c5666", "score": "0.4807481", "text": "function filterData(attr, values){\n for (i = 0; i < attributes.length; i++){\n if (attr == attributes[i]){\n ranges[i] = values;\n } \n} \nvar toVisualize = currentData.filter(function(d) { return isInRange(d)}); \nshownVisual =drawVis(toVisualize); \ncountAirlines(shownVisual);\ndrawChart(shownVisual);\n}", "title": "" }, { "docid": "03db82e3c69c6b94c8544cb00651740d", "score": "0.48030424", "text": "function onKnobChange(note, value) {\n if(note === 21) {\n lowPassFilter.frequency.value = 22000*value;\n } else if(note === 22) {\n highPassFilter.frequency.value = 22000*value;\n }\n}", "title": "" }, { "docid": "0b2817d94046c0da1e965c5063d52d4c", "score": "0.480134", "text": "function changeVisibleBldg() {\r\n var bldg_list = [\r\n ['civic', 'hospital', 'school', 'train_station', 'transportation', 'university', 'public', 'grandstand'],\r\n ['commercial', ' office', 'industrial', 'warehouse', 'kiosk', 'cabin'],\r\n ['hotel'],\r\n ['retail'],\r\n ['apartments', 'farm', 'hotel', 'house', 'residential', 'dormitory', 'terrace']\r\n ];\r\n map.setFilter('3d-HDCC-buildings', null);\r\n\r\n //Set visibility with year inputs from year slider\r\n var yrFilter = ['all', ['<=', yrMin, ['to-number', ['get', 'building:year_built']]], ['>=', yrMax, ['to-number', ['get', 'building:year_built']]]];\r\n var bldgFilters = ['any'];\r\n //Iterate through checkboxes in document and filter by building type\r\n for (var i = 0; i < 5; i++){\r\n var checkbox = checkboxes[i];\r\n if (checkbox.checked) {\r\n var category = bldg_list[i];\r\n for (var j = 0; j < category.length; j++) {\r\n var newFilter = ['==', ['get', 'building']];\r\n newFilter.push(category[j]);\r\n bldgFilters.push(newFilter);\r\n }\r\n }\r\n }\r\n\r\n //Union all filters (intersect non-included)\r\n filters = ['all', yrFilter];\r\n if (bldgFilters.length > 1){\r\n filters.push(bldgFilters);\r\n }\r\n\r\n console.log(filters);\r\n map.setFilter('3d-HDCC-buildings', filters);\r\n}", "title": "" }, { "docid": "14884c2d99ddc78393153bec0896ca5f", "score": "0.48006004", "text": "function updateFilters() {\n\n // Save the element, value, and id of the filter that was changed by user\n let date = d3.select(\"#date\").property(\"value\");\n \n let city = d3.select(\"#city\").property(\"value\");\n\n let state = d3.select(\"#state\").property(\"value\");\n\n let country = d3.select(\"#country\").property(\"value\");\n\n let shape = d3.select(\"#shape\").property(\"value\");\n\n \n // If a filter value was entered then add that filterId and value\n // to the filters list. Otherwise, clear that filter from the filters object\n filters = {};\n \n if (date) {\n filters[\"datetime\"] = date; \n }\n \n if (city) { \n filters[\"city\"] = city; \n }\n \n if (state) {\n filters[\"state\"] = state; \n }\n \n if (country) { \n filters[\"country\"] = country; \n }\n \n if (shape) {\n filters[\"shape\"] = shape; \n }\n \n // Call function to apply all filters and rebuild the table\n filterTable();\n}", "title": "" }, { "docid": "e6accc24083d98516483c6764aa57c97", "score": "0.48004198", "text": "setWKTOnlyFromElmLandPlz(v) {\n //this.init();\n if(v.clear)\n {\n this.drawLayer.olSource.clear();\n this.nextID = 0;\n }\n\n for(let o of v.wkts) {\n let wkt = o.wkt;\n let id = o.id;\n try {\n let newGeometry = undefined;\n\n if (wkt && wkt.length) {\n newGeometry = this.format.wkt.readGeometry(wkt);\n\n let feature = new Feature({\n geometry: newGeometry\n });\n \n feature.set(\"trackingID\", id);\n feature.set(\"source\", \"Server\");\n\n if(!feature.get(\"geoJSON\"))\n {\n var thisGeoJSON = this.format.unifiedWKTizer.olToGeoJSONSimple(feature);\n thisGeoJSON.properties.source = \"server\"\n feature.set(\"geoJSON\", thisGeoJSON)\n }\n\n if(this.nextID == null || this.nextID == undefined || id > this.nextID)\n this.nextID = id;\n \n this.drawLayer.olSource.addFeature(feature);\n }\n\n\n } catch (err) {\n console.error(\n `An error occurred updating feature with new buffer ${err}`\n );\n }\n }\n\n this.clearAndResetDisplayLayer(null, true);\n\n let requestAnimationFrame =\n window.requestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.msRequestAnimationFrame;\n requestAnimationFrame(() => {\n //TODO: Make this extent to the state first\n\n if (this.map) {\n let view = this.map.getView();\n if (view) {\n let feats = this.drawLayer.olSource.getFeatures();\n if (feats && feats.length) {\n let geometry = feats[0].getGeometry();\n if (geometry) {\n // view.fit(feats[0].getGeometry(), {\n // size: this.map.getSize(),\n // duration: 2000\n // });\n }\n };\n }\n }\n });\n \n\n \n\n }", "title": "" }, { "docid": "61ea3b566fd73027382aca6e9e803def", "score": "0.47991607", "text": "function updateFilters() {\n\n // Save the element, value, and id of the filter that was changed\n let newdate = d3.select(\"#datetime\").property(\"value\");\n let newcity = d3.select(\"#city\").property(\"value\");\n let newstate = d3.select(\"#state\").property(\"value\");\n let newcountry = d3.select(\"#country\").property(\"value\");\n let newshape = d3.select(\"#shape\").property(\"value\");\n \n // If a filter value was entered then add that filterId and value\n // to the filters list. Otherwise, clear that filter from the filters object\n \n if (newdate) {filters.datetime = newdate;} else {filters.datetime = \"\";}\n if (newcity) {filters.city = newcity;} else {filters.city = \"\";}\n if (newstate) {filters.state = newstate;} else {filters.state = \"\";}\n if (newcountry) {filters.country = newcountry;} else {filters.country = \"\";}\n if (newshape) {filters.shape = newshape;} else {filters.shape = \"\";}\n\n \n // Call function to apply all filters and rebuild the table\n filterTable();\n}", "title": "" }, { "docid": "7ae7489c5e265eaf324d6a48e279a658", "score": "0.47989246", "text": "function sensor (g : Cell){\n\tvar event = 0; //label of activity\n\tif (g.body.transform.parent == GameObject.Find(\"l_Retina\").transform){\n\t\tlImage = GameObject.Find(\"LeftImage\").transform;\n\t\tfor(var t : Transform in lImage){\n\t\t\tvar ldist = (g.body.transform.position.y-t.position.y)*(g.body.transform.position.y-t.position.y) \n\t\t\t+ (g.body.transform.position.z-t.position.z)*(g.body.transform.position.z-t.position.z);\n\t\t\tif ((ldist<=0.000625 && g.type == 1)||(Mathf.Abs(g.body.transform.position.y-t.position.y)<=0.5*t.localScale.y \n\t\t\t\t\t\t\t\t\t\t\t\t&& Mathf.Abs(g.body.transform.position.z-t.position.z)<=0.5*t.localScale.z && g.type == 0)){\n\t\t\t\tg.body.renderer.material.color = Color32(0,255,0,10);\n\t\t\t\tg.active = 1;\n\t\t\t\tevent = 1;\n\t\t\t\tbreak;\n\t\t\t}\t\n\t\t}\n\t}\n\tif (g.body.transform.parent == GameObject.Find(\"r_Retina\").transform){\n\t\trImage = GameObject.Find(\"RightImage\").transform;\n\t\tfor(var t : Transform in rImage){\n\t\t\tvar rdist = (g.body.transform.position.y-t.position.y)*(g.body.transform.position.y-t.position.y) \n\t\t\t+ (g.body.transform.position.z-t.position.z)*(g.body.transform.position.z-t.position.z);\n\t\t\tif ((rdist<=0.000625 && g.type == 1)||(Mathf.Abs(g.body.transform.position.y-t.position.y)<=0.5*t.localScale.y \n\t\t\t\t\t\t\t\t\t\t\t\t&& Mathf.Abs(g.body.transform.position.z-t.position.z)<=0.5*t.localScale.z && g.type == 0)){\n\t\t\t\tg.body.renderer.material.color = Color32(0,255,0,10);\n\t\t\t\tg.active = 1;\n\t\t\t\tevent = 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\t// reset to inactive\n\tif(event == 0){\n\t\tg.body.renderer.material.color = Color32(255,0,0,10);\n\t\tg.active = 0;\n\t}\n}", "title": "" }, { "docid": "02ac262af19bbbcd6a4d489bf8accf46", "score": "0.4795277", "text": "function updateFilters() {\n\n // 4a. Save the element that was changed as a variable.\n let selector = d3.select(this);\n // 4b. Save the value that was changed as a variable.\n let elementValue = selector.property(\"value\");\n console.log(elementValue);\n // 4c. Save the id of the filter that was changed as a variable.\n let filterId = selector.attr(\"id\");\n console.log(filterId);\n // 5. If a filter value was entered then add that filterId and value\n // to the filters list. Otherwise, clear that filter from the filters object.\n //if (filterId === \"apply-btn\") {\n //filters[filterId] = elementValue;}\n if (elementValue) {\n filters[filterId] = elementValue;\n }\n else {\n delete filters[filterId];\n }\n // 6. Call function to apply all filters and rebuild the table\n filterTable();\n \n }", "title": "" } ]
b08350000ff076b30a32cecf7af04bb7
Go round all the files and collect their file names, size, and other things we can add in into a single big array of files that need scanning. Then we can just iterate over that.
[ { "docid": "e371114f295c5f14fa89524fecc0f89e", "score": "0.0", "text": "function Init(callback) {\n console.log('Client Initializing...');\n\n // Go through all the config files, resolve them (or not) and add to the filesArray array.\n for (var f = 0; f < config['PathsToScan'].length; f++) { // For every config entry\n if (fs.existsSync(config.PathsToScan[f].Location)) { // If the file or dir exists\n if (fs.lstatSync(config.PathsToScan[f].Location).isFile()) { // If it's a file we're looking at\n filesArray.push(getFileMetadata(config.PathsToScan[f].Location)); // Populate and push\n console.log(`[Success] Found file ${config.PathsToScan[f].Location}`);\n } else if (fs.lstatSync(config.PathsToScan[f].Location).isDirectory()) { // Elif its a dir\n fs.readdirSync(config.PathsToScan[f].Location).forEach(function(filename) { // for every item in dir\n if (path.extname(filename) == \".log\") { // If it's a .log and nothing but a .log file\n filesArray.push(getFileMetadata(config.PathsToScan[f].Location + filename)); // Populate and push\n console.log(`[Success] Found file ${config.PathsToScan[f].Location}`);\n };\n });\n } else {\n console.warn(`[Warning] I'm unable to detect what \"${config.PathsToScan[f].Location}\" is. It may be a socket or symlink.`);\n };\n } else {\n console.warn(`[Warning] The file \"${config.PathsToScan[f].Location}\" does not exist!`);\n };\n };\n\n // Check if we have a .data.json file to store little bits of client info, such as our unique key\n if (fs.existsSync(path.join(__dirname + '/.data.json'))) { // If the .data.json file exists\n data = JSON.parse(fs.readFileSync(path.join(__dirname + '/.data.json'), 'utf8')); // Read/Load it into the data varaible as json\n } else {\n UpdateData(); // Else create the file (before the webui launches)\n };\n\n // Launch the webAPI regardless\n require(__dirname + '/WebAPI/launchWebAPI.js');\n\n // Create a quick n dirty config variable which concats the LogSee Server URI together (LSSURI (LogSee Server URI))\n config.LSSURI = `${config.Client.LogSee_Protocol}://${config.Client.LogSee_Host}:${config.Client.LogSee_Port}`;\n console.log('LSSURI Crafted:', config.LSSURI);\n\n console.log('Client Initialized.');\n callback(true);\n}", "title": "" } ]
[ { "docid": "ad7a2621c4e23ac6a68f8ac9c343a0ea", "score": "0.6995081", "text": "function traverseFiles() {\n\t//var files = fs.readdirSync('.');\n\tfs.readdir(filePath, function(err, items) {\n\t\tif (err)\n\t\t\tthrow err;\n\t\tfor (var i = 0; i < items.length; i++) {\n\t\t\t//size in mb\n\t\t\tvar size = getFileSize(filePath+items[i]);\n\t\t\t\n\t\t\t//Size in mb calculated\n\t\t\tfor (var k in fileSizes) {\n\n\t\t\t\t//console.log(size, fileSizes[k], items[i]);\n\t\t\t\tif (size < fileSizes[k]/6) {\n\t\t\t\t\tif(fs.lstatSync(filePath+items[i]).isDirectory()){\n\t\t\t\t\t\titems[i] = items[i]+\"/**\";\n\t\t\t\t\t\t//continue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (filesCategorized[fileSizes[k]]){\n\t\t\t\t\t\tfilesCategorized[fileSizes[k]].push(filePath+items[i]);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tfilesCategorized[fileSizes[k]] = [filePath+items[i]];\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//large size files are managed here\n\t\t\t\n\t\t\tif(size > fileSizes[fileSizes.length-1]){\n\t\t\t\tconsole.log(\"reached at the end of array \",filePath+items[i],size,fileSizes[fileSizes.length-1])\n\t\t\t\t\tif(largeSize < size)\n\t\t\t\t\tlargeSize = size*6;\n\t\t\t\t\t\n\t\t\t\t\tif(fs.lstatSync(filePath+items[i]).isDirectory()){\n\t\t\t\t\t\titems[i] = items[i]+\"/**\";\n\t\t\t\t\t\t//continue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (filesCategorized[largeSize]){\n\t\t\t\t\t\tfilesCategorized[largeSize].push(filePath+items[i]);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tfilesCategorized[largeSize] = [filePath+items[i]];\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\tconsole.log(filesCategorized);\n\t\t//traverse through each file category size\n\t\tfor(var t in filesCategorized){\n\t\t\tconsole.log(\"generating archive for \"+t+\"mb sized files \");\n\t\t\tgenerateArchiveFile(parseInt(t)*1000000,filesCategorized[t]);\t\n\t\t}\n\n\t});\n}", "title": "" }, { "docid": "a922a16d031ef6a1b3f1760fa101d1ec", "score": "0.6683951", "text": "function processFiles() {\n console.log(\"Processing files in \", source, \".\");\n fq.readdir(source, function (err, files) {\n if (err) throw err;\n for (var i = 0, l = files.length; i < l; i++) {\n processFile(source + files[ i ]);\n }\n });\n}", "title": "" }, { "docid": "c8220141401b8d05e3f6de6228060c1c", "score": "0.6620841", "text": "function processFiles(filelist) {\n if (!filelist || !filelist.length || list.length) return;\n\n totalSize = 0;\n totalProgress = 0;\n result.textContent = '';\n\n for (var i = 0; i < filelist.length && i < 50; i++) {\n list.push(filelist[i]);\n totalSize += filelist[i].size;\n }\n uploadNext();\n }", "title": "" }, { "docid": "e72ce065a8b8b4785a95930e2b623c73", "score": "0.6436306", "text": "function processFiles(filelist) {\n if (!filelist || !filelist.length || list.length) return;\n\n totalSize = 0;\n totalProgress = 0;\n result.textContent = '';\n\n for (var i = 0; i < filelist.length && i < 1; i++) {\n list.push(filelist[i]);\n totalSize += filelist[i].size;\n }\n uploadNext();\n }", "title": "" }, { "docid": "4eb7dbb25877f0ebeceb38b38ef7fe1a", "score": "0.63542855", "text": "function processFiles(filelist) {\n if (!filelist || !filelist.length || list.length) return;\n for (var i = 0; i < filelist.length && i < 500; i++) { // limit is 500 files (only for not having an infinite loop)\n nbUploaded=filelist.length;\n list.push(filelist[i]);\n }\n uploadNext();\n }", "title": "" }, { "docid": "787e554bab2129c702486f76af11278f", "score": "0.63269913", "text": "function filesReturned(err, fileDir){\n // Logging out a message so I know when the data has been returned\n console.log(\"\\nData returned from Directory \\n\");\n\n\n for(file in fileDir)\n {\n var currentFile = fileDir[file];\n // Checking to make sure the current file is not called \"app.js\" i.e.\n // I do not want to store the contents of this file, just the ones\n // that exist in the same directory as it\n if(checkIgnoreFiles(currentFile))\n {\n // Creating a temporary date object (so I can access the current time)\n var currentDate = new Date();\n\n // Creating a current time variable, so that I can check to see when each\n // is about to call the .readFile() method (that way I can see if these\n // requests are happending in synchronously or asynchronously)\n var currentTimestamp = currentDate.getTime();\n console.log(fileDir[file] + \" requested data at \" + currentTimestamp);\n\n // Passing in a file from the array returned by the readdir() function.\n // Using the counter to itterate through each of these files.\n fs.readFile(currentFile, {encoding: \"utf8\"}, function(err, data){\n // Creating a new object to store the information of this file temporarily\n var thisFile = {\n // Getting the name of the file from the file directory data, again\n // using the counter to identify to it\n name:fileDir[file],\n // Getting the contents of the file from the parametre \"data\" that\n // was passed back to the readFile() function callback\n contents:data\n };\n\n // Logging out when a file is in the process of being read - again to try and\n // compare the time they open the .readFile() request, to the time which\n // it is processed\n currentTimestamp = currentDate.getTime();\n console.log(\"Data \" + \"\\\"\" + data + \"\\\" returned data at \" + currentTimestamp);\n\n // Pushing this temporary object into the allFiles array, so that it\n // can be stored and accessed later on i.e. once all files have been\n // returned\n allFiles.push(thisFile);\n\n // Increasing the counter value, to keep track of how many file results have\n // been returned\n counter++;\n\n // Checking if the counter is still less than the length of the fileDir\n // array. If it is not then all of the files have been returned, and therefore\n // all of their information has been stored into the allFiles array. Note -\n // none of the file's data has been logged out to the console yet. It has\n // just been stored in the allFiles array\n if(counter == (fileDir.length - totalIgnoredFiles))\n {\n console.log(\"All files have been read, and their data stored\\nNote - some files may have been ignored due to your current settings\");\n saveToTxtFile();\n }\n });\n }\n }\n}", "title": "" }, { "docid": "16b240fbaddee4511fce0a7ec8775e38", "score": "0.62733686", "text": "function pushFiles (files, done) {\n var batch = new Batch()\n\n files.forEach(function (file) {\n batch.push(function (done) {\n if (ignoreFile(file)) {\n notice('ignoring ' + file)\n return done()\n }\n\n file = path.resolve(file)\n fs.stat(file, function (err, stats) {\n if (err) {\n done(err)\n } else if (stats.isDirectory()) {\n fs.readdir(file, function (err, files) {\n if (err) {\n done(err)\n } else {\n pushFiles(files.map(function (f) { return file + '/' + f }), done)\n }\n })\n } else {\n pushFile(file, stats, done)\n }\n })\n })\n })\n\n batch.end(done)\n}", "title": "" }, { "docid": "c166bcfed0a1d85d161c26f352dfd8ee", "score": "0.6249838", "text": "static getAllFilesSync(path: string, options: Object = {folderFilter: '', fileExtensions: [\"exe\", \"dmg\"], withSha: false}) {\n const files = []\n const fileExtensions = options.fileExtensions || [\"exe\", \"dmg\"]\n if(!fs.lstatSync(path).isDirectory()){\n return null\n }\n const isDirectory = source => fs.lstatSync(source).isDirectory() && (!source.includes(options.folderFilter))\n const getDirectories = source => fs.readdirSync(source).map(name => slash([source,name].join('/'))).filter(isDirectory)\n\n const directories = getDirectories(path)\n directories.push(path)\n directories.forEach((folder) => {\n fs.readdirSync(folder).forEach(filename => {\n const fileExt = FileSystem.getFileExtension(filename)\n const fullPath = `${folder.replace(/\\\\/g, '/')}/${filename}`\n if( fileExtensions.includes(fileExt) && fs.lstatSync(fullPath).isFile()) {\n const fSize = FileSystem.getFilesizeInBytes(fullPath)\n const file = {\n size: fSize,\n path: fullPath,\n folder,\n fileName: filename,\n name: FileSystem.removeFileExtension(filename),\n sha256: null\n }\n if(options.withSha){\n file.sha256 = sha1(fs.readFileSync(fullPath))\n }\n files.push(file)\n }\n });\n })\n\n return files\n }", "title": "" }, { "docid": "8bbf99359261711bfd1576e33085dd71", "score": "0.62095284", "text": "function collectFiles() {\n var files = [];\n var passwords = [];\n var urls = [];\n var paths = [];\n transform(compareFileMap, files, passwords);\n transform(compareFileGuidMap, paths, null);\n transform(compareFileUrlMap, urls, null);\n for (var i = 0; i < idx; i++) {\n var prefix = 'idx' + i;\n // fill files and passwords\n transformInternal(compareFileMap, prefix, files, passwords);\n // fill paths by objects with path to file and password\n transformToObj(compareFileGuidMap, prefix, paths);\n // fill urls by objects with url to file and password\n transformToObj(compareFileUrlMap, prefix, urls);\n }\n\n return {\"files\": files, \"passwords\": passwords, \"urls\": urls, \"paths\": paths};\n}", "title": "" }, { "docid": "49b2801cf6d8c356756a8f61d9666deb", "score": "0.6203268", "text": "static getAllFiles(inDirectory, withExtension, callback) {\n Fs.readdir(inDirectory, (error, directoryContents) => {\n if (error) {\n callback(error);\n } else {\n let itemsLeft = directoryContents.length;\n if (!itemsLeft) {\n callback(null, []);\n } else {\n const directoryFiles = [];\n _.each(directoryContents, item => {\n const itemFullPath = Path.resolve(inDirectory, item);\n Fs.stat(itemFullPath, (error, itemStats) => {\n if (error) {\n callback(error);\n } else if (itemStats.isFile() && itemFullPath.endsWith(withExtension)) {\n directoryFiles.push(itemFullPath);\n }\n\n itemsLeft--;\n if (!itemsLeft) {\n callback(null, directoryFiles);\n }\n });\n });\n }\n }\n });\n }", "title": "" }, { "docid": "84947dec9aee8779350d1f113c719ea8", "score": "0.6195972", "text": "function processFiles(stats, cb) {\n var found = [], results = {};\n // process all files\n async.forEach(stats, function (file, cb) {\n var isJs = /package\\.json$/;\n if (file.stats.isFile()) {\n if (isJs.test(file.filename)) {\n found.push({\n filename: path.join(rootfolder, file.filename),\n stats: file.stats\n });\n cb(null);\n } else {\n cb(null);\n }\n } else if (file.stats.isDirectory()) {\n findPackagesFromSingleFolder(\n path.join(rootfolder, file.filename),\n function (err, res) {\n if (!err) {\n concatObject(results, res);\n }\n cb(err);\n }\n );\n }\n }, function (err) {\n if (err) {\n return cb(err);\n }\n return cb(null, found, results);\n });\n }", "title": "" }, { "docid": "60d0b419d64a4fad02958b7b9bbae9f8", "score": "0.61420095", "text": "function collectFiles(aFiles, aFileRoot) {\n return aFiles.map(filename => getFile(filename, aFileRoot));\n}", "title": "" }, { "docid": "520577818a89450ffcea5b1cb4540213", "score": "0.6112052", "text": "function logSizes(currentFolder) {\n //read directory, withFileTypes: true created dirent object, throws error if cant be read\n fs.readdir(\n currentFolder,\n { withFileTypes: true },\n function (error, folder) {\n if (error) {\n console.log(\"Oh ohh! \", error);\n return;\n }\n //loop over each file/folder in folder\n\n folder.forEach((item) => {\n const fullPath = getPath(currentFolder, item.name);\n\n //decide if its a folder or file\n //FOLDER\n if (item.isDirectory()) {\n //call recursively\n logSizes(fullPath);\n return;\n }\n //FILE\n fs.stat(fullPath, (error, stats) => {\n if (error) {\n console.log(\"Oh ohh! \", error);\n return;\n }\n const { size } = stats;\n // log the file\n console.log(`${getPath(root, fullPath)} : ${size}`);\n });\n });\n\n // for (const item in folder) {\n // const fullPath = getPath(currentFolder, folder[item].name);\n\n // //decide if its a folder or file\n // //FOLDER\n // if (folder[item].isDirectory()) {\n // //call recursively\n // logSizes(fullPath);\n // return;\n // }\n // //FILE\n // fs.stat(fullPath, (error, stats) => {\n // if (error) {\n // console.log(\"Oh ohh! \", error);\n // return;\n // }\n // const { size } = stats;\n // // log the file\n // console.log(`${getPath(root, fullPath)} : ${size}`);\n // });\n // }\n }\n );\n}", "title": "" }, { "docid": "31d6d583faa773c8d9a46550596afbf3", "score": "0.6099784", "text": "function computeFileInfos(srcDir) {\n\tvar walkSync = function (dir, filelist) {\n\t\tvar fs = fs || require('fs'),\n\t\t\tfiles = fs.readdirSync(dir);\n\t\tfilelist = filelist || {};\n\t\tfiles.forEach(function (file) {\n\t\t\tvar filename = path.join(dir, file);\n\n\t\t\tif (fs.statSync(filename).isDirectory()) {\n\t\t\t\tfilelist = walkSync(path.join(dir, file), filelist);\n\t\t\t} else {\n\t\t\t\tvar stats = fs.statSync(filename);\n\t\t\t\tvar fileSizeInBytes = stats[\"size\"];\n\n\t\t\t\t// remove dest dir from filename\n\t\t\t\tfilename = filename.substr(path.join(srcDir).length);\n\n\t\t\t\t// file type\n\t\t\t\tvar ext = path.extname(filename);\n\t\t\t\tvar type = '';\n\t\t\t\tif(['.jpeg', '.jpg', '.png', '.gif'].indexOf(ext) >= 0) {\n\t\t\t\t\ttype = 'image';\n\t\t\t\t} else if(['.json'].indexOf(ext) >= 0) {\n\t\t\t\t\ttype = 'json';\n\t\t\t\t} else if(['.html', '.txt'].indexOf(ext) >= 0) {\n\t\t\t\t\ttype = 'text';\n\t\t\t\t} else if(['.xml'].indexOf(ext) >= 0) {\n\t\t\t\t\ttype = 'xml';\n\t\t\t\t} else if(['.pack'].indexOf(ext) >= 0) {\n\t\t\t\t\ttype = 'arraybuffer';\n\t\t\t\t} else {\n\t\t\t\t\ttype = ext.substr(1);\n\t\t\t\t}\n\n\t\t\t\tfilelist[filename] = {\n\t\t\t\t\ttype: type,\n\t\t\t\t\tsize: fileSizeInBytes\n\t\t\t\t};\n\t\t\t}\n\t\t});\n\t\treturn filelist;\n\t};\n\n\treturn walkSync(srcDir, {});\n}", "title": "" }, { "docid": "020a1cc64294344e6284ab81a3f2a0d0", "score": "0.60936534", "text": "function readFiles(callback) {\n const results = [];\n let dirCount = dirnames.length;\n\n dirnames.forEach((dirname) => {\n fs.readdir(dirname, (err, filenames) => {\n if (err) {\n callback(err, null);\n } else {\n let fileCount = filenames.length;\n\n filenames.forEach((filename) => {\n fs.readFile(dirname + '/' + filename, 'utf-8', function(err, content) {\n const timestamp = parseInt(this.filename.replace('.txt', ''));\n if (err) {\n callback(err, null);\n } else {\n const result = JSON.parse(content);\n result.timestamp = timestamp;\n results.push(result);\n if (--fileCount === 0) {\n if (--dirCount === 0) {\n callback(null, results);\n }\n }\n }\n }.bind({filename: filename}));\n });\n }\n });\n });\n}", "title": "" }, { "docid": "7e080e57f3c00f7e105f9ae507284a5c", "score": "0.6091308", "text": "async function transformAll() {\n return new Promise((resolve, reject) => {\n try {\n glob(`${inputDir}/*_raw.json`, {}, async (er, files) => {\n const promises = files.map(f => {\n return () => transformFile(f);\n });\n\n console.log('Converting files...');\n await throttle.all(promises, { maxInProgress: 20 });\n console.log('Done...');\n resolve();\n });\n }catch(error) {\n reject(error);\n }\n });\n}", "title": "" }, { "docid": "f4c7b29b8c0cc17dbcc0221b905db06b", "score": "0.6081384", "text": "function getFiles() {\n\t\tfilewalker(config.path.templates)\n\t\t\t.on('dir', function (p) {\n\t\t\t\tvar valid = helpers.valid(config.include, config.exclude, p);\n\t\t\t\tif (valid) {\n\t\t\t\t\tlogger.directory('%s', p);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (config.verbose) {\n\t\t\t\t\t\tlogger.ignored('%s', p);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t\t.on('stream', function (rs, p, s, fullPath) {\n\t\t\t\tvar valid = helpers.valid(config.include, config.exclude, p);\n\t\t\t\tif (valid) {\n\t\t\t\t\tvar input = fs.createReadStream(fullPath);\n\t\t\t\t}\n\t\t\t\trs.on('data', function(data) {\n\t\t\t\t\tif (valid) {\n\t\t\t\t\t\thelpers.fileToArray(input, config.componentStart, config.placeholderText, config.componentEnd);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\trs.on('end', function (data) {\n\t\t\t\t\tif (valid) {\n\t\t\t\t\t\tlogger.file('%s, %d bytes', p, s.size);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (config.verbose) {\n\t\t\t\t\t\t\tlogger.ignored('%s', p);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t})\n\t\t\t.on('error', function (err) {\n\t\t\t\tlogger.error(err);\n\t\t\t})\n\t\t\t.on('done', function () {\n\t\t\t\tlogger.info('Finished parsing templates. %d dirs, %d files, %d bytes', this.dirs, this.files, this.bytes);\n\t\t\t\tcreateData(helpers.getComponents());\n\t\t\t})\n\t\t.walk();\n\t}", "title": "" }, { "docid": "f1d179d40005615d1e711f5ab0a0d921", "score": "0.60430914", "text": "function processChunksOfFiles(chunkOfFiles, remainingFiles) {\n if (limitReached) return;\n var chunkLen = chunkOfFiles.length;\n var filesInChunkCompleted = 0;\n\n chunkOfFiles.forEach(function(f) {\n /* The file filter checks the birthtime timestamp. If we want the file,\n * we get a bool of true in the callback.\n */\n filterOsm.file(f, filter, function(filePath, bool) {\n\n function checkToFireCallbacks() {\n ++filesCompleted;\n ++filesInChunkCompleted;\n // if every single file is done\n if (filesUsed === filesLimit || filesCompleted === numFiles) {\n if (!limitReached) {\n cb(null, mainXmlDoc.toString());\n limitReached = true;\n }\n }\n // if every file in chunk is done\n else if (filesInChunkCompleted === chunkLen && remainingFiles.length > 0) {\n processChunksOfFiles(\n remainingFiles.slice(0, CHUNK_SIZE),\n remainingFiles.slice(CHUNK_SIZE)\n );\n }\n }\n\n if (!bool) {\n checkToFireCallbacks();\n return;\n }\n fs.readFile(filePath, 'utf-8', function(err, xml) {\n if (limitReached) return;\n if (err) {\n cb(err);\n return;\n }\n if (typeof xml !== 'string' || xml.length === 0) {\n checkToFireCallbacks();\n return;\n }\n try {\n var doc = libxml.parseXmlString(xml);\n var rootEl = doc.root();\n filterOsm.user(rootEl, filter, function(rootEl, bool) {\n if (!bool) {\n checkToFireCallbacks();\n return;\n }\n\n var formData = JSON.parse(\n fs.readFileSync(\n path.join(path.dirname(filePath), 'data.json'),\n 'utf8'\n )\n );\n var unusefulKeys = [\n 'start', 'end', 'today', 'simserial', 'meta', 'deviceid',\n 'username'\n ];\n var usefulKeys = Object.keys(formData).filter(\n key => !unusefulKeys.includes(key) && !key.startsWith('osm_')\n );\n\n var osmElements = rootEl.childNodes();\n for (var j = 0, len = osmElements.length; j < len; j++) {\n var osmElement = osmElements[j];\n // Check that the element is a node, way, or relation.\n var elementName = osmElement.name();\n if (elementName === 'node') {\n rewriteNegativeId(negIdRewriteHash, osmElement);\n } else if (elementName === 'way' || elementName === 'relation') {\n rewriteNegativeId(negIdRewriteHash, osmElement);\n // Ways and relations might need their negative refs rewritten too.\n rewriteNegativeRef(negIdRewriteHash, osmElement);\n }\n // add submission_time and submission_user or submission_deviceid\n // to each feature with the aim of showing this information on the map\n if (['way', 'relation'].includes(elementName) ||\n (elementName === 'node' && checkNodeIsRelevant(osmElement))\n ) {\n osmElement.node('tag').attr({\n k: 'submission_date',\n v: formData.meta.submissionTime.slice(0,10)\n });\n if (formData.username) {\n osmElement.node('tag').attr({\n k: 'submission_user',\n v: formData.username\n });\n } else {\n osmElement.node('tag').attr({\n k: 'submission_deviceid',\n v: formData.deviceid\n });\n }\n usefulKeys.map(key => {\n osmElement.node('tag').attr({\n k: key,\n v: typeof(formData[key]) === 'object' ? JSON.stringify(formData[key]) : formData[key]\n });\n });\n }\n mainOsmElement.addChild(osmElement);\n }\n ++filesUsed;\n checkToFireCallbacks();\n });\n } catch (err) {\n cb(err);\n return;\n }\n\n });\n });\n\n });\n }", "title": "" }, { "docid": "8ec7185656c274aaf6c71f993ecd8c0f", "score": "0.6041103", "text": "function scan(inputPath) {\n /* reset result */\n result = {};\n details = [];\n var options = {\n maxPending: -1,\n maxAttempts: 3,\n attemptTimeout: 3000\n };\n\n //to show the animation\n document.title = 'size checker';\n $(\".selectFolder\").css(\"display\", \"none\");\n $(\".spinner\").css(\"display\", \"block\");\n \nfilewalker(inputPath,options)\n .on('dir', function(p) {\n //console.log('dir: %s', p);\n })\n .on('file', function(p, s) {\n //console.log('file: %s, %d bytes and %s', p, s.size, bytesToSize(s.size));\n details.push({\"name\":p,\"size\":bytesToSize(s.size)});\n if (p.indexOf('/') > 0 ){\n if (result[p.substring(0,p.indexOf('/'))]){\n result[p.substring(0,p.indexOf('/'))] +=s.size\n }\n else {\n result[p.substring(0,p.indexOf('/'))] = s.size\n }\n }\n else {\n result[p] = s.size\n }\n })\n .on('error', function(err) {\n console.error(err);\n })\n .on('done', function() {\n console.log('%d dirs, %d files, %d bytes and %s', this.dirs, this.files, this.bytes, bytesToSize(this.bytes));\n var newTitle = this.dirs + ' dirs, '+ this.files + ' files, total size of ' + bytesToSize(this.bytes);\n document.title = newTitle;\n var totalSize = this.bytes;\n var index = 1;\n var preWidth = 100;\n var preHeight = 100;\n for (var x in result){\n var divPercent = result[x] / totalSize * 100 ;\n var divColor = (function(m,s,c){return (c ? arguments.callee(m,s,c-1) : '#') + s[m.floor(m.random() * s.length)]})(Math,'0123456789ABCDEF',5) ;\n var idName = '#'+index;\n if (index % 2 != 0){\n $(idName).append('<div id=\"' + (index+1) + '\"style=\"float:left;width:'+ preWidth +'%;height:' + preHeight +'%; \"><div class=\"usageblock\" style=\"float:left;background-color:'+ divColor + '; width:' + divPercent +'%;height:100%\" ><span style=\"display:none\">' + x + ' &nbsp &nbsp <b>' + bytesToSize(result[x]) +'</b> </span></div></div>');\n preWidth = 100 - divPercent;\n preHeight = 100 ;\n }\n else {\n $(idName).append('<div id=\"' + (index+1) + '\"style=\"float:right;width:'+ preWidth +'%;height:' + preHeight +'%; \"><div class=\"usageblock\" style=\"float:right;background-color:'+ divColor + '; height:' + divPercent +'%;width:100%\" ><span style=\"display:none\">' + x +' &nbsp &nbsp <b>' + bytesToSize(result[x]) + '</b></span></div></div>');\n preHeight = 100 - divPercent;\n preWidth = 100 ;\n }\n index += 1;\n totalSize -= result[x];\n }\n \n //done \n $(\".spinner\").css(\"display\", \"none\");\n $(\".usagesection\").css(\"display\", \"block\");\n $(\".usageblock\").hover(function(){\n var rhtml = $(this).find(\"span\").html();\n $(\"#usageInfo\").html(rhtml);\n });\n })\n.walk();\n}", "title": "" }, { "docid": "a5a957c23d5a628e24d802c136ae0405", "score": "0.6035675", "text": "function addAllFiles(){\n \tfor ( var i = 0; i < fileArr.length; i++ ) {\n \t drawFileObject(fileArr[i].fileName, fileArr[i].fileFormat, fileArr[i].filePath);\n }\n transformCurrentView();\n\t checkAllSuspiciousFile();\n}", "title": "" }, { "docid": "9442abcb0e5ef74f2e18474b46350d70", "score": "0.597925", "text": "function IterateFileList(files, baseFolder){\n \n var output = {};\n var filesArray = [];\n while(files.hasNext()){\n var file = files.next();\n var parents = file.getParents();\n var path = GeneratePath(parents, baseFolder);\n filesArray.push(GetFileInfo(file, path));\n }\n output.files = filesArray;\n output.filesCount = filesArray.length;\n Logger.log(output)\n return output;\n}", "title": "" }, { "docid": "b0ac8a9fdc4febf2c8727c8418b695bd", "score": "0.5972877", "text": "processDir(callback) {\n fs.readdir(this.dataDir, (err, files) => {\n if (err) throw err;\n this.filesToProcess = files.length; \n for (let f of files) {\n this.processFile(f, callback);\n }\n });\n }", "title": "" }, { "docid": "6882e84c10c254aa963419ec8522e5f1", "score": "0.5968787", "text": "function getAllPathsAndStats(callback) {\r\n fs.readdir(dir, function (err, files) {\r\n if (err) { callback(err); return; }\r\n var paths = _.map(files, function (file) { return path.join(dir, file); });\r\n var stats = [];\r\n var remaining = paths.length;\r\n if (remaining === 0) {\r\n\r\n // Directory is empty.\r\n callback(null, { paths: paths, stats: stats });\r\n } else {\r\n\r\n // Get all file stats in parallel.\r\n paths.forEach(function (path, i) {\r\n fs.stat(path, function (err, stat) {\r\n if (remaining === 0) return;\r\n if (err) {\r\n remaining = 0;\r\n callback(err);\r\n } else {\r\n stats[i] = stat;\r\n --remaining;\r\n if (remaining === 0) callback(null, { paths: paths, stats: stats });\r\n }\r\n });\r\n });\r\n }\r\n });\r\n }", "title": "" }, { "docid": "2e5fe5c023141de9fd21c1e0584bd243", "score": "0.5958255", "text": "function processRawFiles() {\n let files = walk('./raw/matches');\n files.forEach(function(file) {\n processMatchFile(file);\n });\n}", "title": "" }, { "docid": "060d8dab773d1711d7725d2939364577", "score": "0.59541446", "text": "function testScanFiles(callback) {\n const filenames = [\n 'foo',\n 'foo.jpg',\n 'bar.gif',\n 'baz.avi',\n ];\n const expectedFiles = [\n '/testScanFiles/foo.jpg',\n '/testScanFiles/bar.gif',\n '/testScanFiles/baz.avi',\n ];\n reportPromise(\n makeTestFileSystemRoot('testScanFiles')\n .then(populateDir.bind(null, filenames))\n .then(fileOperationUtil.gatherEntriesRecursively)\n .then(\n /** @param {!Array<!FileEntry>} files */\n files => {\n return scanner.scanFiles(files, scanMode).whenFinal();\n })\n .then(assertFilesFound.bind(null, expectedFiles)),\n callback);\n}", "title": "" }, { "docid": "09fac591f27ce472b5e32d87045e757c", "score": "0.59404343", "text": "function ScanFiles() {\n // Send all these files to the API to ensure they're in the DB, and get back data on any metadata of our files.\n request.post({url: `${config.LSSURI}/api/addfiles`, json: {\"Data\": filesArray, \"UniqueKey\": data.UniqueKey}}, function(err, response, body) {\n if (response) {\n if (response.statusCode == 200) {\n filesArray = body.Message;\n };\n };\n });\n\n // Setup file watchers for each file.\n for (let f = 0; f < filesArray.length; f++) { // Iterate over each file\n\n let fsWait = false;\n fs.watch(filesArray[f].filepath, {encoding: 'utf8'}, function(eventType, filename) {\n if (filename) {\n\n if (fsWait) return; // Limit the method to only return once when detected change (fs.watch() is a lil buggy) by ignoring it for 100ms after first event.\n fsWait = setTimeout(() => {fsWait = false;}, 300);\n\n if (eventType == \"rename\") {\n // ohh BALLS! The file has been renamed, way to go silly user!\n // Identify if the file has been renamed to something else (no longer watchable), or if it's been renamed back (watchable)\n if (fs.existsSync(filesArray[f].filepath)) {\n console.log(`[Warning] - Regained track of ${filename}`);\n // Todo: Set notify message\n } else {\n console.log(`[Warning] - Lost track of ${filename} due to it being renamed, moved or deleted.`);\n // Todo: Set notify message\n };\n\n // Todo: Notify user via something, prolly request server API to notify user.\n\n } else if (eventType == \"change\") {\n console.log(`Modification on ${filesArray[f].filename} detected. Comparing to database...`);\n filesArray[f].size = fs.statSync(filesArray[f].filepath).size, // Update our memory copy of the file\n\n CompareFileToDB(filesArray[f])\n .then(changes => {\n if (changes) {\n console.log(`Sending detected changes in ${filesArray[f].filename} to database.`);\n\n // Read the data from the file via 'partial-memory-streaming' I guess? I just made that word.\n streamFromLine(filesArray[f], filesArray[f].lastLine).then(memData => {\n if (memData) {\n //Strigify and compress array json returned from readFromLine(), which contains the files data as a list for each line.\n let compressedFileData = JSON.stringify(memData);\n filesArray[f].fileData = zlib.deflateSync(compressedFileData).toString('base64');\n\n console.log('My byte size is approximately', JSON.stringify(filesArray[f]).length);\n\n //Send the entire file object over the database\n console.log(`Sending compressed file (${filesArray[f].filename}) data to server.`);\n request.post({url: `${config.LSSURI}/api/addseries`, json: {\"Data\": filesArray[f], \"UniqueKey\": data.UniqueKey}}, function(err, response, body) {\n if (response) {\n console.log(response.body);\n };\n if (err) {\n console.log(`[WARNING] ${err}`);\n };\n });\n };\n })\n } else {\n console.log('Database says we are in sync.');\n }\n });\n };\n };\n });\n };\n console.log(`Client is running.`);\n}", "title": "" }, { "docid": "eef2767abe02e382b26c8d3f445d6e2d", "score": "0.59303135", "text": "function listAllFiles() {\n var promise = new Promise((resolve, reject) => {\n fs.readdir(directoryPath, function (err, files) {\n //handling error\n if (err) {\n console.log(error('Unable to scan directory: ' + err));\n promises.push(new Promise((resolve, reject) => {\n reject(\"cant read files in current folder\");\n }))\n }\n var arr = [];\n for (var i = 0; i < files.length; i++) {\n var filePath = directoryPath + \"/\" + files[i]\n var stat = fs.statSync(filePath);\n // Do whatever you want to do with the file\n if (stat.isFile())\n arr.push({\n folderName: directoryPath,\n fileName: files[i]\n });\n }\n resolve(arr);\n });\n })\n\n return promise\n}", "title": "" }, { "docid": "6e56a598e59d0d5f1b1056966e77db5b", "score": "0.59120977", "text": "function processFiles (files, minlen, logger, cb) {\n if (files.length === 0) { \n logger.info('Processing FASTA file: stdin with minlen %i', minlen)\n processFile(process.stdin, \"stdin\", minlen, logger, cb);\n return\n }\n\n for (idx in files) {\n file = files[idx]\n\n logger.info('Processing FASTA file: %s with minlen %i', file, minlen)\n\n // Read the file, pipe through the fasta parser, then through our filter, then output as appropriate\n processFile(fs.createReadStream(file), file, minlen, logger, cb);\n }\n}", "title": "" }, { "docid": "6e217ec1505bca075212af3eb0c3ac55", "score": "0.5840508", "text": "function processFiles(dir) {\n fs.readdir(dir, function(err, list) {\n if (err) {\n console.log('processFiles err: ' + err);\n return;\n }\n list.forEach(function(file) {\n file = dir + '/' + file;\n fs.stat(file, function(err, stat) {\n if (!stat.isDirectory()) {\n compress(file);\n }\n });\n });\n });\n}", "title": "" }, { "docid": "3c10d11bfd00516b093a9f325e722c3d", "score": "0.58351", "text": "getFiles (dir, callback, files_) {\n files_ = files_ || [];\n fs.readdir(dir, (err, files) => {\n async.each(files, (filename, cb) => {\n let path = dir + '/' + filename;\n fs.lstat(path, (err, stats) => {\n if (stats.isSymbolicLink()) {\n files_.push(path);\n cb();\n } else {\n this.getFiles(path, () => {\n cb();\n }, files_);\n }\n });\n }, () => {\n callback(files_);\n });\n });\n }", "title": "" }, { "docid": "3c10d11bfd00516b093a9f325e722c3d", "score": "0.58351", "text": "getFiles (dir, callback, files_) {\n files_ = files_ || [];\n fs.readdir(dir, (err, files) => {\n async.each(files, (filename, cb) => {\n let path = dir + '/' + filename;\n fs.lstat(path, (err, stats) => {\n if (stats.isSymbolicLink()) {\n files_.push(path);\n cb();\n } else {\n this.getFiles(path, () => {\n cb();\n }, files_);\n }\n });\n }, () => {\n callback(files_);\n });\n });\n }", "title": "" }, { "docid": "dd3a2a5257ac3e8fa60efbb725d8fb29", "score": "0.5832618", "text": "function processFiles(files) { \n let movingFiles = [];\n let encryptingFiles = [];\n\n for (var i = 0, iMax = files.length; i < iMax; i++) {\n let file = new ShFile(files[i]);\n movingFiles.push(moveFile(file));\n }\n\n Promise.all(movingFiles)\n .then((movedFiles) => {\n for (var j = 0, jMax = movedFiles.length; j < jMax; j++) {\n // Some files will not be moved due to name conflicts and errors.\n // If that is the case, the returned value will be null.\n if (movedFiles[j]) {\n encryptingFiles.push(encryptNewFile(movedFiles[j], 'foobarbaz')); // todo: accept this from User\n }\n }\n return Promise.all(encryptingFiles);\n })\n .then(() => {\n logger.info('Finished consuming file(s)');\n })\n .catch(error => {\n logger.error(error);\n });\n}", "title": "" }, { "docid": "81beb662813ea9fd837872222b928312", "score": "0.5829405", "text": "getFiles (dataArray) {\n let files = []\n if (Array.isArray(dataArray)) {\n dataArray.forEach((data) => {\n files.push(this.getFileObject(data))\n })\n }\n return files\n }", "title": "" }, { "docid": "1d10f27b4566244fe455ef97b14f416c", "score": "0.5802542", "text": "function getAllFiles( array, folder ) {\n\n // Loop through the array to find files\n // \"coreFile\" represents one item in an array\n array.forEach( function( coreFile ) {\n\n // Use \"dlFiles()\" to file-check & download the files in the array\n // Pass \"array\" & \"folder\" params above, \"dlFiles()\" does the rest\n dlFiles( coreFile, folder );\n\n })\n\n}", "title": "" }, { "docid": "3e80fd0596d88e924e5de98a41f5d7ff", "score": "0.5777505", "text": "async function scanAllFiles(force = false, maxFiles = 999999) {\n\n const started = Date.now();\n let lastUpdate = started;\n\n // setup the HTTP request to the malware scanner web service\n const options = {\n method: 'POST',\n uri: SCAN_SERVICE_URL,\n body: {\n filename: null,\n projectId: firebase.instanceId().app.options.projectId,\n },\n json: true,\n };\n\n // open the storage bucket\n const bucket = firebase.storage().bucket(config.STORAGE_URL);\n\n const processed = [];\n let exception = 'none';\n\n await createLogFile(bucket, started, processed, exception);\n\n try {\n\n // get all files in the bucket\n const [files] = await bucket.getFiles({\n // 'prefix': '/exercises',\n });\n\n // scan all files\n let scanResult;\n let countApiCall = 0;\n for (let i = 0; i < files.length; i++) {\n let file = files[i];\n\n // there is no point scanning the logs files this function produces\n if (file.name.startsWith('virusScanningLogs')) {\n continue; // skip this file\n }\n\n if (force || file.metadata.metadata.scanned === undefined) {\n\n if (countApiCall >= API_MAX_REQUEST) {\n countApiCall = 0;\n // delay API_RATE_WINDOW_MS milliseconds\n await delayMS(API_RATE_WINDOW_MS);\n }\n\n // make the HTTP request to scan the file\n options.body.filename = file.name;\n try {\n scanResult = await request(options);\n } catch (e) {\n scanResult = {error: e.message};\n }\n countApiCall++;\n\n processed.push({\n name: file.name,\n scanned: getScannedDateTime(Date.now()),\n status: scanResult.status || scanResult.error,\n });\n\n } else { // don't rescan this file\n\n processed.push({\n name: file.name,\n scanned: getScannedDateTime(file.metadata.metadata.scanned),\n status: file.metadata.metadata.status || null,\n });\n\n }\n\n if (processed.length >= maxFiles) {\n break;\n }\n\n // update the log file every X seconds\n const diffSecond = Math.round((Date.now() - lastUpdate) / 1000);\n if (diffSecond >= UPDATE_LOG_SECOND) {\n await createLogFile(bucket, started, processed, exception);\n lastUpdate = Date.now();\n }\n\n }\n } catch (e) {\n exception = e;\n }\n\n await createLogFile(bucket, started, processed, exception, true);\n }", "title": "" }, { "docid": "dfd18553fad308795983df5b1dff062b", "score": "0.5746733", "text": "function buildAssembledFilesCollection ( collection ) {\n var assembled_file,\n assembled_files_collection = collectionFactory.createCollection();\n while (collection.hasNext()) {\n assembled_file = \n assembler.assemble(\n collection.getNext(),\n finder);\n assembled_files_collection.addElement(assembled_file);\n }\n collection.resetPointer();\n return assembled_files_collection;\n }", "title": "" }, { "docid": "7bfa92bc9a5dcdb1120e0da59e500567", "score": "0.57227457", "text": "function info_about_files(){\n \n files.forEach(function(file){\n fs.stat(base+path+file, function(err, stats){\n children[file] = {};\n if(err != null) { console.log(err); res.send('Ups'); return;}\n if(stats.isFile()){\n children[file].isFile = true;\n children[file].size = stats.size;\n children[file].name = file;\n children[file].lastModified = date_format(stats.mtime);\n children.push(file);\n } else {\n children[file].name = file;\n children[file].lastModified = date_format(stats.mtime);\n children.push(file);\n }\n filesEE.emit('files_stats_ready',file);\n },file );\n });\n\n }", "title": "" }, { "docid": "d137781042327b629b2bfff085692f4b", "score": "0.57075983", "text": "function group (files, opts, callback) { // opts: { size: boolean }\n if (typeof opts === 'function') return group(files, {}, opts)\n var allAbs = files.every(function (file) {\n return path.isAbsolute(file.path)\n })\n if (!allAbs) return callback(Error('cannot yet handle relative filepaths'))\n var trap = { dirs: [], files: [], paths: [], fdir: [], map: {}, temp: [] }\n var groups = []\n Array.prototype.push.apply(trap.paths, files.map(function (file) {\n return file.path\n }))\n // if single file input always early return as single file\n if (!trap.paths.length) {\n return callback(null, [])\n } else if (trap.paths.length === 1) {\n var singleton = { type: 'file', path: trap.paths[0] }\n if (opts.size) singleton.size = files[0].size\n return callback(null, [ singleton ])\n }\n // split paths into file objects\n trap.fdir = trap.paths.map(function (filepath) {\n return { path: filepath, dir: path.dirname(filepath) }\n })\n // map files to dirs\n trap.map = trap.fdir.reduce(function (acc, cur) {\n if (acc.hasOwnProperty(cur.dir)) acc[cur.dir].push(cur.path)\n else acc[cur.dir] = [ cur.path ]\n return acc\n }, {})\n // push keys of props that represent an entire dir to trap.dirs... via trap.t\n var dirs = Object.keys(trap.map)\n var pending = dirs.length\n dirs.forEach(function (dir) {\n gotAllNestedFiles(dir, trap.map, function (err, truth) {\n if (err) return callback(err, null)\n if (truth) trap.temp.push(dir)\n if (!--pending) finishUp()\n })\n })\n // finish\n function finishUp () {\n // push paths that are not covered by trap.temp to trap.files\n Array.prototype.push.apply(trap.files,\n trap.fdir.filter(function (file) {\n return !trap.temp.some(function (dir) {\n return dir === file.dir\n })\n }).map(function (file) {\n return file.path\n })\n )\n // collapse nested dirs in trap.temp to trap.dirs\n Array.prototype.push.apply(trap.dirs,\n trap.temp.filter(function (dir, i, arr) {\n return !arr.filter(function (d) {\n return d !== dir\n }).some(function (other) {\n return dir.startsWith(other)\n })\n })\n )\n // package neatly\n groups = trap.files.map(function (file) {\n return { type: 'file', path: file }\n }).concat(trap.dirs.map(function (dir) {\n return { type: 'directory', path: dir }\n }))\n // maybe add size\n if (opts.size) {\n groups = groups.map(function (item, i) {\n if (item.type === 'file') {\n item.size = files.find(function (file) {\n return file.path === item.path\n }).size\n } else {\n item.size = files.reduce(function (acc, cur) {\n if (cur.path.startsWith(item.path)) acc += cur.size\n return acc\n }, 0)\n }\n return item\n })\n }\n callback(null, groups)\n }\n}", "title": "" }, { "docid": "e87d5caefb021c5f2de2921bd109f095", "score": "0.5705029", "text": "async function run () {\n const startDate = new Date()\n console.log(`start at ${startDate}`)\n\n const snapshotFolder = path.resolve(__dirname, 'snapshots')\n const folderList = folderWalker(snapshotFolder)\n const skipMap = new Map()\n folderList.forEach(name => skipMap.set(name, true))\n\n console.log(`start scan ${targetPath} folder`)\n const statList = await fileWalker(targetPath, skipMap)\n const allCount = statList.length\n console.log(`find all of ${allCount} files`)\n\n let c = 0\n let success = 0\n let failure = 0\n for await (const stat of statList) {\n const { name, path } = stat\n c += 1\n\n console.log(`[${c}/${allCount}] taking ${name} snapshots on ${path}`)\n try {\n await takeSnapshot(name, path)\n success += 1\n } catch (e) {\n failure += 1\n console.error(e)\n }\n }\n\n const endDate = new Date()\n console.log(`complete script at ${endDate}`)\n console.log(`success ${success} files and failed ${failure} files on ${allCount} files`)\n}", "title": "" }, { "docid": "a248a279d29894b2ac80ed8e6141d0a5", "score": "0.56948465", "text": "function readFromDirData(){\n // let filedir = fs.readdirSync(\"../data\");\n // filedir.forEach((file) => {\n // let filestring = fs.readFileSync(\"../data/\" + file);\n // let fileobj = JSON.parse(filestring);\n // let docs = extractDocuments(fileobj);\n // docs.forEach((elem) => {\n // documents.push(elem);\n // })\n // })\n let filestring = fs.readFileSync(\"./testset.json\");\n let fileobj = JSON.parse(filestring);\n fileobj.forEach((doc) => {\n documents.push(doc)\n })\n console.log(documents.length)\n calcStats();\n}", "title": "" }, { "docid": "b9a329a8d9ae7fab9c64d28b857211e8", "score": "0.56941134", "text": "async normalizeFilesCount() {\n await this.__filesQueue.normalize();\n\n if(!this.__filesQueue.files.length) {\n return await this.addNewFile();\n }\n }", "title": "" }, { "docid": "09ab8ba9f0600d7d9a4d1585a1e37ad6", "score": "0.5693927", "text": "function scan(arr, fn) {\n var batch = new Batch();\n\n arr.forEach(function(pattern) {\n batch.push(function(done) {\n glob(pattern, done);\n });\n });\n\n batch.end(fn);\n}", "title": "" }, { "docid": "df77fc57c632e7ef59eb8675bf16f3b8", "score": "0.568909", "text": "function allFiles(f) {\r\n\ttry {\r\n\t\t// open all files\r\n\t\tfor (var fc = new Enumerator(f.Files); !fc.atEnd(); fc.moveNext()) {\r\n\t\t\tvar file = fc.item();\r\n\t\t\topenFile(file);\r\n\t\t}\r\n\t} catch (e) {\r\n\t\t// some error accessing the files of the folder\r\n\t\t// no reporting yet\r\n\t}\r\n\r\n\ttry {\t\r\n\t\t// go into all subfolders\r\n\t\tfor (var fc = new Enumerator(f.SubFolders); !fc.atEnd(); fc.moveNext()) {\r\n\t\t\tvar sf = fc.item();\r\n\t\t\tallFiles(sf);\r\n\t\t}\r\n\t} catch (e) {\r\n\t\t// some error accessing the subfolders of the folder\r\n\t\t// no reporting yet\r\n\t}\r\n}", "title": "" }, { "docid": "41ca84d8e76dcf7e6cd35eb236a82a5a", "score": "0.56881213", "text": "async loadFileList(dirName) {\n const allFiles = await fs.readdir(dirName);\n let fileList = [];\n allFiles.forEach((file) => {\n if (path.extname(file) === '.gpx') {\n fileList.push(path.basename(file, '.gpx'));\n }\n });\n return fileList;\n }", "title": "" }, { "docid": "811de7008a2d3ccf08fbd21aed1f62e4", "score": "0.5669761", "text": "function getAllFiles() {\r\n\t\t\tvar allFilesArray = new Array();\r\n\t\t\tif (app.project != null) {\r\n\t\t\t\tvar items = app.project.items;\r\n\t\t\t\tfor (var i = 1; i <= items.length; i += 1) {\r\n\t\t\t\t\tif (items[i] instanceof FootageItem && items[i].mainSource instanceof FileSource) {\r\n\t\t\t\t\t\tallFilesArray[allFilesArray.length] = items[i];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn allFilesArray;\r\n\t\t\t\r\n\t\t\t}", "title": "" }, { "docid": "12c9f2851cd2e4f7e5e6c7da7676cd4a", "score": "0.56412077", "text": "function find_files (dir, mask_array){ \n var arr = []; \n for (var i = 0; i < mask_array.length; i++){ \n arr = arr.concat (find_files_sub (dir, [], mask_array[i].toUpperCase())); \n } \n return arr; \n}", "title": "" }, { "docid": "de8136b0478199b7366bb5b0b58a4fa8", "score": "0.5636589", "text": "function _parseFiles(files, done) {\n var docs = [];\n\n async.each(files, function(file, cb) {\n parse.file(file, function(err, contents) {\n if (err) {\n done(err);\n }\n\n docs.push(contents);\n cb();\n });\n }, function(err) {\n if (err) {\n done(err);\n }\n\n done(null, docs);\n });\n}", "title": "" }, { "docid": "d8a23e7a998937258f42813b563c982d", "score": "0.5623229", "text": "function searchIterative(PathToSearch, xtensionSearch) {\n var path = require('path'), fs = require('fs');\n // console.log(\"Collecting all Excel Files - from SpecialLibrary\");\n if (!fs.existsSync(PathToSearch)) {\n console.log(\"Specified directory doesnt exist \", PathToSearch);\n return;\n }\n var files = fs.readdirSync(PathToSearch);\n for (var i = 0; i < files.length; i++) {\n var filename = path.join(PathToSearch, files[i]);\n var stat = fs.lstatSync(filename);\n if (stat.isDirectory()) {\n searchIterative(filename, xtensionSearch); //recursive\n }\n else if (filename.indexOf(xtensionSearch) >= 0) {\n console.log('-- found: ', filename);\n arrFoundFiles.push(filename);\n };\n };\n }", "title": "" }, { "docid": "e5c4f970e95d22555efb0cdc380c8fc7", "score": "0.5613629", "text": "function uploadFiles (files) {\n status.total = files.length;\n\n const processFile = (file, callback) => {\n checkIfUploadRequired(file, (err, required) => {\n if (err) {\n return callback(err);\n }\n\n if (required) {\n return uploadFile(file, callback);\n }\n\n status.skipped++;\n printProgress('Skipped', file.path.dir + '/' + file.path.base);\n return callback();\n });\n };\n\n return new Promise((resolve, reject) => {\n Async.eachLimit(files, config.concurrentRequests, processFile, err => {\n if (err) {\n return reject(err);\n }\n console.log('\\n');\n resolve();\n });\n });\n}", "title": "" }, { "docid": "c05f0c7085ead726df63fe66947d73c7", "score": "0.56075245", "text": "function build_filesSync( dir ){\n\n var obj = [];\n var files = fs.readdirSync(dir);\n for( var i = 0; i < files.length; i++){\n var full_path = dir + \"/\" + files[i];\n var stats = fs.statSync( full_path );\n var tmp_file = {};\n tmp_file.name = files[i];\n if( stats.isDirectory() )\n {\n tmp_file.files = build_filesSync( full_path );\n }else{\n tmp_file.hash = md5(full_path);\n files_hash[tmp_file.hash] = full_path;\n }\n obj.push( tmp_file );\n }\n\n //console.log(util.inspect(obj, null, true));\n return obj;\n}", "title": "" }, { "docid": "98b1793c16a2cba0a9eb7378d8703023", "score": "0.5585219", "text": "function collectFiles2Zip(doALL, doPDF, doTEX, doTMP, doMED, doEXTRA) {\n\tlet dirlist = [];\n\tlet filelist = [];\n\tlet promises = [];\n\tlet extradocs = [];\n\tlet records = getCurrentRecords();\n\n\t//callback to be run when PHP returns a list of contents for a given directory (when its promise is resolved)\n\tfunction fileCallback(promise) {\n\t\treturn function(d) {\n\t\t\tfilelist = filelist.concat(d.split(\",\"));\n\t\t\tpromise.resolve();\n\t\t}\n\t}\n\n\t//Compile directory lists to be sniffed. Concurrently compile a list of extra documents from the corresponding lab record.\n\t//First checks for a user sub selection of records. If no sub selection then it collects all rendered records.\n\tif ($(\"#zip-icon\").hasClass(\"active\")) {\n\t\tfor (let i = records.length - 1; i >= 0; i--) {\n\t\t\tif (records[i].children(\".lab-record-simple-flex\").children(\".fa-circle\").hasClass(\"selected\")) {\n\t\t\t\tdirlist.push(records[i].find(\".version-directory\").text());\n\t\t\t\textradocs.concat(getExtraDocsFromRecord(records[i]));\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor (let i = records.length - 1; i >= 0; i--) {\n\t\t\tdirlist.push(records[i].find(\".version-directory\").text());\n\t\t\textradocs.concat(getExtraDocsFromRecord(records[i]));\n\t\t}\n\t}\n\n\n\t//Create a promise for each directory to be resolved when PHP successfully returns a file list representing the contents of the directory\n\tfor (let i = dirlist.length - 1; i >= 0; i--) {\n\t\tlet promise = $.Deferred();\n\t\tpromises.push(promise);\n\t\t$.post(siteroot + \"/php/getFileListRecursive.php\", \"dirpath=\" + dirlist[i], fileCallback(promise));\n\t}\n\n\t//create a new promise to be resolved when all other promises are resolved\n\tlet deferredFileList = $.when.apply($, promises);\n\n\t//when PHP has finished sniffing all the files inside the directories and returned the file lists 'deferredFileList' is resolved\n\tdeferredFileList.done(function() {\n\t\tfilteredlist = filterFileList(doALL, doPDF, doTEX, doTMP, doMED, filelist);\n\t\tif(doEXTRA || doALL) {\n\t\t\tfilteredlist.concat(extradocs);\n\t\t}\n\t\tmakePromisesBeginZip(filteredlist);\n\t\tconsole.log(\"An elegant syntax for ease of use,\\neasy reading. Not abstruse.\\n\\nHaving this would sure be swell.\\nPHP can rot in hell.\")\n\t});\n\n\t//There is no graceful way to bail from this from a website functionality perspective.\n\t//If this promise fails the website should be considered broken so a simple console log is printed.\n\tdeferredFileList.fail(function() {console.log(\"File collection failed: Unable to locate files for selection.\")});\n\tconsole.log(\"Exiting CollectFiles2Zip\");\n}", "title": "" }, { "docid": "60e774559dcbeb7fd9fe4f2c2d4e1f5d", "score": "0.5583276", "text": "function runThroughFiles(dir){\n\tglob(dir + \"/*.mp4\", function (err, files) {\n\t // files is an array of filenames.\n\t // If the `nonull` option is set, and nothing\n\t // was found, then files is [\"**/*.js\"]\n\t // er is an error object or null.\n\n\t if(err)\n\t \tconsole.log('-- ERROR GETTING FILES WITH GLOB --');\n\n\t console.log(files);\n\n\t // loop through filenames \t \n\t for(var i = 0; i < files.length; i++){\n\t \tvar filepath = files[i];\n\t \tvar index = filepath.lastIndexOf('/');\n\t \tvar ourId = filepath.substring(index + 1);\n\t \tconsole.log(ourId);\n\t\tvar testURL = 'http://' + process.env.IP_ADDR + process.env.PATH_TO_TAGGING_CLIPS + ourId;\n\n\t\t// make call to clarafai to get the tags for that certain video\n\t\tClarifai.tagURL(testURL , ourId, commonResultHandler);\n\t } \n\t});\n}", "title": "" }, { "docid": "2e41c264e55f78f53cfb7e62912fa213", "score": "0.5575606", "text": "function checkFiles() {\n console.log(walk('./raw/matches').length);\n console.log(walk('./processed/matches').length);\n}", "title": "" }, { "docid": "a53a6d9fb6e93661c7b37f2bf9045da9", "score": "0.55702746", "text": "function traverse(dir, allFiles, result = []) {\n\n // list files in directory and loop through\n fs.readdirSync(dir).forEach((file) => {\n\n // builds full path of file\n const fPath = path.resolve(dir, file);\n\n // prepare stats obj\n const fileStats = { file, path: fPath };\n\n // is the file a directory ?\n // if yes, traverse it also, if no just add it to the result\n if (fs.statSync(fPath).isDirectory()) {\n fileStats.type = 'dir';\n fileStats.files = [];\n result.push(fileStats);\n return traverse(fPath, allFiles, fileStats.files)\n }\n\n fileStats.type = 'file';\n result.push(fileStats);\n allFiles.push(fPath);\n });\n return result;\n}", "title": "" }, { "docid": "315c85a383dea9b4efe52a3cf1ac54b7", "score": "0.5553962", "text": "listLogFiles (logDir, logFileRegExp, finish) {\n\n // Read in the directory so we can check the existing logs.\n fs.readdir(logDir, (err, files) => {\n\n if (err) { return finish(err); }\n\n const logFiles = [];\n let maxLogNum = null;\n let maxLogFilename = null;\n\n // No logs found.\n if (!files || !files.length) { return finish(null, logFiles, maxLogNum, maxLogFilename); }\n\n // Filter just the files.\n async.each(files, (filename, next) => {\n\n // Check the type of each filename (e.g. file, directory, etc).\n fs.stat(pathify(logDir, filename), (err, stats) => {\n\n if (err) { return next(err); }\n\n // Skip anything that isn't a file e.g. directories.\n if (!stats.isFile()) { return next(null); }\n\n const match = logFileRegExp.exec(filename);\n\n // Skip if the file isn't one of our logs.\n if (!match) { return next(null); }\n\n // Remember each log file we find.\n logFiles.push({\n filename,\n match,\n });\n\n return next(null);\n\n });\n\n }, (err) => {\n\n if (err) { return finish(err); }\n\n // Drop out here if no log files were found.\n if (!logFiles.length) { return finish(null, logFiles, maxLogNum, maxLogFilename); }\n\n // Sort the files, oldest first.\n logFiles.sort((a, b) => {\n return a.filename.toLowerCase() < b.filename.toLowerCase();\n });\n\n // Reset regular expression.\n const match = logFiles[0].filename.match(logFileRegExp);\n\n // Get the max log info from the oldest log file.\n if (match[1]) {\n maxLogNum = parseInt(match[1], 10);\n maxLogFilename = match[0];\n }\n\n return finish(null, logFiles, maxLogNum, maxLogFilename);\n\n });\n\n });\n\n }", "title": "" }, { "docid": "5af56fed722d723ac8e83894c9291f90", "score": "0.5539593", "text": "function files() {\n let path = datapath + \"imgs/\";\n // let files = [];\n // for(let f of fs.readdirSync(path)) {\n // log.silly(f);\n // files.push(f);\n // }\n // log.silly(typeof(files));\n return fs.readdirSync(path);\n}", "title": "" }, { "docid": "00c2553b3a52aa39a240d109dc7e65b4", "score": "0.5536116", "text": "[Symbol.iterator] () {\n const files = []\n\n files.push({\n type: 'summary',\n filepath: this.summary\n })\n\n if (this.readMore) {\n files.push({\n type: 'read-more',\n filepath: this.readMore\n })\n }\n\n return files[Symbol.iterator]()\n }", "title": "" }, { "docid": "4096abd854c44058b4513eea462e6020", "score": "0.55339515", "text": "get files() {\n if (!this.isDir) return null\n const result = []\n const bcMap = p.findBC(this.uuid, \"file\")\n for (let key in bcMap) {\n const uuid = bcMap[key]\n if (uuid) result.push(uuid)\n }\n return result\n }", "title": "" }, { "docid": "add211a11ecddf4dca8d7c4341c722eb", "score": "0.5531641", "text": "function next() {\n // get next directory to traverse\n var current = queue.shift();\n // if no more to process, we are done\n if (!current) {\n // sort the results if requested\n if (!options.nosort) {\n results.sort(function (a, b) {\n if (a.relativePath < b.relativePath)\n return -1;\n if (a.relativePath > b.relativePath)\n return 1;\n return 0;\n });\n }\n return callback(null, results);\n }\n var relativePath;\n var index;\n var regex;\n var depth;\n var nextIndex;\n var matchItems;\n var enterDirs;\n try {\n // prepare vars\n relativePath = current.path;\n index = current.pattern;\n depth = current.depth;\n regex = patterns[index];\n if (regex) {\n //console.log(\"Matching (r): \", basePath, path, regex.source);\n nextIndex = index + 1;\n var isLast = (nextIndex == patterns.length);\n matchItems = isLast && glob == null;\n enterDirs = !isLast;\n }\n else {\n // globmask matching\n //console.log(\"Matching (g): \", basePath, path, glob.source);\n nextIndex = index;\n matchItems = true;\n enterDirs = (maxDepth == 0) || (maxDepth > 0 && depth < maxDepth);\n // increment depth for each globmask\n depth++;\n }\n // prepare full path\n var fullPath = basePath.join(relativePath).normalize().path;\n // list directory and process its items\n fs.opendir(fullPath, function (err, handle) {\n if (err)\n return callback(err, null);\n emitter.emit(\"traversing\", fullPath);\n // send 1 read request\n var error = null;\n var requests = 1;\n fs.readdir(handle, read);\n function read(err, items) {\n try {\n requests--;\n error = error || err;\n if (error || !items) {\n if (requests > 0)\n return;\n // when done, close the handle\n fs.close(handle, function (err) {\n error = error || err;\n if (err)\n return callback(error, null);\n emitter.emit(\"traversed\", fullPath);\n // process next directory\n next();\n });\n return;\n }\n // process items\n items.forEach(process);\n // read next items using several parallel readdir requests\n while (requests < 2) {\n fs.readdir(handle, read);\n requests++;\n }\n }\n catch (err) {\n error = error || err;\n return callback(error, null);\n }\n }\n });\n }\n catch (err) {\n return callback(err, null);\n }\n // process a single item\n function process(item) {\n var isDir = FileUtil.isDirectory(item.stats);\n var isFile = FileUtil.isFile(item.stats);\n var isDotDir = (item.filename == \".\" || item.filename == \"..\");\n if (isDotDir && !matchDotDirs)\n return;\n if (!isDir && !isFile)\n return;\n var itemPath = relativePath.join(item.filename);\n // add subdirectory to queue if desired\n if (enterDirs && isDir && !isDotDir) {\n queue.push({ path: itemPath, pattern: nextIndex, depth: depth });\n }\n // if not matching items in this directory, we are done with it\n if (!matchItems)\n return;\n // reject items we don't want\n if (isDir && !matchDirectories)\n return;\n if (isFile && !matchFiles)\n return;\n if (regex) {\n // mask matching\n if (!regex.test(item.filename))\n return;\n }\n else {\n // globstar matching\n if (!glob.test(itemPath.path))\n return;\n }\n // add matched file to the list\n var relative = new Path(itemPath.path, fs).normalize();\n item.path = basePath.join(relative).path;\n item.relativePath = relative.path;\n results.push(item);\n emitter.emit(\"item\", item);\n }\n }", "title": "" }, { "docid": "ddf74e31449476a2e3a7bd2fc6d7b5be", "score": "0.5506933", "text": "filesAndFoldersDo(closure) {\n const thisFolderPath = this.getPath()\n\n const folderContents = fs.readdirSync( thisFolderPath, { withFileTypes: true } )\n\n folderContents.forEach( (eachFileStat) => {\n const fullPath = pathLib.join( thisFolderPath, eachFileStat.name )\n\n const path = eachFileStat.isDirectory() ?\n this.thisClassification().new({ path: fullPath })\n :\n FilePath.new({ path: fullPath })\n\n closure( path )\n }) \n }", "title": "" }, { "docid": "c2d813458ccad917f07fc71c5bfd8bc8", "score": "0.5506053", "text": "async function getFiles() {\n const paths = {};\n const fileInformation = await nodeResursiveDir(`${__dirname}/delivery`, true); // add true\n fileInformation.forEach(file => {\n console.log(file)\n const filePath = file.filepath.split('/delivery/')[1];\n let count = 0;\n const pathOfObj = filePath.split('/');\n pathOfObj.pop();\n pathOfObj.reduce((a, b) => {\n count++;\n console.log(a, b, a[b])\n if (a[b]) {\n if (count === pathOfObj.length) {\n a[b] ? '' : a[b] = {};\n return a[b][file.filename.split('.')[0]] = true;\n }\n return a[b];\n } else {\n if (count === pathOfObj.length) {\n a[b] ? '' : a[b] = {};\n return a[b][file.filename.split('.')[0]] = true;\n }\n return a[b] = {};\n }\n\n }, paths)\n });\n return paths\n}", "title": "" }, { "docid": "e4727203abd5a4b43b5e90706e189f6f", "score": "0.550502", "text": "function traverseFileSystem(sourceDirectory, regex, results) {\n var files = fs.readdirSync(sourceDirectory);\n for (var i in files) {\n var currentFile = path.join(sourceDirectory, files[i]);\n const match = RegExp(regex).test(currentFile);\n var stats = fs.statSync(currentFile);\n if (stats.isFile() && match) {\n //let tempArr = currentFile.split(/(\\\\|\\/)tests/);\n //currentFile = tempArr[tempArr.length-1]\n results.push(currentFile);\n }\n else if (stats.isDirectory()) {\n traverseFileSystem(currentFile, regex, results);\n }\n }\n}", "title": "" }, { "docid": "ae4e3ae01061318b3b2a3a42848a72eb", "score": "0.55044895", "text": "async getList() {\n let res = []; \n\n try {\n \n const files = await fs.readdirSync(this.directoryPath) \n //listing all files \n \n for (let file of files) {\n let filePath = `${this.directoryPath}/${file}/index.js`;\n let data = await this.readLine(filePath)\n res.push(data);\n }\n \n } catch (err) {\n console.log(`Unable to scan directory: ${err}`);\n }\n \n return res;\n }", "title": "" }, { "docid": "cc51bf37cc236192109062881263490e", "score": "0.55020165", "text": "async scan(dir_path, entries_matching_path, get_stats) {\n //\n // Format path\n {\n if (entries_matching_path) {\n entries_matching_path = sanitize_regex_path(entries_matching_path);\n }\n }\n /**\n Now path.length>0\n || path[0]=\"**\" and path.length>1\n */\n const { bAll_wildcard, entry_to_find_reg, bEntry_to_find_is_dir, bIterate_subdirs, } = get_path_request(entries_matching_path);\n //\n // Not to iterate all entries twice\n // If bAll_wildcard, we have to first check the next entry\n // (entry_to_find) is not in this to fetch all directories/files\n let entries = bAll_wildcard ? [] : undefined;\n const matching_entries = entries ? [] : undefined;\n //\n // path argument for recursive calls to scan\n // to be used only if !bAll_wildcard\n let recursive_path = !entries_matching_path\n ? undefined\n : entries_matching_path.slice(1);\n {\n const proms = [];\n return fs_promises.opendir(dir_path).then(async (directory) => {\n //\n // Iterate files\n {\n for await (const entry of directory) {\n //\n // If all entries are requested\n {\n // <=> !path\n if (!entry_to_find_reg) {\n if (entry.isDirectory()) {\n const subtree = this.set_subdir(Directory_Tree.make_node({\n dirent: entry,\n path: dir_path,\n parent: this,\n root: this.is_root ? this : undefined,\n }));\n //\n // scan the found directory\n if (bIterate_subdirs) {\n proms.push(subtree.scan(join_path(dir_path, entry.name), recursive_path));\n }\n }\n else {\n this.file_entry = from_Dirent(entry);\n }\n //\n // Fetch entry' stats if requested\n {\n if (get_stats) {\n proms.push(this.load_fs_stats(entry.name, dir_path));\n }\n }\n continue;\n }\n }\n //\n // === path case ===\n // Otherwise a specific entry...\n {\n //\n // ... must be found\n if (!entries) {\n if (entry_to_find_reg.test(entry.name)) {\n if (entry.isDirectory()) {\n if (bEntry_to_find_is_dir) {\n const subtree = this.set_subdir(Directory_Tree.make_node({\n dirent: entry,\n path: dir_path,\n parent: this,\n root: this.is_root ? this : undefined,\n }));\n //\n // scan the found directory\n if (bIterate_subdirs) {\n proms.push(subtree.scan(join_path(dir_path, entry.name), recursive_path));\n }\n }\n }\n //\n // Else entry is a file\n else {\n if (!bEntry_to_find_is_dir) {\n this.file_entry = from_Dirent(entry);\n }\n }\n //\n // Fetch entry' stats if requested\n {\n if (get_stats) {\n proms.push(this.load_fs_stats(entry.name, dir_path));\n }\n }\n // do not break, the regex could math other entries\n }\n }\n //\n // ...or if entry(ies) matching the regex is/are found,\n // should be the only ones used\n // If no matching entry found, all entries are used\n else {\n if (entry_to_find_reg.test(entry.name)) {\n matching_entries.push(entry);\n }\n else {\n entries.push(entry);\n }\n }\n }\n }\n }\n //\n // === bAll_wildcard case ===\n {\n if (matching_entries) {\n //\n //Use matching entries if any\n if (matching_entries.length > 0) {\n entries = matching_entries;\n //\n // Update recursive path accordingly\n // => remove '**' and entry regex\n entries_matching_path = !entries_matching_path\n ? undefined\n : entries_matching_path.slice(2);\n }\n //\n // Iterate entries\n {\n entries.forEach((entry) => {\n if (entry.isDirectory()) {\n if (bEntry_to_find_is_dir) {\n const subtree = this.set_subdir(Directory_Tree.make_node({\n dirent: entry,\n path: dir_path,\n parent: this,\n root: this.is_root ? this : undefined,\n }));\n if (bIterate_subdirs) {\n //\n // scan the found directory\n proms.push(subtree.scan(join_path(dir_path, entry.name), recursive_path));\n }\n // do not break, the regex could math other entries\n }\n }\n //\n // Else entry is a file\n else {\n if (!bEntry_to_find_is_dir) {\n this.file_entry = from_Dirent(entry);\n // do not break, the regex could math other entries\n }\n }\n //\n // Fetch entry' stats if requested\n {\n if (get_stats) {\n proms.push(this.load_fs_stats(entry.name, dir_path));\n }\n }\n });\n }\n }\n }\n //\n // Wait for promises\n {\n if (proms.length === 0) {\n try {\n directory.close();\n }\n catch (ex) { }\n return this;\n }\n return Promise.all(proms).then(() => {\n try {\n directory.close();\n }\n catch (ex) { }\n return this;\n });\n }\n });\n }\n }", "title": "" }, { "docid": "012bcb1667af7f0948bbb03bcaa8e66e", "score": "0.5482587", "text": "function process_next_file() {\r\n\t\tsendfile(i, farr[i], true, false);\r\n\t\t//continue to next file, if exists\r\n\t\ti++;\r\n\t\tif(i < farr.length) setTimeout(process_next_file, 100);\r\n\t}", "title": "" }, { "docid": "85728ed25afe716ec4394a568a04a2e2", "score": "0.547992", "text": "generateFiles(settings) {\n\t\tfs.readdir(settings.src, (err, filenames) => {\n\t\t\tif (err) {\n\t\t\t\tonError(settings.src);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfilenames.forEach((filename) => {\n\t\t\t\tconst fileType = filename.split('.').pop();\n\n\t\t\t\tif (fileType === 'spawn') {\n\t\t\t\t\tfs.readFile(settings.src + filename, (err, content) => {\n\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\tonError(settings.src + filename);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis.parseSpawnFile(content).then((fileString) => {\n\t\t\t\t\t\t\tconsole.log(fileString);\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "011968dd63c5185db263e3847ecff8cc", "score": "0.5477693", "text": "function processFiles(list) {\r\n\r\n var i, file, filename, main, hist;\r\n var files = {\r\n 'hist' : {},\r\n 'main' : {},\r\n 'list' : [],\r\n 'ordList' : ordList\r\n };\r\n\r\n for (i = 0; i < list.length; i++) {\r\n file = list[i];\r\n filename = file.filename;\r\n main = files.main[filename];\r\n if (main === undefined) {\r\n files.main[filename] = file;\r\n files.list.push(file);\r\n } else {\r\n hist = files.hist[filename];\r\n hist = hist ? hist : [];\r\n hist.push(file);\r\n files.hist[filename] = hist;\r\n }\r\n }\r\n return files;\r\n\r\n function move(index, movement) {\r\n moveElementInArray(files.list, index, movement);\r\n }\r\n\r\n function ordList() {\r\n var i, res = [];\r\n // [{'fileTid':'1234'},{'fileTid':'334'}]\r\n for (i = 0; i < files.list.length; i++) {\r\n res.push(files.list[i].fileTid);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "fc27635203737e037fe5a06094df1275", "score": "0.5477442", "text": "function enumerate(dir) {\n jsonFiles = []\n console.log('Enumerating through ' + dir)\n fs.readdirSync(dir).forEach(function(file) {\n var stat\n stat = fs.statSync('' + dir + path.sep + file)\n if (file.split('.').pop() === 'json') {\n return jsonFiles.push('' + dir + path.sep + file)\n }\n })\n return jsonFiles\n}", "title": "" }, { "docid": "a282fe5619e2ad2973cb50a60f812fcd", "score": "0.5475557", "text": "allFilesDo(closure) {\n this.allFilesAndFoldersDo( (eachPath) => {\n if( ! eachPath.isFilePath() ) { return }\n\n closure( eachPath )\n })\n }", "title": "" }, { "docid": "3cada2b3456b36ffd512f37d6c07543e", "score": "0.5475088", "text": "async function uploadScrapedFiles() {\n const filenames = fs.readdirSync(DATA_URI);\n\n for (let filename of filenames) {\n const filedata = require(`${DATA_URI}/${filename}`);\n const scrapeDateTime = getDateFromFilename(filename);\n await persistCards(filedata, scrapeDateTime);\n console.log(`Seeded ${filename}`);\n }\n}", "title": "" }, { "docid": "30b1705391ca93a3f1727bea4c6051b1", "score": "0.5472065", "text": "allFilesAndFoldersDfsDo(closure) {\n const queue = []\n\n queue.push( this )\n\n while( queue.length > 0 ) {\n const current = queue.pop()\n\n // First queue the next folder for the iteration, then evaluate the\n // closure on the current file or folder.\n // This ensures that if the iteration performs some operation with\n // secondary effects on the folder (like deleting it) its children\n // were already queuded\n if( current.isFolderPath() ) {\n const currentPath = current.getPath()\n\n const folderContents = fs.readdirSync( currentPath, { withFileTypes: true } )\n\n const nextFolderItems = []\n\n for( const eachFileStat of folderContents ) {\n // Preserve the order among files and subfolders in a folder\n nextFolderItems.unshift( eachFileStat )\n }\n\n for( const eachFileStat of nextFolderItems ) {\n const fullPath = pathLib.join( currentPath, eachFileStat.name )\n\n const eachPath = eachFileStat.isDirectory() ?\n this.thisClassification().new({ path: fullPath })\n :\n FilePath.new({ path: fullPath })\n\n queue.push( eachPath )\n }\n }\n\n // skip this FolderPath\n if( current !== this ) {\n closure( current )\n }\n }\n }", "title": "" }, { "docid": "7c20e9f70036b73c316df2889fdd0ef7", "score": "0.54712945", "text": "readFolder(folder, recursive, includes, withDirs, depth) {\n const walk = (folder, recursive, level) => {\n let collection = [];\n\n if (fs.existsSync(folder)) {\n const dir = fs.readdirSync(folder);\n\n dir.forEach(i => {\n let itemPath = `${folder}/${i}`;\n\n if (fs.existsSync(itemPath)) {\n\n try {\n const xstat = fs.statSync(itemPath);\n const xstatItem = {\n atime: 'at' + xstat.atime.getTime(),\n mtime: 'mt' + xstat.mtime.getTime(),\n ctime: 'ct' + xstat.ctime.getTime(),\n btime: `bt${xstat.birthtime.getTime()}`\n };\n let item = false;\n\n // the directories\n if (xstat.isDirectory()) {\n if (withDirs === true || withDirs === 'only') {\n let folderName = path.basename(itemPath);\n\n item = new Folder(this, {\n id: folderName,\n path: itemPath,\n folderName: folderName,\n ...xstatItem\n });\n\n if (recursive === true || level < depth) {\n console.log('>>>>>>>>>LEVEL', level);\n item.childs = walk(itemPath, recursive, level + 1);\n }\n\n collection.push(item);\n }\n }\n\n // the files\n if (!xstat.isDirectory() && withDirs !== 'only') {\n let fileName = path.basename(itemPath).replace(path.extname(itemPath), '');\n let extension = path.extname(itemPath).replace('.', '');\n\n const regexExtensions = new RegExp(includes.join(\"|\"), \"i\");\n if (regexExtensions.test(extension)) {\n item = new Image(this, {\n id: fileName,\n filePath: itemPath,\n fileName: fileName,\n extension: extension,\n size: xstat.size,\n ...xstatItem\n });\n\n collection.push(item);\n }\n }\n\n } catch (err) {\n LOG('NOT READABLE', itemPath, err);\n collection = walk(itemPath, recursive, level + 1);\n }\n } else {\n LOG('NOT EXISTS', itemPath);\n collection = walk(itemPath, recursive, level + 1);\n }\n\n\n });\n } else {\n LOG('NOT EXISTS ', folder);\n }\n\n return collection;\n };\n\n return walk(folder, recursive, 0);\n }", "title": "" }, { "docid": "f2e9508e7745794c16479165d115b34b", "score": "0.5471131", "text": "async function processFiles(root, lang, originalRoot) {\n root = root.replace(/\\\\/g, '/');\n if (!lang) {\n return Promise.all(consts.LANGUAGES.map(lang =>\n processFiles(path.join(root, lang).replace(/\\\\/g, '/'), lang, root)));\n } else {\n const promises = fs.readdirSync(root).filter(name => !name.startsWith('_') && name !== 'adapterref').map(name => {\n const fileName = path.join(root, name).replace(/\\\\/g, '/');\n const stat = fs.statSync(fileName);\n if (stat.isDirectory()) {\n if (IGNORE.indexOf(fileName.replace(root, '')) === -1) {\n return processFiles(fileName, lang, originalRoot);\n } else {\n return Promise.resolve();\n }\n } else {\n return processFile(fileName, lang, originalRoot);\n }\n });\n return Promise.all(promises);\n }\n}", "title": "" }, { "docid": "de6ad172a12d5c8727e2d3b58de313cc", "score": "0.54702085", "text": "function inspectAndDescribeFiles(folderPath, files, cb) {\n async.map(files, (file, asyncCb) => {\n let resolvedFilePath = path.resolve(folderPath, file)\n inspectAndDescribeFile(resolvedFilePath, asyncCb)\n }, cb)\n}", "title": "" }, { "docid": "a2fde2c3491029e830d42b33b37ca10a", "score": "0.54681224", "text": "function GetFilesInfo(files, path){\n var output = [];\n while(files.hasNext()){\n var file = files.next();\n output.push(GetFileInfo(file, path));\n }\n return output;\n}", "title": "" }, { "docid": "93181546f8be58fd0c87727672f54735", "score": "0.54530275", "text": "convertFormat(srcFiles, toFormat) {\n // console.log('convertFormat', srcFiles, toFormat)\n if (!srcFiles || !toFormat)\n throw \"ConvertFormat warning: srcFile & toFormat are required fields\"\n if (!toFormat) toFormat = 'flac' // default format\n const tmpDir = tempy.directory() + '/'\n let fileCopyTasks = srcFiles.map(src => fs.copy(src, tmpDir + path.basename(src)) )\n let processTask = () => processAudio(tmpDir,'convertFormat', toFormat)\n let collectTask = () => globby(`${tmpDir}*.${toFormat}`).then(paths => {\n //console.log(`Step 4: globby results in: ${tmpDir}*.${toFormat}`, paths)\n return paths\n })\n return Promise.all( fileCopyTasks )\n .then( processTask )\n .then( collectTask )\n .then( (paths) => {\n //console.log('Step 5: complete', paths.length)\n return paths\n })\n }", "title": "" }, { "docid": "4be06f9166087a62235285c52994ea3d", "score": "0.545202", "text": "allFilesAndFoldersBfsDo(closure) {\n const queue = []\n\n queue.unshift( this )\n\n while( queue.length > 0 ) {\n const current = queue.pop()\n\n // First queue the next folder for the iteration, then evaluate the\n // closure on the current file or folder.\n // This ensures that if the iteration performs some operation with\n // secondary effects on the folder (like deleting it) its children\n // were already queuded\n if( current.isFolderPath() ) {\n const currentPath = current.getPath()\n\n const folderContents = fs.readdirSync( currentPath, { withFileTypes: true } )\n\n for( const eachFileStat of folderContents ) {\n const fullPath = pathLib.join( currentPath, eachFileStat.name )\n\n const eachPath = eachFileStat.isDirectory() ?\n this.thisClassification().new({ path: fullPath })\n :\n FilePath.new({ path: fullPath })\n\n queue.unshift( eachPath )\n }\n }\n\n // skip this FolderPath\n if( current !== this ) {\n closure( current )\n }\n }\n }", "title": "" }, { "docid": "b5d023d9db3868601f804853ad05e953", "score": "0.5451704", "text": "function doneAllFiles() {\n filesUploading = [];\n\n // now that we're all done uploading all the files, let's kick off a request to\n // load the album from the server instead of using the fake albumObj above.\n var curTime = (new Date).getTime();\n $.get(\"/api/getAlbum.php?album=\"+album+\"&atTime=\"+curTime,\n\tfunction(data) {\n\t albumObj = data.album;\n\t loadAlbum();\n\t}, 'json');\n}", "title": "" }, { "docid": "ba70ff13878c3c2e39560931d8dab8ec", "score": "0.5450195", "text": "function scanFolders() {\n\t\t// console.log(\"scan it, bitch\");\n\t\tfor (var i = 0; i < deviceList.length; i++) {\n\t\t\tvar devicePath=config.ETHER_TMP_DIR+deviceList[i]+\"/\";\n\t\t\tconsole.log(\"scanning files on \"+devicePath)\n\t\t\tscanFilesAndPipeToRedis(devicePath)\n\t\t}\n\t}", "title": "" }, { "docid": "eb0742e73418cefe93355a0c4ed12986", "score": "0.5440142", "text": "function allFiles () {\n const globPattern = globJoin(testingCache, '**', '*.*')\n const filePaths = glob(globPattern)\n return filePaths.map(s => s.replace(testingCache + path.sep, ''))\n}", "title": "" }, { "docid": "9b5966d2793590ebb9f336832a3ce378", "score": "0.54210293", "text": "async function getAllFileEntries(dataTransferItemList) {\n let fileEntries = [];\n // Use BFS to traverse entire directory/file structure\n let queue = [];\n // Unfortunately dataTransferItemList is not iterable i.e. no forEach\n for (let i = 0; i < dataTransferItemList.length; i++) {\n queue.push(dataTransferItemList[i].webkitGetAsEntry());\n }\n while (queue.length > 0) {\n let entry = queue.shift();\n if (entry.isFile) {\n fileEntries.push(entry);\n } else if (entry.isDirectory) {\n let reader = entry.createReader();\n queue.push(...await readAllDirectoryEntries(reader));\n }\n }\n return fileEntries;\n }", "title": "" }, { "docid": "ca56479df461d3da2aad60a238692ee0", "score": "0.54129", "text": "async function find_kind_files(dir) {\n try {\n var files = await fsp.readdir(dir);\n var found = [];\n for (let file of files) {\n var name = path.join(dir, file);\n var stat = await fsp.stat(name);\n if (stat.isDirectory()) {\n var child_found = await find_kind_files(name);\n for (let child_name of child_found) {\n found.push(child_name);\n }\n } else if (name.slice(-5) === \".kind\") {\n found.push(name);\n }\n }\n } catch (e) {\n console.log(\"Not a directory: \" + dir);\n process.exit();\n }\n return found;\n}", "title": "" }, { "docid": "f9cf0d672a3af66c52cde1c3a69f55a3", "score": "0.5408839", "text": "function readfilesinDirectory(path)\n{\n files=[]\n fs.readdirSync(path).forEach(file => {\n console.log(file);\n files.push(file)\n });\n return files\n}", "title": "" }, { "docid": "28c6836b435f60226871278bcda1d0e3", "score": "0.5406212", "text": "scan(req, res, next) {\n // navigate forward or back in the tree\n const cwd = (req.query.dirname) ? path.join(req.query.dirname, '..') : req.query.cwd;\n if (path.extname(cwd).length > 0) { // do nothing if cwd is a file\n return next();\n }\n // if cwd is a dir then get all sub files, resolve their absolute path and then parse them\n const files = fs.readdirSync(cwd)\n .map((file) => path.resolve(cwd, file))\n .map((file) => path.parse(file));\n // finally send the files to the front end\n res.send(files);\n res.status(200).end();\n }", "title": "" }, { "docid": "a7c42b2fd168bf09993f9bcf039914b9", "score": "0.53953516", "text": "function parseFiles (files) {\n // Print number of files received\n if (files) {\n console.log(`Parsing ${files.length} files.`)\n }\n\n var delayIncrement = 0;\n \n // Iterate files\n files.forEach(function (file, index) {\n if (file.pinned_to) {\n console.log(`Ignoring pinned file: \"${file.title}\"`);\n } else {\n // Make synchronous requests due to Slack's rate limiting\n setTimeout(function () {\n deleteFile(file, index == files.length - 1)\n }, delayIncrement * rateLimitDelayMS);\n\n delayIncrement++;\n }\n });\n}", "title": "" }, { "docid": "8d7fffaaf1e961dca106fdd9d514c261", "score": "0.5391272", "text": "processFiles(files) {\n\t\tfiles.forEach(async file => {\n\t\t\tthis.processDay(file[0], file[1]);\n\t\t});\n\t}", "title": "" }, { "docid": "676597f4c53979ecdd58320ad63d0a42", "score": "0.53836656", "text": "function getFilesContent(sourceDirectory, filesArray, filenameExtension, themeSettings, numItemsPerIndexPage, outputDirectory, callback) {\n if (!(typeof sourceDirectory === 'string')) {\n throw new TypeError(\"Value of argument \\\"sourceDirectory\\\" violates contract.\\n\\nExpected:\\nstring\\n\\nGot:\\n\" + _inspect(sourceDirectory));\n }\n\n if (!Array.isArray(filesArray)) {\n throw new TypeError(\"Value of argument \\\"filesArray\\\" violates contract.\\n\\nExpected:\\nArray\\n\\nGot:\\n\" + _inspect(filesArray));\n }\n\n if (!(typeof filenameExtension === 'string')) {\n throw new TypeError(\"Value of argument \\\"filenameExtension\\\" violates contract.\\n\\nExpected:\\nstring\\n\\nGot:\\n\" + _inspect(filenameExtension));\n }\n\n if (!(themeSettings instanceof Object)) {\n throw new TypeError(\"Value of argument \\\"themeSettings\\\" violates contract.\\n\\nExpected:\\nObject\\n\\nGot:\\n\" + _inspect(themeSettings));\n }\n\n if (!(typeof numItemsPerIndexPage === 'number')) {\n throw new TypeError(\"Value of argument \\\"numItemsPerIndexPage\\\" violates contract.\\n\\nExpected:\\nnumber\\n\\nGot:\\n\" + _inspect(numItemsPerIndexPage));\n }\n\n if (!(typeof outputDirectory === 'string')) {\n throw new TypeError(\"Value of argument \\\"outputDirectory\\\" violates contract.\\n\\nExpected:\\nstring\\n\\nGot:\\n\" + _inspect(outputDirectory));\n }\n\n if (!(typeof callback === 'function')) {\n throw new TypeError(\"Value of argument \\\"callback\\\" violates contract.\\n\\nExpected:\\nFunction\\n\\nGot:\\n\" + _inspect(callback));\n }\n\n // Outputs\n let err = null;\n\n // let ret = {}; // eslint-disable-line object-curly-newline\n let ret = [];\n\n // Working vars\n let numFilesProcessed = 0;\n\n const totalNumFiles = filesArray.length;\n\n filesArray.map(f => {\n // Working vars\n const filename = _path2.default.resolve(sourceDirectory, f);\n\n (0, _getFileTitle2.default)(filename, filenameExtension, title => {\n (0, _createSlug2.default)(title, slug => {\n (0, _createFilenameFromSlug2.default)(slug, outputFilename => {\n (0, _createUri2.default)(themeSettings.scheme, themeSettings.hostname, themeSettings.baseURI, outputDirectory, slug, themeSettings.createAbsoluteHRefs, (GAUErr, URI) => {\n if (GAUErr) {\n return callback(GAUErr, []);\n }\n\n (0, _getFileMetadata2.default)(filename, (GFMErr, fileMetadata) => {\n if (GFMErr) {\n return callback(GFMErr, []);\n }\n\n (0, _getFileContentAsHtml2.default)(filename, (GFCAHErr, HTML) => {\n if (GFCAHErr) {\n return callback(GFCAHErr, []);\n }\n\n numFilesProcessed = numFilesProcessed + 1;\n\n // We need to set all the obj props here otherwise we'll suffer context issues WRT async-ness\n let item = {\n absoluteURI: URI,\n filename: outputFilename,\n title: title,\n slug: slug,\n metadata: fileMetadata,\n HTML: HTML\n };\n\n ret.push(item);\n\n if (numFilesProcessed >= totalNumFiles) {\n // We're done\n return callback(err, ret);\n }\n });\n });\n });\n });\n });\n });\n });\n}", "title": "" }, { "docid": "3f97686fa51fe27bb3b6245c46ef4037", "score": "0.53831476", "text": "function getFiles(dir, files_){\n files_ = files_ || [];\n\n\n var files = fs.readdirSync(dir);\n\n for (var i in files){\n\n var name = dir + '/' + files[i];\n \n if (fs.statSync(name).isDirectory()){\n getFiles(name, files_); //Append directory to list\n dirList.push(name)\n } else {\n //Check file\n fs.readFile(name, 'utf8', function(err, data) {\n var lowerCaseData = data.toLowerCase();\n containsAny(lowerCaseData, list, name)\n })\n files_.push(name);\n }\n }\n return files_;\n}", "title": "" }, { "docid": "47286a9c47e1a8272ddbe939beec27e5", "score": "0.53806573", "text": "function processFiles(inputFiles = [], outputFiles = [], inputDir = '.', outputDir = './out') {\n return new Promise((resolve, reject) => {\n if (inputFiles.length) {\n const proms = inputFiles.map(file => {\n return new Promise((res, rej) => {\n log(`${outputFiles.indexOf(file) > -1 ? 'Merging' : 'Copying'} ${file}`);\n const inputFilePath = path.join(inputDir, file);\n const outputFilePath = path.join(outputDir, file);\n Promise.all([getXMLasObj(inputFilePath), getXMLasObj(outputFilePath)])\n .then(results => {\n const [\n inputObj,\n outputObj,\n ] = results;\n const mergedObj = merge({}, outputObj, inputObj, (dest, src, key) => {\n return key === '_comment' ? `${src}\\n${dest || ''}` : undefined;\n });\n const xmlString = convert.json2xml(JSON.stringify(mergedObj), { compact: true, spaces: 2 });\n // if (outputFilePath.indexOf('values/dimens.xml') > -1) {\n // // console.log(JSON.stringify(mergedObj, null, 2));\n // log(xmlString);\n //\n // // console.log(JSON.stringify(inputObj, null, 2));\n // }\n // res();\n fs.outputFile(outputFilePath, xmlString, err => {\n if (err) {\n rej(err);\n }\n else {\n res();\n }\n });\n }, rej);\n });\n });\n Promise.all(proms).then(resolve, reject);\n }\n else {\n reject('No input files to process.');\n }\n });\n}", "title": "" }, { "docid": "44d6ac78082ce0f33ab842a68236d31c", "score": "0.5379062", "text": "function getFileArray(files, folder, ext) {\n\tvar result = []\n\n\t// build result array by scanning each individual value\n\tif (Array.isArray(files)) {\n\t\tfiles.forEach(function(file) {\n\t\t\tpushFilenames(file)\n\t\t})\n\t} else pushFilenames(files)\n\n\treturn result\n\n\tfunction pushFilenames(filename, aFolder) {\n\t\tif (!aFolder) aFolder = folder\n\n\t\t// determine if file or folder\n\t\tvar file = path.resolve(aFolder, filename)\n\t\tvar type = getType(file)\n\t\tif (type == null) {\n\t\t\t// does not exist, try with extension\n\t\t\tif (!path.extname(file)) {\n\t\t\t\tfile += '.' + ext\n\t\t\t\ttype = getType(file)\n\t\t\t}\n\t\t}\n\t\tif (type == null) throw new Error('File not found:' + file)\n\n\t\t// is it a file?\n\t\tif (type) result.push(file)\n\t\telse {\n\n\t\t\t// traverse the folder\n\t\t\tfs.readdirSync(file).forEach(function (aFile) {\n\t\t\t\tpushFilenames(aFile, file)\n\t\t\t})\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5f82c0268bcf823b81a55ff47465d70a", "score": "0.5375113", "text": "async filesChanged(fileUpdates) {\n if (!fileUpdates.length) return null\n\n // Group files by folder\n var folderGroups = {}\n fileUpdates.forEach((file) => {\n if (folderGroups[file.folderId]) {\n folderGroups[file.folderId].fileUpdates.push(file)\n } else {\n folderGroups[file.folderId] = {\n libraryId: file.libraryId,\n folderId: file.folderId,\n fileUpdates: [file]\n }\n }\n })\n\n const libraryScanResults = {}\n\n // Group files by book\n for (const folderId in folderGroups) {\n var libraryId = folderGroups[folderId].libraryId\n var library = this.db.libraries.find(lib => lib.id === libraryId)\n if (!library) {\n Logger.error(`[Scanner] Library not found in files changed ${libraryId}`)\n continue;\n }\n var folder = library.getFolderById(folderId)\n if (!folder) {\n Logger.error(`[Scanner] Folder is not in library in files changed \"${folderId}\", Library \"${library.name}\"`)\n\n Logger.debug(`Looking at folders in library \"${library.name}\" for folderid ${folderId}`)\n library.folders.forEach((fold) => {\n Logger.debug(`Folder \"${fold.id}\" \"${fold.fullPath}\"`)\n })\n continue;\n }\n\n var relFilePaths = folderGroups[folderId].fileUpdates.map(fileUpdate => fileUpdate.relPath)\n var fileUpdateBookGroup = groupFilesIntoAudiobookPaths(relFilePaths, true)\n var folderScanResults = await this.scanFolderUpdates(libraryId, folderId, fileUpdateBookGroup)\n libraryScanResults[libraryId] = folderScanResults\n }\n\n Logger.debug(`[Scanner] Finished scanning file changes, results:`, libraryScanResults)\n return libraryScanResults\n }", "title": "" }, { "docid": "f72a3c660f8a284784ceaab6db0774da", "score": "0.53735334", "text": "function filterResultingFiles(name) {\n const base = fs[name];\n mappedFS[name] = function () {\n const dir = arguments[0];\n const callback = arguments[arguments.length - 1];\n if (isIgnored(dir)) {\n // Return empty file list for filtered directories.\n callback(null, []);\n return;\n }\n arguments[arguments.length - 1] = function (err, files) {\n if (err) {\n callback(err);\n }\n else {\n // Create absolute paths for \"ignored\" testing, map platforms, and return back the base name.\n const absoluteFilePaths = files.map((file) => path_1.join(dir, file));\n const resultAbsolute = filterIgnoredFilesAlienFilesAndMap(absoluteFilePaths);\n const resultFileNames = resultAbsolute.map((f) => path_1.basename(f));\n callback(null, resultFileNames);\n }\n };\n base.apply(fs, arguments);\n };\n }", "title": "" }, { "docid": "e89576bdf01eea53a414089ca6361409", "score": "0.5359491", "text": "function readAllFiles(callBack){\n try{\n var allFiles=[];\n fs.readdir(\"./sounds\", function(err, items) {\n if(err){\n Log.ErrorLogging(err);\n callBack(cFAIL,null);\n }else{\n for (var i=0; i<items.length; i++) {\n if(items[i].startsWith(\"PAnnounce_\")){\n var files =[];\n var row=[];\n var data =fs.readFileSync('./sounds/'+items[i],\"utf16le\");\n let table = data.toString().split('\\r\\n');\n for(let i=0; i<table.length;i++){\n row = table[i].split('\\t');\n files.push(row);\n }\n allFiles.push({language : items[i].substr(10,2) , files:files , SoundsFile:table[0].trim()});\n } \n }\n Files=allFiles;\n callBack(cSUCCESS,Files);\n }\n });\n }catch(err){\n Log.ErrorLogging(err);\n callBack(cFAIL,null);\n }\n }", "title": "" }, { "docid": "c8eb0f4041b70f0b112a37075ddf3a2e", "score": "0.5357178", "text": "addFiles(files){\n let i;\n let length=files.length\n for(i=0;i<length;i++){\n //Add config files to setup the game\n if(files[i].data.Settings) this.game.settings=files[i].data.Settings;\n if(files[i].data.Scenes) this.game.data.scenes=files[i].data.Scenes;\n if(files[i].data.Cutscenes) this.game.data.cutscenes=files[i].data.Cutscenes;\n if(files[i].data.Objects) this.game.data.objects=files[i].data.Objects;\n if(files[i].data.Dialogues) this.game.data.dialogues=files[i].data.Dialogues;\n if(files[i].data.Puzzles) this.game.data.puzzles=files[i].data.Puzzles;\n if(files[i].data.Credits) this.game.data.credits=files[i].data.Credits;\n if(files[i].data.Texts) this.game.data.texts=files[i].data.Texts;\n\n //Look for sound files\n if(files[i].data.Sounds){\n let soundSrc=files[i].data.Sounds;\n for(let j=0;j<soundSrc.length;j++){\n let tmpSound=soundSrc[j].Src;\n if(tmpSound!==null) this.add(soundSrc[j].Name,tmpSound);\n }\n }\n\n //Look for video files\n if(files[i].data.Vids)\n {\n //Fix for load correctly vids with pixi-sound\n this.fixVidLoad();\n let vidSrc=files[i].data.Vids;\n for(let i=0;i<vidSrc.length;i++){\n let tmpVid=vidSrc[i].Src;\n if(tmpVid!==null) this.add(vidSrc[i].Name,tmpVid);\n }\n }\n\n //Load Animations\n if(files[i].data.Animations)\n {\n let animSrc=files[i].data.Animations;\n for(let i=0;i<animSrc.length;i++){\n let tmpAnim=animSrc[i].Src;\n if(tmpAnim!==null) this.add(animSrc[i].Name,tmpAnim);\n }\n }\n\n //Load Backgrounds if don't use texture atlas for backgrounds\n if(files[i].data.Backgrounds){\n let bgSrc=files[i].data.Animations;\n for(let i=0;i<bgSrc.length;i++){\n let tmpBg=bgSrc[i].Src;\n if(tmpBg!==null) this.add(bgSrc[i].Name,tmpBg);\n }\n }\n\n //Look for player files\n if(files[i].data.Player){\n this.add('playerTex', files[i].data.Player.Texture)\n .add('playerJson', files[i].data.Player.Json)\n .add('playerSkeleton', files[i].data.Player.Skeleton);\n this.game.data.player=files[i].data.Player;\n }\n\n //Look for NPC files\n if(files[i].data.Characters){\n let npcSrc=files[i].data.Characters;\n for(let i=0;i<npcSrc.length;i++){\n this.add(npcSrc[i].Name+\"Tex\", npcSrc[i].Texture)\n .add(npcSrc[i].Name+'Json', npcSrc[i].Json)\n .add(npcSrc[i].Name+'Skeleton', npcSrc[i].Skeleton);\n }\n this.game.data.npc=files[i].data.Characters;\n }\n }\n }", "title": "" }, { "docid": "ba9dc5418db885451119aae2df335799", "score": "0.5345202", "text": "function concatenateProcessedFiles() {\n // delete output file so it doesn't get processed as input\n let outputFilePath = './processed/matches/matches.json';\n if(fs.existsSync(outputFilePath)) {\n fs.unlinkSync(outputFilePath);\n }\n\n let files = walk('./processed/matches');\n let matches = new Array();\n files.forEach(function(file) {\n if (file.endsWith('.json')) {\n let filematches = require(file);\n matches = matches.concat(filematches);\n }\n });\n fs.writeFileSync(outputFilePath, JSON.stringify(matches, null, 3));\n}", "title": "" }, { "docid": "0f064eb21a132699c64b3ad708a99582", "score": "0.53415745", "text": "async function combine() {\n console.log('Combining files to create report');\n glob(`${outputDir}/*_coverage.json`, {}, async (er, files) => {\n const collector = new istanbul.Collector();\n let doneCount = 0;\n let total = files.length;\n\n files.forEach(f => {\n console.log(`adding ${f} - ${++doneCount}/${total}`);\n collector.add(JSON.parse(fs.readFileSync(f, 'utf8')));\n });\n\n const report = istanbul.Report.create('html', { });\n const reportFile = await new Promise((resolve, reject) => {\n report.on('error', reject);\n try {\n report.writeReport(collector);\n } catch(err) {\n console.error(err);\n }\n });\n });\n}", "title": "" }, { "docid": "9cfa3cc71e2aaee6b0b55de423cdfe75", "score": "0.5339678", "text": "function eachFile(dir_path,files,day) { \r\n return new Promise(function(resolve, reject) { \r\n var error;\r\n var num_modified_files =0 ; // number of modified files in the folder.\r\n var count =0; // counts number of insert operations occured.\r\n for ( var index = 0; index < files.length; index++) {\r\n const file = files[index];\r\n // check for csv files\r\n var file_ext = path.extname(file);\r\n if(file_ext == \".csv\"){\r\n var filePath = path.join(dir_path, file);\r\n var fileStats = fs.statSync(filePath);\r\n var modifiedDay = fileStats.mtime.toDateString().substr(8,2);\r\n // if file was modified today.\r\n if(modifiedDay === day){\r\n num_modified_files++;\r\n let csvData = [];\r\n let stream = fs.createReadStream(filePath);\r\n let csvStream = fastcsv\r\n .parse()\r\n .on(\"data\", function(data) {\r\n csvData.push(data);\r\n })\r\n .on(\"end\",function() {\r\n csvData.shift();\r\n // dropping the table from database.\r\n dropTable(file)\r\n .then((res)=>{\r\n console.log(\"Dropping the table: \",res.slice(0,-4));\r\n // creating Table if not present before;\r\n createTable(res)\r\n .then(function(res){\r\n // inserting the data to the table created before.\r\n insertData(res,[csvData])\r\n .then(()=>{count++;\r\n if(count === num_modified_files) {\r\n var res; \r\n waitFor(1).then((resp)=>{res=resp;}); \r\n return resolve(res);\r\n }\r\n })\r\n .catch((err) => {\r\n error =err;\r\n console.log(\"Error while inserting data into the table.\",err);\r\n });\r\n })\r\n .catch((err) => {\r\n error =err;\r\n console.log(\"Error in creating table: \",err);\r\n });\r\n })\r\n .catch((err)=>{ \r\n error =err;\r\n console.log(\"Error while dropping the table\");\r\n });\r\n })\r\n stream.pipe(csvStream);\r\n }\r\n } \r\n }\r\n if(error) {reject(error);}\r\n if(num_modified_files === 0) {\r\n var res;\r\n waitFor(1).then((resp)=>{res=resp;});\r\n resolve(res);\r\n }\r\n }); \r\n}", "title": "" }, { "docid": "5711182be44fb44af1f00635d0e6a39e", "score": "0.5329535", "text": "async function getAllFiles(dirPath, arrayOfFiles = []) {\n try {\n const files = fs.readdirSync(dirPath);\n\n for (const file of files) {\n if (fs.statSync(dirPath + \"/\" + file).isDirectory()) {\n await getAllFiles(dirPath + \"/\" + file, arrayOfFiles);\n } else {\n arrayOfFiles.push(join(dirPath, \"/\", file));\n }\n }\n\n } catch (err) {\n // Stop invalid dir errors\n }\n return arrayOfFiles;\n}", "title": "" }, { "docid": "a713b9d0b7f458169224ac5edef09a67", "score": "0.5326593", "text": "function next() {\n\t\tvar f;\n\n\t\tidx += 1;\n\t\tdebug( 'Reading file: %s (%d of %d)', files[ idx ], idx+1, nfiles );\n\n\t\tf = resolve( dir, files[ idx ] );\n\t\treadFile( f, fopts, onFile );\n\t}", "title": "" }, { "docid": "e6d2c2bef51f1b8b576a2f5e5c9ecca8", "score": "0.5324965", "text": "function checkBatch() {\n for (i=0; i<fileNames.length; i++) {\n handleCheck(fileNames[i], i);\n }\n}", "title": "" }, { "docid": "6f5af3c1fc66fca766c8dd25e75f46af", "score": "0.53247434", "text": "buildFiles(files, folder) {\n var hash = {};\n var prefix = folder ? (folder + '/') : '';\n\n files.forEach(node => {\n if (node.type === 'directory') {\n const sub = this.buildFiles(node.files, prefix + node.name);\n Object.keys(sub).forEach(f => hash[f] = 1);\n } else if (node.type === 'file') {\n hash[prefix + node.name] = 1;\n }\n });\n\n return hash;\n }", "title": "" } ]
0645ebda00854d5e68bad5393f94b67f
Removes properties that does not belong to the object Adds missing properties based on template
[ { "docid": "6f46d5090e36e4ea1231abc283db7c9f", "score": "0.5317249", "text": "function alignDataWithTemplate(data,\n optional_filled_template) {\n // var dataCopy = angular.copy(data); // do not\n // alter original data\n // console.log(template_default);\n if (optional_filled_template) {\n // delete unknown properties\n for (var attrname in data) {\n if (!optional_filled_template\n .hasOwnProperty(attrname)) {\n delete data[attrname];\n // console.log('delete ' + attrname);\n }\n }\n // add missing properties\n for (var attrname in optional_filled_template) {\n if (!data.hasOwnProperty(attrname)) {\n data[attrname] = optional_filled_template[attrname];\n console.log('add filled ' + attrname);\n }\n }\n }\n\n // add missing properties\n for (var attrname in hiddenData) {\n if (!data.hasOwnProperty(attrname)) {\n data[attrname] = hiddenData[attrname];\n console.log('add hidden ' + attrname);\n }\n }\n return data;\n }", "title": "" } ]
[ { "docid": "1182b634476b8e6cd44508843d7b78ca", "score": "0.62196577", "text": "function stripProps(obj) {\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n if (\n // Strip leading $ marks, from angular\n prop.indexOf('$')===0 ||\n // Strip leading underscores, for convenience attributes\n prop.indexOf('_')===0 ||\n // Strip trailing underscores, for instance-prototype binding\n prop.indexOf('_')===prop.length-1) {\n delete(obj[prop]);\n }\n // Recursion: All the items in an array\n else if (Array.isArray(obj[prop])) {\n for (var i in obj[prop]) {\n stripProps(obj[prop][i]);\n }\n }\n // Recursion: All the properties of an object\n else if (typeof(obj[prop])==='object') {\n stripProps(obj[prop]);\n }\n }\n }\n }", "title": "" }, { "docid": "5187c5bccf078f5f6e018ad10349785d", "score": "0.5983723", "text": "cleanJson (json, properties) {\n let cleanedJson = {}\n cleanedJson = object.assign(cleanedJson, object.pick(json, properties))\n return cleanedJson\n }", "title": "" }, { "docid": "33aadd40d52add130ff5790f5cf4c96d", "score": "0.5795738", "text": "function copyNonHalProperties(unparsed, resource) {\n Object.keys(unparsed).forEach(function(key) {\n if (key !== '_links' && key !== '_embedded') {\n resource[key] = unparsed[key]\n }\n })\n}", "title": "" }, { "docid": "23c7ba4b93a0892f077ac7cd03bba4ed", "score": "0.57750547", "text": "function dedupeProperties(properties) {\n const knownProps = new Map();\n const deduped = [];\n for (let i = 0; i < properties.length; i++) {\n const prop = properties[i];\n // dynamic keys are always allowed\n if (prop.key.type === 8 /* COMPOUND_EXPRESSION */ || !prop.key.isStatic) {\n deduped.push(prop);\n continue;\n }\n const name = prop.key.content;\n const existing = knownProps.get(name);\n if (existing) {\n if (name === 'style' || name === 'class' || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isOn)(name)) {\n mergeAsArray(existing, prop);\n }\n // unexpected duplicate, should have emitted error during parse\n }\n else {\n knownProps.set(name, prop);\n deduped.push(prop);\n }\n }\n return deduped;\n}", "title": "" }, { "docid": "23c7ba4b93a0892f077ac7cd03bba4ed", "score": "0.57750547", "text": "function dedupeProperties(properties) {\n const knownProps = new Map();\n const deduped = [];\n for (let i = 0; i < properties.length; i++) {\n const prop = properties[i];\n // dynamic keys are always allowed\n if (prop.key.type === 8 /* COMPOUND_EXPRESSION */ || !prop.key.isStatic) {\n deduped.push(prop);\n continue;\n }\n const name = prop.key.content;\n const existing = knownProps.get(name);\n if (existing) {\n if (name === 'style' || name === 'class' || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isOn)(name)) {\n mergeAsArray(existing, prop);\n }\n // unexpected duplicate, should have emitted error during parse\n }\n else {\n knownProps.set(name, prop);\n deduped.push(prop);\n }\n }\n return deduped;\n}", "title": "" }, { "docid": "4c31cba42d0be21f3665031d25b464c3", "score": "0.5676806", "text": "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}", "title": "" }, { "docid": "0f32606e3c6ba892230fd21e6d346e08", "score": "0.5669106", "text": "removeUsedProps(aProps) {\n\t\t//METODO: change this to actual source cleanup\n\t\tdelete aProps[\"input\"];\n\t\tdelete aProps[\"markup\"];\n\t\tdelete aProps[\"spacingMarkup\"];\n\t\tdelete aProps[\"noItemsMarkup\"];\n\t}", "title": "" }, { "docid": "76a35738cc4d3c955c9fab48713b13a7", "score": "0.5662054", "text": "function makeSafeObject(dirty, properties) {\n\tlet safe = {};\n\tproperties.forEach((prop) => {\n\t\tlet parts = prop.split('.');\n\t\tlet source = dirty;\n\t\tlet target = safe;\n\t\tfor (let i=0; i < parts.length - 1; i++) {\n\t\t\tif (!source[parts[i]]) return; // Source doesn't have property\n\t\t\tif (!target[parts[i]]) target[parts[i]] = {};\n\t\t\tsource = source[parts[i]];\n\t\t\ttarget = target[parts[i]];\n\t\t}\n\t\tif (!source[parts[parts.length-1]]) return; // Source doesn't have property\n\t\ttarget[parts[parts.length-1]] = source[parts[parts.length-1]];\n\t});\n\treturn safe;\n}", "title": "" }, { "docid": "bf949b028f5191f5a72928f1b460302c", "score": "0.56552815", "text": "function fillProperties(target,source){for(var key in source){if(source.hasOwnProperty(key)&&!target.hasOwnProperty(key)){target[key]=source[key]}}}", "title": "" }, { "docid": "70bb5ac14f3c90ec1a75d83d2cbf2e93", "score": "0.5643787", "text": "removeUsedProps(aProps) {\n\t\t//METODO: change this to actual source cleanup\n\t\tdelete aProps[\"text\"];\n\t\tdelete aProps[\"maxLength\"];\n\t}", "title": "" }, { "docid": "a923421202e3480f104e9aa27a8be3d9", "score": "0.56303203", "text": "function fillProperties(target,source){for(var key in source){if(source.hasOwnProperty(key)&&!target.hasOwnProperty(key)){target[key]=source[key];}}}", "title": "" }, { "docid": "d4252b12a3bfbde1479d89aa2aeff6c3", "score": "0.56271034", "text": "remove_props(obj, props = []) {\n if (!this.is_object(obj)) return false;\n for (var key in obj) {\n if (!obj.hasOwnProperty(key))\n continue;\n if (typeof obj[key] === 'object' && obj[key] !== null)\n obj[key] = this.remove_props(obj[key], props);\n else\n if (props.includes(key)) \n delete obj[key];\n }\n return obj;\n }", "title": "" }, { "docid": "b26304258f2a23c52fb2abcc57db0155", "score": "0.5612587", "text": "function reportUnusedProperties() {\n for (const container of vueComponentPropertiesContainerMap.values()) {\n if (container.unknown) {\n continue\n }\n for (const property of container.properties) {\n if (\n container.usedNames.has(property.name) ||\n templatePropertiesContainer.usedNames.has(property.name)\n ) {\n continue\n }\n if (\n property.groupName === 'props' &&\n (container.unknownProps ||\n container.usedPropsNames.has(property.name))\n ) {\n continue\n }\n context.report({\n node: property.node,\n messageId: 'unused',\n data: {\n group: PROPERTY_LABEL[property.groupName],\n name: property.name\n }\n })\n }\n }\n }", "title": "" }, { "docid": "853b854f2eaec130ddf2450c3761d919", "score": "0.56095004", "text": "function without_fields(obj, fields) {\n var newObj = {}\n for (var key in obj) {\n if (!fields || fields.indexOf(key) < 0) {\n newObj[key] = obj[key];\n }\n }\n return newObj;\n}", "title": "" }, { "docid": "f1b7a6cf8b41936d7f43fd97b0394d0f", "score": "0.55986845", "text": "static getNewProperties() {\n return {};\n }", "title": "" }, { "docid": "75d5eb48c86aae557074c067f0456bee", "score": "0.5561783", "text": "function dedupeProperties(properties) {\n\t const knownProps = new Map();\n\t const deduped = [];\n\t for (let i = 0; i < properties.length; i++) {\n\t const prop = properties[i];\n\t // dynamic keys are always allowed\n\t if (prop.key.type === 8 /* COMPOUND_EXPRESSION */ || !prop.key.isStatic) {\n\t deduped.push(prop);\n\t continue;\n\t }\n\t const name = prop.key.content;\n\t const existing = knownProps.get(name);\n\t if (existing) {\n\t if (name === 'style' || name === 'class' || name.startsWith('on')) {\n\t mergeAsArray(existing, prop);\n\t }\n\t // unexpected duplicate, should have emitted error during parse\n\t }\n\t else {\n\t knownProps.set(name, prop);\n\t deduped.push(prop);\n\t }\n\t }\n\t return deduped;\n\t}", "title": "" }, { "docid": "76403603d2198aa52cbdcdb1af803aea", "score": "0.55560064", "text": "function removeUnknownProps(doc){\n\tdelete doc.created;\n\tdelete doc.modified;\n\tdelete doc.id;\n\tdelete doc._id\n\treturn doc\n}", "title": "" }, { "docid": "2a8593fef156df12096040aed4dab933", "score": "0.55357885", "text": "function dedupeProperties(properties) {\r\n const knownProps = new Map();\r\n const deduped = [];\r\n for (let i = 0; i < properties.length; i++) {\r\n const prop = properties[i];\r\n // dynamic keys are always allowed\r\n if (prop.key.type === 8 /* COMPOUND_EXPRESSION */ || !prop.key.isStatic) {\r\n deduped.push(prop);\r\n continue;\r\n }\r\n const name = prop.key.content;\r\n const existing = knownProps.get(name);\r\n if (existing) {\r\n if (name === 'style' || name === 'class' || name.startsWith('on')) {\r\n mergeAsArray(existing, prop);\r\n }\r\n // unexpected duplicate, should have emitted error during parse\r\n }\r\n else {\r\n knownProps.set(name, prop);\r\n deduped.push(prop);\r\n }\r\n }\r\n return deduped;\r\n}", "title": "" }, { "docid": "2a8593fef156df12096040aed4dab933", "score": "0.55357885", "text": "function dedupeProperties(properties) {\r\n const knownProps = new Map();\r\n const deduped = [];\r\n for (let i = 0; i < properties.length; i++) {\r\n const prop = properties[i];\r\n // dynamic keys are always allowed\r\n if (prop.key.type === 8 /* COMPOUND_EXPRESSION */ || !prop.key.isStatic) {\r\n deduped.push(prop);\r\n continue;\r\n }\r\n const name = prop.key.content;\r\n const existing = knownProps.get(name);\r\n if (existing) {\r\n if (name === 'style' || name === 'class' || name.startsWith('on')) {\r\n mergeAsArray(existing, prop);\r\n }\r\n // unexpected duplicate, should have emitted error during parse\r\n }\r\n else {\r\n knownProps.set(name, prop);\r\n deduped.push(prop);\r\n }\r\n }\r\n return deduped;\r\n}", "title": "" }, { "docid": "d8b561ae8b527d824339389a60ec7515", "score": "0.5527744", "text": "function cfnPipelineRemoveAttributesPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnPipeline_RemoveAttributesPropertyValidator(properties).assertSuccess();\n return {\n Attributes: cdk.listMapper(cdk.stringToCloudFormation)(properties.attributes),\n Name: cdk.stringToCloudFormation(properties.name),\n Next: cdk.stringToCloudFormation(properties.next),\n };\n}", "title": "" }, { "docid": "4501e8fde236c54c9fc704702bbb1cf5", "score": "0.5525441", "text": "cleanFields(obj) {\n\n if (!(this.judgeNotNull(obj) && this.isObj(obj))) {\n return obj\n }\n for (let key in obj) {\n if (this.getType(obj[key]) === 'object') {\n this.cleanFields(obj[key])\n }\n if (!this.judgeNotNull(obj[key])) {\n delete obj[key]\n }\n }\n return obj\n }", "title": "" }, { "docid": "a732f944218516057d7fdc2feb6f63b9", "score": "0.54964775", "text": "function dedupeProperties(properties) {\n const knownProps = new Map();\n const deduped = [];\n for (let i = 0; i < properties.length; i++) {\n const prop = properties[i];\n // dynamic keys are always allowed\n if (prop.key.type === 8 /* COMPOUND_EXPRESSION */ || !prop.key.isStatic) {\n deduped.push(prop);\n continue;\n }\n const name = prop.key.content;\n const existing = knownProps.get(name);\n if (existing) {\n if (name === 'style' || name === 'class' || name.startsWith('on')) {\n mergeAsArray(existing, prop);\n }\n // unexpected duplicate, should have emitted error during parse\n }\n else {\n knownProps.set(name, prop);\n deduped.push(prop);\n }\n }\n return deduped;\n}", "title": "" }, { "docid": "a732f944218516057d7fdc2feb6f63b9", "score": "0.54964775", "text": "function dedupeProperties(properties) {\n const knownProps = new Map();\n const deduped = [];\n for (let i = 0; i < properties.length; i++) {\n const prop = properties[i];\n // dynamic keys are always allowed\n if (prop.key.type === 8 /* COMPOUND_EXPRESSION */ || !prop.key.isStatic) {\n deduped.push(prop);\n continue;\n }\n const name = prop.key.content;\n const existing = knownProps.get(name);\n if (existing) {\n if (name === 'style' || name === 'class' || name.startsWith('on')) {\n mergeAsArray(existing, prop);\n }\n // unexpected duplicate, should have emitted error during parse\n }\n else {\n knownProps.set(name, prop);\n deduped.push(prop);\n }\n }\n return deduped;\n}", "title": "" }, { "docid": "a732f944218516057d7fdc2feb6f63b9", "score": "0.54964775", "text": "function dedupeProperties(properties) {\n const knownProps = new Map();\n const deduped = [];\n for (let i = 0; i < properties.length; i++) {\n const prop = properties[i];\n // dynamic keys are always allowed\n if (prop.key.type === 8 /* COMPOUND_EXPRESSION */ || !prop.key.isStatic) {\n deduped.push(prop);\n continue;\n }\n const name = prop.key.content;\n const existing = knownProps.get(name);\n if (existing) {\n if (name === 'style' || name === 'class' || name.startsWith('on')) {\n mergeAsArray(existing, prop);\n }\n // unexpected duplicate, should have emitted error during parse\n }\n else {\n knownProps.set(name, prop);\n deduped.push(prop);\n }\n }\n return deduped;\n}", "title": "" }, { "docid": "a732f944218516057d7fdc2feb6f63b9", "score": "0.54964775", "text": "function dedupeProperties(properties) {\n const knownProps = new Map();\n const deduped = [];\n for (let i = 0; i < properties.length; i++) {\n const prop = properties[i];\n // dynamic keys are always allowed\n if (prop.key.type === 8 /* COMPOUND_EXPRESSION */ || !prop.key.isStatic) {\n deduped.push(prop);\n continue;\n }\n const name = prop.key.content;\n const existing = knownProps.get(name);\n if (existing) {\n if (name === 'style' || name === 'class' || name.startsWith('on')) {\n mergeAsArray(existing, prop);\n }\n // unexpected duplicate, should have emitted error during parse\n }\n else {\n knownProps.set(name, prop);\n deduped.push(prop);\n }\n }\n return deduped;\n}", "title": "" }, { "docid": "f08d484739304e11b0ff381f287e51e9", "score": "0.54963386", "text": "function myOmit(oneObject, propertyToDelete) {\n\tlet result = {};\n\tfor (let key in oneObject) { // Key= a, b, c\n\t\tfor (let i=0; i<propertyToDelete.length; i++) {\n\t\t\tif (key === propertyToDelete[i]) {\n\t\t\t\tdelete oneObject[propertyToDelete[i]];\n\t\t\t}\n\t\t}\n\t}\n\treturn oneObject;\n}", "title": "" }, { "docid": "b3e5e489a791e2c8915e5ff1f742bb00", "score": "0.5491627", "text": "function extendRemove(target, props) {\n $.extend(target, props);\n for (var name in props) {\n if (props[name] == null) {\n target[name] = props[name];\n }\n }\n return target;\n }", "title": "" }, { "docid": "3e988070d6e0e261b43bd49a6c7a6cb6", "score": "0.54880893", "text": "removeUsedProps(aProps) {\n\t\t//METODO: change this to actual source cleanup\n\t\tdelete aProps[\"text\"];\n\t}", "title": "" }, { "docid": "cf3e910bf945a29563cb5dc3256255d8", "score": "0.5468794", "text": "function sanitizeWrapperProps(properties) {\n return omit(properties, Object.keys(ratingPropTypes));\n}", "title": "" }, { "docid": "a1a5d1ed0f6402f2dcd7d19f21d05802", "score": "0.54559773", "text": "function crawlForMissingTemplates(obj, path) {\n for(var key in obj) {\n if(key.charAt(0) === '_') continue;\n var val = obj[key];\n var nextPath = getNextPath(obj, key, path);\n if(isPlainObject(val)) {\n if(Array.isArray(obj) && val._template === false && val.templateitemname) {\n errorList.push({\n code: 'missing',\n path: nextPath,\n templateitemname: val.templateitemname\n });\n }\n crawlForMissingTemplates(val, nextPath);\n } else if(Array.isArray(val) && hasPlainObject(val)) {\n crawlForMissingTemplates(val, nextPath);\n }\n }\n }", "title": "" }, { "docid": "6e349c188b8dbfa6f70169aa50738e84", "score": "0.5445227", "text": "function sanitizeChildProps(properties) {\n return (0, _omit2.default)(properties, (0, _keys2.default)(placeholderPropTypes));\n}", "title": "" }, { "docid": "afeff8d7b1ea795b1e33d94b045dbc4c", "score": "0.54373336", "text": "function removeProperties(object, array) {\n//for loop the array\n//use hasOwnProperty on each\n//use delete operater to remove it if true\n//return object\nfor (let i = 0; i < array.length; i++) {\n if (object.hasOwnProperty(array[i])) {\n delete object[array[i]];\n }\n}\nreturn object;\n}", "title": "" }, { "docid": "43b914e0a91352fd53069ca689d5b5a0", "score": "0.54359424", "text": "function crawlForMissingTemplates(obj, path) {\n for (var key in obj) {\n if (key.charAt(0) === '_') continue;\n var val = obj[key];\n var nextPath = getNextPath(obj, key, path);\n if (isPlainObject(val)) {\n if (Array.isArray(obj) && val._template === false && val.templateitemname) {\n errorList.push({\n code: 'missing',\n path: nextPath,\n templateitemname: val.templateitemname\n });\n }\n crawlForMissingTemplates(val, nextPath);\n } else if (Array.isArray(val) && hasPlainObject(val)) {\n crawlForMissingTemplates(val, nextPath);\n }\n }\n }", "title": "" }, { "docid": "6fe3c594ee5c18bae683c35471887341", "score": "0.5433333", "text": "removeUsedProps(aProps) {\n\t\t//METODO: change this to actual source cleanup\n\t\tdelete aProps[\"input\"];\n\t}", "title": "" }, { "docid": "5e0a84f7681bc01bbd84f90587809775", "score": "0.54266036", "text": "skipProperties() {\n return [];\n }", "title": "" }, { "docid": "9b8e320b214ad7b1791c78ee7b8ba139", "score": "0.5422231", "text": "function removeProperties(object, array) {\n \n // let newObj = {...object};\n \n // for (let key of array) {\n \n // if (newObj[key]) delete newObj[key];\n \n // }\n \n // return newObj;\n \n for (let prop of array) {\n if (object.hasOwnProperty(prop)) delete object[prop];\n }\n\n}", "title": "" }, { "docid": "6aa6b412d17117489989c71d13e3252e", "score": "0.5418675", "text": "function convertPatternProperties(schema) {\n\tschema['x-patternProperties'] = schema['patternProperties'];\n\tdelete schema['patternProperties'];\n\treturn schema;\n}", "title": "" }, { "docid": "a11929e40181c809ca4210aa39beb17d", "score": "0.5417436", "text": "function fillProperties(target, source) {\n for (var key in source) {\n if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n }", "title": "" }, { "docid": "5d6e7fc40a8308a31bb88d3ecccbc6a9", "score": "0.5410942", "text": "function omit(obj, prop1,prop2) {\r\n if (!obj) {\r\n return null;\r\n }\r\n var result = mixin({},obj);\r\n for(var i=1;i<arguments.length;i++) {\r\n var pn = arguments[i];\r\n if (pn in obj) {\r\n delete result[pn];\r\n }\r\n }\r\n return result;\r\n\r\n }", "title": "" }, { "docid": "3f40feb5ee66ab5dab4ac1c0ebd72e22", "score": "0.54077697", "text": "function removeProperties(object, array) {\nfor (let i = 0; i < array.length; i++) {\n for (let key in object) {\n if (array[i] === key) {\n delete object[key];\n }\n }\n \n} return object;\n}", "title": "" }, { "docid": "7104cf085b59ac86cde47946790112df", "score": "0.5393855", "text": "function _BuildTemplateProperties(properties, id, map, basicProperties)\n\t{\n\t\t//retrieve the template from the map\n\t\tvar template = map[id];\n\t\t//has base template?\n\t\tif (!String_IsNullOrWhiteSpace(template.BaseTemplate))\n\t\t{\n\t\t\t//do this one first\n\t\t\t_BuildTemplateProperties(properties, template.BaseTemplate, map);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//doesnt have a base template so force the basic properties first\n\t\t\tfor (var property in basicProperties)\n\t\t\t{\n\t\t\t\t//add this to the map\n\t\t\t\tproperties[property] = basicProperties[property];\n\t\t\t}\n\t\t}\n\t\t//now loop through each property\n\t\tfor (var property in template.Properties)\n\t\t{\n\t\t\t//add this to the map\n\t\t\tproperties[property] = template.Properties[property];\n\t\t}\n\t}", "title": "" }, { "docid": "8e728268368a79018ee40f81ca83adb4", "score": "0.53811187", "text": "function deleteEmptyProperties(obj) {\n for (const i in obj) {\n if (i === 'missingValues') continue\n if (obj[i] === undefined || obj[i] === '' || obj[i].length === 0) {\n delete obj[i]\n } else if (typeof obj[i] === 'object') {\n deleteEmptyProperties(obj[i])\n }\n }\n}", "title": "" }, { "docid": "c1ed350d3fc7477edbfaec24f4608c9f", "score": "0.5371659", "text": "function fillTemplate(source, dest, obj) {\n var content = fs.readFileSync(source, {encoding: \"utf8\"});\n for (var prop in obj) {\n content = content.replace(new RegExp('{' + prop + '}', 'g'), obj[prop]);\n }\n\n fs.writeFileSync(dest, content);\n}", "title": "" }, { "docid": "57d8141ac8f7b3ba4ded59efdab8d87b", "score": "0.53669477", "text": "function extendRemove(target, props) {\r\n\t$.extend(target, props);\r\n\tfor (var name in props) {\r\n\t\tif (props[name] == null) {\r\n\t\t\ttarget[name] = props[name];\r\n\t\t}\r\n\t}\r\n\treturn target;\r\n}", "title": "" }, { "docid": "58cdfe15815f7f5a8af54746648c997a", "score": "0.5366343", "text": "function fillProperties(target, source) {\n for (var key in source) {\n if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n }", "title": "" }, { "docid": "58cdfe15815f7f5a8af54746648c997a", "score": "0.5366343", "text": "function fillProperties(target, source) {\n for (var key in source) {\n if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n }", "title": "" }, { "docid": "58cdfe15815f7f5a8af54746648c997a", "score": "0.5366343", "text": "function fillProperties(target, source) {\n for (var key in source) {\n if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n }", "title": "" }, { "docid": "ded6af026818559bc12144b2c7ff21d1", "score": "0.53646994", "text": "function cleanObject(obj) {\n const result = Object.assign(obj)\n for (const propName in result) {\n if (result[propName] === null || result[propName] === undefined) {\n delete result[propName];\n }\n }\n\n return result\n}", "title": "" }, { "docid": "4b963635a1342b91193f45e246b120b2", "score": "0.53505", "text": "function extendRemove(target, props) {\r\n $.extend(target, props);\r\n for (var name in props) {\r\n if (props[name] == null) {\r\n target[name] = props[name];\r\n }\r\n }\r\n return target;\r\n }", "title": "" }, { "docid": "9cbe4a5652677ec407104fdfa3198afc", "score": "0.53464276", "text": "function extendRemove(target, props) {\r\n\t$.extend(target, props);\r\n\tfor (var name in props)\r\n\t\tif (props[name] == null)\r\n\t\t\ttarget[name] = null;\r\n\treturn target;\r\n}", "title": "" }, { "docid": "d68c71a89150828c2ee2d2471d195746", "score": "0.5345006", "text": "Omit(schema, keys, options = {}) {\r\n const next = { ...clone(schema), ...options };\r\n next.required = next.required ? next.required.filter((key) => !keys.includes(key)) : undefined;\r\n for (const key of Object.keys(next.properties)) {\r\n if (keys.includes(key))\r\n delete next.properties[key];\r\n }\r\n return next;\r\n }", "title": "" }, { "docid": "d5a312330096f3377920782cfc68501c", "score": "0.5343863", "text": "function removeProperties(obj, array) {\n for (var key in obj)\n if (array.indexOf(key) > -1) delete obj[key];\n \n}", "title": "" }, { "docid": "83b6ef29a5f9823372efb5a902299f4c", "score": "0.5340925", "text": "function copyWithoutUrlOrConfig(props){\n const result = {};\n for(const k in props){\n if(k !== 'url' && k !== 'config'){\n result[k] = props[k];\n }\n }\n return result;\n}", "title": "" }, { "docid": "b3f2b4ed27dbd2e6f81ed7260fcdb369", "score": "0.5340409", "text": "function extendRemove(target, props) {\n\t\t$.extend(target, props);\n\t\tfor (var name in props) {\n\t\t\tif (props[name] == null) {\n\t\t\t\ttarget[name] = props[name];\n\t\t\t}\n\t\t}\n\t\treturn target;\n\t}", "title": "" }, { "docid": "b3f2b4ed27dbd2e6f81ed7260fcdb369", "score": "0.5340409", "text": "function extendRemove(target, props) {\n\t\t$.extend(target, props);\n\t\tfor (var name in props) {\n\t\t\tif (props[name] == null) {\n\t\t\t\ttarget[name] = props[name];\n\t\t\t}\n\t\t}\n\t\treturn target;\n\t}", "title": "" }, { "docid": "d006b0631d072b936b56475f1cd04c8e", "score": "0.5324043", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props) {\n\t\tif (props[name] == null) {\n\t\t\ttarget[name] = null;\n\t\t}\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "d006b0631d072b936b56475f1cd04c8e", "score": "0.5324043", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props) {\n\t\tif (props[name] == null) {\n\t\t\ttarget[name] = null;\n\t\t}\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "e28b59f449ef42340455f2b03ba0b121", "score": "0.5309854", "text": "function clean(obj) {\n for (var propName in obj) { \n if (obj[propName] === null || obj[propName] === undefined || obj[propName] === \"\") {\n delete obj[propName];\n }\n }\n }", "title": "" }, { "docid": "e28b59f449ef42340455f2b03ba0b121", "score": "0.5309854", "text": "function clean(obj) {\n for (var propName in obj) { \n if (obj[propName] === null || obj[propName] === undefined || obj[propName] === \"\") {\n delete obj[propName];\n }\n }\n }", "title": "" }, { "docid": "e3c61bc9ff95b2dd8117e90dfdb716c5", "score": "0.5308033", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props) {\n\t\tif (props[name] == null) {\n\t\t\ttarget[name] = props[name];\n\t\t}\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "e3c61bc9ff95b2dd8117e90dfdb716c5", "score": "0.5308033", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props) {\n\t\tif (props[name] == null) {\n\t\t\ttarget[name] = props[name];\n\t\t}\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "e3c61bc9ff95b2dd8117e90dfdb716c5", "score": "0.5308033", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props) {\n\t\tif (props[name] == null) {\n\t\t\ttarget[name] = props[name];\n\t\t}\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "e3c61bc9ff95b2dd8117e90dfdb716c5", "score": "0.5308033", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props) {\n\t\tif (props[name] == null) {\n\t\t\ttarget[name] = props[name];\n\t\t}\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "e3c61bc9ff95b2dd8117e90dfdb716c5", "score": "0.5308033", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props) {\n\t\tif (props[name] == null) {\n\t\t\ttarget[name] = props[name];\n\t\t}\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "e3c61bc9ff95b2dd8117e90dfdb716c5", "score": "0.5308033", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props) {\n\t\tif (props[name] == null) {\n\t\t\ttarget[name] = props[name];\n\t\t}\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "e3c61bc9ff95b2dd8117e90dfdb716c5", "score": "0.5308033", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props) {\n\t\tif (props[name] == null) {\n\t\t\ttarget[name] = props[name];\n\t\t}\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "e3c61bc9ff95b2dd8117e90dfdb716c5", "score": "0.5308033", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props) {\n\t\tif (props[name] == null) {\n\t\t\ttarget[name] = props[name];\n\t\t}\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "e3c61bc9ff95b2dd8117e90dfdb716c5", "score": "0.5308033", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props) {\n\t\tif (props[name] == null) {\n\t\t\ttarget[name] = props[name];\n\t\t}\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "e3c61bc9ff95b2dd8117e90dfdb716c5", "score": "0.5308033", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props) {\n\t\tif (props[name] == null) {\n\t\t\ttarget[name] = props[name];\n\t\t}\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "e3c61bc9ff95b2dd8117e90dfdb716c5", "score": "0.5308033", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props) {\n\t\tif (props[name] == null) {\n\t\t\ttarget[name] = props[name];\n\t\t}\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "e3c61bc9ff95b2dd8117e90dfdb716c5", "score": "0.5308033", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props) {\n\t\tif (props[name] == null) {\n\t\t\ttarget[name] = props[name];\n\t\t}\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "e3c61bc9ff95b2dd8117e90dfdb716c5", "score": "0.5308033", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props) {\n\t\tif (props[name] == null) {\n\t\t\ttarget[name] = props[name];\n\t\t}\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "e3c61bc9ff95b2dd8117e90dfdb716c5", "score": "0.5308033", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props) {\n\t\tif (props[name] == null) {\n\t\t\ttarget[name] = props[name];\n\t\t}\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "e3c61bc9ff95b2dd8117e90dfdb716c5", "score": "0.5308033", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props) {\n\t\tif (props[name] == null) {\n\t\t\ttarget[name] = props[name];\n\t\t}\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "e3c61bc9ff95b2dd8117e90dfdb716c5", "score": "0.5308033", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props) {\n\t\tif (props[name] == null) {\n\t\t\ttarget[name] = props[name];\n\t\t}\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "e3c61bc9ff95b2dd8117e90dfdb716c5", "score": "0.5308033", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props) {\n\t\tif (props[name] == null) {\n\t\t\ttarget[name] = props[name];\n\t\t}\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "c0bb0d1ab5dad205f8062043827ff732", "score": "0.5307808", "text": "function stripFieldsContaining(topic, fieldName) {\n var newProps = new Array();\n for (var it=0; it < topic.properties.length; it++) {\n // resultHandler.append('<tr><td>'+topic.properties[i].label+'</td><td>'+topic.properties[i].value+'</td></tr>');\n if (topic.properties[it].name.indexOf(fieldName) == -1) {\n // log('fieldStrippin: ' + it);\n newProps.push(topic.properties[it]);\n } else if (topic.properties[it].name.indexOf(\"Email\") != -1) {\n // save Email Address Property being stripped by a command called \"Address\"\"\n newProps.push(topic.properties[it]);\n } else {\n // flog('stripping Field ' + topic.properties[it].name);\n }\n }\n topic.properties = newProps;\n return topic;\n }", "title": "" }, { "docid": "c3baa56e8d9a14c8a467cb8525525620", "score": "0.5292704", "text": "function updateHelper(obj) {\n for (var key in obj) {\n switch(key) {\n case 'name':\n break;\n \n case 'price':\n break;\n \n default:\n delete obj[key]\n }\n }\n return obj \n}", "title": "" }, { "docid": "f84f82fa5dbe9c0978771a018b742572", "score": "0.5288357", "text": "function removeProp(obj, prop){\n if (obj[prop]){\n delete obj[prop.toString()]\n }\n if (obj[prop] == undefined){\n delete obj[prop.toString()]\n }\n return obj\n }", "title": "" }, { "docid": "71c70a1c5ad86deaf498dd9dacacb625", "score": "0.5272289", "text": "clearKeys() {\n for (let obj in this.skillables) {\n this.skillables[obj].KEYS = this.skillables[obj].KEYS.filter(item => item !== \"skills\");\n }\n for (let obj in this.objects) {\n if ('KEYS' in this.objects[obj]) {\n this.objects[obj].KEYS.length = 0;\n }\n }\n }", "title": "" }, { "docid": "6e585d26390dfad6d4a4b09d92ad0ff6", "score": "0.52646303", "text": "function extendRemove(target, props) {\n $.extend(target, props);\n for (var name in props)\n if (props[name] == null || props[name] == undefined)\n target[name] = props[name];\n return target;\n}", "title": "" }, { "docid": "462ebb90b313d7c0644b1196162491a3", "score": "0.52628154", "text": "toMinimalTemplate (format) {\n\t\tlet ret = {};\n\n\t\tif (this.name)\n\t\t\tret.name = this.name;\n\t\tif (this.modelName)\n\t\t\tret.model = this.modelName;\n\n\t\tret.type = Attribute.formatType(this.type, format);\n\t\tif (this.notNull)\n\t\t\tret.notNull = true;\n\t\tif (this.primary)\n\t\t\tret.primary = true;\n\t\tif (this.unique)\n\t\t\tret.unique = true;\n\t\tif (this.check !== null)\n\t\t\tret.check = this.check;\n\t\tif (this.foreign !== null)\n\t\t\tret.foreign = this.foreign;\n\n\t\tlet defaultTypeObject = new this.type.constructor();\n\t\tif (this.type.isEnumerable() !== defaultTypeObject.isEnumerable())\n\t\t\tret.enumerable = this.type.isEnumerable();\n\t\tif (this.type.isComparable() !== defaultTypeObject.isComparable())\n\t\t\tret.comparable = this.type.isComparable();\n\t\tif (this.type.isSearchable() !== defaultTypeObject.isSearchable())\n\t\t\tret.searchable = this.type.isSearchable();\n\t\tif (this.type.isFragmentable() !== defaultTypeObject.isFragmentable())\n\t\t\tret.fragmentable = this.type.isFragmentable();\n\t\t// TODO: replace with getter when implemented in library\n\t\tif (this.type.properties.absentValue !== defaultTypeObject.properties.absentValue)\n\t\t\tret.absentValue = this.type.properties.absentValue;\n\n\t\treturn ret;\n\t}", "title": "" }, { "docid": "3532c8d3dcbcafe9108a6537759dc9e2", "score": "0.52553797", "text": "uncss(...removeProps) {\n\t\tlet css = {};\n\t\tfor (let prop of removeProps)\n\t\t\tcss[prop] = '';\n\t\treturn this.css(css);\n\t}", "title": "" }, { "docid": "3532c8d3dcbcafe9108a6537759dc9e2", "score": "0.52553797", "text": "uncss(...removeProps) {\n\t\tlet css = {};\n\t\tfor (let prop of removeProps)\n\t\t\tcss[prop] = '';\n\t\treturn this.css(css);\n\t}", "title": "" }, { "docid": "8609b0672d993729bfe66bdc35023b5f", "score": "0.5252402", "text": "function removeProperties(obj, keys) {\n var clone = _extends({}, obj);\n\n keys.forEach(function (key) {\n delete clone[key];\n });\n return clone;\n}", "title": "" }, { "docid": "d3a7d0f1c0bd095c5f3d61b3634e61d5", "score": "0.52484226", "text": "function removeProperties(object, array) {\nfor (var key in object){\n if (array.includes(key)){\n delete object[key];\n }\n}\n}", "title": "" }, { "docid": "5a6f542fdc6f982335593ba4bc0dee21", "score": "0.52463424", "text": "function formatProperties (properties) {\n var result = {};\n for (var key in properties) {\n result[key] = _.clone(properties[key]);\n result[key].type = properties[key].type.name;\n }\n return result;\n }", "title": "" }, { "docid": "82e3993db4155083a6d06bb7c36467ea", "score": "0.52443516", "text": "function property_remover(data, property){\n let new_data = data.map(record => {\n if(record[property]){\n delete(record[property]);\n }\n return record;\n })\n return new_data;\n}", "title": "" }, { "docid": "b27a151e90f361977491b2350b5b5f2c", "score": "0.52408934", "text": "missing_props(obj, props = []) {\n if (!this.is_object(obj)) return false;\n if (!this.is_array(props)) props = [props];\n var obj = this.lower_props(obj);\n var result = [];\n for (var i = 0; i < props.length; i++) {\n var prop = props[i].toLowerCase();\n if (!obj.hasOwnProperty(prop)) {\n result.push(props);\n }\n }\n return result;\n }", "title": "" }, { "docid": "f4de5b253272527a7df906b5d67bd270", "score": "0.5234952", "text": "function removeProperties(object, array) {\n for(var i in array){\n var x = array[i];\n delete object[x];\n }\n return object;\n}", "title": "" }, { "docid": "1132417810d3b0d9377d135dbe9a4318", "score": "0.5234737", "text": "function prepareTemplateProps(userName,firstName, lastName, email, password, rejectReason, reviewer){\n var templateProps = {};\n templateProps[\"creator\"] = {firstname: reviewer.properties[\"firstName\"], lastname: reviewer.properties[\"lastName\"]};\n templateProps[\"username\"] = userName;\n templateProps[\"password\"] = password;\n templateProps[\"firstname\"] = firstName;\n templateProps[\"lastname\"] = lastName;\n templateProps[\"rejectReason\"] = rejectReason;\n return templateProps;\n}", "title": "" }, { "docid": "a57d39b40409340aa0d298e6344aaee0", "score": "0.52305204", "text": "static get properties() {\n return {\n \"cityProp\": {\n \"name\": \"cityProp\",\n \"type\": \"String\",\n \"value\": \" \",\n \"reflect\": true,\n \"attribute\": true,\n \"observer\": false\n },\n \"inputId\": {\n \"name\": \"inputId\",\n \"type\": \"String\",\n \"value\": \" \",\n \"reflectToAttribute\": false,\n \"observer\": false\n },\n \"width\": {\n \"name\": \"width\",\n \"type\": \"String\",\n \"value\": \" \",\n \"reflectToAttribute\": false,\n \"observer\": false\n }\n}\n;\n }", "title": "" }, { "docid": "3b0909dbd478c590d3701d986cf98db2", "score": "0.5228634", "text": "function clean(t) {\n for (const prop in t) {\n if (t[prop] === undefined) {\n delete t[prop];\n }\n }\n return t;\n}", "title": "" }, { "docid": "178529667e7d0d28d515ab2a0ed944d9", "score": "0.5227636", "text": "function removeProperties(object, strArr){\n strArr.forEach(removeTest) //calling a removeTest on each array element\n return object\n \n //FOR EACH FUNCTION - removeTest\n function removeTest(element, index){\n for( var key in object){ //look at each key in object\n if(key === element){ //if there is a match\n delete object[key]; //delete that key\n }\n }\n }\n}", "title": "" }, { "docid": "bdd0d34739ce8ae16634da9c0733870a", "score": "0.52016664", "text": "function cleanMeta(obj) {\n delete obj._id;\n delete obj._rev;\n delete obj.docType;\n}", "title": "" }, { "docid": "23d18414a78b318bc3ff881d52c27558", "score": "0.5193887", "text": "function fillProperties(target, source) {\n for (const key in source) {\n if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n}", "title": "" }, { "docid": "23d18414a78b318bc3ff881d52c27558", "score": "0.5193887", "text": "function fillProperties(target, source) {\n for (const key in source) {\n if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n}", "title": "" }, { "docid": "23d18414a78b318bc3ff881d52c27558", "score": "0.5193887", "text": "function fillProperties(target, source) {\n for (const key in source) {\n if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n}", "title": "" }, { "docid": "23d18414a78b318bc3ff881d52c27558", "score": "0.5193887", "text": "function fillProperties(target, source) {\n for (const key in source) {\n if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n}", "title": "" }, { "docid": "23d18414a78b318bc3ff881d52c27558", "score": "0.5193887", "text": "function fillProperties(target, source) {\n for (const key in source) {\n if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n}", "title": "" } ]
2a063584f32647f691f437b16afbce0b
Returns a random integer in the range [start, stop], i.e. between start and stop, possibly including either.
[ { "docid": "816476214030f0632f0db2e15871af3a", "score": "0.893777", "text": "function getRandomInt(start, stop) {\n var range = stop - start + 1;\n return Math.floor(Math.random() * range + start);\n}", "title": "" } ]
[ { "docid": "1fa0f933595af77e2cc951a6c20be681", "score": "0.8406253", "text": "function randomInt(start, end) {\n return Math.floor(Math.random() * (end-start+1)) + start;\n }", "title": "" }, { "docid": "fb47d2238f6e78af6c2f6eb724c7c7df", "score": "0.8385413", "text": "function randomInt(start, end) {\n return Math.floor(Math.random()*(end-start+1))+start;\n}", "title": "" }, { "docid": "8949e016e8c5feea977b6652a3e3bcb2", "score": "0.83525085", "text": "function getRandomInt(start, end) {\n\treturn Math.floor((Math.random() * (end - start)) + start);\n}", "title": "" }, { "docid": "49bfe3d2887eab42b9288600aed57294", "score": "0.8325162", "text": "function randInt(start, end) {\n // range is from start to end + 1 so it is inclusive\n r = end - start\n return Math.floor(Math.random() * r) + start;\n}", "title": "" }, { "docid": "548debd77cb40b42ea4a780aa1d79bb5", "score": "0.80238545", "text": "function between(start, stop) {\n\n\t//Init defaults\n\tstart = start || 0;\n\tstop = stop || 1000;\n\n\tif (start > stop) {\n\t\tthrow new Error('Start value cannot be greater than stop value');\n\t}\n\n\tvar random = Randomizer.rand(stop - start + 1) + start;\n\treturn random;\n}", "title": "" }, { "docid": "9a215e4465f1b50b6e0ae4868887e0ca", "score": "0.79991966", "text": "function rnd(start, end){\n return Math.floor(Math.random() * (end - start) + start);\n}", "title": "" }, { "docid": "023e6c5a025e527d0e3b5eaa07bc45f3", "score": "0.78932047", "text": "function rnd(start, end) {\n\treturn Math.floor(Math.random() * (end - start) + start)\n}", "title": "" }, { "docid": "83a83d57ab1f792818698c8fc8b2a0cd", "score": "0.7680264", "text": "function random_range(start_num, end_num) {\n if (Array.isArray(start_num)) {\n var index = Math.floor(Math.random() * (start_num.length - 0)) + 0;\n return start_num[index];\n }else {\n return Math.floor(Math.random() * (end_num + 1 - start_num)) + start_num;\n }\n}", "title": "" }, { "docid": "e51e1020f8085c6982ed366a7a2870d3", "score": "0.7631989", "text": "function genRandom(start,end)\n{\nreturn Math.floor(Math.random() * end) + start;\n}", "title": "" }, { "docid": "edf1dce2af8eb2ab0b771226febf1071", "score": "0.7555452", "text": "function getRandomIntInclusive() {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "84f088e0b16c00d73ebb9f547201cc98", "score": "0.75097364", "text": "getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min; //The maximum is inclusive and the minimum is inclusive\n }", "title": "" }, { "docid": "e416c137af9633b3337c1a9c9317f658", "score": "0.74445236", "text": "function randomNumber(start, end, interger) {\n start += 0// se não receber parametro\n end += 0\n interger += true\n\nlet r = Math.random()* (end - start + 1) + start;\nreturn interger ? parseInt(r): r;\n}", "title": "" }, { "docid": "0213fa258eadafae702816aa3f802670", "score": "0.7418323", "text": "function randInt(range)\n{\n\treturn Math.floor(Math.random() * range);\n}", "title": "" }, { "docid": "65c85ec693c45c760fa907559abb0a4f", "score": "0.7383485", "text": "function getRandomDigit(start, end) {\n return Math.floor((Math.random() * (end - start + 1))) + start;\n}", "title": "" }, { "docid": "1f45a765c0530dcd0e749594106e53ef", "score": "0.7351361", "text": "function random_int_from_interval(min, max){\n return Math.floor(Math.random() * (max - min + 1) + min);\n}", "title": "" }, { "docid": "bbfc1949a5bb1dc1a064695be878b02b", "score": "0.73459715", "text": "getRandomIntInclusive(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "title": "" }, { "docid": "0145397218af1917caf29c024d308c7c", "score": "0.733881", "text": "function random_int(range)\n{\n return Math.floor(Math.random() * range) % range;\n}", "title": "" }, { "docid": "ed634ea4bffe5c0d6c1a179823c66243", "score": "0.7332847", "text": "function getRandomIntInclusive(min, max) \n{\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1) + min); //The maximum is inclusive and the minimum is inclusive\n}", "title": "" }, { "docid": "27f56a6148b54d1a829a28614200a707", "score": "0.7260656", "text": "function randomInt(range) {\n return Math.floor(Math.random() * range);\n}", "title": "" }, { "docid": "27f56a6148b54d1a829a28614200a707", "score": "0.7260656", "text": "function randomInt(range) {\n return Math.floor(Math.random() * range);\n}", "title": "" }, { "docid": "17bb7d27c593abd81ee847e4ea1a5a40", "score": "0.7254186", "text": "function randomIntInRange(from, to) {\n return floor(rnd() * (to - from - 1)) + from;\n}", "title": "" }, { "docid": "3ade48806414b84549ed89dc4b542805", "score": "0.7244496", "text": "function getRandomInt(min, max) {return Math.floor(Math.random() * (max - min + 1)) + min;}", "title": "" }, { "docid": "8a743f4c8b6195d7a3629df97fd26f78", "score": "0.72253853", "text": "function getRandomIntInclusive (min, max) {\n min = Math.ceil(min)\n max = Math.floor(max)\n return Math.floor(Math.random() * (max - min + 1)) + min\n}", "title": "" }, { "docid": "15d5625b49abb9305777d96f57a00746", "score": "0.7221859", "text": "function getRandomIntInclusive(min,max){\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max-min+1)+min);\n}", "title": "" }, { "docid": "81ae01bc30c91ebab918661e3e50b539", "score": "0.7221053", "text": "function getRandomIntegerInclusive(min, max) {\r\n min = Math.ceil(min);\r\n max = Math.floor(max);\r\n return Math.floor(Math.random() * (max - min + 1)) + min; \r\n}", "title": "" }, { "docid": "7410a0b37e774855a4ea174223d44a9f", "score": "0.72207767", "text": "function randomIntFromInterval(min, max){\n return Math.floor(Math.random()*(max-min+1)+min);\n}", "title": "" }, { "docid": "0f4867a7fcb1270c419cccb1a89f1865", "score": "0.7220452", "text": "function randomIntFromInterval(min,max)\n{\n return Math.floor(Math.random()*(max-min+1)+min);\n}", "title": "" }, { "docid": "2480080b36fe2f05647dea8125fff57a", "score": "0.7218876", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min; //The maximum is inclusive and the minimum is inclusive \n }", "title": "" }, { "docid": "2480080b36fe2f05647dea8125fff57a", "score": "0.7218876", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min; //The maximum is inclusive and the minimum is inclusive \n }", "title": "" }, { "docid": "307c985a8aeeae50a3db2f907ebf012a", "score": "0.72174746", "text": "randomIntegerBetween(pMinimum,pMaximum){return Math.floor(Math.random()*(pMaximum-pMinimum))+pMinimum;}", "title": "" }, { "docid": "972225c00eac0f20061d70bac8328b97", "score": "0.72099227", "text": "function randomIntFromInterval(min, max) { // min and max included \n return Math.floor(Math.random() * (max - min + 1) + min);\n}", "title": "" }, { "docid": "53c01af92eb11aee84e06d2026ec4d64", "score": "0.7205056", "text": "function randInt(lb, ub) {\r\n var rf = Math.random();\r\n rf = rf * (ub - lb) + lb;\r\n return Math.floor(rf);\r\n}", "title": "" }, { "docid": "e325991df532d52f3c72729d88783260", "score": "0.719507", "text": "function getRandomIntInclusive(min, max){\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max-min+1)) + min;\n}", "title": "" }, { "docid": "227aa61894b73131042287b2e35b44cb", "score": "0.71933454", "text": "function getRandomIntBet(start, end) {\n between = Math.floor(Math.random() * (end - start) + start);\n return console.log(between);\n}", "title": "" }, { "docid": "616dc3d0b35784aea5d19541eab97048", "score": "0.71914", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min)\n max = Math.floor(max)\n return Math.floor(Math.random() * (max - min + 1)) + min\n }", "title": "" }, { "docid": "2fbd80a64b83688b68be75efe707e8c7", "score": "0.7188844", "text": "function randNum(min, max, interval) { if(interval === undefined) { interval = 1; } var range = []; for(var i = min; i <= max; i += interval) { range.push(i); } return range[Math.floor(Math.random() * range.length)]; }", "title": "" }, { "docid": "5c0625a4f9ff44b0359458c09e819772", "score": "0.71842605", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min; //The maximum is inclusive and the minimum is inclusive\n }", "title": "" }, { "docid": "772cf375a14d8febad7286986be07a4e", "score": "0.7182324", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min; //The maximum is inclusive and the minimum is inclusive \n}", "title": "" }, { "docid": "772cf375a14d8febad7286986be07a4e", "score": "0.7182324", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min; //The maximum is inclusive and the minimum is inclusive \n}", "title": "" }, { "docid": "772cf375a14d8febad7286986be07a4e", "score": "0.7182324", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min; //The maximum is inclusive and the minimum is inclusive \n}", "title": "" }, { "docid": "bfc391a0532002764adb8e562a325728", "score": "0.7182131", "text": "function randomIntFromInterval(min, max) { // min and max included \n return Math.floor(Math.random() * (max - min + 1) + min);\n}", "title": "" }, { "docid": "af9ad0d40de55f7221cf0195b0f2c412", "score": "0.71771175", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min; //The maximum is inclusive and the minimum is inclusive \n}", "title": "" }, { "docid": "af9ad0d40de55f7221cf0195b0f2c412", "score": "0.71771175", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min; //The maximum is inclusive and the minimum is inclusive \n}", "title": "" }, { "docid": "af9ad0d40de55f7221cf0195b0f2c412", "score": "0.71771175", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min; //The maximum is inclusive and the minimum is inclusive \n}", "title": "" }, { "docid": "af9ad0d40de55f7221cf0195b0f2c412", "score": "0.71771175", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min; //The maximum is inclusive and the minimum is inclusive \n}", "title": "" }, { "docid": "05e8c54a9fff1f31d6d99496c9d3d0d8", "score": "0.7167768", "text": "function getRandomInt(min, max) {return min + Math.floor(Math.random() * (max - min + 1));}", "title": "" }, { "docid": "fd052c1666b2451b8a532cda4903d2ae", "score": "0.71650255", "text": "function ranNumBetweenRange(min, max) {\n var x = Math.floor(Math.random()*(max-min+1)+min);\n return x;\n\n}", "title": "" }, { "docid": "19a944f004adfbccfb2f6ff947f71ec7", "score": "0.71590835", "text": "function getRandomIntInclusive (min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "46d701f07694ec2244201519eda0f07a", "score": "0.7153741", "text": "randomRange(num1,num2){\n return Phaser.Math.RND.integerInRange(num1, num2);\n }", "title": "" }, { "docid": "33e50cab8d9af9fde59c6cacce1906f7", "score": "0.715293", "text": "function getRndInteger(min, max){\r\n return Math.floor(Math.random() * (max- min)) + min;\r\n}", "title": "" }, { "docid": "fc4bd48590a04916190c70a38f1cdc8a", "score": "0.7132041", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min; //The maximum is inclusive and the minimum is inclusive\n}", "title": "" }, { "docid": "4043f03f9556abf6799e6b2f64a655aa", "score": "0.71317285", "text": "function getRndInteger(min, max) { //Return an integer between min and max, max excluded\n return Math.floor(Math.random() * (max - min)) + min;\n}", "title": "" }, { "docid": "bacc6e9da3615c47e571ca48d685e797", "score": "0.7126754", "text": "function getRandomInt(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; }", "title": "" }, { "docid": "1fbc198574430908e581a37a6ba178f4", "score": "0.71260864", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min; //The maximum is inclusive and the minimum is inclusive\n}", "title": "" }, { "docid": "a8e0214c81dba4b9830ad475611d3c16", "score": "0.71253127", "text": "randomIntFromInterval(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n }", "title": "" }, { "docid": "595dd98dc868709d950d9e39a0fa567e", "score": "0.7124699", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "title": "" }, { "docid": "658d71e78d394c8bc415a6f154d255bd", "score": "0.71234244", "text": "function randomIntFromInterval(min,max)\n\t{\n\t return Math.floor(Math.random()*(max-min+1)+min);\n\t}", "title": "" }, { "docid": "6d409254481ffc551a7c5d28e8a8da9b", "score": "0.71167254", "text": "function getRandomIntInclusive(min, max) {\r\n min = Math.ceil(min);\r\n max = Math.floor(max);\r\n return Math.floor(Math.random() * (max - min + 1)) + min;\r\n}", "title": "" }, { "docid": "d5c32d752df1341448deb787a5466c63", "score": "0.71084976", "text": "function integerRandomRange(min, max) {\n return Math.floor((Math.random() * max) + min);\n}", "title": "" }, { "docid": "f5a128069f59ebf41501caa9f61ce61b", "score": "0.7104747", "text": "function getRandomIntInclusive(min, max) {\n\t\t\t\t return Math.floor(Math.random() * (max - min + 1)) + min;\n\t\t\t\t}", "title": "" }, { "docid": "fa88de0934b3bfc7c9b7ca6b4b479e9e", "score": "0.71025807", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "title": "" }, { "docid": "fa88de0934b3bfc7c9b7ca6b4b479e9e", "score": "0.71025807", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "title": "" }, { "docid": "fa88de0934b3bfc7c9b7ca6b4b479e9e", "score": "0.71025807", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "title": "" }, { "docid": "fa88de0934b3bfc7c9b7ca6b4b479e9e", "score": "0.71025807", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "title": "" }, { "docid": "4057dd8bc6f48f58c5020cbd0211738a", "score": "0.7102009", "text": "rndInt(min, max) {\n [min, max] = [Math.ceil(min), Math.floor(max)];\n return min + Math.floor(Math.random() * (max - min + 1));\n }", "title": "" }, { "docid": "b484207ae8f0cf9919db3154954be351", "score": "0.7100318", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "title": "" }, { "docid": "3d2f8c2e0c31bcdda8366e3904c4d261", "score": "0.70980847", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "3d2f8c2e0c31bcdda8366e3904c4d261", "score": "0.70980847", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "3d2f8c2e0c31bcdda8366e3904c4d261", "score": "0.70980847", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "3d2f8c2e0c31bcdda8366e3904c4d261", "score": "0.70980847", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "00340ec97799014abd35c678c89a4191", "score": "0.70977694", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "00340ec97799014abd35c678c89a4191", "score": "0.70977694", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "00340ec97799014abd35c678c89a4191", "score": "0.70977694", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "00340ec97799014abd35c678c89a4191", "score": "0.70977694", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "00340ec97799014abd35c678c89a4191", "score": "0.70977694", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "00340ec97799014abd35c678c89a4191", "score": "0.70977694", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "00340ec97799014abd35c678c89a4191", "score": "0.70977694", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "00340ec97799014abd35c678c89a4191", "score": "0.70977694", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "00340ec97799014abd35c678c89a4191", "score": "0.70977694", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "00340ec97799014abd35c678c89a4191", "score": "0.70977694", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "00340ec97799014abd35c678c89a4191", "score": "0.70977694", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "c7c5ee48753bf4ced2a112bdffe6ec79", "score": "0.7096742", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1) + min); // The maximum is inclusive and the minimum is inclusive\n}", "title": "" }, { "docid": "9c67ae79d4c307d56e716e9c9821d5b6", "score": "0.7096542", "text": "function randomInt(range) {\r\n return Math.floor(Math.random() * range);\r\n }", "title": "" }, { "docid": "8eb743552fa362dd85b76fb799948066", "score": "0.7090234", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min +1)) + min;\n}", "title": "" }, { "docid": "f2b0c2cd9729155067ba0264588530b1", "score": "0.70891935", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n //The maximum is inclusive and the minimum is inclusive\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "4173c288373b8386c53883492a3387ad", "score": "0.7088061", "text": "function randomIntFromInterval(min, max) {\n return Math.floor(Math.random()*(max-min+1)+min);\n}", "title": "" }, { "docid": "1e3b3e63b6275fe445358da028010370", "score": "0.70852065", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1) + min);\n}", "title": "" }, { "docid": "e03436970e9bdc19da9c830b87fa07b6", "score": "0.70827013", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1) + min);\n}", "title": "" }, { "docid": "2d26387e0dcab8691aab05187efeff69", "score": "0.7080242", "text": "function getRandomIntInclusive(min, max) {\n\tmin = Math.ceil(min);\n\tmax = Math.floor(max);\n\n\treturn Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "9fdf590a379d6ad9cf6b7f0e8a79f98e", "score": "0.70733005", "text": "function getRandomInt(min, max) \n{\n return Math.floor(Math.random() * Math.floor(max) + min);\n}", "title": "" }, { "docid": "9fdd8aca26d6518954c90690a4b65c7e", "score": "0.70730263", "text": "function getRandomIntInclusive(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "b9ff93f349b36a378e9510ab4347a732", "score": "0.7072057", "text": "function getRandomIntInclusive(min, max) {\r\n return Math.floor(Math.random() * (max - min + 1)) + min;\r\n}", "title": "" }, { "docid": "b9ff93f349b36a378e9510ab4347a732", "score": "0.7072057", "text": "function getRandomIntInclusive(min, max) {\r\n return Math.floor(Math.random() * (max - min + 1)) + min;\r\n}", "title": "" }, { "docid": "8c6275f32a3e4b94f25cbec67f651d3b", "score": "0.70713073", "text": "function getRandomIntInclusive(min, max) {\n if (!(min < max))\n return -1;\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "7d85b7f6a4a63b98bc9fed00ceb6adbe", "score": "0.7070879", "text": "function randomIntFromInterval(min,max)\n {\n return Math.floor(Math.random()*(max-min+1)+min);\n }", "title": "" }, { "docid": "ead7a3ac4e9d6ab73dffaa98bdc621a6", "score": "0.7067803", "text": "function getRandomInt(min, max) {\"use strict\";\n return Math.floor(Math.random() * (max - min)) + min; //MAX is exclusive and the MIN is inclusive\n }", "title": "" }, { "docid": "41c570438c090d1caeac9f2a677ffb02", "score": "0.7067775", "text": "function randomIntFromInterval(min, max) {\r\n return Math.floor(Math.random() * (max - min + 1) + min);\r\n}", "title": "" }, { "docid": "2a22321ccab04babced38c23020cfb66", "score": "0.7067688", "text": "function getRandomIntInclusive(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "title": "" }, { "docid": "2a22321ccab04babced38c23020cfb66", "score": "0.7067688", "text": "function getRandomIntInclusive(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "title": "" }, { "docid": "63d1dfc88e68d7cf421edf5897b89ae0", "score": "0.7063416", "text": "function getRandomIntInclusive(min, max) {\n\treturn Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" } ]
e0c8e6b31c76706b6bb90e147681a1f7
i am some comment1
[ { "docid": "1c98bac6ebef5d6093c1f85d74eeb266", "score": "0.0", "text": "async hello() {\n console.log(\"Hello\")\n }", "title": "" } ]
[ { "docid": "51c313a24416dcef29a77a747b13efad", "score": "0.70730925", "text": "function another(){\n\t\tconsole.log(test)\n\t\t// this is a comment ((asd)ss)\n\t}", "title": "" }, { "docid": "10b35538f7e41bfee25ef8110ba87b4f", "score": "0.67590255", "text": "function MTComments() {}", "title": "" }, { "docid": "82165abdac8df3e23ca20c2f0eae0385", "score": "0.6755862", "text": "function cb_comment () {\n cb({\n ev: EVENTS.COMMENT\n ,line_no: line_no+1\n ,comment: comment\n })\n // reset collector var\n comment = \"\"\n }", "title": "" }, { "docid": "c4e8defcb643d466443d90497ef472b4", "score": "0.66485846", "text": "Comment(token) {\n return ''\n }", "title": "" }, { "docid": "8cbae2c8adb49074b1b672454bd8e0d1", "score": "0.65977085", "text": "function comment( li ) {\n\tlet line = li.innerHTML \n\tlet t = line.trim() \n\tli.innerHTML = \"<span class='comment'>\" +line.replace(t ,comment_prefix(true) +t) +\"</span>\" }", "title": "" }, { "docid": "cc3a203c4c19322bc5bdce9bc4643e84", "score": "0.6417459", "text": "function Commentator () {}", "title": "" }, { "docid": "efc86d5d709d6630c08fcaa02792af7b", "score": "0.6393448", "text": "function addComment(){}", "title": "" }, { "docid": "1e9789f3daf71402b5cec23b542c7348", "score": "0.6391656", "text": "function parseCommentRun() {\n\t\t \tvar m;\n\t\t \tif(m = txt1.match(/^(?:[^*\\/]+|\\*[^\\/]|\\/[^*])/)) {\n\t\t \t\teatChars(m[0].length);\n\t\t \t\treturn true;\n\t\t \t} else {\n\t\t \t\treturn false;\n\t\t \t}\n\t\t }", "title": "" }, { "docid": "d3af8d5afb522da2b87613f1a90fc6fd", "score": "0.6254293", "text": "_commentIndex(index){return index+1}", "title": "" }, { "docid": "10dd56ffe46e105a3e112625dba88837", "score": "0.61979437", "text": "function detect(comment) {\n if(comment.startsWith('Can someone explain')){\n return true\n }else{\n return false\n }\n \n }", "title": "" }, { "docid": "f1b7724dfed4bec3d5f1f628f43903cf", "score": "0.6195449", "text": "function comment () {\n if (token && token.type === 'comment') {\n current++\n return {\n type: 'comment',\n content: token.value,\n location: { line: token.line, col: token.col }\n }\n }\n }", "title": "" }, { "docid": "b9743f7597275b682c42fd21cc6d1c41", "score": "0.6174753", "text": "[consts.COMMENTS_BLOCK_OF_ONEPOST_INDICATOR](state, val) {\n state.byOnePostCommentsBlocking = val;\n }", "title": "" }, { "docid": "171984df74f0aaad1ac3b00f5d92f56b", "score": "0.6166462", "text": "function inComment (stream, state) {\n if (stream.match(/^.*?#\\}/)) state.tokenize = tokenBase\n else stream.skipToEnd()\n return \"comment\";\n }", "title": "" }, { "docid": "55279fef82cb5d23221c2939261aec78", "score": "0.6145284", "text": "function oblic(){\n /*\n * // *this is oblic*\n * //\n * // _this is oblic_\n * //\n * // with some description\n */\n }", "title": "" }, { "docid": "6711d328d9f3d25543b105afa84ab837", "score": "0.61225486", "text": "function doComments( comments )\n{\n //var result = doLMSInitialize();\n\n var result\t= doLMSGetValue( \"cmi.comments\");\n\n if (doLMSGetLastError() != \"0\")\n {\n\t alert(\"Não foi possível marcar sua posição!\");\n }else if ( comments != null )\n {\n\n\t\t\tdoLMSSetValue( \"cmi.comments\", comments );\n\t\t\tresult = doLMSCommit();\n }\n}", "title": "" }, { "docid": "b2fdf9e887d8b04488d424b104f9d2b0", "score": "0.60633355", "text": "function testFunction(){\n\t'Hello This Is World'\n\tvar x = 0 + 10 * 30\n\tvar obj = {a:123, b:456}\n\tobj[\"c\"] = 789\n\t/* this is a multi\n\tline comment\n\t*/\n\tfunction another(){\n\t\tconsole.log(test)\n\t\t// this is a comment ((asd)ss)\n\t}\n}", "title": "" }, { "docid": "d540e789407d49c65ca3dce7a2d38cfe", "score": "0.6023634", "text": "function comments (ctx, node) {\n return `\\\\begin{comment}\\n${node.data.comment}\\n\\\\end{comment}\\n`\n}", "title": "" }, { "docid": "1335db24a05def2629e4c46a5e83e758", "score": "0.594463", "text": "get commentText() {\r\n return this.payload.comment;\r\n }", "title": "" }, { "docid": "2e4b06a625d215624e480fb67d6797e6", "score": "0.5923488", "text": "function get_Comments( comments )\n{\n\n\tresult\t\t= doLMSGetValue( \"cmi.comments\" );\n\t\n\tif (doLMSGetLastError() != \"0\")\n\t\talert(\"Não foi possível recuperar seus dados!\");\n\telse\n\t\t{\n\t\t\tvar bookmark = unescape(result); \n\t\t//\t\talert(\"Inicio: \" + bookmark);\n\t\t\tif (bookmark.length > 0)\n\t\t\t{\n\t\t\t\tvar mst = bookmark.split(',');\n\t\t\t\tfor (var f = 0; f < mst.length; f++) \n\t\t\t\t{\n\t\t\t\t\tvar status = mst[f].split('s');\n\t\t\t\t\t\t\n\t\t\t\t\tif (comments == status[0])\n\t\t\t\t\t\tP_STATUS = status[1]; //se achar uma licao igual a requerida atribuo o status para minha variavel global\n\t\t\t\t} \n\t\t//\t\t\talert(\"escape: \" + escape(bookmark));\n\t\t\t}\n\t\t}\n}", "title": "" }, { "docid": "6f9335b7a6f81b13ca234d2631999daa", "score": "0.5913495", "text": "function addCommentInteraction(item, T) {\n if (allowComment(item)) {\n T.content.push(\"<details><summary>Comment</summary>\" \n +`<div ${TAG}=\"extendedTextInteraction\" ${ITEM}=\"${identifier(elem)}\"`\n +` ${RESPONSE_ID}=\"$comment\" class=\"${INTERACTION} ${BLOCK} ${COMMENT}\">`\n +`<textarea placeholder=\"${QTI.LANG.COMMENT}\"></textarea>`\n +\"</div></details>\");\n }\n }", "title": "" }, { "docid": "f4b3a64c72e136a7873d84e08c6cb194", "score": "0.59133303", "text": "get comment () {\n\t\treturn this._comment;\n\t}", "title": "" }, { "docid": "1a742d4d730b7d6ad8c419a393d93a65", "score": "0.59084374", "text": "function ValidComment(item) {\r\nvar htmlspec = /<(.|\\n)+?>/; //regular expression defining HTML code <something> \r\n\tif (item.search(htmlspec) != -1) return false;\r\n\treturn true;\r\n}", "title": "" }, { "docid": "d80eae585f4542554bdbda5d74c7aabc", "score": "0.5899619", "text": "function getNotesComments(note){\n\t\t\tvar tempNotes = note.NoteText.split(\"Comments:\\n\");\n\t\t\tif(tempNotes && tempNotes.length == 2){\n\t\t\t\treturn tempNotes[1];\n\t\t\t} else { \n\t\t\t\treturn note.NoteText;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "5b7675faae79a909d960cec8e256026a", "score": "0.5884575", "text": "function GM_citer(e) {\r\ntry {\r\n var target=e.target;\r\n if (!target) {\r\n target=e.srcElement;\r\n }\r\nfilter.commenter=1;\r\nupdateCommenter();\r\n var editor=unsafeWindow.tinyMCE.getInstanceById(\"champ_article\");\r\n var txt=\"<blockquote\";\r\n if (target.getAttribute(\"idUser\")>0) {\r\n txt+=\" id_membre='\"+target.getAttribute(\"idUser\")+\"'\";\r\n }\r\n txt+=\"><i><a>\"+target.getAttribute(\"nameUser\")+\" a écrit</a></i><br/>\\r\\n<blockquote><i>\";\r\n\r\n if (unsafeWindow.getSelection && unsafeWindow.getSelection() && unsafeWindow.getSelection()!=\"\") {\r\n\ttxt+= \"[...]\"+unsafeWindow.getSelection()+\"[...]\";\r\n } else {\r\n txt+=getTxt(document.getElementById(target.getAttribute(\"idComment\")+\"-txtFull\"));\r\n }\r\n txt+=\"</i></blockquote></blockquote><br/>\\n\\r\";\r\n editor.setContent(editor.getContent()+\"\\r\\n\"+txt);\r\n editor.focus();\r\n} catch (exc) {\r\nalert(exc);\r\n}\r\n}", "title": "" }, { "docid": "47c51f31c3f4458f1015001ed2582375", "score": "0.5878631", "text": "get comment() {\n\t\treturn this._comment;\n\t}", "title": "" }, { "docid": "55e2c055fdb2a28fdfa063b0c46c1d59", "score": "0.5872663", "text": "function comment2HTML(str)\r\n{\r\n\ttxt = \"\";\r\n\tcomments = str.split(\"--####--\");\r\n\tparts = comments[0].trim().split(\"-//-\");\r\n\t\r\n\tfor (i = 0; i < parts.length; ++i)\r\n\t{\r\n\t\tpart = parts[i].trim();\r\n\t\ttitle = /\\[.+\\]\\:/.exec(part)[0];\r\n\t\ttitle = title.substr(1, title.length - 3);\r\n\t\t\r\n\t\tpartCom = part.substr(title.length + 3);\r\n\t\t\r\n\t\ttxt += \"<p><b>\" + title + \"</b> :\" + partCom + \"</p>\";\r\n\t}\r\n\ttxt += \"<hr style='border: 0; background-color: Black; margin: 8px;' />\";\r\n\r\n\tgeneral = comments[1].trim();\r\n\ttxt += \"<p><b>General</b> : \" + general.substr(9) + \"</p>\";\r\n\r\n\ttxt += \"<hr style='border: 0; background-color: Black; margin: 8px;' />\";\r\n\r\n\tfor (i = 2; i < comments.length; ++i)\r\n\t{\r\n\t\tcomment = comments[i].trim();\r\n\t\tlogin = /[^ ]+\\:/i.exec(comment)[0];\r\n\t\tlogin = login.substr(0, login.length - 1);\r\n\t\ttxt += \"<p><img src='photo.php?login=\" + login + \"' style='width:60px; float: left; padding: 1px 2px 0 0;' /><b>\" + login + \"</b> : \" + comment.substr(login.length + 1).trim() + \"<br style='clear: both'></p>\";\r\n\t}\r\n\r\n\t// SPECIFIQUE\r\n\tend = / +(\\/ +[a-z]+ : -?[0-9]+ +)+\\/ +[0-9]+:[0-9]+ +\\/ +([a-z_]+)/gi.exec(txt);\r\n\ttxt = txt.substr(0, txt.indexOf(end[0])) + txt.substr(txt.indexOf(end[0]) + end[0].length);\r\n\ttxt = txt.replace(/\\\\'/g, \"'\").replace(/\\\\\"/g, '\"');\r\n\ttxt += \"<p style='text-align: right; font-style: italic;'>Not&eacute; par : <b>\" + end[2] + \"</b></p>\";\r\n\t\r\n\treturn txt;\r\n}", "title": "" }, { "docid": "b1f0c45655a4053cf5bec460224cd7b3", "score": "0.5857394", "text": "sup(comment) {\n console.log(`Sup? I am ${this.get('name')}! My comment is \"${comment}\"`);\n }", "title": "" }, { "docid": "de51dcd4189dedc0dbf1b826259ff507", "score": "0.5851737", "text": "get comment() {\n\t\treturn this.__comment;\n\t}", "title": "" }, { "docid": "3ffbb0abfe65fdde2d4a028649f9e912", "score": "0.58510643", "text": "function displayNewComments(com) {\r\n var title = document.title;\r\n var prefix = \"\";\r\n if (title.substring(0, 2) === \"* \") {\r\n title = title.substring(2);\r\n }\r\n setNewCommentsBlock(ID_MMNEWCHANNELCOMMENTS, com.groupHtml);\r\n if (!isNaN(com.group) && com.group !== 0) {\r\n prefix = \"* \";\r\n }\r\n setNewCommentsBlock(ID_MMNEWCOMMENTS, com.personalHtml);\r\n if (!isNaN(com.personal) && com.personal !== 0) {\r\n prefix = \"* \";\r\n } \r\n document.title = prefix + title;\r\n \r\n if (debug) {\r\n var end = new Date();\r\n var elapsed = end.getTime() - checkerTimer;\r\n GM_log(\"Checked for comments: \" + com.group + \"/\" + com.personal + \", check number \" + checkerCounter + \", interval \" + elapsed + \"s\");\r\n }\r\n}", "title": "" }, { "docid": "834d0f23355399bcb44868c85867e624", "score": "0.5829076", "text": "comment() {\n\t\tthis._currentIndex += 4;\n\n\t\twhile (this._currentIndex < this._source.length) {\n\t\t\tif (this._source[this._currentIndex] === '-') {\n\t\t\t\tif (this._currentIndex + 2 >= this._source.length) {\n\t\t\t\t\tthis._currentState = STATES.ILLEGAL;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (this._source[this._currentIndex + 1] === '-' &&\n\t\t\t\t\tthis._source[this._currentIndex + 2] === '>') {\n\t\t\t\t\tthis._currentIndex += 3;\n\t\t\t\t\tthis._currentState = STATES.INITIAL;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._currentIndex++;\n\t\t}\n\t\tthis._currentState = STATES.ILLEGAL;\n\t}", "title": "" }, { "docid": "d700e64597ba869b2739ab4efeadbe99", "score": "0.57999337", "text": "function comment() {\n\n var line;\n\n for(;;) {\n line = nextLine();\n\n if (line === undefined || line.trimLeft().startsWith('#*/'))\n break;\n }\n}", "title": "" }, { "docid": "01553f6cf04809dcc39f7c2e2cdf3a3d", "score": "0.579313", "text": "function addComment() {\n\tvar comment = document.getElementsByTagName('textarea')[0].value;\n\tif (comment != '') {\n\t\tdocument.getElementById('allcomments').innerHTML = '<p>' + comment + '</p>' + document.getElementById('allcomments').innerHTML;\n\t\tdocument.getElementsByTagName('textarea')[0].value = '';\n\t}\n}", "title": "" }, { "docid": "d58f6c4d65ab823e91f5047cf3a99109", "score": "0.5785456", "text": "function main() {\nif (1 == 1)\n {\n var test = 1 + 1;\n //This is a comment\n }\n \n return 'Hello, World!';\n }", "title": "" }, { "docid": "7561c373d81c61a85e54aa7373f00244", "score": "0.57717484", "text": "function detect(comment) {\n // Answer 1\n return comment.startsWith(`Can someone explain`)\n\n // Answer 2\n return (comment.indexOf('Can someone explain') === 0);\n}", "title": "" }, { "docid": "292316a2508c79e72f6a8fb0e50ea41b", "score": "0.5760633", "text": "function displayComment(singleComment) {\n let block = document.querySelector(\".commentsec__existing__one\");\n let newblock = block.cloneNode(true);\n newblock.querySelector(\".commentsec__existing__one__comment__header--name\").innerHTML = singleComment.name;\n newblock.querySelector(\".commentsec__existing__one__comment__header--date\").innerHTML = singleComment.date;\n newblock.querySelector(\".commentsec__existing__one__comment__body\").innerHTML = singleComment.comment;\n newblock.querySelector(\".commentsec__existing__one__comment__body\").overflowWrap = \"break-word\";\n newblock.style.display = block;\n newblock.querySelector(\".commentsec__existing__one__image\").style.backgroundImage = `${singleComment.image}`;\n newblock.querySelector(\".commentsec__existing__one__image\").style.backgroundPosition = \"center\";\n newblock.querySelector(\".commentsec__existing__one__image\").style.backgroundSize = \"cover\";\n document.querySelector(\".commentsec__existing\").prepend(newblock);\n}", "title": "" }, { "docid": "12145eb70c4a96210633dd3dd42681df", "score": "0.57544583", "text": "function comment(_, text) {\n // Avoid comments as JSON doesn't support them.\n return \"‣ \" + text;\n}", "title": "" }, { "docid": "2e96dd1fa6fb42f20b89d34c3e11656b", "score": "0.5749515", "text": "$comment() {\n return () => ({\n result: true\n });\n }", "title": "" }, { "docid": "d428ab5e0fc013bbe79528534cdf23b1", "score": "0.5738672", "text": "function add(text) {\n //HACK - unique ID generate\n var id = (+new Date() + Math.floor(Math.random() * 999999)).toString(36);\n\n _comments[id] = {\n id: id,\n text: text\n };\n }", "title": "" }, { "docid": "7d509129932cbb13bb0234b66ab20e06", "score": "0.57299817", "text": "function _getCommentText(issueComment) {\n var chUserId = _githubToClubhouseUser(issueComment.user.id);\n\n if (chUserId) return issueComment.body;\n\n return '**[Comment from GitHub user @' + issueComment.user.login + ':]** ' + issueComment.body;\n}", "title": "" }, { "docid": "7a3f7e6245a4b4184c4c071eb16abafd", "score": "0.5722922", "text": "function parseComments() {\n for (id in json_obj.annotations) {\n annotation = json_obj.annotations[id];\n annotation.heading = annotation.texts[lang].heading;\n annotation.text = annotation.texts[lang].text;\n }\n }", "title": "" }, { "docid": "e58d19ebc7aaed8f9003a83232e9a8c7", "score": "0.5711525", "text": "function createCommenterFromComment($comment) {\n var $link = $comment.find(\".author .confluence-userlink\"),\n $userLogoImg = $comment.find(\".comment-user-logo img.userLogo\");\n\n return AJS.Confluence.QuickEdit.QuickComment.createCommenterParam($userLogoImg,\n $link.attr(\"data-username\"), $link.text());\n }", "title": "" }, { "docid": "555c2d162e14769a3abdf4898f207b6f", "score": "0.57035494", "text": "function testFindCommentLengthEmptyBlockComment() {\n testString = '/**/\\n this = that;';\n assertEquals(4, PAGESPEED.Utils.findCommentLength(testString, 0));\n}", "title": "" }, { "docid": "2f4ecc455f8dfaca6d553fcdf070ca6b", "score": "0.5687161", "text": "function testFindCommentLengthSingleLineCommentSecondComment() {\n testComment = '// single line comment\\n';\n testString = '//foo\\n' + testComment;\n startIndex = testString.length - testComment.length;\n assertEquals(testComment.length,\n PAGESPEED.Utils.findCommentLength(testString, startIndex));\n}", "title": "" }, { "docid": "a0345002ef124199cd97bfbd7a9a6470", "score": "0.5678054", "text": "function executeComment(atuserid,commType,commid,content){\r\n\tif(getCookie(\"DevStoreLastComment\")==null || getCookie(\"DevStoreLastComment\")!=content){\r\n\t\tvar urls =\"content=\"+encodeURIComponent(AnalyticEmotion(content))+\"&pid=\"+object_id+\"&commtype=\"+commType+\"&objectType=\"+object_type;\r\n\t\tif(typeof atuserid !='undefined' && atuserid != null){\r\n\t\t\turls += \"&atuserid=\"+atuserid;\r\n\t\t}\r\n\t\tif(typeof commid !='undefined' && commid != null ){\r\n\t\t\turls += \"&commid=\"+commid;\r\n\t\t}\r\n\t\tif(commType==1){\r\n\t\t\turls+=\"&barr=\"+barr.toString()+\"&garr=\"+garr.toString();\r\n\t\t}\r\n\t\tvar data=doComment(urls);\r\n\t\treturn data;\r\n\t} else{\r\n\t\talert(\"请不要在短时间内发表重复评论!\");\r\n\t\treturn null;\r\n\t}\r\n}", "title": "" }, { "docid": "da82c984f35cb6731f2c80c19da6cec4", "score": "0.5670302", "text": "function tokenComment(stream, state) {\n var maybeEnd = false,\n ch;\n while (ch = stream.next()) {\n if (ch === \"/\" && maybeEnd) {\n state.tokenize = tokenBase;\n break;\n }\n maybeEnd = (ch === \"*\");\n }\n return \"comment\";\n }", "title": "" }, { "docid": "0a0bc7893cf454fb654800176768f71a", "score": "0.5667281", "text": "function g() {\n\t/*\n\tBlock comment inside of function g.\n\t*/\n\tinstruction1;\n\t/*\n\tBlock comment for instruction 2 with a quote:\n\t\tWhat was that?\n\t*/\n\tinstruction2;\n\t/*\n\tBlock comment for instruction 3…\n\t…with several indented lines.\n\t*/\n\tinstruction3;\n\t/*\n\tTrailing block comment inside of function g.\n\t*/\n}", "title": "" }, { "docid": "712f45c11b149eea0382bf6088132aaa", "score": "0.5656907", "text": "_isComment(o) {\n return Boolean(o && o.nodeType === 8)\n }", "title": "" }, { "docid": "310150b211cb23f13929174cb159f9ea", "score": "0.5648508", "text": "comment (ch) {\n if (ch !== '/') { return ch }\n var p = this.at\n var second = this.lookahead()\n if (second === '/') {\n while (ch) {\n ch = this.next()\n if (ch === '\\n' || ch === '\\r') { break }\n }\n ch = this.next()\n } else if (second === '*') {\n while (ch) {\n ch = this.next()\n if (ch === '*' && this.lookahead() === '/') {\n this.next()\n break\n }\n }\n if (!ch) {\n this.error('Unclosed comment, starting at character ' + p)\n }\n this.next()\n return this.white()\n }\n return ch\n }", "title": "" }, { "docid": "60ded5fd71b2ce69aa6e20a70d85b5f5", "score": "0.56344193", "text": "function setComments( comments , status )\n{\n \n //var resulta = doLMSInitialize();\n\n var result\t= doLMSGetValue( \"cmi.comments\");\n\n if (doLMSGetLastError() != \"0\")\n {\n\t alert(\"Não foi possível recuperar seus dados!\");\n }else if (result.length<1) \n\t\t\t{\n\t\t\t\tresult = comments + \"s\" + status;\n\t\t\t} else {\n\t\t\t\t\tind\t\t= result.indexOf(comments);\n\t\t\t\t\tcomp\t= comments.length + 1;\n\t\t\t\t\tif (ind<0) \n\t\t\t\t\t{\n\t\t\t\t\t\tresult = result + \",\" + comments + \"s\" + status;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// divide a string em duas partes, uma antes da tela da idx referida\n\t\t\t\t\t\t\ttemp = result.substr(0, (ind+comp));\n//\t\t\t\t\t\t\talert(\"pp = \" + temp);\n\t\t\t\t\t\t\t// e outra apos o valor da tela da idx referida -- para telas ate 10 e maior que 10\n\t\t\t\t\t\t\tif (status <= 10) \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttemp1 = result.substr((ind+comp+1), (result.length-ind));\n\t\t\t\t\t } else {\n\t\t\t\t\t\t\t\t\ttemp1 = result.substr((ind+comp+2), (result.length-ind));\n\t\t\t\t\t\t\t }\n\n// \t\t\t\t\t\t\talert(\"sp = \" + temp1);\n\t\t\t\t\t\t\t // junta as duas partes com o novo valor da tela\n\t\t\t\t\t\t result = temp + status + temp1;\n//\t\t\t\t\t\t\t alert(\"resultado=\" + result);\n\t\t\t\t\t}\n\t\t\t}\n\tdoComments( result );\n}", "title": "" }, { "docid": "35426e01ae3823738a06bba6f7a6858b", "score": "0.5627259", "text": "function commentFirst (a, b) {\n return (a === b + '#') ? -1\n : (b === a + '#') ? 1\n : (a > b ? 1 : a < b ? -1 : 0)\n }", "title": "" }, { "docid": "04fe07fca3968ed1ab0c461e0e0b4161", "score": "0.5624386", "text": "function getComment() {\n var x = \"\";\n var decodedCookie = decodeURIComponent(document.cookie);\n var ca = decodedCookie.split(\"; \");\n var cookieCnt = document.cookie.split(\";\").length;\n for (var i = 0; i < cookieCnt; i++) {\n var str = ca[i];\n if (str.substring(0, 7) == \"comment\") {\n var c = ca[i].split(\"=\");\n if (x == 0) {\n x = x + \"<b>door \" + c[2] + \":</b><br> \" + c[1];\n } else {\n x = x + \"<br><hr><br><b> door \" + c[2] + \":</b><br> \" + c[1];\n }\n }\n }\n // If comment is empty, do not display anything\n if (x == \"\") {} else {\n x = x + \"<hr>\";\n }\n document.getElementById(\"commentText\").innerHTML = x;\n\n}", "title": "" }, { "docid": "5bd743053b6890f775ca2b34d7e7d2ec", "score": "0.561694", "text": "function testFindCommentLengthSingleLineComment() {\n testComment = '// single line comment\\n';\n testString = testComment + '//foo\\n';\n assertEquals(testComment.length,\n PAGESPEED.Utils.findCommentLength(testString, 0));\n}", "title": "" }, { "docid": "1637075c2b1961ddc3df56dee82040e2", "score": "0.5599801", "text": "function addChatComment() {\n var chatInput = document.getElementById(CHAT_INPUT);\n var commentContent = chatInput.value;\n\n if(commentContent.indexOf(\"\\n\") !== 0 && commentContent !== \"\") {\n if(commentContent.split(\" \")[0].toUpperCase() === MAP_TRIGGER) {\n handleMapCommand(commentContent);\n } else {\n sendMessage(commentContent, visibleThread.getName());\n }\n chatInput.value = \"\";\n } else {\n alert (\"error processing message\");\n }\n}", "title": "" }, { "docid": "9aff8f17a5b73ca3ad8a73af53a2cf95", "score": "0.55912936", "text": "function addComment(postId){\n var post = splitId(postId);\n inputElementId = postId + \"-comment-input\"\n var commentTxt = document.getElementById(inputElementId).value;\n if(commentTxt.length>1){\n createComment(1,commentTxt,post);\n\n }\n else{\n alert(\"You need to add some text!\")\n }\n }", "title": "" }, { "docid": "1690e3abf7ea95504e434fa35d314c20", "score": "0.5591037", "text": "createComment(text) {\n if (text === undefined || text.length === 0) {\n return Promise.reject('text must be defined');\n }\n return postAnnotationComment(this.space().itemid(), this.dataset().itemid(), this.file().itemid(), this.itemid(), text)\n .then((payload) => (\n checkEmpty(payload, () => simpleObjectReturn(payload, this))\n ));\n }", "title": "" }, { "docid": "171ad25babfe77716e3ec45e4225accb", "score": "0.5583018", "text": "function $3i5(){\n var commentNode$=new $3i5.$$;NodeType(\"commentNode\",commentNode$);\n return commentNode$;\n}", "title": "" }, { "docid": "68fdbc7da0a8e9ea833a897f5183397e", "score": "0.5581256", "text": "function testFindCommentLengthBlockComment() {\n testString = 'abcd/* block comment \\nsecond line of block comment */123';\n assertEquals(testString.length - 4 - 3,\n PAGESPEED.Utils.findCommentLength(testString, 4));\n}", "title": "" }, { "docid": "c3e546c4a8febca5de0e22e96a5f7fe3", "score": "0.5573738", "text": "function Comment(comment) {\r\n this.id = comment.id;\r\n this.body = comment.body;\r\n this.user = comment.user;\r\n}", "title": "" }, { "docid": "fde8fda8b1fd3856b96fbcba45b3bd7f", "score": "0.5570513", "text": "commentToken(chunk = this.chunk) {\n var comment, commentAttachments, content, contents, here, i, match, matchIllegal, newLine, placeholderToken, prev;\n if (!(match = chunk.match(COMMENT))) {\n return 0;\n }\n [comment, here] = match;\n contents = null;\n // Does this comment follow code on the same line?\n newLine = /^\\s*\\n+\\s*#/.test(comment);\n if (here) {\n matchIllegal = HERECOMMENT_ILLEGAL.exec(comment);\n if (matchIllegal) {\n this.error(`block comments cannot contain ${matchIllegal[0]}`, {\n offset: matchIllegal.index,\n length: matchIllegal[0].length\n });\n }\n // Parse indentation or outdentation as if this block comment didn’t exist.\n chunk = chunk.replace(`###${here}###`, '');\n // Remove leading newlines, like `Rewriter::removeLeadingNewlines`, to\n // avoid the creation of unwanted `TERMINATOR` tokens.\n chunk = chunk.replace(/^\\n+/, '');\n this.lineToken(chunk);\n // Pull out the ###-style comment’s content, and format it.\n content = here;\n if (indexOf.call(content, '\\n') >= 0) {\n content = content.replace(RegExp(`\\\\n${repeat(' ', this.indent)}`, \"g\"), '\\n');\n }\n contents = [content];\n } else {\n // The `COMMENT` regex captures successive line comments as one token.\n // Remove any leading newlines before the first comment, but preserve\n // blank lines between line comments.\n content = comment.replace(/^(\\n*)/, '');\n content = content.replace(/^([ |\\t]*)#/gm, '');\n contents = content.split('\\n');\n }\n commentAttachments = (function() {\n var j, len, results;\n results = [];\n for (i = j = 0, len = contents.length; j < len; i = ++j) {\n content = contents[i];\n results.push({\n content: content,\n here: here != null,\n newLine: newLine || i !== 0 // Line comments after the first one start new lines, by definition.\n });\n }\n return results;\n })();\n prev = this.prev();\n if (!prev) {\n // If there’s no previous token, create a placeholder token to attach\n // this comment to; and follow with a newline.\n commentAttachments[0].newLine = true;\n this.lineToken(this.chunk.slice(comment.length));\n placeholderToken = this.makeToken('JS', '');\n placeholderToken.generated = true;\n placeholderToken.comments = commentAttachments;\n this.tokens.push(placeholderToken);\n this.newlineToken(0);\n } else {\n attachCommentsToNode(commentAttachments, prev);\n }\n return comment.length;\n }", "title": "" }, { "docid": "d030385fc5518119ebf6a9dcf2728fb9", "score": "0.55659074", "text": "get commentBody () { return $('#comment-text') }", "title": "" }, { "docid": "b783c6116061a89fd69569ff7ae07bc7", "score": "0.5557395", "text": "function testFindCommentLengthBlockCommentExtraSlash() {\n testString = '/** /*/123456';\n assertEquals(testString.length - 6,\n PAGESPEED.Utils.findCommentLength(testString, 0));\n}", "title": "" }, { "docid": "8e9c7cfe40bb77da546a1a93d58a7d25", "score": "0.5545106", "text": "function skipComment () {\n i += 2;\n while (i < jsString.length && (curr() !== '\\n')) {\n i++;\n }\n }", "title": "" }, { "docid": "09cc8648a207c0e71db3c52b970c7e52", "score": "0.5536447", "text": "function bold(){\n /*\n * // **this is bold**\n * //\n * // __this is bold__\n * //\n * // with some description\n */\n }", "title": "" }, { "docid": "8ac24a26c504d461517c14c5fa0b4ad4", "score": "0.552857", "text": "function getCommentsForThread(threadId) {\n return \"select * from reply where thread_id_num = \"+threadId+\";\"\n}", "title": "" }, { "docid": "64784025e99d0a618005f79840c1eb7a", "score": "0.55004305", "text": "function skipBlockComment () {\n i += 2;\n while (i < jsString.length && (curr() !== '*' || next() !== '/')) {\n i++;\n }\n i += 2;\n }", "title": "" }, { "docid": "4ed82c5a098d01e1e90d0e53d695a57c", "score": "0.5490118", "text": "function FeedComment(feed = true)\n{\n\tif (pos >= bufferSize)\n\t{\n\t\treturn false;\n\t}\n\n\tlet start = 0;\n\tlet end = bufferSize;\n\n\n\n\tlet nextPos = (pos + 1);\n\n\tlet name = Substring(buffer, pos, 1);\n\tlet nextName = \"\";\n\n\tif (nextPos < bufferSize)\n\t{\n\t\tnextName = Substring(buffer, nextPos, 1);\n\t}\n\n\n\n\tif\n\t(\n\t\t(name == \"/\") &&\n\t\t(nextName == \"/\")\n\t)\n\t{\n\t\tstart = pos;\n\n\t\tpos += 2;\n\n\t\twhile (pos < bufferSize)\n\t\t{\n\t\t\tlet nextPos = (pos + 1);\n\n\t\t\tlet name = Substring(buffer, pos, 1);\n\t\t\tlet nextName = \"\";\n\n\t\t\tif (nextPos < bufferSize)\n\t\t\t{\n\t\t\t\tnextName = Substring(buffer, nextPos, 1);\n\t\t\t}\n\n\t\t\tif\n\t\t\t(\n\t\t\t\tname.match(/\\r/) &&\n\t\t\t\tnextName.match(/\\n/)\n\t\t\t)\n\t\t\t{\n\t\t\t\tend = pos;\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if (name.match(/\\n/))\n\t\t\t{\n\t\t\t\tend = pos;\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tpos++;\n\t\t}\n\n\t\tlet size = (end - start);\n\n\t\tlet comment = Substring(buffer, start, size);\n\n\t\tif (feed)\n\t\t{\n\t\t\tc += comment;\n\t\t}\n\n\t\treturn true;\n\t}\n\telse if\n\t(\n\t\t(name == \"/\") &&\n\t\t(nextName == \"*\")\n\t)\n\t{\n\t\tstart = pos;\n\n\t\tpos += 2;\n\n\t\twhile (pos < bufferSize)\n\t\t{\n\t\t\tlet nextPos = (pos + 1);\n\n\t\t\tlet name = Substring(buffer, pos, 1);\n\t\t\tlet nextName = \"\";\n\n\t\t\tif (nextPos < bufferSize)\n\t\t\t{\n\t\t\t\tnextName = Substring(buffer, nextPos, 1);\n\t\t\t}\n\n\t\t\tif\n\t\t\t(\n\t\t\t\t(name == \"*\") &&\n\t\t\t\t(nextName == \"/\")\n\t\t\t)\n\t\t\t{\n\t\t\t\tend = pos;\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tpos++;\n\t\t}\n\n\t\tlet size = (end - start);\n\n\t\tlet comment = Substring(buffer, start, size);\n\n\t\tif (feed)\n\t\t{\n\t\t\tc += comment;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "title": "" }, { "docid": "db1805a11dfb891497bc343385333849", "score": "0.5486586", "text": "function readMultilineComment(start){\n var newInside = \"/*\";\n var maybeEnd = (start == \"*\");\n while (true) {\n if (source.endOfLine())\n break;\n var next = source.next();\n if (next == \"/\" && maybeEnd){\n newInside = null;\n break;\n }\n maybeEnd = (next == \"*\");\n }\n setInside(newInside);\n return {type: \"comment\", style: \"js-comment\"};\n }", "title": "" }, { "docid": "455b844e3fb6557a926bc934335bf3f9", "score": "0.54846954", "text": "function appendComment(comment, username, email){\n\n var $bitcoinButton =\n $(\"<span class='bitcoin'>Ƀ</span>\").click(function() {\n chrome.runtime.sendMessage({\n bittip: true,\n targetEmail: email\n },function(response) {\n if (response){\n alert('Yay, thanks for the tip!');\n }\n })\n });\n\n $annotationPane.find('.comments')\n .append(\n $(\"\" +\n \"<li class='comment'>\" +\n comment+\n (username ? \"<small> - \" + username + \"</small>\" : \"\") +\n \"</li>\")\n .append($bitcoinButton)\n .fadeIn(800));\n }", "title": "" }, { "docid": "d1b0331042108ede57d44d53dbf54c71", "score": "0.5473535", "text": "function ma_getComment(post) {\n var params = {\n controller: \"FeedsAndPosts\",\n method: \"getArticleNamesAndUsernames\",\n stablePageIds: post.forumId,\n format: \"json\"\n };\n\n return new Promise(function (resolve) {\n $.ajax({\n url: encodeURI(mw.config.get(\"wgServer\") + mw.config.get(\"wgScriptPath\") + \"/wikia.php\"),\n type: \"GET\",\n data: params\n }).then(\n function (comment) {\n comment.post = post;\n resolve(comment);\n });\n });\n }", "title": "" }, { "docid": "2823fb1f3010286b1d5bb57e9c6b61b4", "score": "0.54653805", "text": "function comment(data){\n\n var c = '';\n //comment reply\n c += '<div class=\"comment-cont\">';\n c += '<img src=\"images/uploaded_images/profile_photos/'+data.user_img+'\"/>';\n c += '<p class=\"comment-head\">';\n c += '<a href=\"friends/friend_profile.php?friend_id='+data.user_id+'\">'+data.user_first+' '+data.user_last+'</a> <span class=\"text-muted\" style=\"font-size:11px\">@'+data.user_name+'</span>';\n c += '</p>';\n c += '<p>'+data.comment+'</p>';\n c += '<small class=\"text-muted\">Just Now</small>';\n c += '</div>';\n\n $('#adding_comment_'+data.commentId).prepend(c);\n\n}", "title": "" }, { "docid": "87815764f616d845d9cf4c7175152a3b", "score": "0.5452255", "text": "function makeComment(messages) {\n messages = messages.split('\\n');\n for (let i = 0; i < messages.length; i++) {\n const item = document.createElement(\"div\");\n item.innerText = messages[i];\n appendLog(item);\n }\n}", "title": "" }, { "docid": "a20cc69d24ff38768151da09ac10edc5", "score": "0.5451062", "text": "function createCommentHtml(docid, date, title, author, tags, text, summarize, comments) {\n return \"<div class=\\\"broadcast\\\" id=\\\"\" + docid + \"\\\"> <div class=\\\"bccontent\\\"> <div class=\\\"timestamp\\\">\" + date + \"</div> <div class=\\\"author\\\"> From \" + author + \"</div> <div class=\\\"bctext\\\"><p>\" + cleanupAndFormat(text) + \" <a href=\\\"javascript:showDocument(\" + docid + \")\\\">[leave a comment]</a>\" + \"</p></div></div><hr class=\\\"hr-markup\\\"></div>\";\n}", "title": "" }, { "docid": "fb1feb506576dfce9e5151eef0bcf5fd", "score": "0.544745", "text": "comment(message) {\n console.log(chalk.grey(message))\n }", "title": "" }, { "docid": "32d8d6446673a37fd08dbedd87c13776", "score": "0.5443248", "text": "function getComments(data) {\n\t\t\t// Loop to get all the comments out of the data\n\t\t\tvar comments = [];\n\t\t\tfor (var i = 0; i < data[1].data.children.length; i++) {\n\t\t\t\tvar comment = data[1].data.children[i].data.body;\n\t\t\t\tcomments.push(comment);\n\t\t\t}\n\t\t\tdisplayComments(comments);\n\t\t}", "title": "" }, { "docid": "f45ac9ab1f3925f5ac013aca56183d56", "score": "0.543965", "text": "function Comment (trip,naut_id,body,post_time,edit_time) {\n\t\tthis.trip = trip;\n\t\tthis.naut_id = naut_id;\n\t\tthis.body = body;\n\t\tthis.post_time = post_time;\n\t\tthis.edit_time = edit_time;\n\t}", "title": "" }, { "docid": "a99eec3eb7b3cc78fb20cb00ce4ea38f", "score": "0.5429659", "text": "_classifyComments(comments) {\n var current_class, current_module;\n current_class = void 0;\n current_module = void 0;\n return comments.forEach((comment) => {\n var i, id, j, last, len, ref, seperator, tag, typeString;\n comment.ctx || (comment.ctx = {});\n comment.params = [];\n comment.returnprops = [];\n comment.throws = [];\n comment.resterrors = [];\n comment.sees = [];\n comment.reverse_sees = [];\n comment.todos = [];\n comment.extends = [];\n comment.subclasses = [];\n comment.uses = [];\n comment.usedbys = [];\n comment.properties = [];\n comment.examples = [];\n if (comment.ctx.type === 'property' || comment.ctx.type === 'method') {\n id = comment.ctx.string.replace('()', '');\n } else {\n id = comment.ctx.name;\n }\n comment.ctx.fullname = id;\n comment.namespace || (comment.namespace = '');\n if (comment.ctx.type === 'property' || comment.ctx.type === 'method') {\n if (comment.ctx.cons != null) {\n comment.isStatic = false;\n comment.ctx.class_name = comment.ctx.cons;\n } else if (comment.ctx.receiver != null) {\n comment.isStatic = true;\n comment.ctx.class_name = comment.ctx.receiver;\n }\n }\n last = 0;\n ref = comment.tags;\n for (i = j = 0, len = ref.length; j < len; i = ++j) {\n tag = ref[i];\n if (tag.type === '') {\n comment.tags[last].string += `\\n${tag.string}`;\n continue;\n }\n last = i;\n switch (tag.type) {\n case 'page':\n case 'restapi':\n case 'class':\n comment.ctx.type = tag.type;\n if (tag.string) {\n comment.ctx.name = tag.string;\n comment.ctx.fullname = id = comment.ctx.name;\n }\n break;\n case 'module':\n comment.ctx.type = 'class';\n comment.is_module = true;\n if (tag.string) {\n comment.ctx.name = tag.string;\n comment.ctx.fullname = id = comment.ctx.name;\n }\n comment.code = null;\n break;\n case 'memberof':\n if (/(::|#|\\.prototype)$/.test(tag.parent)) {\n comment.isStatic = false;\n comment.ctx.class_name = tag.parent.replace(/(::|#|\\.prototype)$/, '');\n } else {\n comment.isStatic = true;\n comment.ctx.class_name = tag.parent;\n }\n break;\n case 'namespace':\n comment.namespace = tag.string ? tag.string : '';\n break;\n case 'property':\n comment.ctx.type = tag.type;\n comment.ctx.name = tag.name;\n break;\n case 'method':\n comment.ctx.type = tag.type;\n if (tag.string) {\n comment.ctx.name = tag.string;\n }\n break;\n case 'static':\n comment.isStatic = true;\n break;\n case 'private':\n comment.isPrivate = true;\n break;\n case 'abstract':\n comment.isAbstract = true;\n break;\n case 'async':\n comment.isAsync = true;\n break;\n case 'promise':\n comment.doesReturnPromise = true;\n break;\n case 'nodejscallback':\n comment.doesReturnNodejscallback = true;\n break;\n case 'chainable':\n comment.isChainable = true;\n break;\n case 'type':\n if (!tag.types && tag.typeString) {\n typeString = tag.typeString;\n if (!/{.*}/.test(typeString)) {\n typeString = '{' + typeString + '}';\n }\n dox.parseTagTypes(typeString, tag);\n }\n break;\n case 'apimethod':\n comment.apimethod = tag.string.toUpperCase();\n id += '_' + comment.apimethod;\n break;\n case 'param':\n case 'return':\n case 'returns':\n case 'returnprop':\n case 'throws':\n case 'resterror':\n case 'see':\n case 'extends':\n case 'todo':\n case 'api':\n case 'uses':\n case 'override':\n case 'example':\n case 'internal':\n break;\n default:\n console.log(`Unknown tag : ${tag.type} in ${comment.full_path}`);\n }\n }\n if (comment.namespace) {\n comment.namespace += '.';\n }\n if (comment.ctx.class_name) {\n if (comment.ctx.type === 'function') {\n comment.ctx.type = 'method';\n } else if (comment.ctx.type === 'declaration') {\n comment.ctx.type = 'property';\n }\n seperator = comment.isStatic ? '.' : '::';\n id = comment.ctx.class_name + seperator + comment.ctx.name;\n comment.ctx.fullname = comment.ctx.class_name.replace(/.*[\\.\\/](\\w+)/, '$1') + seperator + comment.ctx.name;\n }\n if (comment.ctx.type === 'class') {\n current_class = comment;\n if (comment.is_module) {\n current_module = comment;\n }\n }\n if ((comment.ctx.type === 'property' || comment.ctx.type === 'method') && !comment.namespace) {\n if (current_class) {\n comment.namespace = current_class.namespace;\n }\n if (current_module && !comment.ctx.class_name) {\n comment.ctx.class_name = current_module.ctx.name;\n }\n }\n if (id) {\n comment.id = id;\n if (this.result.ids.hasOwnProperty(id)) {\n this.result.ids[id] = 'DUPLICATED ENTRY';\n } else {\n this.result.ids[id] = comment;\n }\n if (comment.namespace && this.result.ids.hasOwnProperty(comment.namespace + id)) {\n this.result.ids[comment.namespace + id] = 'DUPLICATED ENTRY';\n } else {\n this.result.ids[comment.namespace + id] = comment;\n }\n comment.html_id = (comment.namespace + id).replace(/[^A-Za-z0-9_]/g, '_');\n }\n switch (comment.ctx.type) {\n case 'class':\n comment.ctx.name = comment.namespace + comment.ctx.name;\n comment.ctx.fullname = comment.namespace + comment.ctx.fullname;\n this.result.classes[comment.ctx.name] = comment;\n if (comment.is_module) {\n return comment.filename = 'modules/' + comment.ctx.name.replace(/\\//g, '.');\n } else {\n return comment.filename = 'classes/' + comment.ctx.name.replace(/\\//g, '.');\n }\n break;\n case 'property':\n case 'method':\n comment.ctx.class_name = comment.namespace + comment.ctx.class_name;\n return comment.filename = 'classes/' + comment.ctx.class_name.replace(/\\//g, '.');\n case 'page':\n return comment.filename = 'pages';\n case 'restapi':\n return comment.filename = 'restapis';\n }\n });\n }", "title": "" }, { "docid": "298505b74c413dcb808b84fd7e450e31", "score": "0.5426677", "text": "function likeComment(){\n\t\tvar th = $(this);\n\t\tth.toggleClass('unlike');\n\t\tif(!th.hasClass('unlike'))\n\t\t\tth.text(\"J'aime\");\n\t\telse \n\t\t\tth.text(\"Je n'aime plus\");\n\t}", "title": "" }, { "docid": "1815961dff068aa530b423f14e15e51c", "score": "0.5420601", "text": "function createComment(gist) {\n // Check that we have a valid GitHub token\n var token = $.cookie(\"githubauth\");\n if (token) {\n var data = {\n \"body\": \"[Click here](\" + window.location.origin + pagepath + \"?gist=\" + gist.data.id + \") to run this code online\",\n }\n gist.createComment({\n data: data\n });\n }\n}", "title": "" }, { "docid": "7ee0fd006a435e6c8908a5850f06dfde", "score": "0.54188186", "text": "function extractComment() {\r\n var el=document.getElementById(\"commentaire\").getElementsByClassName(\"comment\");\r\n comments=new Array();\r\n\r\n\r\nvar u=document.getElementById(\"user-pseudo\");\r\nif (u) {\r\n user=getTxt(u);\r\n}\r\n\r\nfor (var i=0;i<el.length;i++) {\r\ntry {\r\n var comment=new Object();\r\n var c=el[i];\r\n var n=document.getElementById(c.getAttribute(\"id\")+\"-user\");\r\n\r\n // Identifiant de commentaire\r\n comment.id=c.getAttribute(\"id\");\r\n\r\n // nom du commentateur + est-il loggué ?\r\n comment.uLogged=0;\r\n if (n) {\r\n comment.uLogged=1;\r\n if (n.getAttribute(\"href\").match(\"^mailto\")) {\r\n comment.uLogged=0;\r\n }\r\n comment.uProfil=n.getAttribute(\"href\");\r\n comment.name=n.innerHTML;\r\n\r\n if (comment.uLogged) {\r\n //http://www.freezone.fr/envoyer_message_membre62003,\r\n var lnks=c.getElementsByTagName(\"a\");\r\n for (var j=0;(node=lnks[j]) && !comment.uId;j++) {\r\n var rx=new RegExp(\"^.*envoyer_message_membre([0-9]+),.*\",\"g\");\r\n var str=node.getAttribute(\"href\");\r\n\r\n if (str && str.match(rx)) {\r\n comment.uId=str.replace(rx,\"$1\");\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Image du profil\r\n var img=c.getElementsByClassName(\"infos_user_comment\");\r\n if (img) {\r\n var img=img[0].getElementsByTagName(\"img\");\r\n comment.img=img[0].getAttribute(\"src\");\r\n }\r\n\r\n // barre de vote\r\n comment.uVote=document.getElementById(\"user_comment_\"+comment.id);\r\n comment.alerter=document.getElementById(\"alert-\"+comment.id);\r\n\r\n // date du commentaire\r\n var dateTag=c.getElementsByClassName(\"date_comment\");\r\n if (dateTag && dateTag[0]) {\r\n comment.date=dateTag[0].innerHTML.substr(9).replace(/20[0-9][0-9] ./,\" - \").replace(/ +$/,\"\");\r\n }\r\n\r\n // Contenu du commenaire\r\n var txtC=document.getElementById(c.getAttribute(\"id\")+\"-comment\");\r\n comment.txt=txtC.innerHTML;\r\n\r\n // constitution du résumé\r\n var p=txtC.getElementsByTagName(\"p\");\r\n comment.resume=\"\";\r\n var n=0;\r\n while (short(comment.resume).length<300 && p[n]) {\r\n try {\r\n comment.resume=comment.resume+getTxt(p[n]);\r\n } catch (e) {\r\n comment.resume=comment.resume+\"???\";\r\n }\r\n n++;\r\n }\r\n comment.resume=short(comment.resume);\r\n\r\n // vérification s'il s'agit d'une réponse + extraction du membre à qui l'on répond..\r\n var answer=txtC.getElementsByTagName(\"blockquote\");\r\n comment.answer=\"\";\r\n if (answer) {\r\n n=0;\r\n while (answer[n] && !comment.answer) {\r\n if (answer[n].getAttribute(\"id_membre\")) {\r\n comment.idAnswer=answer[n].getAttribute(\"id_membre\");\r\n }\r\n var t=answer[n].getElementsByTagName(\"a\");\r\n if (t) {\r\n for(var j=0;(answerName=t[j]) && !comment.answer;j++) {\r\n var txt=getTxt(answerName);\r\n \t\t if (txt.match(\"a écrit\")) {\r\n\t\t comment.answer=txt.substr(0,txt.length-\" a écrit\".length);\r\n }\r\n }\r\n \r\n }\r\n n++;\r\n }\r\n }\r\n\r\n //alert(comment.name+\" - \"+comment.img+\" - \"+comment.date+\"[\"+comment.resume+\"] ->\"+comment.answer+\"(\"+comment.idAnswer+\")\");\r\n\r\n comments[comments.length]=comment;\r\n \r\n} catch (e) {\r\nalert(e);\r\n}\r\n}\r\n\r\n \r\n\r\nvar toolbar=document.getElementById(\"GM_toolbar\");\r\nif (!toolbar) {\r\n var parent=document.createElement(\"div\");\r\n parent.id=\"GM_toolbar\";\r\n getBody().appendChild(parent);\r\n parent.setAttribute(\"style\",\"background:white;border:1px solid #D0D0D0;top:20px;left:0px;position:fixed\");\r\n\r\n var title=document.createElement(\"a\");\r\nvar bkg=\"url('modules/freezone/images/bg_info_comment.jpg') repeat-x scroll 0 0 transparent;\";\r\n title.appendChild(document.createTextNode(\"Filtre (\"+filter.nb+\")\"));\r\n title.setAttribute(\"style\",\"display:block;color:white;text-align:center;padding:1px 3px 0px 3px;font-weight:bold;background:\"+bkg);\r\n title.id=\"filterTitle\";\r\n title.setAttribute(\"href\",\"http://www.universfreebox.com\");\r\n parent.appendChild(title);\r\n\r\n\r\n var order=document.createElement(\"a\");\r\n order.appendChild(document.createTextNode(\"Connectés\"));\r\n order.setAttribute(\"style\",\"display:block;font-weight:bold;border:0px solid black;border-top-width:1px;padding:1px 3px 0px 3px;cursor:pointer\");\r\n order.setAttribute(\"id\",\"filterLogged\");\r\n parent.appendChild(order);\r\n order.addEventListener(\"click\",changeFilterLogged,true);\r\n\r\n var order=document.createElement(\"a\");\r\n order.appendChild(document.createTextNode(\"Mes réponses\"));\r\n order.setAttribute(\"style\",\"color:#808080;display:block;border:0px solid black;border-top-width:1px;padding:1px 3px 0px 3px;cursor:pointer\");\r\n order.setAttribute(\"id\",\"filterAnswerMe\");\r\n parent.appendChild(order);\r\n order.addEventListener(\"click\",changeFilterAnswerMe,true);\r\n\r\n\r\n var order=document.createElement(\"a\");\r\n order.appendChild(document.createTextNode(\"Mes commentaires\"));\r\n order.setAttribute(\"style\",\"color:black;font-weight:bold;display:block;border:0px solid black;border-top-width:1px;padding:1px 3px 0px 3px;cursor:pointer\");\r\n order.setAttribute(\"id\",\"filterMe\");\r\n parent.appendChild(order);\r\n order.addEventListener(\"click\",changeFilterMe,true);\r\n\r\n var order=document.createElement(\"a\");\r\n order.appendChild(document.createTextNode(\"Affichage Résumé\"));\r\n order.setAttribute(\"style\",\"color:black;font-weight:bold;display:block;border:0px solid black;border-top:2px solid #D0D0D0;padding:1px 3px 0px 3px;cursor:pointer\");\r\n order.setAttribute(\"id\",\"showMode\");\r\n parent.appendChild(order);\r\n order.addEventListener(\"click\",changeShowMode,true);\r\n\r\n var order=document.createElement(\"a\");\r\n order.appendChild(document.createTextNode(\"Commenter\"));\r\n order.setAttribute(\"style\",\"display:block;border:0px solid black;border-top:1px solid black;padding:1px 3px 0px 3px;cursor:pointer\");\r\n order.setAttribute(\"id\",\"commenter\");\r\n parent.appendChild(order);\r\n order.addEventListener(\"click\",changeCommenter,true);\r\n\r\n }\r\n\r\n\r\n rebuildAllComm();\r\n\r\n\r\n\r\n}", "title": "" }, { "docid": "3b5acede163acd0ca09d63a00ef851a8", "score": "0.5418512", "text": "function readMultilineComment(start){\r\n var newInside = \"/*\";\r\n var maybeEnd = (start == \"*\");\r\n while (true) {\r\n if (source.endOfLine())\r\n break;\r\n var next = source.next();\r\n if (next == \"/\" && maybeEnd){\r\n newInside = null;\r\n break;\r\n }\r\n maybeEnd = (next == \"*\");\r\n }\r\n setInside(newInside);\r\n return {type: \"comment\", style: \"groovyComment\"};\r\n }", "title": "" }, { "docid": "8a4db9d8313248465065c4db71b4c5cb", "score": "0.5415532", "text": "function getComment(commentID, msg){\n var comment = document.createElement(\"div\");\n $(comment).addClass(\"comment\");\n comment.id = commentID;\n $(comment).append(msg);\n\n return $(comment);\n }", "title": "" }, { "docid": "f7fcab30dd1460c78fc9c7341cb1b182", "score": "0.5404927", "text": "function GotComment(_id,userid,username, message,likes,dislikes,parentId,topicId,isDeleted){\r\n this._id = _id;\r\n this.userid = userid;\r\n this.username = username;\r\n this.message = message;\r\n this.likes = likes;\r\n this.dislikes = dislikes;\r\n this.parentId = parentId;\r\n this.topicId = topicId;\r\n this.isDeleted= isDeleted;\r\n this.reply = [];\r\n }", "title": "" }, { "docid": "4835563b8b65d0b0d739a08c8f771fea", "score": "0.5400151", "text": "function sitWriteComment(obj, event) {\r\n\tif (jQuery(obj).hasClass('Active')) {\r\n\t\tvar reportName = jQuery(obj).attr('report');\r\n\t\tvar pArray = new Array();\r\n\t\t\r\n\t\tvar pCount = jQuery(obj).attr('p0') * 2 + 1;\r\n\t\t\r\n\t\tvar currentPAttr = 'p0';\r\n\t\tfor (i=0;i<pCount;i++) {\r\n\t\t\tcurrentPAttr = 'p' + i;\r\n\t\t\tpArray[i] = Url.encode(jQuery(obj).attr(currentPAttr));\r\n\t\t}\r\n\t\t\r\n\t\tcg_reportName = Url.encode(reportName);\r\n\t\tcg_parameters = pArray;\r\n\r\n\t\tdoShowCustomDialog(null, event);\r\n\t}\r\n}", "title": "" }, { "docid": "06db24c3462308d8d8fa79aa2fb5aee7", "score": "0.53998226", "text": "function testFindCommentLengthNoMatch() {\n testString = 'X//Comment starts after first character\\n';\n assertEquals(0, PAGESPEED.Utils.findCommentLength(testString, 0));\n}", "title": "" }, { "docid": "8b36bd56d028d2f79034c76ddafdbad9", "score": "0.5393164", "text": "get comments() {\n return `\n <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->\n <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->\n <!--[if lt IE 9]>\n <script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n <script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n <![endif]--> \n `;\n }", "title": "" }, { "docid": "6899cc1df5c124d8929c6e1daff8c792", "score": "0.53912413", "text": "function testFindCommentLengthBlockCommentWithNestedSingleLineComment() {\n testString = '/* block comment \\n with a single line // comment in it \\n*/';\n assertEquals(testString.length,\n PAGESPEED.Utils.findCommentLength(testString, 0));\n}", "title": "" }, { "docid": "a1ac2c8905314821e22e6a294ee5e28c", "score": "0.5387754", "text": "function UCPVoteComment(username, comment, commentAnchor) {\r\n this.username = username;\r\n this.comment = comment;\r\n this.commentAnchor = commentAnchor;\r\n this.toString = function () {\r\n return this.username + \" said :\" + this.comment;\r\n };\r\n }", "title": "" }, { "docid": "4ddf844f8e4013c0880e2394f9dd1047", "score": "0.5387473", "text": "function formatComment(param){\n var format=\"\";\n if(param.typeFormat==1){\n var f=StringADate(param.date);\n format=\"<div class='coment' id='coment_\"+param.id+\"'><table><tr><td class='tdizq'>\"+\n \"<img src='\"+param.us_img+\"'/></td>\"+\n \"<td class='tdder'>\"+\n \"<div class='name_com'>\"+param.us_name+\"<span class='date_com'>\"+formatTimeEvent(f)+\", \"+formatDateEvent(f)+\"</span></div>\"+\n \"<div class='descript_com'>\"+param.comm+\"</div>\"+\n \"</td>\"+\n \"</tr>\"+\n \"</table>\"+\n \"</div>\";\n return format;\n }\n return \"\";\n}", "title": "" }, { "docid": "2898913018a31cb8e9ae171ed2587ebd", "score": "0.53841394", "text": "function addComment (name1, body1, date1, commentArray) {\r\n\r\n let newComment = {\r\n name: name1,\r\n body: body1,\r\n date: date1,\r\n }\r\n commentArray.unshift(newComment);\r\n}", "title": "" }, { "docid": "1ffe3dfe16426860e917ef8511ac5602", "score": "0.5383456", "text": "commentToken(chunk) {\n let match;\n let content;\n if (chunk == null) {\n ({\n chunk,\n } = this);\n }\n if (!(match = chunk.match(COMMENT))) { return 0; }\n const [comment, here] = match;\n let contents = null;\n // Does this comment follow code on the same line?\n const newLine = /^\\s*\\n+\\s*#/.test(comment);\n if (here) {\n const matchIllegal = HERECOMMENT_ILLEGAL.exec(comment);\n if (matchIllegal) {\n this.error(`block comments cannot contain ${matchIllegal[0]}`,\n { offset: matchIllegal.index, length: matchIllegal[0].length });\n }\n\n // Parse indentation or outdentation as if this block comment didn’t exist.\n chunk = chunk.replace(`###${here}###`, '');\n // Remove leading newlines, like `Rewriter::removeLeadingNewlines`, to\n // avoid the creation of unwanted `TERMINATOR` tokens.\n chunk = chunk.replace(/^\\n+/, '');\n this.lineToken(chunk);\n\n // Pull out the ###-style comment’s content, and format it.\n content = here;\n if (Array.from(content).includes('\\n')) {\n content = content.replace(new RegExp(`\\\\n${repeat(' ', this.indent)}`, 'g'), '\\n');\n }\n contents = [content];\n } else {\n // The `COMMENT` regex captures successive line comments as one token.\n // Remove any leading newlines before the first comment, but preserve\n // blank lines between line comments.\n content = comment.replace(/^(\\n*)/, '');\n content = content.replace(/^([ |\\t]*)#/gm, '');\n contents = content.split('\\n');\n }\n\n const commentAttachments = (() => {\n const result = [];\n for (let i = 0; i < contents.length; i++) {\n content = contents[i];\n result.push({\n content,\n here: (here != null),\n newLine: newLine || (i !== 0), // Line comments after the first one start new lines, by definition.\n });\n }\n return result;\n })();\n\n const prev = this.prev();\n if (!prev) {\n // If there’s no previous token, create a placeholder token to attach\n // this comment to; and follow with a newline.\n commentAttachments[0].newLine = true;\n this.lineToken(this.chunk.slice(comment.length)); // Set the indent.\n const placeholderToken = this.makeToken('JS', '');\n placeholderToken.generated = true;\n placeholderToken.comments = commentAttachments;\n this.tokens.push(placeholderToken);\n this.newlineToken(0);\n } else {\n attachCommentsToNode(commentAttachments, prev);\n }\n\n return comment.length;\n }", "title": "" }, { "docid": "73dc147b4beb2ecdd05fed90b19eebf3", "score": "0.5383005", "text": "function testFindCommentLengthSingleLineCommentWithNestedBlockComment() {\n testComment = '// single line comment with a /* block */ in it \\n';\n testString = testComment + '//foo\\n';\n assertEquals(testComment.length,\n PAGESPEED.Utils.findCommentLength(testString, 0));\n}", "title": "" }, { "docid": "fa6b839ad834e6be187f2e16b6ecb10c", "score": "0.5382627", "text": "comment(value) {\n if (typeof value !== 'string') {\n throw new TypeError('Table comment must be string');\n }\n this._single.comment = value;\n }", "title": "" }, { "docid": "6282399d9ceb73543dea8dd4dad99b13", "score": "0.53770214", "text": "comments(parent, args, { prisma }, info) {\n const opArgs = {};\n\n return prisma.query.comments(opArgs, info);\n\n // return comments;\n }", "title": "" }, { "docid": "24b2d42722938aa1e029db3ed143d2da", "score": "0.53761125", "text": "function getCommentsMarkup(commentElement) {\n\n // Encase the entire comment in <p> tags.\n var commentsStr = \"<p>\" + commentElement.value + \"</p>\";\n\n // Replace any LFs or CRLFs with a closing followed by an opening <p> tag.\n var lineBreakRegex = /\\r?\\n+/g;\n return commentsStr.replace(lineBreakRegex,\"</p><p>\");\n} // End getCommentsMarkup(commentElement)", "title": "" }, { "docid": "13ecf9b4646e5b3d90b1b2f0dff16dcd", "score": "0.537575", "text": "function onlyFirstComment( container ) {\n //console.log(\"onlyFirstComment top container and container.childNodes\",container,container.childNodes);\n if( container.childNodes.length === 1 && container.children[0].tagName.toLowerCase() === \"small\" ) {\n console.log( \"[onlyFirstComment] container only had a small in it\" );\n container = container.children[0];\n }\n var i, autosignedIdx, autosigned = container.querySelector( \"small.autosigned\" );\n if( autosigned && ( autosignedIdx = iterableToList(\n container.childNodes ).indexOf( autosigned ) ) >= 0 ) {\n i = autosignedIdx;\n } else {\n var childNodes = container.childNodes;\n for( i = 0; i < childNodes.length; i++ ) {\n if( hasTimestamp( childNodes[i] ) ) {\n //console.log( \"[oFC] found a timestamp in \",childNodes[i]);\n break;\n }\n }\n if( i === childNodes.length ) {\n throw new Error( \"[onlyFirstComment] No timestamp found\" );\n }\n }\n //console.log(\"[onlyFirstComment] killing all after \",i,container.childNodes[i]);\n i++;\n var elemToRemove;\n while( elemToRemove = container.childNodes[i] ) {\n container.removeChild( elemToRemove );\n }\n }", "title": "" }, { "docid": "a514a324c659a32fe52b8914cbe79457", "score": "0.5372203", "text": "function formatCommentText(commentText)\r\n{\r\n\tcommentText = commentText.replace(/\\r\\n/gi,\"<br>\");\r\n\tcommentText = commentText.replace(/\\n/gi,\"<br>\");\t\r\n\treturn commentText;\r\n}", "title": "" }, { "docid": "5bc29e3c140d6a26c1e78ed2b092d941", "score": "0.53717756", "text": "function addComment(el, comm) {\r\n\t\tif (Array.isArray(comm)) {\r\n\t\t\tcomm.forEach(addComment.bind(null, el));\r\n\t\t}\r\n\t\telse {\r\n\t\t\tcomm = ' ' + comm + ' ';\r\n\t\t\tif (isMeth(document, 'createComment')) { /* node element and fragment */\r\n\t\t\t\tel.appendChild(document.createComment(comm));\r\n\t\t\t}\r\n\t\t\telse if (isMeth(el, 'insertAdjacentHTML')) { /* node element only, no fragment */\r\n\t\t\t\tel.insertAdjacentHTML('beforeEnd', '<!--' + comm + '-->');\r\n\t\t\t}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "7727f249131bd19144c64b3528f7c5d7", "score": "0.53713554", "text": "function constrainComments() {\n if (comments) {\n if (comments.length < 90) return comments;\n else return comments.slice(0, 90) + \" ... \";\n }\n return \"N/A\";\n }", "title": "" }, { "docid": "55df10fa0e8975d875fc5f490be27430", "score": "0.53683954", "text": "function updateComment(id) {\n var commentID = \"\";\n switch (id) {\n default:\n case 0: // Waste\n commentID = \"waste\";\n break;\n case 1: // Water\n commentID = \"water\";\n break;\n case 2: // Electricity\n commentID = \"electricity\";\n break;\n case 3: // Gas\n commentID = \"gas\";\n break;\n }\n var html = \"\";\n html += \"<b>\" + document.getElementById(commentID + \"CommentHeader\").innerText + \"</b><br/>\";\n html += document.getElementById(commentID + \"Comment\").innerText;\n document.getElementById(\"comment\").innerHTML = html;\n}", "title": "" }, { "docid": "0fee4de37160ad7e0108138258619441", "score": "0.5361931", "text": "function writeComment(e){\n\t\tvar code = (e.keyCode ? e.keyCode : e.which);\n\t\tif(code==13){\n\t\t\te.preventDefault();\n\t\t\tvar th = $(e.target);\n\t\t\tvar html = \"<li class='clearfix'><a class='yourPic' data-popup='yourProfile'><img src='img/unknown.png'></a><div class='content'><a class='name' data-popup='yourProfile'>Vous-même</a><p>\"+th.val()+\"</p><a class='time' data-popup='seeDate'>il y a quelques secondes</a> · <a class='like'>J'aime</a></div></li>\";\n\t th.val('');\n\t var newLI = th.parent().prev().addClass('showComments').append(html).find('li').last();\n\t newLI.find('a').not('.like').on('click',showPopup);\n\t newLI.find('.like').on('click',likeComment);\n\n\t var nb = th.parent().parent().prev().find('.commentNb');\n\t\t\tvar i = parseInt(nb.text());\n\t\t\tif(isNaN(i)){\n\t\t\t\ti = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\ti += 1;\n\t\t\t}\n\t\t\tnb.removeClass('no-comment').text(i);\n\t\t}\n\t}", "title": "" }, { "docid": "7534fad61820784d312dab126b7fd48d", "score": "0.53494877", "text": "function scanComment() {\n tokenStart = index;\n index += 2; // --\n\n var character = input.charAt(index)\n , content = ''\n , isLong = false\n , commentStart = index\n , lineStartComment = lineStart\n , lineComment = line;\n\n if ('[' === character) {\n content = readLongString(true);\n // This wasn't a multiline comment after all.\n if (false === content) content = character;\n else isLong = true;\n }\n // Scan until next line as long as it's not a multiline comment.\n if (!isLong) {\n while (index < length) {\n if (isLineTerminator(input.charCodeAt(index))) break;\n ++index;\n }\n if (options.comments) content = input.slice(commentStart, index);\n }\n\n if (options.comments) {\n var node = ast.comment(content, input.slice(tokenStart, index));\n\n // `Marker`s depend on tokens available in the parser and as comments are\n // intercepted in the lexer all location data is set manually.\n if (options.locations) {\n node.loc = {\n start: { line: lineComment, column: tokenStart - lineStartComment }\n , end: { line: line, column: index - lineStart }\n };\n }\n if (options.ranges) {\n node.range = [tokenStart, index];\n }\n if (options.onCreateNode) options.onCreateNode(node);\n comments.push(node);\n }\n }", "title": "" } ]
c0b51f1f272675f9eedd5d6ff1d14172
Render the DOM representation of the text of a line. Also builds up a 'line map', which points at the DOM nodes that represent specific stretches of text, and is used by the measuring code. The returned object contains the DOM node, this map, and information about linewide styles that were set by the mode.
[ { "docid": "39f05e757b649904b001451428fae9a0", "score": "0.7192867", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content]), content: content, col: 0, pos: 0, cm: cm};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if ((ie || webkit) && cm.getOption(\"lineWrapping\"))\n builder.addToken = buildTokenSplitSpaces(builder.addToken);\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n builder.content.className = \"cm-tab-wrap-hack\";\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "title": "" } ]
[ { "docid": "57f1d0b07ed50992136736cf8ac3ea9e", "score": "0.7258744", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content]), content: content, col: 0, pos: 0, cm: cm};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if ((ie || webkit) && cm.getOption(\"lineWrapping\"))\n builder.addToken = buildTokenSplitSpaces(builder.addToken);\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n insertLineContent(line, builder, getLineStyles(cm, line));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n return builder;\n }", "title": "" }, { "docid": "57f1d0b07ed50992136736cf8ac3ea9e", "score": "0.7258744", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content]), content: content, col: 0, pos: 0, cm: cm};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if ((ie || webkit) && cm.getOption(\"lineWrapping\"))\n builder.addToken = buildTokenSplitSpaces(builder.addToken);\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n insertLineContent(line, builder, getLineStyles(cm, line));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n return builder;\n }", "title": "" }, { "docid": "0eac132f60c7972ea92f93d5d7a97734", "score": "0.72178537", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {\n pre: elt(\"pre\", [ content ]),\n content: content,\n col: 0,\n pos: 0,\n cm: cm\n };\n lineView.measure = {};\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if ((ie || webkit) && cm.getOption(\"lineWrapping\")) builder.addToken = buildTokenSplitSpaces(builder.addToken);\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line))) builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass) builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass) builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0) builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n // See issue #2901\n if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className)) builder.content.className = \"cm-tab-wrap-hack\";\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className) builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n return builder;\n }", "title": "" }, { "docid": "9b176fed1d20a7b5a9743415827f4e00", "score": "0.72077763", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content]), content: content,\n col: 0, pos: 0, cm: cm,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n builder.content.className = \"cm-tab-wrap-hack\";\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "title": "" }, { "docid": "9b176fed1d20a7b5a9743415827f4e00", "score": "0.72077763", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content]), content: content,\n col: 0, pos: 0, cm: cm,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n builder.content.className = \"cm-tab-wrap-hack\";\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "title": "" }, { "docid": "9b176fed1d20a7b5a9743415827f4e00", "score": "0.72077763", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content]), content: content,\n col: 0, pos: 0, cm: cm,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n builder.content.className = \"cm-tab-wrap-hack\";\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "title": "" }, { "docid": "7b29095c24506c8756682ff7c76140e8", "score": "0.70512664", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "title": "" }, { "docid": "6b58689708ad8e342788a87eb2831df9", "score": "0.7047157", "text": "function buildLineContent(cm, lineView) {\n\t // The padding-right forces the element to have a 'border', which\n\t // is needed on Webkit to be able to get line-level bounding\n\t // rectangles for it (in measureChar).\n\t var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null)\n\t var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t col: 0, pos: 0, cm: cm,\n\t trailingSpace: false,\n\t splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")}\n\t lineView.measure = {}\n\n\t // Iterate over the logical lines that make up this visual line.\n\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0)\n\t builder.pos = 0\n\t builder.addToken = buildToken\n\t // Optionally wire in some hacks into the token-rendering\n\t // algorithm, to deal with browser quirks.\n\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n\t { builder.addToken = buildTokenBadBidi(builder.addToken, order) }\n\t builder.map = []\n\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line)\n\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate))\n\t if (line.styleClasses) {\n\t if (line.styleClasses.bgClass)\n\t { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\") }\n\t if (line.styleClasses.textClass)\n\t { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\") }\n\t }\n\n\t // Ensure at least a single node is present, for measuring.\n\t if (builder.map.length == 0)\n\t { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))) }\n\n\t // Store the map and a cache object for the current logical line\n\t if (i == 0) {\n\t lineView.measure.map = builder.map\n\t lineView.measure.cache = {}\n\t } else {\n\t ;(lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n\t ;(lineView.measure.caches || (lineView.measure.caches = [])).push({})\n\t }\n\t }\n\n\t // See issue #2901\n\t if (webkit) {\n\t var last = builder.content.lastChild\n\t if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n\t { builder.content.className = \"cm-tab-wrap-hack\" }\n\t }\n\n\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre)\n\t if (builder.pre.className)\n\t { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\") }\n\n\t return builder\n\t}", "title": "" }, { "docid": "f926227a9cdbe560daeffecc9993e0b4", "score": "0.70297647", "text": "function buildLineContent(cm, lineView) {\n\t // The padding-right forces the element to have a 'border', which\n\t // is needed on Webkit to be able to get line-level bounding\n\t // rectangles for it (in measureChar).\n\t var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t col: 0, pos: 0, cm: cm,\n\t splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n\t lineView.measure = {};\n\n\t // Iterate over the logical lines that make up this visual line.\n\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t var line = i ? lineView.rest[i - 1] : lineView.line, order;\n\t builder.pos = 0;\n\t builder.addToken = buildToken;\n\t // Optionally wire in some hacks into the token-rendering\n\t // algorithm, to deal with browser quirks.\n\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n\t builder.addToken = buildTokenBadBidi(builder.addToken, order);\n\t builder.map = [];\n\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t if (line.styleClasses) {\n\t if (line.styleClasses.bgClass)\n\t builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n\t if (line.styleClasses.textClass)\n\t builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n\t }\n\n\t // Ensure at least a single node is present, for measuring.\n\t if (builder.map.length == 0)\n\t builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n\t // Store the map and a cache object for the current logical line\n\t if (i == 0) {\n\t lineView.measure.map = builder.map;\n\t lineView.measure.cache = {};\n\t } else {\n\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n\t (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t }\n\t }\n\n\t // See issue #2901\n\t if (webkit) {\n\t var last = builder.content.lastChild\n\t if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n\t builder.content.className = \"cm-tab-wrap-hack\";\n\t }\n\n\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t if (builder.pre.className)\n\t builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n\t return builder;\n\t }", "title": "" }, { "docid": "c0e45be2f1f2d89c980c8601cf0512ca", "score": "0.70297647", "text": "function buildLineContent(cm, lineView) {\n\t // The padding-right forces the element to have a 'border', which\n\t // is needed on Webkit to be able to get line-level bounding\n\t // rectangles for it (in measureChar).\n\t var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t col: 0, pos: 0, cm: cm,\n\t splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n\t lineView.measure = {};\n\n\t // Iterate over the logical lines that make up this visual line.\n\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t var line = i ? lineView.rest[i - 1] : lineView.line, order;\n\t builder.pos = 0;\n\t builder.addToken = buildToken;\n\t // Optionally wire in some hacks into the token-rendering\n\t // algorithm, to deal with browser quirks.\n\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n\t builder.addToken = buildTokenBadBidi(builder.addToken, order);\n\t builder.map = [];\n\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t if (line.styleClasses) {\n\t if (line.styleClasses.bgClass)\n\t builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n\t if (line.styleClasses.textClass)\n\t builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n\t }\n\n\t // Ensure at least a single node is present, for measuring.\n\t if (builder.map.length == 0)\n\t builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n\t // Store the map and a cache object for the current logical line\n\t if (i == 0) {\n\t lineView.measure.map = builder.map;\n\t lineView.measure.cache = {};\n\t } else {\n\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n\t (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t }\n\t }\n\n\t // See issue #2901\n\t if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n\t builder.content.className = \"cm-tab-wrap-hack\";\n\n\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t if (builder.pre.className)\n\t builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n\t return builder;\n\t }", "title": "" }, { "docid": "2394265a2258ac63695220e6f792bff7", "score": "0.70229095", "text": "function buildLineContent(cm, lineView) {\n\t // The padding-right forces the element to have a 'border', which\n\t // is needed on Webkit to be able to get line-level bounding\n\t // rectangles for it (in measureChar).\n\t var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t col: 0, pos: 0, cm: cm,\n\t trailingSpace: false,\n\t splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n\t lineView.measure = {};\n\n\t // Iterate over the logical lines that make up this visual line.\n\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t var line = i ? lineView.rest[i - 1] : lineView.line, order;\n\t builder.pos = 0;\n\t builder.addToken = buildToken;\n\t // Optionally wire in some hacks into the token-rendering\n\t // algorithm, to deal with browser quirks.\n\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n\t builder.addToken = buildTokenBadBidi(builder.addToken, order);\n\t builder.map = [];\n\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t if (line.styleClasses) {\n\t if (line.styleClasses.bgClass)\n\t builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n\t if (line.styleClasses.textClass)\n\t builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n\t }\n\n\t // Ensure at least a single node is present, for measuring.\n\t if (builder.map.length == 0)\n\t builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n\t // Store the map and a cache object for the current logical line\n\t if (i == 0) {\n\t lineView.measure.map = builder.map;\n\t lineView.measure.cache = {};\n\t } else {\n\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n\t (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t }\n\t }\n\n\t // See issue #2901\n\t if (webkit) {\n\t var last = builder.content.lastChild\n\t if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n\t builder.content.className = \"cm-tab-wrap-hack\";\n\t }\n\n\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t if (builder.pre.className)\n\t builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n\t return builder;\n\t }", "title": "" }, { "docid": "394b19fbb4579850a1ad2452cbe9edf8", "score": "0.7002156", "text": "function buildLineContent(cm, lineView) {\n\t\t // The padding-right forces the element to have a 'border', which\n\t\t // is needed on Webkit to be able to get line-level bounding\n\t\t // rectangles for it (in measureChar).\n\t\t var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t\t var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t\t col: 0, pos: 0, cm: cm,\n\t\t trailingSpace: false,\n\t\t splitSpaces: cm.getOption(\"lineWrapping\")};\n\t\t lineView.measure = {};\n\n\t\t // Iterate over the logical lines that make up this visual line.\n\t\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t\t var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n\t\t builder.pos = 0;\n\t\t builder.addToken = buildToken;\n\t\t // Optionally wire in some hacks into the token-rendering\n\t\t // algorithm, to deal with browser quirks.\n\t\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n\t\t { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n\t\t builder.map = [];\n\t\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t\t if (line.styleClasses) {\n\t\t if (line.styleClasses.bgClass)\n\t\t { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n\t\t if (line.styleClasses.textClass)\n\t\t { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n\t\t }\n\n\t\t // Ensure at least a single node is present, for measuring.\n\t\t if (builder.map.length == 0)\n\t\t { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n\t\t // Store the map and a cache object for the current logical line\n\t\t if (i == 0) {\n\t\t lineView.measure.map = builder.map;\n\t\t lineView.measure.cache = {};\n\t\t } else {\n\t\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n\t\t ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t\t }\n\t\t }\n\n\t\t // See issue #2901\n\t\t if (webkit) {\n\t\t var last = builder.content.lastChild;\n\t\t if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n\t\t { builder.content.className = \"cm-tab-wrap-hack\"; }\n\t\t }\n\n\t\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t\t if (builder.pre.className)\n\t\t { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n\t\t return builder\n\t\t }", "title": "" }, { "docid": "57d914f3bb2b245552b29eaa90445930", "score": "0.6986084", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n builder.content.className = \"cm-tab-wrap-hack\";\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "title": "" }, { "docid": "57d914f3bb2b245552b29eaa90445930", "score": "0.6986084", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n builder.content.className = \"cm-tab-wrap-hack\";\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "title": "" }, { "docid": "48a11e2d1d7c52866164d80a6c341c72", "score": "0.6986084", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n builder.content.className = \"cm-tab-wrap-hack\";\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "title": "" }, { "docid": "57d914f3bb2b245552b29eaa90445930", "score": "0.6986084", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n builder.content.className = \"cm-tab-wrap-hack\";\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "title": "" }, { "docid": "8724bbefb4579b2b09dafb711bfc8dfa", "score": "0.6983033", "text": "function buildLineContent(cm, lineView) {\r\n // The padding-right forces the element to have a 'border', which\r\n // is needed on Webkit to be able to get line-level bounding\r\n // rectangles for it (in measureChar).\r\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null)\r\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\r\n col: 0, pos: 0, cm: cm,\r\n trailingSpace: false,\r\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")}\r\n lineView.measure = {}\r\n\r\n // Iterate over the logical lines that make up this visual line.\r\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\r\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0)\r\n builder.pos = 0\r\n builder.addToken = buildToken\r\n // Optionally wire in some hacks into the token-rendering\r\n // algorithm, to deal with browser quirks.\r\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\r\n { builder.addToken = buildTokenBadBidi(builder.addToken, order) }\r\n builder.map = []\r\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line)\r\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate))\r\n if (line.styleClasses) {\r\n if (line.styleClasses.bgClass)\r\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\") }\r\n if (line.styleClasses.textClass)\r\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\") }\r\n }\r\n\r\n // Ensure at least a single node is present, for measuring.\r\n if (builder.map.length == 0)\r\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))) }\r\n\r\n // Store the map and a cache object for the current logical line\r\n if (i == 0) {\r\n lineView.measure.map = builder.map\r\n lineView.measure.cache = {}\r\n } else {\r\n ;(lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\r\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({})\r\n }\r\n }\r\n\r\n // See issue #2901\r\n if (webkit) {\r\n var last = builder.content.lastChild\r\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\r\n { builder.content.className = \"cm-tab-wrap-hack\" }\r\n }\r\n\r\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre)\r\n if (builder.pre.className)\r\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\") }\r\n\r\n return builder\r\n}", "title": "" }, { "docid": "faa8d48c0241703e27c3f565769ca7bc", "score": "0.69534963", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null)\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")}\n lineView.measure = {}\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0)\n builder.pos = 0\n builder.addToken = buildToken\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order) }\n builder.map = []\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line)\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate))\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\") }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\") }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))) }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map\n lineView.measure.cache = {}\n } else {\n ;(lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({})\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\" }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre)\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\") }\n\n return builder\n}", "title": "" }, { "docid": "e48ffdd170db82f5d807a55e592aa67c", "score": "0.6947439", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "title": "" }, { "docid": "e48ffdd170db82f5d807a55e592aa67c", "score": "0.6947439", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "title": "" }, { "docid": "e48ffdd170db82f5d807a55e592aa67c", "score": "0.6947439", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "title": "" }, { "docid": "e48ffdd170db82f5d807a55e592aa67c", "score": "0.6947439", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "title": "" }, { "docid": "e48ffdd170db82f5d807a55e592aa67c", "score": "0.6947439", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "title": "" }, { "docid": "e48ffdd170db82f5d807a55e592aa67c", "score": "0.6947439", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "title": "" }, { "docid": "e48ffdd170db82f5d807a55e592aa67c", "score": "0.6947439", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "title": "" }, { "docid": "e48ffdd170db82f5d807a55e592aa67c", "score": "0.6947439", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "title": "" }, { "docid": "e48ffdd170db82f5d807a55e592aa67c", "score": "0.6947439", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "title": "" }, { "docid": "8be8829a643a23c198c919896a267cee", "score": "0.69319874", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "title": "" }, { "docid": "8be8829a643a23c198c919896a267cee", "score": "0.69319874", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "title": "" }, { "docid": "8be8829a643a23c198c919896a267cee", "score": "0.69319874", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "title": "" }, { "docid": "8be8829a643a23c198c919896a267cee", "score": "0.69319874", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "title": "" }, { "docid": "8be8829a643a23c198c919896a267cee", "score": "0.69319874", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "title": "" }, { "docid": "8be8829a643a23c198c919896a267cee", "score": "0.69319874", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "title": "" }, { "docid": "8be8829a643a23c198c919896a267cee", "score": "0.69319874", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "title": "" }, { "docid": "8be8829a643a23c198c919896a267cee", "score": "0.69319874", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "title": "" }, { "docid": "8be8829a643a23c198c919896a267cee", "score": "0.69319874", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "title": "" }, { "docid": "8be8829a643a23c198c919896a267cee", "score": "0.69319874", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "title": "" }, { "docid": "8be8829a643a23c198c919896a267cee", "score": "0.69319874", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "title": "" }, { "docid": "58af8df6c5d57c1437e8b604a4e6b7b0", "score": "0.6876688", "text": "function buildLineContent(cm, lineView) {\n\t // The padding-right forces the element to have a 'border', which\n\t // is needed on Webkit to be able to get line-level bounding\n\t // rectangles for it (in measureChar).\n\t var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t var builder = { pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t col: 0, pos: 0, cm: cm,\n\t trailingSpace: false,\n\t splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\") };\n\t // hide from accessibility tree\n\t content.setAttribute(\"role\", \"presentation\");\n\t builder.pre.setAttribute(\"role\", \"presentation\");\n\t lineView.measure = {};\n\n\t // Iterate over the logical lines that make up this visual line.\n\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t var line = i ? lineView.rest[i - 1] : lineView.line,\n\t order = void 0;\n\t builder.pos = 0;\n\t builder.addToken = buildToken;\n\t // Optionally wire in some hacks into the token-rendering\n\t // algorithm, to deal with browser quirks.\n\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line))) {\n\t builder.addToken = buildTokenBadBidi(builder.addToken, order);\n\t }\n\t builder.map = [];\n\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t if (line.styleClasses) {\n\t if (line.styleClasses.bgClass) {\n\t builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n\t }\n\t if (line.styleClasses.textClass) {\n\t builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n\t }\n\t }\n\n\t // Ensure at least a single node is present, for measuring.\n\t if (builder.map.length == 0) {\n\t builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\t }\n\n\t // Store the map and a cache object for the current logical line\n\t if (i == 0) {\n\t lineView.measure.map = builder.map;\n\t lineView.measure.cache = {};\n\t } else {\n\t ;(lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t }\n\t }\n\n\t // See issue #2901\n\t if (webkit) {\n\t var last = builder.content.lastChild;\n\t if (/\\bcm-tab\\b/.test(last.className) || last.querySelector && last.querySelector(\".cm-tab\")) {\n\t builder.content.className = \"cm-tab-wrap-hack\";\n\t }\n\t }\n\n\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t if (builder.pre.className) {\n\t builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\t }\n\n\t return builder;\n\t }", "title": "" }, { "docid": "c9e58b07c6b9f02a075025e8e8dd7d2f", "score": "0.6837337", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null)\n var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")}\n // hide from accessibility tree\n content.setAttribute(\"role\", \"presentation\")\n builder.pre.setAttribute(\"role\", \"presentation\")\n lineView.measure = {}\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0)\n builder.pos = 0\n builder.addToken = buildToken\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order) }\n builder.map = []\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line)\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate))\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\") }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\") }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))) }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map\n lineView.measure.cache = {}\n } else {\n ;(lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({})\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\" }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre)\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\") }\n\n return builder\n}", "title": "" }, { "docid": "d835c6b81380879c1c597cc1cbaf1539", "score": "0.68033767", "text": "function buildLineContent(cm,lineView){ // The padding-right forces the element to have a 'border', which\n\t// is needed on Webkit to be able to get line-level bounding\n\t// rectangles for it (in measureChar).\n\tvar content=elt(\"span\",null,null,webkit?\"padding-right: .1px\":null);var builder={pre:elt(\"pre\",[content],\"CodeMirror-line\"),content:content,col:0,pos:0,cm:cm,splitSpaces:(ie||webkit)&&cm.getOption(\"lineWrapping\")};lineView.measure={}; // Iterate over the logical lines that make up this visual line.\n\tfor(var i=0;i<=(lineView.rest?lineView.rest.length:0);i++){var line=i?lineView.rest[i-1]:lineView.line,order;builder.pos=0;builder.addToken=buildToken; // Optionally wire in some hacks into the token-rendering\n\t// algorithm, to deal with browser quirks.\n\tif(hasBadBidiRects(cm.display.measure)&&(order=getOrder(line)))builder.addToken=buildTokenBadBidi(builder.addToken,order);builder.map=[];var allowFrontierUpdate=lineView!=cm.display.externalMeasured&&lineNo(line);insertLineContent(line,builder,getLineStyles(cm,line,allowFrontierUpdate));if(line.styleClasses){if(line.styleClasses.bgClass)builder.bgClass=joinClasses(line.styleClasses.bgClass,builder.bgClass||\"\");if(line.styleClasses.textClass)builder.textClass=joinClasses(line.styleClasses.textClass,builder.textClass||\"\");} // Ensure at least a single node is present, for measuring.\n\tif(builder.map.length==0)builder.map.push(0,0,builder.content.appendChild(zeroWidthElement(cm.display.measure))); // Store the map and a cache object for the current logical line\n\tif(i==0){lineView.measure.map=builder.map;lineView.measure.cache={};}else {(lineView.measure.maps||(lineView.measure.maps=[])).push(builder.map);(lineView.measure.caches||(lineView.measure.caches=[])).push({});}} // See issue #2901\n\tif(webkit&&/\\bcm-tab\\b/.test(builder.content.lastChild.className))builder.content.className=\"cm-tab-wrap-hack\";signal(cm,\"renderLine\",cm,lineView.line,builder.pre);if(builder.pre.className)builder.textClass=joinClasses(builder.pre.className,builder.textClass||\"\");return builder;}", "title": "" }, { "docid": "6b841901a190b72d3405127442dc39a9", "score": "0.6797916", "text": "function _renderLine(input){var fontIsMonospace=input.fontIsMonospace;var containsForeignElements=input.containsForeignElements;var lineContent=input.lineContent;var len=input.len;var isOverflowing=input.isOverflowing;var parts=input.parts;var tabSize=input.tabSize;var containsRTL=input.containsRTL;var spaceWidth=input.spaceWidth;var renderWhitespace=input.renderWhitespace;var renderControlCharacters=input.renderControlCharacters;var characterMapping=new CharacterMapping(len+1,parts.length);var charIndex=0;var tabsCharDelta=0;var charOffsetInPart=0;var out='<span>';for(var partIndex=0,tokensLen=parts.length;partIndex<tokensLen;partIndex++){var part=parts[partIndex];var partEndIndex=part.endIndex;var partType=part.type;var partRendersWhitespace=renderWhitespace!==0/* None */&&partType.indexOf('vs-whitespace')>=0;charOffsetInPart=0;if(partRendersWhitespace){var partContentCnt=0;var partContent='';for(;charIndex<partEndIndex;charIndex++){characterMapping.setPartData(charIndex,partIndex,charOffsetInPart);var charCode=lineContent.charCodeAt(charIndex);if(charCode===9/* Tab */){var insertSpacesCount=tabSize-(charIndex+tabsCharDelta)%tabSize;tabsCharDelta+=insertSpacesCount-1;charOffsetInPart+=insertSpacesCount-1;if(insertSpacesCount>0){partContent+='&rarr;';partContentCnt++;insertSpacesCount--;}while(insertSpacesCount>0){partContent+='&nbsp;';partContentCnt++;insertSpacesCount--;}}else{// must be CharCode.Space\npartContent+='&middot;';partContentCnt++;}charOffsetInPart++;}characterMapping.setPartLength(partIndex,partContentCnt);if(fontIsMonospace||containsForeignElements){out+=\"<span class=\\\"\"+partType+\"\\\">\"+partContent+\"</span>\";}else{out+=\"<span class=\\\"\"+partType+\"\\\" style=\\\"width:\"+spaceWidth*partContentCnt+\"px\\\">\"+partContent+\"</span>\";}}else{var partContentCnt=0;var partContent='';for(;charIndex<partEndIndex;charIndex++){characterMapping.setPartData(charIndex,partIndex,charOffsetInPart);var charCode=lineContent.charCodeAt(charIndex);switch(charCode){case 9/* Tab */:var insertSpacesCount=tabSize-(charIndex+tabsCharDelta)%tabSize;tabsCharDelta+=insertSpacesCount-1;charOffsetInPart+=insertSpacesCount-1;while(insertSpacesCount>0){partContent+='&nbsp;';partContentCnt++;insertSpacesCount--;}break;case 32/* Space */:partContent+='&nbsp;';partContentCnt++;break;case 60/* LessThan */:partContent+='&lt;';partContentCnt++;break;case 62/* GreaterThan */:partContent+='&gt;';partContentCnt++;break;case 38/* Ampersand */:partContent+='&amp;';partContentCnt++;break;case 0/* Null */:partContent+='&#00;';partContentCnt++;break;case 65279/* UTF8_BOM */:case 8232/* LINE_SEPARATOR_2028 */:partContent+='\\uFFFD';partContentCnt++;break;case 13/* CarriageReturn */:// zero width space, because carriage return would introduce a line break\npartContent+='&#8203';partContentCnt++;break;default:if(renderControlCharacters&&charCode<32){partContent+=String.fromCharCode(9216+charCode);partContentCnt++;}else{partContent+=String.fromCharCode(charCode);partContentCnt++;}}charOffsetInPart++;}characterMapping.setPartLength(partIndex,partContentCnt);if(containsRTL){out+=\"<span dir=\\\"ltr\\\" class=\\\"\"+partType+\"\\\">\"+partContent+\"</span>\";}else{out+=\"<span class=\\\"\"+partType+\"\\\">\"+partContent+\"</span>\";}}}// When getting client rects for the last character, we will position the\n// text range at the end of the span, insteaf of at the beginning of next span\ncharacterMapping.setPartData(len,parts.length-1,charOffsetInPart);if(isOverflowing){out+=\"<span>&hellip;</span>\";}out+='</span>';return new RenderLineOutput(characterMapping,out,containsRTL,containsForeignElements);}", "title": "" }, { "docid": "8087ee280c22e91d278937928fde8699", "score": "0.6343115", "text": "function _renderLine(input, sb) {\n var fontIsMonospace = input.fontIsMonospace;\n var containsForeignElements = input.containsForeignElements;\n var lineContent = input.lineContent;\n var len = input.len;\n var isOverflowing = input.isOverflowing;\n var parts = input.parts;\n var tabSize = input.tabSize;\n var containsRTL = input.containsRTL;\n var spaceWidth = input.spaceWidth;\n var renderWhitespace = input.renderWhitespace;\n var renderControlCharacters = input.renderControlCharacters;\n var characterMapping = new CharacterMapping(len + 1, parts.length);\n var charIndex = 0;\n var tabsCharDelta = 0;\n var charOffsetInPart = 0;\n var prevPartContentCnt = 0;\n var partAbsoluteOffset = 0;\n sb.appendASCIIString('<span>');\n\n for (var partIndex = 0, tokensLen = parts.length; partIndex < tokensLen; partIndex++) {\n partAbsoluteOffset += prevPartContentCnt;\n var part = parts[partIndex];\n var partEndIndex = part.endIndex;\n var partType = part.type;\n var partRendersWhitespace = renderWhitespace !== RenderWhitespace.None && partType.indexOf('vs-whitespace') >= 0;\n charOffsetInPart = 0;\n sb.appendASCIIString('<span class=\"');\n sb.appendASCIIString(partType);\n sb.appendASCII(charCode_1.CharCode.DoubleQuote);\n\n if (partRendersWhitespace) {\n var partContentCnt = 0;\n {\n var _charIndex = charIndex;\n var _tabsCharDelta = tabsCharDelta;\n\n for (; _charIndex < partEndIndex; _charIndex++) {\n var charCode = lineContent.charCodeAt(_charIndex);\n\n if (charCode === charCode_1.CharCode.Tab) {\n var insertSpacesCount = tabSize - (_charIndex + _tabsCharDelta) % tabSize;\n _tabsCharDelta += insertSpacesCount - 1;\n partContentCnt += insertSpacesCount;\n } else {\n // must be CharCode.Space\n partContentCnt++;\n }\n }\n }\n\n if (!fontIsMonospace) {\n var partIsOnlyWhitespace = partType === 'vs-whitespace';\n\n if (partIsOnlyWhitespace || !containsForeignElements) {\n sb.appendASCIIString(' style=\"width:');\n sb.appendASCIIString(String(spaceWidth * partContentCnt));\n sb.appendASCIIString('px\"');\n }\n }\n\n sb.appendASCII(charCode_1.CharCode.GreaterThan);\n\n for (; charIndex < partEndIndex; charIndex++) {\n characterMapping.setPartData(charIndex, partIndex, charOffsetInPart, partAbsoluteOffset);\n var charCode = lineContent.charCodeAt(charIndex);\n\n if (charCode === charCode_1.CharCode.Tab) {\n var insertSpacesCount = tabSize - (charIndex + tabsCharDelta) % tabSize;\n tabsCharDelta += insertSpacesCount - 1;\n charOffsetInPart += insertSpacesCount - 1;\n\n if (insertSpacesCount > 0) {\n sb.write1(0x2192); // &rarr;\n\n insertSpacesCount--;\n }\n\n while (insertSpacesCount > 0) {\n sb.write1(0xA0); // &nbsp;\n\n insertSpacesCount--;\n }\n } else {\n // must be CharCode.Space\n sb.write1(0xb7); // &middot;\n }\n\n charOffsetInPart++;\n }\n\n prevPartContentCnt = partContentCnt;\n } else {\n var partContentCnt = 0;\n\n if (containsRTL) {\n sb.appendASCIIString(' dir=\"ltr\"');\n }\n\n sb.appendASCII(charCode_1.CharCode.GreaterThan);\n\n for (; charIndex < partEndIndex; charIndex++) {\n characterMapping.setPartData(charIndex, partIndex, charOffsetInPart, partAbsoluteOffset);\n var charCode = lineContent.charCodeAt(charIndex);\n\n switch (charCode) {\n case charCode_1.CharCode.Tab:\n var insertSpacesCount = tabSize - (charIndex + tabsCharDelta) % tabSize;\n tabsCharDelta += insertSpacesCount - 1;\n charOffsetInPart += insertSpacesCount - 1;\n\n while (insertSpacesCount > 0) {\n sb.write1(0xA0); // &nbsp;\n\n partContentCnt++;\n insertSpacesCount--;\n }\n\n break;\n\n case charCode_1.CharCode.Space:\n sb.write1(0xA0); // &nbsp;\n\n partContentCnt++;\n break;\n\n case charCode_1.CharCode.LessThan:\n sb.appendASCIIString('&lt;');\n partContentCnt++;\n break;\n\n case charCode_1.CharCode.GreaterThan:\n sb.appendASCIIString('&gt;');\n partContentCnt++;\n break;\n\n case charCode_1.CharCode.Ampersand:\n sb.appendASCIIString('&amp;');\n partContentCnt++;\n break;\n\n case charCode_1.CharCode.Null:\n sb.appendASCIIString('&#00;');\n partContentCnt++;\n break;\n\n case charCode_1.CharCode.UTF8_BOM:\n case charCode_1.CharCode.LINE_SEPARATOR_2028:\n sb.write1(0xfffd);\n partContentCnt++;\n break;\n\n default:\n if (strings.isFullWidthCharacter(charCode)) {\n tabsCharDelta++;\n }\n\n if (renderControlCharacters && charCode < 32) {\n sb.write1(9216 + charCode);\n partContentCnt++;\n } else {\n sb.write1(charCode);\n partContentCnt++;\n }\n\n }\n\n charOffsetInPart++;\n }\n\n prevPartContentCnt = partContentCnt;\n }\n\n sb.appendASCIIString('</span>');\n } // When getting client rects for the last character, we will position the\n // text range at the end of the span, insteaf of at the beginning of next span\n\n\n characterMapping.setPartData(len, parts.length - 1, charOffsetInPart, partAbsoluteOffset);\n\n if (isOverflowing) {\n sb.appendASCIIString('<span>&hellip;</span>');\n }\n\n sb.appendASCIIString('</span>');\n return new RenderLineOutput(characterMapping, containsRTL, containsForeignElements);\n}", "title": "" }, { "docid": "de19c20d2148377dcc9fb9666191c4ad", "score": "0.63393307", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n\t\t var built = getLineContent(cm, lineView);\n\t\t lineView.text = lineView.node = built.pre;\n\t\t if (built.bgClass) { lineView.bgClass = built.bgClass; }\n\t\t if (built.textClass) { lineView.textClass = built.textClass; }\n\n\t\t updateLineClasses(cm, lineView);\n\t\t updateLineGutter(cm, lineView, lineN, dims);\n\t\t insertLineWidgets(cm, lineView, dims);\n\t\t return lineView.node\n\t\t }", "title": "" }, { "docid": "00fe21043d25a16534f8f34a121f7d79", "score": "0.6334234", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }", "title": "" }, { "docid": "2aa7065f7270703f852e295055825fd7", "score": "0.63290524", "text": "function mapFromLineView(lineView,line,lineN){if(lineView.line==line)return {map:lineView.measure.map,cache:lineView.measure.cache};for(var i=0;i<lineView.rest.length;i++)if(lineView.rest[i]==line)return {map:lineView.measure.maps[i],cache:lineView.measure.caches[i]};for(var i=0;i<lineView.rest.length;i++)if(lineNo(lineView.rest[i])>lineN)return {map:lineView.measure.maps[i],cache:lineView.measure.caches[i],before:true};} // Render a line into the hidden node display.externalMeasured. Used", "title": "" }, { "docid": "5b9bada4877ffb9d8ec579e8e76e2e1a", "score": "0.63135946", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }", "title": "" }, { "docid": "5b9bada4877ffb9d8ec579e8e76e2e1a", "score": "0.63135946", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }", "title": "" }, { "docid": "5b9bada4877ffb9d8ec579e8e76e2e1a", "score": "0.63135946", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }", "title": "" }, { "docid": "5b9bada4877ffb9d8ec579e8e76e2e1a", "score": "0.63135946", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }", "title": "" }, { "docid": "5b9bada4877ffb9d8ec579e8e76e2e1a", "score": "0.63135946", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }", "title": "" }, { "docid": "5b9bada4877ffb9d8ec579e8e76e2e1a", "score": "0.63135946", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }", "title": "" }, { "docid": "5b9bada4877ffb9d8ec579e8e76e2e1a", "score": "0.63135946", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }", "title": "" }, { "docid": "5b9bada4877ffb9d8ec579e8e76e2e1a", "score": "0.63135946", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }", "title": "" }, { "docid": "5b9bada4877ffb9d8ec579e8e76e2e1a", "score": "0.63135946", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }", "title": "" }, { "docid": "581b63129bd01ad11dee3f67a8f2d7b8", "score": "0.62933767", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n\t var built = getLineContent(cm, lineView)\n\t lineView.text = lineView.node = built.pre\n\t if (built.bgClass) { lineView.bgClass = built.bgClass }\n\t if (built.textClass) { lineView.textClass = built.textClass }\n\n\t updateLineClasses(lineView)\n\t updateLineGutter(cm, lineView, lineN, dims)\n\t insertLineWidgets(cm, lineView, dims)\n\t return lineView.node\n\t}", "title": "" }, { "docid": "c43022ee07e9b860abb416a1cc6b5d53", "score": "0.6289033", "text": "function buildLineElement(cm, lineView, lineN, dims) {\r\n var built = getLineContent(cm, lineView)\r\n lineView.text = lineView.node = built.pre\r\n if (built.bgClass) { lineView.bgClass = built.bgClass }\r\n if (built.textClass) { lineView.textClass = built.textClass }\r\n\r\n updateLineClasses(cm, lineView)\r\n updateLineGutter(cm, lineView, lineN, dims)\r\n insertLineWidgets(cm, lineView, dims)\r\n return lineView.node\r\n}", "title": "" }, { "docid": "b578c0eb6c705cb7442c9caf9e933c91", "score": "0.6287531", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n\t var built = getLineContent(cm, lineView);\n\t lineView.text = lineView.node = built.pre;\n\t if (built.bgClass) {\n\t lineView.bgClass = built.bgClass;\n\t }\n\t if (built.textClass) {\n\t lineView.textClass = built.textClass;\n\t }\n\n\t updateLineClasses(lineView);\n\t updateLineGutter(cm, lineView, lineN, dims);\n\t insertLineWidgets(cm, lineView, dims);\n\t return lineView.node;\n\t }", "title": "" }, { "docid": "361766c0e490d76b87d23d56cc1964f6", "score": "0.62826574", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(lineView, dims);\n return lineView.node;\n }", "title": "" }, { "docid": "c5cfdf3bfdb7f4e2101e45f65b6467bc", "score": "0.6280505", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView)\n lineView.text = lineView.node = built.pre\n if (built.bgClass) { lineView.bgClass = built.bgClass }\n if (built.textClass) { lineView.textClass = built.textClass }\n\n updateLineClasses(cm, lineView)\n updateLineGutter(cm, lineView, lineN, dims)\n insertLineWidgets(cm, lineView, dims)\n return lineView.node\n}", "title": "" }, { "docid": "b01fd46af1a8a5b4c2c2f1dec348bfcd", "score": "0.6275436", "text": "function _renderLine(input, sb) {\r\n var fontIsMonospace = input.fontIsMonospace;\r\n var canUseHalfwidthRightwardsArrow = input.canUseHalfwidthRightwardsArrow;\r\n var containsForeignElements = input.containsForeignElements;\r\n var lineContent = input.lineContent;\r\n var len = input.len;\r\n var isOverflowing = input.isOverflowing;\r\n var parts = input.parts;\r\n var tabSize = input.tabSize;\r\n var containsRTL = input.containsRTL;\r\n var spaceWidth = input.spaceWidth;\r\n var renderWhitespace = input.renderWhitespace;\r\n var renderControlCharacters = input.renderControlCharacters;\r\n var characterMapping = new CharacterMapping(len + 1, parts.length);\r\n var charIndex = 0;\r\n var tabsCharDelta = 0;\r\n var charOffsetInPart = 0;\r\n var prevPartContentCnt = 0;\r\n var partAbsoluteOffset = 0;\r\n sb.appendASCIIString('<span>');\r\n for (var partIndex = 0, tokensLen = parts.length; partIndex < tokensLen; partIndex++) {\r\n partAbsoluteOffset += prevPartContentCnt;\r\n var part = parts[partIndex];\r\n var partEndIndex = part.endIndex;\r\n var partType = part.type;\r\n var partRendersWhitespace = (renderWhitespace !== 0 /* None */ && (partType.indexOf('vs-whitespace') >= 0));\r\n charOffsetInPart = 0;\r\n sb.appendASCIIString('<span class=\"');\r\n sb.appendASCIIString(partType);\r\n sb.appendASCII(34 /* DoubleQuote */);\r\n if (partRendersWhitespace) {\r\n var partContentCnt = 0;\r\n {\r\n var _charIndex = charIndex;\r\n var _tabsCharDelta = tabsCharDelta;\r\n for (; _charIndex < partEndIndex; _charIndex++) {\r\n var charCode = lineContent.charCodeAt(_charIndex);\r\n if (charCode === 9 /* Tab */) {\r\n var insertSpacesCount = tabSize - (_charIndex + _tabsCharDelta) % tabSize;\r\n _tabsCharDelta += insertSpacesCount - 1;\r\n partContentCnt += insertSpacesCount;\r\n }\r\n else {\r\n // must be CharCode.Space\r\n partContentCnt++;\r\n }\r\n }\r\n }\r\n if (!fontIsMonospace) {\r\n var partIsOnlyWhitespace = (partType === 'vs-whitespace');\r\n if (partIsOnlyWhitespace || !containsForeignElements) {\r\n sb.appendASCIIString(' style=\"width:');\r\n sb.appendASCIIString(String(spaceWidth * partContentCnt));\r\n sb.appendASCIIString('px\"');\r\n }\r\n }\r\n sb.appendASCII(62 /* GreaterThan */);\r\n for (; charIndex < partEndIndex; charIndex++) {\r\n characterMapping.setPartData(charIndex, partIndex, charOffsetInPart, partAbsoluteOffset);\r\n var charCode = lineContent.charCodeAt(charIndex);\r\n if (charCode === 9 /* Tab */) {\r\n var insertSpacesCount = tabSize - (charIndex + tabsCharDelta) % tabSize;\r\n tabsCharDelta += insertSpacesCount - 1;\r\n charOffsetInPart += insertSpacesCount - 1;\r\n if (insertSpacesCount > 0) {\r\n if (!canUseHalfwidthRightwardsArrow || insertSpacesCount > 1) {\r\n sb.write1(0x2192); // RIGHTWARDS ARROW\r\n }\r\n else {\r\n sb.write1(0xffeb); // HALFWIDTH RIGHTWARDS ARROW\r\n }\r\n insertSpacesCount--;\r\n }\r\n while (insertSpacesCount > 0) {\r\n sb.write1(0xA0); // &nbsp;\r\n insertSpacesCount--;\r\n }\r\n }\r\n else {\r\n // must be CharCode.Space\r\n sb.write1(0xb7); // &middot;\r\n }\r\n charOffsetInPart++;\r\n }\r\n prevPartContentCnt = partContentCnt;\r\n }\r\n else {\r\n var partContentCnt = 0;\r\n if (containsRTL) {\r\n sb.appendASCIIString(' dir=\"ltr\"');\r\n }\r\n sb.appendASCII(62 /* GreaterThan */);\r\n for (; charIndex < partEndIndex; charIndex++) {\r\n characterMapping.setPartData(charIndex, partIndex, charOffsetInPart, partAbsoluteOffset);\r\n var charCode = lineContent.charCodeAt(charIndex);\r\n switch (charCode) {\r\n case 9 /* Tab */:\r\n var insertSpacesCount = tabSize - (charIndex + tabsCharDelta) % tabSize;\r\n tabsCharDelta += insertSpacesCount - 1;\r\n charOffsetInPart += insertSpacesCount - 1;\r\n while (insertSpacesCount > 0) {\r\n sb.write1(0xA0); // &nbsp;\r\n partContentCnt++;\r\n insertSpacesCount--;\r\n }\r\n break;\r\n case 32 /* Space */:\r\n sb.write1(0xA0); // &nbsp;\r\n partContentCnt++;\r\n break;\r\n case 60 /* LessThan */:\r\n sb.appendASCIIString('&lt;');\r\n partContentCnt++;\r\n break;\r\n case 62 /* GreaterThan */:\r\n sb.appendASCIIString('&gt;');\r\n partContentCnt++;\r\n break;\r\n case 38 /* Ampersand */:\r\n sb.appendASCIIString('&amp;');\r\n partContentCnt++;\r\n break;\r\n case 0 /* Null */:\r\n sb.appendASCIIString('&#00;');\r\n partContentCnt++;\r\n break;\r\n case 65279 /* UTF8_BOM */:\r\n case 8232 /* LINE_SEPARATOR_2028 */:\r\n sb.write1(0xfffd);\r\n partContentCnt++;\r\n break;\r\n default:\r\n if (isFullWidthCharacter(charCode)) {\r\n tabsCharDelta++;\r\n }\r\n if (renderControlCharacters && charCode < 32) {\r\n sb.write1(9216 + charCode);\r\n partContentCnt++;\r\n }\r\n else {\r\n sb.write1(charCode);\r\n partContentCnt++;\r\n }\r\n }\r\n charOffsetInPart++;\r\n }\r\n prevPartContentCnt = partContentCnt;\r\n }\r\n sb.appendASCIIString('</span>');\r\n }\r\n // When getting client rects for the last character, we will position the\r\n // text range at the end of the span, insteaf of at the beginning of next span\r\n characterMapping.setPartData(len, parts.length - 1, charOffsetInPart, partAbsoluteOffset);\r\n if (isOverflowing) {\r\n sb.appendASCIIString('<span>&hellip;</span>');\r\n }\r\n sb.appendASCIIString('</span>');\r\n return new RenderLineOutput(characterMapping, containsRTL, containsForeignElements);\r\n}", "title": "" }, { "docid": "a91fc5e8b4313c6435e9cfb714ae8ae7", "score": "0.627066", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView)\n lineView.text = lineView.node = built.pre\n if (built.bgClass) { lineView.bgClass = built.bgClass }\n if (built.textClass) { lineView.textClass = built.textClass }\n\n updateLineClasses(lineView)\n updateLineGutter(cm, lineView, lineN, dims)\n insertLineWidgets(cm, lineView, dims)\n return lineView.node\n}", "title": "" }, { "docid": "722488949b768b45edcc92b9f362af6a", "score": "0.6269709", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(lineView, dims);\n return lineView.node;\n }", "title": "" }, { "docid": "722488949b768b45edcc92b9f362af6a", "score": "0.6269709", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(lineView, dims);\n return lineView.node;\n }", "title": "" }, { "docid": "722488949b768b45edcc92b9f362af6a", "score": "0.6269709", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(lineView, dims);\n return lineView.node;\n }", "title": "" }, { "docid": "722488949b768b45edcc92b9f362af6a", "score": "0.6269709", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(lineView, dims);\n return lineView.node;\n }", "title": "" }, { "docid": "722488949b768b45edcc92b9f362af6a", "score": "0.6269709", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(lineView, dims);\n return lineView.node;\n }", "title": "" }, { "docid": "6a410e0772299b9641e36559c545019d", "score": "0.6267366", "text": "function _renderLine(input, sb) {\r\n var fontIsMonospace = input.fontIsMonospace;\r\n var canUseHalfwidthRightwardsArrow = input.canUseHalfwidthRightwardsArrow;\r\n var containsForeignElements = input.containsForeignElements;\r\n var lineContent = input.lineContent;\r\n var len = input.len;\r\n var isOverflowing = input.isOverflowing;\r\n var parts = input.parts;\r\n var fauxIndentLength = input.fauxIndentLength;\r\n var tabSize = input.tabSize;\r\n var startVisibleColumn = input.startVisibleColumn;\r\n var containsRTL = input.containsRTL;\r\n var spaceWidth = input.spaceWidth;\r\n var middotWidth = input.middotWidth;\r\n var renderWhitespace = input.renderWhitespace;\r\n var renderControlCharacters = input.renderControlCharacters;\r\n // use U+2E31 - WORD SEPARATOR MIDDLE DOT or U+00B7 - MIDDLE DOT\r\n var spaceRenderWhitespaceCharacter = (middotWidth > spaceWidth ? 0x2E31 : 0xB7);\r\n var characterMapping = new CharacterMapping(len + 1, parts.length);\r\n var charIndex = 0;\r\n var visibleColumn = startVisibleColumn;\r\n var charOffsetInPart = 0;\r\n var prevPartContentCnt = 0;\r\n var partAbsoluteOffset = 0;\r\n sb.appendASCIIString('<span>');\r\n for (var partIndex = 0, tokensLen = parts.length; partIndex < tokensLen; partIndex++) {\r\n partAbsoluteOffset += prevPartContentCnt;\r\n var part = parts[partIndex];\r\n var partEndIndex = part.endIndex;\r\n var partType = part.type;\r\n var partRendersWhitespace = (renderWhitespace !== 0 /* None */ && (partType.indexOf('vs-whitespace') >= 0));\r\n charOffsetInPart = 0;\r\n sb.appendASCIIString('<span class=\"');\r\n sb.appendASCIIString(partType);\r\n sb.appendASCII(34 /* DoubleQuote */);\r\n if (partRendersWhitespace) {\r\n var partContentCnt = 0;\r\n {\r\n var _charIndex = charIndex;\r\n var _visibleColumn = visibleColumn;\r\n for (; _charIndex < partEndIndex; _charIndex++) {\r\n var charCode = lineContent.charCodeAt(_charIndex);\r\n var charWidth = (charCode === 9 /* Tab */ ? (tabSize - (_visibleColumn % tabSize)) : 1) | 0;\r\n partContentCnt += charWidth;\r\n if (_charIndex >= fauxIndentLength) {\r\n _visibleColumn += charWidth;\r\n }\r\n }\r\n }\r\n if (!fontIsMonospace) {\r\n var partIsOnlyWhitespace = (partType === 'vs-whitespace');\r\n if (partIsOnlyWhitespace || !containsForeignElements) {\r\n sb.appendASCIIString(' style=\"display:inline-block;width:');\r\n sb.appendASCIIString(String(spaceWidth * partContentCnt));\r\n sb.appendASCIIString('px\"');\r\n }\r\n }\r\n sb.appendASCII(62 /* GreaterThan */);\r\n for (; charIndex < partEndIndex; charIndex++) {\r\n characterMapping.setPartData(charIndex, partIndex, charOffsetInPart, partAbsoluteOffset);\r\n var charCode = lineContent.charCodeAt(charIndex);\r\n var charWidth = void 0;\r\n if (charCode === 9 /* Tab */) {\r\n charWidth = (tabSize - (visibleColumn % tabSize)) | 0;\r\n if (!canUseHalfwidthRightwardsArrow || charWidth > 1) {\r\n sb.write1(0x2192); // RIGHTWARDS ARROW\r\n }\r\n else {\r\n sb.write1(0xFFEB); // HALFWIDTH RIGHTWARDS ARROW\r\n }\r\n for (var space = 2; space <= charWidth; space++) {\r\n sb.write1(0xA0); // &nbsp;\r\n }\r\n }\r\n else { // must be CharCode.Space\r\n charWidth = 1;\r\n sb.write1(spaceRenderWhitespaceCharacter); // &middot; or word separator middle dot\r\n }\r\n charOffsetInPart += charWidth;\r\n if (charIndex >= fauxIndentLength) {\r\n visibleColumn += charWidth;\r\n }\r\n }\r\n prevPartContentCnt = partContentCnt;\r\n }\r\n else {\r\n var partContentCnt = 0;\r\n if (containsRTL) {\r\n sb.appendASCIIString(' dir=\"ltr\"');\r\n }\r\n sb.appendASCII(62 /* GreaterThan */);\r\n for (; charIndex < partEndIndex; charIndex++) {\r\n characterMapping.setPartData(charIndex, partIndex, charOffsetInPart, partAbsoluteOffset);\r\n var charCode = lineContent.charCodeAt(charIndex);\r\n var producedCharacters = 1;\r\n var charWidth = 1;\r\n switch (charCode) {\r\n case 9 /* Tab */:\r\n producedCharacters = (tabSize - (visibleColumn % tabSize));\r\n charWidth = producedCharacters;\r\n for (var space = 1; space <= producedCharacters; space++) {\r\n sb.write1(0xA0); // &nbsp;\r\n }\r\n break;\r\n case 32 /* Space */:\r\n sb.write1(0xA0); // &nbsp;\r\n break;\r\n case 60 /* LessThan */:\r\n sb.appendASCIIString('&lt;');\r\n break;\r\n case 62 /* GreaterThan */:\r\n sb.appendASCIIString('&gt;');\r\n break;\r\n case 38 /* Ampersand */:\r\n sb.appendASCIIString('&amp;');\r\n break;\r\n case 0 /* Null */:\r\n sb.appendASCIIString('&#00;');\r\n break;\r\n case 65279 /* UTF8_BOM */:\r\n case 8232 /* LINE_SEPARATOR_2028 */:\r\n sb.write1(0xFFFD);\r\n break;\r\n default:\r\n if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__[\"isFullWidthCharacter\"](charCode)) {\r\n charWidth++;\r\n }\r\n if (renderControlCharacters && charCode < 32) {\r\n sb.write1(9216 + charCode);\r\n }\r\n else {\r\n sb.write1(charCode);\r\n }\r\n }\r\n charOffsetInPart += producedCharacters;\r\n partContentCnt += producedCharacters;\r\n if (charIndex >= fauxIndentLength) {\r\n visibleColumn += charWidth;\r\n }\r\n }\r\n prevPartContentCnt = partContentCnt;\r\n }\r\n sb.appendASCIIString('</span>');\r\n }\r\n // When getting client rects for the last character, we will position the\r\n // text range at the end of the span, insteaf of at the beginning of next span\r\n characterMapping.setPartData(len, parts.length - 1, charOffsetInPart, partAbsoluteOffset);\r\n if (isOverflowing) {\r\n sb.appendASCIIString('<span>&hellip;</span>');\r\n }\r\n sb.appendASCIIString('</span>');\r\n return new RenderLineOutput(characterMapping, containsRTL, containsForeignElements);\r\n}", "title": "" }, { "docid": "6ec7eabaa1d9979fdb4a701128e37423", "score": "0.6260397", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node;\n }", "title": "" }, { "docid": "6ec7eabaa1d9979fdb4a701128e37423", "score": "0.6260397", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node;\n }", "title": "" }, { "docid": "6ec7eabaa1d9979fdb4a701128e37423", "score": "0.6260397", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node;\n }", "title": "" }, { "docid": "6ec7eabaa1d9979fdb4a701128e37423", "score": "0.6260397", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node;\n }", "title": "" }, { "docid": "6ec7eabaa1d9979fdb4a701128e37423", "score": "0.6260397", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node;\n }", "title": "" }, { "docid": "6ec7eabaa1d9979fdb4a701128e37423", "score": "0.6260397", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node;\n }", "title": "" }, { "docid": "6ec7eabaa1d9979fdb4a701128e37423", "score": "0.6260397", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node;\n }", "title": "" }, { "docid": "2be3a6b65d8b84b8a34668a649dc39e7", "score": "0.62541324", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n\t var built = getLineContent(cm, lineView);\n\t lineView.text = lineView.node = built.pre;\n\t if (built.bgClass) lineView.bgClass = built.bgClass;\n\t if (built.textClass) lineView.textClass = built.textClass;\n\n\t updateLineClasses(lineView);\n\t updateLineGutter(cm, lineView, lineN, dims);\n\t insertLineWidgets(cm, lineView, dims);\n\t return lineView.node;\n\t }", "title": "" }, { "docid": "2be3a6b65d8b84b8a34668a649dc39e7", "score": "0.62541324", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n\t var built = getLineContent(cm, lineView);\n\t lineView.text = lineView.node = built.pre;\n\t if (built.bgClass) lineView.bgClass = built.bgClass;\n\t if (built.textClass) lineView.textClass = built.textClass;\n\n\t updateLineClasses(lineView);\n\t updateLineGutter(cm, lineView, lineN, dims);\n\t insertLineWidgets(cm, lineView, dims);\n\t return lineView.node;\n\t }", "title": "" }, { "docid": "2be3a6b65d8b84b8a34668a649dc39e7", "score": "0.62541324", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n\t var built = getLineContent(cm, lineView);\n\t lineView.text = lineView.node = built.pre;\n\t if (built.bgClass) lineView.bgClass = built.bgClass;\n\t if (built.textClass) lineView.textClass = built.textClass;\n\n\t updateLineClasses(lineView);\n\t updateLineGutter(cm, lineView, lineN, dims);\n\t insertLineWidgets(cm, lineView, dims);\n\t return lineView.node;\n\t }", "title": "" }, { "docid": "53cca63713b99048aa916d5b022fd3b5", "score": "0.62512165", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "title": "" }, { "docid": "53cca63713b99048aa916d5b022fd3b5", "score": "0.62512165", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "title": "" }, { "docid": "53cca63713b99048aa916d5b022fd3b5", "score": "0.62512165", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "title": "" }, { "docid": "53cca63713b99048aa916d5b022fd3b5", "score": "0.62512165", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "title": "" }, { "docid": "53cca63713b99048aa916d5b022fd3b5", "score": "0.62512165", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "title": "" }, { "docid": "53cca63713b99048aa916d5b022fd3b5", "score": "0.62512165", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "title": "" }, { "docid": "53cca63713b99048aa916d5b022fd3b5", "score": "0.62512165", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "title": "" }, { "docid": "53cca63713b99048aa916d5b022fd3b5", "score": "0.62512165", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "title": "" }, { "docid": "53cca63713b99048aa916d5b022fd3b5", "score": "0.62512165", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "title": "" }, { "docid": "53cca63713b99048aa916d5b022fd3b5", "score": "0.62512165", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "title": "" }, { "docid": "53cca63713b99048aa916d5b022fd3b5", "score": "0.62512165", "text": "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "title": "" }, { "docid": "d0aaada68aa19347be667cfad550ef3a", "score": "0.6172627", "text": "function Line(text, styles) {\n this.styles = styles || [text, null];\n this.text = text;\n this.height = 1;\n this.marked = this.gutterMarker = this.className = this.handlers = null;\n this.stateAfter = this.parent = this.hidden = null;\n }", "title": "" }, { "docid": "e3620b35c6225524d0a828c584ee20dd", "score": "0.6140382", "text": "function Line(text, styles) {\n this.styles = styles || [text, null];\n this.text = text;\n this.height = 1;\n this.marked = this.gutterMarker = this.className = this.bgClassName = this.handlers = null;\n this.stateAfter = this.parent = this.hidden = null;\n }", "title": "" }, { "docid": "e3620b35c6225524d0a828c584ee20dd", "score": "0.6140382", "text": "function Line(text, styles) {\n this.styles = styles || [text, null];\n this.text = text;\n this.height = 1;\n this.marked = this.gutterMarker = this.className = this.bgClassName = this.handlers = null;\n this.stateAfter = this.parent = this.hidden = null;\n }", "title": "" }, { "docid": "6c970535748f49587682118b5ddafede", "score": "0.61039704", "text": "function getLineContent(cm,lineView){var ext=cm.display.externalMeasured;if(ext&&ext.line==lineView.line){cm.display.externalMeasured=null;lineView.measure=ext.measure;return ext.built;}return buildLineContent(cm,lineView);} // Redraw the line's text. Interacts with the background and text", "title": "" }, { "docid": "04dcb415ce7cba0c43826b6044c773e6", "score": "0.594005", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "title": "" }, { "docid": "44b09d8d5919ad81cd6afe110f7f6c98", "score": "0.593606", "text": "function ensureLineWrapped(lineView){if(lineView.node==lineView.text){lineView.node=elt(\"div\",null,null,\"position: relative\");if(lineView.text.parentNode)lineView.text.parentNode.replaceChild(lineView.node,lineView.text);lineView.node.appendChild(lineView.text);if(ie&&ie_version<8)lineView.node.style.zIndex=2;}return lineView.node;}", "title": "" }, { "docid": "69e05546a72a4145d0f914c09fd47378", "score": "0.59162724", "text": "getContentLine(line) {\n const rightWhitespace = this.repeat(' ', this.widestLineLength - line.width + this.rightPadding);\n const leftWhitespace = this.repeat(' ', this.leftPadding);\n return this.wrapInVerticalLines(line.text, leftWhitespace, rightWhitespace);\n }", "title": "" }, { "docid": "16cf24ba025bbad31e411e9f84650fc4", "score": "0.5893857", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "title": "" }, { "docid": "1fc31a1378a21f699509c37316b46cc6", "score": "0.5892579", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "title": "" } ]
d3e6ed7ccae7cdbfaef70d290df299bd
Adds player's card to list of played cards
[ { "docid": "7bc466f98bddc94e8cc10bc0017be7a9", "score": "0.6522125", "text": "playCard(username, cardId) {\n if (this.state.status !== statusTypes.WAITING_FOR_OTHER_PLAYERS) {\n throw Error(\"Now is not the right time to play a card\");\n } else if (this.hasPlayedCard(username)) {\n throw Error(\"You cannot play more than one card\");\n } else {\n const url = this.getCardsByUsername(username).find(playedCard => playedCard.cardId === cardId).url;\n const card = { username, cardId, url };\n this.update({\n playedCards: [...this.state.playedCards, card]\n });\n socket.emitPlayedCard(username, card);\n this.getCardsByUsername(username).find(playedCard => playedCard.cardId === cardId).played = true;\n this.markTurnAsFinished(username);\n if (this.allPlayersPlayedCard()) {\n clearTimeout(this.playRandomCardsTimeout);\n this.clearFinishedTurn();\n this.emitPlayedCards();\n }\n }\n }", "title": "" } ]
[ { "docid": "3f0571dce2a42e1f9e320c8c84feb774", "score": "0.72368544", "text": "addCardsToPlayerHand(drawnCards) {\n for (let i = 0; i < this.handOfPlayer.length; i++) {\n // If slot in array is empty\n if (this.handOfPlayer[i] === null) {\n this.handOfPlayer[i] = drawnCards.pop();\n this.handElement.children[i].appendChild(this.handOfPlayer[i].render());\n }\n }\n }", "title": "" }, { "docid": "a52005786010d8f279ddccadf2ea74b4", "score": "0.7026082", "text": "function addCardForPlayer(card) {\n var li = document.createElement('li');\n li.innerHTML = card;\n document.getElementById('playerHandCards').appendChild(li);\n}", "title": "" }, { "docid": "4b215e412a6a9e373bc5e37f6e93705b", "score": "0.70156276", "text": "setNewCardsToPlayers() {\n for (let trade of this.trades) {\n _player = trade.player;\n _otherPlayer = trade.playerToSteal;\n cardId = trade.cardToSteal\n _player.hand.push(new Card(trade.cardToSteal))\n _otherPlayer.hand = _otherPlayer.hand.filter(card => { return card.id != cardId })\n }\n }", "title": "" }, { "docid": "963236f835417389f3c46d93156110b9", "score": "0.69505805", "text": "newCard() {\n this.state.players.forEach(player => {\n const newCard = cardsManager.assign(this.state.players, 1, this.state.allCardsNumber);\n if (this.state.mode === 'custom') {\n db.getCard(newCard[0].cardId)\n .then(cardWithUrl => {\n player.cards.push({...newCard[0], url: cardWithUrl.dataValues.url});\n })\n .catch(err => { throw new Error(err.message) });\n } else {\n player.cards.push(newCard[0]);\n }\n });\n }", "title": "" }, { "docid": "77694a0cc08bd01c27b827fa5d3d5936", "score": "0.6949054", "text": "playCard(){\n if( this.newDeck.p1Deck.length > 0 && this.newDeck.p2Deck.length > 0){\n this.playedCards.push(this.newDeck.p1Deck.pop()); /*pop the last item from player 1's array into the playedCards array*/\n this.playedCards.push(this.newDeck.p2Deck.pop());/*pop the last item from player 2's array into the playedCards array*/\n // console.log(`Player 1 played a ${this.playedCards[0].rank} of ${this.playedCards[0].suit}. Player 2 played a ${this.playedCards[1].rank} of ${this.playedCards[1].suit}.`); /*Logs the cards from each player*/\n }\n else if (this.newDeck.p1Deck.length === 0){\n for(let y = 0; y < this.playedCards.length; y++){\n this.newDeck.p2Deck.unshift(this.playedCards[y]);\n }\n console.log(`Player 2 wins`);\n }\n else if(this.newDeck.p2Deck.length === 0){\n for(let z = 0; z < this.playedCards.length; z++){\n this.newDeck.p1Deck.unshift(this.playedCards[z]);\n }\n console.log(`Player 1 wins`);\n }\n }", "title": "" }, { "docid": "67cf6c1360ab41676312e65e14c17a81", "score": "0.6941152", "text": "function addToHand(card) {\n\n collection.push(card);\n\n }", "title": "" }, { "docid": "15a27b17aa6861f3b473442f3b456ac9", "score": "0.69176686", "text": "function addToOpenCards(card, cardList) {\n cardList.push(card);\n}", "title": "" }, { "docid": "051b3041a84ca84d328aec369f2a74da", "score": "0.68735296", "text": "function addToOpenCards(card){\n\topenCards.push(card);\n}", "title": "" }, { "docid": "424c88cf3222371fdd7e3af13ca2c053", "score": "0.68631047", "text": "function addCard(card) {\n var index = this.cards.push(card) - 1;\n card.index = index;\n }", "title": "" }, { "docid": "e9b7dc74969ed119697bfde306de0802", "score": "0.68332565", "text": "function addCards (cards) {\n\tcards.forEach(addCard)\n}", "title": "" }, { "docid": "4f2280b34fc6c8a6b7485aa415355a30", "score": "0.68184245", "text": "function addCardToOpenList(card) {\n openCards.push(card);\n}", "title": "" }, { "docid": "ea1c0cfac6e0c9e9b3a7c44314a2874b", "score": "0.6817963", "text": "function addToOpenCards(card) {\n\topenCards.push(card);\n}", "title": "" }, { "docid": "ef82be4c40e96092831f6114d798df59", "score": "0.67856383", "text": "function addCard(list, card) {\n list.push(card);\n if (list.length == 2) {\n isMatch(list[0], list[1]);\n }\n}", "title": "" }, { "docid": "dd3e3ab49bf6aebcbb04780ab91c6cfc", "score": "0.6771343", "text": "function add(card) {\n cards.push(card);\n}", "title": "" }, { "docid": "35bf6ad03099d552fe11a50f71c41f5a", "score": "0.6765687", "text": "useCard (playerId, card) {\n // Set the duel cards\n let duel = this.duels.get(this.actualDuelIndex)\n const newCards = duel.get('cards').push(Map({ playerId, card }))\n duel = duel.set('cards', newCards)\n\n this.duels = this.duels.set(this.actualDuelIndex, duel)\n\n // Remove the card from the player\n this.players = this.players.map((player) => {\n if (player.get('playerId') === playerId) {\n player = player.set('cards', player.get('cards').filter((c) => c !== card))\n }\n\n return player\n })\n\n // Check if need to set next duel\n if (this.duels.get(this.actualDuelIndex).get('cards').size === this.players.size) {\n this.actualDuelIndex += 1\n }\n\n // Check if there are cards to be used\n let cardsLeft = 0\n this.players.forEach((player) => {\n cardsLeft += player.get('cards').size\n })\n\n // Finish the round if there are no cards left\n if (cardsLeft === 0) this.finish()\n\n this.updateDecision()\n }", "title": "" }, { "docid": "19bf0e88861e7c9646caa9f40272d1e6", "score": "0.6752557", "text": "function addToOpenList(card) {\n openCards.push(card);\n}", "title": "" }, { "docid": "ef7ee8a176adf078c9e3a09a4b060612", "score": "0.67402035", "text": "play(card) {\n if (this.game.currentRound.waitingForPlayer() !== this) {\n notifier.info(\"not-your-turn\");\n return;\n }\n\n let cardToBePlayed = this.hand.find(card);\n if (!card || !cardToBePlayed) {\n throw new Error(\"can't play a card that's not on the player's hand\");\n }\n if (!this.canPlay(card)) {\n notifier.info(\"cant-play-card\");\n return;\n }\n\n try {\n this.game.currentTrick.add(cardToBePlayed, this);\n this.hand.remove(cardToBePlayed);\n this.game.currentRound.nextPlayer();\n\n if (options.autoplay === true) {\n setTimeout(() => this.game.currentRound.nextMove(), 800);\n }\n } catch (error) {\n if (this.isHuman) {\n notifier.info(\"not-your-turn\");\n return;\n }\n }\n }", "title": "" }, { "docid": "f258b96a4b10ba70eb4f09abeb96baaf", "score": "0.6737577", "text": "function takeCard(card){\n card.isEquipped = false;\n localPlayer.hand.push(card);\n $(\"#discard\").attr(\"disabled\", \"disabled\");\n $(\"#discard\").css(\"visibility\", \"hidden\");\n $(\"#take\").attr(\"disabled\", \"disabled\");\n $(\"#take\").css(\"visibility\", \"hidden\");\n socket.emit(\"cardTaken\", {card: card, playerNum: localPlayer.playerNum});\n endCount();\n\n //emits the signal to activate the next player's turn\n socket.emit(\"playerTurn\", {\"playerNum\": localPlayer.playerNum});\n}", "title": "" }, { "docid": "0f3d978d818285fe466fef6f9a4b965c", "score": "0.67039216", "text": "playCard(card) {\n this.hand.shift(card);\n // this.tempCards.push( card )\n }", "title": "" }, { "docid": "afdcf1045c0e4b9d1ae74b90f0e9464c", "score": "0.6682307", "text": "function addToOpenedCards(card) {\n if (card.hasClass(\"open\")) {\n openedCards.push(shuffledCards[card.index()]);\n };\n}", "title": "" }, { "docid": "d1fc22406c07e122328060e3d5569044", "score": "0.66476536", "text": "function addActiveCard(card) {\n\n\tif (activeCards.length < activeCardMax) {\n\n\t\tflipCard(card);\n\t\treturn activeCards.push(card);\n\t}\n}", "title": "" }, { "docid": "e4f2c516315df71e47f4a80396226d99", "score": "0.66365325", "text": "AIsPlayCard() {\n this.state.players.forEach(player => {\n if (!player.real && !this.isCurrentPlayer(player.username)) {\n const cards = this.getUnplayedCardsByUsername(player.username);\n const cardId = AI.pickRandomCard(cards);\n this.playCard(player.username, cardId);\n }\n });\n }", "title": "" }, { "docid": "6316c96265646e2b79dfafa084a18f8a", "score": "0.66272086", "text": "push(card) {\n this.cards.push(card) // push adds an element to the end of the array\n }", "title": "" }, { "docid": "53682ca1a09a91ba008fd71c57c50795", "score": "0.6608482", "text": "playRandomCards() {\n this.state.players.forEach(player => {\n if (!this.hasPlayedCard(player.username)) {\n const cards = this.getUnplayedCardsByUsername(player.username);\n const cardId = AI.pickRandomCard(cards);\n this.playCard(player.username, cardId); \n }\n });\n }", "title": "" }, { "docid": "472d8d3993dc59315ef1dd872240c6d5", "score": "0.6601109", "text": "generateNewCardAndSyncPlayersList(playerIndex, cardIndex) {\n // It gets the cards for the player with the provided index.\n const playerCards = this.tableBodyElement.children.item(playerIndex).children.item(CARDS_CELL);\n\n console.log(this.playerList);\n const card = playerCards.children[cardIndex];\n card.src = this.getRandomCard();\n\n // It updates the card avatar for the provided player index on players list.\n this.playerList[playerIndex].cards[cardIndex] = card.src;\n }", "title": "" }, { "docid": "76a73cd831302801ea16aa3559b48fe5", "score": "0.6557044", "text": "'players.getPlayerCard'(playerId, playerCard) {\n check(playerId, String);\n check(playerCard, String);\n\n if (checkIfCity(playerCard)) {\n Players.update(playerId, { $push: { cityCards: playerCard } });\n } else {\n Players.update(playerId, { $push: { eventCards: playerCard } });\n }\n }", "title": "" }, { "docid": "e812e0d1199e1775040b8cec44ad70c4", "score": "0.65434533", "text": "function playCard() {\n console.log(`Play card`);\n // console.log(event.target.id);\n newMatch.playSelectedCard(currentPlayer, event.target.id);\n document.querySelectorAll(`.in-play`).forEach((card) => {card.addEventListener(`click`, attack)});\n}", "title": "" }, { "docid": "6f33364974277c0cb67e48980ea94e81", "score": "0.65199345", "text": "function addOpenedCardToList(openedCard) {\n openedCards.push(openedCard);\n\n if (openedCards.length == 2) {\n increaseMoves();\n if (openedCards[0].attr(\"type\") === openedCards[1].attr(\"type\")) {\n match(openedCards);\n } else {\n unmatch();\n }\n }\n}", "title": "" }, { "docid": "808865006c9e0ecb5d33129ec61f7031", "score": "0.6507998", "text": "function cardsSelected(card) {\n memoryGame.pickedCards.push(card);\n console.log(memoryGame.pickedCards);\n}", "title": "" }, { "docid": "fa3c549a9d111f83fb6c911f7f98d8aa", "score": "0.6503232", "text": "function addCardForOther(card, id, sessionID) {\n var li = document.createElement('li');\n li.innerHTML = card;\n console.log('Trying to append to ' + 'otherHandCards'.concat(id));\n document.getElementById('otherHandCards'.concat(id)).appendChild(li);\n document.getElementById('otherHandText'.concat(id)).innerHTML = \"Other Player's Hand (\" + sessionID + \")\";\n}", "title": "" }, { "docid": "f6b807e69b260dcadb2d99bc2785e618", "score": "0.64786124", "text": "function addToOpenCards(card){\n if(openCards.length===1){\n if(openCards[0]===card){\n return;\n }\n }\n openCards.push(card);\n\n if(openCards.length>1){\n if(openCards[0].innerHTML===openCards[1].innerHTML){\n lockCardsOpen(openCards[0]);\n lockCardsOpen(openCards[1]);\n openCards = [];\n }else{\n hideSymbols(openCards[0], openCards[1]);\n openCards = [];\n }\n incrementCounter();\n updateScoreStars();\n }\n}", "title": "" }, { "docid": "c664e9fb4c6ebbc4c6e4425e4697377c", "score": "0.64608866", "text": "function addCardToList(id) {\n getList(parseInt(id))\n .then(list => {\n let newCards = list.cards !== undefined ? list.cards : []; // Handle an empty list\n newCards.push(``);\n updateList(id, list.name, list.pos, newCards);\n })\n \n}", "title": "" }, { "docid": "d64aef0dcacae39d4110f275965ca159", "score": "0.6426564", "text": "draw(player) {\n\n for(let i=0; i<3; i++) {\n //drawing random card from the deck\n let randomCard = deckOfCards.splice(Math.floor(Math.random() * deckOfCards.length), 1)[0]; \n player.cards.push(randomCard);\n\n console.log(`${player.name} has been dealt ${randomCard.name}`)\n cardsUsed.push(randomCard.name)\n }\n }", "title": "" }, { "docid": "6f488119c82128a58e4949cd1721132f", "score": "0.64210224", "text": "function addCard(clicked) {\n cardList.push(clicked);\n //console.log(cardList);\n \n}", "title": "" }, { "docid": "a593574b92495950c4ab855350485d98", "score": "0.64174855", "text": "addCardToScreen(card) {\n\n //adds card to dictionary of all visible cards\n this.visibleCards[card.getID(true)] = card;\n\n //add to cards div\n let cards = document.getElementById(\"Cards\")\n cards.appendChild(card.getCardImage());\n\n }", "title": "" }, { "docid": "38ccc64db8baa24b501ecb4c9c687689", "score": "0.6403644", "text": "function AppendNewCardToPlayerPool(playerID, card){\n\tFindAndreturnPlayerForm(playerID).children[2].appendChild(card); //remove();\n}", "title": "" }, { "docid": "9d7874a0c60cf5672e83dcbc360f3885", "score": "0.63876605", "text": "function addNewGame(card){\n currentList = event.currentTarget;\n var listItem = document.createElement('li'),listData;\n listItem.classList.add('card','appear');\n \n if(currentList.closest('.uproar-quests')){\n questList.splice(cardIndex(card),1);\n listData = questList[currentList.childElementCount];\n }\n else if(currentList.closest('.uproar-popular')){\n popularList.splice(cardIndex(card),1);\n listItem.classList.add('game-card' );\n listData = popularList[currentList.childElementCount];\n }\n\n listTemplate = `\n <figure data-catagory=\"action\"><img src=\"${listData.gameImage}\" alt=\"${listData.gameTitle}\"></figure>\n <figcaption class=\"game-desc\"><h2>${listData.gameTitle}</h2><p>${listData.gameDesc}</p></figcaption>\n <div class=\"card-footer clear\"><span class=\"points\"><svg class=\"icon-logo\"><use href=\"#icon-logo\"></use></svg>${listData.gamePoint}</span><span class=\"power\"><svg class=\"icon-power\"><use href=\"#icon-power\"></use></svg>${listData.gamePower}</span><button class=\"btn-primary\">accept</button>\n </div>`;\n listItem.innerHTML = listTemplate;\n setTimeout(() => {\n currentList.append(listItem);\n card.remove();\n }, 500);\n}", "title": "" }, { "docid": "b761b32f72bd4fc3eb4ca72690d94457", "score": "0.6370107", "text": "function giveTwoCards() {\r\n\tfor (var i = 0; i < 2; i++) {\r\n\t\tfor (var j = 0; j < players.length; j++) {\r\n\t\t\tif (currentStatus[j] != \"not playing\"){\r\n\t\t\t\tplayers[j].cards[i] = deck[deckPointer];\r\n\t\t\t\tdeckPointer++; \r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "972520766134c86cd622b779b8301695", "score": "0.6369005", "text": "function addCard(card) {\n console.log(card)\n const findCard = cards.find((el) => {\n return card.roomID === el.roomID && card.cardID === el.cardID;\n });\n if (!findCard) {\n cards.push(card);\n }\n}", "title": "" }, { "docid": "68baef8c0f079d5fc1d98c9d2725c3a0", "score": "0.63614076", "text": "createPlayersAndGenerateRandomIntialCardHandForEachOne() {\n // It gets players data generated on waiting room.\n const localList = JSON.parse(localStorage.getItem('players'));\n\n // crea y configura los jugadores\n for (let playerIndex = 0; playerIndex < localList.length; playerIndex += 1) {\n const player = new Player(\n localList[playerIndex].name,\n localList[playerIndex].avatar,\n playerIndex\n );\n player.configurePlayer();\n this.playerList.push(player);\n\n const playerCards = this.tableBodyElement.children\n .item(playerIndex)\n .children.item(CARDS_CELL);\n // Asigna cartas al azar.\n for (let cardIndex = 0; cardIndex < CARDS_COUNT; cardIndex += 1) {\n const card = playerCards.children[cardIndex];\n card.src = this.getRandomCard();\n this.playerList[playerIndex].cards[cardIndex] = card.src;\n }\n this.sendCardsUpdateToServer(playerIndex);\n }\n console.log(this.playerList);\n }", "title": "" }, { "docid": "0e209cd9e1b3d80cce2da1d39ce8797f", "score": "0.63469374", "text": "function computerPlayerTurn() {\n\t\tif(players[currentPlayer].length === 0) {\n\t\t\tfor(var i = 0; i < 5; i++) {\n\t\t\t\tplayers[currentPlayer].push(stock.pop());\n\t\t\t\tui.removeCardFromStockPile();\n\t\t\t\tui.addCardToComputerPlayerTray(currentPlayer);\n\t\t\t}\n\t\t} else {\n\t\t\t\t// Get all legal cards\n\t\t\t\tvar legalCards = game.getLegalCards(currentPlayer);\n\t\t\t\tif(legalCards.length !== 0) {\n\t\t\t\t\tif (legalCards.length >= 3){\n\t\t\t\t\t\tvar randomCardOut = Math.floor(Math.random() * 3) + 1;\n\t\t\t\t\t\tfor(var i = 0; i < randomCardOut; i++) {\n\t\t\t\t\t\t\tvar legalCards = game.getLegalCards(currentPlayer);\n\t\t\t\t\t\t\tcomputerPlayCard(legalCards);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (legalCards.length === 2) {\n\t\t\t\t\t\tvar randomCardOut = Math.floor(Math.random() * 2) + 1;\n\t\t\t\t\t\tfor(var i = 0; i < randomCardOut; i++) {\n\t\t\t\t\t\t\tvar legalCards = game.getLegalCards(currentPlayer);\n\t\t\t\t\t\t\tcomputerPlayCard(legalCards);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (legalCards.length === 1) {\n\t\t\t\t\t\tvar legalCards = game.getLegalCards(currentPlayer);\n\t\t\t\t\t\tcomputerPlayCard(legalCards);\n\t\t\t\t\t}\n\t\t\t\t\tif (game.getPlayerCards(currentPlayer).lenght>6){\n\t\t\t\t\t\tvar randomIndex = Math.floor(Math.random() * game.getPlayerCards(currentPlayer).lenght);\n\t\t\t\t\t\tgame.addCardToDiscardPile(cardObject);\n\t\t\t\t\t\tgame.removePlayerCard(currentPlayer, cardObject.id);\n\t\t\t\t\t}\n\t\t\t\t\t$('#player' + (currentPlayer+1) + '-playedCard').fadeIn(1500)\n\t\t\t\t\t.fadeOut(1500);\n\t\t\t\t\tcomputerDrawCard();\n\t\t\t\t\tcomputerDrawCard();\n\t\t\t\t} else {\n\t\t\t\t\t// Don't have any legal card to play, then draw a card from stock pile\n\t\t\t\t\tif(!game.checkEndGame()) {\n\t\t\t\t\t\tfor(var i = 0; i < 2; i++) {\n\t\t\t\t\t\t\tvar numOfCard = players[currentPlayer].length;\n\t\t\t\t\t\t\tvar randomIndex = Math.floor(Math.random() * numOfCard);\n\t\t\t\t\t\t\tvar cardObject = players[currentPlayer][randomIndex];\n\t\t\t\t\t\t\tui.addCardToDiscardPile(cardObject);\n\t\t\t\t\t\t\tgame.addCardToDiscardPile(cardObject);\n\t\t\t\t\t\t\tgame.removePlayerCard(currentPlayer, cardObject.id);\n\t\t\t\t\t\t\tui.removeCardFromComputerPlayerTray(currentPlayer);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor(var i = 0; i < 2; i++) {\n\t\t\t\t\t\t\tvar cardObject = stock.pop();\n\t\t\t\t\t\t\tif(card.isExcessLandfillCard(cardObject)||card.isIncineratorFailureCard(cardObject)) {\n\t\t\t\t\t\t\t\tgame.playCardProcessor(cardObject);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tplayers[currentPlayer].push(cardObject);\n\t\t\t\t\t\t\t\tui.removeCardFromStockPile();\n\t\t\t\t\t\t\t\tui.addCardToComputerPlayerTray(currentPlayer);\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}\n\t\tnextPlayer();\n\t}", "title": "" }, { "docid": "560859bf7e0a9dc2a5d7106de1c95e88", "score": "0.63382107", "text": "function createCard() {\r\n var gameList = shuffle(playingDeck);\r\n gameList.forEach(function(card) {\r\n $(\".deck\").append('<li class=\"card\"><i class=\"fa ' + card + '\"></i></li>');\r\n });\r\n}", "title": "" }, { "docid": "2a8d9a6795f07ae823812c17bb4b105e", "score": "0.63241255", "text": "function playerCardHit(player){\n let selectedCard = dealerService.cardHit();\n player.cardHand.push(selectedCard);\n currentCard = selectedCard.Weight;\n console.log(selectedCard.Value + \" \" + selectedCard.Suit);\n addToPlayerTotal(player);\n}", "title": "" }, { "docid": "9be4db62202e91dad938d30ed245d7f9", "score": "0.6321406", "text": "function cardsArray(card){\n openCards.push(card);\n}", "title": "" }, { "docid": "f9a70cf0cd82aa23bd7b205e71ac16af", "score": "0.630494", "text": "function stackAddCard(card) {\n\n this.cards.push(card);\n }", "title": "" }, { "docid": "8c16f8cb78b2b57028d5eeeaef200f47", "score": "0.63048065", "text": "play(player, card, position) {\n\n // if invalid play, throw an error\n if (!this.canPlay(player, card, position)) {\n return console.warn('This play is invalid.');\n }\n\n // remove the card from the player's hand\n var hand = this.hands.get(player),\n cardIndex = hand.indexOf(card);\n\n // and place it on the board\n this.board.splice(position, 1, hand.splice(cardIndex, 1)[0]);\n\n // apply game rules to the play\n this.board[position].owner = player\n for (let won of Rules.compute(this, player, card, position)) {\n won.owner = player;\n }\n\n this.nextTurn();\n }", "title": "" }, { "docid": "58f1eeda72161112fb9e8b8bad251dcc", "score": "0.63037914", "text": "function addToOpenCards(card) {\n if (openCards.length < 2) {\n openCards.push(card);\n }\n matchCards();\n }", "title": "" }, { "docid": "104f9080271f742c70e400970c5a04c5", "score": "0.62980676", "text": "function hitCard(){\n\t\t//Draw a new card from deck\n\t\tvar newCard = cardDraw();\n\t\t//Pushing the new card into the player hand depending who called push.\n\t\t//This allow for both dealer and player to use same function\n\t\tplayerTurn.hand.push(newCard);\n\t\t//Run total again to update and check for new total\n\t\ttotal();\n\t}", "title": "" }, { "docid": "b5e5c3e2ca1427df73b9cdd25253ea81", "score": "0.6296654", "text": "function setPlayableCards() {\r\n\tvar card;\r\n\r\n\t// if startingSuit is null/undefined\r\n\t// i.e. if I am starting this round\r\n\tif (startingSuit === undefined || startingSuit === null) {\r\n//\t\tconsole.log(\"I am starting this round. cut=\"+isCut);\r\n\t\t// if it has been cut, everything is playable\r\n\t\tif (isCut)\r\n\t\t\t$('.handCard').removeClass('unplayable').addClass('playable');\r\n\r\n\t\telse {\r\n//\t\t\tconsole.log(\"it hasn't been cut yet\");\r\n\r\n\t\t\t// let's assume I have don't have non trump cards\r\n\t\t\tvar hasNonTrump = false;\r\n\t\t\t\r\n\t\t\t// iterate through each card in hand\r\n\t\t\tfor (var i in myCardArray) {\r\n\r\n\t\t\t\tvar cardId = myCardArray[i];\r\n\t\t\t\tvar splitArray = cardId.split(\"-\");\r\n\t\t\t\tcard = splitArray[1];\r\n\r\n//\t\t\t\tconsole.log(\"card:\"+card);\r\n//\t\t\t\tconsole.log(\"trumpSuit:\"+trumpSuit);\r\n\t\t\t\t\r\n\t\t\t\t// if this card is not a trump suit\r\n\t\t\t\tif (!card.endsWith(trumpSuit)) {\r\n\r\n\t\t\t\t\t// make it playable\r\n\t\t\t\t\t$('#'+ cardId).removeClass('unplayable').addClass('playable');\r\n\r\n\t\t\t\t\t// refute assumption that i don't have any\r\n\t\t\t\t\t// non trump & flag that I have at least one\r\n\t\t\t\t\thasNonTrump = true;\r\n\t\t\t\t}\r\n\t\t\t\t// else console.log(card + \" ends with \" + trumpSuit);\r\n\t\t\t}\r\n\t\t\t// if after iteration, I have no non trump\r\n\t\t\t// console.log(\"has Non Trump:\" + hasNonTrump);\r\n\t\t\tif (!hasNonTrump)\r\n\t\t\t\t// make everything playable\r\n\t\t\t\t$('.handCard').removeClass('unplayable').addClass('playable');\r\n\t\t}\r\n\t}\r\n\t// and if i am not starting this round\r\n\telse {\r\n//\t\tconsole.log(\"I am NOT starting this round\");\r\n\r\n\t\t// let's assume I don't have any card with starting suit\r\n\t\tvar hasStartingSuit = false;\r\n\r\n\t\t// iterate through each card in hand\r\n\t\tfor ( var i in myCardArray) {\r\n\t\t\tvar cardId = myCardArray[i];\r\n\t\t\tvar splitArray = cardId.split(\"-\");\r\n\t\t\tcard = splitArray[1];\r\n\r\n\t\t\t// so if this card is same as starting suit\r\n\t\t\tif (card.endsWith(startingSuit)) {\r\n\t\t\t\t\r\n//\t\t\t\tconsole.log(\"I have the card \"+ card + \" of suit \" + startingSuit);\r\n\t\t\t\t// make it playable\r\n\t\t\t\t$('#'+ cardId).removeClass('unplayable').addClass('playable');\r\n\r\n\t\t\t\t// refute assumption that i don't have any card\r\n\t\t\t\t// of starting suit & flag that I have at least one\r\n\t\t\t\thasStartingSuit = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// if after iteration, I have no card with starting suit\r\n\t\tif (!hasStartingSuit)\r\n\t\t\t// make everything in my hand playable\r\n\t\t\t$('.handCard').removeClass('unplayable').addClass('playable');\r\n\t}\r\n\thighlightTurn();\r\n}", "title": "" }, { "docid": "11c990977edc58b9dc6ee99e35fafcec", "score": "0.6272176", "text": "function addPlayer(player){\n queue.push({\n player,\n timestamp: Date.now(),\n });\n}", "title": "" }, { "docid": "9aa21edd104b21d85e164808672d0f5b", "score": "0.62590146", "text": "function placeCard(card) {\n deck.appendChild(card);\n}", "title": "" }, { "docid": "d8646f845b94eeb39fec9d1bdc6bda73", "score": "0.6252903", "text": "function addToOpenCards(){\n\n count++;\n let pick = this;\n openCards.push(this);\n\n if(openCards.length>1){\n\t\t\tfor(let x = 1; (x <= openCards.length && x != count); x++) {\n\t\t\t\t \tif(this != openCards[x-1]) {\n\t\t\t\t \t\tmoves++;\n \t\t\t// if cards match, lock the cards\n\t\t\t\t\t\t\tif(this.innerHTML === openCards[x-1].innerHTML){\n\t\t\t\t\t\t\t\tlockCards.call(this, openCards[x-1]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// if cards dont match, hide the card\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\topenCards[x-1].classList.add(\"wrong\");\n\t\t\t\t\t\t\t\tthis.classList.add(\"wrong\");\n\n\t\t\t\t\t\t\t\topenCards[x-1].classList.remove(\"show\",\"open\");\n\t\t\t\t\t\t\t\tthis.classList.remove(\"show\",\"open\");\n\n\t\t\t\t\t\t\t\tlet c = openCards[x-1];\n\n\t\t\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t\t\tpick.classList.remove(\"wrong\");\n\t\t\t\t\t\t\t\t\tc.classList.remove(\"wrong\");\n\t\t\t\t\t\t\t\t},500);\n\n\t\t\t\t\t\t\t\topenCards = [];\n\t\t\t\t\t\t\t\tcount = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t// moves--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\tcount = 0;\n\t\t\t}\n\t\topenCards=[];\n\t\t}\n\tupdateMovesAndStars();\n}", "title": "" }, { "docid": "363ceaf2d0b75aec21d2d184ab5d322b", "score": "0.62494546", "text": "function addPlayer(player){\n if(gameStarted){\n addNewSnake(player)\n }\n}", "title": "" }, { "docid": "76cf00f27003797ea4114689dc992652", "score": "0.62489796", "text": "function addFlippedCard(tappedCard){\n flippedCards.push(tappedCard);\n}", "title": "" }, { "docid": "58166eaa05e25f0cc6dcf5e75072f35d", "score": "0.6246388", "text": "insertIntoQueue() {\n var i=0;\n while(i < this.deckCards.length) {\n this.listQueue.enqueue(this.deckCards[i]);\n i++;\n }\n }", "title": "" }, { "docid": "8da0f29469482a7a1f9aa7796a6ff76b", "score": "0.6245539", "text": "function passingCards() {\n localIndex = currentPlayer.getTableIndex();\n var nextPlayerIndex;\n var nextPlayerIterator = 0;\n\n // Extracts each player's position and passes the cards to them\n for (var i = 0; i < maxPlayers; i++) {\n nextPlayerIterator++;\n nextPlayerIndex = (localIndex + nextPlayerIterator) % currentPlayers.length;\n if ((currentPlayers[i].getId() != undefined) && (currentPlayers[i].getUsername() != currentPlayer)) {\n switch (positions[currentPlayers[i].getUsername()]) {\n case \"right\":\n cardsToRight();\n break;\n case \"back\":\n cardsToBack();\n break;\n case \"left\":\n cardsToLeft();\n break;\n }\n }\n }\n}", "title": "" }, { "docid": "cf1d27115b8e60ee60955876ba2ecd7d", "score": "0.6223273", "text": "function addPlayer(player) {\n\t\tif (player.socketId == socket.id) {\n\t\t\tmyPlayer = player;\n\t\t}\n\t\tif ($scope.players.includes(player)) {\n\t\t\treturn;\n\t\t}\n\t\t$scope.players.push(player);\n\t\tconsole.log('New player added: ' + player.socketId);\n\t\ttoggleButton();\t\n\t\t$scope.$apply();\n\t}", "title": "" }, { "docid": "8641ba3aa0e1eaa6f0c8a9778de95b53", "score": "0.62217563", "text": "function addToOpenCards(card) {\n\tcard.removeEventListener('click', cardClick);\n\topenCards.push(card);\n\tdoMatchCards(card);\n}", "title": "" }, { "docid": "0026964ef0b16feeab2299da6ab95982", "score": "0.62045515", "text": "theTurn(){\n currentGame.communityCards[3] = (playingDeck.deckShuffled.shift());\n this.appendAll()\n }", "title": "" }, { "docid": "f737fbca9c0fe961bf5e055f696201ba", "score": "0.61912787", "text": "function play() {\n\t\tvar winningCard = war(cards_player_1[0], cards_player_2[0]);\n\t\tvar winner;\n\t\tvar loser;\n\t\tif(winningCard ===cards_player_1[0]){\n\t\t\tcards_player_1.push(cards_player_1.shift(), cards_player_2.shift())\n\t\t}else if(winningCard ===cards_player_2[0]){\n\t\t\tcards_player_2.push(cards_player_1.shift(), cards_player_2.shift())\n\t\t}else{\n\t\t\tcards_player_1.push(cards_player_1.shift());\n\t\t\tcards_player_2.push(cards_player_2.shift());\n\t\t}\n\t\tif(cards_player_1.length === 0||cards_player_2.length === 0){\n\t\t\talert(\"Game Over\");\n\t\t}\n\t\t//this function (defined below) will continue to the next turn\n\t\tadvance();\n\t}", "title": "" }, { "docid": "c76d0f059542920ed102e34afb153b09", "score": "0.6184825", "text": "addCard(card) {\n\n }", "title": "" }, { "docid": "e3f6566fd15a862e30a163b5b0bb2e87", "score": "0.61754507", "text": "function addCardToHand(thisHand) {\n\t// thisHand is a required parameter\n\tif(!thisHand) {\n\t\t// suppress an error & return an array with a single card inside if no hand was passed\n\t\tvar thisHand = [];\n\t}\n\t// Select a random card from the deck\n\tvar cardNum = Math.floor(Math.random() * deck.length);\n\tvar rndCard = deck[cardNum];\n\t// Add that card to thisHand\n\tthisHand.push(rndCard);\n\t// Remove that card from the deck\n\tdeck.splice(cardNum, 1);\n\t// Give the hand to the assigned player\n\treturn thisHand;\n}", "title": "" }, { "docid": "ca6bdd49d888bde1753fdef40e386367", "score": "0.6171368", "text": "function addToCardsToCompare(){\n cardsToCompare.push(event.target);\n if (cardsToCompare.length === 2){\n increaseMoves();\n compareCards();\n }\n}", "title": "" }, { "docid": "8e925c0ad87f8f5d5b4952c23c6cf1ec", "score": "0.61693305", "text": "function stackAddCard(card) {\n\n this.cards.push(card);\n}", "title": "" }, { "docid": "30c73b8f6cb177f630fa545e501206d3", "score": "0.6143647", "text": "function shuffledDeck() {\n shuffle(cardList); \n for (i = 0; i <= cardList.length; i++) {\n newcard = cardList[i];\n $('.deck').append(newcard);\n }\n}", "title": "" }, { "docid": "0efabc4053dfa24f469824003492ce46", "score": "0.61401314", "text": "function playCard(cardsChosen, who)\n{\n var cardChosenValue = getCardValue(cardsChosen[0]);\n //clear cpu move if player goes\n if(who === PLAYER)\n {\n $('#cpumove').text(\"\");\n $('#bomb').css(\"visibility\", \"hidden\");\n }\n for(var i = 0; i < cardsChosen.length; i++)\n {\n pile.push(cardsChosen[i]);\n }\n \n for(var i = 0; i < cardsChosen.length; i++)\n {\n if(who === PLAYER)\n {\n if(playerHand.length > 0)\n removeCard(playerHand, \"playerhand\", cardsChosen[i]);\n else if(playerFaceup.length > 0)\n removeCard(playerFaceup, \"playerfaceup\", cardsChosen[i]);\n else\n removeCard(playerFacedown, \"playerfacedown\", cardsChosen[i]);\n }\n else\n {\n if(cpuHand.length > 0)\n removeCard(cpuHand, \"cpuhand\", cardsChosen[i]);\n else if(cpuFaceup.length > 0)\n removeCard(cpuFaceup, \"cpufaceup\", cardsChosen[i]);\n else\n removeCard(cpuFacedown, \"cpufacedown\", cardsChosen[i]);\n }\n }\n if(checkBomb())\n {\n cardChosenValue = '10'; //one of the tens\n }\n var repeat = false;\n switch(cardChosenValue)\n {\n case '10': bomb(who); repeat= true; break;\n case '2': repeat= true; break;\n default:\n }\n\n if(playerHand.length <= 3)\n $('#player').css(\"width\", \"300\");\n if(cpuHand.length <= 3)\n $('#cpu').css(\"width\", \"300\");\n redoPile();\n drawCard(who);\n\n if(repeat)\n repeatTurn(who);\n else\n switchTurn(who);\n\n}", "title": "" }, { "docid": "18dc1b5eaf1918834e85bb9354c4cdc8", "score": "0.6136529", "text": "addCardToPlayerHand(newCard)\r\n {\r\n this.state.hand.push({\r\n firstSection: newCard.props.firstSection,\r\n secondSection: newCard.props.secondSection,\r\n key: newCard.key,\r\n id: newCard.props.id,\r\n onCubeClick: newCard.props.onCubeClick,\r\n isSelected:'notSelected'\r\n\r\n });\r\n this.props.changeTurn();\r\n this.forceUpdate();\r\n }", "title": "" }, { "docid": "a159b80565bd2deaa1ffdafbe34e6a8d", "score": "0.61351573", "text": "addPlayer(player) {\n if (!player.game_room_id) {\n player.game_room_id = this.getRoomID();\n if (player.rooms.indexOf(this.getRoomID()) < 0) {\n player.join(this.getRoomID());\n }\n }\n if (this.getStateName === \"LOBBY\") {\n this.players.push(player);\n } else {\n var index = getRandomIntInclusive(0, this.players.length - 1);\n this.players.splice(index, 0, player);\n }\n var ConnectedPlayer = GameRoomManager.ConnectedPlayers.get(player.request.user.username);\n ConnectedPlayer.in_game = true;\n ConnectedPlayer.in_queue = false;\n }", "title": "" }, { "docid": "99512007bfc6d2db773cd537ba7d1065", "score": "0.61351556", "text": "function addPlayer(player) {\n console.log('Added player!');\n\n player.team_id = teamId;\n \n console.log(player);\n\n const config = {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(player)\n };\n \n fetch(`${baseURL}/players`, config)\n .then(res => res.json())\n .then(player => setPlayers([...players, player]))\n }", "title": "" }, { "docid": "ace39c7600744a177544e16bd82cbb32", "score": "0.6134314", "text": "function shuffledCards() {\n let shuffled = shuffle(cards);\n shuffled.forEach(function(newCard) {\n deck.appendChild(newCard);\n });\n}", "title": "" }, { "docid": "8dd65dfdd7e8ea36cabd6061000fba52", "score": "0.613133", "text": "function addCardForPlayer(card, sessionID) {\n var id = document.getElementById('playerHandCards').childElementCount+1;\n var input = document.createElement('div');\n input.innerHTML = card;\n input.id = (\"PlayerCard\"+id);\n document.getElementById('yourHandText').innerHTML = \"Your Hand (\" + sessionID + \")\";\n document.getElementById('playerHandCards').appendChild(input);\n}", "title": "" }, { "docid": "3765b318ea9b8a38eea604ab7ff294d3", "score": "0.61268896", "text": "#appendCard(id, card) {\n const cardsContainer = this.bindById(id);\n cardsContainer.appendChild(card);\n }", "title": "" }, { "docid": "30e2f15783a412b59da5e5a9fec543d4", "score": "0.61173654", "text": "function pushHand (playerOrDealer){\n var newCard;\n newCard = getCard();\n newCard = aceValid(newCard, playerOrDealer);\n playerOrDealer.hand.push(newCard);\n playerOrDealer.score = playerOrDealer.score + newCard.value;\n renderCard(playerOrDealer, newCard);\n}", "title": "" }, { "docid": "8204ba8b40c348147982923a2b8272df", "score": "0.61171556", "text": "function startGame() {\n $( \".deck\" ).empty();\n match = 0;\n moves = 0;\n count = 0;\n openCards = [];\n rating(moves);\n $( \".moves\" ).text(moves);\n startTime();\n\n// shuffle the list of cards using the provided \"shuffle\" method below\n let shuffleCards = shuffle(cardsList);\n\n// loop through each card and create its HTML\n for (var i =0; i < shuffleCards.length; i++) {\n $( \".deck\" ).append($( \"<li class=\\\"card\\\"><i class=\\\"\" + shuffleCards[i] + \"\\\"></i></li>\" ));\n }\n\n// set up the event listener for a card. If a card is clicked:\n addCardListener()\n}", "title": "" }, { "docid": "92576d9bdbda7c74fdee58532e6eff1b", "score": "0.61071557", "text": "cardMatches(card1, card2) {\n this.matches.push(card1);\n this.matches.push(card2);\n if (this.matches.length === this.cardsList.length) this.afterGame(\"You Win!\");\n\n\n }", "title": "" }, { "docid": "73bb1360c5a067665ba0e213b5be1afc", "score": "0.61068994", "text": "function updateDeck(activeCardIndex, playerDeck) {\n // Create an empty array to store all the cards both players played\n let cardsPlayedArray = [];\n // For each card (index position), from 0 (beginning of deck), to the last\n // card played (activeCardIndex), add that card to the array, and remove that\n // card from its respective deck.\n for (let i = 0; i <= activeCardIndex; i++) {\n cardsPlayedArray.push(p1_deck[0]);\n p1_deck.shift();\n cardsPlayedArray.push(p2_deck[0]);\n p2_deck.shift();\n }\n playerDeck.push(...cardsPlayedArray);\n}", "title": "" }, { "docid": "835c5a56860af390bbdb6eb73ff78687", "score": "0.6101697", "text": "function play() {\n\t\tvar card1=cards_player_1.shift();\n\t\tvar card2=cards_player_2.shift();\n\t\t\twar(card1,card2);\n\t\t\twinner.push(card1);\n\t\t\twinner.push(card2);\n\t\t//this function (defined below) will continue to the next turn\n\t\tadvance();\n\t}", "title": "" }, { "docid": "a94758b41e75260630e60c86e720d2c2", "score": "0.60982066", "text": "function addCard(winner) {\n var clone = cardTemplate.content.cloneNode(true);\n var guessCount = clone.getElementById('guess-count');\n var winnerField = clone.querySelector('.result-card-winner-name');\n winnerField.innerText = winner;\n cardArea.prepend(clone);\n guessCount.innerText = counter;\n counter = 0;\n}", "title": "" }, { "docid": "c9c8542e697900cdf3e4a154e2561669", "score": "0.6093557", "text": "function addToggledCard(){\n const card = event.target;\n toggledCards.push(card);\n console.log(toggledCards);\n }", "title": "" }, { "docid": "cebc3199e6406a6869c1b187ae5e5c46", "score": "0.60797787", "text": "function addCard(num) {\r\n deck.push(num);\r\n }", "title": "" }, { "docid": "534cbaccb4506c57d893eb9e2da508c3", "score": "0.60784644", "text": "function nextPlayer() {\n\tgameState.playOrder.push(gameState.playOrder.shift());\n}", "title": "" }, { "docid": "c393118a63d53864d90eea59dd87b3ef", "score": "0.6074152", "text": "function useCard(card){\n\texecuteStringFunction(card.action);\n\n var indexC = localPlayer.hand.indexOf(card);\n socket.emit(\"modifyCard\",\n {\n \"playerNum\": localPlayer.playerNum,\n \"card\": card,\n \"indexC\": indexC,\n \"functionName\": \"use\"\n });\n\n\tlocalPlayer.hand.splice(indexC, 1);\n\tshowHand();\n}", "title": "" }, { "docid": "5fb00f9261e1f0027d38be6412c1802d", "score": "0.6071396", "text": "takeCard() {\n const cardObject = this.currentDeck.cardsArray.pop();\n this.currentPlayer.hand.push(cardObject);\n\n const cardElement = getCard.frontSide(cardObject);\n\n cardElement.onclick = () => { this.currentPlayer.playCard(cardObject, cardElement); }; //! TEMP\n\n renderCard.toHand(cardElement);\n\n this.currentPlayer.setCurrentAge();\n header.changePlayerStats(this.currentPlayer);\n\n this.actionDone();\n }", "title": "" }, { "docid": "8587e8f97f6cce5a784011495f2fc00d", "score": "0.60618764", "text": "function placeCards() {\n let shuffled = shuffle(cards);\n for (var i = 0; i < shuffled.length; i++) {\n let template = `<li class = \"card\"><i class = \"fa fa-${shuffled[i]}\"></i></li>`;\n deck.insertAdjacentHTML('beforeend', template);\n };\n}", "title": "" }, { "docid": "f7d0b1b62a4c56330995ddf5f6f25c66", "score": "0.60616237", "text": "addCard (card) {\n\t\t\tthis.checkStorage() // check if tempStorage has 2 crads\n\t\t\tthis.localStorage.push(card)\n\t\t\tthis.localStorage.length === 2 && this.checkValue()\n\t\t}", "title": "" }, { "docid": "7c594036db06cec79b5054474edaf081", "score": "0.6061361", "text": "function appendCards(cards) {\n let cardSection = document.getElementById('card-section');\n cards.forEach(function (card) {\n cardSection.appendChild(card);\n });\n}", "title": "" }, { "docid": "4d2a03fa6a0f33cf181beaedd94119dd", "score": "0.6054162", "text": "function takeHit() {\n\tplayerHand.push(deck.pop())\n}", "title": "" }, { "docid": "53f17c619b7b7a8d5198e529a768f723", "score": "0.60493374", "text": "generatePlayerCards() {\n const tempBoard = [...this.board]; // Copia para ordenar diferente.\n const selectedCards = tempBoard.sort(() => 0.5 - Math.random())\n .slice(0, this.playersCardsQuantity * this.players.length);\n\n for (let index = 0; index < this.players.length; index += 1) {\n this.players[index].cards = selectedCards.slice(\n (this.playersCardsQuantity * index),\n ((this.playersCardsQuantity * index) + this.playersCardsQuantity),\n );\n }\n }", "title": "" }, { "docid": "bb43eefb0f5ead055c164a22d6124fc0", "score": "0.6048802", "text": "function addPlayer (player) {\n\tconsole.log(`Adding Player ${chalk.bold(player)} to next update batch`);\n\tbatchedPlayers.push(player);\n\treturn;\n}", "title": "" }, { "docid": "a16a1fc506e3b531b4671d14a867e6b5", "score": "0.603226", "text": "function nextPlayer() {\n\t\tui.clearToast();\n\t\tif(!game.checkEndGame()) {\n\t\t\tif(stock.length <= 5){\n\t\t\t\tvar counter = discardpile.length;\n\t\t\t\tfor(var i = 0; i < counter;i++) {\n\t\t\t\t\tstock.push(discardpile.pop());\n\t\t\t\t}\n\t\t\t\tshuffleCards(counter);\n\t\t\t}\n\t\t\tif(moveToNextPlayer() !== 0) {\n\t\t\t\tsetTimeout(function(){computerPlayerTurn();},3000);\n\t\t\t\tdocument.getElementById('player' + (currentPlayer+1) + '-playedCardHolder').innerHTML = '';\n\t\t\t} else {\n\t\t\t\tui.bindCardClickListener();\n\t\t\t\tui.lockNewGame(false);\n\t\t\t\tplayer1CardsClickEnabled = true;\n\t\t\t\tui.showToast('Your turn.');\n\t\t\t\tif(players[0].length === 0) {\n\t\t\t\t\tfor(var i = 0; i < 5; i++) {\n\t\t\t\t\t\t// Get the card\n\t\t\t\t\t\tvar cardObject = game.getStockPileCardToHumanPlayer();\n\t\t\t\t\t\t// Update the UI\n\t\t\t\t\t\tui.removeCardFromStockPile();\n\t\t\t\t\t\tif(card.isExcessLandfillCard(cardObject)||card.isIncineratorFailureCard(cardObject)) {\n\t\t\t\t\t\t\tgame.removePlayerCard(0, cardObject.id);\n\t\t\t\t\t\t\tgame.playCardProcessor(cardObject);\n\t\t\t\t\t\t\tnextPlayer();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tui.addCardToHumanPlayerTray(cardObject);\n\t\t\t\t\t\t\tnextPlayer();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if(game.getLegalCards(0).length === 0) {\n\t\t\t\t\tstockpileClickEnabled = true;\n\t\t\t\t} else {\n\t\t\t\t\tstockpileClickEnabled = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "1d5fa2b559359373fb49cc026898c961", "score": "0.60282147", "text": "function addCardToComputerHand(x) {\n\n\t\t\t$(\"#computerDrawnCard\").empty();\n\t\t\t$(\"#compHand\").append('<div class=\"card faceDown cardInHand\" id=\"' + x.suit + x.cardNumber + '\"><p class=\"tempCompCardStyle\">' + x.cardNumber + ' of ' + x.suit + '</p></div>');\n\t\t\t$(\"#checkComp\").append(x.cardNumber + x.suit + '<br>');\n\n\t}", "title": "" }, { "docid": "665f6200b07c2164cd805893462610cb", "score": "0.6020036", "text": "cards() {\n for(var i=0;i<this.rank.length;i++) {\n for(var j=0;j<this.suit.length;j++) {\n this.deckCards[this.suit.length*i + j] = this.rank[i] + \" of \" + this.suit[j];\n }\n }\n }", "title": "" }, { "docid": "bd4e5dacdb015059a769862795e12388", "score": "0.6013091", "text": "addCard(id, name, url, canPlay) {\n // add to stack\n if(name in this.cardNameIndices) {\n let index = this.cardNameIndices[name];\n let cardStack = this.yourStacks[index];\n cardStack.addCard(id);\n this.cardIndices[id] = index;\n }\n else {\n let index = this.yourStacks.length;\n let cardStack = new CardStack(id, name, url, canPlay);\n this.yourStacks.push(cardStack);\n gui.cardScroller.items.push(new CardStackPanel(cardStack));\n this.cardNameIndices[name] = index;\n this.cardIndices[id] = index;\n }\n }", "title": "" }, { "docid": "7fa28470a9c3fc33f7b73baf63ef9d23", "score": "0.60116804", "text": "function updateAllPlayerData()\n{\n $(\".playerCard\").each(function(index, card){\n updatePlayerData(card.id);\n });\n resortCards();\n}", "title": "" }, { "docid": "91dfe784a52de5a4fa2b64a584944ccf", "score": "0.6011382", "text": "function playerAdded(added, leaderboard) {\n console.log(\"playerAdded\");\n // If there is an existing player with that product id, we need to increment its score.\n const existing = leaderboard.players.find(player => {\n console.log(\"playerAdded::return existing\");\n return player.playerId === added.player.playerId;\n });\n\n if (existing) {\n existing.score = added.player.score;\n } else {\n console.log(\"playerAdded::push\");\n // Otherwise, we just add the player to the existing list.\n leaderboard.players.push(added.player);\n }\n\n // And return the new state.\n console.log(\"return state\");\n return leaderboard;\n}", "title": "" }, { "docid": "523620fd82e7568a2449c848c3d46b2c", "score": "0.600303", "text": "function addCard(pile, card) {\n let i;\n try {\n card.imageURL = card.faceUp;\n for (i = pile.length; i > 0; i--) {\n pile[i] = pile[i - 1];\n }\n pile[0] = card;\n } catch (e) {}\n }", "title": "" }, { "docid": "5cbc58d2efe200eded815f0acfd40bc8", "score": "0.6001362", "text": "function populateCards(){\n shuffle(cardList).forEach((card) => {\n createCard(card);\n });\n addClickListenerFlip();\n}", "title": "" }, { "docid": "7b229861db0759af73d1ae6b22012a1b", "score": "0.600012", "text": "dealCards() {\n let min = 0;\n let max = 13;\n let numCards = 13;\n\n for (let player of this.players) {\n while (min < max) {\n player.addCard(this.deck.getCardByIndex(min));\n min++;\n }\n player.sortHand();\n // increment max to get the next 13 indices\n max = max + numCards;\n }\n }", "title": "" }, { "docid": "ba438b9108d5ce43173a8a83996ff36b", "score": "0.5995741", "text": "function draw(){\n \tconsole.log(\"DRAW FUCTION\")\n \tconsole.log(player.count)\n \tlet history = new TempObj()\n\n \t\tlet card = `<li id='playerCard${cardNum}' class='cardFormat playerCard ani'></li>`\n\n \t\t//prepend. since the list items are pushed left by .append(). \n \t\t$(\".ulPlayer\").prepend(card)\n \t\t$(`#playerCard${cardNum}`).css(\"background-image\",history[\"suitDecal\"])\n \t\tplayer.count = player.count + history[\"deckCardValue\"]\n \t\t$(\"#countP\").html(player.count)\n\n \t\thasAce(player,history)\n \t\tconsole.log(\"activated\")\n \t\tconsole.log(player.aceCount)\n\n \t\tgameInfoUpdate()\n\n\t\tif(player.count > 21){\n\t\t\tdisabled()//stop player from continuously drawing cards. Players will try to break the game somehow...\n\t\t\tlost()\n\t\t}\n\t\t//this means that user has doubled down, check to ensure that player has switched turns from dbl down button \n\t\tif(player[\"turn\"] == false){\n\t\t\tif(player.count <= 21){\n\t\t\t\tdealerDraw()\n\t\t\t}\n\t\t}\n\t\t\n\t\t//for card variable, each new card will be different\n \tcardNum ++\n }", "title": "" }, { "docid": "d3bd21b706006a458212b81994ff1641", "score": "0.5994919", "text": "function storeCards(e) {\n cardsList.push(e.target);\n if (cardsList.length > 1) {\n if (cardsList[0].firstElementChild.className == cardsList[1].firstElementChild.className) {\n lockCards(e);\n matched++;\n cardsList.splice(0, cardsList.length);\n }\n // hiding the cards if they are not matched\n else {\n t = setTimeout(hideCards, 2000, e);\n }\n countMoves();\n } else {\n t = setTimeout(hideCards, 2000, e);\n return;\n }\n\n}", "title": "" } ]
6104f0b3b6be36bcee1471e4cbc20162
Updates the metadata for this object.
[ { "docid": "154847654cd761ac0cd8e36f9520f5ac", "score": "0.6398157", "text": "updateMetadata(metadata) {\n return (0, _storage.updateMetadata)(this._delegate, metadata);\n }", "title": "" } ]
[ { "docid": "d87fd56445dc3a0d81091aa3676c1aba", "score": "0.70128936", "text": "update(metadataKey, value) {\r\n this.metadata[metadataKey] = value;\r\n }", "title": "" }, { "docid": "3a33c9655292bfc10332b0d5e3c8d421", "score": "0.6735647", "text": "updateMetadata(key, value) {\n this.metadata[key] = value;\n if (this.debug) {\n this.render();\n this._triggerDebugPaint(this.debug);\n }\n }", "title": "" }, { "docid": "58fd58dc91ad4d53ae838c7fc413fff9", "score": "0.65309256", "text": "updateMetaData() {\n if (_.get(this, 'config.userMetaData.lastUsedAt')) {\n this.metaData.lastUsedAt = new Date().toISOString();\n }\n\n if (_.get(this, 'config.userMetaData.sessionsCount')) {\n if (this.platform.isNewSession()) {\n if (!this.metaData.sessionsCount) {\n this.metaData.sessionsCount = 0;\n }\n this.metaData.sessionsCount += 1;\n }\n }\n\n if (_.get(this, 'config.userMetaData.requestHistorySize') > 0) {\n if (!_.get(this.metaData, `requests.${this.platform.jovo.getHandlerPath()}`)) {\n let requests = {\n count: 0,\n log: [],\n };\n _.set(this.metaData,\n `requests.${this.platform.jovo.getHandlerPath()}`,\n requests);\n }\n let requestItem = this.metaData.requests[this.platform.jovo.getHandlerPath()];\n requestItem.count += 1;\n requestItem.log.push(new Date().toISOString());\n\n if (requestItem.log.length > this.config.requestHistorySize) {\n requestItem.log = requestItem.log.slice(1, requestItem.log.length);\n }\n }\n\n if (_.get(this, 'config.userMetaData.devices')) {\n if (!_.get(this.metaData, 'devices[\"'+this.platform.getDeviceId()+'\"]')) {\n let device = {\n hasAudioInterface: this.platform.hasAudioInterface(),\n hasScreenInterface: this.platform.hasScreenInterface(),\n };\n _.set(this.metaData,\n 'devices[\"'+this.platform.getDeviceId()+'\"]',\n device);\n }\n }\n }", "title": "" }, { "docid": "baddbf2cecc6043d19da66e355c3a170", "score": "0.6378768", "text": "set metadata(value) {\n Guard.assertValidMetadataOrNull(value);\n this._metadata = value;\n }", "title": "" }, { "docid": "178c0c214e594aa2ac6e01f36ca4b4ac", "score": "0.6225931", "text": "function setMeta(metadata) {\n\t m._meta = metadata;\n\t }", "title": "" }, { "docid": "5a4e6687b3dce1c77b371164355e56c9", "score": "0.60617214", "text": "function updateMediapackageMetadata() {\n updateMetadataField('title', 'title');\n updateMetadataField('created', 'start');\n updateMetadataField('language', 'language');\n updateMetadataField('keywords', 'keywords');\n updateMetadataField('rightsholder', 'rightsholder');\n updateMetadataField('license', 'license');\n updateMetadataField('subject', 'subject');\n updateMetadataGroupField('creator', 'creators', 'creator');\n updateMetadataGroupField('contributor', 'contributors', 'contributor');\n\n // update series\n if ($('#series').val() != '') {\n if ($('#ispartof').val() == '') {\n createSeriesFromText();\n }\n updateMPElement('seriestitle', $('#series').val());\n updateMPElement('series', $('#ispartof').val());\n }\n}", "title": "" }, { "docid": "5513919589f3a334036c9e5a90e0d79d", "score": "0.60353434", "text": "setMetadata(metadata){\n if(!Metadata.isMetadataInstance(metadata)){\n throw new Error(\"Metadata must be instance of Metadata\");\n }\n this.currentMetadata = metadata;\n }", "title": "" }, { "docid": "5b0785a99101d9e947ba4c2e40468fee", "score": "0.5917852", "text": "async setMetadata(id, metadata) {\n let filename = this._formatMetadataFilename(id);\n\n let contents = JSON.stringify(\n metadata.constructor.toObject(metadata), null, 2\n );\n\n await fs.writeFile(filename, contents);\n }", "title": "" }, { "docid": "7b5b959b368f3f51610999299780ead9", "score": "0.58024436", "text": "function changeMetaData(value) {\n setMetaData(value);\n }", "title": "" }, { "docid": "2809785df14acb12baf285b4aeba04ac", "score": "0.57706565", "text": "setLayerMetadata(layerId, metadata) {\n let layer = this.map.getLayer(layerId);\n //merge the metadata with the existing metadata\n if (layer) layer.metadata = Object.assign(layer.metadata, metadata);\n }", "title": "" }, { "docid": "5551dd0d1bb7e9be1848a2e0ee71308e", "score": "0.57185817", "text": "function updateMetadata$2(ref, metadata) {\n ref = _firebaseUtil.getModularInstance(ref);\n return updateMetadata$1(ref, metadata);\n}", "title": "" }, { "docid": "d12919c2424207323e4069288484cead", "score": "0.5666007", "text": "static updateMetaData(src, type, isLiveData, entityName, primaryKey, fieldlist, typelist) {\n\t\t//src, type, data, entityName, primaryKey, fieldlist, typelist\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tDataSource.Data(type)\n\t\t\t\t.getMetaData(src)\n\t\t\t\t.then(async (mdata) => {\n\t\t\t\t\tif (DataSource.isLocal(type)) {\n\t\t\t\t\t\tif (entityName && primaryKey && fieldlist && typelist) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tmdata = DataSource.parseMetadataLocal(type, entityName, primaryKey, fieldlist, typelist);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\treject({ error: err, status: 400 });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst meta = await Database.getDataSourceLocalMeta(src);\n\n\t\t\t\t\t\t\tif (meta) {\n\t\t\t\t\t\t\t\tconst { entity, prim, fields, types } = meta;\n\t\t\t\t\t\t\t\tmdata = DataSource.parseMetadataLocal(type, entity, prim, fields, types);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn reject({\n\t\t\t\t\t\t\t\t\terror: {\n\t\t\t\t\t\t\t\t\t\tmessage: 'Meta-Data not stored in Database and has not been provided.',\n\t\t\t\t\t\t\t\t\t\tsrc,\n\t\t\t\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tstatus: 500,\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} else {\n\t\t\t\t\t\tmdata = DataSource.parseMetadataRemote(mdata, type);\n\t\t\t\t\t}\n\t\t\t\t\tCache.setMetaData(src, mdata, isLiveData);\n\t\t\t\t\tresolve();\n\t\t\t\t})\n\t\t\t\t.catch((err) => reject(err));\n\t\t});\n\t}", "title": "" }, { "docid": "c39d9f9f09f65d5e3fef663e8c1b3ef6", "score": "0.5658058", "text": "setOnMetadataUpdate(onMetadataUpdate) {\n this._onMetadataUpdate = onMetadataUpdate;\n }", "title": "" }, { "docid": "add5b356ea442277a04b6a60182724f0", "score": "0.5656232", "text": "@action setMeta(meta = {}) {\n this.meta.merge(meta);\n }", "title": "" }, { "docid": "aa9334573829dc1cc1bc1970838e0c7f", "score": "0.5605991", "text": "get metadata() {\n return this._metadata;\n }", "title": "" }, { "docid": "aa9334573829dc1cc1bc1970838e0c7f", "score": "0.5605991", "text": "get metadata() {\n return this._metadata;\n }", "title": "" }, { "docid": "0e6c18b105783ea1f74dae1724f555c9", "score": "0.5545178", "text": "function updateMetadata$1(ref, metadata) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__awaiter\"])(this, void 0, void 0, function () {\n var authToken, requestInfo;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n ref._throwIfRoot('updateMetadata');\n return [4 /*yield*/, ref.storage._getAuthToken()];\n case 1:\n authToken = _a.sent();\n requestInfo = updateMetadata(ref.storage, ref._location, metadata, getMappings());\n return [2 /*return*/, ref.storage._makeRequest(requestInfo, authToken).getPromise()];\n }\n });\n });\n}", "title": "" }, { "docid": "d3072aad1674d6051c09f9da3cbb7d94", "score": "0.5490457", "text": "addFormMetadata() {\n if (this.nanopub.metadata) {\n // logger.debug('Metadata', this.metadata);\n for (let key in this.metadata) {\n if (key === 'key') {continue;}\n let idx = this.nanopub.metadata.findIndex(obj => obj.name === key);\n\n if (idx >= 0) {\n // logger.debug('Add Metadata Data Key', key, 'Val', this.metadata[key], 'Idx', idx);\n this.nanopub.metadata[idx].value = this.metadata[key];\n } else {\n\n // logger.debug('Add Metadata Key', key, 'Val', this.metadata[key]);\n\n let val = \"\";\n if (this.metadata[key] === undefined) {\n val = \"\";\n }\n else {val = this.metadata[key];}\n\n this.nanopub.metadata.push({'name' : key, 'value': val});\n }\n }\n }\n }", "title": "" }, { "docid": "e90651e7c9e975d49bb7e9b93bbedce4", "score": "0.54750943", "text": "getMetaData() {\n return this.metadata;\n }", "title": "" }, { "docid": "5d6bbba369090c1773a6ea177574493a", "score": "0.5446437", "text": "withMetadata(metadata) {\n this.metadata = metadata;\n return this;\n }", "title": "" }, { "docid": "5d6bbba369090c1773a6ea177574493a", "score": "0.5446437", "text": "withMetadata(metadata) {\n this.metadata = metadata;\n return this;\n }", "title": "" }, { "docid": "4e418abd3b59fd30de524b75b9b139d3", "score": "0.54321593", "text": "function updateMetadata$1(ref, metadata) {\n return _tslib.__awaiter(this, void 0, void 0, function () {\n var requestInfo;\n return _tslib.__generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n ref._throwIfRoot('updateMetadata');\n requestInfo = updateMetadata(ref.storage, ref._location, metadata, getMappings());\n return [4, /*yield*/\n ref.storage.makeRequestWithTokens(requestInfo)];\n case 1:\n return [2, /*return*/\n _a.sent().getPromise()];\n }\n });\n });\n}", "title": "" }, { "docid": "1eb4c46ffd109dc58175fba3c56556ef", "score": "0.54054224", "text": "async function updateMetadata$1(ref, metadata) {\n ref._throwIfRoot('updateMetadata');\n\n const requestInfo = updateMetadata$2(ref.storage, ref._location, metadata, getMappings());\n return (await ref.storage.makeRequestWithTokens(requestInfo)).getPromise();\n}", "title": "" }, { "docid": "2346a3da8b6ac6a183a8f7d6bd3d6cdd", "score": "0.5347937", "text": "function updateMetadata$2(ref, metadata) {\n ref = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_1__.getModularInstance)(ref);\n return updateMetadata$1(ref, metadata);\n}", "title": "" }, { "docid": "012f23874cf46cd6386adab02b6afcbf", "score": "0.53360516", "text": "mergeMetadata() {\n this.name = this.metadata.title || this.nameFromFilepath();\n this.artist = this.metadata.artist[0] || 'Unknown Artist';\n this.album = this.metadata.albumartist[0] || 'Unknown Album';\n }", "title": "" }, { "docid": "84a0cb60765934831cd382a1fe0b4253", "score": "0.5335409", "text": "async populate(meta) {\n if (!meta) meta = await ImageUtil.getMetaData(this.buffer); // eslint-disable-line no-param-reassign\n for (const x in meta) this[x] = meta[x]; // eslint-disable-line guard-for-in\n }", "title": "" }, { "docid": "91a7f214b3bc11fad7e3a7d49b8996ae", "score": "0.52670413", "text": "get metadata() {\n return this._rawMetadata;\n }", "title": "" }, { "docid": "91a7f214b3bc11fad7e3a7d49b8996ae", "score": "0.52670413", "text": "get metadata() {\n return this._rawMetadata;\n }", "title": "" }, { "docid": "fa0faa59e39f59e82d34d28f1ee1b8ab", "score": "0.5228541", "text": "get metadata() {\n\t\treturn this.__metadata;\n\t}", "title": "" }, { "docid": "fa0faa59e39f59e82d34d28f1ee1b8ab", "score": "0.5228541", "text": "get metadata() {\n\t\treturn this.__metadata;\n\t}", "title": "" }, { "docid": "7be684f1b30a3e8368b836d00414c365", "score": "0.52247065", "text": "function updateMetadata$1(ref, metadata) {\n return (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__awaiter)(this, void 0, void 0, function () {\n var requestInfo;\n return (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__generator)(this, function (_a) {\n switch (_a.label) {\n case 0:\n ref._throwIfRoot('updateMetadata');\n requestInfo = updateMetadata(ref.storage, ref._location, metadata, getMappings());\n return [4 /*yield*/, ref.storage.makeRequestWithTokens(requestInfo)];\n case 1: return [2 /*return*/, (_a.sent()).getPromise()];\n }\n });\n });\n}", "title": "" }, { "docid": "73e09149636719d7e1371ac14ab8b9b4", "score": "0.51810247", "text": "function update() {\n var objects = handle.getTelemetryObjects();\n\n // Initialize domain offset if necessary\n if (domainOffset === undefined) {\n initializeDomainOffset(objects.map(function (obj) {\n return handle.getDomainValue(obj, domain);\n }).filter(function (value) {\n return typeof value === 'number';\n }));\n }\n\n // Make sure lines are available\n prepareLines(objects);\n\n // Add new data\n objects.forEach(addPointFor);\n\n // Then, update extrema\n updateBounds();\n }", "title": "" }, { "docid": "b9bea25b316a89864502e57d62a89226", "score": "0.5175031", "text": "function augmentMetadata(name) {\n const data = metadata[name];\n\n if (data.docData === undefined) data.docDate = today;\n\n if (data.thisVersion === undefined) {\n data.thisVersion = `https://www.w3.org/TR/${substitutions.YYYY}/${data.status}-${data.shortname}-${substitutions.DATE}/`;\n }\n\n if (data.latestVersion === undefined) {\n data.latestVersion = `https://www.w3.org/TR/${data.shortname}/`;\n }\n\n if (data.deliverers === undefined) {\n data.deliverers = [{ name: data.groupName, homepage: data.groupHomepage }];\n }\n}", "title": "" }, { "docid": "74779d2826f6628f888531f132fb43e0", "score": "0.51589406", "text": "updateObject(obj) {\n this.storeObject(obj);\n }", "title": "" }, { "docid": "555a4406d2ccadb08e83ae0824115d47", "score": "0.5157107", "text": "function setMetaInformation() {\r\n metaInformationService.reset();\r\n pageTitleService.setPageTitle();\r\n }", "title": "" }, { "docid": "078d49f1aa3c0cfc0cb9af3edeaf8489", "score": "0.5118262", "text": "async updateMeta() {\n\t\tlet stmtMeta = this.db.prepare(`UPDATE \"fleetport-meta\" SET \"lastUpdated\" = ?, \"firstRun\" = ?`);\n\t\tlet infoMeta = stmtMeta.run((+ Date.now()), 0);\n\t\tconsole.log(infoMeta);\n\t}", "title": "" }, { "docid": "b9af2bd032ffc9a8ad2b89deee473007", "score": "0.5095441", "text": "update (data) {\n for(let prop in data) {\n this[prop] = data[prop];\n }\n }", "title": "" }, { "docid": "c2f4cdce796129e83f24057dfa2bd345", "score": "0.5091747", "text": "get metadata() {\n return this._metadata || (this._metadata = Object.create(null));\n }", "title": "" }, { "docid": "c2f4cdce796129e83f24057dfa2bd345", "score": "0.5091747", "text": "get metadata() {\n return this._metadata || (this._metadata = Object.create(null));\n }", "title": "" }, { "docid": "316e223b70f96fefcf94870e213a7b2f", "score": "0.50697744", "text": "extractFormMetadata() {\n for (let key in this.metadata) {\n if (key === 'key') {continue;}\n let idx = this.nanopub.metadata.findIndex(obj => obj.name === key);\n if (idx >= 0) {\n // logger.debug('Extract Metadata Key', idx, 'Val', this.nanopub.metadata[idx]['value']);\n if (this.nanopub.metadata[idx] !== undefined) {\n this.metadata[key] = this.nanopub.metadata[idx]['value'];\n // logger.debug('Loading Metadata Key', key, 'Val', this.metadata[key]);\n }\n }\n }\n // logger.debug('Created Metadata', this.metadata);\n }", "title": "" }, { "docid": "1b6a1e725bbf0291c74968c246e91e02", "score": "0.50659925", "text": "setMetaValue (event) {\n this.setMetaData(event, 'content')\n }", "title": "" }, { "docid": "98ed8a2253fd40f1523b696410164dc8", "score": "0.5056163", "text": "_ensureMetadata() {\n const metadata = this.metadata;\n if (!metadata.has('language_info')) {\n metadata.set('language_info', { name: '' });\n }\n if (!metadata.has('kernelspec')) {\n metadata.set('kernelspec', { name: '', display_name: '' });\n }\n }", "title": "" }, { "docid": "12e8a630a012ebb2231870c24642e549", "score": "0.50520766", "text": "_ensureMetadata() {\n let metadata = this.metadata;\n if (!metadata.has('language_info')) {\n metadata.set('language_info', { name: '' });\n }\n if (!metadata.has('kernelspec')) {\n metadata.set('kernelspec', { name: '', display_name: '' });\n }\n }", "title": "" }, { "docid": "707330db9b912c13a4873fa70e3e7154", "score": "0.5039336", "text": "get metadata() {\r\n return this.modelDB.get('metadata');\r\n }", "title": "" }, { "docid": "a656c6e9047c5cf57fd39e0ac55b3f2a", "score": "0.50392455", "text": "update(propName, data) {\r\n\t\tsuper.update();\r\n\t}", "title": "" }, { "docid": "5918f46293ee5b28a11a718a859f2458", "score": "0.50354356", "text": "function Metadata() {\n\ttry\n\t{\n\t\tvar data = fs.readFileSync(filePath, 'utf8');\n\t\tthis.data = JSON.parse(data);\n\t}\n\tcatch (e)\n\t{\n\t\tthis.data = {};\n\t}\n\tthis.data.start_time = this.data.start_time | default_JSON.start_time;\n}", "title": "" }, { "docid": "5e0024ba588d6d2c1459e53305ca988c", "score": "0.5034517", "text": "function update() {\n var entityMemo = this;\n var props;\n var entity = entityMemo.entity;\n var aspect = entity.entityAspect;\n var stateName = aspect.entityState.name;\n switch (stateName) {\n case 'Added':\n var originalValues = aspect.originalValues;\n props = entity.entityType.dataProperties;\n props.forEach(function (dp) {\n if (dp.isPartOfKey) { return; }\n var name = dp.name;\n var value = entity.getProperty(name);\n if (originalValues[name] !== value) {\n entityMemo.pendingChanges[name] = value;\n }\n });\n break;\n\n case 'Deleted':\n entityMemo.isDeleted = true;\n entityMemo.pendingChanges = {};\n break;\n\n case 'Modified':\n props = Object.keys(aspect.originalValues);\n props.forEach(function (name) {\n entityMemo.pendingChanges[name] = entity.getProperty(name);\n });\n break;\n }\n }", "title": "" }, { "docid": "2552203016c21d41cddd33dab8326c30", "score": "0.5026465", "text": "get metadata() {\n return this.modelDB.get('metadata');\n }", "title": "" }, { "docid": "2552203016c21d41cddd33dab8326c30", "score": "0.5026465", "text": "get metadata() {\n return this.modelDB.get('metadata');\n }", "title": "" }, { "docid": "2552203016c21d41cddd33dab8326c30", "score": "0.5026465", "text": "get metadata() {\n return this.modelDB.get('metadata');\n }", "title": "" }, { "docid": "c5186c5022f3ce542812a4af2fa4c13c", "score": "0.5020035", "text": "async update() {\n await Promise.all(this.files.map(file => file.update()));\n\n this.data.files = this.files.map(file => file.data);\n }", "title": "" }, { "docid": "0dc64c9d8c955f85e8e3e673ba374804", "score": "0.5013469", "text": "setMetadata(options) {\n const operationArguments = {\n options: coreHttp.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, setMetadataOperationSpec);\n }", "title": "" }, { "docid": "0dc64c9d8c955f85e8e3e673ba374804", "score": "0.5013469", "text": "setMetadata(options) {\n const operationArguments = {\n options: coreHttp.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, setMetadataOperationSpec);\n }", "title": "" }, { "docid": "7fd3278c5fee1a50e32e6945d9efcd3d", "score": "0.5005893", "text": "_ensureMetadata() {\r\n let metadata = this.metadata;\r\n if (!metadata.has('language_info')) {\r\n metadata.set('language_info', { name: '' });\r\n }\r\n if (!metadata.has('kernelspec')) {\r\n metadata.set('kernelspec', { name: '', display_name: '' });\r\n }\r\n }", "title": "" }, { "docid": "85142fb06bab2dc30069a9361d31797a", "score": "0.5004395", "text": "function syncMetaData() {\n /*\n\t\t Define the image meta data keys. These are managed separately\n\t\t since we aren't actually changing the inner HTML of these elements.\n\t */\n let imageMetaDataKeys = [\n \"cover_art_url\",\n \"station_art_url\",\n \"podcast_episode_cover_art_url\"\n ];\n\n /*\n\t\t Get all of the song info elements\n\t */\n let songInfoElements = document.querySelectorAll(\n \"[data-amplitude-song-info]\"\n );\n\n /*\n\t\t Iterate over all of the song info elements. We will either\n\t\t set these to the new values, or clear them if the active song\n\t\t doesn't have the info set.\n\t */\n for (let i = 0; i < songInfoElements.length; i++) {\n let songIndex = songInfoElements[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n let playlist = songInfoElements[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (songIndex != null && playlist == null) {\n let info = songInfoElements[i].getAttribute(\"data-amplitude-song-info\");\n\n /*\n Get the song info value referenced on the element. Depending on the type of\n element, we may need to fallback to another value when the direct value\n we want isn't found.\n i.e.\n data-amplitude-song-info=\"cover_art_url\" defaults to using the value\n of \"default_album_art\" when \"cover_art_url\" is missing on the song.\n */\n let val = config.songs[songIndex][info] != undefined ? config.songs[songIndex][info] : null;\n /*\n If it's an image meta data key, then we set the src attribute of\n the element. Otherwise we set the inner HTML of the element.\n */\n if (imageMetaDataKeys.indexOf(info) >= 0) {\n /*\n If this is an image meta data key and the individual song doesn't\n have the key, use the default_album_art\n */\n val = val || config.default_album_art\n songInfoElements[i].setAttribute(\n \"src\",\n val\n );\n } else {\n songInfoElements[i].innerHTML = val;\n }\n }\n\n /*\n If the song index and playlist are not null, continue.\n */\n if (songIndex != null && playlist != null) {\n /*\n Get the info we are displaying.\n */\n let info = songInfoElements[i].getAttribute(\"data-amplitude-song-info\");\n\n /*\n Set the meta data accordingly.\n */\n if (config.playlists[playlist].songs[songIndex][info] != undefined) {\n if (imageMetaDataKeys.indexOf(info) >= 0) {\n songInfoElements[i].setAttribute(\n \"src\",\n config.playlists[playlist].songs[songIndex][info]\n );\n } else {\n songInfoElements[i].innerHTML =\n config.playlists[playlist].songs[songIndex][info];\n }\n }\n }\n }\n\n /*\n Display the playlist meta data.\n */\n displayPlaylistMetaData();\n }", "title": "" }, { "docid": "0dca4673c50a7058bbe21d907a80eecd", "score": "0.50037116", "text": "addMeta(key, value) {\n this.meta[key] = value;\n }", "title": "" }, { "docid": "c16a4bc32894b59de2d192df743f88db", "score": "0.4992291", "text": "function setImageMetadata(imageProperty) {\n const image = {\n name: imageProperty.name,\n dateCreated: Date.now(),\n size: imageProperty.size,\n url: imageProperty.url\n };\n return imageModel.create(image);\n}", "title": "" }, { "docid": "ab670ddb0cf82bcc878810625d06ee63", "score": "0.49903956", "text": "updated(_changedProperties) { }", "title": "" }, { "docid": "699fc47f435b635981e4d7aca12c0514", "score": "0.4976556", "text": "getMetadata () {\n return this.metadata\n }", "title": "" }, { "docid": "84a21a8d62af6ac1f3b2838bbfdb7fd5", "score": "0.49694368", "text": "updateInformation() {\n this.updateLastSignOfLife();\n }", "title": "" }, { "docid": "464465f6e982e0fb867b777538b83407", "score": "0.49484318", "text": "function update() {\n\t\tvar notification = Notification.display('Updating ' + this.description + '.', false);\n\t\tthis.$update(postUpdate);\t\n\t}", "title": "" }, { "docid": "0b554fdb50d4e81fd2eda10908e64302", "score": "0.49454588", "text": "updated(_changedProperties) {}", "title": "" }, { "docid": "0b554fdb50d4e81fd2eda10908e64302", "score": "0.49454588", "text": "updated(_changedProperties) {}", "title": "" }, { "docid": "0b554fdb50d4e81fd2eda10908e64302", "score": "0.49454588", "text": "updated(_changedProperties) {}", "title": "" }, { "docid": "6e03ed99779c511bc1bed90f914ed092", "score": "0.49405965", "text": "getMetadata(object) {\n const phetioObjectMetadata = super.getMetadata(object);\n delete phetioObjectMetadata.phetioFeatured;\n return phetioObjectMetadata;\n }", "title": "" }, { "docid": "3083017e0ffbc0c32afc5c9727bf030f", "score": "0.4938967", "text": "function updateMetaData(projectName, componentName, metaData) {\n var kosmoBucket = program.getKosmoBucket();\n var s3 = new AWS.S3({ region: kosmoBucket.region });\n\n var latestMetaKeyPath = path.join(\n 'meta',\n projectName,\n 'templates',\n componentName,\n 'latest.json'\n );\n var getObject = utils.pbind(s3.getObject, s3, {\n Bucket: kosmoBucket.name,\n Key: latestMetaKeyPath,\n });\n return getObject().then(data => {\n return JSON.parse(data.Body.toString());\n }, err => {\n if (err.code === 'NoSuchKey') {\n return '';\n }\n throw err;\n }).then(previousMeta => {\n if (previousMeta) {\n metaData.previousMeta = `meta/${projectName}/templates/${componentName}/${previousMeta.timestamp}.json`;\n }\n\n var upload = utils.pbind(s3.upload, s3);\n\n var uploadLatestPromise = upload({\n Bucket: kosmoBucket.name,\n Key: latestMetaKeyPath,\n Body: JSON.stringify(metaData, null, 2),\n });\n\n var uploadPreviousPromise = previousMeta\n ? upload({\n Bucket: kosmoBucket.name,\n Key: metaData.previousMeta,\n Body: JSON.stringify(previousMeta, null, 2),\n })\n : null;\n\n return Promise.all(_.compact([uploadLatestPromise, uploadPreviousPromise]));\n });\n}", "title": "" }, { "docid": "ab6cd4a38c6c3a12df8e17a088735d08", "score": "0.49375802", "text": "update(updateObject) {\n let job = this\n\n // Just finished -- move job source to the \"ready\" folder and resume status update\n if (updateObject.status === 'ready' && job.status != updateObject.status) {\n const sourcepath = job.path()\n\n job.status = 'ready';\n const readypath = job.path()\n\n return fs.move(sourcepath, readypath)\n .then( _ => job.update(updateObject))\n // Return the job so te result is available/chainable\n .then( _ => job )\n }\n\n // Update Job metadata\n job = Object.assign(job, updateObject)\n\n const jobid = job.id\n const sourcepath = path.join(job.status === 'ready' ? DIR_JOBS_READY : DIR_JOBS_PENDING, jobid, 'job.json')\n\n // Write updated metadata to the filesystem\n return fs.outputJson(sourcepath, job).then( _ => job)\n }", "title": "" }, { "docid": "653916ef40d17f15a14d9ceeceba51ad", "score": "0.49330592", "text": "function updateMeta(meta, min) {\r\n var exists = false,\r\n stat = fs.statSync(min);\r\n meta.size = stat.size;\r\n\r\n // get gzip size\r\n gzip(fs.readFileSync(min), function(err, data) {\r\n\r\n if (err) {\r\n console.log(message.GZIP_NOT_SUPPORTED);\r\n return;\r\n }\r\n meta.gzipped = data.length;\r\n console.log('%s is gzipped, size: %s', meta.name, meta.gzipped);\r\n\r\n metaData.forEach(function(m, i) {\r\n if (m.name === meta.name) {\r\n metaData[i] = meta;\r\n exists = true;\r\n }\r\n });\r\n if (!exists)\r\n metaData.push(meta);\r\n\r\n console.log('Update into registry %s', meta.name);\r\n registry.update(metaData, true);\r\n\r\n });\r\n}", "title": "" }, { "docid": "75f018a3e000eddbf395d931d4106ca9", "score": "0.49036846", "text": "patchMetadata(profile) {\n axios({\n method: 'PATCH',\n url: `https://connorzg.auth0.com/api/v2/users/${profile.user_id}`,\n headers: { authorization: `Bearer ${this.props.idToken}` },\n data: {\n user_metadata: {\n name: profile.user_metadata.name || profile.name,\n picture: profile.user_metadata.picture || profile.picture,\n description: profile.user_metadata.description || ''\n }\n }\n }).then((res) => {\n this.setState({profile: res.data}, () => {\n // Refresh user profiles and hide the form after setting current user\n this.setState({ editMode: false });\n this.getAllUsers();\n });\n });\n }", "title": "" }, { "docid": "0f25dc424b96e30439da519ae8a5c41b", "score": "0.4901485", "text": "onMetadataChanged(sender, args) {\r\n switch (args.key) {\r\n case 'language_info':\r\n this._updateMimetype();\r\n break;\r\n default:\r\n break;\r\n }\r\n }", "title": "" }, { "docid": "2d587a2fa7e275ad4236aabe4ce371eb", "score": "0.4901047", "text": "update (properties, children) {\n\n // perform custom update logic here...\n this.properties = properties;\n this.children = children;\n\n // then call `etch.update`, which is async and returns a promise\n return etch.update(this)\n }", "title": "" }, { "docid": "281bc2ef48267e90a1e5e05b1c6fd5ce", "score": "0.48974478", "text": "function updateAllPropertyInfoTimeStamp() { this.timeStamp = new Date().getTime(); }", "title": "" }, { "docid": "79c31c52512936d810a0f271f0887464", "score": "0.4896696", "text": "@upload\n @route('PUT', '/api/meds/{id}')\n update(request, reply) {\n super.update({\n id : request.params.id,\n data: request.payload\n }, (err, model) => {\n if (err) console.log(err);\n reply(err || model);\n });\n }", "title": "" }, { "docid": "bd177837c9f21896ee42914b3e0d27ac", "score": "0.4890929", "text": "function updateAugmentaObject (object,message) \n{\n\tvar msg = JSON.parse(message);\n\n\tobject.hasData.set(true);\n\tobject.frame.set(msg.object.update.frame);\n\tobject.id.set(msg.object.update.id);\n\tobject.oid.set(msg.object.update.oid);\n\tobject.age.set(msg.object.update.age);\n\tobject.centroid.set(msg.object.update.centroid.x, msg.object.update.centroid.y);\n\tobject.velocity.set(msg.object.update.velocity.x, msg.object.update.velocity.y);\n\tobject.orientation.set(msg.object.update.orientation);\n\tobject.boundingRectCoord.set(msg.object.update.boundingRect.x, msg.object.update.boundingRect.y);\n\tobject.boundingRectWidth.set(msg.object.update.boundingRect.width);\n\tobject.boundingRectHeight.set(msg.object.update.boundingRect.height);\n\tobject.boundingRectRotation.set(msg.object.update.orientation); // different from orientation ?\n\tobject.height.set(msg.object.update.height);\n}", "title": "" }, { "docid": "c891a5268ca944665f5ffe5f9aa3b4b6", "score": "0.4888257", "text": "_updateProperties() {\n // console.log('MarkersManager._updateProperties()')\n Object.keys(this._dirtyProps).forEach((path) => {\n let textProperties = this._textProperties[path]\n if (textProperties) {\n textProperties.forEach(this._updateTextProperty.bind(this))\n }\n })\n this._dirtyProps = {}\n }", "title": "" }, { "docid": "0ff04dcd6412f9ca566a0b2750a717ba", "score": "0.48855916", "text": "updateInfo(state) {\n const metaData = this.props.metaData\n this.props.dispatch(updateContactData(metaData, state))\n }", "title": "" }, { "docid": "c6a7ad75817ae792f9926940050a9d30", "score": "0.4873142", "text": "refresh() {\n this._createdAt = this._lastUpdatedAt;\n }", "title": "" }, { "docid": "83bd2474c27794f57729c15545e79b7b", "score": "0.48535308", "text": "function serviceUpdateModel(req, resp) {\n\t\tlogger.info(\"<Service> UpdateModel.\");\n\t\tvar objectsData = parseRequest(req, ['id', 'name', 'file', 'creator', 'creationDate', 'thumbnail', 'tags']);\n\t\t\n\t\twriteHeaders(resp);\n\t\tupdateModel(objectsData.id, objectsData.name, objectsData.file, objectsData.creator, objectsData.creationDate, objectsData.thumbnail, objectsData.tags, function(err, status) {\n\t\t\tif (err) error(2, resp);\n\t\t\telse resp.end(JSON.stringify({ status: status })); \n\t\t});\n\t}", "title": "" }, { "docid": "9840ea63904d7d1ab515527ac3da6007", "score": "0.48532018", "text": "function _insertPadMetaData(padId, obj) {\n appjet.requestCache.pads.meta.put(padId, obj);\n}", "title": "" }, { "docid": "166a357255490ef0dd2f0c5505c39da4", "score": "0.48516285", "text": "setAll(newAttrs) {\n\n for (const key of Object.keys(newAttrs)) {\n this[key] = newAttrs[key];\n }\n }", "title": "" }, { "docid": "a89fbadfa228c6a5d0db308116ea96c3", "score": "0.4848906", "text": "update(){}", "title": "" }, { "docid": "b7065763e7cd377008718d6694d92a2b", "score": "0.48471466", "text": "function migrateMetadata(txn) {\n\n function decodeMetadataCompat(storedObject) {\n if (!storedObject.data) {\n // old format, when we didn't store it stringified\n storedObject.deletedOrLocal = storedObject.deletedOrLocal === '1';\n return storedObject;\n }\n return decodeMetadata(storedObject);\n }\n\n // ensure that every metadata has a winningRev and seq,\n // which was previously created on-the-fly but better to migrate\n var bySeqStore = txn.objectStore(BY_SEQ_STORE);\n var docStore = txn.objectStore(DOC_STORE);\n var cursor = docStore.openCursor();\n cursor.onsuccess = function (e) {\n var cursor = e.target.result;\n if (!cursor) {\n return; // done\n }\n var metadata = decodeMetadataCompat(cursor.value);\n\n metadata.winningRev = metadata.winningRev || merge.winningRev(metadata);\n\n function fetchMetadataSeq() {\n // metadata.seq was added post-3.2.0, so if it's missing,\n // we need to fetch it manually\n var start = metadata.id + '::';\n var end = metadata.id + '::\\uffff';\n var req = bySeqStore.index('_doc_id_rev').openCursor(\n IDBKeyRange.bound(start, end));\n\n var metadataSeq = 0;\n req.onsuccess = function (e) {\n var cursor = e.target.result;\n if (!cursor) {\n metadata.seq = metadataSeq;\n return onGetMetadataSeq();\n }\n var seq = cursor.primaryKey;\n if (seq > metadataSeq) {\n metadataSeq = seq;\n }\n cursor[\"continue\"]();\n };\n }\n\n function onGetMetadataSeq() {\n var metadataToStore = encodeMetadata(metadata,\n metadata.winningRev, metadata.deletedOrLocal);\n\n var req = docStore.put(metadataToStore);\n req.onsuccess = function () {\n cursor[\"continue\"]();\n };\n }\n\n if (metadata.seq) {\n return onGetMetadataSeq();\n }\n\n fetchMetadataSeq();\n };\n\n }", "title": "" }, { "docid": "302c0258ea03ba6ad41f8a6bb784083f", "score": "0.4831145", "text": "function doUpdate(){\n UnitOfMeasureManagerAbstract.super_.prototype.updateItem.call(self, obj, cb);\n }", "title": "" }, { "docid": "949480eca56aeb81503c858f6203225f", "score": "0.48254955", "text": "setDetailsFromFileMetadata() {\n if (!this.audioFiles.length) return false\n var audioFile = this.audioFiles[0]\n return this.book.setDetailsFromFileMetadata(audioFile.metadata)\n }", "title": "" }, { "docid": "15c631f891edca859347da17b874b387", "score": "0.4823487", "text": "function updateObjectDescription(currentObject, itemData){\n\t \tvar item = doc.content[currentObject.id];\n\t \titem.description = new Description(itemData.title, itemData.tags, itemData.text);\n\t }", "title": "" }, { "docid": "6f21fe7a8f35adf50a3eb3ef13b6b636", "score": "0.48220307", "text": "update(obj){\n \n }", "title": "" }, { "docid": "7834d4cf5cd0478438c6343110ef4a19", "score": "0.48197103", "text": "async update(id, attrs) {\n const records = await this.getAll();\n const record = records.find(record => record.id === id);\n if (!record) {\n throw new Error(`Record with id ${id} not found`);\n }\n Object.assign(record, attrs); // Assign the specified record-object a new set of attrs\n await this.writeAll(records);\n }", "title": "" }, { "docid": "c112b2c7b645981f80add33246b1f3b5", "score": "0.48180172", "text": "function migrateMetadata(txn) {\n\n function decodeMetadataCompat(storedObject) {\n if (!storedObject.data) {\n // old format, when we didn't store it stringified\n storedObject.deleted = storedObject.deletedOrLocal === '1';\n return storedObject;\n }\n return decodeMetadata(storedObject);\n }\n\n // ensure that every metadata has a winningRev and seq,\n // which was previously created on-the-fly but better to migrate\n var bySeqStore = txn.objectStore(BY_SEQ_STORE);\n var docStore = txn.objectStore(DOC_STORE);\n var cursor = docStore.openCursor();\n cursor.onsuccess = function (e) {\n var cursor = e.target.result;\n if (!cursor) {\n return; // done\n }\n var metadata = decodeMetadataCompat(cursor.value);\n\n metadata.winningRev = metadata.winningRev || merge.winningRev(metadata);\n\n function fetchMetadataSeq() {\n // metadata.seq was added post-3.2.0, so if it's missing,\n // we need to fetch it manually\n var start = metadata.id + '::';\n var end = metadata.id + '::\\uffff';\n var req = bySeqStore.index('_doc_id_rev').openCursor(\n IDBKeyRange.bound(start, end));\n\n var metadataSeq = 0;\n req.onsuccess = function (e) {\n var cursor = e.target.result;\n if (!cursor) {\n metadata.seq = metadataSeq;\n return onGetMetadataSeq();\n }\n var seq = cursor.primaryKey;\n if (seq > metadataSeq) {\n metadataSeq = seq;\n }\n cursor.continue();\n };\n }\n\n function onGetMetadataSeq() {\n var metadataToStore = encodeMetadata(metadata,\n metadata.winningRev, metadata.deleted);\n\n var req = docStore.put(metadataToStore);\n req.onsuccess = function () {\n cursor.continue();\n };\n }\n\n if (metadata.seq) {\n return onGetMetadataSeq();\n }\n\n fetchMetadataSeq();\n };\n\n }", "title": "" }, { "docid": "ccab72b57eea4d8f000463bc9cfb739d", "score": "0.48173815", "text": "updated() {\n this.getData();\n }", "title": "" }, { "docid": "fe5891674a66e155f89539a86350785a", "score": "0.481275", "text": "function migrateMetadata(txn) {\n\n function decodeMetadataCompat(storedObject) {\n if (!storedObject.data) {\n // old format, when we didn't store it stringified\n storedObject.deleted = storedObject.deletedOrLocal === '1';\n return storedObject;\n }\n return decodeMetadata(storedObject);\n }\n\n // ensure that every metadata has a winningRev and seq,\n // which was previously created on-the-fly but better to migrate\n var bySeqStore = txn.objectStore(BY_SEQ_STORE);\n var docStore = txn.objectStore(DOC_STORE);\n var cursor = docStore.openCursor();\n cursor.onsuccess = function (e) {\n var cursor = e.target.result;\n if (!cursor) {\n return; // done\n }\n var metadata = decodeMetadataCompat(cursor.value);\n\n metadata.winningRev = metadata.winningRev ||\n calculateWinningRev(metadata);\n\n function fetchMetadataSeq() {\n // metadata.seq was added post-3.2.0, so if it's missing,\n // we need to fetch it manually\n var start = metadata.id + '::';\n var end = metadata.id + '::\\uffff';\n var req = bySeqStore.index('_doc_id_rev').openCursor(\n IDBKeyRange.bound(start, end));\n\n var metadataSeq = 0;\n req.onsuccess = function (e) {\n var cursor = e.target.result;\n if (!cursor) {\n metadata.seq = metadataSeq;\n return onGetMetadataSeq();\n }\n var seq = cursor.primaryKey;\n if (seq > metadataSeq) {\n metadataSeq = seq;\n }\n cursor.continue();\n };\n }\n\n function onGetMetadataSeq() {\n var metadataToStore = encodeMetadata(metadata,\n metadata.winningRev, metadata.deleted);\n\n var req = docStore.put(metadataToStore);\n req.onsuccess = function () {\n cursor.continue();\n };\n }\n\n if (metadata.seq) {\n return onGetMetadataSeq();\n }\n\n fetchMetadataSeq();\n };\n\n }", "title": "" }, { "docid": "fe5891674a66e155f89539a86350785a", "score": "0.481275", "text": "function migrateMetadata(txn) {\n\n function decodeMetadataCompat(storedObject) {\n if (!storedObject.data) {\n // old format, when we didn't store it stringified\n storedObject.deleted = storedObject.deletedOrLocal === '1';\n return storedObject;\n }\n return decodeMetadata(storedObject);\n }\n\n // ensure that every metadata has a winningRev and seq,\n // which was previously created on-the-fly but better to migrate\n var bySeqStore = txn.objectStore(BY_SEQ_STORE);\n var docStore = txn.objectStore(DOC_STORE);\n var cursor = docStore.openCursor();\n cursor.onsuccess = function (e) {\n var cursor = e.target.result;\n if (!cursor) {\n return; // done\n }\n var metadata = decodeMetadataCompat(cursor.value);\n\n metadata.winningRev = metadata.winningRev ||\n calculateWinningRev(metadata);\n\n function fetchMetadataSeq() {\n // metadata.seq was added post-3.2.0, so if it's missing,\n // we need to fetch it manually\n var start = metadata.id + '::';\n var end = metadata.id + '::\\uffff';\n var req = bySeqStore.index('_doc_id_rev').openCursor(\n IDBKeyRange.bound(start, end));\n\n var metadataSeq = 0;\n req.onsuccess = function (e) {\n var cursor = e.target.result;\n if (!cursor) {\n metadata.seq = metadataSeq;\n return onGetMetadataSeq();\n }\n var seq = cursor.primaryKey;\n if (seq > metadataSeq) {\n metadataSeq = seq;\n }\n cursor.continue();\n };\n }\n\n function onGetMetadataSeq() {\n var metadataToStore = encodeMetadata(metadata,\n metadata.winningRev, metadata.deleted);\n\n var req = docStore.put(metadataToStore);\n req.onsuccess = function () {\n cursor.continue();\n };\n }\n\n if (metadata.seq) {\n return onGetMetadataSeq();\n }\n\n fetchMetadataSeq();\n };\n\n }", "title": "" }, { "docid": "1eb95cc581d3c75c868826629ecbb697", "score": "0.4812705", "text": "function migrateMetadata(txn) {\n\n function decodeMetadataCompat(storedObject) {\n if (!storedObject.data) {\n // old format, when we didn't store it stringified\n storedObject.deleted = storedObject.deletedOrLocal === '1';\n return storedObject;\n }\n return decodeMetadata(storedObject);\n }\n\n // ensure that every metadata has a winningRev and seq,\n // which was previously created on-the-fly but better to migrate\n var bySeqStore = txn.objectStore(BY_SEQ_STORE);\n var docStore = txn.objectStore(DOC_STORE);\n var cursor = docStore.openCursor();\n cursor.onsuccess = function (e) {\n var cursor = e.target.result;\n if (!cursor) {\n return; // done\n }\n var metadata = decodeMetadataCompat(cursor.value);\n\n metadata.winningRev = metadata.winningRev ||\n winningRev(metadata);\n\n function fetchMetadataSeq() {\n // metadata.seq was added post-3.2.0, so if it's missing,\n // we need to fetch it manually\n var start = metadata.id + '::';\n var end = metadata.id + '::\\uffff';\n var req = bySeqStore.index('_doc_id_rev').openCursor(\n IDBKeyRange.bound(start, end));\n\n var metadataSeq = 0;\n req.onsuccess = function (e) {\n var cursor = e.target.result;\n if (!cursor) {\n metadata.seq = metadataSeq;\n return onGetMetadataSeq();\n }\n var seq = cursor.primaryKey;\n if (seq > metadataSeq) {\n metadataSeq = seq;\n }\n cursor[\"continue\"]();\n };\n }\n\n function onGetMetadataSeq() {\n var metadataToStore = encodeMetadata(metadata,\n metadata.winningRev, metadata.deleted);\n\n var req = docStore.put(metadataToStore);\n req.onsuccess = function () {\n cursor[\"continue\"]();\n };\n }\n\n if (metadata.seq) {\n return onGetMetadataSeq();\n }\n\n fetchMetadataSeq();\n };\n\n }", "title": "" }, { "docid": "2ffb1239cd69571fa01d6ef13a89e4e9", "score": "0.4812595", "text": "update(_changedProperties) {\n if (this.__reflectingProperties !== undefined) {\n // Use forEach so this works even if for/of loops are compiled to for\n // loops expecting arrays\n this.__reflectingProperties.forEach((v, k) => this.__propertyToAttribute(k, this[k], v));\n this.__reflectingProperties = undefined;\n }\n this.__markUpdated();\n }", "title": "" }, { "docid": "f8eb39b840d56866e7b35b68a962355d", "score": "0.4808084", "text": "function migrateMetadata(txn) {\n\n function decodeMetadataCompat(storedObject) {\n if (!storedObject.data) {\n // old format, when we didn't store it stringified\n storedObject.deleted = storedObject.deletedOrLocal === '1';\n return storedObject;\n }\n return decodeMetadata(storedObject);\n }\n\n // ensure that every metadata has a winningRev and seq,\n // which was previously created on-the-fly but better to migrate\n var bySeqStore = txn.objectStore(BY_SEQ_STORE);\n var docStore = txn.objectStore(DOC_STORE);\n var cursor = docStore.openCursor();\n cursor.onsuccess = function (e) {\n var cursor = e.target.result;\n if (!cursor) {\n return; // done\n }\n var metadata = decodeMetadataCompat(cursor.value);\n\n metadata.winningRev = metadata.winningRev ||\n winningRev(metadata);\n\n function fetchMetadataSeq() {\n // metadata.seq was added post-3.2.0, so if it's missing,\n // we need to fetch it manually\n var start = metadata.id + '::';\n var end = metadata.id + '::\\uffff';\n var req = bySeqStore.index('_doc_id_rev').openCursor(\n IDBKeyRange.bound(start, end));\n\n var metadataSeq = 0;\n req.onsuccess = function (e) {\n var cursor = e.target.result;\n if (!cursor) {\n metadata.seq = metadataSeq;\n return onGetMetadataSeq();\n }\n var seq = cursor.primaryKey;\n if (seq > metadataSeq) {\n metadataSeq = seq;\n }\n cursor.continue();\n };\n }\n\n function onGetMetadataSeq() {\n var metadataToStore = encodeMetadata(metadata,\n metadata.winningRev, metadata.deleted);\n\n var req = docStore.put(metadataToStore);\n req.onsuccess = function () {\n cursor.continue();\n };\n }\n\n if (metadata.seq) {\n return onGetMetadataSeq();\n }\n\n fetchMetadataSeq();\n };\n\n }", "title": "" }, { "docid": "f8eb39b840d56866e7b35b68a962355d", "score": "0.4808084", "text": "function migrateMetadata(txn) {\n\n function decodeMetadataCompat(storedObject) {\n if (!storedObject.data) {\n // old format, when we didn't store it stringified\n storedObject.deleted = storedObject.deletedOrLocal === '1';\n return storedObject;\n }\n return decodeMetadata(storedObject);\n }\n\n // ensure that every metadata has a winningRev and seq,\n // which was previously created on-the-fly but better to migrate\n var bySeqStore = txn.objectStore(BY_SEQ_STORE);\n var docStore = txn.objectStore(DOC_STORE);\n var cursor = docStore.openCursor();\n cursor.onsuccess = function (e) {\n var cursor = e.target.result;\n if (!cursor) {\n return; // done\n }\n var metadata = decodeMetadataCompat(cursor.value);\n\n metadata.winningRev = metadata.winningRev ||\n winningRev(metadata);\n\n function fetchMetadataSeq() {\n // metadata.seq was added post-3.2.0, so if it's missing,\n // we need to fetch it manually\n var start = metadata.id + '::';\n var end = metadata.id + '::\\uffff';\n var req = bySeqStore.index('_doc_id_rev').openCursor(\n IDBKeyRange.bound(start, end));\n\n var metadataSeq = 0;\n req.onsuccess = function (e) {\n var cursor = e.target.result;\n if (!cursor) {\n metadata.seq = metadataSeq;\n return onGetMetadataSeq();\n }\n var seq = cursor.primaryKey;\n if (seq > metadataSeq) {\n metadataSeq = seq;\n }\n cursor.continue();\n };\n }\n\n function onGetMetadataSeq() {\n var metadataToStore = encodeMetadata(metadata,\n metadata.winningRev, metadata.deleted);\n\n var req = docStore.put(metadataToStore);\n req.onsuccess = function () {\n cursor.continue();\n };\n }\n\n if (metadata.seq) {\n return onGetMetadataSeq();\n }\n\n fetchMetadataSeq();\n };\n\n }", "title": "" }, { "docid": "158ef4608394ed749d65e0a99a1dc531", "score": "0.48038146", "text": "update() {\n var protocard = CardIndex[this.index];\n for(var prop in protocard) {\n if('prop' !== 'name') {\n this[prop] = protocard[prop]; //Copies over the properties from the protocard\n }\n }\n if(protocard !== undefined)\n this.original_name = protocard['name'];\n }", "title": "" }, { "docid": "80a97850892e7357aa1e93f79bf183ce", "score": "0.47890633", "text": "setMeta(meta) {\n if (meta instanceof Array) {\n meta.map(val => { this.meta.updateTag(val); });\n }\n else {\n this.meta.updateTag(meta);\n }\n }", "title": "" }, { "docid": "1bed59f9b41f57a873374f7636b305a1", "score": "0.47772223", "text": "_updateMeta(param){\n\t\tthis.label = param.label;\n\t\tthis.startTime=param.startTime;\n\t\tthis.endTime = param.endTime;\n\t\tthis.desc = param.desc || '';\n\t\tthis.exp = param.exp || '';\n\t\tthis.markColor = param.markColor || 6076508;\n\t\tthis.priority = param.priority || 0;\n\t\tthis.privacy = param.privacy || 0;\n\t\tthis.attachment = Attachments.create(param.attachment);\n\t\tthis.subtasks = Subtasks.create(param.subtask);\n\t\tthis.creatorId = param.creatorId;\n\t\t\n\t\tif(param.template){\n\t\t\tthis.template = TemplateFactory.create(param.template);\n\t\t}\n\n\t\t//todo: bad.\n\t\t/*this.statical = (function(templateType){\n\t\t\tvar returnValue = ['duration'];\n \t\t\tswitch(templateType){\n \t\t\t\tcase 0: //normal\n\t\t\t\tcase 1: //ewo\n\t\t\t\tcase 2: //hot issue\n\t\t\t\tcase 4:\n\t\t\t\tcase 5:\n\t\t\t\tcase 6:\n\t\t\t\tcase 7:\n\t\t\t\t\treturn returnValue;\n\t\t\t\tcase 3: //mule\n\t\t\t\t\treturn returnValue.concat([\"template.param.bp.value\", \"template.param.heavy.value\", \"template.param.snorkelNoiseXls\"]);\n \t\t\t}\n\t\t})(param.template.type);*/\n\t\tthis.statical = [\"duration\"];\n\n\n\n\t\t/**\n\t\t** property used in spread sheet.\n\t\t**/\n\t\tthis.startWeek = param.startWeek || 0;\n\t\tthis.endWeek = param.endWeek || 0;\n\n\t}", "title": "" }, { "docid": "be13cddf2a793cb740ac2f4136ac9a60", "score": "0.4771604", "text": "async update(props) {\n // can not update relationship properties\n if (Object.keys(props).some((key) => {\n const root = key.split(\".\")[0];\n return this.META.property(root).isRelationship;\n })) {\n const relProps = Object.keys(props).filter((p) => this.META.property(p).isRelationship);\n const e = new Error(`You called update on a hash which has relationships included in it. Please only use \"update\" for updating properties. The relationships you were attempting to update were: ${relProps.join(\", \")}.`);\n e.name = \"FireModel::NotAllowed\";\n throw e;\n }\n const lastUpdated = new Date().getTime();\n const changed = Object.assign({}, props, { lastUpdated });\n await this._updateProps(index_1.FMEvents.RECORD_CHANGED_LOCALLY, index_1.FMEvents.RECORD_CHANGED, changed);\n return;\n }", "title": "" }, { "docid": "03c77bed9a18993f1e1bbbc009ff2f22", "score": "0.47690496", "text": "function UpdateMetaDirective($log, updateAttribute) {\n\n return {\n restrict: 'E',\n scope: {\n charset: '@',\n name: '@',\n content: '@',\n httpEquiv: '@',\n scheme: '@',\n property: '@',\n itemprop: '@'\n },\n link: function(scope, iElem, iAttrs) {\n var selector;\n\n if(scope.name) {\n selector = 'meta[name=\"' + scope.name + '\"]';\n }\n\n if(scope.httpEquiv) {\n selector = 'meta[http-equiv=\"' + scope.httpEquiv + '\"]';\n }\n\n if(scope.property) {\n selector = 'meta[property=\"' + scope.property + '\"]';\n }\n\n if(scope.itemprop) {\n selector = 'meta[itemprop=\"' + scope.itemprop + '\"]';\n }\n\n // watch the content parameter and set the changing value as needed\n scope.$watch('content', function (newValue, oldValue) {\n if (typeof newValue !== 'undefined') {\n updateAttribute.update(selector, 'content', scope.content);\n }\n });\n\n // watch the charset parameter and set it as needed\n scope.$watch('charset', function (newValue, oldValue) {\n if (typeof newValue !== 'undefined') {\n updateAttribute.update('meta[charset]', 'charset', scope.charset);\n }\n });\n }\n };\n }", "title": "" } ]
3eb127b6266caabec87df3e1c90c345d
Get term.js options from ITerminalOptions.
[ { "docid": "88c839e128b87cbbfeccd5ec663c4922", "score": "0.59702593", "text": "function getConfig(options) {\n let config = {};\n if (options.cursorBlink !== void 0) {\n config.cursorBlink = options.cursorBlink;\n }\n else {\n config.cursorBlink = Terminal.defaultOptions.cursorBlink;\n }\n if (options.fontSize !== void 0) {\n config.fontSize = options.fontSize;\n }\n else {\n config.fontSize = Terminal.defaultOptions.fontSize;\n }\n return config;\n }", "title": "" } ]
[ { "docid": "2ae642d43986a9bcbc0a0c0f807bd334", "score": "0.6104782", "text": "get options() {\n return Object.assign(CliCommand.defaultOptions(), this.specificOptions);\n }", "title": "" }, { "docid": "a9970f951e58210a0224768b43774be3", "score": "0.59984136", "text": "function getOctokitOptions(token, options) {\n const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller\n // Auth\n const auth = Utils.getAuthString(token, opts);\n if (auth) {\n opts.auth = auth;\n }\n return opts;\n}", "title": "" }, { "docid": "a9970f951e58210a0224768b43774be3", "score": "0.59984136", "text": "function getOctokitOptions(token, options) {\n const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller\n // Auth\n const auth = Utils.getAuthString(token, opts);\n if (auth) {\n opts.auth = auth;\n }\n return opts;\n}", "title": "" }, { "docid": "a9970f951e58210a0224768b43774be3", "score": "0.59984136", "text": "function getOctokitOptions(token, options) {\n const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller\n // Auth\n const auth = Utils.getAuthString(token, opts);\n if (auth) {\n opts.auth = auth;\n }\n return opts;\n}", "title": "" }, { "docid": "a9970f951e58210a0224768b43774be3", "score": "0.59984136", "text": "function getOctokitOptions(token, options) {\n const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller\n // Auth\n const auth = Utils.getAuthString(token, opts);\n if (auth) {\n opts.auth = auth;\n }\n return opts;\n}", "title": "" }, { "docid": "a9970f951e58210a0224768b43774be3", "score": "0.59984136", "text": "function getOctokitOptions(token, options) {\n const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller\n // Auth\n const auth = Utils.getAuthString(token, opts);\n if (auth) {\n opts.auth = auth;\n }\n return opts;\n}", "title": "" }, { "docid": "a9970f951e58210a0224768b43774be3", "score": "0.59984136", "text": "function getOctokitOptions(token, options) {\n const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller\n // Auth\n const auth = Utils.getAuthString(token, opts);\n if (auth) {\n opts.auth = auth;\n }\n return opts;\n}", "title": "" }, { "docid": "a9970f951e58210a0224768b43774be3", "score": "0.59984136", "text": "function getOctokitOptions(token, options) {\n const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller\n // Auth\n const auth = Utils.getAuthString(token, opts);\n if (auth) {\n opts.auth = auth;\n }\n return opts;\n}", "title": "" }, { "docid": "a9970f951e58210a0224768b43774be3", "score": "0.59984136", "text": "function getOctokitOptions(token, options) {\n const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller\n // Auth\n const auth = Utils.getAuthString(token, opts);\n if (auth) {\n opts.auth = auth;\n }\n return opts;\n}", "title": "" }, { "docid": "a9970f951e58210a0224768b43774be3", "score": "0.59984136", "text": "function getOctokitOptions(token, options) {\n const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller\n // Auth\n const auth = Utils.getAuthString(token, opts);\n if (auth) {\n opts.auth = auth;\n }\n return opts;\n}", "title": "" }, { "docid": "a9970f951e58210a0224768b43774be3", "score": "0.59984136", "text": "function getOctokitOptions(token, options) {\n const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller\n // Auth\n const auth = Utils.getAuthString(token, opts);\n if (auth) {\n opts.auth = auth;\n }\n return opts;\n}", "title": "" }, { "docid": "a9970f951e58210a0224768b43774be3", "score": "0.59984136", "text": "function getOctokitOptions(token, options) {\n const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller\n // Auth\n const auth = Utils.getAuthString(token, opts);\n if (auth) {\n opts.auth = auth;\n }\n return opts;\n}", "title": "" }, { "docid": "a9970f951e58210a0224768b43774be3", "score": "0.59984136", "text": "function getOctokitOptions(token, options) {\n const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller\n // Auth\n const auth = Utils.getAuthString(token, opts);\n if (auth) {\n opts.auth = auth;\n }\n return opts;\n}", "title": "" }, { "docid": "a9970f951e58210a0224768b43774be3", "score": "0.59984136", "text": "function getOctokitOptions(token, options) {\n const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller\n // Auth\n const auth = Utils.getAuthString(token, opts);\n if (auth) {\n opts.auth = auth;\n }\n return opts;\n}", "title": "" }, { "docid": "a9970f951e58210a0224768b43774be3", "score": "0.59984136", "text": "function getOctokitOptions(token, options) {\n const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller\n // Auth\n const auth = Utils.getAuthString(token, opts);\n if (auth) {\n opts.auth = auth;\n }\n return opts;\n}", "title": "" }, { "docid": "d05d3b6381c349a558dc69521ba87de8", "score": "0.59099025", "text": "constructor(options = {}) {\n super();\n this._needsResize = true;\n this._theme = 'dark';\n this._session = null;\n this._termOpened = false;\n this._offsetWidth = -1;\n this._offsetHeight = -1;\n this.addClass(TERMINAL_CLASS);\n // Create the xterm.\n this._term = new xterm_1.Terminal(Private.getConfig(options));\n this._initializeTerm();\n // Initialize settings.\n let defaults = Terminal.defaultOptions;\n this._initialCommand = options.initialCommand || defaults.initialCommand;\n this.theme = options.theme || defaults.theme;\n this.id = `jp-Terminal-${Private.id++}`;\n this.title.label = 'Terminal';\n }", "title": "" }, { "docid": "d05d3b6381c349a558dc69521ba87de8", "score": "0.59099025", "text": "constructor(options = {}) {\n super();\n this._needsResize = true;\n this._theme = 'dark';\n this._session = null;\n this._termOpened = false;\n this._offsetWidth = -1;\n this._offsetHeight = -1;\n this.addClass(TERMINAL_CLASS);\n // Create the xterm.\n this._term = new xterm_1.Terminal(Private.getConfig(options));\n this._initializeTerm();\n // Initialize settings.\n let defaults = Terminal.defaultOptions;\n this._initialCommand = options.initialCommand || defaults.initialCommand;\n this.theme = options.theme || defaults.theme;\n this.id = `jp-Terminal-${Private.id++}`;\n this.title.label = 'Terminal';\n }", "title": "" }, { "docid": "14affa4ed4765fb5be4ab89e7d14b247", "score": "0.58521116", "text": "getTermOptions() {\n const { chartType, entities, categories, entityTypes } = this.state;\n var options = [{ key: -1, value: utils.TRENDING_TERM_ITEM, text: utils.TRENDING_TERM_ITEM }];\n var collection;\n\n // select based on the filter type\n if (chartType === utils.ENTITY_FILTER) {\n collection = entities.results;\n } else if (chartType === utils.CATEGORY_FILTER) {\n collection = categories.results;\n } else if (chartType === utils.ENTITY_TYPE_FILTER) {\n collection = entityTypes.results;\n }\n\n if (collection) {\n collection.map(item =>\n options.push({key: item.key, value: item.key, text: item.key})\n );\n }\n\n return options;\n }", "title": "" }, { "docid": "54c489291ed6b1ff3bde4098958e590c", "score": "0.5682676", "text": "get gatheredOptions() {\n let options = {};\n\n for (let o of this.previewOptions) {\n let value = this.args[o] || this[o];\n\n if (value !== undefined) {\n options[o] = value;\n }\n }\n\n return options;\n }", "title": "" }, { "docid": "869f91bf95222c1cf2afbe1e74bf6237", "score": "0.5677142", "text": "get DEFAULT_CMD_OPTIONS() {\n return {};\n }", "title": "" }, { "docid": "77fcccfe3b921380d7d0b2e437e53672", "score": "0.56581783", "text": "get options() {\n Observable.track(this, \"options\");\n return this._options;\n }", "title": "" }, { "docid": "4ac2352ad64ed10226958d672c35d0f8", "score": "0.56253886", "text": "static get aotOptions() {}", "title": "" }, { "docid": "9b7b75688a7bc347a520b3a9fb7b1dc0", "score": "0.55822784", "text": "function topologySelectorTerm(options) {\n return ({}).merge(options);\n}", "title": "" }, { "docid": "59a3e14fde57d59d29cb494507943eb7", "score": "0.5550819", "text": "getOptions() {\n return options;\n }", "title": "" }, { "docid": "6f97094e6c2a53dcfbc24abadb966668", "score": "0.5544797", "text": "function getConfig(options) {\n var config = {};\n if (options.cursorBlink !== void 0) {\n config.cursorBlink = options.cursorBlink;\n }\n else {\n config.cursorBlink = Terminal.defaultOptions.cursorBlink;\n }\n return config;\n }", "title": "" }, { "docid": "7844197ab92f7f52f8ac9c952f636948", "score": "0.5508162", "text": "function options() {\n // The only option that needs parsing is the parallelism flag. Ignore any failures.\n let parallel;\n const parallelOpt = process.env[nodeEnvKeys.parallel];\n if (parallelOpt) {\n try {\n parallel = parseInt(parallelOpt, 10);\n }\n catch (err) {\n // ignore.\n }\n }\n // Now just hydrate the rest from environment variables. These might be missing, in which case\n // we will fail later on when we actually need to create an RPC connection back to the engine.\n return {\n // node runtime\n project: process.env[nodeEnvKeys.project],\n stack: process.env[nodeEnvKeys.stack],\n dryRun: (process.env[nodeEnvKeys.dryRun] === \"true\"),\n queryMode: (process.env[nodeEnvKeys.queryMode] === \"true\"),\n parallel: parallel,\n monitorAddr: process.env[nodeEnvKeys.monitorAddr],\n engineAddr: process.env[nodeEnvKeys.engineAddr],\n syncDir: process.env[nodeEnvKeys.syncDir],\n cacheDynamicProviders: process.env[nodeEnvKeys.cacheDynamicProviders] !== \"false\",\n // pulumi specific\n testModeEnabled: (process.env[pulumiEnvKeys.testMode] === \"true\"),\n legacyApply: (process.env[pulumiEnvKeys.legacyApply] === \"true\"),\n };\n}", "title": "" }, { "docid": "ed959c6e04951aeee53aa60d11e3704e", "score": "0.5507659", "text": "function Terminal(options) {\n if (options === void 0) { options = {}; }\n var _this = _super.call(this) || this;\n _this._fontSize = -1;\n _this._needsSnap = true;\n _this._needsResize = true;\n _this._rowHeight = -1;\n _this._colWidth = -1;\n _this._offsetWidth = -1;\n _this._offsetHeight = -1;\n _this._sessionSize = [1, 1, 1, 1];\n _this._theme = 'dark';\n _this._box = null;\n _this._session = null;\n _this.addClass(TERMINAL_CLASS);\n // Create the xterm, dummy terminal, and private style sheet.\n _this._term = new Xterm(Private.getConfig(options));\n _this._initializeTerm();\n _this._dummyTerm = Private.createDummyTerm();\n // Initialize settings.\n var defaults = Terminal.defaultOptions;\n _this._fontSize = options.fontSize || defaults.fontSize;\n _this._initialCommand = options.initialCommand || defaults.initialCommand;\n _this.theme = options.theme || defaults.theme;\n _this.id = \"jp-Terminal-\" + Private.id++;\n _this.title.label = 'Terminal';\n return _this;\n }", "title": "" }, { "docid": "1d5b5440badbbbdd9141555ba0b98d75", "score": "0.55062026", "text": "function getOptions() {\n\t\treturn defaultOptions;\n\t}", "title": "" }, { "docid": "ced0b79e58c4d53782431e857d8c413b", "score": "0.549189", "text": "get terminals() {\n return this._terminals;\n }", "title": "" }, { "docid": "b835f20c5dcf45c22c80ff5385accffb", "score": "0.54894686", "text": "function getOptions() {\r\n\treturn defaultOptions;\r\n}", "title": "" }, { "docid": "66928e498e366d63725ba8b77f98a114", "score": "0.5486095", "text": "function getOptions() {\n\treturn defaultOptions;\n}", "title": "" }, { "docid": "66928e498e366d63725ba8b77f98a114", "score": "0.5486095", "text": "function getOptions() {\n\treturn defaultOptions;\n}", "title": "" }, { "docid": "c2ad1750853ab3fdd7bfe603167dee8c", "score": "0.5461036", "text": "get options() {\n return this._options\n }", "title": "" }, { "docid": "5fae93c8817e5b450b87e2052c7c42fd", "score": "0.5458452", "text": "function getOptions() {\n return defaultOptions;\n }", "title": "" }, { "docid": "2bfb3deaba366fa74740d64f6c9bf1c2", "score": "0.5443832", "text": "get options() {\n\t\treturn this._options;\n\t}", "title": "" }, { "docid": "d63be44c930408c61573fdf1dec4f8e0", "score": "0.54278547", "text": "getOptions() { return this._options; }", "title": "" }, { "docid": "58715ac2fe1193217d78174586b4afe7", "score": "0.5421735", "text": "function options () {\n decache('../lib/env-options.js')\n return require('../lib/env-options')\n}", "title": "" }, { "docid": "0ebb8fbfe2a83c198b792fcbc7d864e8", "score": "0.5376466", "text": "function nodeSelectorTerm(options) {\n return ({}).merge(options);\n}", "title": "" }, { "docid": "ff49c23189f2bcc50dd4f3d7eb3b709d", "score": "0.5341816", "text": "function GetOptions() {\n return store.getItem('options').then(function (data) {\n if (data != null) {\n options = data;\n\n // fill in defaults for new options\n for (let key in GetDefaultOptions()) {\n if (options[key] == undefined) {\n options[key] = defaultOptions[key];\n }\n }\n }\n });\n}", "title": "" }, { "docid": "792b1ff0f6da69c406c0e9d60e767ced", "score": "0.52977616", "text": "function terminal(interpreter, options) {\n return $('#terminal').terminal(function() {\n interpreter.apply(this, arguments);\n }, options);\n}", "title": "" }, { "docid": "10d00ab3ff320c2a4689fbf9d394c4cc", "score": "0.5266371", "text": "static getCanvasOptions(options) {\n\n // Get window dims\n const dims = Psych.dims();\n\n // Default options\n const _options = Object.assign({\n lineWidth: 0,\n size: 100,\n fillStyle: 'black',\n strokeStyle: 'black',\n top: dims.height / 2,\n left: dims.width / 2,\n rotate: 0\n }, options);\n\n return _options;\n\n }", "title": "" }, { "docid": "397f1086a2e70b3ec171ebd3070ab529", "score": "0.52459574", "text": "get options() { return this._options; }", "title": "" }, { "docid": "d7e979d429885c4e6b313cabc0a5482e", "score": "0.52334887", "text": "getOptions() {\n return this._options;\n }", "title": "" }, { "docid": "bb980a6462424e8dc88ac458544b2c35", "score": "0.5233347", "text": "get options() {\n return this.m_optionsMap;\n }", "title": "" }, { "docid": "8085a9a52b2a6a0a0c0a41de33bb5d43", "score": "0.5229345", "text": "function nodeSelectorTermIoK8sKubernetesPkgApiV1(options) {\n return ({}).merge(options);\n}", "title": "" }, { "docid": "b2dc9f4b9c0159c958bfbd24149ee485", "score": "0.52269596", "text": "get_terminal(name) {\r\n return this._terminals_dict[name];\r\n }", "title": "" }, { "docid": "2debea43aa219818c7651735bf0d0eb4", "score": "0.5219722", "text": "function getOptions() {\n\tvar options = [];\n\toptions.push(document.getElementById(\"includeSymbols\").checked);\n\toptions.push(document.getElementById(\"lengthRange\").value);\n\toptions.push(document.getElementById(\"mixedCase\").checked);\n\n\treturn options;\n}", "title": "" }, { "docid": "e279791c0d577d9bc3514ea2b92dfd7f", "score": "0.5190312", "text": "function getOptions() {\n\t\treturn JSON.parse(localStorage.getItem(OPTIONS_KEY)) || DEFAULT_OPTIONS;\n\t}", "title": "" }, { "docid": "b0209e70928457b6ae6318e1fab599f5", "score": "0.5165696", "text": "get options() {\n return [\n { label: 'Program 1', value: 'program' },\n { label: 'Program 2', value: 'program2' },\n { label: 'Program 3', value: 'program3' },\n ];\n }", "title": "" }, { "docid": "f98e8e0b2ce7a33bbac8191753982947", "score": "0.5158559", "text": "getOptions() {\n return Object.assign({}, this._options);\n }", "title": "" }, { "docid": "7a6ba4d4aa96c35b7e743f88dbbe22ee", "score": "0.51312006", "text": "function getOptions(path: NodePath): Options {\n while (!t.Program.check(path.node)) {\n path = path.parentPath;\n }\n\n return path.node.options || {};\n }", "title": "" }, { "docid": "0d7e4773c27ed9e3a44f46fc32180f85", "score": "0.5116939", "text": "function getOptions(args) {\n\n var allowed,\n shortcuts,\n options;\n\n allowed = {\n root: path,\n yui3: Boolean,\n verbose: Boolean,\n help: Boolean,\n colors: Boolean,\n yconfig: path,\n\n init: path,\n include: [ Array, String ],\n exclude: [ Array, String ],\n\n 'save-results': Boolean,\n 'results-format' : String,\n 'results-file' : String,\n\n coverage: Boolean,\n istanbul: Boolean,\n 'fast-cover': Boolean,\n 'save-coverage': Boolean,\n 'coverage-report-format': String,\n 'coverage-file' : String,\n\n 'cov-include': [ Array, String ],\n 'cov-exclude': [ Array, String ],\n 'tmp': path\n };\n\n shortcuts = {\n 'v': '--verbose',\n 'c': '--coverage',\n 'r': '--save-results',\n 'h': '--help'\n };\n\n options = nopt(allowed, shortcuts, args, 0);\n makeCamelCase(options);\n if (options.colors === undefined) { options.colors = true; }\n return options;\n}", "title": "" }, { "docid": "11d14c4f5c6aecbbc159b606983befd3", "score": "0.50896573", "text": "_getOptions(editor=undefined) {\n\t\teditor = editor || atom.workspace.getActiveTextEditor();\n\t\tconst commentChars = editor ? (atom.config.get('editor.commentStart', {scope: editor.getRootScopeDescriptor()}) || '').trim() : '';\n\t\tconst areCommentsRequired = commentChars !== '';\n\t\tconst prefixes = areCommentsRequired ? CustomFolds.prefixes : CustomFolds.textFilePrefixes;\n\t\tconst postfixes = areCommentsRequired ? CustomFolds.postfixes : CustomFolds.textFilePostfixes;\n\n\t\treturn {editor, commentChars, areCommentsRequired, prefixes, postfixes};\n\t}", "title": "" }, { "docid": "9e94ae7a1b06807297146ca31cf6ce46", "score": "0.5075665", "text": "get options() {\n return this._items;\n }", "title": "" }, { "docid": "09f2836fd97ce306a1123915dafe87b2", "score": "0.5073752", "text": "function getOptionsText() {\n var options = [];\n // options for \"related\" data sets\n for ( var i=0; i<this.categories.length; i++ ) {\n if ( this.completes_rct[i]>0 ) {\n options.push( \"Find the <em>\" + this.categories[i] + \"</em> for a <em>modified set of data</em>.\" );\n } else {\n options.push( \"Find the <em>\" + this.categories[i] + \"</em> for the <em>same set of data</em>.\" );\n }\n }\n // options for \"unrelated\" data sets\n for ( var i=0; i<this.categories.length; i++ ) {\n options.push( \"Find the <em>\" + this.categories[i] + \"</em> for a <em>different story problem</em>.\" );\n }\n // quit option, if applicable\n var quit_avail = true;\n for ( var i=0; i<this.categories.length; i++ ) {\n quit_avail = quit_avail && ( this.completes_tot[i]>=this.complete_targ );\n }\n if ( quit_avail ) {\n options.push( \"Quit\" );\n }\n return options;\n}", "title": "" }, { "docid": "9469072566fa888d39cc5286d78fb7d4", "score": "0.5049926", "text": "function getNonPrivateDataFromCmdlineOpts(options) {\n return {\n accountId: options.accountId,\n networkId: options.networkId,\n nodeUrl: options.nodeUrl,\n walletUrl: options.walletUrl,\n };\n}", "title": "" }, { "docid": "279336df61d0a7629cb1693416660ee2", "score": "0.5034285", "text": "async function getOptions(apiToken){\n return _get('/enrich/options', apiToken);\n}", "title": "" }, { "docid": "b606b8fbabe75e250f360b318688883d", "score": "0.50235116", "text": "function getCommandLineOptions() {\n var options = externals_1.commandLineArgs([\n { name: 'configPath', type: String, defaultOption: true },\n { name: 'autoRunSeleniumServer', type: Boolean },\n { name: 'updateBaselineImages', type: Boolean }\n ]);\n return options;\n }", "title": "" }, { "docid": "653b4155258c443171899a50302870d0", "score": "0.5015224", "text": "get options() {\n Observable.track(this, \"options\");\n return this.filteredOptions.length ? this.filteredOptions : this._options;\n }", "title": "" }, { "docid": "c8cdb844ac103fdda7dcc561d3218e49", "score": "0.50130033", "text": "get options() {\n\t\t// Return options from the wrapper AceAccordion object.\n\t\treturn this.wrapper_ace_accordion.options;\n\t}", "title": "" }, { "docid": "01916ca34041d7350ea77dc11bbdb626", "score": "0.5006085", "text": "function GetOptions() {\n var promiseGetOption = store.getItem('options').then(function(data) {\n if (data != null) {\n options = data;\n\n // fill in defaults for new options\n for (key in GetDefaultOptions()) {\n if (options[key] == undefined) {\n options[key] = defaultOptions[key];\n }\n }\n }\n });\n return promiseGetOption;\n}", "title": "" }, { "docid": "4aac355a208214d9c721e7d1f4a05bfe", "score": "0.49340338", "text": "function getOptions() {\n\t// Create the required options object\n\tvar options = new ExportOptionsPNG24();\n\t// See ExportOptionsPNG24 in the JavaScript Reference for available options\n\n\tvar rgb_color = new RGBColor();\n\trgb_color.red = 255;\n\trgb_color.green = 255;\n\trgb_color.blue = 255;\n\n\t// Set the options you want below:\n\toptions.antiAliasing = true;\n\toptions.artBoardClipping = true;\n\toptions.horizontalScale = 100.0;\n\toptions.verticalScale = 100.0;\n\toptions.matte = true;\n\toptions.matteColor = rgb_color;\n\toptions.saveAsHTML = false;\n\toptions.transparency = true;\n\n\treturn options;\n}", "title": "" }, { "docid": "9f0e099f84d12a65309c767763c5d7eb", "score": "0.49080014", "text": "async getOptions(filter = {}) {\n return this.locatorForAll(MatOptionHarness.with(filter))();\n }", "title": "" }, { "docid": "0743c681ddf890d832f894c665a1d12a", "score": "0.49038383", "text": "function getGlobalOptions() {\n return _globalOptions;\n }", "title": "" }, { "docid": "38e5665c8c08022fec9b4032ef09ea70", "score": "0.48956332", "text": "function getBundleOptions(options) {\n const data = getData(options.value);\n const metadata = getMetadata(options.value);\n const trusted = !!options.trusted;\n return { data, metadata, trusted };\n }", "title": "" }, { "docid": "c3621f256d885d7ace8282d397fc4418", "score": "0.48783866", "text": "function parseOptions() {\n var option;\n var opts = {};\n var parser = new getopt.BasicParser('hv:p:u:', process.argv);\n\n while ((option = parser.getopt()) !== undefined) {\n switch (option.option) {\n case 'h':\n usage();\n break;\n case 'u':\n opts.user = option.optarg;\n break;\n case 'p':\n opts.port = parseInt(option.optarg, 10);\n break;\n default:\n usage('invalid option: ' + option.option);\n break;\n }\n }\n\n return opts;\n}", "title": "" }, { "docid": "72350b03701e11bfe62823ccda8d6e7b", "score": "0.48759004", "text": "get options() {\n return this[optionsValue];\n }", "title": "" }, { "docid": "2d8e11e62d4960e510de468df10ed99d", "score": "0.48745105", "text": "function getOptions() {\n return new Promise((resolve, reject) => {\n chrome.storage.local.get([\"options\"], result => {\n resolve(result.options);\n });\n });\n}", "title": "" }, { "docid": "dd01406d813c21c09763e9024c7ec2fa", "score": "0.48691142", "text": "function getOptions() {\r\n gvar.mnu_Value[0] = getValue('KEY_FIXED_MNU');\r\n gvar.mnu_Value[1] = getValue('KEY_TCKILL_MNU');\r\n gvar.paused = getValue('KEY_PAUSED');\t\r\n }", "title": "" }, { "docid": "2c8ae8f72afb8d45619eceeb791515c1", "score": "0.48644486", "text": "function getNodeOptions(isDev) {\n\n var opts = {\n script: config.nodeServer,\n delayTime: 1,\n env: {\n 'PORT': port,\n 'NODE_ENV': isDev ? 'dev' : 'build'\n },\n watch: [config.server]\n };\n\n console.log('node options: ' + JSON.stringify(opts));\n}", "title": "" }, { "docid": "adfa579f61c88dc84aae043112f2b22d", "score": "0.48519927", "text": "get opts() {\n const opts = vscode.workspace.getConfiguration('ruby.lint.rubocop');\n if (!opts || opts === true) {\n return {};\n }\n return opts;\n }", "title": "" }, { "docid": "52e05c6b8b75fd8a94961568c123831b", "score": "0.4849663", "text": "_getOptions(options = {}) {\n return Object.assign({}, options, { serverSettings: this.serverSettings });\n }", "title": "" }, { "docid": "5ab4fe0dbea84d3f781bd89302f42010", "score": "0.48463598", "text": "function getBundleOptions(options) {\n let data = getData(options.value);\n let metadata = getMetadata(options.value);\n let trusted = !!options.trusted;\n return { data, metadata, trusted };\n }", "title": "" }, { "docid": "abbf460e236b22c817112854dfc37ca9", "score": "0.48437256", "text": "ShowHelpOptions() {\n // show help about declared options\n console.log()\n console.log(\"-\".repeat(60))\n console.log(\"Options:\")\n for (const key in this.optDeclarations) {\n let line = \"\"\n const opt = this.optDeclarations[key]\n let text = \"--\" + key\n if (opt.valueType) text = text + \" \" + opt.valueType\n if (opt.shortName) {\n text = text + \", -\" + opt.shortName\n if (opt.valueType) text = text + \" \" + opt.valueType\n }\n line = ` ${text}`.padEnd(50) + (opt.helpText ? opt.helpText : \"\")\n console.log(line)\n }\n console.log(\"-\".repeat(60))\n }", "title": "" }, { "docid": "a864896957cbb0a9f386a94cf7c2b0d6", "score": "0.48415533", "text": "get fontSize() {\n return this._term.getOption('fontSize');\n }", "title": "" }, { "docid": "a864896957cbb0a9f386a94cf7c2b0d6", "score": "0.48415533", "text": "get fontSize() {\n return this._term.getOption('fontSize');\n }", "title": "" }, { "docid": "df4f6ad9688e5042158c63ea51abf2be", "score": "0.4828778", "text": "function getStartEnvOptions() {\n var options = {};\n\n for (var k in args) {\n switch (k) {\n case 'daemon':\n case 'robust':\n options[k] = args[k] === true ? '1' : '0';\n break;\n case 'cluster':\n options[k] = args[k] ? args[k] : os.cpus().length;\n break;\n case 'port':\n options[k] = args[k];\n break;\n }\n }\n\n return options;\n}", "title": "" }, { "docid": "4dfea88670656185cf493bc2a5e88d7f", "score": "0.4827906", "text": "getOpenTerminal() {\n for (let item of atom.workspace.getPaneItems()) {\n if (item instanceof TerminalSession) {\n return item;\n }\n }\n }", "title": "" }, { "docid": "f1fc59844b1075929e52f8b2cc728489", "score": "0.4814123", "text": "function TerminalManager(options) {\n if (options === void 0) { options = {}; }\n var _this = this;\n this._running = [];\n this._isDisposed = false;\n this._isReady = false;\n this._refreshTimer = -1;\n this._runningChanged = new signaling_1.Signal(this);\n this.serverSettings = options.serverSettings || __1.ServerConnection.makeSettings();\n // Set up state handling if terminals are available.\n if (terminal_1.TerminalSession.isAvailable()) {\n // Initialize internal data.\n this._readyPromise = this._refreshRunning();\n // Set up polling.\n this._refreshTimer = setInterval(function () {\n _this._refreshRunning();\n }, 10000);\n }\n }", "title": "" }, { "docid": "9c27ec57c75b89f8b05f12693ca9352a", "score": "0.47993582", "text": "get transcriptPicker() {\n let options = {};\n options[-1] = this._getLocal(this.localization, \"transcript\", \"off\");\n Object.keys(\n this.loadedTracks && this.loadedTracks.textTracks\n ? this.loadedTracks.textTracks\n : {}\n ).forEach((key) => {\n options[key] =\n this.loadedTracks.textTracks[key].label ||\n this.loadedTracks.textTracks[key].language;\n });\n return options;\n }", "title": "" }, { "docid": "4d3c54900e36ccc09342b4b0d1f65733", "score": "0.4794976", "text": "function getOptions(opts){var options={};for(var opt in defaultOptions) {options[opt] = opts && _util.has(opts,opt)?opts[opt]:defaultOptions[opt];}if(_util.isArray(options.onToken)){(function(){var tokens=options.onToken;options.onToken = function(token){return tokens.push(token);};})();}if(_util.isArray(options.onComment))options.onComment = pushComment(options,options.onComment);return options;}", "title": "" }, { "docid": "ddfcc379beb6ed4dd3e0a25915894966", "score": "0.4778493", "text": "function getOptions(){\n let options = [];\n if(document.querySelector(\"#upperCaseCB\").checked){\n options.push({getCharacter: getUpperCase});\n }\n if(document.querySelector(\"#lowerCaseCB\").checked){\n options.push({getCharacter: getLowerCase});\n }\n if(document.querySelector(\"#numbersCB\").checked){\n options.push({getCharacter: getNumber});\n }\n if(document.querySelector(\"#specialsCB\").checked){\n options.push({getCharacter: getSpecial});\n }\n return options\n}", "title": "" }, { "docid": "5c981045fa2877707630e881af997d83", "score": "0.4773701", "text": "getConfig() {\n return this.options;\n }", "title": "" }, { "docid": "cd4cd351c6da805046a7451f42be0c8e", "score": "0.47727725", "text": "function getOptions(options) {\n\n\t\t// fill in missing values with defaults\n\t\toptions = $.extend({}, defaults, options);\n\n\t\t// check for inconsistent directional restrictions\n\t\tif (options.direction !== 'multi' && options.direction !== options.wheelDirection) {\n\t\t\toptions.wheelDirection = options.direction;\n\t\t}\n\n\t\t// ensure positive values for deltas\n\t\toptions.scrollDelta = math.abs(parseFloat(options.scrollDelta));\n\t\toptions.wheelDelta = math.abs(parseFloat(options.wheelDelta));\n\n\t\t// fix values for scroll offset\n\t\toptions.scrollLeft = options.scrollLeft === none ? null : math.abs(parseFloat(options.scrollLeft));\n\t\toptions.scrollTop = options.scrollTop === none ? null : math.abs(parseFloat(options.scrollTop));\n\n\t\treturn options;\n\n\t}", "title": "" }, { "docid": "3370122886ab9583bc9ab4769ad6de53", "score": "0.47583178", "text": "function getOptionValuesFromOtherEnvVars() {\n const options = {};\n if(process.env.NODE_PENDING_DEPRECATION === '1') {\n options['--pending-deprecation'] = true;\n }\n return options;\n}", "title": "" }, { "docid": "9c13e6491827705e324624f5ae5f7323", "score": "0.47541267", "text": "function getBundleOptions(options) {\n let data = getData(options.value);\n return { data };\n }", "title": "" }, { "docid": "023804a68656ddddb7c3241be2d85cda", "score": "0.47509354", "text": "function mkStdOptions()/*...args*/{var h=Object.prototype.hasOwnProperty;var opts={};var args=[].concat.apply([],arguments);// clone defaults, so we do not modify those constants?\nif(args[0]!==\"NODEFAULT\"){args.unshift(defaultJisonLexOptions);}else{args.shift();}for(var i=0,len=args.length;i<len;i++){var o=args[i];if(!o)continue;// clone input (while camel-casing the options), so we do not modify those either.\nvar o2={};for(var p in o){if(typeof o[p]!=='undefined'&&h.call(o,p)){o2[mkIdentifier$2(p)]=o[p];}}// now clean them options up:\nif(typeof o2.main!=='undefined'){o2.noMain=!o2.main;}delete o2.main;// special check for `moduleName` to ensure we detect the 'default' moduleName entering from the CLI\n// NOT overriding the moduleName set in the grammar definition file via an `%options` entry:\nif(o2.moduleName===o2.defaultModuleName){delete o2.moduleName;}// now see if we have an overriding option here:\nfor(var p in o2){if(h.call(o2,p)){if(typeof o2[p]!=='undefined'){opts[p]=o2[p];}}}}return opts;}// set up export/output attributes of the `options` object instance", "title": "" }, { "docid": "083160eb6e7dadf30e19c472a2348bc9", "score": "0.47362816", "text": "openTerminal() {\n let target = this.document_.getElementById('kd-shell-term');\n this.term.decorate(target);\n target.firstChild.style.position = null;\n this.term.installKeyboard();\n }", "title": "" }, { "docid": "3d1f4cf4d2dd3502b521c7a6373f77b7", "score": "0.47357896", "text": "function getBundleOptions(options) {\n var data = getData(options.value);\n var metadata = getMetadata(options.value);\n var trusted = !!options.trusted;\n return { data: data, metadata: metadata, trusted: trusted };\n }", "title": "" }, { "docid": "1d6ceb3e48427cba057c710bf2a6369a", "score": "0.47329378", "text": "async function getOptions() {\n let options = defaultOptions;\n try {\n options = await browser.storage.sync.get(defaultOptions);\n } catch (err) {\n console.error(err);\n }\n return options;\n}", "title": "" }, { "docid": "a2060c5991f5753da809ca7266d069cb", "score": "0.47186145", "text": "async function getInterfaceOptions() {\n\n let url = `[% path %]services/interface.cgi?method=get_options`;\n\n try {\n const resp = await fetch(url, {method: 'get', credentials: 'include'});\n const data = await resp.json();\n return data.results;\n } catch(error) {\n console.error('Failure occurred in getInterfaceOptions:', error);\n return [];\n }\n}", "title": "" }, { "docid": "5b7a786b82c2d213a689e90cb0d15016", "score": "0.47055885", "text": "getOptions() {\n return this.state.options.slice();\n }", "title": "" }, { "docid": "60d1047c79e572e5d77f15391b03bbef", "score": "0.46999368", "text": "getOptions() {\r\n return this.settings;\r\n }", "title": "" }, { "docid": "c76d57cda6621383ac0b5ff90420f492", "score": "0.46974114", "text": "options (config = {}) {\n return session.options(BANNER, config)\n }", "title": "" }, { "docid": "6bca3e8ba65acbc0e400da21a42882bc", "score": "0.4687327", "text": "options() {\n return algorithm_1.iter(this._options);\n }", "title": "" }, { "docid": "d206b6ff6442ceeeb21873527b020af9", "score": "0.46864796", "text": "GetDefaultStaticTerminal(int, TERMINAL_DIRECTION) {\n\n }", "title": "" }, { "docid": "90d17e65b05c2b976e919d21b4db9b42", "score": "0.46839672", "text": "function getCliOptions() {\n\tvar i , max = 0 ;\n\n\tfor ( i = 2 ; i < process.argv.length ; i ++ ) {\n\t\tif ( process.argv[ i ].match( /\\*|.+\\.js/ ) ) {\n\t\t\tmax = i ;\n\t\t}\n\t}\n\n\treturn require( 'minimist' )( process.argv.slice( max + 1 ) ) ;\n}", "title": "" }, { "docid": "82e2b8379e12b95cebd5c81072d8a85a", "score": "0.4680256", "text": "get additionalOptions() {\n return this._additionalOptions;\n }", "title": "" }, { "docid": "82e2b8379e12b95cebd5c81072d8a85a", "score": "0.4680256", "text": "get additionalOptions() {\n return this._additionalOptions;\n }", "title": "" } ]
fd14400d27522752c23ecec4aa4a9e82
mostrar mensaje de error
[ { "docid": "dc0be83369a395657757b57be58a4982", "score": "0.67550826", "text": "function mostrarError(error)\n{\nconst mensajeError=document.createElement('p');\nmensajeError.textContent=error;\nmensajeError.classList.add('error');\n\n// insertar en el contenido\nconst contenido=document.querySelector('#contenido');\ncontenido.appendChild(mensajeError);\n\n// elimina la alerta despues de 3 segundos\nsetTimeout(()=>\n{\nmensajeError.remove();\n},3000);\n\n}", "title": "" } ]
[ { "docid": "4eae2b98964b6d2740a33f7e3ba4dd52", "score": "0.8577199", "text": "function error(){} // Funcion para mostrar error", "title": "" }, { "docid": "65a5433bbc92cf5024355c8edb8d866c", "score": "0.7386384", "text": "function gestionarError() {\n\n}", "title": "" }, { "docid": "fe73a7290ce739d9565d17389af6fa8e", "score": "0.7310061", "text": "function errorMsg( err ) {\n console.log( displayLog( `Error Occurred: ${err.message} with error code ${err.code}, Please restart the Device`, 'red' ) );\n}", "title": "" }, { "docid": "baab851d1c45ad73f808e95715f7fd12", "score": "0.7293878", "text": "function fail(err) {\n noti.style.display = 'block';\n noti.innerHTML = `<p>${err.message}</p>`;\n}", "title": "" }, { "docid": "e878401eb130de436b0ab1bdf2066d25", "score": "0.72935724", "text": "function mostrarErrorInesperado() {\n\t$.alerts.alert(\"Ocurrió un error inesperado. Por favor comuníquese con el administrador del sistema.\", _sistema);\n}", "title": "" }, { "docid": "3c07351a6a7c74e003c2537de3f3d312", "score": "0.7232065", "text": "function errormsg() {\n console.log(\"Unable to get any data\");\n }", "title": "" }, { "docid": "349c3f8ea71ca6aef6f5876d003694ca", "score": "0.7202872", "text": "mensajeError(mensaje) {\n this.snackColor = \"red\";\n this.sanckText = \"[Error] \" + mensaje;\n this.snackStatus = true;\n }", "title": "" }, { "docid": "c09c678f6e7cc5f0c68f080544c608e5", "score": "0.7192308", "text": "function error(err) {\n loading(0);\n console.error(err);\n toast(\"Alguma coisa deu errado\");\n }", "title": "" }, { "docid": "c09c678f6e7cc5f0c68f080544c608e5", "score": "0.7192308", "text": "function error(err) {\n loading(0);\n console.error(err);\n toast(\"Alguma coisa deu errado\");\n }", "title": "" }, { "docid": "c09c678f6e7cc5f0c68f080544c608e5", "score": "0.7192308", "text": "function error(err) {\n loading(0);\n console.error(err);\n toast(\"Alguma coisa deu errado\");\n }", "title": "" }, { "docid": "893fdc49dc1151d7b642de9b448333af", "score": "0.7165806", "text": "function errorMsg(msg, error) {\n errorMessage.innerHTML += '<p>' + msg + '</p>';\n if (typeof error !== 'undefined') {\n console.error(error);\n }\n}", "title": "" }, { "docid": "ef4d0490ffef53e9300359cb1d24a5ba", "score": "0.711622", "text": "function mensajeError(mensaje) {\n\tjAlert(\"<strong>Error</strong><br/><br/><br/>\" + mensaje);\n}", "title": "" }, { "docid": "aef3de7c7c981d2069737c2775b157a0", "score": "0.708562", "text": "function error( msg, line, file ) { app.Alert( msg, file + \": error at line \" + line, \"\", 255 ); }", "title": "" }, { "docid": "20def1695429394d56bb3b567e51ca01", "score": "0.7048919", "text": "function errorMessage(error) {\r\n // if we don't get data from the server the server symbol be red\r\n let serverResponse = document.querySelector(\".serverResponse\");\r\n serverResponse.style.color = \"#f4200b\";\r\n console.error(error);\r\n }", "title": "" }, { "docid": "ab28412dea25aeba6e3546ca6492a87c", "score": "0.70453143", "text": "function errorDisplay(message ,err) {\n console.log(\"Error collecting the temperature.\");\n console.log(err);\n process.exit(1);\n}", "title": "" }, { "docid": "7d31b1f74c281729853dc9582fe5d954", "score": "0.70273906", "text": "function showError (error) {\n console.error(error.message);\n }", "title": "" }, { "docid": "d27b44b99dc30b6552cecfbdd676a536", "score": "0.69986904", "text": "function show_error(){\n console.log(\"KUCH GALAT HUA HAI/SOMETHING WENT WRONG\");\n}", "title": "" }, { "docid": "c497ec54c41059d8bb167b1355cf19af", "score": "0.6993426", "text": "function showErrorConnexion()\n\t{\n\t\tvar title = 'Impossible d\\'effectuer la réquête ';\n\t\t\ttexte = 'Vérifiez votre connexion internet, puis rééssayez !';\n\n\t\tshowSomeError(title, texte);\n\n\t}", "title": "" }, { "docid": "adfff4cbc0a3d8dc5f59cf10698575dc", "score": "0.69908917", "text": "function error(err) {\n swal(\"Error: \" + err);\n }", "title": "" }, { "docid": "e2ae9551590afa20245a6fc3774de6b4", "score": "0.69836235", "text": "function showError (err) {\n $mdToast.show(\n $mdToast.simple()\n .content($translate.instant('SCES.' + err))\n .position('top right')\n .hideDelay(5000));\n }", "title": "" }, { "docid": "e2ae9551590afa20245a6fc3774de6b4", "score": "0.69836235", "text": "function showError (err) {\n $mdToast.show(\n $mdToast.simple()\n .content($translate.instant('SCES.' + err))\n .position('top right')\n .hideDelay(5000));\n }", "title": "" }, { "docid": "cf9aa3c6b4b311bf44665cf6ed398ed7", "score": "0.6982809", "text": "function errore(err){\r\n console.log(err);\r\n}", "title": "" }, { "docid": "4a993bc4fe8d15831e2037722f37f114", "score": "0.6963873", "text": "function error_message(message)\n{\n error_message = error_message + \"* \" + message + \"\\n\";\n error = true;\n \n}", "title": "" }, { "docid": "e3583f366e22f875363700ff842053e3", "score": "0.6943982", "text": "function displayError (err) {\n displayText(`There was an error: ${err}`);\n }", "title": "" }, { "docid": "c7494fa0f1c06d378945e69f297f2291", "score": "0.69303787", "text": "function showError(error){\r\n switch(error.code){\r\n case error.PERMISSION_DENIED:\r\n er.innerHTML=\"Denegada la petición de Geolocalización en el navegador.\"\r\n break;\r\n case error.POSITION_UNAVAILABLE:\r\n er.innerHTML=\"La información de la localización no esta disponible.\"\r\n break;\r\n case error.TIMEOUT:\r\n er.innerHTML=\"El tiempo de petición ha expirado.\"\r\n break;\r\n case error.UNKNOWN_ERROR:\r\n er.innerHTML=\"Ha ocurrido un error desconocido.\"\r\n break;\r\n }\r\n }", "title": "" }, { "docid": "a0bc921ab9335f758fc572ffffca2cc2", "score": "0.69303375", "text": "setError(msg) { }", "title": "" }, { "docid": "b064416d7b2bcca84ee8e6cce0187618", "score": "0.69234324", "text": "function displayError(msg) {\r\n\tdisplayMessageOrErr(msg, true);\r\n}", "title": "" }, { "docid": "27a9e8a0e4cf131fd7dce9100cde477c", "score": "0.69226027", "text": "function showError(msg) {\n\talert(msg);\n}", "title": "" }, { "docid": "037a1476c501364e5a066181d233607f", "score": "0.6922029", "text": "function showError(message) {\n // Create a message on the user's screen with red text starting with ERROR followed by the message passed\n Materialize.toast('ERROR ' + message, 5000, 'red-text');\n // Log the error given to the \n console.error('Message: ' + message);\n }", "title": "" }, { "docid": "7b1133745c7235251a4ab405b049e4d3", "score": "0.69132644", "text": "function showError(msg) {\n document.getElementById('err').textContent = msg;\n document.getElementById('err').style.display = 'block';\n}", "title": "" }, { "docid": "47ed6c18d0e01c572e32e53117b7b4ca", "score": "0.69054145", "text": "function showError(error){\n \n alert(error.message);\n throw new Error(error.message);\n}", "title": "" }, { "docid": "82ff171d4d4d111af1781528b5f7331a", "score": "0.69037855", "text": "function fail (msg) { // Not got location\n\t\n\telMap.textContent = msg; // Show error message\n\tconsole.log(msg.code); // Log the error\n}", "title": "" }, { "docid": "ab3667c54e7c93fd59554bf8d2bdc50e", "score": "0.69003314", "text": "function mostrarError(error){\n const mensajeError = document.createElement('p');\n mensajeError.textContent = error;\n //Agregar estilos de un css por medio se la clase error\n mensajeError.classList.add('error');\n \n //Insertarlo en el contenido\n const contenido = document.querySelector('#contenido');\n contenido.appendChild(mensajeError);\n\n //Sirve para elimniar el error despues de 3 segundos\n setTimeout(() => {\n mensajeError.remove();\n }, 3000);\n}", "title": "" }, { "docid": "56a4a377577319d6d673776cea237654", "score": "0.6891577", "text": "function mostrarError(error) {\n switch(error.code) {\n case error.PERMISSION_DENIED:\n x.innerHTML = \"El usuario ha negado el acceso a la Geolocalización.\"\n break;\n case error.POSITION_UNAVAILABLE:\n x.innerHTML = \"La información de tu ubicación no esta disponible.\"\n break;\n case error.TIMEOUT:\n x.innerHTML = \"Ha finalizado el tiempo de espera para obtener la Geolocalización.\"\n break;\n case error.UNKNOWN_ERROR:\n x.innerHTML = \"Ha occurrido un error.\"\n break;\n }\n}", "title": "" }, { "docid": "22260c5f90a057038267be5b4229307d", "score": "0.68811685", "text": "function errorMessage(msg, fullMessage) {\r\n\t// More complex error for developers\r\n\tif(fullMessage && window.location.href.indexOf('//dev') != -1) {\r\n\t\t// Get the message from an Ajax response object\r\n\t\ttry {\r\n\t\t\tif(typeof fullMessage == 'object') fullMessage = fullMessage.status + '//' + fullMessage.responseText;\r\n\t\t} catch(er) {\r\n\t\t\tfullMessage = \"\";\r\n\t\t}\r\n\t\tmsg = msg + '<br>' + fullMessage.replace(/\\n/g,'<br>');\r\n\t}\r\n\t\r\n\t$('statusMessage').showMessage(msg,'bad',60);\r\n}", "title": "" }, { "docid": "13b7b13c6f8735f89b93fa1562d47192", "score": "0.68770283", "text": "function ErrorMessage (message) {\n console.log('\\n\\n')\n console.log('Error *****')\n console.log(message)\n console.log('\\n\\n')\n process.exit(1)\n}", "title": "" }, { "docid": "3015dc7bea25667f8c43c9a58e0bec19", "score": "0.687467", "text": "error() {\n this.view.mostrarError();\n }", "title": "" }, { "docid": "4e70284ca31ea2c0e05ae1c01367556c", "score": "0.68690634", "text": "function showError(msg) {\n var content = 'Sorry! ';\n\n switch (msg) {\n case 'browser':\n content += 'Your browser is not compatible.';\n break;\n\n case 'request':\n content += 'No response from server yet. Please refresh after a while.';\n break;\n\n case 'player':\n content += 'Some error happens to the audio player';\n break;\n\n case 'error':\n content += 'Something unexpected happens..';\n break;\n\n default:\n content += msg;\n break;\n }\n\n var template = '' +\n '<div id=\"errorContainer\" class=\"container\">' +\n\n '<h3>{{content}}</h3>' +\n '<p>These browsers are fully tested and well supported:</p>' +\n '<p>' +\n '<a href=\"http://www.google.com/search?q=download+chrome\"> Chrome /</a>' +\n '<a href=\"http://www.google.com/search?q=download+firefox\"> Firefox /</a>' +\n '<a href=\"http://www.google.com/search?q=download+safari\"> Safari </a>' +\n '</p>' +\n\n '</div>';\n\n $('#main').html(Mustache.to_html(template, {\n content: content\n }));\n }", "title": "" }, { "docid": "e7941a0254ba0c98d889879d746c38ab", "score": "0.68575424", "text": "function errorAlert(err) {\n log(c.red(err.toString()));\n this.emit(\"end\");\n}", "title": "" }, { "docid": "eb5c4ce85a507296bb389b49108f662e", "score": "0.6814964", "text": "function showError(err, object_alert, title_h5) {\n\t$(object_alert).find(\"h5\").html(title_h5);\n\t$(object_alert).find(\"ul\").html('');\n\t$(object_alert).css('display','block');\n\t$.each( err, function( key, value ) {\n\t\t$(object_alert).find(\"ul\").append('<li>'+value+'</li><br/>');\n\t});\n}", "title": "" }, { "docid": "ee024fdb0254e40df5ae6051e7d8cace", "score": "0.67989993", "text": "function onFail(message) {\n alert('Настаната е грешка при фотографирање!');\n }", "title": "" }, { "docid": "dbd948523694ac0b4b8d2667abce6042", "score": "0.67988044", "text": "showError(err) {\n }", "title": "" }, { "docid": "ca8fb3e8a388a9a9e9b6589b1a66b586", "score": "0.67942774", "text": "function error(obj) {\n text(obj, markerERROR);\n }", "title": "" }, { "docid": "d3caca7b0fe8743c3760b36925a311f3", "score": "0.6793224", "text": "function mostrarMensajeError(objetoError){\n document.querySelector(\"#mensajeError\").innerHTML= \"Error: \" + objetoError.message + \"!!!!\";\n}", "title": "" }, { "docid": "15ed33e3a418e14bae162203437a8d28", "score": "0.6786978", "text": "function mostrarError(mensaje) {\n const mensajeError = document.createElement(\"p\");\n mensajeError.textContent = mensaje;\n mensajeError.classList.add(\n \"border\",\n \"border-red-500\",\n \"background-red-100\",\n \"text-red-500\",\n \"p-3\",\n \"mt-5\",\n \"text-center\",\n \"error\"\n );\n\n //Ahora verifico que no exista ya un mensaje de error en la pantalla, asi no se repite el mensaje una y otra vez en la pantalla\n const existe = document.querySelectorAll(\".error\");\n\n if (existe.length === 0) {\n formulario.appendChild(mensajeError);\n }\n}", "title": "" }, { "docid": "09491de8631e9c731d96daa6d1b5b03c", "score": "0.6784904", "text": "function AfficheError(pErreur,pMessage){\n\tvar tMots = pErreur.split('/*');\n var sErreur = tMots[0], lAffiche=\"\";\n if (tMots.length>1) sErreur+=\" \"+tMots[1];\n\tif (pErreur.substr(0,2)==\"KO\") {lAffiche=pErreur;} else {lAffiche=sErreur;}\n\tvar sRc=\"<br/>\";\n\tsErreur=lAffiche.replace(/;/g,sRc);\n if (pMessage) sErreur+=\" : \"+pMessage\n AfficheToast(sErreur);\n}", "title": "" }, { "docid": "b164195875a67ec1b8eef2e40b99b85c", "score": "0.67797804", "text": "function error() {\n\t\talert(\"ERROR!\");\n\t}", "title": "" }, { "docid": "deeb4df2c6883e4358702fae1d039597", "score": "0.67752856", "text": "function errorExist() {\n alert('すでにマイリストに動画が存在しています');\n}", "title": "" }, { "docid": "69d3294216955e911e6bac94704b434f", "score": "0.6761364", "text": "function displayMessage(str){\n\tif(str){\n\t\taa.env.setValue(\"ErrorCode\", \"-1\");\n\t\taa.env.setValue(\"ErrorMessage\", str);\n\t}\n}", "title": "" }, { "docid": "61bc905cc65932c3f105bafd4cb5f24d", "score": "0.6761144", "text": "function showError(error) {\n\tswitch(error.code) {\n\t\tcase error.PERMISSION_DENIED:\n\t\t\tx.innerHTML=\"Usuario negó la solicitud de geolocalización.\"\n\t\t\tbreak;\n\t\tcase error.POSITION_UNAVAILABLE:\n\t\t\tx.innerHTML=\"La información de ubicación no está disponible.\"\n\t\t\tbreak;\n\t\tcase error.TIMEOUT:\n\t\t\tx.innerHTML=\"La solicitud para obtener la ubicación del usuario el tiempo de espera.\"\n\t\t\tbreak;\n\t\tcase error.UNKNOWN_ERROR:\n\t\t\tx.innerHTML=\"Que vergonzoso, ocurrió un error\"\n\t\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "2f8339f82b10f7546daf604ffd0a641a", "score": "0.6751141", "text": "function showError( e ) {\n var msg = (typeof e == \"string\") ? e : e.msg,\n field;\n setText(\"msg\",e.msg || e);\n if ((typeof e == \"object\") &&\n e.field &&\n (field = getElement( e.field ))) {\n field.select();\n field.focus();\n setClass(field,\"error\");\n }\n }", "title": "" }, { "docid": "25cc238b34a204ba802b36c988a4cc2c", "score": "0.6742235", "text": "function displayError() {\n //display error on the page\n $('.main').html(Handlebars.templates.error);\n //sets the questionNumber to 5 to ensure there is no continuation\n currentGame.serverError();\n }", "title": "" }, { "docid": "add6a1dbd301448b5a0c6034e4d6b974", "score": "0.6739162", "text": "function err(type, data){\n let err_message = {\n user: 'Alert',\n color: 'ee5502',\n time: 'Only you can view this message',\n }\n if(type === 'color')\n err_message['text'] = 'Color format should be /nickcolor RRGGBB.'\n else if(type === 'name')\n err_message['text'] = 'The name \"' + data + '\" is already taken.'\n else if(type === 'command')\n err_message['text'] = 'Invalid command. Valid commands are /nick and /nickcolor'\n else\n err_message['text'] = 'An unknown error occured.'\n add_message(err_message);\n }", "title": "" }, { "docid": "101283ece4012f546d57c1fe2e0de77e", "score": "0.671668", "text": "function errort() {\n // add type: 'error' to options\n return toast.error(\"Failed with Error...\", {\n position: toast.POSITION.BOTTOM_RIGHT\n });\n }", "title": "" }, { "docid": "5188005dfedad2b6757bc913bcc9b6b2", "score": "0.6715721", "text": "function displayError() {\n if (window.location.search.indexOf('error') !== -1) {\n var arr = window.location.search.split('=');\n if (arr.length) {\n var error = decodeURI(arr[1]);\n msg.update({\n message: error\n });\n }\n }\n}", "title": "" }, { "docid": "51bb1c94b95b6a3088976ed160cbba3e", "score": "0.67153966", "text": "function showErrorMessage(title, err) {\n var msg\n if (err instanceof Error) {\n msg = err.toString() + '\\n\\nStack trace:\\n' + err.stack\n } else {\n msg = err\n }\n dialog.showErrorBox(title, msg)\n}", "title": "" }, { "docid": "82138e857c9a1dbfc8d950e41adb87c1", "score": "0.67116314", "text": "function error(e) {\n alert(\"Algo salió mal, técnicamente\");\n }", "title": "" }, { "docid": "57968250a25ba5afe2a549be23bff49a", "score": "0.6708075", "text": "function _error(col, error) {\n if (error.status === 404) {\n\t rootel.html(notFoundScreen);\n\t } else {\n\t console.error(\"errorrrrr!!! abortasdvasld;fkjasjdf,,,,, HALT\");\n\t }\n\t}", "title": "" }, { "docid": "b6c98f4e60925920869b6a2f01f316cf", "score": "0.6696356", "text": "function error(message) {\n info(message);\n}", "title": "" }, { "docid": "28c86c3003de2ad94a61c4c56744eaaa", "score": "0.6693331", "text": "function showErrorMessage(msg = 'There is a problem with our servers. We apologize for the inconvince, please try again later') {\n console.log('ERROR: ' + msg);\n alert('ERROR: ' + msg);\n}", "title": "" }, { "docid": "94e7149ffc893b7be864d0dfdf8692af", "score": "0.6691282", "text": "function error(message) {\r\n command_1.issue('error', message);\r\n}", "title": "" }, { "docid": "e01d8a3fad63e6efe6eaaaebd18e0551", "score": "0.66904473", "text": "function reportExecuteScriptError(error) {\n document.querySelector(\"#popup-content\").classList.add(\"hidden\");\n document.querySelector(\"#user_mesage\").classList.add(\"hidden\");\n document.querySelector(\"#error-content\").classList.remove(\"hidden\");\n document.querySelector(\"#eror_reson\").insertAdjacentHTML('beforeend',error.message );\n console.error(`Помилка загрузки скрипта: ${error.message}`);\n}", "title": "" }, { "docid": "453b1a488f0a24c3e70f861dd0bc6a27", "score": "0.668174", "text": "function error(err) {\n console.warn(`ERROR(${err.code}): ${err.message}`);\n $('#temp').html(`ERROR(${err.code}): ${err.message}`);\n}", "title": "" }, { "docid": "7264f58a2f468f808f966747a8d59694", "score": "0.6679484", "text": "function alertMjsError(msj) {\r\n //cerrar progressvarsubWind_alert_conexWS_cant\r\n document.getElementById('contentbarProgress').style.display = 'none';\r\n\r\n //alert(`No se pudo conectar, conexión: ${error.message}, `);\r\n document.getElementById('subWind_alert_errorMessage').innerHTML = msj;\r\n //cerrar cualquier otra ventana abrir ventana de alerta mostrando el mensaje configurado\r\n document.getElementById('contentsubWind_alert_auth_cant').style.display = 'none';\r\n document.getElementById('contentsubWind_alert_auth_cant').style.display = 'inline';\r\n document.getElementById('contentsubWind_alert_auth_success').style.display = 'none';\r\n\r\n //redireccionar a index\r\n setInterval(() => {\r\n window.location = '/'\r\n }, 1500);\r\n\r\n}", "title": "" }, { "docid": "3ee7bfd556510a553eb4261548d97fe3", "score": "0.6675774", "text": "static error(message) {\n if (Config_1.Config.debugMode) {\n Debug.showConsole();\n outputConsole.appendLine(`[ERROR] ${message}`);\n }\n }", "title": "" }, { "docid": "221b3af664628d9fef2880e95e5e6363", "score": "0.66653854", "text": "function err(strm,errorCode){strm.msg=msg[errorCode];return errorCode;}", "title": "" }, { "docid": "e2152109fd356010977ae1415c33488d", "score": "0.6664286", "text": "function showError() {\n if (errorStatus) {\n errorElement.style.display = \"block\";\n errorElement.innerHTML = \"Hubo un error, lo sentimos\";\n }\n}", "title": "" }, { "docid": "6f101f3824103652545726aee07a1f3c", "score": "0.6645259", "text": "function showError(msg) {\n if (errors.findIndex(value => value === msg) >= 0) {\n return;\n }\n errors.push(msg);\n renderErrors();\n}", "title": "" }, { "docid": "41153be517ade75ddf0a33c47d74cf12", "score": "0.66450626", "text": "function displayError(error) {\n var errorMsg = '';\n switch (error.code) {\n case \"INVALID_EMAIL\":\n errorMsg = \"You entered an invalid email\";\n break;\n case \"INVALID_PASSWORD\":\n errorMsg = \"You entered an invalid password\";\n break;\n case \"EMAIL_TAKEN\":\n errorMsg = \"The email you entered has been taken.\"; \n break;\n default:\n errorMsg = \"We're not really sure what happened.\";\n break;\n }\n $error.text(errorMsg);\n }", "title": "" }, { "docid": "0d3a18cb0720335d422ea5f0348e70c5", "score": "0.664088", "text": "function showError(msg) {\n\t\tbootbox.alert(msg);\n\t\tenableInput();\n}", "title": "" }, { "docid": "2c337b2dc216de6d5e5a5676b0ef1569", "score": "0.6635158", "text": "function fn_error(){\n //mapComplete.innerHTML = ' Error!. Para visualizar el mapa debe aceptar compartir su ubicacion ';\n }", "title": "" }, { "docid": "61604b27e572fa67487c3e90289f9e14", "score": "0.6631639", "text": "function mostrarError(request, status, error) {\n\t$(\"#mensajes\").addClass(\"badge badge-important\").html(request.responseText)\n}", "title": "" }, { "docid": "32eefd1ac06c19c333c7b9caebbb86c7", "score": "0.6621914", "text": "function onError(evt)\r\n{\r\n\twriteToScreen('<span style=\"color: red;\">ERROR: </span> ' + evt.data);\r\n}", "title": "" }, { "docid": "d59fadbac218cc819bf7b841c310dd24", "score": "0.66185236", "text": "function printerr () {\n err_st = \"<h3>Invalid input near</h3><p class=\\\"error\\\">\"+\"&nbsp;\".repeat(err_loc)+\"v\"+err_st+\"<br /></p>\";\n $(\"#err-msg\").html(err_st);\n $(\"#err-msg\").css(\"background-color\",\"red\");\n}", "title": "" }, { "docid": "7314a1663fa2aa6b359f8d27c355263f", "score": "0.6618436", "text": "function showError(err) {\n\tif (confirm('An unknown error has occurred.\\n' +\n\t\t'Would you like to see more information?', true, 'Unknown Error')) {\n\t\t\talert(err + ': on line ' + err.line, 'Script Error', true);\n\t}\n}", "title": "" }, { "docid": "a56bd6531b362162545d80d3687d97ff", "score": "0.6615407", "text": "function showError(title, message) {\n Dialogs.showModalDialog(\n Dialogs.DIALOG_ID_ERROR,\n title,\n message\n );\n }", "title": "" }, { "docid": "a56bd6531b362162545d80d3687d97ff", "score": "0.6615407", "text": "function showError(title, message) {\n Dialogs.showModalDialog(\n Dialogs.DIALOG_ID_ERROR,\n title,\n message\n );\n }", "title": "" }, { "docid": "7775a53f458b5e3be98146c60418d1cd", "score": "0.6612848", "text": "function show_error_message(data){\n\t\t//$('#message_error').html('<div class=\"alert alert-danger alert-dismissible\" id=\"message_box\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">&times;</button><i class=\"icon fa fa-exclamation\"></i>'+data+'</div>');\n\t\tconfig_toast_master();\n\t\ttoastr[\"error\"](data);\n\t}", "title": "" }, { "docid": "b09f1c7251972a5adbb2ce133c931f26", "score": "0.6611522", "text": "function IotErrorMsg(errorCode){\n\t var errMsg=\"\";\n\t switch(errorCode){\n\t case 200:\n\t\t errMsg = \"Success\";\n\t\t break; \n\t case 100:\n\t\t errMsg = \"The item is not exist\";\n\t\t break; \n\t case 101:\n\t\t errMsg = \"The item is existed\";\n\t\t break; \n\tdefault:\n\t\t errMsg = \"Unknow code\";\n\t\t break; \t\t\t \n\t };\n\t \n\t alert(errMsg);\n }", "title": "" }, { "docid": "bfda2e3a3a5409b8c61346ada2879ff5", "score": "0.6606613", "text": "function error(err) {\n console.log('error: ' + err.code + ', message: ' + err.message); \n }", "title": "" }, { "docid": "a6e5c70ff86aabf4f1c9b1350ea5f3df", "score": "0.66059726", "text": "function error(err){\n // return the error message\n msg = 'Error: ' + err + ' :(';\n outputResult(msg); // output button\n $('.pure-button').removeClass('pure-button-primary').addClass('pure-button-error'); // change button style\n }", "title": "" }, { "docid": "2ee3ec7565f2dd130f794276e21a0927", "score": "0.66012424", "text": "function mostrarError(error) {\n\n const mensajeError = document.createElement('p');\n mensajeError.textContent = error;\n mensajeError.classList.add('error');\n\n //insertado en el contenido\n\n const contenido = document.querySelector('#contenido');\n contenido.appendChild(mensajeError);\n\n //Elimina la alerta despues de 3segundos paso 3.3\n setTimeout(() => {\n mensajeError.remove();\n }, 3000);\n\n}", "title": "" }, { "docid": "2b4cbd314a9da544d3d730d7ea753933", "score": "0.6597809", "text": "function showError(message){\n errorBox.style.display = \"inherit\";\n errorMessage.innerHTML = message;\n }", "title": "" }, { "docid": "fce7ea59723221690c9c6cc09cc2c93a", "score": "0.6592742", "text": "function handleError() {\r\n let error = gen(\"p\");\r\n error.textContent = \"Sorry, something went wrong. Please try again.\";\r\n error.id = \"error\";\r\n id(\"error\").appendChild(error);\r\n }", "title": "" }, { "docid": "f6c8551e988a5632a35b663da8574596", "score": "0.65922153", "text": "function showErrorDialog(message) {\r\n openDialog(generateDialog(wunderlist.language.data.error_occurred, '<p class=\"pl8\">' + message + '</p>'));\r\n }", "title": "" }, { "docid": "9140c2ec20009db61821deb57534e818", "score": "0.65904033", "text": "function msg(body){\r\n $(\"#cvv-error\").text(body).show();\r\n }", "title": "" }, { "docid": "1a9042bcfdecb5382e7d5d28106fe455", "score": "0.6585448", "text": "function handleErrors() {\r\n window.alert('Произошла, ошибка:', error);\r\n console.log('Error:', JSON.stringify(response), status, error);\r\n }", "title": "" }, { "docid": "112c48cd78adb7f1d3ccd2aa9bcd94f2", "score": "0.6584109", "text": "function errh(msg, exc) {\n\t console.log(\"Error message is: \" + msg +\n\t\t\t \" - Error Details: \" + dwr.util.toDescriptiveString(exc, 2));\n\t}", "title": "" }, { "docid": "f12810881559894637d04b300922d992", "score": "0.6575439", "text": "function displayError()\n\t{\n\t\tfor (var i=0; i<arguments.length; i++)\n\t\t{\n\t\t\tdisplayMessage(\"ERROR in FileOpener: \" + arguments[i], false);\n\t\t}\t\n\t}", "title": "" }, { "docid": "17f034acf6d80fb8353e25de7bcd1f08", "score": "0.65742743", "text": "function showError(error)\n{\n\tvar x=document.getElementById(\"results\");\n\tswitch(error.code) \n\t{\n\t\tcase error.PERMISSION_DENIED:\n\t\t x.innerHTML=\"Vous avez refus&eacute; l&rsquo;acc&egrave;s &agrave; la G&eacute;olocalisation.\"\n\t\t break;\n\t\tcase error.POSITION_UNAVAILABLE:\n\t\t x.innerHTML=\"G&eacute;olocalisation indisponible, veuillez regarder dans l&rsquo;aide ou activer le service dans les reglages de votre appareil.\"\n\t\t break;\n\t\tcase error.TIMEOUT:\n\t\t x.innerHTML=\"La demande de G&eacute;olocalisation a expir&eacute;(user location request timed out).\"\n\t\t break;\n\t\tcase error.UNKNOWN_ERROR:\n\t\t x.innerHTML=\"Erreur inconnue de G&eacute;olocalisation (unknown error occurred).\"\n\t\t break;\n\t}\n}", "title": "" }, { "docid": "768d28b7e69ea2713ad43ae5fd0f39fa", "score": "0.65742296", "text": "function demo3() {\n\n\n try {\n demo()\n }\n catch (error) {\n\n console.log(\"pls check function....\", error.name)\n console.log(\"pls check function....\", error.message)\n document.getElementById(\"error\").innerHTML = error.message\n }\n\n\n}", "title": "" }, { "docid": "895f55fe0fcc84a9d9317de215e55d8c", "score": "0.65631497", "text": "function errback(err) {\n\t\trdbAdmin.showErrorMessage('<pre>'+err[0] + ':' + err[1]+'</pre>');\n\t}", "title": "" }, { "docid": "8750a55b343d38fbda92d6bfdcd69b37", "score": "0.6562256", "text": "function messageFailed(error) {\n __result2 = error.name;\n}", "title": "" }, { "docid": "7bc7d2e8b908c665ccb223baf9d74f90", "score": "0.6558757", "text": "_error(err) {\n // Hide loading\n this._loading(false);\n if (!err.message) return;\n this.refs['popup'].getWrappedInstance().show(err.message);\n }", "title": "" }, { "docid": "1f24180e2d4bc1f13238d0553a79fd9f", "score": "0.65556", "text": "function errorAlertPost(error) {\n notify.onError({\n title: \"Gulp postCSS\",\n subtitle: \"Algo esta mal en tu CSS!\",\n sound: \"Basso\"\n })(error);\n console.log(error.toString());\n this.emit(\"end\");\n}", "title": "" }, { "docid": "36779fcb729b41a80dddaee320d1087c", "score": "0.65461254", "text": "function showErrorInvalidMethod(){\n var prom = ezBSAlert({\n type: \"alert\",\n messageText: \"Neipravan url!\",\n alertType: \"san-blue\"\n });\n \n}", "title": "" }, { "docid": "e15c21652f139530215d853fd6f10486", "score": "0.6543768", "text": "function serveError(res, info) { res.send(\"Oops! Please inform your supervisor that- \" + info); \t}", "title": "" }, { "docid": "013866e1176e3d47ef191f0892b35aff", "score": "0.65430015", "text": "function fotoFail(message) {\n _mensaje(\"¡Oops!\",message,\"Entendido\",\"\");\n }", "title": "" }, { "docid": "fcd66a1ae24e8814d2d71b4d5ddced56", "score": "0.6540539", "text": "function alertErrorMsg(s){ errorAlert.html('<i class=\"fa fa-warning\"></i> ' + s).show(); }", "title": "" }, { "docid": "00c5e8241c8de95749987531de7f9ef7", "score": "0.6538727", "text": "error (message, stay = false, config = {}) {\n this.toast('error', message, config, stay)\n }", "title": "" } ]
dae36d598a5a280c1cef17b2fa158496
Attempts to determine the type of sort based on the URL
[ { "docid": "ca2786cd3aa111137313696719d065b0", "score": "0.6882061", "text": "function checkURL() {\n // Try URL first\n var param = loc.search;\n\n if (param) {\n // Most Recent: ?sk=h_chr\n // Top Stories: ?sk=h_nor\n\n // Not currently sorted by most recent\n if (param.indexOf('sk=h_chr') === -1) {\n changeSort();\n }\n\n // Successfully determined sort\n return true;\n }\n else {\n param = loc.pathname.replace(/^\\//, '');\n\n if (param && param.length) {\n // We're not on the home page, so sorting is not applicable\n return true;\n }\n }\n\n // Failed to determine sort via URL\n return false;\n }", "title": "" } ]
[ { "docid": "a7bd22045679cc6fa1c6ff3ee02e6e7e", "score": "0.59649795", "text": "handleSort(type, order) {\n switch(type) {\n case 'Departs':\n case 'Arrives':\n this.sortByTime(type, order);\n break;\n case 'MainCabinPrice':\n case 'FirstClassPrice':\n this.sortByPrice(type, order);\n break;\n default: break;\n }\n }", "title": "" }, { "docid": "d681f761ad59e6438407517063047027", "score": "0.59613425", "text": "function sortByType(a, b){\n var typeA = a.type;\n var typeB = b.type;\n\n if (typeA <= typeB){ //sorting \"dir\" type before \"file\" type\n return -1; \n }else{\n return 1;\n }\n}", "title": "" }, { "docid": "28c511b212e3431f0f7412587ddcec9b", "score": "0.5866227", "text": "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}", "title": "" }, { "docid": "aaf6877b877f71ff29fa43c7ae480db4", "score": "0.5857207", "text": "sort(type) {\n const { getSortBy, batmanListings, supermanListings} = this.props;\n getSortBy({ type, batmanListings, supermanListings });\n }", "title": "" }, { "docid": "71c506ce119caada1e08027e71149474", "score": "0.58275276", "text": "sort(events, urls, sortBy, isAscending) {\n if (sortBy === \"date\") {\n this.sortArrays(events, urls, \"startDate\", isAscending);\n } else if (sortBy === \"title\") {\n this.sortArrays(events, urls, \"name\", isAscending);\n } else if (sortBy === \"organization\") {\n this.sortArrays(events, urls, \"organization\", isAscending);\n } \n }", "title": "" }, { "docid": "a1e3bcb0ec33c45f9072e35c619d6541", "score": "0.5771989", "text": "function sort() {\n let val = document.getElementById('sort').value\n if (val === 'title') {\n sortByTitle()\n } else if (val === 'author') {\n sortByAuthor()\n } else if (val === 'genre') {\n sortByGenre()\n } else if (val === 'pages') {\n sortByPages()\n } else {\n sortByCreationDate()\n }\n}", "title": "" }, { "docid": "5ff0fd87581e37bdf4497ab03489a72e", "score": "0.57552516", "text": "function sortByTypeHandler() {\n let sorted = sortByType(myData);\n showData(sorted, document.getElementById(\"display\"));\n}", "title": "" }, { "docid": "771ce8611182a0c8ef34260d451a8f28", "score": "0.57147735", "text": "function sort_path()\n {\n var path=window.location+\"\";\n path= path.split('?')[0];\n a=path.split('#');\n b=a[0];\n if(a.length>0)\n b=path.split('#')[1];\n c=b.split('/');\n sec=b.split('/')[0];\n if(sec==\"project\")\n sec=c[0]+'/'+c[1];\n var sort_by=$('.sort.selected').text();\n //~ $('.starred starred_count').addClass('open'); \n var order=$('.asc-desc.selected').children('span').attr('class');\n window.location=\"#\"+sec+'?sort_by='+sort_by+'&order='+order;\n }", "title": "" }, { "docid": "54046a93b81e8070f1d6e8de3aad4eb5", "score": "0.5669286", "text": "function getSortMethod(aimArray){\n // to got sort option\n var sortMethod=$(\"#sortByPrice\").find(\"option:selected\").text();\n\n if(sortMethod==\"Price: low-high\"){\n orderLowtoHigh(aimArray);\n }else if(sortMethod==\"Price: high-low\"){\n orderHightoLow(aimArray);\n }\n}", "title": "" }, { "docid": "f4931779421b7d06012d0d01a2266644", "score": "0.56619483", "text": "function ewrpt_Sort(e, url) {\n\tvar newUrl = url\n\tif (e.ctrlKey)\n\t\tnewUrl += \"&ctrl=1\";\n\tlocation = newUrl;\n\treturn true;\n}", "title": "" }, { "docid": "96571a54dfcdaaf78a2eefbcd8699329", "score": "0.5643313", "text": "async function TopologicalSort(){}", "title": "" }, { "docid": "3b6bd65b36d998b6980fcf0040954e8d", "score": "0.56190586", "text": "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}", "title": "" }, { "docid": "0f51942521f6109e3b85bdb2ce0c32b6", "score": "0.5603176", "text": "function getSortMethod(columnName)\r\n{\r\n function compareNumericalDesc(x,y) { return y-x; }\r\n function compareNumericalAsc(x,y) { return x-y; }\r\n function compareString(x,y) { return (x==y) ? 0 : (y<x) ? 1 : -1; }\r\n \r\n function preprocessUsingHash(hash) { return function(cellText) { return hash[cellText]; }; }\r\n function integerize(cellText) { return parseInt(cellText, 10); }\r\n function uppercase(cellText) { return cellText.toUpperCase(); }\r\n\r\n var hashes = \r\n {\r\n \"Sev\" : { \"blo\":7, \"cri\":6, \"maj\":5, \"nor\":4, \"min\":3, \"tri\":2, \"enh\":1 }, // BMO's sane order\r\n \"Status\" : { \"UNCO\":7, \"NEW\":6, \"ASSI\":5, \"REOP\":4, \"RESO\":3, \"VERI\":2, \"CLOS\":1 }, // BMO's sane order\r\n \"Resolution\": { \"\":7, \"FIXE\":6, \"INVA\":5, \"WONT\":4, \"DUPL\":3, \"WORK\":2, \"MOVE\":1 } // BMO's weird order\r\n };\r\n\r\n\r\n switch(columnName) {\r\n\r\n case \"Sev\":\r\n case \"Status\":\r\n case \"Resolution\":\r\n return { preprocess: preprocessUsingHash(hashes[columnName]), compare: compareNumericalDesc };\r\n\r\n case \"Votes\":\r\n // bugs with the most votes first\r\n return { preprocess: integerize, compare: compareNumericalDesc };\r\n \r\n case \"ID\":\r\n // oldest bugs first\r\n return { preprocess: integerize, compare: compareNumericalAsc };\r\n\r\n default:\r\n // case-insensitive, alphabetical\r\n return { preprocess: uppercase, compare: compareString};\r\n\r\n }\r\n\r\n //also dates! maybe skip those, because the server has more information about dates than it gives us?\r\n}", "title": "" }, { "docid": "1d049058be973bcc1e2308e31eb95a15", "score": "0.5592254", "text": "function getUrl(type, param, sortParam) {\n if (('mirrorSettingsKey' in config) && config.mirror != SettingsService.get(config.mirrorSettingsKey)) {\n config.mirror = SettingsService.get(config.mirrorSettingsKey);\n }\n var url = config.mirror + config.endpoints[type];\n // does provider supports search sorting?\n var sortPart = (typeof sortParam !== 'undefined') ? sortParam.split('.') : [];\n if (typeof sortParam !== 'undefined' && 'orderby' in config && sortPart.length == 2 && sortPart[0] in config.orderby && sortPart[1] in config.orderby[sortPart[0]]) {\n url = url.replace('%o', config.orderby[sortPart[0]][sortPart[1]]);\n }\n return url.replace('%s', encodeURIComponent(param));\n }", "title": "" }, { "docid": "9779c7ea7737adabbcceec6b7fb1af77", "score": "0.55813074", "text": "function sortBySeedsDescending() {\n var url = window.location.href,\n searchPattern = /(\\/[0-9]+\\/)(99)(\\/[0-9])+/,\n browsePattern = /browse\\/[0-9]+$/;\n if (url.match(searchPattern)) {\n var newUrl = url.replace(searchPattern, \"$17$3\");\n window.location.replace(newUrl);\n } else if (url.match(browsePattern)) {\n var newUrl = url + \"/0/7/0\";\n window.location.replace(newUrl);\n }\n }", "title": "" }, { "docid": "a40d9e98b1a3824478db2ab6b5cdb814", "score": "0.5559933", "text": "function SortChoice(products,Sort){\n switch(Sort){\n case \"price-asc\":\n return sortby_price(products,true);\n case \"price-desc\":\n return sortby_price(products,false);\n case \"date-asc\":\n return sortby_date(products,true);\n case \"date-desc\":\n return sortby_date(products,false);\n default :\n return products;\n }\n \n}", "title": "" }, { "docid": "e03a0ec230b37e049707d7d6e54ddb76", "score": "0.55463165", "text": "function sortByType(data) {\n // take isolated copy keep the reference safe\n let sortedByType = data.slice();\n return sortedByType.sort(function (a, b) {\n //make case insensitive compare\n if (a.type.toLowerCase() < b.type.toLowerCase()) {\n return -1;\n } else {\n return 1;\n }\n });\n}", "title": "" }, { "docid": "2114968d5343fc73a61c591692a4a0a9", "score": "0.5540104", "text": "function keywords_sort(sorting_method) {\n var checkbox = document.querySelector('.admin-panel-keywords-keywords-checkbox');\n //If it is an english localization, we don't need to show it, because it is a default localization.\n var current_sorting_method = document.querySelector('#'+sorting_method);\n //href equals to url.\n window.location.href = ((checkbox.dataset.localization === \"en\") ? \"\" : \n \"/ru\")+\"/admin/keywords/\"+current_sorting_method.id+\"_\"+current_sorting_method.dataset.sorting_mode;\n }", "title": "" }, { "docid": "e695d350ed05f93225d204bfa16412a5", "score": "0.55181926", "text": "handleSort(e){\n let sorter = e.target.innerHTML.toLowerCase()\n switch(sorter) {\n case 'percentage':\n sorter = 'percent'\n break\n case 'user':\n sorter = 'name'\n break\n case 'words':\n sorter = 'numWords'\n break\n default:\n break\n }\n //TODO: fix weird sorting bug\n this.props.store.setSorter(sorter)\n }", "title": "" }, { "docid": "19108199d95c07b75a5f57948a6fe4f1", "score": "0.5515235", "text": "function changeSort() {\n window.location.href = loc.origin + '/?sk=h_chr';\n }", "title": "" }, { "docid": "db5b4961e525074d56f19022575e6cb3", "score": "0.5492626", "text": "function sortTable(type) {\r\n let data = window.value.data;\r\n data = sortData(data, type);\r\n populateDataSource(data);\r\n}", "title": "" }, { "docid": "86b17fb9406fe38379fbe9d93a6a5023", "score": "0.5471489", "text": "function castNumberToString(pageNumber?: number | string): string {\n if (typeof pageNumber === 'number') {\n return String(pageNumber);\n }\n\n if (typeof pageNumber === 'string') {\n return pageNumber;\n }\n\n if (\n typeof pageNumber !== 'string' ||\n typeof pageNumber !== 'number'\n ) {\n throw new Error('Unexpected page number type');\n }\n\n throw new Error(`Unable to cast ${pageNumber} to string`);\n}\n\n/**\n * Determine the category number from an category name ('movies', 'audio', etc)\n */\nfunction resolveCategory(categoryParam: number | string, defaultCategory: number): number {\n if (typeof categoryParam === 'number') {\n return categoryParam;\n }\n\n if (typeof categoryParam === 'string') {\n if (categoryParam in primaryCategoryNumbers) {\n return primaryCategoryNumbers[categoryParam];\n }\n }\n\n return defaultCategory;\n}\n\nexport function search(title: string = '*', opts: Object = {}) {\n const convertedCategory = resolveCategory(opts.category, parseInt(searchDefaults.category, 10));\n\n const castedOptions = {\n ...opts,\n page: opts.page ? castNumberToString(opts.page) : searchDefaults.page,\n category: opts.category ? castNumberToString(convertedCategory) : searchDefaults.category,\n orderby: opts.orderby ? castNumberToString(opts.orderby) : searchDefaults.orderBy\n };\n\n const {\n page,\n category,\n orderBy,\n sortBy,\n ...rest\n } = { ...searchDefaults, ...castedOptions };\n\n const orderingNumber = convertOrderByObject({ orderBy, sortBy });\n\n const url = `${baseUrl}/s/?${querystring.stringify({\n q: title,\n category,\n page,\n orderby: orderingNumber\n })}`;\n\n return parsePage(url, parseResults, rest.filter, null, null, opts.proxyList || searchDefaults.proxyList);\n}\n\nexport function getTorrent(id: string | number | { link: string }) {\n const url = (() => {\n if (typeof id === 'object') {\n return id.link;\n }\n return typeof id === 'number' || /^\\d+$/.test(id)\n ? `${baseUrl}/torrent/${id}`\n // If id is an object return it's link property. Otherwise,\n // return 'id' itself\n : id;\n })();\n\n return parsePage(url, parseTorrentPage);\n}", "title": "" }, { "docid": "9ebcc8c8cff995d2848a401b1ea38e80", "score": "0.5458406", "text": "function sort(typeOfSort, brands) {\n if(typeOfSort=='price-asc'){\n Object.keys(brands).forEach((brand, i) => {\n brands[brand].sort(price_asc);\n });}\n else if (typeOfSort=='price-desc'){\n Object.keys(brands).forEach((brand, i) => {\n brands[brand].sort(price_desc);\n });}\n else if (typeOfSort=='date-asc'){\n Object.keys(brands).forEach((brand, i) => {\n brands[brand].sort(date_asc);\n });}\n else if (typeOfSort=='date-desc'){\n Object.keys(brands).forEach((brand, i) => {\n brands[brand].sort(date_desc);\n });}\n return brands;\n}", "title": "" }, { "docid": "2fe725d8203f71091fac4225de253197", "score": "0.54528964", "text": "function getUrlType(url) {\n if (url.startsWith('magnet:')) {\n return 'magnet';\n }\n if (url.startsWith('ed2k:')) {\n return 'ed2k';\n }\n return '';\n}", "title": "" }, { "docid": "f7b430ce1126edfe7068f4a7086039cc", "score": "0.54459614", "text": "sortProductByCheapest () {\n this.params.sort = 'cheapest'\n this.submitting = { ...this.submitting, dropshipProducts: true, sortStatus: true }\n let params = this.generateParamsUrl()\n Router.replace(`/dropship?${params}`)\n this.props.getDropshipProducts(this.params)\n }", "title": "" }, { "docid": "5c103ac489b76898781f0a20eb736f61", "score": "0.5444522", "text": "function findSort(){\n if(!started){\n startSort();\n }\n\n if(done)\n return;\n\n randomizeButton.disabled = true;\n\n let decision = sortSelector.value;\n switch(decision){\n case \"Selection\":\n selectionSort();\n break;\n case \"Quick\":\n quicksort();\n break;\n case \"Bubble\":\n bubblesort();\n break;\n case \"Insertion\":\n insertionSort();\n break;\n case \"Merge\":\n mergeSort();\n break;\n case \"Heap\":\n heapSort();\n break;\n case \"Bogo\":\n bogoSort();\n break;\n }\n\n \n}", "title": "" }, { "docid": "02454a5c0e98468c93645bef3aee7119", "score": "0.5423044", "text": "function setpagetype(WHATURL) {\r\n if (WHATURL.match(/torrents\\.php\\?id=\\d+/)) PAGETYPE = \"album\";\r\n else if (WHATURL.match(/artist\\.php/)) PAGETYPE = \"artist\";\r\n else if (WHATURL.match(/torrents\\.php/)) PAGETYPE = \"search\";\r\n else if (WHATURL.match(/collage\\.php/)) PAGETYPE = \"collage\";\r\n}", "title": "" }, { "docid": "3b79c053e1ababfb67b1dd3e0b99ae1f", "score": "0.541694", "text": "function typeComparator( auto1, auto2){\n /* your code here*/\n var types = ['wagon', 'suv', 'pickup', 'roadster'];\n type1 = types.indexOf(auto1.type.toLowerCase());\n type2 = types.indexOf(auto2.type.toLowerCase());\n\n if (type1 > type2) {\n return true;\n } else if (type1 == type2) {\n return yearComparator(auto1, auto2); \n } else\n return false;\n}", "title": "" }, { "docid": "794501138ac5f255545b9bac5d47db70", "score": "0.5409317", "text": "function sortFunc(sort){\n switch(sort){\n case \"name\":\n sortByName()\n break\n case \"age\":\n sortByAge()\n break\n default:\n console.log(\"sort does not match any cases\")\n }\n }", "title": "" }, { "docid": "5e0d5dd862d3e6bc88d2df80fa349bde", "score": "0.5351718", "text": "function sortedCustom(param) {\n setFlag(flag + 1);\n let a = request;\n\n if (param == \"Date\") {\n a.sort(comparisonByDate);\n setRequests(a);\n } else if (param == \"Priority\") {\n a.sort(comparisonByPriority);\n setRequests(a);\n } else if (param == \"Distance\") {\n a.sort(comparisonByDistance);\n setRequests(a);\n }\n }", "title": "" }, { "docid": "e2a2e474ccf071a276bc34d827d84ec7", "score": "0.5351115", "text": "function changeSortingTypeOfListingHeaders(target)\n{\n\t$('table.listing, table.listingDis, table.small_table', $('#'+target)).not('.sortingTypeVerified').each(function()\n\t{\t\n\t\tvar table = this;\n\t\tvar rowLen = $('tr', this).length;\n\t\tif(rowLen < 20 && rowLen > 2) \n\t\t{\n\t\t\t$('tr:first th', this).each(function()\n\t\t\t{\n\t\t\t\t//check class asc or desc if exists return no need to continue \n\t\t\t\tif($('a', this).length <= 0)\n\t\t\t\t\treturn;\n\t\t\t\tvar anchorHref = $('a', this).attr('href');\t\n\t\t\t\tif(anchorHref.indexOf('direction:desc') > 0)\n\t\t\t\t\treturn;\n\t\t\t\tvar colIndex = $(this).index();\n\t\t\t\tvar cells = [], sortedCells = [];\n\t\t\t\t$('tr td:nth-child('+(colIndex + 1)+')', table).each(function() {\n\t\t\t\t\tvar colText = $(this).text();\n\t\t\t\t\tcells.push(colText); // save column text into an array\n\t\t\t\t\tsortedCells.push(colText);\n\t\t\t\t});\n\t\t\t\tsortedCells.sort(function(a,b) { // do case insensitive sort\n\t\t\t\t\tvar a = a.toLowerCase(), b = b.toLowerCase();\n\t\t\t\t\tif( a == b) return 0; if( a > b) return 1; return -1;\n\t\t\t\t});\n\t\t\t\tif(arraysEqual(cells, sortedCells)) { //check defalut column text with manual sorted text\n\t\t\t\t\t//if it is equal make it desc order\n\t\t\t\t\tanchorHref = anchorHref.replace(\"direction:asc\",\"direction:desc\"); \n\t\t\t\t\t$('a', this).attr('href', anchorHref);\n\t\t\t\t}\t\t\t\n\t\t\t});\n\t\t}\n\t\t$(this).addClass('sortingTypeVerified');// add verified class to avoid the same process again on next ajax call\n\t});\t\n}", "title": "" }, { "docid": "d734501a3286f62a9a09a59fab6edb8d", "score": "0.5317289", "text": "function sortByFunc() {\n switch (sortBy.field) {\n case 'name':\n case 'ticker':\n if (sortBy.desc === 0) {\n return (a, b) => a[sortBy.field].localeCompare(b[sortBy.field])\n }\n return (a, b) => b[sortBy.field].localeCompare(a[sortBy.field])\n case 'price':\n case 'changes':\n case 'marketCapitalization':\n default:\n if (sortBy.desc === 0) {\n return (a, b) => (a[sortBy.field] - b[sortBy.field])\n }\n return (a, b) => (b[sortBy.field] - a[sortBy.field])\n }\n }", "title": "" }, { "docid": "048e4328684d1f9c1c27a04799058e84", "score": "0.5298363", "text": "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}", "title": "" }, { "docid": "ef83cd23c510383bd306f0012c7a6de4", "score": "0.52896017", "text": "function laodPLMSortColumn(action, url, processHandler)\r\n{\r\n\t//alert('calling the new sort function');\r\n\tcloseMsgBox();\r\n\tvar htmlAreaObj = _getWorkAreaDefaultObj();\r\n var objAjax = htmlAreaObj.getHTMLAjax();\r\n var objHTMLData = htmlAreaObj.getHTMLDataObj();\r\n\tif(objAjax)\r\n {\r\n objAjax.setActionURL(action);\r\n objAjax.setActionMethod(url);\r\n objAjax.setProcessHandler(processHandler);\r\n objAjax.sendRequest();\r\n \r\n if(objAjax.isProcessComplete())\r\n \t{\r\n \tobjHTMLData.resetChangeFields();\r\n \t}\r\n }\r\n\t\r\n}", "title": "" }, { "docid": "d6b27b47db91b8653f642fcdc0c61039", "score": "0.52724534", "text": "function clickedColumnSorter(aTableRow, bTableRow, type) {\n\t\tvar aContent = getFirstTextFromCell(aTableRow, columnIndex).toLowerCase();\n\t\tvar bContent = getFirstTextFromCell(bTableRow, columnIndex).toLowerCase();\n\n\t\tvar aExtractedContent = numericStringTools.extractNumbersIfPresent(aContent);\n\t\tvar bExtractedContent = numericStringTools.extractNumbersIfPresent(bContent);\n\n\t\tif (type === 'time') {\n\t\t\tvar now = new Date();\n\n\t\t\tvar aFullDate = now.toDateString() + ' ' + aContent.slice(0, 5) + ' ' + aContent.slice(-2);\n\t\t\tvar bFullDate = now.toDateString() + ' ' + bContent.slice(0, 5) + ' ' + bContent.slice(-2);\n\n\t\t\taExtractedContent = Date.parse(aFullDate);\n\t\t\tbExtractedContent = Date.parse(bFullDate);\n\t\t}\n\t\tvar directionComparer = shouldSortAscending ? ascendingComparer : descendingComparer;\n\n\t\treturn comparer(directionComparer, aExtractedContent, bExtractedContent);\n\t}", "title": "" }, { "docid": "13f6fc79546ce894c73ffd8d8456fdf7", "score": "0.526856", "text": "function getSortMethod(stpGuid, stpName, cbfn) {\r\n log(\r\n \"getSortMethod(\" +\r\n stpGuid +\r\n \",\" +\r\n stpName +\r\n \",\" +\r\n (cbfn ? \"defined function\" : \"null\") +\r\n \")\"\r\n );\r\n //sortQuery = _spPageContextInfo.siteAbsoluteUrl + \"/_api/web/lists/GetByTitle('Subtopic%20Sort')/items?$select=Subtopic,Sort_x0020_Method&$filter=TaxCatchAll/IdForTerm eq '\" + stpGuid + \"'\";\r\n sortQuery =\r\n _spPageContextInfo.siteAbsoluteUrl +\r\n \"/_api/web/lists/GetByTitle('Accordion%20Sort')/items?$select=TopicOrSubtopic,SortMethod&$filter=TaxCatchAll/IdForTerm eq '\" +\r\n stpGuid +\r\n \"'\";\r\n var subtopicSortMethod = \"\";\r\n var nullVal = \"Title asc\";\r\n var newSubtopicTermLabel = \"\";\r\n var ret = \"\";\r\n //if(cbfn == null) {\r\n //$.ajaxSetup({async: false});\r\n //}\r\n $.ajax({\r\n url: sortQuery,\r\n type: \"GET\",\r\n headers: {\r\n accept: \"application/json;odata=verbose\"\r\n },\r\n success: function(data) {\r\n log(data);\r\n if (data.d.results.length == 0) {\r\n if (cbfn != null) {\r\n cbfn(nullVal);\r\n } else {\r\n log(\r\n \"getSortMethod(\" +\r\n stpGuid +\r\n \",\" +\r\n stpName +\r\n \",\" +\r\n (cbfn ? \"defined function\" : \"null\") +\r\n \") returning \" +\r\n nullVal\r\n );\r\n ret = nullVal;\r\n }\r\n } else {\r\n $.each(data.d.results, function(index, item) {\r\n //Assign sort method to variable and send back to callback\r\n if (stpGuid) {\r\n //subtopicSortMethod = item.Sort_x0020_Method;\r\n subtopicSortMethod = item.SortMethod;\r\n //return sort method to callback func\r\n if (cbfn != null) {\r\n if (subtopicSortMethod) {\r\n cbfn(subtopicSortMethod);\r\n }\r\n } else {\r\n if (subtopicSortMethod) {\r\n log(\r\n \"getSortMethod(\" +\r\n stpGuid +\r\n \",\" +\r\n stpName +\r\n \",\" +\r\n (cbfn ? \"defined function\" : \"null\") +\r\n \") returning \" +\r\n subtopicSortMethod\r\n );\r\n ret = subtopicSortMethod;\r\n }\r\n }\r\n }\r\n });\r\n }\r\n }\r\n });\r\n //if(cbfn == null) {\r\n //$.ajaxSetup({async: true});\r\n //return ret;\r\n //}\r\n }", "title": "" }, { "docid": "aca640ea93f856e11fe63b1ec3610166", "score": "0.5249661", "text": "setSortType(type) {\n this.sortType = type;\n }", "title": "" }, { "docid": "09eb0da4fd1b22c1e62ef2c79a6d17d1", "score": "0.5246067", "text": "function pageSort ( a, b ) {\n return pageTypeOrder[a.type] - pageTypeOrder[b.type];\n}", "title": "" }, { "docid": "d0b26bc6727209811012f36f6d08c651", "score": "0.5243457", "text": "function typeComparator( auto1, auto2){\n /* your code here*/\n var type1 = auto1.type.toLowerCase();\n var type2 = auto2.type.toLowerCase();\n \n switch (type1) {\n \tcase 'roadster': type1 = 4;\n \tbreak;\n case 'pickup': type1 = 3;\n \tbreak;\n case 'suv': type1 = 2;\n \tbreak;\n case 'wagon': type1 = 1;\n \tbreak;\n default: type1 = 0;\n \tbreak;\n }\n \n switch (type2) {\n \tcase 'roadster': type2 = 4;\n \tbreak;\n case 'pickup': type2 = 3;\n \tbreak;\n case 'suv': type2 = 2;\n \tbreak;\n case 'wagon': type2 = 1;\n \tbreak;\n default: type2 = 0;\n \tbreak;\n }\n \n if (type1 < type2) {\n \treturn true;\n }\n else if (type1 > type2) {\n \treturn false;\n }\n else {\n \tif (yearComparator(auto1, auto2)) {\n \treturn true;\n }\n else\n \treturn false;\n }\n \n}", "title": "" }, { "docid": "ee153118bc7202e805ac1dfd2dfc9d83", "score": "0.52251476", "text": "function bindSort(obj, sortByID, sortOrderID, actionTypeID, fnCallback) {\r\n\r\n\r\n var sortby = ($(obj).attr(\"sortby\"));\r\n var previouseSortBy = $(\"#\" + sortByID).val();\r\n var sortOrder = $(\"#\" + sortOrderID).val();\r\n\r\n if (sortby == previouseSortBy) {\r\n if (sortOrder == '0') {\r\n $(\"#\" + sortOrderID).val(\"1\");\r\n $(obj).addClass(\"desc\");\r\n }\r\n else {\r\n $(\"#\" + sortOrderID).val(\"0\");\r\n $(obj).addClass(\"asc\");\r\n }\r\n $(\"#\" + sortByID).val(sortby);\r\n }\r\n else {\r\n $(\"#\" + sortOrderID).val(\"1\");\r\n $(\"#\" + sortByID).val(sortby);\r\n }\r\n $(\"#\" + actionTypeID).val(\"sortList\");\r\n //$(\"#currentPage\").val(\"1\");\r\n fnCallback();\r\n\r\n}", "title": "" }, { "docid": "422fe7176b198da4e124bdc1a37f77f9", "score": "0.5220449", "text": "static getInstance(type, vals) {\r\n let abstractSorter;\r\n switch(type) {\r\n case \"insert_sort\":\r\n abstractSorter = new InsertSort([...vals], new PrintStorage());\r\n break;\r\n case \"quick_sort\":\r\n abstractSorter = new QuickSort([...vals], new PrintStorage());\r\n break;\r\n case \"heap_sort\":\r\n abstractSorter = new HeapSort([...vals], new PrintStorage());\r\n break;\r\n }\r\n\r\n return abstractSorter;\r\n }", "title": "" }, { "docid": "4e676f393889bd79a8cbc257f4c708e9", "score": "0.5208347", "text": "get sortingOrder() {}", "title": "" }, { "docid": "082b9c7d33e1d7d10e6b7727224e5368", "score": "0.52000725", "text": "function _alphaNumSort(m,n) {\n var a = m.url.toLowerCase()\n var b = n.url.toLowerCase()\n if (a === b) { return 0 }\n if (isNaN(m) || isNaN(n)) { return (a > b ? 1 : -1) }\n else { return m-n }\n }", "title": "" }, { "docid": "9b2297b5159a4f1bb953a1426acdbdb5", "score": "0.51979655", "text": "function sortFromOption(){\n // console.log(\"sortFromOption\");\n getSortMethod(nowArray);\n pageNumber = 1;\n changeDisplayAmount(displayType,1);\n}", "title": "" }, { "docid": "6a660f78c217dcf550ce83af78bc533e", "score": "0.51898026", "text": "applySorting(by, type) {\n this.projectController.applySorting(by, type);\n }", "title": "" }, { "docid": "a33385846aa9cc75e7df248537ccc94b", "score": "0.5185729", "text": "filterByDate(type) {\n if (this.order === \"ASC\" && type === \"DESC\") {\n this.list = this.list.sort(this._dateDifDESC.bind(this));\n } else if (this.order === \"DESC\" && type === \"ASC\") {\n this.list = this.list.sort(this._dateDifASC.bind(this));\n }\n }", "title": "" }, { "docid": "a16761345f6421c9e3987c8040495cc3", "score": "0.51834893", "text": "function sort() {\r\n\t// Set the and filter strings\r\n\tsortString = $('#page_sort').val();\r\n\tfilterString = $('#page_filter').val();\r\n\r\n\t// Remove current thumbnails from DOM\r\n\tclearThumbnails();\r\n\t\r\n\t// Display updated thumbnails\r\n\tdisplayThumbnails();\r\n\t\r\n\tissorting = true;\r\n}", "title": "" }, { "docid": "b6870bed3e9389b8b4bd71ae2b200f29", "score": "0.5180704", "text": "function sort(direction, type, field) {\n return (data) => {\n const copy = [].concat(data);\n copy.sort((type === 'alphanum' ? alphanumSort : numericSort)(direction, field));\n assert.deepEqual(data, copy);\n };\n }", "title": "" }, { "docid": "08c149339d9f3a4d864537667542e4f3", "score": "0.51761645", "text": "function sortBy(srtValue, srtOrder){\n pageData = sortObjectBy(pageData,srtValue,srtOrder);\n checkSelected();\n pagination(max);\n}", "title": "" }, { "docid": "6dc7f004ebb77d763cd88cd28946ffd0", "score": "0.51754826", "text": "sortProductByExpensive () {\n this.params.sort = 'expensive'\n this.submitting = { ...this.submitting, dropshipProducts: true, sortStatus: true }\n let params = this.generateParamsUrl()\n Router.replace(`/dropship?${params}`)\n this.props.getDropshipProducts(this.params)\n }", "title": "" }, { "docid": "e9482a2ed0d5efe1b592fa99c356eab3", "score": "0.5165029", "text": "function validateSort(sort) {\n if (typeof sort !== 'string') {\n return false;\n }\n\n return sorts.includes(sort);\n}", "title": "" }, { "docid": "90b5b14e2f65646c2ea9a4c2b03d9e53", "score": "0.5163574", "text": "fetchAvailableSort(e) {\n e.preventDefault();\n let cursource = e.target.getAttribute('value');\n if (!cursource) {\n cursource = e.target.value;\n }\n // fix source name\n const sourceName = this.toTitleCase(cursource.toString());\n const sources = JSON.parse(localStorage.sources);\n const sourceNode = sources.filter(obj => obj.id === cursource);\n HeadlineAction.getHeadlines(cursource, '');\n this.setState({\n sources,\n source: cursource,\n articleSource: sourceName,\n sortBy: (sourceNode[0].sortBysAvailable.length > 1) ?\n sourceNode[0].sortBysAvailable : [],\n });\n }", "title": "" }, { "docid": "8385a8300df181bbefe9232466aa0d5f", "score": "0.514906", "text": "function sort(direction, type, field) {\n return (data) => {\n const copy = [].concat(data);\n copy.sort((type === 'alphanum' ? alphanumSort : numericSort)(direction, field));\n assert.deepEqual(data, copy);\n };\n }", "title": "" }, { "docid": "97fcc9328f26534631a823564ccbeb73", "score": "0.5132477", "text": "function sortChanged(){\n\tconst url2 = url+`&q=${name.val()}&t=${type.val()}&color=${color.val()}&s=${sort.val()}`;\n\tloadData(url2, displayData);\n}", "title": "" }, { "docid": "295a23b0dc4c82cc2d7560860b10e1f0", "score": "0.51296633", "text": "function typeComparator( auto1, auto2){\n //let's first assign a value to each known type\n var carTypeValues = {\"roadster\":1, \"pickup\":2, \"suv\":3, \"wagon\":4};\n var carType1 = carTypeValues[auto1.type.toLowerCase()];\n var carType2 = carTypeValues[auto2.type.toLowerCase()];\n\n //catch any types not covered in carTypeValues map\n if (carType1 === undefined) carType1 = 5;\n if (carType2 === undefined) carType2 = 5;\n\n var ret;\n if (carType1 === carType2) {\n //if the types are the same, then we have to use the model year to determine superiority\n //put auto2 first to sort such that a higher year is first\n ret = exComparator(auto2.year, auto1.year);\n } else {\n //otherwise, use those values (1-5) instead of the string literal as the basis for comparison\n ret = exComparator(carType1, carType2);\n }\n\n return ret;\n\n //I referenced this stack overflow query for ideas on sorting based on arbitrary values\n //https://stackoverflow.com/questions/42276580/how-to-sort-an-array-based-on-arbitrary-object-values\n}", "title": "" }, { "docid": "70897f6c7778784868d63b9edc655107", "score": "0.51026773", "text": "function sortOrder(_, t) {\n if (t.kind === \"array\") {\n return \" array\";\n }\n else if (t.kind === \"double\") {\n return \" xdouble\";\n }\n else if (t.isPrimitive()) {\n return \" \" + t.kind;\n }\n return t.kind;\n }", "title": "" }, { "docid": "b5e114e24eabecc076ab418f9eaafa9b", "score": "0.51014", "text": "function storage() {\n if (sortFilter != null) {\n if (sortFilter === \"Shortest\") {\n runtimeSort(0)\n // $(\"#sort-btn\").text(\"Shortest\")\n }\n else if (sortFilter === \"Longest\") {\n runtimeSort(1)\n // $(\"#sort-btn\").text(\"Longest\")\n }\n }\n }", "title": "" }, { "docid": "2a027dacdc4d4041bb7a3849008fbb7a", "score": "0.5096803", "text": "function sortMethodList(type) {\n var methods = vm.allClasses[vm.selectedClass.key].methods;\n switch (type) {\n case constants.sortMessage.default:\n vm.sortMessage = constants.sortMessage.default;\n ref.once(\"value\", handleDataUpdate);\n break;\n case constants.sortMessage.a:\n vm.sortMessage = constants.sortMessage.a;\n vm.allClasses[vm.selectedClass.key].methods = helperFactory.sortList(methods, constants.sortMessage.a);\n break;\n case constants.sortMessage.d:\n vm.sortMessage = constants.sortMessage.d;\n vm.allClasses[vm.selectedClass.key].methods = helperFactory.sortList(methods, constants.sortMessage.d);\n break;\n default:\n break;\n }\n }", "title": "" }, { "docid": "c1b178906f7973fed6376c33c222353b", "score": "0.5093987", "text": "function urlType(url) {\n\t\tif (/(\\.mp3(?!\\w)|\\.ogg(?!\\w)|\\.wav(?!\\w)|#audio$)/.test(url))\n\t\t\treturn \"audio\";\n\t\tif (/(\\.mp4(?!\\w)|#video$)/.test(url))\n\t\t\treturn \"video\";\n\t\treturn \"image\";\n\t}", "title": "" }, { "docid": "54c50ecf00e417bebfedaf9264c060a5", "score": "0.50919086", "text": "function typeComparator( auto1, auto2){\r\nvar car1 = auto1.type.toUpperCase();\r\nvar car2 = auto2.type.toUpperCase();\r\n if(car1 === \"ROADSTER\"){ \r\n if(car2 === \"ROADSTER\"){ \r\n \treturn yearComparator(auto1, auto2);\r\n }else{\r\n return false;\r\n }\r\n \r\n }\r\n else if(car1 === \"PICKUP\"){ \r\n\t\tif(car2 === \"ROADSTER\"){ \r\n return true;\r\n }\r\n else if(car2 === \"PICKUP\"){ \r\n return yearComparator( auto1, auto2);\r\n }else{\r\n return false;\r\n }\r\n }\r\n \r\n else if(car1 === \"SUV\"){ \r\n\t\tif(car2 === \"ROADSTER\" || car2 === \"PICKUP\"){ \r\n return true;\r\n }\r\n else if(car2 === \"SUV\"){ \r\n return yearComparator( auto1, auto2);\r\n }else{\r\n return false;\r\n }\r\n }\r\n \r\n else if(car1 === \"WAGON\"){ \r\n\t\tif(car2 === \"ROADSTER\" || car2 === \"PICKUP\" || car2 === \"SUV\"){ \r\n return true;\r\n }\r\n else if(car2 === \"WAGON\"){ \r\n return yearComparator( auto1, auto2);\r\n }else{\r\n return false;\r\n }\r\n } \r\n\t\t\r\n else{\r\n\t\tif(car2 === \"ROADSTER\" || car2 === \"PICKUP\" || car2 === \"SUV\" || car2 === \"WAGON\"){ \r\n return true;\r\n }\r\n else if(car1 === car2){ \r\n return yearComparator( auto1, auto2);\r\n }\r\n\r\n \r\n\t}\r\n}", "title": "" }, { "docid": "4d9761bab787c643e94033f040481fa1", "score": "0.5091211", "text": "table_sorter_custom_ajax (table, url) {\n var obj = table.config.pager.ajaxObject;\n var page = table.config.pager.page;\n var pageLength = table.config.pager.size;\n var sort = [];\n var filter = [];\n var key, data, item;\n var dir=\"\";\n var titan_report=this.titan_report;\n var sortListTemp=table.config.sortList;\n var dataObj =this.titan_report.data_object;\n\n for (item in table.config.sortList) {\n\n key = table.config.sortList[item][0];\n data = table.config.sortList[item][1];\n if(this.titan_report.m.new_columns) { //columns may have changed use that set\n for(var index in this.titan_report.m.new_columns) {\n dir=\"\";\n if(data===1) dir=\"DESC\";\n if(data===0) dir=\"ASC\";\n if(key===parseInt(index)) sort.push([this.titan_report.m.new_columns[index].name, dir]);\n }\n } else { //use origonal column set\n for(index in method.columns) {\n dir=\"\";\n if(data===1) dir=\"DESC\";\n if(data===0) dir=\"ASC\";\n if(key===parseInt(index)) sort.push([this.titan_report.m.columns[index].name, dir]);\n }\n }\n }\n \n for (item in table.config.lastSearch) {\n key = item;\n data = table.config.lastSearch[item];\n if (data.trim() === \"\") continue;\n if(this.titan_report.m.new_columns) {\n for(index in this.titan_report.m.new_columns) {\n if(key===index) filter.push([this.titan_report.m.new_columns[index].name, data]);\n }\n }else {\n for(index in this.titan_report.m.columns) {\n if(key===index) filter.push([this.titan_report.m.columns[index].name, data]);\n }\n }\n }\n \n if(this.titan_report.data_object.parameterless === false) {\n this.titan_report.data_object.parameters = {};\n $('[id^='+this.titan_report.instance+'Titan_Parameter_]').each(function () {\n titan_report.data_object.parameters[this.id] = this.value;\n });\n }\n\n this.titan_report.data_object.aggregates = {};\n /*$('[id^=Titan_Aggregate_]').each(function () {\n if(this.checked) titan_report.data_object.aggregates[this.id] = this.checked;\n });*/\n \n this.titan_report.data_object.aggregates = {};\n this.titan_report.data_object.parameters['multi_search']=$(\"#\"+this.titan_report.instance+\"_\"+\"multi_search\").val();\n dataObj.page = page;\n dataObj.pageLength = pageLength;\n dataObj.sort = sort;\n dataObj.filters = filter;\n obj.data = JSON.stringify(dataObj);\n table.config.pager.ajaxObject = obj; //?\n return url;\n }", "title": "" }, { "docid": "d4bd6656ce8fc987d367e7cb45bff940", "score": "0.50750494", "text": "get overrideSorting() {}", "title": "" }, { "docid": "39b4a3bfe259c7778c9e0ef9b8c31d3e", "score": "0.50703186", "text": "isSortingRequired() {\n const entriesType = this.getEntriesType();\n const { isSortingRequired = false } = this.props.state.entries[entriesType];\n\n return isSortingRequired;\n }", "title": "" }, { "docid": "7ba857a91ad82311867d0588d282fefe", "score": "0.50675166", "text": "sort(v) {\n const query = pickBy({...this.$route.query, sort: v}, identity);\n this.$router.replace({query});\n }", "title": "" }, { "docid": "1e78f19432bd782af9f6b906d5e70d86", "score": "0.50534666", "text": "function sortViewList() {\n var primarySort = document.getElementsByTagName(\"select\")[0].value;\n var hierarchy = [];\n if (primarySort === \"name\") { //hierarchy: name > category > price\n hierarchy = [\"name\", \"category\", \"price\"];\n } else if (primarySort === \"price\") { //hierarchy: price > name > category\n hierarchy = [\"price\", \"name\", \"category\"];\n } else if (primarySort === \"category\") { //hierarchy: category > name > price\n hierarchy = [\"category\", \"name\", \"price\"];\n }\n itemViewList = mergeSort(itemViewList, hierarchy);\n}", "title": "" }, { "docid": "794ed1f0ae3044c74807fe8409d7600f", "score": "0.5047845", "text": "function getComparer(typeOfSelector){\n\tvar comparer;\n\tswitch(typeOfSelector){\n\t\tcase \"class\":{\t\t\t\n\t\t\tcomparer = getClass;\t\t\t\n\t\t\tbreak;\n\t\t}\n\t\tcase \"id\":{\n\t\t\tcomparer = getId;\n\t\t\tbreak;\n\t\t}\t\t\t\n\t\tcase \"simple\":{\n\t\t\tcomparer = getTagName;\n\t\t\tbreak;\n\t\t}\n\t\tdefault:{\n\t\t\talert(\"This is not an acceptable selector\");\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\treturn comparer;\n}", "title": "" }, { "docid": "08808da3548a594d4dd575b31f0ee9d2", "score": "0.50223863", "text": "_fetchSearchParam() {\n const column = this.meta._columns.find(column => column.defaultSort)\n\n const sort = this.sortCondition || (column && `${column.slot},desc` || 'id,desc')\n console.log(sort)\n\n let _param = {\n page: this.page - 1,\n size: this.size,\n sort,\n ...this.queryParams,\n ...this.extraParams,\n ...this.filters\n }\n\n if (this.enterFromRoute && this.$route) {\n const {meta: {searchParams}} = this.$route\n if (searchParams) {\n Object.entries(searchParams).forEach(([k, v]) => {\n const searchItem = this.meta._searchItems.find(item => item.key === k)\n if (searchItem) {\n const {type, modelType, tree, resourcePath, primaryKeyType} = searchItem\n if (Types.isString(type)) {\n if (_param[k] === undefined) _param[`${k}.contains`] = v\n this.$nextTick(() => {\n this.$refs.search.setValue(k, v)\n })\n } else if (Types.isBoolean(type)) {\n if (_param[k] === undefined) _param[`${k}.equals`] = Boolean(v)\n this.$nextTick(() => {\n this.$refs.search.setValue(k, Boolean(v))\n })\n } else if (Types.isDecimal(type)) {\n const value = _.split(v, ',', 2).map(value => Number(v))\n if (_param[k] === undefined) {\n _param[`${k}.greaterOrEqualThan`] = value[0]\n _param[`${k}.lessThan`] = value[1]\n }\n this.$nextTick(() => {\n this.$refs.search.setValue(k, value)\n })\n } else if (Types.isModel(type)) {\n if (Types.isCommonOrSuperModel(type, modelType)) {\n if (tree) {\n let _rest = new Rest(resourcePath, this.$apiURL)\n _rest.GET({\n uri: `tree`,\n params: {level: 10}\n }).then((res) => {\n const arr = copyObjectRenameAttrInArrRecursive({\n src: res,\n correspondence: {_instanceName: 'label', id: 'value', _children: 'children'}\n })\n if (_param[k] === undefined) _param[`${k}.in`] = arr\n this.$nextTick(() => {\n this.$refs.search.$refs[`${k}Item`].pullOptions(this.meta._searchItems.find(searchItem => searchItem.key === k))\n this.$refs.search.setValue(k, arr)\n })\n })\n } else {\n if (_param[k] === undefined) _param[`${k}.in`] = v\n this.$nextTick(() => {\n this.$refs.search.$refs[`${k}Item`].pluginData(this.meta._searchItems.find(searchItem => searchItem.key === k), v)\n if (primaryKeyType === 'Long') {\n this.$refs.search.setValue(k, Number(v))\n } else {\n this.$refs.search.setValue(k, v)\n }\n })\n }\n } else {\n let value\n if (v.includes(',')) {\n value = _.split(v, ',')\n } else {\n value = v\n }\n if (_param[k] === undefined) _param[`${k}.in`] = value\n this.$nextTick(() => {\n this.$refs.search.setValue(k, value)\n })\n }\n } else if (Types.isDateType(type)) {\n if (_param[k] === undefined) {\n if (v.includes(',')) {\n const value = _.split(v, ',', 2)\n _param[`${k}.greaterOrEqualThan`] = value[0]\n _param[`${k}.lessThan`] = value[1]\n\n this.$nextTick(() => {\n this.$refs.search.setValue(k, [new Date(Date.parse(value[0].replace(/-/g, '/'))), new Date(Date.parse(value[1].replace(/-/g, '/')))])\n })\n }\n }\n }\n }\n })\n }\n }\n return _param\n }", "title": "" }, { "docid": "ec11b5c372c87395b712aef43ea8b7f4", "score": "0.5019919", "text": "function validateDefaultSortBy(part, path) {\n if (_.has(part, 'defaultSortBy')) {\n if (typeof part.defaultSortBy !== 'object') {\n errors.push(`defaultSortBy in ${path.join('.')} has incorrect format, must be an object`);\n } else {\n _.each(part.defaultSortBy, (val, key) => {\n if (val !== -1 && val !== 1) {\n errors.push(\n `defaultSortBy in ${path.join('.')} has incorrect format, the sorting order must be either 1 or -1`\n );\n }\n if (!_.has(part.fields, key) && key !== '_id') {\n errors.push(`defaultSortBy in ${path.join('.')} refers to nonexisting field \"${key}\"`);\n }\n });\n }\n }\n }", "title": "" }, { "docid": "e5f0c9ee3e0cd634dab1c17c92f3ff60", "score": "0.5018639", "text": "processSortItemsByTask() {\n // IF WE ARE CURRENTLY INCREASING BY TASK SWITCH TO DECREASING\n if (window.todo.model.isCurrentItemSortCriteria(ItemSortCriteria.SORT_BY_TASK_INCREASING)) {\n window.todo.model.sortTasks(ItemSortCriteria.SORT_BY_TASK_DECREASING);\n }\n // ALL OTHER CASES SORT BY INCREASING\n else {\n window.todo.model.sortTasks(ItemSortCriteria.SORT_BY_TASK_INCREASING);\n }\n }", "title": "" }, { "docid": "fca3c215a3dcdb741e4f359117f61ff3", "score": "0.50130373", "text": "function filterByTypeAndSortDesc(sortingParameter) {\n let fileTypeList = imageLibrary.files;\n if (sortingParameter === \"kronologisk\") {\n fileTypeList = fileTypeList\n .filter((file) => file.type !== \"nyhet\");\n } else {\n fileTypeList = fileTypeList\n .filter((file) => file.type === sortingParameter);\n }\n return sortByYearDescending(fileTypeList);\n}", "title": "" }, { "docid": "9e48710d271ab9c30f61988e817461e1", "score": "0.5002412", "text": "sort() {\n //Check is sort is present\n if(this.queryStr.sort){\n //Handling multiple sorting paramters\n const sortBy = this.queryStr.sort.split(',').join(' ');\n this.query = this.query.sort(sortBy);\n }else{\n //Incase no paramters are specified \n //Sort based on posting date in descreasing order\n this.query = this.query.sort('-postingDate');\n }\n\n return this;\n }", "title": "" }, { "docid": "7b535560eed1033d838b26985d3aa509", "score": "0.4989571", "text": "processSortItemsByStatus() {\n // IF WE ARE CURRENTLY INCREASING BY STATUS SWITCH TO DECREASING\n if (window.todo.model.isCurrentItemSortCriteria(ItemSortCriteria.SORT_BY_STATUS_INCREASING)) {\n window.todo.model.sortTasks(ItemSortCriteria.SORT_BY_STATUS_DECREASING);\n }\n // ALL OTHER CASES SORT BY INCRASING\n else {\n window.todo.model.sortTasks(ItemSortCriteria.SORT_BY_STATUS_INCREASING);\n }\n }", "title": "" }, { "docid": "c5cd5c4fb49a753bccf3763648f84d49", "score": "0.4987352", "text": "function Sort() {}", "title": "" }, { "docid": "5da4319b399d38ca01198e5ef1e5f8c1", "score": "0.49835578", "text": "function getSortedHomepage(sortingMethod, callback) {\n // Load reddit.com/{sortingMethod}.json and call back with the array of posts\n // Check if the sorting method is valid based on the various Reddit sorting methods\n requestAsJson('https://reddit.com/' + sortingMethod + '.json', function(err, res) {\n if (err) {\n console.log(\"error here getSortedHomepage\" + err);\n }\n else {\n try {\n var parsedSortedHomepage = JSON.parse(res.body);\n //console.log(parsedSortedHomepage.data.children);\n callback(null, parsedSortedHomepage.data.children);\n }\n catch (err) {\n console.log(\"huge error here getsortedhomepage\");\n }\n }\n });\n}", "title": "" }, { "docid": "3f11ec7520256ae8900a3951ad8969a2", "score": "0.49804792", "text": "function initialSort() {\n var column, direction;\n column = $j('#paginationSort').val() || '';\n column = column.match(/none/) ? '' : column;\n direction = ($j('#paginationSortOrder').val() || '').match(/desc|false/) ? desc : asc\n return { column: column, direction: direction };\n }", "title": "" }, { "docid": "29d044a64cff1f025dae0dba55d3985f", "score": "0.4979033", "text": "function getSortFunc(opts, desc) {\n const options = opts || {};\n\n const type = options.type;\n const comparator = options.comparator;\n const byValue = options.byValue;\n\n return function (pair1, pair2) {\n const sortBy = byValue ? 'value' : 'key';\n let p1 = pair1[sortBy];\n let p2 = pair2[sortBy];\n let retValue;\n\n if (comparator) {\n retValue = comparator(p1, p2);\n } else {\n if (type) {\n p1 = type(p1);\n p2 = type(p2);\n }\n\n if (p1 < p2) {\n retValue = -1;\n } else if (p1 > p2) {\n retValue = 1;\n } else {\n retValue = 0;\n }\n }\n\n if (desc) {\n retValue *= -1;\n }\n\n return retValue;\n };\n }", "title": "" }, { "docid": "3219bd996f8d80228feb0576519ec961", "score": "0.49556124", "text": "function sortPosts(basedOn, order, upper, lower) {\n \n fetch(urlSortPosts, {\n method: \"POST\",\n headers: {\n 'Accept': 'application/json',\n 'content-type': 'application/json',\n 'Authorization': ('Bearer ' + JSON.parse(localStorage.token))\n },\n body: JSON.stringify({\n \"basedOn\": basedOn,\n \"order\": order,\n \"upper\": upper,\n \"lower\": lower\n })\n }).then(function (res) {\n if (res.ok) {\n res.json().then(function (data) {\n resetTokenHome();\n getSortedPosts(data.response);\n console.log(\"Inside res.ok. Sorted Posts retrieved\");\n }.bind(this));\n }\n else {\n alert(\"Error: sorting of posts unsuccessful!\");\n if (res.status == '403') {\n window.location.href = \"./inactive.html\";\n }\n res.json().then(function (data) {\n console.log(data.message);\n }.bind(this));\n }\n }).catch(function (err) {\n alert(\"Error: No internet connection!\");\n console.log(err.message + \": No Internet Connection\");\n });\n\n}", "title": "" }, { "docid": "a037ee5b08702abeaa1e15b9b2f46d8a", "score": "0.49488777", "text": "function savesort(sortby) {\n var sortbyparam = '?sort='+sortby;\n history.pushState(null, '', sortbyparam);\n}", "title": "" }, { "docid": "5d147a9ce08f43e6a8f497f878aad070", "score": "0.49455795", "text": "dynamicSort(property) {\n var sortOrder = 1;\n //check for \"-\" operator and sort asc/desc depending on that\n if (property[0] === \"-\") {\n sortOrder = -1;\n property = property.substr(1);\n }\n return function (a, b) {\n var result =\n a[property] < b[property] ? -1 : a[property] > b[property] ? 1 : 0;\n return result * sortOrder;\n };\n }", "title": "" }, { "docid": "7e97515857ff355244fd0f1408ec8249", "score": "0.49370515", "text": "function appSort(sorter, sign){\n return function (a, b) {\n if ((a.star === true) && (b.star !== true)) {\n return -1;\n }\n if ((a.star !== true) && (b.star === true)) {\n return 1;\n }\n var nameA=a[sorter].toLowerCase(), nameB=b[sorter].toLowerCase();\n switch (sorter.toLowerCase()) {\n case 'status':\n const statMap = {bid: 0, nextround: 1, pending: 2, cut: 4};\n nameA = nameA.replace(/\\s+/g, '');\n nameB = nameB.replace(/\\s+/g, '');\n if (statMap[nameA] < statMap[nameB])\n return -1 * sign;\n if (statMap[nameA] > statMap[nameB])\n return 1 * sign;\n return 0;\n case 'year':\n const yearMap = {freshman: 0, sophomore: 1, junior: 2, senior: 4};\n if (yearMap[nameA] < yearMap[nameB])\n return -1 * sign;\n if (yearMap[nameA] > yearMap[nameB])\n return 1 * sign;\n return 0;\n default:\n if (nameA < nameB)\n return -1 * sign;\n if (nameA > nameB)\n return 1 * sign;\n return 0;\n }\n }\n}", "title": "" }, { "docid": "e56c4e5a0bec29a699ea50d0c65e68b7", "score": "0.49354765", "text": "function sort(button) {\n var type = button.id;\n /*console.log(type);*/\n switch (type) {\n case 'Bubble Sort':\n console.log('Bubble Sort');\n bubbleSort(arr);\n console.log(arr);\n break;\n case 'Selection Sort':\n console.log('Selection Sort');\n selectionSort(arr);\n console.log(arr);\n break;\n case 'Insertion Sort':\n console.log('Insertion Sort');\n insertionSort(arr);\n console.log(arr);\n break;\n case 'Merge Sort':\n console.log('Merge Sort');\n mergeSort(arr);\n console.log(arr);\n break;\n case 'Quick Sort':\n console.log('Quick Sort');\n quickSort(arr);\n console.log(arr);\n break;\n default:\n return false;\n }\n}", "title": "" }, { "docid": "5dec9c3f971690b81895a4056a20e10b", "score": "0.49307758", "text": "getSortFunction() {\n var low_to_high = function (a, b) {return a.duration - b.duration};\n var high_to_low = function (a, b) {return b.duration - a.duration};\n if(this.state.selected_sort === 'High To Low'){\n return high_to_low\n }\n else if(this.state.selected_sort === 'Low To High'){\n return low_to_high\n }\n else {\n return null\n }\n }", "title": "" }, { "docid": "5c78dc5c675915dd4042f82d3c6950c0", "score": "0.49296567", "text": "function validateDefaultSortBy(part, path, errors) {\n if (!_.has(part, 'defaultSortBy')) {\n return;\n }\n\n if (typeof part.defaultSortBy !== 'object') {\n return errors.push(`defaultSortBy in ${path.join('.')} has incorrect format, must be an object`);\n }\n\n _.each(part.defaultSortBy, (val, key) => {\n if (val !== -1 && val !== 1) {\n errors.push(\n `defaultSortBy in ${path.join('.')} has incorrect format, the sorting order must be either 1 or -1`\n );\n }\n\n if (part.type !== 'Grid') {\n const hasNonExistingField = !_.has(part.fields, key) && key !== '_id';\n if (hasNonExistingField) {\n errors.push(`defaultSortBy in ${path.join('.')} refers to nonexisting field \"${key}\"`);\n }\n }\n });\n }", "title": "" }, { "docid": "0d4c52a92522d5c86d59c8ba5b1119dc", "score": "0.4920486", "text": "queryToURL({query, page, sort, desc}){\n const order = sort === 'best'\n ? 'data'\n : sort === 'date'\n ? 'data'\n : sort\n\n const by = desc ? 'DESC' : 'ASC'\n return `http://rarbg.to/torrents.php?search=${encodeURIComponent(query)}&order=${order}&by=${by}`\n }", "title": "" }, { "docid": "f856b169deba1fbde6043f60c19371fb", "score": "0.49188018", "text": "function finalurl() {\n var url = new URL(window.location.href);\n var search_params = url.searchParams;\n search_params.set('sorting', document.getElementById(\"sort-list\").value);\n url.search = search_params.toString();\n var new_url = url.toString();\n return new_url\n }", "title": "" }, { "docid": "8e1fe9c59f5ed80a8fe2aef4051ee091", "score": "0.49143195", "text": "function getSortMethod(){\n var _args = Array.prototype.slice.call(arguments);\n return function(a, b){\n for(var x in _args){\n var ax = a[_args[x].substring(1)];\n var bx = b[_args[x].substring(1)];\n var cx;\n\n ax = typeof ax == \"string\" ? ax.toLowerCase() : ax / 1;\n bx = typeof bx == \"string\" ? bx.toLowerCase() : bx / 1;\n\n if(_args[x].substring(0,1) == \"-\"){cx = ax; ax = bx; bx = cx;}\n if(ax != bx){return ax < bx ? -1 : 1;}\n }\n }\n}", "title": "" }, { "docid": "350e841c6c89f99ad21de9f81e8c01f9", "score": "0.49142265", "text": "function sortSelector(event) {\n event.preventDefault();\n if ($(\".select-field\").val() == 1) {\n var sortOrder = \"asc\";\n var functionArray = currentSongResults[0];\n var sortedResultsObj = _.orderBy(functionArray, [\"title\"], [sortOrder]);\n var track = sortedResultsObj.map(createListing);\n node.append(track);\n playEventListener(track);\n\n } else if ($(\".select-field\").val() == 2) {\n var sortOrder = \"desc\";\n var functionArray = currentSongResults[0];\n var sortedResultsObj = _.orderBy(functionArray, [\"title\"], [sortOrder]);\n var track = sortedResultsObj.map(createListing);\n node.append(track);\n playEventListener(track);\n };\n}", "title": "" }, { "docid": "cac3326aa57a0c97759c3bab6c1064ec", "score": "0.4906794", "text": "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}", "title": "" }, { "docid": "22dd5dab795488eacb4225dfb93276e3", "score": "0.49065453", "text": "sortTrips (type) {\n this.sortType = type\n const sortedTrips = this.mergeSort(this.allMyTrips)\n this.allMyTrips = sortedTrips\n }", "title": "" }, { "docid": "31ae96c83d9cf4c86054d4eee0cf74d6", "score": "0.49001268", "text": "function GetEraSortType(current_window) \r\n\t{\r\n\t\tif (current_window.era_rc != null && current_window.era_rc[\"SortBy\"] != null) \r\n\t\t{\r\n\t\t\t\treturn current_window.era_rc[\"SortBy\"];\r\n\t\t} \r\n\t\t\r\n\t\treturn 'Rank';\r\n\t}", "title": "" }, { "docid": "0edea2b15b81ccf9f1a19a7d6b5dc1c1", "score": "0.48958474", "text": "buildRequestUrl(search, filter, sort, page) {\n let requestUrl;\n\n if (search === \"\" && filter === \"\" && sort === \"\") {\n // no searchInput, no filterInput, no sortInput\n requestUrl = `${apiUrl}/products?page=${page}`;\n\n } else if (search !== \"\" && filter !== \"\" && sort !== \"\") {\n // searchInput, filterInput, sortInput - all\n requestUrl = `${apiUrl}/products?q=${search}&category_id=${filter}&sort=${sort}&page=${page}`;\n\n } else if (search !== \"\" && filter === \"\" && sort === \"\") {\n // searchInput only\n requestUrl = `${apiUrl}/products?q=${search}&page=${page}`;\n\n } else if (search === \"\" && filter !== \"\" && sort === \"\") {\n // filterInput only\n requestUrl = `${apiUrl}/products?category_id=${filter}&page=${page}`;\n\n } else if (search === \"\" && filter === \"\" && sort !== \"\") {\n // sortInput only\n requestUrl = `${apiUrl}/products?sort=${sort}&page=${page}`;\n\n } else if (search !== \"\" && filter !== \"\" && sort === \"\") {\n // searchInput and filterInput\n requestUrl = `${apiUrl}/products?q=${search}&category_id=${filter}&page=${page}`;\n\n } else if (search !== \"\" && filter === \"\" && sort !== \"\") {\n // searchInput and sortInput\n requestUrl = `${apiUrl}/products?q=${search}&sort=${sort}&page=${page}`;\n\n } else if (search === \"\" && filter !== \"\" && sort !== \"\") {\n // filterInput and sortInput\n requestUrl = `${apiUrl}/products?category_id=${filter}&sort=${sort}&page=${page}`;\n }\n \n return requestUrl;\n }", "title": "" }, { "docid": "94c00bb9b6d6259948c2b69a73ca9f1d", "score": "0.48922628", "text": "function getPageType(page) {\n\t\tlogTrace('invoking getPageType($)', page);\n\n\t\t// remove trailing slash\n\t\tpage = page.replace(/\\/$/, '');\n\n\t\tswitch (page) {\n\n\t\t\tcase '':\n\t\t\t\treturn 'frontpage';\n\n\t\t\tcase '/directory':\n\t\t\t\treturn 'categories';\n\n\t\t\tcase '/directory/all':\n\t\t\t\treturn 'channels';\n\n\t\t\tcase '/directory/gaming':\n\t\t\tcase '/directory/irl':\n\t\t\tcase '/directory/music':\n\t\t\tcase '/directory/creative':\n\t\t\t\treturn 'explore';\n\n\t\t\tcase '/directory/following':\n\t\t\tcase '/directory/following/live':\n\t\t\tcase '/directory/following/videos':\n\t\t\tcase '/directory/following/hosts':\n\t\t\tcase '/directory/following/games':\n\t\t\t\treturn 'following';\n\n\t\t\tcase '/directory/following/channels':\n\t\t\t\treturn null;\n\n\t\t\tdefault:\n\n\t\t\t\t// order of checks matters!\n\t\t\t\tif (RegExp('^/directory/.+').test(page) === true) {\n\n\t\t\t\t\tif (page.indexOf('/all/tags/') >= 0) {\n\n\t\t\t\t\t\treturn 'channels';\n\t\t\t\t\t}\n\n\t\t\t\t\tif (page.indexOf('/tags/') >= 0) {\n\n\t\t\t\t\t\treturn 'categories';\n\t\t\t\t\t}\n\n\t\t\t\t\tif (page.indexOf('/videos/') >= 0) {\n\n\t\t\t\t\t\treturn 'videos';\n\t\t\t\t\t}\n\n\t\t\t\t\tif (page.indexOf('/clips') >= 0) {\n\n\t\t\t\t\t\treturn 'clips';\n\t\t\t\t\t}\n\n\t\t\t\t\tif (page.indexOf('/game/') >= 0) {\n\n\t\t\t\t\t\treturn 'game';\n\t\t\t\t\t}\n\n\t\t\t\t\tif (page.indexOf('/collection/') >= 0) {\n\n\t\t\t\t\t\treturn 'collection';\n\t\t\t\t\t}\n\n\t\t\t\t\treturn 'channels';\n\t\t\t\t}\n\t\t}\n\n\t\treturn logWarn('Unable to detect type of page:', page);\n\t}", "title": "" }, { "docid": "9a7901d8ca62f02460ce52052d58e50a", "score": "0.48877382", "text": "function sortProduct(){ \r\n\r\n var compare = document.product.filter.value;\r\n \r\n var container = document.getElementById('item-container');\r\n// if(compare == 'price') {\r\n// console.log(hats.sort(comparePrice));\r\n// } else if(compare == 'name') {\r\n// console.log(hats.sort(compareName));\r\n// }else {\r\n// console.log('Nothing selected!');\r\n// }\r\n\r\n// THE ABOVE IF/ELSE statment works as well, but I prefer to use switch statements for they are easier to read.\r\n \r\n switch(compare){\r\n case 'price':\r\n console.log(hats.sort(compareName));\r\n break;\r\n \r\n case 'name':\r\n console.log(hats.sort(comparePrice));\r\n break;\r\n \r\n default:\r\n console.log('ERROR: Code is broken somewhere');\r\n break;\r\n \r\n }\r\n \r\n event.preventDefault();\r\n}", "title": "" }, { "docid": "afd3024073e6c88ff085a6d26625f575", "score": "0.48874927", "text": "function invalidSortFunction(a, b) {\n return 'bad'\n}", "title": "" }, { "docid": "892dd87895343b3a7ef0e7301189f77d", "score": "0.48854703", "text": "function sortButtonClicked(link) {\r\n if (link === \"low-to-high\") {\r\n sortdisheslowtohigh(dishes);\r\n }\r\n else if (link == \"high-to-low\") {\r\n sortdisheshightolow(dishes);\r\n }\r\n\telse if (link== \"shuffle\"){\r\n\t\tshuffle(dishes);\r\n\t}\r\n\telse if (link== \"rating\"){\r\n\t\tsortrating(dishes);\r\n\t}\r\n showdishes(dishes);\r\n}", "title": "" }, { "docid": "5b79ee8d53f30e36ed8360b245b26e88", "score": "0.48818612", "text": "function _addNumericSort(decimalPlace) {\n $.each({\n // Plain numbers\n \"num\": function num(d) {\n return __numericReplace(d, decimalPlace);\n },\n // Formatted numbers\n \"num-fmt\": function numFmt(d) {\n return __numericReplace(d, decimalPlace, _re_formatted_numeric);\n },\n // HTML numeric\n \"html-num\": function htmlNum(d) {\n return __numericReplace(d, decimalPlace, _re_html);\n },\n // HTML numeric, formatted\n \"html-num-fmt\": function htmlNumFmt(d) {\n return __numericReplace(d, decimalPlace, _re_html, _re_formatted_numeric);\n }\n }, function (key, fn) {\n // Add the ordering method\n _ext.type.order[key + decimalPlace + '-pre'] = fn; // For HTML types add a search formatter that will strip the HTML\n\n if (key.match(/^html\\-/)) {\n _ext.type.search[key + decimalPlace] = _ext.type.search.html;\n }\n });\n } // Default sort methods", "title": "" }, { "docid": "44d4b08e99f4b5d3bce95d17659e1a34", "score": "0.48796043", "text": "function sortByCritics(id) {\n window.location.href = \"/Artist/Details/\"+String(id);\n}", "title": "" }, { "docid": "870869f92f1d1c07cdda764092576903", "score": "0.48777628", "text": "function Sort(f_list,sort){\n switch(sort){\n case 'LocationAscend':\n return f_list.sort(locationAscend);\n case 'LocationDescend':\n return f_list.sort(locationDescend);\n case 'SourceAscend':\n return f_list.sort(sourceAscend);\n case 'SourceDescend':\n return f_list.sort(sourceDescend);\n case 'TypeAscend':\n return f_list.sort(typeAscend);\n case 'TypeDescend':\n return f_list.sort(typeDescend);\n case 'ChrAscend':\n return f_list.sort(chrAscend);\n case 'ChrDescend':\n return f_list.sort(chrDescend);\n default:\n return;\n }\n}", "title": "" }, { "docid": "1aa7e86383cae5a7ba20d123b0d1acb3", "score": "0.48765528", "text": "function getAssociatedDateSorter(fieldType) {\n const FORMAT = (fieldType === FieldType.date) ? moment$1.ISO_8601 : mapMomentDateFormatWithFieldType(fieldType);\n return (value1, value2, sortDirection) => {\n if (FORMAT === moment$1.ISO_8601) {\n return compareDates(value1, value2, sortDirection, FORMAT, false);\n }\n return compareDates(value1, value2, sortDirection, FORMAT, true);\n };\n}", "title": "" }, { "docid": "6746cf13b99edbd970abfb1bfb2969fd", "score": "0.4869051", "text": "sortByPrice() {\r\n get('#app > div > div.MrQ4g > div > div._3pSVv._19-Sz.F0sHG._1eAL0 > div > div > div._1V_Pj > div.izVGc').contains('Sort by').click();\r\n get('[id^=price_asc]').click({ multiple: true, force: true });\r\n }", "title": "" } ]